OpenShift REST Resource Definition Schema: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
 
(6 intermediate revisions by the same user not shown)
Line 2: Line 2:


* [[OpenShift_Configuration#Definitions|OpenShift Configuration]]
* [[OpenShift_Configuration#Definitions|OpenShift Configuration]]
=Overview=
Some information about schema can be obtained with
[[oc explain]] <''resource''>
where possible resource names can be obtained with:
[[oc get]]


=apiVersion=
=apiVersion=
Line 14: Line 24:


{{External|https://docs.openshift.com/container-platform/latest/rest_api/openshift_v1.html#v1-objectmeta}}
{{External|https://docs.openshift.com/container-platform/latest/rest_api/openshift_v1.html#v1-objectmeta}}
Metadata contains the following:
==name==
The name of the resource within its namespace. When the resource is created, the name is required, and must be unique within a namespace, though in some cases, resources may allow a client to request the generation of an appropriate name automatically. When the resource is queried, the name cannot be updated.


==labels==
==labels==
Line 20: Line 36:


==annotations==
==annotations==
A key/value map intended to store state set by external tools. Annotations cannot be queried. Annotation must be preserved when the object is modified.
=spec=
The representation of the desired state of the resource.
==selector==
=status=
The representation of the current state of the resource.

Latest revision as of 18:43, 28 November 2017

Internal

Overview

Some information about schema can be obtained with

oc explain <resource>

where possible resource names can be obtained with:

oc get

apiVersion

'apiVersion' specifies the versioned schema of the representation of the object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values.

kind

A CamelCase string representing the REST resource. Servers may infer this from the endpoint the client submits requests to. Cannot be updated in the representation.

metadata

https://docs.openshift.com/container-platform/latest/rest_api/openshift_v1.html#v1-objectmeta

Metadata contains the following:

name

The name of the resource within its namespace. When the resource is created, the name is required, and must be unique within a namespace, though in some cases, resources may allow a client to request the generation of an appropriate name automatically. When the resource is queried, the name cannot be updated.

labels

Map of key/value pairs that can be used to organize and categorize objects. The are used as arguments for selectors.

annotations

A key/value map intended to store state set by external tools. Annotations cannot be queried. Annotation must be preserved when the object is modified.

spec

The representation of the desired state of the resource.

selector

status

The representation of the current state of the resource.