Master
Versions: Euwe / Fine / Latest /

Collection Metadata

Collection specific metadata can be queried by sending an HTTP OPTIONS request on the specific collection:

OPTIONS /api/:collection

What gets returned is the following structure:

{
  "attributes": [
  ],
  "virtual_attributes": [
  ],
  "relationships": [
  ],
  "data": {
  }
}
Entry Description

attributes

Physical attributes of the collection

virtual_attributes

Virtual attributes of the collection

relationships

Physical or Virtual associations to other resources

data

Optional meta-data for the collection

The following is an example for the groups collection:

OPTIONS /api/groups
{
  "attributes": [
    "created_on",
    "description",
    "group_type",
    "id",
    "sequence",
    "settings",
    "tenant_id",
    "updated_on"
  ],
  "virtual_attributes": [
    "allocated_memory",
    "allocated_storage",
    "allocated_vcpu",
    "custom_1",
    "custom_2",
    "custom_3",
    "custom_4",
    "custom_5",
    "custom_6",
    "custom_7",
    "custom_8",
    "custom_9",
    "miq_user_role_name",
    "provisioned_storage",
    "read_only",
    "region_description",
    "region_number",
    "user_count"
  ],
  "relationships": [
    "active_vms",
    "custom_attributes",
    "entitlement",
    "miq_custom_attributes",
    "miq_report_results",
    "miq_reports",
    "miq_templates",
    "miq_user_role",
    "miq_widget_contents",
    "miq_widget_sets",
    "taggings",
    "tags",
    "tenant",
    "users",
    "vms"
  ],
  "data": {
  }
}

Optional Metadata

Most collections do not declare additional metadata as shown by the empty data hash entry above. Optional metadata is made available as needed for API clients. They are generally used to provide additional information needed for user-interfaces, help complete or validate data for additional API calls, etc.

Currently, optional metadata is made available for the following collections:

Collection

/api/arbitration_rules

/api/container_deployments

There is no enforced structure for the data element as each collection may need to provide different types of metadata. The following are partial meta-data examples:

OPTIONS /api/arbitration_rules
{
  "attributes" : [
    ...
  ],
  "virtual_attributes" : [
    ...
  ],
  "relationships" : [
    ...
  ],
  "data" : {
    "field_values": [
      "User-id",
      "User-name",
      "User-email",
      "User-userid",
      "User-first_name",
      "User-last_name",
      ...
    ]
  }
}
OPTIONS /api/container_deployments
{
  "attributes" : [
    ...
  ],
  "virtual_attributes" : [
    ...
  ],
  "relationships" : [
    ...
  ],
  "data" : {
    "deployment_types" : [
      "origin",
      "openshift-enterprise"
    ],
    "provision" : [
      {
        "provider" : {
          ...
        },
        "templates" : [
          ...
        ]
      }
    ],
    "providers" : [
      ...
    ]
  }
}