Este conteúdo não está disponível no idioma selecionado.

Chapter 4. Template [template.openshift.io/v1]


Description

Template contains the inputs needed to produce a Config.

Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).

Type
object
Required
  • objects

4.1. Specification

PropertyTypeDescription

apiVersion

string

APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources

kind

string

Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds

labels

object (string)

labels is a optional set of labels that are applied to every object during the Template to Config transformation.

message

string

message is an optional instructional message that will be displayed when this template is instantiated. This field should inform the user how to utilize the newly created resources. Parameter substitution will be performed on the message before being displayed so that generated credentials and other parameters can be included in the output.

metadata

ObjectMeta_v2

metadata is the standard object’s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata

objects

array (RawExtension)

objects is an array of resources to include in this template. If a namespace value is hardcoded in the object, it will be removed during template instantiation, however if the namespace value is, or contains, a ${PARAMETER_REFERENCE}, the resolved value after parameter substitution will be respected and the object will be created in that namespace.

parameters

array

parameters is an optional array of Parameters used during the Template to Config transformation.

parameters[]

object

Parameter defines a name/value variable that is to be processed during the Template to Config transformation.

4.1.1. .parameters

Description
parameters is an optional array of Parameters used during the Template to Config transformation.
Type
array

4.1.2. .parameters[]

Description
Parameter defines a name/value variable that is to be processed during the Template to Config transformation.
Type
object
Required
  • name
PropertyTypeDescription

description

string

Description of a parameter. Optional.

displayName

string

Optional: The name that will show in UI instead of parameter 'Name'

from

string

From is an input value for the generator. Optional.

generate

string

generate specifies the generator to be used to generate random string from an input value specified by From field. The result string is stored into Value field. If empty, no generator is being used, leaving the result Value untouched. Optional.

The only supported generator is "expression", which accepts a "from" value in the form of a simple regular expression containing the range expression "[a-zA-Z0-9]", and the length expression "a{length}".

Examples:

from | value ----------------------------- "test[0-9]{1}x" | "test7x" "[0-1]{8}" | "01001100" "0x[A-F0-9]{4}" | "0xB3AF" "[a-zA-Z0-9]{8}" | "hW4yQU5i"

name

string

Name must be set and it can be referenced in Template Items using ${PARAMETER_NAME}. Required.

required

boolean

Optional: Indicates the parameter must have a value. Defaults to false.

value

string

Value holds the Parameter data. If specified, the generator will be ignored. The value replaces all occurrences of the Parameter ${Name} expression during the Template to Config transformation. Optional.

4.2. API endpoints

The following API endpoints are available:

  • /apis/template.openshift.io/v1/templates

    • GET: list or watch objects of kind Template
  • /apis/template.openshift.io/v1/watch/templates

    • GET: watch individual changes to a list of Template. deprecated: use the 'watch' parameter with a list operation instead.
  • /apis/template.openshift.io/v1/namespaces/{namespace}/templates

    • DELETE: delete collection of Template
    • GET: list or watch objects of kind Template
    • POST: create a Template
  • /apis/template.openshift.io/v1/watch/namespaces/{namespace}/templates

    • GET: watch individual changes to a list of Template. deprecated: use the 'watch' parameter with a list operation instead.
  • /apis/template.openshift.io/v1/namespaces/{namespace}/templates/{name}

    • DELETE: delete a Template
    • GET: read the specified Template
    • PATCH: partially update the specified Template
    • PUT: replace the specified Template
  • /apis/template.openshift.io/v1/namespaces/{namespace}/processedtemplates

    • POST: create a Template
  • /apis/template.openshift.io/v1/watch/namespaces/{namespace}/templates/{name}

    • GET: watch changes to an object of kind Template. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.

4.2.1. /apis/template.openshift.io/v1/templates

HTTP method
GET
Description
list or watch objects of kind Template
Table 4.1. HTTP responses
HTTP codeReponse body

200 - OK

TemplateList schema

401 - Unauthorized

Empty

4.2.2. /apis/template.openshift.io/v1/watch/templates

HTTP method
GET
Description
watch individual changes to a list of Template. deprecated: use the 'watch' parameter with a list operation instead.
Table 4.2. HTTP responses
HTTP codeReponse body

200 - OK

WatchEvent schema

401 - Unauthorized

Empty

