1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-29 02:45:06 +00:00

update APICall docs (#1534)

Signed-off-by: Jim Bugwadia <jim@nirmata.com>
This commit is contained in:
Jim Bugwadia 2021-02-03 13:10:02 -08:00 committed by GitHub
parent 32522e7827
commit ba9d003774
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 55 additions and 31 deletions

View file

@ -53,13 +53,13 @@ spec:
description: ContextEntry adds variables and data sources to a rule Context. Either a ConfigMap reference or a APILookup must be provided.
properties:
apiCall:
description: APICall is an API server request to retrieve data
description: APICall defines an HTTP request to the Kubernetes API server. The JSON data retrieved is stored in the context.
properties:
jmesPath:
description: JMESPath is an optional JSON Match Expression that can be used to transform the JSON response from the API server.
description: JMESPath is an optional JSON Match Expression that can be used to transform the JSON response returned from the API server. For example a JMESPath of "items | length(@)" applied to the API server response to the URLPath "/apis/apps/v1/deployments" will return the total count of deployments across all namespaces.
type: string
urlPath:
description: URLPath is the URL path to be used in the HTTP GET request
description: URLPath is the URL path to be used in the HTTP GET request to the Kubernetes API server (e.g. "/api/v1/namespaces" or "/apis/apps/v1/deployments"). The format required is the same format used by the `kubectl get --raw` command.
type: string
required:
- urlPath
@ -1276,13 +1276,13 @@ spec:
description: ContextEntry adds variables and data sources to a rule Context. Either a ConfigMap reference or a APILookup must be provided.
properties:
apiCall:
description: APICall is an API server request to retrieve data
description: APICall defines an HTTP request to the Kubernetes API server. The JSON data retrieved is stored in the context.
properties:
jmesPath:
description: JMESPath is an optional JSON Match Expression that can be used to transform the JSON response from the API server.
description: JMESPath is an optional JSON Match Expression that can be used to transform the JSON response returned from the API server. For example a JMESPath of "items | length(@)" applied to the API server response to the URLPath "/apis/apps/v1/deployments" will return the total count of deployments across all namespaces.
type: string
urlPath:
description: URLPath is the URL path to be used in the HTTP GET request
description: URLPath is the URL path to be used in the HTTP GET request to the Kubernetes API server (e.g. "/api/v1/namespaces" or "/apis/apps/v1/deployments"). The format required is the same format used by the `kubectl get --raw` command.
type: string
required:
- urlPath

View file

@ -71,17 +71,25 @@ spec:
must be provided.
properties:
apiCall:
description: APICall is an API server request to retrieve
data
description: APICall defines an HTTP request to the Kubernetes
API server. The JSON data retrieved is stored in the
context.
properties:
jmesPath:
description: JMESPath is an optional JSON Match Expression
that can be used to transform the JSON response
from the API server.
returned from the API server. For example a JMESPath
of "items | length(@)" applied to the API server
response to the URLPath "/apis/apps/v1/deployments"
will return the total count of deployments across
all namespaces.
type: string
urlPath:
description: URLPath is the URL path to be used in
the HTTP GET request
the HTTP GET request to the Kubernetes API server
(e.g. "/api/v1/namespaces" or "/apis/apps/v1/deployments").
The format required is the same format used by the
`kubectl get --raw` command.
type: string
required:
- urlPath

View file

@ -72,17 +72,25 @@ spec:
must be provided.
properties:
apiCall:
description: APICall is an API server request to retrieve
data
description: APICall defines an HTTP request to the Kubernetes
API server. The JSON data retrieved is stored in the
context.
properties:
jmesPath:
description: JMESPath is an optional JSON Match Expression
that can be used to transform the JSON response
from the API server.
returned from the API server. For example a JMESPath
of "items | length(@)" applied to the API server
response to the URLPath "/apis/apps/v1/deployments"
will return the total count of deployments across
all namespaces.
type: string
urlPath:
description: URLPath is the URL path to be used in
the HTTP GET request
the HTTP GET request to the Kubernetes API server
(e.g. "/api/v1/namespaces" or "/apis/apps/v1/deployments").
The format required is the same format used by the
`kubectl get --raw` command.
type: string
required:
- urlPath

View file

@ -58,13 +58,13 @@ spec:
description: ContextEntry adds variables and data sources to a rule Context. Either a ConfigMap reference or a APILookup must be provided.
properties:
apiCall:
description: APICall is an API server request to retrieve data
description: APICall defines an HTTP request to the Kubernetes API server. The JSON data retrieved is stored in the context.
properties:
jmesPath:
description: JMESPath is an optional JSON Match Expression that can be used to transform the JSON response from the API server.
description: JMESPath is an optional JSON Match Expression that can be used to transform the JSON response returned from the API server. For example a JMESPath of "items | length(@)" applied to the API server response to the URLPath "/apis/apps/v1/deployments" will return the total count of deployments across all namespaces.
type: string
urlPath:
description: URLPath is the URL path to be used in the HTTP GET request
description: URLPath is the URL path to be used in the HTTP GET request to the Kubernetes API server (e.g. "/api/v1/namespaces" or "/apis/apps/v1/deployments"). The format required is the same format used by the `kubectl get --raw` command.
type: string
required:
- urlPath
@ -1177,13 +1177,13 @@ spec:
description: ContextEntry adds variables and data sources to a rule Context. Either a ConfigMap reference or a APILookup must be provided.
properties:
apiCall:
description: APICall is an API server request to retrieve data
description: APICall defines an HTTP request to the Kubernetes API server. The JSON data retrieved is stored in the context.
properties:
jmesPath:
description: JMESPath is an optional JSON Match Expression that can be used to transform the JSON response from the API server.
description: JMESPath is an optional JSON Match Expression that can be used to transform the JSON response returned from the API server. For example a JMESPath of "items | length(@)" applied to the API server response to the URLPath "/apis/apps/v1/deployments" will return the total count of deployments across all namespaces.
type: string
urlPath:
description: URLPath is the URL path to be used in the HTTP GET request
description: URLPath is the URL path to be used in the HTTP GET request to the Kubernetes API server (e.g. "/api/v1/namespaces" or "/apis/apps/v1/deployments"). The format required is the same format used by the `kubectl get --raw` command.
type: string
required:
- urlPath

View file

@ -58,13 +58,13 @@ spec:
description: ContextEntry adds variables and data sources to a rule Context. Either a ConfigMap reference or a APILookup must be provided.
properties:
apiCall:
description: APICall is an API server request to retrieve data
description: APICall defines an HTTP request to the Kubernetes API server. The JSON data retrieved is stored in the context.
properties:
jmesPath:
description: JMESPath is an optional JSON Match Expression that can be used to transform the JSON response from the API server.
description: JMESPath is an optional JSON Match Expression that can be used to transform the JSON response returned from the API server. For example a JMESPath of "items | length(@)" applied to the API server response to the URLPath "/apis/apps/v1/deployments" will return the total count of deployments across all namespaces.
type: string
urlPath:
description: URLPath is the URL path to be used in the HTTP GET request
description: URLPath is the URL path to be used in the HTTP GET request to the Kubernetes API server (e.g. "/api/v1/namespaces" or "/apis/apps/v1/deployments"). The format required is the same format used by the `kubectl get --raw` command.
type: string
required:
- urlPath
@ -1177,13 +1177,13 @@ spec:
description: ContextEntry adds variables and data sources to a rule Context. Either a ConfigMap reference or a APILookup must be provided.
properties:
apiCall:
description: APICall is an API server request to retrieve data
description: APICall defines an HTTP request to the Kubernetes API server. The JSON data retrieved is stored in the context.
properties:
jmesPath:
description: JMESPath is an optional JSON Match Expression that can be used to transform the JSON response from the API server.
description: JMESPath is an optional JSON Match Expression that can be used to transform the JSON response returned from the API server. For example a JMESPath of "items | length(@)" applied to the API server response to the URLPath "/apis/apps/v1/deployments" will return the total count of deployments across all namespaces.
type: string
urlPath:
description: URLPath is the URL path to be used in the HTTP GET request
description: URLPath is the URL path to be used in the HTTP GET request to the Kubernetes API server (e.g. "/api/v1/namespaces" or "/apis/apps/v1/deployments"). The format required is the same format used by the `kubectl get --raw` command.
type: string
required:
- urlPath

View file

@ -108,7 +108,8 @@ type ContextEntry struct {
// ConfigMap is the ConfigMap reference.
ConfigMap *ConfigMapReference `json:"configMap,omitempty" yaml:"configMap,omitempty"`
// APICall is an API server request to retrieve data
// APICall defines an HTTP request to the Kubernetes API server. The JSON
// data retrieved is stored in the context.
APICall *APICall `json:"apiCall,omitempty" yaml:"apiCall,omitempty"`
}
@ -122,15 +123,22 @@ type ConfigMapReference struct {
Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty"`
}
// APICall contains an API server URL path used to perform an HTTP GET request
// and an optional JMESPath to transform the retrieved data.
// APICall defines an HTTP request to the Kubernetes API server. The JSON
// data retrieved is stored in the context. An APICall contains a URLPath
// used to perform the HTTP GET request and an optional JMESPath used to
// transform the retrieved JSON data.
type APICall struct {
// URLPath is the URL path to be used in the HTTP GET request
// URLPath is the URL path to be used in the HTTP GET request to the
// Kubernetes API server (e.g. "/api/v1/namespaces" or "/apis/apps/v1/deployments").
// The format required is the same format used by the `kubectl get --raw` command.
URLPath string `json:"urlPath" yaml:"urlPath"`
// JMESPath is an optional JSON Match Expression that can be used to
// transform the JSON response from the API server.
// transform the JSON response returned from the API server. For example
// a JMESPath of "items | length(@)" applied to the API server response
// to the URLPath "/apis/apps/v1/deployments" will return the total count
// of deployments across all namespaces.
// +optional
JMESPath string `json:"jmesPath,omitempty" yaml:"jmesPath,omitempty"`
}