This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.このコンテンツは選択した言語では利用できません。
Using the OpenShift REST API
Comprehensive guide to using the OpenShift REST API
Abstract
Chapter 1. Introduction リンクのコピーリンクがクリップボードにコピーされました!
1.1. Introduction リンクのコピーリンクがクリップボードにコピーされました!
1.1.1. Using this Guide リンクのコピーリンクがクリップボードにコピーされました!
This guide provides step-by-step examples for interacting with the OpenShift and Kubernetes REST APIs. Each section contains a description of the resource or function and a set of applicable actions. Each action features a request breakdown that lists the requests types and expected results, followed by applicable example requests and responses to help guide the user through the process. Example configurations for all resources in this guide can be found in the Resource Examples chapter.
This guide does not include complete listings of all available options for each resource object and should be considered a companion to the comprehensive information found in the REST API Reference Guide.
1.1.1.1. Request Types リンクのコピーリンクがクリップボードにコピーされました!
GET requests are used to retrieve a resource configuration if that resource is specified by name in the target URL.
For example, a GET request to {$OCP_CLUSTER}/oapi/namespaces/{$PROJECT}/routes/{$ROUTE} returns that {$ROUTE} configuration.
Alternatively, GET requests to resource collections return the list objects in that resource collection.
For example, a GET request to {$OCP_CLUSTER}/oapi/namespaces/{$PROJECT}/routes returns a list of the routes in the {$PROJECT} namespace.
GET requests do not require a request body.
POST requests are used to create new resources based on the configuration in the request body.
For example, a POST request with a new route configuration in the request body to {$OCP_CLUSTER}/api/namespaces/{$PROJECT}/routes creates a new route in the {$PROJECT} namespace.
PUT requests are used to update or modify configurations. A PUT request targets specific resources and requires a complete and modified configuration in the request body.
For example, A PUT request to with a complete route configuration that has had one or more field values updated to {$OCP_CLUSTER}/oapi/namespaces/{$PROJECT}/routes/{$ROUTE} will replace that {$ROUTE} configuration.
PATCH requests are used to selectively update or modify field values in a resource configuration. How the change is merged is defined per field.
PATCH requests require JSON formatting and Content-Type: header text/strategic-merge-patch+json.
For example, a PATCH request with the following request body:
to {$OCP_CLUSTER}/oapi/namespaces/{$PROJECT}/routes/{$ROUTE} will update the weight of that route to 1.
DELETE requests are used to remove resource configurations.
For example, a request to {$OCP_CLUSTER}/oapi/namespaces/{$PROJECT}/routes/{$ROUTE} removes that route from the {$PROJECT} namespace.
DELETE requests do not require a request body.
1.1.1.2. Request Examples リンクのコピーリンクがクリップボードにコピーされました!
Request bodies are typically shown in their simplest form. Detailed object configurations can be found in the Resource Examples chapter. Comprehensive information for each API object can be found in the REST API Reference Guide.
Request and response body snippets are used in some examples. These snippets use ellipses (…) to delimit the relevant content from the redacted parts of the example configuration.
Request headers use generic {$BEARER_TOKEN} and {$OCP_CLUSTER} variables in place of the request authentication bearer token hash, and the OpenShift cluster hostname in the request target url, respectively.
An example OpenShift cluster hostname is:
https://openshift.example.com:8443
https://openshift.example.com:8443
Additional variables are included in place of object names. For example, {$PROJECT} is commonly used in place of a particular namespace.
Request examples in this guide use YAML for readability, and application/yaml is specified in the Accept: and Content-Type: headers to accommodate this. However, PATCH requests require JSON formatting and are documented as such.
1.1.2. API Authentication リンクのコピーリンクがクリップボードにコピーされました!
Requests to the OpenShift Container Platform API are authenticated using the following methods:
- OAuth Access Tokens
-
Obtained from the OpenShift Container Platform OAuth server using the
<master>/oauth/authorizeand<master>/oauth/tokenendpoints. -
Sent as an
Authorization: Bearer…header -
Sent as an
access_token=…query parameter for websocket requests prior to OpenShift Container Platform server version 3.6. -
Sent as a websocket subprotocol header in the form
base64url.bearer.authorization.k8s.io.<base64url-encoded-token>for websocket requests in OpenShift Container Platform server version 3.6 and later.
-
Obtained from the OpenShift Container Platform OAuth server using the
- X.509 Client Certificates
- Requires an HTTPS connection to the API server.
- Verified by the API server against a trusted certificate authority bundle.
- The API server creates and distributes certificates to controllers to authenticate themselves.
Any request with an invalid access token or an invalid certificate is rejected by the authentication layer with a 401 error.
If no access token or certificate is presented, the authentication layer assigns the system:anonymous virtual user and the system:unauthenticated virtual group to the request. This allows the authorization layer to determine which requests, if any, an anonymous user is allowed to make.
See the REST API Overview for more information and examples.
Chapter 2. Preparing Resources リンクのコピーリンクがクリップボードにコピーされました!
2.1. Projects リンクのコピーリンクがクリップボードにコピーされました!
2.1.1. Description of Resource リンクのコピーリンクがクリップボードにコピーされました!
Projects are the unit of isolation and collaboration in OpenShift. A project has one or more members, a quota on the resources that the project may consume, and the security controls on the resources in the project. Within a project, members may have different roles - project administrators can set membership, editors can create and manage the resources, and viewers can see but not access running containers. In typical clusters, cluster administrators, rather than project administrators, can alter project quotas.
Listing or watching projects will return only projects the user has the reader role on.
An OpenShift project is an alternative representation of a Kubernetes namespace. Projects are exposed as editable to end users while namespaces are not. Direct creation of a project is typically restricted to administrators, while end users should use the ProjectRequest resource.
2.1.2. Creating a New Project as Administrator リンクのコピーリンクがクリップボードにコピーされました!
2.1.2.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Creating a new project as an administrator requires one request:
-
A POST request to the
projectsresource.
The POST request to the projects resource uses a Project configuration in the request body.
2.1.2.2. POST Request to Create a New Project リンクのコピーリンクがクリップボードにコピーされました!
Request Header
Request Body
apiVersion: v1
kind: Project
metadata:
name: {$PROJECT_NAME}
apiVersion: v1
kind: Project
metadata:
name: {$PROJECT_NAME}
2.1.3. Creating a New Project as User リンクのコピーリンクがクリップボードにコピーされました!
2.1.3.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Creating a new project as a user requires one request:
-
A POST request to the
projectrequestsresource.
The POST request uses a ProjectRequest configuration in the request body.
2.1.3.2. POST Request to Create a New Project リンクのコピーリンクがクリップボードにコピーされました!
Request Header
Request Body
apiVersion: v1
kind: ProjectRequest
metadata:
name: {$PROJECT_NAME}
apiVersion: v1
kind: ProjectRequest
metadata:
name: {$PROJECT_NAME}
2.1.4. Listing all Projects in an Environment リンクのコピーリンクがクリップボードにコピーされました!
2.1.4.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Listing all the projects in an environment requires one request:
-
A GET request to the
projectsresource.
The GET request returns a ProjectList configuration.
2.1.4.2. GET Request to List all Projects リンクのコピーリンクがクリップボードにコピーされました!
Request Header
2.1.5. Listing a Specific Project リンクのコピーリンクがクリップボードにコピーされました!
2.1.5.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Listing the details for a project requires three requests:
-
A GET request to the project name in the
projectsresource. -
A GET request to the
resourcequotassubresource of the project namespace. -
A GET request to the
limitrangessubresource of the project namespace.
These requests return the Project, ResourceQuotaList, and LimitRangeList configurations respectively for the project namespace.
2.1.5.2. GET Request to List the Project Configuration リンクのコピーリンクがクリップボードにコピーされました!
Request Header
2.1.5.3. GET Request to List the ResourceQuotaList Configuration リンクのコピーリンクがクリップボードにコピーされました!
Request Header
2.1.5.4. GET Request to List the LimitRangeList Configuration リンクのコピーリンクがクリップボードにコピーされました!
Request Header
2.1.6. Deleting a Project リンクのコピーリンクがクリップボードにコピーされました!
2.1.6.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Deleting a project requires one request:
-
A DELETE request to the project namespace in the
projectsresource of the namespace.
The DELETE request returns a code: 200 and the project is deleted.
2.1.6.2. DELETE Request to Delete a Project リンクのコピーリンクがクリップボードにコピーされました!
Request Header
2.2. Service Accounts リンクのコピーリンクがクリップボードにコピーされました!
2.2.1. Description of Resource リンクのコピーリンクがクリップボードにコピーされました!
ServiceAccount binds together:
- a name, understood by users, and perhaps by peripheral systems, for an identity
- a principal that can be authenticated and authorized
- a set of secrets
2.2.2. Creating a New Service Account リンクのコピーリンクがクリップボードにコピーされました!
2.2.2.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Creating a new service account requires one request:
-
A POST request to the
serviceaccountssubresource of the namespace.
The POST request uses a ServiceAccount configuration in the request body.
2.2.2.2. POST Request to Create a New Service Account リンクのコピーリンクがクリップボードにコピーされました!
Request Header
Request Body
apiVersion: v1
kind: ServiceAccount
metadata:
name: {$SERVICEACCOUNT}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {$SERVICEACCOUNT}
2.2.3. Listing All Service Accounts in an Environment リンクのコピーリンクがクリップボードにコピーされました!
2.2.3.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Listing all the service accounts in an environment requires one request:
-
A GET request to the
serviceaccountsresource.
The GET request returns the ServiceAccountList, listing the details of all service accounts in the environment.
2.2.3.2. GET Request to Return All Service Accounts in an Environment リンクのコピーリンクがクリップボードにコピーされました!
Request Header
2.2.4. Listing all Service Accounts in a Namespace リンクのコピーリンクがクリップボードにコピーされました!
2.2.4.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Listing all the service accounts in a namespace requires one request:
-
A GET request to the
serviceaccountssubresource of the namespace.
The GET request returns the ServiceAccountList, listing the details of all service accounts in the namespace.
2.2.4.2. GET Request to Return Service Accounts in Namespace リンクのコピーリンクがクリップボードにコピーされました!
Request Header
2.2.5. Listing a Specific Service Account Configuration リンクのコピーリンクがクリップボードにコピーされました!
2.2.5.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Listing a specific service account configuration requires one request:
-
A GET request to the service account name in the
serviceaccountssubresource of the namespace.
The GET request returns the ServiceAccount configuration for the specified service account.
2.2.5.2. GET Request to Return Specific Service Account Configuration リンクのコピーリンクがクリップボードにコピーされました!
Request Header
2.2.6. Adding a Role to a Service Account リンクのコピーリンクがクリップボードにコピーされました!
2.2.6.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Adding a role to a service account requires two requests, where the second request type is dependent on the response of the first:
-
A GET request to the
policybindingssubresource of the namespace. -
A POST request to the
rolebindingssubresource of the namespace (if the role has not been previously bound to an object in the namespace) +. OR -
A PUT request to the role name in the
rolebindingssubresource of the namespace.
The GET request returns the PolicyBindingList, listing all the RoleBinding configurations in the namespace.
Create a RoleBinding with a POST request to bind an object to a role. Once the role binding exists in the namespace, binding another object to that role requires modification of the RoleBinding with a PUT request.
2.2.6.2. GET Request to Return PolicyBindingList in Namespace リンクのコピーリンクがクリップボードにコピーされました!
Request Header
The GET request returns a list of the role bindings that are present in the namespace.
Response Body Snippet
If the intended role is not listed, send a POST request to create the RoleBinding configuration. Include the service account as a subject for the role, and the system:serviceaccount:{$PROJECT}:{$SERVICEACCOUNT} user name that distinguishes the service account.
If the role is listed, as in the response in the example above, update the returned RoleBinding configuration with the subject and userName of the service account being added to the role and send it as a PUT request to the role name in the rolebindings subresource of the namespace.
2.2.6.3. POST Request to Create a RoleBinding in a Namespace リンクのコピーリンクがクリップボードにコピーされました!
Request Header
Request Body
2.2.6.4. PUT Request to Add a Service Account to an Existing Role リンクのコピーリンクがクリップボードにコピーされました!
Request Header
Request Body
2.2.7. Linking a Secret to a Service Account リンクのコピーリンクがクリップボードにコピーされました!
2.2.7.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Linking a secret to a service account requires two requests:
-
A GET request to the service account name in the
serviceaccountssubresource of the namespace. -
A PUT request with updated
secretsparameter to the service account name in theserviceaccountssubresource of the namespace.
The GET request returns the ServiceAccount configuration.
The PUT request uses the returned ServiceAccount configuration with an updated secrets parameter to include the secret to link to the service account.
2.2.7.2. GET Request to Return Service Account Configuration リンクのコピーリンクがクリップボードにコピーされました!
Request Header
Request Body Snippet
...
secrets:
- name: {$SERVICEACCOUNT}-token-x4tx5
- name: {$SERVICEACCOUNT}-dockercfg-7qfh6
...
...
secrets:
- name: {$SERVICEACCOUNT}-token-x4tx5
- name: {$SERVICEACCOUNT}-dockercfg-7qfh6
...
2.2.7.3. PUT Request to Add Secret to Service Account Configuration リンクのコピーリンクがクリップボードにコピーされました!
Request Header
Request Body Snippet
2.2.8. Unlinking a Secret from a Service Account リンクのコピーリンクがクリップボードにコピーされました!
2.2.8.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Unlinking a secret from a service account requires two requests:
-
A GET request to the service account name in the
serviceaccountssubresource of the namespace. -
A PUT request with modified
secretsparameter to the service account name in theserviceaccountssubresource of the namespace.
The GET request returns the ServiceAccount configuration.
The PUT request uses the returned ServiceAccount configuration with a modified secrets parameter to unlink the secret from the service account.
2.2.8.2. GET Request to Return Service Account Configuration リンクのコピーリンクがクリップボードにコピーされました!
Request Header
Request Body Snippet
2.2.8.3. PUT Request to Remove Secret from Service Account Configuration リンクのコピーリンクがクリップボードにコピーされました!
Request Header
Request Body Snippet
...
secrets:
- name: {$SERVICEACCOUNT}-token-x4tx5
- name: {$SERVICEACCOUNT}-dockercfg-7qfh6
...
...
secrets:
- name: {$SERVICEACCOUNT}-token-x4tx5
- name: {$SERVICEACCOUNT}-dockercfg-7qfh6
...
2.2.9. Deleting a Service Account リンクのコピーリンクがクリップボードにコピーされました!
2.2.9.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Deleting a service account requires one request:
-
A DELETE request to the service account name in the
serviceaccountssubresource of the namespace.
The DELETE request returns a code: 200 and the service account is deleted.
2.2.9.2. DELETE Request to Delete Service Account リンクのコピーリンクがクリップボードにコピーされました!
Request Header
2.3. Secrets リンクのコピーリンクがクリップボードにコピーされました!
2.3.1. Description of Resource リンクのコピーリンクがクリップボードにコピーされました!
The Secret resource type provides a mechanism to hold sensitive information such as passwords, OpenShift Container Platform client configuration files, dockercfg files, private source repository credentials, and so on. Secrets decouple sensitive content from the pods.
2.3.2. Creating Secrets from File リンクのコピーリンクがクリップボードにコピーされました!
2.3.2.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Creating a new secret requires one request:
-
A POST request to the
secretssubresource of the namespace.
The POST request to the secret subresource uses a Secret configuration in the request body.
2.3.2.2. POST Request to Create a New Secret リンクのコピーリンクがクリップボードにコピーされました!
Request Header
Request Body
| Parameter Name | Description | Additional Notes |
|---|---|---|
|
| Base64-encoded contents of file, where the {$FILENAME} parameter is the plaintext file name |
If the file is already encrypted, the |
|
| Base64-encoded user name for basic authentication | |
|
| Base64-encoded password for the supplied basic authentication user name | |
|
| Base64-encoded contents of certificate file | |
|
| Base64-encoded contents of SSH private key file |
2.3.3. Listing Secrets in an Environment リンクのコピーリンクがクリップボードにコピーされました!
2.3.3.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Listing all the secrets in an environment requires one request:
-
A GET request to the
secretsresource.
The GET request to the secrets resource returns returns the SecretList, listing the details for all secrets in the environment.
2.3.3.2. GET Request to Return All Secrets in an Environment リンクのコピーリンクがクリップボードにコピーされました!
Request Header
2.3.4. Listing Secrets in a Namespace リンクのコピーリンクがクリップボードにコピーされました!
2.3.4.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Listing all the secrets in a namespace requires one request:
-
A GET request to the
secretssubresource of the namespace.
The GET request to the secrets resource returns the SecretList, listing the details of all secrets in the namespace.
2.3.4.2. GET Request to Return Secrets in Namespace リンクのコピーリンクがクリップボードにコピーされました!
Request Header
2.3.5. Listing a Specific Secret Configuration リンクのコピーリンクがクリップボードにコピーされました!
2.3.5.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Listing a specific secret configuration requires one request:
-
A GET request to the secret name in the
secretssubresource of the namespace.
The GET request returns the Secret configuration for the specified secret.
2.3.5.2. GET Request to Return Specific Secret Configuration リンクのコピーリンクがクリップボードにコピーされました!
Request Header
2.3.6. Linking a Secret to a Service Account リンクのコピーリンクがクリップボードにコピーされました!
2.3.6.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Linking a secret to a service account requires two requests:
-
A GET request to the service account name in the
serviceaccountssubresource of the namespace. -
A PUT request with updated
secretsparameter to the service account name in theserviceaccountssubresource of the namespace.
The GET request returns the ServiceAccount configuration.
The PUT request uses the returned ServiceAccount configuration with an updated secrets parameter to include the secret to link to the service account.
2.3.6.2. GET Request to Return Service Account Configuration リンクのコピーリンクがクリップボードにコピーされました!
Request Header
Request Body Snippet
...
secrets:
- name: {$SERVICEACCOUNT}-token-x4tx5
- name: {$SERVICEACCOUNT}-dockercfg-7qfh6
...
...
secrets:
- name: {$SERVICEACCOUNT}-token-x4tx5
- name: {$SERVICEACCOUNT}-dockercfg-7qfh6
...
2.3.6.3. PUT Request to Add Secret to Service Account Configuration リンクのコピーリンクがクリップボードにコピーされました!
Request Header
Request Body Snippet
2.3.7. Unlinking a Secret from a Service Account リンクのコピーリンクがクリップボードにコピーされました!
2.3.7.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Unlinking a secret from a service account requires two requests:
-
A GET request to the service account name in the
serviceaccountssubresource of the namespace. -
A PUT request with modified
secretsparameter to the service account name in theserviceaccountssubresource of the namespace.
The GET request returns the ServiceAccount configuration.
The PUT request uses the returned ServiceAccount configuration with a modified secrets parameter to unlink the secret from the service account.
2.3.7.2. GET Request to Return Service Account Configuration リンクのコピーリンクがクリップボードにコピーされました!
Request Header
Request Body Snippet
2.3.7.3. PUT Request to Remove Secret from Service Account Configuration リンクのコピーリンクがクリップボードにコピーされました!
Request Header
Request Body Snippet
...
secrets:
- name: {$SERVICEACCOUNT}-token-x4tx5
- name: {$SERVICEACCOUNT}-dockercfg-7qfh6
...
...
secrets:
- name: {$SERVICEACCOUNT}-token-x4tx5
- name: {$SERVICEACCOUNT}-dockercfg-7qfh6
...
2.3.8. Deleting a Service Account リンクのコピーリンクがクリップボードにコピーされました!
2.3.8.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Deleting a service account requires one request:
-
A DELETE request to the service account name in the
serviceaccountssubresource of the namespace.
The DELETE request returns a code: 200 and the service account is deleted.
2.3.8.2. DELETE Request to Delete Service Account リンクのコピーリンクがクリップボードにコピーされました!
Request Header
2.3.9. Deleting Secrets リンクのコピーリンクがクリップボードにコピーされました!
2.3.9.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Deleting a secret requires one request:
-
A DELETE request to the secret name in the
secretsubresource of the namespace.
The *DELETE request returns a code: 200 and the secret is deleted.
2.3.9.2. DELETE Request to Delete Secret リンクのコピーリンクがクリップボードにコピーされました!
Request Header
2.4. Persistent Volumes リンクのコピーリンクがクリップボードにコピーされました!
2.4.1. Description of Resource リンクのコピーリンクがクリップボードにコピーされました!
PersistentVolume (PV) is a storage resource provisioned by an administrator. It is analogous to a node.
2.4.2. Creating a New Persistent Volume リンクのコピーリンクがクリップボードにコピーされました!
2.4.2.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Creating a new persistent volume requires one request:
-
A POST request to the
persistentvolumesresource.
The POST request uses a PersistentVolume configuration in the request body.
2.4.2.2. POST Request to Create a Persistent Volume リンクのコピーリンクがクリップボードにコピーされました!
Request Header
Request Body
2.4.3. Listing All Persistent Volumes in an Environment リンクのコピーリンクがクリップボードにコピーされました!
2.4.3.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Listing all the persistent volumes in an environment requires one request:
-
A GET request to the
persistentvolumesresource.
The GET request returns returns the PersistentVolumeList, listing the details of all persistent volumes in the environment.
2.4.3.2. GET Request to Return All Persistent Volumes in an Environment リンクのコピーリンクがクリップボードにコピーされました!
Request Header
2.4.4. Listing a Specific Persistent Volume Configuration リンクのコピーリンクがクリップボードにコピーされました!
2.4.4.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Listing a specific persistent volumes configuration requires one request:
-
A GET request to the persistent volume name in the
persistentvolumesresource.
The GET request returns the PersistentVolume configuration for the specified persistent volume.
2.4.4.2. GET Request to Return Specific Persistent Volume Configuration リンクのコピーリンクがクリップボードにコピーされました!
Request Header
2.4.5. Deleting a Persistent Volume リンクのコピーリンクがクリップボードにコピーされました!
2.4.5.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Deleting a persistent volume requires one request:
-
A DELETE request to the persistent volume name in the
persistentvolumesresource.
The DELETE request returns a code: 200 and the persistent volume is deleted.
2.4.5.2. DELETE Request to Delete Persistent Volume リンクのコピーリンクがクリップボードにコピーされました!
Request Header
2.5. Persistent Volume Claims リンクのコピーリンクがクリップボードにコピーされました!
2.5.1. Description of Resource リンクのコピーリンクがクリップボードにコピーされました!
PersistentVolumeClaim is a user’s request for and claim to a persistent volume.
2.5.2. Creating a New Persistent Volume Claim リンクのコピーリンクがクリップボードにコピーされました!
2.5.2.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Creating a new persistent volume claim requires one request:
-
A POST request to the
persistentvolumeclaimssubresource of the namespace.
The POST request uses a PersistentVolumeClaim configuration in the request body.
2.5.2.2. POST Request to Create a Persistent Volume Claim リンクのコピーリンクがクリップボードにコピーされました!
Request Header
Request Body
2.5.3. Listing All Persistent Volume Claims in an Environment リンクのコピーリンクがクリップボードにコピーされました!
2.5.3.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Listing all the persistent volume claims in an environment requires one request:
-
A GET request to the
persistentvolumeclaimsresource.
The GET request returns the PersistentVolumeClaimList, listing the details of all persistent volume claims in the environment.
2.5.3.2. GET Request to Return All Persistent Volume Claims in an Environment リンクのコピーリンクがクリップボードにコピーされました!
Request Header
2.5.4. Listing all Persistent Volume Claims in a Namespace リンクのコピーリンクがクリップボードにコピーされました!
2.5.4.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Listing all the persistent volume claims in a namespace requires one request:
-
A GET request to the
persistentvolumeclaimssubresource of the namespace.
The GET request returns the PersistentVolumeClaimList, listing the details of all persistent volume claims in the namespace.
2.5.4.2. GET Request to Return Persistent Volume Claims in Namespace リンクのコピーリンクがクリップボードにコピーされました!
Request Header
2.5.5. Listing a Specific Persistent Volume Claim Configuration リンクのコピーリンクがクリップボードにコピーされました!
2.5.5.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Listing a specific persistent volume claim configuration requires one request:
-
A GET request to the persistent volume claim name in the
persistentvolumeclaimssubresource of the namespace.
The GET request returns the PersistentVolumeClaim configuration for the specified persistent volume claim.
2.5.5.2. GET Request to Return Specific Persistent Volume Claim Configuration リンクのコピーリンクがクリップボードにコピーされました!
Request Header
2.5.6. Adding a Persistent Volume Claim to an Object リンクのコピーリンクがクリップボードにコピーされました!
Persistent volume claims can be added to objects that have a pod template: deploymentconfigs, replication controllers, and pods. However, you can not change a pod’s volumes once it has been created.
If you alter a volume setting on a deployment config, a deployment will be triggered. Changing a replication controller will not affect running pods.
Adding a persistent volume claim to an object configuration requires two requests:
-
A GET request to the object name in the
{$OBJECT}subresource of the namespace. -
A PATCH request with updated field values to the object name in the
{$OBJECT}subresource of the namespace.
The GET request is optional as the PATCH request body is not determined by the returned configuration, however it can be useful for preparing the PATCH request body.
The syntax for the PATCH request is the same for both deploymentconfig and replicationcontroller objects.
2.5.6.1. PATCH Request to Add Persistent Volume Claim リンクのコピーリンクがクリップボードにコピーされました!
PATCH requests require JSON formatting.
The following PATCH request example adds a persistent volume claim {$CLAIM}, which is bound to persistent volume {$VOLUME), to deploymentconfig {$DEPLOYMENTCONFIG}. The same PATCH can be applied to a replicationcontroller object with modified target:
Request Header
Request Body
2.5.7. Removing a Persistent Volume Claim from an Object リンクのコピーリンクがクリップボードにコピーされました!
If you alter a volume setting on a deployment config, a deployment will be triggered. Changing a replication controller will not affect running pods.
Removing a persistent volume claim from an object configuration requires two requests:
-
A GET request to the object name in the
{$OBJECT}subresource of the namespace. -
A PATCH request with a
delete$patchtype to the object name in the{$OBJECT}subresource of the namespace.
The GET request is optional as the PATCH request body is not determined by the returned configuration, however it can be useful for preparing the PATCH request body.
The syntax for the PATCH request is the same for both deploymentconfig and replicationcontroller objects.
2.5.7.1. PATCH Request to Add Persistent Volume Claim リンクのコピーリンクがクリップボードにコピーされました!
PATCH requests require JSON formatting.
The following PATCH request example adds a persistent volume claim {$CLAIM}, which is bound to persistent volume {$VOLUME), to deploymentconfig {$DEPLOYMENTCONFIG}. The same PATCH can be applied to a replicationcontroller object with modified target:
Request Header
Request Body
2.5.8. Deleting a Persistent Volume Claim リンクのコピーリンクがクリップボードにコピーされました!
2.5.8.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Deleting a persistent volume claim requires one request:
-
A DELETE request to the persistent volume claim name in the
persistentvolumeclaimssubresource of the namespace.
The DELETE request returns a code: 200 and the persistent volume claim is deleted.
2.5.8.2. DELETE Request to Delete Persistent Volume Claim リンクのコピーリンクがクリップボードにコピーされました!
Request Header
Chapter 3. Builds and Images リンクのコピーリンクがクリップボードにコピーされました!
3.1. BuildConfigs リンクのコピーリンクがクリップボードにコピーされました!
3.1.1. Description of Resource リンクのコピーリンクがクリップボードにコピーされました!
Build configurations define a build process for new Docker images. There are three types of builds possible - a Docker build using a Dockerfile, a Source-to-Image build that uses a specially prepared base image that accepts source code that it can make runnable, and a custom build that can run arbitrary Docker images as a base and accept the build parameters. Builds run on the cluster and on completion are pushed to the Docker registry specified in the "output" section. A build can be triggered via a webhook, when the base image changes, or when a user manually requests a new build be created.
Each build created by a build configuration is numbered and refers back to its parent configuration. Multiple builds can be triggered at once. Builds that do not have "output" set can be used to test code or run a verification build.
3.1.2. Creating a New BuildConfig リンクのコピーリンクがクリップボードにコピーされました!
3.1.2.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Creating a new buildconfig requires one request:
-
A POST request to the
buildconfigssubresource of the namespace.
The POST request uses a BuildConfig configuration in the request body. The following example uses a BuildConfig for the Jboss Developer kitchensink quickstart found at https://github.com/jboss-developer/jboss-eap-quickstarts.
3.1.2.2. POST Request to Create a New BuildConfig リンクのコピーリンクがクリップボードにコピーされました!
Request Header
Request Body
3.1.3. Listing All BuildConfigs in an Environment リンクのコピーリンクがクリップボードにコピーされました!
3.1.3.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Listing all the buildconfigs in an environment requires one request:
-
A GET request to the
buildconfigsresource.
The GET request returns the BuildConfigList, listing the details of all buildconfigs in the environment.
3.1.3.2. GET Request to Return All BuildConfigs in an Environment リンクのコピーリンクがクリップボードにコピーされました!
Request Header
3.1.4. Listing all BuildConfigs in a Namespace リンクのコピーリンクがクリップボードにコピーされました!
3.1.4.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Listing all the buildconfigs in a namespace requires one request:
-
A GET request to the
buildconfigssubresource of the namespace.
The GET request returns the BuildConfigList, listing the details of all buildconfigs in the namespace.
3.1.4.2. GET Request to Return BuildConfigs in Namespace リンクのコピーリンクがクリップボードにコピーされました!
Request Header
3.1.5. Listing a Specific BuildConfig Configuration リンクのコピーリンクがクリップボードにコピーされました!
3.1.5.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Listing a specific buildconfig configuration requires one request:
-
A GET request to the buildconfig name in the
buildconfigssubresource of the namespace.
The GET request returns the BuildConfig configuration for the specified build.
3.1.5.2. GET Request to Return Specific BuildConfig Configuration リンクのコピーリンクがクリップボードにコピーされました!
Request Header
3.1.6. Deleting a BuildConfig リンクのコピーリンクがクリップボードにコピーされました!
3.1.6.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Deleting a buildconfig requires one request:
-
A DELETE request to the buildconfig name in the
buildconfigssubresource of the namespace.
The DELETE request returns a code: 200 and the buildconfig is deleted.
3.1.6.2. DELETE Request to Delete BuildConfig リンクのコピーリンクがクリップボードにコピーされました!
Request Header
3.2. Builds リンクのコピーリンクがクリップボードにコピーされました!
3.2.1. Description of Resource リンクのコピーリンクがクリップボードにコピーされました!
A build is the process of transforming input parameters into a resulting object. Most often, the process is used to transform input parameters or source code into a runnable image. A BuildConfig object is the definition of the entire build process.
3.2.2. Listing All Builds in an Environment リンクのコピーリンクがクリップボードにコピーされました!
3.2.2.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Listing all the builds in an environment requires one request:
-
A GET request to the
buildsresource.
The GET request returns the BuildList, listing the details of all builds in the environment.
3.2.2.2. GET Request to Return All Builds in an Environment リンクのコピーリンクがクリップボードにコピーされました!
Request Header
3.2.3. Listing all Builds in a Namespace リンクのコピーリンクがクリップボードにコピーされました!
3.2.3.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Listing all the builds in a namespace requires one request:
-
A GET request to the
buildssubresource of the namespace.
The GET request returns the BuildList, listing the details of all builds in the namespace.
3.2.3.2. GET Request to Return Builds in Namespace リンクのコピーリンクがクリップボードにコピーされました!
Request Header
3.2.4. Listing a Specific Build Configuration リンクのコピーリンクがクリップボードにコピーされました!
3.2.4.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Listing a specific build configuration requires one request:
-
A GET request to the build name in the
buildssubresource of the namespace.
The GET request returns the Build configuration for the specified build.
3.2.4.2. GET Request to Return Specific Build Configuration リンクのコピーリンクがクリップボードにコピーされました!
Request Header
3.2.5. Starting a Build リンクのコピーリンクがクリップボードにコピーされました!
3.2.5.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Starting a build requires one request:
-
A POST request to the
instantiatesubresource of theBuildConfigname.
The POST request returns a BuildConfig configuration.
3.2.5.2. POST Request to Start a Build リンクのコピーリンクがクリップボードにコピーされました!
Request Header
Request Body
3.2.6. Cancelling a Build リンクのコピーリンクがクリップボードにコピーされました!
3.2.6.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Cancelling a build consists of two requests:
-
A GET request to the build name in the
buildssubresource of the namespace. -
A PUT request with an added
cancelledfield to the build name in thebuildssubresource of the namespace.
The GET request returns a Build configuration.
The GET request is optional if an updated Build configuration can otherwise be provided for the PUT request.
Include a spec: status: cancelled parameter with value true in the Build configuration. Send the updated configuration as the request body in a PUT request to the build name.
3.2.6.2. GET Request to Return Build Configuration リンクのコピーリンクがクリップボードにコピーされました!
Request Header
3.2.6.3. PUT Request to Cancel a Build リンクのコピーリンクがクリップボードにコピーされました!
Request Header
Request Body Snippet
...
spec:
status:
cancelled: "true"
...
...
spec:
status:
cancelled: "true"
...
3.2.7. Deleting a Build リンクのコピーリンクがクリップボードにコピーされました!
3.2.7.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Deleting a build requires one request:
-
A DELETE request to the build name in the
buildssubresource of the namespace.
The DELETE request returns a code: 200 and the build is deleted.
3.2.7.2. DELETE Request to Delete Build リンクのコピーリンクがクリップボードにコピーされました!
Request Header
3.3. Images リンクのコピーリンクがクリップボードにコピーされました!
3.3.1. Description of Resource リンクのコピーリンクがクリップボードにコピーされました!
An image is a binary that includes all of the requirements for running a single container, as well as metadata describing its needs and capabilities.
3.3.2. Creating an Image リンクのコピーリンクがクリップボードにコピーされました!
3.3.2.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Creating a new image requires one request:
-
A POST request to the
imagessubresource of the namespace.
The POST request uses an Image configuration in the request body.
3.3.2.2. POST Request to Create a New Image リンクのコピーリンクがクリップボードにコピーされました!
Request Header
Request Body
apiVersion: v1
kind: Image
metadata:
name: {$IMAGE}
dockerImageReference: registry.access.redhat.com/openshift3/jenkins-1-rhel7@sha256:9a370e38aca93da91bda03107f74fc245b169a8c642daf431a93289f44e187a0
apiVersion: v1
kind: Image
metadata:
name: {$IMAGE}
dockerImageReference: registry.access.redhat.com/openshift3/jenkins-1-rhel7@sha256:9a370e38aca93da91bda03107f74fc245b169a8c642daf431a93289f44e187a0
3.3.3. Listing All Images in a Cluster リンクのコピーリンクがクリップボードにコピーされました!
3.3.3.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Listing all the images in a cluster requires one request:
-
A GET request to the
imagesresource.
The GET request returns the ImageList, listing the details of all images in the cluster.
3.3.3.2. GET Request to Return All Images in a Cluster リンクのコピーリンクがクリップボードにコピーされました!
Request Header
3.3.4. Listing a Specific Image Configuration リンクのコピーリンクがクリップボードにコピーされました!
3.3.4.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Listing a specific image configuration in a cluster requires one request:
-
A GET request to the
sha256:-prefixed image hash in theimagesresource.
The GET request returns the Image configuration for the specified image.
3.3.4.2. GET Request to Return Specific Image Configuration リンクのコピーリンクがクリップボードにコピーされました!
Request Header
3.3.5. Deleting an Image リンクのコピーリンクがクリップボードにコピーされました!
3.3.5.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Deleting an Image requires one request:
-
A DELETE request to the
sha256:-prefixed image hash in theimagesresource.
The DELETE request returns a code: 200 and the Image is deleted.
3.3.5.2. DELETE Request to Delete Image リンクのコピーリンクがクリップボードにコピーされました!
Request Header
3.4. Image Streams リンクのコピーリンクがクリップボードにコピーされました!
3.4.1. Description of Resource リンクのコピーリンクがクリップボードにコピーされました!
An ImageStream stores a mapping of tags to images, metadata overrides that are applied when images are tagged in a stream, and an optional reference to a Docker image repository on a registry.
3.4.2. Creating a New Image Stream リンクのコピーリンクがクリップボードにコピーされました!
3.4.2.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Creating a new image stream requires one request:
-
A POST request to the
imagestreamssubresource of the namespace.
The POST request uses an ImageStream configuration in the request body.
3.4.2.2. POST Request to Create a New Image Stream リンクのコピーリンクがクリップボードにコピーされました!
Request Header
Request Body
3.4.3. Importing an Image Stream リンクのコピーリンクがクリップボードにコピーされました!
3.4.3.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Importing an image stream requires one request:
-
A POST request to the
imagestreamimportssubresource of the namespace.
The POST request uses an ImageStreamImport configuration in the request body.
The following example imports the ruby-23-rhel7:latest image into a namespace as a custom imagestream.
3.4.3.2. POST Request to Create a New Image Stream リンクのコピーリンクがクリップボードにコピーされました!
Request Header
Request Body
3.4.4. Listing All Image Streams in a Cluster リンクのコピーリンクがクリップボードにコピーされました!
3.4.4.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Listing all the image streams in a cluster requires one request:
-
A GET request to the
imagestreamsresource.
The GET request returns the ImageStreamList, listing the details of all image streams in the cluster.
3.4.4.2. GET Request to Return All Image Streams in a Cluster リンクのコピーリンクがクリップボードにコピーされました!
Request Header
3.4.5. Listing all Image Streams in a Namespace リンクのコピーリンクがクリップボードにコピーされました!
3.4.5.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Listing all the image streams in a namespace requires one request:
-
A GET request to the
imagestreamssubresource of the namespace.
The GET request returns the ImageStreamList, listing the details of all image streams in the namespace.
3.4.5.2. GET Request to Return Image Streams in Namespace リンクのコピーリンクがクリップボードにコピーされました!
Request Header
3.4.6. Listing a Specific Image Stream Configuration リンクのコピーリンクがクリップボードにコピーされました!
3.4.6.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Listing a specific image stream configuration requires one request:
-
A GET request to the image stream name in the
imagestreamssubresource of the namespace.
The GET request returns the ImageStream configuration for the specified image stream.
3.4.6.2. GET Request to Return Specific Image Stream Configuration リンクのコピーリンクがクリップボードにコピーされました!
Request Header
3.4.7. Deleting an Image Stream リンクのコピーリンクがクリップボードにコピーされました!
3.4.7.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Deleting a image stream requires one request:
-
A DELETE request to the image stream name in the
imagestreamssubresource of the namespace.
The DELETE request returns a code: 200 and the image stream is deleted.
3.4.7.2. DELETE Request to Delete Image Stream リンクのコピーリンクがクリップボードにコピーされました!
Request Header
3.5. Image Stream Tags リンクのコピーリンクがクリップボードにコピーされました!
3.5.1. Description of Resource リンクのコピーリンクがクリップボードにコピーされました!
An ImageStreamTag represents an Image that is retrieved by tag name from an ImageStream.
3.5.2. Adding an Image Stream Tag リンクのコピーリンクがクリップボードにコピーされました!
3.5.2.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Adding a tag to an image stream requires one request:
-
A PUT request to the image stream tag name in the
imagestreamtagssubresource of the namespace.
The PUT request uses an ImageStreamTag configuration in the request body.
The following example adds an image stream tag to the default ruby image stream in the openshift namespace.
3.5.2.2. PUT Request to Add an Image Stream Tag リンクのコピーリンクがクリップボードにコピーされました!
Request Header
Request Body
3.5.3. Deleting an Image Stream Tag リンクのコピーリンクがクリップボードにコピーされました!
3.5.3.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Deleting an image stream tag requires one request:
-
A DELETE request to the image stream tag name in the
imagestreamtagssubresource of the namespace.
The DELETE request returns a code: 200 and the image stream tag is deleted.
The following example deletes the image stream tag, added in the previous example, from the default ruby image stream in the openshift namespace.
3.5.3.2. DELETE Request to Delete Image Stream Tag リンクのコピーリンクがクリップボードにコピーされました!
Request Header
Chapter 4. Project Management リンクのコピーリンクがクリップボードにコピーされました!
4.1. Pod Configurations リンクのコピーリンクがクリップボードにコピーされました!
4.1.1. Description of Function リンクのコピーリンクがクリップボードにコピーされました!
Display the Pod configurations of pods in an OpenShift cluster. Depending on the endpoint of the request, you can list the Pod configurations for all the pods in an environment, all the pods in a namespace, or a specific Pod configuration in a namespace.
4.1.2. Listing Configurations for All Pods in an Environment リンクのコピーリンクがクリップボードにコピーされました!
4.1.2.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Listing all the pods in an environment requires one request:
-
A GET request to the
podsresource.
The GET request returns the PodList, listing the details of all pods in the environment.
4.1.2.2. GET Request to Return All Pod Configurations in OpenShift Environment リンクのコピーリンクがクリップボードにコピーされました!
Request Header
4.1.3. Listing All Pods in a Namespace リンクのコピーリンクがクリップボードにコピーされました!
4.1.3.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Listing all the pods in a namespace requires one request:
-
A GET request to the
podssubresource of the namespace.
The GET request returns the PodList, listing the details of all pods in the namespace.
4.1.3.2. GET Request to Return All Pod Configurations in Namespace リンクのコピーリンクがクリップボードにコピーされました!
Request Header
4.1.4. Listing a Specific Pod Configuration in a Namespace リンクのコピーリンクがクリップボードにコピーされました!
4.1.4.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Listing a specific pod configuration requires one request:
-
A GET request to the pod name in the
podssubresource of the namespace.
The GET request returns the Pod configuration for the specified pod.
4.1.4.2. GET Request to Return Specific Pod Configuration リンクのコピーリンクがクリップボードにコピーされました!
Request Header
4.2. Idle リンクのコピーリンクがクリップボードにコピーされました!
4.2.1. Description of Function リンクのコピーリンクがクリップボードにコピーされました!
Idling discovers the scalable resources (such as deployment configurations and replication controllers) associated with a series of services by examining the endpoints of the service. Each service is then marked as idled, the associated resources are recorded, and the resources are scaled down to zero replicas.
Upon receiving network traffic, the services (and any associated routes) will "wake up" the associated resources by scaling them back up to their previous scale.
4.2.2. Idling a DeploymentConfig リンクのコピーリンクがクリップボードにコピーされました!
4.2.2.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Idling consists of a series of requests:
-
A GET request to the endpoint name of the
endpointssubresource of the namespace to discover corresponding pods. -
A GET request to each pod name in the
podssubresource to discover the owner reference (deploymentconfigorreplicationcontroller) for that pod. -
A GET request to the referenced owner name (
deploymentconfigorreplicationcontroller) to discover if that referenced owner has an owner reference. -
A GET request to the
scalesubresource for all referenceddeploymentconfigorreplicationcontrollerobjects to discover the replica value for the resource. -
A PATCH request with updated annotations, including idle start time and corresponding owner reference, to each endpoint name in the
endpointsubresource of the namespace. -
A PUT request with updated annotations for the idle time and previous scale to the endpoint owner name (
deploymentconfigorreplicationcontroller) to set the replicas to0.
Idling an endpoint requires a PATCH request to the endpoint, and a PUT request to the referenced owner of the resources. GET requests 1-3 discover the pods corresponding to the endpoint, the owner resource of the pods, and then discover if that owner resource is owned by another resource.
GET request 4 is optional as the replica value for the resource is in the configuration returned in a previous GET request; however, returning the scale subresource can simplify the process of retrieving the replica value.
The PATCH request adds annotations to the endpoint that include the time in which the resource is considered idle, and an owner reference so that the owner resource is scaled accordingly when a service receives traffic. The PUT request to the owner resource includes the same idle time annotation as the endpoint, the previous replica value of the resource to scale to when unidled, and replaces the replica value to 0 to idle the resource.
| Annotation | Description |
|---|---|
| kubernetes.io/created-by | Owner reference for Kubernetes objects. |
| openshift.io/deployment-config.name |
Owner reference for resource belonging to a |
| Annotation | Description |
|---|---|
| idling.alpha.openshift.io/idled-at | Indicates the time at which the resource is considered idle. |
| idling.alpha.openshift.io/unidle-targets | References the owner resource that the endpoint will unidle. |
| Annotation | Description |
|---|---|
| idling.alpha.openshift.io/idled-at | Indicates the time at which the resource is considered idle. |
| idling.alpha.openshift.io/previous-scale | Indicates the previous scale of the resource prior to idle. When the endpoint receives traffic, the resource will scale to this value. |
4.2.2.2. GET Request to Return endpoint リンクのコピーリンクがクリップボードにコピーされました!
Request Header
Response Body Snippet
The request returns two pods corresponding to the endpoint.
4.2.2.3. GET Request to Return pod Owner リンクのコピーリンクがクリップボードにコピーされました!
Request Header
Response Body Snippet
The pod owner is discovered from the kubernetes.io/created-by: and the openshift.io/deployment-config.name: annotations. The pod in this example has two owners: {$REPLICATIONCONTROLLER} and {$DEPLOYMENTCONFIG}.
For the purposes of the example, {$POD2} has the same owners.
4.2.2.4. GET Request to Return replicationcontroller Owner リンクのコピーリンクがクリップボードにコピーされました!
Request Header
Response Body Snippet
The replication owner is discovered with the openshift.io/deployment-config.name: annotation. The replication controller in this example is also owned by {$DEPLOYMENTCONFIG}.
4.2.2.5. GET Request to Return the deploymentconfig Owner リンクのコピーリンクがクリップボードにコピーされました!
Request Header
Response Body Snippet
The returned deploymentconfig shows no owner, confirming that {$DEPLOYMENTCONFIG} is the sole owner of {$POD1} and {$POD2}.
4.2.2.6. GET Request to Return Scale リンクのコピーリンクがクリップボードにコピーされました!
Request Header
Response Body Snippet
... kind: Scale spec: replicas: 2 ...
...
kind: Scale
spec:
replicas: 2
...
The deploymentconfig has a replica value of 2. This will be used when updating the deploymentconfig to idle the resources.
4.2.2.7. PATCH Request to Update endpoint リンクのコピーリンクがクリップボードにコピーされました!
PATCH requests require JSON formatting.
Request Header
Request Body
The idling.alpha.openshift.io/idled-at: annotation indicates the time at which the endpoint is considered idled. The same annotation is used for the owner in the next step.
The idling.alpha.openshift.io/unidle-targets: annotation indicates that the endpoint will unidle the owner.
4.2.2.8. PUT Request to Update the deploymentconfig リンクのコピーリンクがクリップボードにコピーされました!
Request Header
Request Body Snippet
The PUT request uses the deploymentconfig returned in a previous request, modified with the following:
-
The idling.alpha.openshift.io/idled-at: annotation is added to indicate the time at which the endpoint is considered idled.
-
The idling.alpha.openshift.io/previous-scale: annotation is added, using the value from the previous
scalerequest. When the endpoint is unidled, this value will determine the number of replicas to scale. -
The replicas value is modified to
0.
4.3. Rollback リンクのコピーリンクがクリップボードにコピーされました!
4.3.1. Description of Function リンクのコピーリンクがクリップボードにコピーされました!
Revert an application back to a previous deployment.
When you run this command your deployment configuration will be updated to match a previous deployment. By default only the pod and container configuration will be changed and scaling or trigger settings will be left as-is. Note that environment variables and volumes are included in rollbacks; if you have recently updated security credentials in your environment your previous deployment may not have the correct values.
Any image triggers present in the rolled back configuration will be disabled with a warning. This is to help prevent your rolled back deployment from being replaced by a triggered deployment soon after your rollback.
Any version of the deploymentconfig can be used for the rollback request. Rolling back a deployment creates a new deployment version. All deployment reversions use rollback requests, whether rolling the version back or forward.
4.3.2. Rolling Back a Deployment リンクのコピーリンクがクリップボードにコピーされました!
4.3.2.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Deployment rollback consists of two requests:
-
A POST request to the
rollbacksubresource of the deployment. -
A PUT request to the deployment name in the
deploymentconfigsubresource of the namespace.
The POST request body specifies which elements of the deployment configuration version spec to be included in the returned deploymentconfig. The request returns a new deploymentconfig that represents the rollback state and can be used verbatim in the request body of the PUT request.
The PUT request body sends the returned deploymentconfig configuration to the deployment name in the subresource. This triggers a new deployment that effectively rolls back the deployment to the version specified in the returned deploymentconfig.
4.3.2.2. POST Request to Return deploymentconfig リンクのコピーリンクがクリップボードにコピーされました!
Request Header
Request Body
| Field Name | Description | Required | Type |
|---|---|---|---|
|
|
Returns the | True | Boolean |
|
|
Returns the | True | Boolean |
|
|
Returns the | True | Boolean |
|
|
Returns the | True | Boolean |
4.3.2.3. PUT Request to Revert Application to Previous Deployment リンクのコピーリンクがクリップボードにコピーされました!
Request Header
Request Body
Use the response body returned by the POST request as the request body. No changes are necessary.
4.4. Scale リンクのコピーリンクがクリップボードにコピーされました!
4.4.1. Description of Function リンクのコピーリンクがクリップボードにコピーされました!
Set a new size for a deployment, replicationcontroller, or job resources:
-
deploymentconfig: Modify the number of replica pods for the deployment. -
replicationcontroller: Modify the number of replicas maintained by a replication controller in a deployment. -
job: Modify the number of pod replicas running in parallel, executing a job.
4.4.2. Scaling a Deployment リンクのコピーリンクがクリップボードにコピーされました!
4.4.2.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Scaling a deployment consists of two requests:
-
A GET request to the
scalesubresource of the deployment. -
A PUT request with an updated
replicasvalue to thescalesubresource of the deployment.
The GET request returns the Scale configuration.
The GET request is optional if an updated Scale configuration can otherwise be provided for the PUT request.
Update the spec: replicas parameter in the Scale configuration. Send the configuration as the request body in a PUT request to the scale subresource of the deployment.
4.4.2.2. GET Request to Scale Deployment リンクのコピーリンクがクリップボードにコピーされました!
Request Header
4.4.2.3. PUT Request to Scale Deployment リンクのコピーリンクがクリップボードにコピーされました!
Request Header
Request Body Snippet
... spec: replicas: 3 ...
...
spec:
replicas: 3
...
4.4.3. Scaling a Replication Controller リンクのコピーリンクがクリップボードにコピーされました!
4.4.3.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Scaling a replication controller consists of two requests:
-
A GET request to the deployment name and version in the
replicationcontrollerssubresource of the namespace. -
A PUT request with an updated
replicasvalue to the same deployment in thereplicationcontrollersof the namespace.
The GET request returns the ReplicationController configuration.
The GET request is optional if an updated ReplicationController configuration can otherwise be provided for the PUT request. The ReplicationController configuration includes an encoded deploymentconfig for the deployment being scaled.
Update the spec: replicas parameter in the ReplicationController configuration. Send the configuration as the request body in a PUT request to the deployment replicationcontrollers resource.
4.4.3.2. GET Request for Deployment Replication Controller リンクのコピーリンクがクリップボードにコピーされました!
Request Header
4.4.3.3. PUT Request to Scale Replication Controller リンクのコピーリンクがクリップボードにコピーされました!
Request Header
Request Body Snippet
... spec: replicas: 3 ...
...
spec:
replicas: 3
...
4.4.4. Scaling a Job リンクのコピーリンクがクリップボードにコピーされました!
4.4.4.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Scaling a job consists of two requests:
-
A GET request to the job name in the
jobssubresource of the namespace . -
A PUT request with an updated
parallelismvalue to the job name in thejobssubresource of the namespace .
The GET request returns a Job configuration.
The GET request is optional if an updated Job configuration can otherwise be provided for the PUT request.
Update the spec: parallelism parameter in the Job configuration. Send the configuration as the request body in a PUT request to the deployment jobs subresource.
4.4.4.2. GET Request for Deployment Job リンクのコピーリンクがクリップボードにコピーされました!
Request Header
4.4.4.3. PUT Request to Scale Job リンクのコピーリンクがクリップボードにコピーされました!
Request Header
Request Body Snippet
... spec: parallelism: 3 ...
...
spec:
parallelism: 3
...
4.5. Routes リンクのコピーリンクがクリップボードにコピーされました!
4.5.1. Description of Resource リンクのコピーリンクがクリップボードにコピーされました!
A route allows developers to expose services through an HTTP(S) aware load balancing and proxy layer via a public DNS entry. The route may further specify TLS options and a certificate, or specify a public CNAME that the router should also accept for HTTP and HTTPS traffic. An administrator typically configures their router to be visible outside the cluster firewall, and may also add additional security, caching, or traffic controls on the service content. Routers usually talk directly to the service endpoints.
Once a route is created, the host field may not be changed. Generally, routers use the oldest route with a given host when resolving conflicts.
Routers are subject to additional customization and may support additional controls via the annotations field.
Because administrators may configure multiple routers, the route status field is used to return information to clients about the names and states of the route under each router. If a client chooses a duplicate name, for instance, the route status conditions are used to indicate the route cannot be chosen.
See the Architecture Guide and the Developer Guide for more information on routes, and the REST API Guide for complete field descriptions.
4.5.2. Creating a New Route リンクのコピーリンクがクリップボードにコピーされました!
4.5.2.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Creating a new route requires one request:
-
A POST request to the
routessubresource of the namespace.
The POST request uses a Route configuration in the request body.
The following request example uses the minimum required fields to expose a service with an insecure route.
4.5.2.2. POST Request to Create a New Route リンクのコピーリンクがクリップボードにコピーされました!
Request Header
Request Body
| Field.subfield | Description | Type |
|---|---|---|
|
| Map of string keys and values that can be used to organize and categorize (scope and select) objects. Used primarily for router sharding. May match selectors of replication controllers and services. | projectlabel |
|
| Name of the route. | routename |
| Field.subfield | Description | Type |
|---|---|---|
|
| Host is an optional alias/DNS that points to the service. If not specified, a route name will typically be automatically chosen. Must follow DNS952 subdomain conventions. | route-project.router.default.svc.cluster.local |
|
| If specified, the port to be used by the router. Most routers will use all endpoints exposed by the service by default - set this value to instruct routers which port to use. | 8080-tcp |
|
| Name of the service/target used for the route. | servicename |
|
| Weight as an integer between 1 and 256 that specifies the target’s relative weight against other target. reference objects | 1 |
|
| Name of an alternate service/target that is being referred to. | altservice |
|
| Weight as an integer between 1 and 256 that specifies the target’s relative weight against other target. | 1 |
|
| The tls field provides the ability to configure certificates and termination for the route. Options are 'edge', 'passthrough', 'reencrypt'. | edge |
|
| Wildcard policy, if any, for the route. Currently only 'Subdomain' or 'None' is allowed. | Subdomain |
4.5.3. Listing All Service Configurations in an Environment リンクのコピーリンクがクリップボードにコピーされました!
4.5.3.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Listing the configurations for all routes in an environment requires one request:
-
A GET request to the
routesresource.
The GET request returns the RouteList, listing the details of all routes in the environment.
4.5.3.2. GET Request to Return All Service Configurations in an Environment リンクのコピーリンクがクリップボードにコピーされました!
Request Header
4.5.4. Listing All Service Configurations in a Namespace リンクのコピーリンクがクリップボードにコピーされました!
4.5.4.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Listing the configurations for all services in a namespace requires one request:
-
A GET request to the
routessubresource of the namespace.
The GET request returns the RouteList, listing the details of all routes in the namespace.
4.5.4.2. GET Request to Return All Service Configurations in Namespace リンクのコピーリンクがクリップボードにコピーされました!
Request Header
4.5.5. Listing a Specific Route Configuration in a Namespace リンクのコピーリンクがクリップボードにコピーされました!
4.5.5.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Listing a specific Route configuration requires one request:
-
A GET request to the route name in the
routessubresource of the namespace.
The GET request returns the Route configuration for the specified route.
4.5.5.2. GET Request to Return Specific Route Configuration リンクのコピーリンクがクリップボードにコピーされました!
Request Header
4.5.6. Updating a Route Configuration リンクのコピーリンクがクリップボードにコピーされました!
Updating a Route configuration requires two requests:
-
A GET request to the route name in the
routessubresource of the namespace. -
A PATCH request with updated field values to the route name in the
routessubresource of the namespace.
The GET request is optional as the PATCH request body is not determined by the returned configuration, however it can be useful for preparing the PATCH request body.
4.5.6.1. PATCH Request to Update Route Configuration リンクのコピーリンクがクリップボードにコピーされました!
PATCH requests require JSON formatting.
The following PATCH request example adds an alternate service to the route and updates the original service with an equal weight:
Request Header
Request Body
4.5.7. Deleting a Route リンクのコピーリンクがクリップボードにコピーされました!
4.5.7.1. Request Breakdown リンクのコピーリンクがクリップボードにコピーされました!
Deleting a route requires one request:
-
A DELETE request to the route name in the
routessubresource of the namespace.
The DELETE request returns a code: 200 and the route is deleted.
4.5.7.2. DELETE Request to Delete a Route リンクのコピーリンクがクリップボードにコピーされました!
Request Header
Chapter 5. Resource Examples リンクのコピーリンクがクリップボードにコピーされました!
5.1. Preparing Resources Examples リンクのコピーリンクがクリップボードにコピーされました!
5.1.1. Project Configuration リンクのコピーリンクがクリップボードにコピーされました!
5.1.2. ServiceAccount Configuration リンクのコピーリンクがクリップボードにコピーされました!
5.1.3. RoleBinding Configuration リンクのコピーリンクがクリップボードにコピーされました!
5.1.4. Secret Configuration リンクのコピーリンクがクリップボードにコピーされました!
5.1.5. PersistentVolume Configuration リンクのコピーリンクがクリップボードにコピーされました!
5.1.6. PersistentVolumeClaim Configuration リンクのコピーリンクがクリップボードにコピーされました!
5.1.7. DeploymentConfig Configuration リンクのコピーリンクがクリップボードにコピーされました!
5.2. Build and Image Examples リンクのコピーリンクがクリップボードにコピーされました!
5.2.1. Build Configuration リンクのコピーリンクがクリップボードにコピーされました!
5.2.2. BuildConfig Configuration リンクのコピーリンクがクリップボードにコピーされました!
5.2.3. Image Configuration リンクのコピーリンクがクリップボードにコピーされました!
5.2.4. Image Stream Import Configuration リンクのコピーリンクがクリップボードにコピーされました!
5.2.5. Image Stream Configuration リンクのコピーリンクがクリップボードにコピーされました!
5.2.6. Image Stream Tag Configuration リンクのコピーリンクがクリップボードにコピーされました!
5.3. Project Management Resource Examples リンクのコピーリンクがクリップボードにコピーされました!
5.3.1. Scale Configuration リンクのコピーリンクがクリップボードにコピーされました!
5.3.2. ReplicationController Configuration リンクのコピーリンクがクリップボードにコピーされました!
5.3.3. Job Configuration リンクのコピーリンクがクリップボードにコピーされました!
5.3.4. Pod Configuration リンクのコピーリンクがクリップボードにコピーされました!
5.3.5. Route Configuration リンクのコピーリンクがクリップボードにコピーされました!
Legal Notice
リンクのコピーリンクがクリップボードにコピーされました!
Copyright © 2025 Red Hat
OpenShift documentation is licensed under the Apache License 2.0 (https://www.apache.org/licenses/LICENSE-2.0).
Modified versions must remove all Red Hat trademarks.
Portions adapted from https://github.com/kubernetes-incubator/service-catalog/ with modifications by Red Hat.
Red Hat, Red Hat Enterprise Linux, the Red Hat logo, the Shadowman logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat Software Collections is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation’s permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.