4.2.3. /apis/template.openshift.io/v1/namespaces/{namespace}/templates

HTTP method
DELETE
Description
delete collection of Template
Table 4.3. Query parameters
ParameterTypeDescription

dryRun

string

When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed

Table 4.4. HTTP responses
HTTP codeReponse body

200 - OK

Status_v10 schema

401 - Unauthorized

Empty

HTTP method
GET
Description
list or watch objects of kind Template
Table 4.5. HTTP responses
HTTP codeReponse body

200 - OK

TemplateList schema

401 - Unauthorized

Empty

HTTP method
POST
Description
create a Template
Table 4.6. Query parameters
ParameterTypeDescription

dryRun

string

When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed

fieldValidation

string

fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.

Table 4.7. Body parameters
ParameterTypeDescription

body

Template schema

 
Table 4.8. HTTP responses
HTTP codeReponse body

200 - OK

Template schema

201 - Created

Template schema

202 - Accepted

Template schema

401 - Unauthorized

Empty

4.2.4. /apis/template.openshift.io/v1/watch/namespaces/{namespace}/templates

HTTP method
GET
Description
watch individual changes to a list of Template. deprecated: use the 'watch' parameter with a list operation instead.
Table 4.9. HTTP responses
HTTP codeReponse body

200 - OK

WatchEvent schema

401 - Unauthorized

Empty

4.2.5. /apis/template.openshift.io/v1/namespaces/{namespace}/templates/{name}

Table 4.10. Global path parameters
ParameterTypeDescription

name

string

name of the Template

HTTP method
DELETE
Description
delete a Template
Table 4.11. Query parameters
ParameterTypeDescription

dryRun

string

When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed

Table 4.12. HTTP responses
HTTP codeReponse body

200 - OK

Template schema

202 - Accepted

Template schema

401 - Unauthorized

Empty

HTTP method
GET
Description
read the specified Template
Table 4.13. HTTP responses
HTTP codeReponse body

200 - OK

Template schema

401 - Unauthorized

Empty

HTTP method
PATCH
Description
partially update the specified Template
Table 4.14. Query parameters
ParameterTypeDescription

dryRun

string

When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed

fieldValidation

string

fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.

Table 4.15. HTTP responses
HTTP codeReponse body

200 - OK

Template schema

201 - Created

Template schema

401 - Unauthorized

Empty

HTTP method
PUT
Description
replace the specified Template
Table 4.16. Query parameters
ParameterTypeDescription

dryRun

string

When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed

fieldValidation

string

fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.

Table 4.17. Body parameters
ParameterTypeDescription

body

Template schema

 
Table 4.18. HTTP responses
HTTP codeReponse body

200 - OK

Template schema

201 - Created

Template schema

401 - Unauthorized

Empty

4.2.6. /apis/template.openshift.io/v1/namespaces/{namespace}/processedtemplates

Table 4.19. Global query parameters
ParameterTypeDescription

dryRun

string

When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed

fieldValidation

string

fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.

HTTP method
POST
Description
create a Template
Table 4.20. Body parameters
ParameterTypeDescription

body

Template schema

 
Table 4.21. HTTP responses
HTTP codeReponse body

200 - OK

Template schema

201 - Created

Template schema

202 - Accepted

Template schema

401 - Unauthorized

Empty

4.2.7. /apis/template.openshift.io/v1/watch/namespaces/{namespace}/templates/{name}

Table 4.22. Global path parameters
ParameterTypeDescription

name

string

name of the Template

HTTP method
GET
Description
watch changes to an object of kind Template. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.
Table 4.23. HTTP responses
HTTP codeReponse body

200 - OK

WatchEvent schema

401 - Unauthorized

Empty

Red Hat logoGithubRedditYoutubeTwitter

Aprender

Experimente, compre e venda

Comunidades

Sobre a documentação da Red Hat

Ajudamos os usuários da Red Hat a inovar e atingir seus objetivos com nossos produtos e serviços com conteúdo em que podem confiar.

Tornando o open source mais inclusivo

A Red Hat está comprometida em substituir a linguagem problemática em nosso código, documentação e propriedades da web. Para mais detalhes veja oBlog da Red Hat.

Sobre a Red Hat

Fornecemos soluções robustas que facilitam o trabalho das empresas em plataformas e ambientes, desde o data center principal até a borda da rede.

© 2024 Red Hat, Inc.