Querying Guest Shell Information

This section contains payload examples to demonstrate how to use the NX-API REST API to control the state of the Guest Shell on the Cisco Nexus 3000 and 9000 Series switches.

For more information about the Guest Shell, see the Cisco Nexus 9000 Series NX-OS Programmability Guide:

https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-installation-and-configuration-guides-list.html/

Obtaining Guest Shell Status

Obtaining Guest Shell Status
GET http://<IP_Address>/api/mo/sys/guestshell/status.json
{
  "guestshellStatus": {
    "attributes": {
      "dn": "sys/guestshell/status",
      "lastActionStatus": "Successfully activated virtual service",
      "operState": "activated"
    }
  }
}

Note: This example was added in Cisco NX-OS Release 9.3(3).

You can subscribe the status change notification as described in the Subscribing to Query Results section of the following chapter:

https://pubhub.cisco.com/app/project/preview/2130/live/#!cisco-nexus-3000-and-9000-series-nx-api-rest-sdk-user-guide-and-api-reference-release-9-3x/accessing-the-object-data-through-rest-interfaces


guestshellStatus Properties

The following table contains information about the guestshellStatus properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.

Property NameData TypeDescriptionValues
lastActionStatusstring:Basic
Status/result of last action performed on the Guest ShellA sequence of characters
operStateguestshell:GuestShellOperState
(scalar:Enum8)
Operational state of the Guest ShellSELECTION:
0 - unknown
1 - initializing
2 - provisioned
3 - configured
4 - installing
5 - installed
6 - install-failed
7 - install-verify-failed
8 - activating
9 - activated
10 - activate-failed
11 - deactivated
12 - deactivating
13 - restarting
14 - not-installed
15 - error
DEFAULT: unknown


Related Documentation

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:

http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:

https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide:

https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Obtaining Guestshell Resource Information

Obtaining Guestshell Resource Information
GET http://<IP_Address>/api/mo/sys/guestshell/resources.json
{
  "guestshellResourceInfo": {
    "attributes": {
      "bootflashAvailable": "1025",
      "bootflashCommitted": "250",
      "bootflashQuota": "2000",
      "cpuAvailable": "19",
      "cpuCommitted": "1",
      "cpuQuota": "20",
      "cpuRequested": "1",
      "cpuUtilized": "0",
      "dn": "sys/guestshell/resources",
      "memAvailable": "5120",
      "memCommitted": "256",
      "memQuota": "5376",
      "memRequested": "256",
      "memUtilized": "31",
      "rootfsRequested": "250",
      "rootfsUtilized": "154"
    }
  }
}

Note: This example was added in Cisco NX-OS Release 9.3(3).


guestshellResourceInfo Properties

The following table contains information about the guestshellResourceInfo properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.

Property NameData TypeDescriptionValues
bootflashAvailableguestshell:BootflashResource
(scalar:Uint32)
Amount of bootflash space available beneath the quota that may be committedRANGE: [0, 4294967295]
bootflashCommittedguestshell:BootflashResource
(scalar:Uint32)
Amount of space used for rootfs and control filesRANGE: [0, 4294967295]
bootflashQuotaguestshell:BootflashResource
(scalar:Uint32)
Maximum bootflash space that may be usedRANGE: [0, 4294967295]
cpuAvailableguestshell:CpuResource
(scalar:Uint32)
Amount of CPU share beneath the quota that may be committedRANGE: [0, 4294967295]
cpuCommittedguestshell:CpuResource
(scalar:Uint32)
Current share of CPURANGE: [0, 4294967295]
cpuQuotaguestshell:CpuResource
(scalar:Uint32)
Maximum CPU share allowedRANGE: [0, 4294967295]
cpuRequestedguestshell:CpuResource
(scalar:Uint32)
Requested share of CPURANGE: [0, 4294967295]
cpuUtilizedguestshell:CpuResource
(scalar:Uint32)
Current utilization of CPU resourcesRANGE: [0, 4294967295]
memAvailableguestshell:MemoryResource
(scalar:Uint32)
Amount of memory beneath the quota that may be committedRANGE: [0, 4294967295]
memCommittedguestshell:MemoryResource
(scalar:Uint32)
Maximum amount of memory currently allowed to be usedRANGE: [0, 4294967295]
memQuotaguestshell:MemoryResource
(scalar:Uint32)
Maximum memory limit allowedRANGE: [0, 4294967295]
memRequestedguestshell:MemoryResource
(scalar:Uint32)
Requested memory limitRANGE: [0, 4294967295]
memUtilizedguestshell:MemoryResource
(scalar:Uint32)
Amount of memory in useRANGE: [0, 4294967295]
rootfsRequestedguestshell:BootflashResource
(scalar:Uint32)
Requested space for rootfsRANGE: [0, 4294967295]
rootfsUtilizedguestshell:BootflashResource
(scalar:Uint32)
Current utilization of the rootfsRANGE: [0, 4294967295]


Related Documentation

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:

http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:

https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide:

https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Obtaining Guestshell Information

Obtaining Guestshell Information
GET http://<IP_Address>/api/mo/sys/guestshell/info.json

{
  "guestshellInfo": {
    "attributes": {
      "description": "Cisco Systems Guest Shell",
      "dn": "sys/guestshell/info",
      "packageLocation": "/isanboot/bin/guestshell.ova",
      "signingKeyType": "release",
      "version": "2.6(0.0)"
    }
  }
}

Note: This example was added in Cisco NX-OS Release 9.3(3).

https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html


guestshellInfo Properties

The following table contains information about the guestshellInfo properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.

Property NameData TypeDescriptionValues
descriptionstring:Basic
Guest Shell descriptionA sequence of characters
packageLocationstring:Basic
Location of the Guest Shell package file at the time it was installedA sequence of characters
signingKeyTypeguestshell:SigningKeyType
(scalar:Enum8)
Type of key that was used to sign the Guest Shell source packageSELECTION:
0 - unknown
1 - development
2 - release
3 - unsigned
DEFAULT: unknown
versionstring:Basic
Guest Shell version numberA sequence of characters


Related Documentation

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:

http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:

https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide:

https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html