Oracle Cloud Infrastructure Documentation



Displays metadata for an Oracle Cloud Infrastructure Compute instance.


Instance Metadata

For more information about instance metadata, see Getting Instance Metadata.


oci-metadata [-h] [-j] [-g key] [--help]


-h | --human-readable

Display human readable output (default).

-j | --json

Display output in JSON.

-g | --get key

Retrieve data only for the specified key.


Displays a summary of the command line options.


Getting all metadata for the instance

Running oci-metadata with no options returns all metadata for the instance:

# oci-metadata
Instance details:
Instance name: our-test-instance-20180622-1222
Region: phx - us-phoenix-1 (Phoenix, AZ, USA)
Availability Domain: cumS:PHX-AD-1
Fault domain: FAULT-DOMAIN-1
Instance shape: VM.Standard1.1
Instance created at: 2018-06-22 19:23:18 UTC
Instance state: Running
Instance OCID: ocid1.instance.oc1.phx.abcdefghijklmnopqrstuvwxyz1234567890123456789012345678901234
Compartment OCID: ocid1.compartment.oc1..abcdefghijklmnopqrstuvwxyz1234567890123456789012345678901234
Image OCID: ocid1.image.oc1.phx.aaaaaaaaxyc7rpmh3v4yyuxcdjndofxuuus4iwd7a7wjc63u2ykycojr5djq canonicalRegionName: us-phoenix-1 Networking details: Private IP address: MAC address: 00:00:17:00:F4:3F Subnet CIDR block: Virtual router IP address: VNIC OCID: ocid1.vnic.oc1.phx.abcdefghijklmnopqrstuvwxyz1234567890123456789012345678901234
VLAN tag: 1146

Getting only specific metadata

Pass in a key with the --get parameter to retrieve only the metadata for that key:

# oci-metadata --get state
Instance details:
Instance state: Running