Oracle Cloud Infrastructure Documentation

oci-metadata

Description

Displays metadata for an Oracle Cloud Infrastructure Compute instance.

Note

Instance Metadata

For more information about 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 data only 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:
  Display Name: my-example-instance
  Region: phx - us-phoenix-1 (Phoenix, AZ, USA)
  Canonical Region Name: us-phoenix-1
  Availability Domain: cumS:PHX-AD-1
  Fault domain: FAULT-DOMAIN-3
  OCID: ocid1.instance.oc1.phx.exampleuniqueID
  Compartment OCID: ocid.compartment.oc1..exampleuniqueID
  Instance shape: VM.Standard2.1
  Image ID: ocid1.image.oc1.phx.exampleuniqueID
  Created at: 1569529065596
  state: Running
  agentConfig:
    managementDisabled: False
    monitoringDisabled: False
  Instance Metadata:
    ssh_authorized_keys: ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEApzWsZ0DxxE+jNpsh5C3
    ncc18eZ06MCONWnP5D/8eqdGjUqqBU7lHvgaIqYHy1PH/B4w/pya56k41FLzdXFVAzCy4NGyE4XZjLcS
    SR4jW1As4r3WHY/f61Gc1Vicz39u+bB1XYaHm46zS4WrQEquqU4wbz70iwe50nSIhrGpvM5HWYOK0dsV
    A7/zzw+yW37NUGa/QeM4/bJvCVg3BVjB6VWdmV7dFwRMeCaVJFQH3wKndvuJib78zoHl9sbYm74vzqTY
    Si/bVoIz9YnZ4bA3MS0UqapoK/m2M9T27+UA/lz/ILCKXP3+vNcVcjRplanJT/qlzhLiIiBCRo4RsdGx
    UIw== rsa-key-20181129
Networking details:
  VNIC OCID: ocid1.vnic.oc1.phx.exampleuniqueID
  VLAN Tag: 2392
  Private IP address: 10.0.0.16
  MAC address: 02:00:17:03:D8:FE
  Subnet CIDR block: 10.0.0.0/24
  Virtual router IP address: 10.0.0.1

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