vsphere-automation-appliance

The Ruby gem for the vSphere Appliance API

  • API version: 2.0.0
  • Package version: 0.2.1

Installation

Add this line to your application's Gemfile:

gem 'vsphere-automation-appliance'

And then execute:

$ bundle

Or install it yourself as:

$ gem install vsphere-automation-appliance

Getting Started

Please follow the installation procedure and then run the following code:

# Load the gem
require 'vsphere-automation-appliance'

# Setup authorization
VSphereAutomation.configure do |config|
  # Configure API key authorization: api_key
  config.api_key['vmware-api-session-id'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['vmware-api-session-id'] = 'Bearer'
end

api_instance = VSphereAutomation::Appliance::AccessConsolecliApi.new

begin
  #Get enabled state of the console-based controlled CLI (TTY1).
  result = api_instance.get
  p result
rescue VSphereAutomation::ApiError => e
  puts "Exception when calling AccessConsolecliApi->get: #{e}"
end

Documentation for API Endpoints

All URIs are relative to https://<vcenter>/rest

Class Method HTTP request Description
VSphereAutomation::Appliance::AccessConsolecliApi get GET /appliance/access/consolecli Get enabled state of the console-based controlled CLI (TTY1).
VSphereAutomation::Appliance::AccessConsolecliApi set PUT /appliance/access/consolecli Set enabled state of the console-based controlled CLI (TTY1).
VSphereAutomation::Appliance::AccessDcuiApi get GET /appliance/access/dcui Get enabled state of Direct Console User Interface (DCUI TTY2).
VSphereAutomation::Appliance::AccessDcuiApi set PUT /appliance/access/dcui Set enabled state of Direct Console User Interface (DCUI TTY2).
VSphereAutomation::Appliance::AccessShellApi get GET /appliance/access/shell Get enabled state of BASH, that is, access to BASH from within the controlled CLI.
VSphereAutomation::Appliance::AccessShellApi set PUT /appliance/access/shell Set enabled state of BASH, that is, access to BASH from within the controlled CLI.
VSphereAutomation::Appliance::AccessSshApi get GET /appliance/access/ssh Get enabled state of the SSH-based controlled CLI.
VSphereAutomation::Appliance::AccessSshApi set PUT /appliance/access/ssh Set enabled state of the SSH-based controlled CLI.
VSphereAutomation::Appliance::HealthApi messages GET /appliance/health/item/messages Get health messages.
VSphereAutomation::Appliance::HealthApplmgmtApi get GET /appliance/health/applmgmt Get health status of applmgmt services.
VSphereAutomation::Appliance::HealthDatabasestorageApi get GET /appliance/health/database-storage Get database storage health.
VSphereAutomation::Appliance::HealthLoadApi get GET /appliance/health/load Get load health.
VSphereAutomation::Appliance::HealthMemApi get GET /appliance/health/mem Get memory health.
VSphereAutomation::Appliance::HealthSoftwarepackagesApi get GET /appliance/health/software-packages Get information on available software updates available in the remote vSphere Update Manager repository. Red indicates that security updates are available. Orange indicates that non-security updates are available. Green indicates that there are no updates available. Gray indicates that there was an error retreiving information on software updates.
VSphereAutomation::Appliance::HealthStorageApi get GET /appliance/health/storage Get storage health.
VSphereAutomation::Appliance::HealthSwapApi get GET /appliance/health/swap Get swap health.
VSphereAutomation::Appliance::HealthSystemApi get GET /appliance/health/system Get overall health of system.
VSphereAutomation::Appliance::HealthSystemApi lastcheck GET /appliance/health/system/lastcheck Get last check timestamp of the health of the system.
VSphereAutomation::Appliance::LocalAccountsApi create POST /appliance/local-accounts/username Create a new local user account.
VSphereAutomation::Appliance::LocalAccountsApi delete DELETE /appliance/local-accounts/username Delete a local user account.
VSphereAutomation::Appliance::LocalAccountsApi get GET /appliance/local-accounts/username Get the local user account information.
VSphereAutomation::Appliance::LocalAccountsApi list GET /appliance/local-accounts Get a list of the local user accounts.
VSphereAutomation::Appliance::LocalAccountsApi set PUT /appliance/local-accounts/username Set local user account properties.
VSphereAutomation::Appliance::LocalAccountsApi update PATCH /appliance/local-accounts/username Update selected fields in local user account properties.
VSphereAutomation::Appliance::LocalAccountsPolicyApi get GET /appliance/local-accounts/global-policy Get the global password policy.
VSphereAutomation::Appliance::LocalAccountsPolicyApi set PUT /appliance/local-accounts/global-policy Set the global password policy.
VSphereAutomation::Appliance::LoggingForwardingApi get GET /appliance/logging/forwarding Returns the configuration for forwarding log messages to remote logging servers.
VSphereAutomation::Appliance::LoggingForwardingApi set PUT /appliance/logging/forwarding Sets the configuration for forwarding log messages to remote log servers.
VSphereAutomation::Appliance::LoggingForwardingApi test POST /appliance/logging/forwarding Validates the current log forwarding configuration by checking the liveness of the remote machine and optionally sending a test diagnostic log message from the appliance to all configured logging servers to allow manual end-to-end validation. The message that is sent is: \"This is a diagnostic log test message from vCenter Server.\"
VSphereAutomation::Appliance::MonitoringApi get GET /appliance/monitoring/stat_id Get monitored item info
VSphereAutomation::Appliance::MonitoringApi list GET /appliance/monitoring Get monitored items list
VSphereAutomation::Appliance::MonitoringApi query GET /appliance/monitoring/query Get monitoring data.
VSphereAutomation::Appliance::NetworkingApi get GET /appliance/networking Get Networking information for all configured interfaces.
VSphereAutomation::Appliance::NetworkingApi reset POST /appliance/networking Reset and restarts network configuration on all interfaces, also this will renew the DHCP lease for DHCP IP address.
VSphereAutomation::Appliance::NetworkingApi update PATCH /appliance/networking Enable or Disable ipv6 on all interfaces
VSphereAutomation::Appliance::NetworkingDnsDomainsApi add POST /appliance/networking/dns/domains Add domain to DNS search domains.
VSphereAutomation::Appliance::NetworkingDnsDomainsApi list GET /appliance/networking/dns/domains Get list of DNS search domains.
VSphereAutomation::Appliance::NetworkingDnsDomainsApi set PUT /appliance/networking/dns/domains Set DNS search domains.
VSphereAutomation::Appliance::NetworkingDnsHostnameApi get GET /appliance/networking/dns/hostname Get the Fully Qualified Doman Name.
VSphereAutomation::Appliance::NetworkingDnsHostnameApi set PUT /appliance/networking/dns/hostname Set the Fully Qualified Domain Name.
VSphereAutomation::Appliance::NetworkingDnsHostnameApi test POST /appliance/networking/dns/hostname/test Test the Fully Qualified Domain Name.
VSphereAutomation::Appliance::NetworkingDnsServersApi add POST /appliance/networking/dns/servers Add a DNS server. This method fails if mode argument is \"dhcp\"
VSphereAutomation::Appliance::NetworkingDnsServersApi get GET /appliance/networking/dns/servers Get DNS server configuration.
VSphereAutomation::Appliance::NetworkingDnsServersApi set PUT /appliance/networking/dns/servers Set the DNS server configuration. If you set the mode argument to \"DHCP\", a DHCP refresh is forced.
VSphereAutomation::Appliance::NetworkingDnsServersApi test POST /appliance/networking/dns/servers/test Test if dns servers are reachable.
VSphereAutomation::Appliance::NetworkingFirewallInboundApi get GET /appliance/networking/firewall/inbound Get the ordered list of firewall rules. Within the list of traffic rules, rules are processed in order of appearance, from top to bottom. When a connection matches a firewall rule, further processing for the connection stops, and the appliance ignores any additional firewall rules you have set.
VSphereAutomation::Appliance::NetworkingFirewallInboundApi set PUT /appliance/networking/firewall/inbound Set the ordered list of firewall rules to allow or deny traffic from one or more incoming IP addresses. This overwrites the existing firewall rules and creates a new rule list. Within the list of traffic rules, rules are processed in order of appearance, from top to bottom. For example, the list of rules can be as follows:
AddressPrefixInterface NamePolicy
10.112.0.10*REJECT
10.112.0.10nic0ACCEPT
In the above example, the first rule drops all packets originating from 10.112.0.1 and
the second rule accepts all packets originating from 10.112.0.1 only on nic0. In effect, the second rule is always ignored which is not desired, hence the order has to be swapped. When a connection matches a firewall rule, further processing for the connection stops, and the appliance ignores any additional firewall rules you have set.
VSphereAutomation::Appliance::NetworkingInterfacesApi get GET /appliance/networking/interfaces/interface_name Get information about a particular network interface.
VSphereAutomation::Appliance::NetworkingInterfacesApi list GET /appliance/networking/interfaces Get list of available network interfaces, including those that are not yet configured.
VSphereAutomation::Appliance::NetworkingInterfacesIpv4Api get GET /appliance/networking/interfaces/interface_name/ipv4 Get IPv4 network configuration for specific NIC.
VSphereAutomation::Appliance::NetworkingInterfacesIpv4Api set PUT /appliance/networking/interfaces/interface_name/ipv4 Set IPv4 network configuration for specific network interface.
VSphereAutomation::Appliance::NetworkingInterfacesIpv6Api get GET /appliance/networking/interfaces/interface_name/ipv6 Get IPv6 network configuration for specific interface.
VSphereAutomation::Appliance::NetworkingInterfacesIpv6Api set PUT /appliance/networking/interfaces/interface_name/ipv6 Set IPv6 network configuration for specific interface.
VSphereAutomation::Appliance::NetworkingNoProxyApi get GET /appliance/networking/noproxy Returns servers for which no proxy configuration will be applied.
VSphereAutomation::Appliance::NetworkingNoProxyApi set PUT /appliance/networking/noproxy Sets servers for which no proxy configuration should be applied. This operation sets environment variables. In order for this operation to take effect, a logout from appliance or a service restart is required. If IPv4 is enabled, \"127.0.0.1\" and \"localhost\" will always bypass the proxy (even if they are not explicitly configured).
VSphereAutomation::Appliance::NetworkingProxyApi delete DELETE /appliance/networking/proxy/protocol Deletes a proxy configuration for a specific protocol.
VSphereAutomation::Appliance::NetworkingProxyApi get GET /appliance/networking/proxy/protocol Gets the proxy configuration for a specific protocol.
VSphereAutomation::Appliance::NetworkingProxyApi list GET /appliance/networking/proxy Gets proxy configuration for all configured protocols.
VSphereAutomation::Appliance::NetworkingProxyApi set PUT /appliance/networking/proxy/protocol Configures which proxy server to use for the specified protocol. This operation sets environment variables for using proxy. In order for this configuration to take effect a logout / service restart is required.
VSphereAutomation::Appliance::NetworkingProxyApi test POST /appliance/networking/proxy/protocol Tests a proxy configuration by testing the connection to the proxy server and test host.
VSphereAutomation::Appliance::NtpApi get GET /appliance/ntp Get the NTP configuration status. If you run the 'timesync.get' command, you can retrieve the current time synchronization method (NTP- or VMware Tools-based). The 'ntp' command always returns the NTP server information, even when the time synchronization mode is not set to NTP. If the time synchronization mode is not NTP-based, the NTP server status is displayed as down.
VSphereAutomation::Appliance::NtpApi set PUT /appliance/ntp Set NTP servers. This method updates old NTP servers from configuration and sets the input NTP servers in the configuration. If NTP based time synchronization is used internally, the NTP daemon will be restarted to reload given NTP configuration. In case NTP based time synchronization is not used, this method only replaces servers in the NTP configuration.
VSphereAutomation::Appliance::NtpApi test POST /appliance/ntp/test Test the connection to a list of ntp servers.
VSphereAutomation::Appliance::RecoveryApi get GET /appliance/recovery Gets the properties of the appliance Recovery subsystem.
VSphereAutomation::Appliance::RecoveryBackupApi validate POST /appliance/recovery/backup/validate Check for backup errors without starting backup.
VSphereAutomation::Appliance::RecoveryBackupJobApi cancel POST /appliance/recovery/backup/job/id/cancel Cancel the backup job.
VSphereAutomation::Appliance::RecoveryBackupJobApi create POST /appliance/recovery/backup/job Initiate backup.
VSphereAutomation::Appliance::RecoveryBackupJobApi get GET /appliance/recovery/backup/job/id See backup job progress/result.
VSphereAutomation::Appliance::RecoveryBackupJobApi list GET /appliance/recovery/backup/job Get list of backup jobs
VSphereAutomation::Appliance::RecoveryBackupJobDetailsApi list GET /appliance/recovery/backup/job/details Returns detailed information about the current and historical backup jobs.
VSphereAutomation::Appliance::RecoveryBackupPartsApi get GET /appliance/recovery/backup/parts/id Gets the size (in MB) of the part.
VSphereAutomation::Appliance::RecoveryBackupPartsApi list GET /appliance/recovery/backup/parts Gets a list of the backup parts.
VSphereAutomation::Appliance::RecoveryBackupSchedulesApi create POST /appliance/recovery/backup/schedules/schedule Creates a schedule
VSphereAutomation::Appliance::RecoveryBackupSchedulesApi delete DELETE /appliance/recovery/backup/schedules/schedule Deletes an existing schedule
VSphereAutomation::Appliance::RecoveryBackupSchedulesApi get GET /appliance/recovery/backup/schedules/schedule Returns an existing schedule information based on id
VSphereAutomation::Appliance::RecoveryBackupSchedulesApi list GET /appliance/recovery/backup/schedules Returns a list of existing schedules with details
VSphereAutomation::Appliance::RecoveryBackupSchedulesApi run POST /appliance/recovery/backup/schedules/schedule?action=run Initiate backup with the specified schedule
VSphereAutomation::Appliance::RecoveryBackupSchedulesApi update PUT /appliance/recovery/backup/schedules/update/schedule Updates a schedule
VSphereAutomation::Appliance::RecoveryBackupSystemNameApi list GET /appliance/recovery/backup/system-name Returns a list of system names for which backup archives exist under locSpec.
VSphereAutomation::Appliance::RecoveryBackupSystemNameArchiveApi get GET /appliance/recovery/backup/system-name/system_name/archives/archive Returns the information for backup corresponding to given backup location and system name.
VSphereAutomation::Appliance::RecoveryBackupSystemNameArchiveApi list GET /appliance/recovery/backup/system-name/system_name/archives Returns information about backup archives corresponding to given backup location and system name, which match the FilterSpec.
VSphereAutomation::Appliance::RecoveryReconciliationJobApi create POST /appliance/recovery/reconciliation/job Initiate reconciliation.
VSphereAutomation::Appliance::RecoveryReconciliationJobApi get GET /appliance/recovery/reconciliation/job Get reconciliation job progress/result.
VSphereAutomation::Appliance::RecoveryRestoreApi validate POST /appliance/recovery/restore/validate Get metadata before restore
VSphereAutomation::Appliance::RecoveryRestoreJobApi cancel POST /appliance/recovery/restore/job/cancel Cancel the restore job
VSphereAutomation::Appliance::RecoveryRestoreJobApi create POST /appliance/recovery/restore/job Initiate restore.
VSphereAutomation::Appliance::RecoveryRestoreJobApi get GET /appliance/recovery/restore/job See restore job progress/result.
VSphereAutomation::Appliance::ServicesApi get GET /appliance/services/service Returns the state of a service.
VSphereAutomation::Appliance::ServicesApi list GET /appliance/services Lists details of vCenter services.
VSphereAutomation::Appliance::ServicesApi restart POST /appliance/services/service/restart Restarts a service
VSphereAutomation::Appliance::ServicesApi start POST /appliance/services/service/start Starts a service
VSphereAutomation::Appliance::ServicesApi stop POST /appliance/services/service/stop Stops a service
VSphereAutomation::Appliance::ShutdownApi cancel POST /appliance/shutdown/cancel Cancel pending shutdown action.
VSphereAutomation::Appliance::ShutdownApi get GET /appliance/shutdown Get details about the pending shutdown action.
VSphereAutomation::Appliance::ShutdownApi poweroff POST /appliance/shutdown/poweroff Power off the appliance.
VSphereAutomation::Appliance::ShutdownApi reboot POST /appliance/shutdown/reboot Reboot the appliance.
VSphereAutomation::Appliance::SystemStorageApi list GET /appliance/system/storage Get disk to partition mapping.
VSphereAutomation::Appliance::SystemStorageApi resize POST /appliance/system/storage/resize Resize all partitions to 100 percent of disk size.
VSphereAutomation::Appliance::SystemStorageApi resize_ex POST /appliance/system/storage Resize all partitions to 100 percent of disk size.
VSphereAutomation::Appliance::SystemTimeApi get GET /appliance/system/time Get system time.
VSphereAutomation::Appliance::SystemTimeTimezoneApi get GET /appliance/system/time/timezone Get time zone.
VSphereAutomation::Appliance::SystemTimeTimezoneApi set PUT /appliance/system/time/timezone Set time zone.
VSphereAutomation::Appliance::SystemUptimeApi get GET /appliance/system/uptime Get the system uptime.
VSphereAutomation::Appliance::SystemVersionApi get GET /appliance/system/version Get the version.
VSphereAutomation::Appliance::TechpreviewMonitoringSnmpApi disable POST /appliance/techpreview/monitoring/snmp/disable Stop an enabled SNMP agent.
VSphereAutomation::Appliance::TechpreviewMonitoringSnmpApi enable POST /appliance/techpreview/monitoring/snmp/enable Start a disabled SNMP agent.
VSphereAutomation::Appliance::TechpreviewMonitoringSnmpApi get GET /appliance/techpreview/monitoring/snmp Return an SNMP agent configuration.
VSphereAutomation::Appliance::TechpreviewMonitoringSnmpApi hash POST /appliance/techpreview/monitoring/snmp/hash Generate localized keys for secure SNMPv3 communications.
VSphereAutomation::Appliance::TechpreviewMonitoringSnmpApi limits GET /appliance/techpreview/monitoring/snmp/limits Get SNMP limits information.
VSphereAutomation::Appliance::TechpreviewMonitoringSnmpApi reset POST /appliance/techpreview/monitoring/snmp/reset Restore settings to factory defaults.
VSphereAutomation::Appliance::TechpreviewMonitoringSnmpApi set PUT /appliance/techpreview/monitoring/snmp Set SNMP configuration.
VSphereAutomation::Appliance::TechpreviewMonitoringSnmpApi stats GET /appliance/techpreview/monitoring/snmp/stats Generate diagnostics report for snmp agent.
VSphereAutomation::Appliance::TechpreviewMonitoringSnmpApi test POST /appliance/techpreview/monitoring/snmp/test Send a warmStart notification to all configured traps and inform destinations (see RFC 3418).
VSphereAutomation::Appliance::TechpreviewServicesStatusApi get POST /appliance/techpreview/services/status/get Get status of a service.
VSphereAutomation::Appliance::TimesyncApi get GET /appliance/timesync Get time synchronization mode.
VSphereAutomation::Appliance::TimesyncApi set PUT /appliance/timesync Set time synchronization mode.
VSphereAutomation::Appliance::UpdateApi cancel POST /appliance/update Request the cancellation the update operation that is currently in progress.
VSphereAutomation::Appliance::UpdateApi get GET /appliance/update Gets the current status of the appliance update.
VSphereAutomation::Appliance::UpdatePendingApi get GET /appliance/update/pending/version Gets update information
VSphereAutomation::Appliance::UpdatePendingApi install POST /appliance/update/pending/version?action=install Starts operation of installing the appliance update. Will fail is the update is not staged
VSphereAutomation::Appliance::UpdatePendingApi list GET /appliance/update/pending Checks if new updates are available.
VSphereAutomation::Appliance::UpdatePendingApi precheck POST /appliance/update/pending/version Runs update precheck
VSphereAutomation::Appliance::UpdatePendingApi stage POST /appliance/update/pending/version?action=stage Starts staging the appliance update. The updates are searched for in the following order: staged, CDROM, URL
VSphereAutomation::Appliance::UpdatePendingApi stage_and_install POST /appliance/update/pending/version?action=stage-and-install Starts operation of installing the appliance update. Will stage update if not already staged The updates are searched for in the following order: staged, CDROM, URL
VSphereAutomation::Appliance::UpdatePendingApi validate POST /appliance/update/pending/version?action=validate Validates the user provided data before the update installation.
VSphereAutomation::Appliance::UpdatePolicyApi get GET /appliance/update/policy Gets the automatic update checking and staging policy.
VSphereAutomation::Appliance::UpdatePolicyApi set PUT /appliance/update/policy Sets the automatic update checking and staging policy.
VSphereAutomation::Appliance::UpdateStagedApi delete DELETE /appliance/update/staged Deletes the staged update
VSphereAutomation::Appliance::UpdateStagedApi get GET /appliance/update/staged Gets the current status of the staged update
VSphereAutomation::Appliance::VmonServiceApi get GET /appliance/vmon/service/service Returns the state of a service.
VSphereAutomation::Appliance::VmonServiceApi list_details GET /appliance/vmon/service Lists details of services managed by vMon.
VSphereAutomation::Appliance::VmonServiceApi restart POST /appliance/vmon/service/service/restart Restarts a service
VSphereAutomation::Appliance::VmonServiceApi start POST /appliance/vmon/service/service/start Starts a service
VSphereAutomation::Appliance::VmonServiceApi stop POST /appliance/vmon/service/service/stop Stops a service
VSphereAutomation::Appliance::VmonServiceApi update PATCH /appliance/vmon/service/service Updates the properties of a service.

Documentation for Models