Oracle Cloud Infrastructure Documentation

oci-metadata

Description

Displays Oracle Cloud Infrastructureinstance metadata.

Note

Instance Metadata

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

Usage

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

Options

-h | --human-readable

Display human readable output (default).

-j | --json

Display output in JSON.

-g | --get key

Retrieve only data for the specified key.

--help

Displays a summary of the command line options.

Examples

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: 10.0.0.3 MAC address: 00:00:17:00:F4:3F Subnet CIDR block: 10.0.0.0/24 Virtual router IP address: 10.0.0.1 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