Settings:
export KUBERNETES_BRANCH="release-1.10"
export CLIENT_VERSION="0.1.0a1"
export PACKAGE_NAME="client"
3421 lines
166 KiB
Go
3421 lines
166 KiB
Go
/*
|
|
* Kubernetes
|
|
*
|
|
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
|
*
|
|
* API version: v1.10.0
|
|
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
|
*/
|
|
|
|
package client
|
|
|
|
import (
|
|
"io/ioutil"
|
|
"net/url"
|
|
"net/http"
|
|
"strings"
|
|
"golang.org/x/net/context"
|
|
"encoding/json"
|
|
"fmt"
|
|
)
|
|
|
|
// Linger please
|
|
var (
|
|
_ context.Context
|
|
)
|
|
|
|
type RbacAuthorizationV1ApiService service
|
|
|
|
|
|
/* RbacAuthorizationV1ApiService
|
|
create a ClusterRole
|
|
* @param ctx context.Context for authentication, logging, tracing, etc.
|
|
@param body
|
|
@param optional (nil or map[string]interface{}) with one or more of:
|
|
@param "pretty" (string) If 'true', then the output is pretty printed.
|
|
@return V1ClusterRole*/
|
|
func (a *RbacAuthorizationV1ApiService) CreateClusterRole(ctx context.Context, body V1ClusterRole, localVarOptionals map[string]interface{}) (V1ClusterRole, *http.Response, error) {
|
|
var (
|
|
localVarHttpMethod = strings.ToUpper("Post")
|
|
localVarPostBody interface{}
|
|
localVarFileName string
|
|
localVarFileBytes []byte
|
|
successPayload V1ClusterRole
|
|
)
|
|
|
|
// create path and map variables
|
|
localVarPath := a.client.cfg.BasePath + "/apis/rbac.authorization.k8s.io/v1/clusterroles"
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
localVarQueryParams := url.Values{}
|
|
localVarFormParams := url.Values{}
|
|
|
|
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
|
|
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
|
|
}
|
|
// to determine the Content-Type header
|
|
localVarHttpContentTypes := []string{ "*/*", }
|
|
|
|
// set Content-Type header
|
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
|
if localVarHttpContentType != "" {
|
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
|
}
|
|
|
|
// to determine the Accept header
|
|
localVarHttpHeaderAccepts := []string{
|
|
"application/json",
|
|
"application/yaml",
|
|
"application/vnd.kubernetes.protobuf",
|
|
}
|
|
|
|
// set Accept header
|
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
|
if localVarHttpHeaderAccept != "" {
|
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
|
}
|
|
// body params
|
|
localVarPostBody = &body
|
|
if ctx != nil {
|
|
// API Key Authentication
|
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
|
var key string
|
|
if auth.Prefix != "" {
|
|
key = auth.Prefix + " " + auth.Key
|
|
} else {
|
|
key = auth.Key
|
|
}
|
|
localVarHeaderParams["authorization"] = key
|
|
}
|
|
}
|
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
|
if err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
localVarHttpResponse, err := a.client.callAPI(r)
|
|
if err != nil || localVarHttpResponse == nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
defer localVarHttpResponse.Body.Close()
|
|
if localVarHttpResponse.StatusCode >= 300 {
|
|
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
|
|
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
|
|
}
|
|
|
|
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
/* RbacAuthorizationV1ApiService
|
|
create a ClusterRoleBinding
|
|
* @param ctx context.Context for authentication, logging, tracing, etc.
|
|
@param body
|
|
@param optional (nil or map[string]interface{}) with one or more of:
|
|
@param "pretty" (string) If 'true', then the output is pretty printed.
|
|
@return V1ClusterRoleBinding*/
|
|
func (a *RbacAuthorizationV1ApiService) CreateClusterRoleBinding(ctx context.Context, body V1ClusterRoleBinding, localVarOptionals map[string]interface{}) (V1ClusterRoleBinding, *http.Response, error) {
|
|
var (
|
|
localVarHttpMethod = strings.ToUpper("Post")
|
|
localVarPostBody interface{}
|
|
localVarFileName string
|
|
localVarFileBytes []byte
|
|
successPayload V1ClusterRoleBinding
|
|
)
|
|
|
|
// create path and map variables
|
|
localVarPath := a.client.cfg.BasePath + "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings"
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
localVarQueryParams := url.Values{}
|
|
localVarFormParams := url.Values{}
|
|
|
|
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
|
|
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
|
|
}
|
|
// to determine the Content-Type header
|
|
localVarHttpContentTypes := []string{ "*/*", }
|
|
|
|
// set Content-Type header
|
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
|
if localVarHttpContentType != "" {
|
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
|
}
|
|
|
|
// to determine the Accept header
|
|
localVarHttpHeaderAccepts := []string{
|
|
"application/json",
|
|
"application/yaml",
|
|
"application/vnd.kubernetes.protobuf",
|
|
}
|
|
|
|
// set Accept header
|
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
|
if localVarHttpHeaderAccept != "" {
|
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
|
}
|
|
// body params
|
|
localVarPostBody = &body
|
|
if ctx != nil {
|
|
// API Key Authentication
|
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
|
var key string
|
|
if auth.Prefix != "" {
|
|
key = auth.Prefix + " " + auth.Key
|
|
} else {
|
|
key = auth.Key
|
|
}
|
|
localVarHeaderParams["authorization"] = key
|
|
}
|
|
}
|
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
|
if err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
localVarHttpResponse, err := a.client.callAPI(r)
|
|
if err != nil || localVarHttpResponse == nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
defer localVarHttpResponse.Body.Close()
|
|
if localVarHttpResponse.StatusCode >= 300 {
|
|
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
|
|
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
|
|
}
|
|
|
|
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
/* RbacAuthorizationV1ApiService
|
|
create a Role
|
|
* @param ctx context.Context for authentication, logging, tracing, etc.
|
|
@param namespace object name and auth scope, such as for teams and projects
|
|
@param body
|
|
@param optional (nil or map[string]interface{}) with one or more of:
|
|
@param "pretty" (string) If 'true', then the output is pretty printed.
|
|
@return V1Role*/
|
|
func (a *RbacAuthorizationV1ApiService) CreateNamespacedRole(ctx context.Context, namespace string, body V1Role, localVarOptionals map[string]interface{}) (V1Role, *http.Response, error) {
|
|
var (
|
|
localVarHttpMethod = strings.ToUpper("Post")
|
|
localVarPostBody interface{}
|
|
localVarFileName string
|
|
localVarFileBytes []byte
|
|
successPayload V1Role
|
|
)
|
|
|
|
// create path and map variables
|
|
localVarPath := a.client.cfg.BasePath + "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles"
|
|
localVarPath = strings.Replace(localVarPath, "{"+"namespace"+"}", fmt.Sprintf("%v", namespace), -1)
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
localVarQueryParams := url.Values{}
|
|
localVarFormParams := url.Values{}
|
|
|
|
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
|
|
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
|
|
}
|
|
// to determine the Content-Type header
|
|
localVarHttpContentTypes := []string{ "*/*", }
|
|
|
|
// set Content-Type header
|
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
|
if localVarHttpContentType != "" {
|
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
|
}
|
|
|
|
// to determine the Accept header
|
|
localVarHttpHeaderAccepts := []string{
|
|
"application/json",
|
|
"application/yaml",
|
|
"application/vnd.kubernetes.protobuf",
|
|
}
|
|
|
|
// set Accept header
|
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
|
if localVarHttpHeaderAccept != "" {
|
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
|
}
|
|
// body params
|
|
localVarPostBody = &body
|
|
if ctx != nil {
|
|
// API Key Authentication
|
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
|
var key string
|
|
if auth.Prefix != "" {
|
|
key = auth.Prefix + " " + auth.Key
|
|
} else {
|
|
key = auth.Key
|
|
}
|
|
localVarHeaderParams["authorization"] = key
|
|
}
|
|
}
|
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
|
if err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
localVarHttpResponse, err := a.client.callAPI(r)
|
|
if err != nil || localVarHttpResponse == nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
defer localVarHttpResponse.Body.Close()
|
|
if localVarHttpResponse.StatusCode >= 300 {
|
|
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
|
|
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
|
|
}
|
|
|
|
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
/* RbacAuthorizationV1ApiService
|
|
create a RoleBinding
|
|
* @param ctx context.Context for authentication, logging, tracing, etc.
|
|
@param namespace object name and auth scope, such as for teams and projects
|
|
@param body
|
|
@param optional (nil or map[string]interface{}) with one or more of:
|
|
@param "pretty" (string) If 'true', then the output is pretty printed.
|
|
@return V1RoleBinding*/
|
|
func (a *RbacAuthorizationV1ApiService) CreateNamespacedRoleBinding(ctx context.Context, namespace string, body V1RoleBinding, localVarOptionals map[string]interface{}) (V1RoleBinding, *http.Response, error) {
|
|
var (
|
|
localVarHttpMethod = strings.ToUpper("Post")
|
|
localVarPostBody interface{}
|
|
localVarFileName string
|
|
localVarFileBytes []byte
|
|
successPayload V1RoleBinding
|
|
)
|
|
|
|
// create path and map variables
|
|
localVarPath := a.client.cfg.BasePath + "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings"
|
|
localVarPath = strings.Replace(localVarPath, "{"+"namespace"+"}", fmt.Sprintf("%v", namespace), -1)
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
localVarQueryParams := url.Values{}
|
|
localVarFormParams := url.Values{}
|
|
|
|
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
|
|
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
|
|
}
|
|
// to determine the Content-Type header
|
|
localVarHttpContentTypes := []string{ "*/*", }
|
|
|
|
// set Content-Type header
|
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
|
if localVarHttpContentType != "" {
|
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
|
}
|
|
|
|
// to determine the Accept header
|
|
localVarHttpHeaderAccepts := []string{
|
|
"application/json",
|
|
"application/yaml",
|
|
"application/vnd.kubernetes.protobuf",
|
|
}
|
|
|
|
// set Accept header
|
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
|
if localVarHttpHeaderAccept != "" {
|
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
|
}
|
|
// body params
|
|
localVarPostBody = &body
|
|
if ctx != nil {
|
|
// API Key Authentication
|
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
|
var key string
|
|
if auth.Prefix != "" {
|
|
key = auth.Prefix + " " + auth.Key
|
|
} else {
|
|
key = auth.Key
|
|
}
|
|
localVarHeaderParams["authorization"] = key
|
|
}
|
|
}
|
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
|
if err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
localVarHttpResponse, err := a.client.callAPI(r)
|
|
if err != nil || localVarHttpResponse == nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
defer localVarHttpResponse.Body.Close()
|
|
if localVarHttpResponse.StatusCode >= 300 {
|
|
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
|
|
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
|
|
}
|
|
|
|
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
/* RbacAuthorizationV1ApiService
|
|
delete a ClusterRole
|
|
* @param ctx context.Context for authentication, logging, tracing, etc.
|
|
@param name name of the ClusterRole
|
|
@param body
|
|
@param optional (nil or map[string]interface{}) with one or more of:
|
|
@param "pretty" (string) If 'true', then the output is pretty printed.
|
|
@param "gracePeriodSeconds" (int32) The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.
|
|
@param "orphanDependents" (bool) Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.
|
|
@param "propagationPolicy" (string) Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.
|
|
@return V1Status*/
|
|
func (a *RbacAuthorizationV1ApiService) DeleteClusterRole(ctx context.Context, name string, body V1DeleteOptions, localVarOptionals map[string]interface{}) (V1Status, *http.Response, error) {
|
|
var (
|
|
localVarHttpMethod = strings.ToUpper("Delete")
|
|
localVarPostBody interface{}
|
|
localVarFileName string
|
|
localVarFileBytes []byte
|
|
successPayload V1Status
|
|
)
|
|
|
|
// create path and map variables
|
|
localVarPath := a.client.cfg.BasePath + "/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}"
|
|
localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1)
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
localVarQueryParams := url.Values{}
|
|
localVarFormParams := url.Values{}
|
|
|
|
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["gracePeriodSeconds"], "int32", "gracePeriodSeconds"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["orphanDependents"], "bool", "orphanDependents"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["propagationPolicy"], "string", "propagationPolicy"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
|
|
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["gracePeriodSeconds"].(int32); localVarOk {
|
|
localVarQueryParams.Add("gracePeriodSeconds", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["orphanDependents"].(bool); localVarOk {
|
|
localVarQueryParams.Add("orphanDependents", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["propagationPolicy"].(string); localVarOk {
|
|
localVarQueryParams.Add("propagationPolicy", parameterToString(localVarTempParam, ""))
|
|
}
|
|
// to determine the Content-Type header
|
|
localVarHttpContentTypes := []string{ "*/*", }
|
|
|
|
// set Content-Type header
|
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
|
if localVarHttpContentType != "" {
|
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
|
}
|
|
|
|
// to determine the Accept header
|
|
localVarHttpHeaderAccepts := []string{
|
|
"application/json",
|
|
"application/yaml",
|
|
"application/vnd.kubernetes.protobuf",
|
|
}
|
|
|
|
// set Accept header
|
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
|
if localVarHttpHeaderAccept != "" {
|
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
|
}
|
|
// body params
|
|
localVarPostBody = &body
|
|
if ctx != nil {
|
|
// API Key Authentication
|
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
|
var key string
|
|
if auth.Prefix != "" {
|
|
key = auth.Prefix + " " + auth.Key
|
|
} else {
|
|
key = auth.Key
|
|
}
|
|
localVarHeaderParams["authorization"] = key
|
|
}
|
|
}
|
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
|
if err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
localVarHttpResponse, err := a.client.callAPI(r)
|
|
if err != nil || localVarHttpResponse == nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
defer localVarHttpResponse.Body.Close()
|
|
if localVarHttpResponse.StatusCode >= 300 {
|
|
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
|
|
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
|
|
}
|
|
|
|
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
/* RbacAuthorizationV1ApiService
|
|
delete a ClusterRoleBinding
|
|
* @param ctx context.Context for authentication, logging, tracing, etc.
|
|
@param name name of the ClusterRoleBinding
|
|
@param body
|
|
@param optional (nil or map[string]interface{}) with one or more of:
|
|
@param "pretty" (string) If 'true', then the output is pretty printed.
|
|
@param "gracePeriodSeconds" (int32) The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.
|
|
@param "orphanDependents" (bool) Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.
|
|
@param "propagationPolicy" (string) Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.
|
|
@return V1Status*/
|
|
func (a *RbacAuthorizationV1ApiService) DeleteClusterRoleBinding(ctx context.Context, name string, body V1DeleteOptions, localVarOptionals map[string]interface{}) (V1Status, *http.Response, error) {
|
|
var (
|
|
localVarHttpMethod = strings.ToUpper("Delete")
|
|
localVarPostBody interface{}
|
|
localVarFileName string
|
|
localVarFileBytes []byte
|
|
successPayload V1Status
|
|
)
|
|
|
|
// create path and map variables
|
|
localVarPath := a.client.cfg.BasePath + "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}"
|
|
localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1)
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
localVarQueryParams := url.Values{}
|
|
localVarFormParams := url.Values{}
|
|
|
|
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["gracePeriodSeconds"], "int32", "gracePeriodSeconds"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["orphanDependents"], "bool", "orphanDependents"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["propagationPolicy"], "string", "propagationPolicy"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
|
|
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["gracePeriodSeconds"].(int32); localVarOk {
|
|
localVarQueryParams.Add("gracePeriodSeconds", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["orphanDependents"].(bool); localVarOk {
|
|
localVarQueryParams.Add("orphanDependents", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["propagationPolicy"].(string); localVarOk {
|
|
localVarQueryParams.Add("propagationPolicy", parameterToString(localVarTempParam, ""))
|
|
}
|
|
// to determine the Content-Type header
|
|
localVarHttpContentTypes := []string{ "*/*", }
|
|
|
|
// set Content-Type header
|
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
|
if localVarHttpContentType != "" {
|
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
|
}
|
|
|
|
// to determine the Accept header
|
|
localVarHttpHeaderAccepts := []string{
|
|
"application/json",
|
|
"application/yaml",
|
|
"application/vnd.kubernetes.protobuf",
|
|
}
|
|
|
|
// set Accept header
|
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
|
if localVarHttpHeaderAccept != "" {
|
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
|
}
|
|
// body params
|
|
localVarPostBody = &body
|
|
if ctx != nil {
|
|
// API Key Authentication
|
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
|
var key string
|
|
if auth.Prefix != "" {
|
|
key = auth.Prefix + " " + auth.Key
|
|
} else {
|
|
key = auth.Key
|
|
}
|
|
localVarHeaderParams["authorization"] = key
|
|
}
|
|
}
|
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
|
if err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
localVarHttpResponse, err := a.client.callAPI(r)
|
|
if err != nil || localVarHttpResponse == nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
defer localVarHttpResponse.Body.Close()
|
|
if localVarHttpResponse.StatusCode >= 300 {
|
|
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
|
|
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
|
|
}
|
|
|
|
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
/* RbacAuthorizationV1ApiService
|
|
delete collection of ClusterRole
|
|
* @param ctx context.Context for authentication, logging, tracing, etc.
|
|
@param optional (nil or map[string]interface{}) with one or more of:
|
|
@param "pretty" (string) If 'true', then the output is pretty printed.
|
|
@param "continue_" (string) The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.
|
|
@param "fieldSelector" (string) A selector to restrict the list of returned objects by their fields. Defaults to everything.
|
|
@param "includeUninitialized" (bool) If true, partially initialized resources are included in the response.
|
|
@param "labelSelector" (string) A selector to restrict the list of returned objects by their labels. Defaults to everything.
|
|
@param "limit" (int32) limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.
|
|
@param "resourceVersion" (string) When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.
|
|
@param "timeoutSeconds" (int32) Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.
|
|
@param "watch" (bool) Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.
|
|
@return V1Status*/
|
|
func (a *RbacAuthorizationV1ApiService) DeleteCollectionClusterRole(ctx context.Context, localVarOptionals map[string]interface{}) (V1Status, *http.Response, error) {
|
|
var (
|
|
localVarHttpMethod = strings.ToUpper("Delete")
|
|
localVarPostBody interface{}
|
|
localVarFileName string
|
|
localVarFileBytes []byte
|
|
successPayload V1Status
|
|
)
|
|
|
|
// create path and map variables
|
|
localVarPath := a.client.cfg.BasePath + "/apis/rbac.authorization.k8s.io/v1/clusterroles"
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
localVarQueryParams := url.Values{}
|
|
localVarFormParams := url.Values{}
|
|
|
|
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["continue_"], "string", "continue_"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["fieldSelector"], "string", "fieldSelector"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["includeUninitialized"], "bool", "includeUninitialized"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["labelSelector"], "string", "labelSelector"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["resourceVersion"], "string", "resourceVersion"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["timeoutSeconds"], "int32", "timeoutSeconds"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["watch"], "bool", "watch"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
|
|
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["continue_"].(string); localVarOk {
|
|
localVarQueryParams.Add("continue", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["fieldSelector"].(string); localVarOk {
|
|
localVarQueryParams.Add("fieldSelector", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["includeUninitialized"].(bool); localVarOk {
|
|
localVarQueryParams.Add("includeUninitialized", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["labelSelector"].(string); localVarOk {
|
|
localVarQueryParams.Add("labelSelector", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk {
|
|
localVarQueryParams.Add("limit", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["resourceVersion"].(string); localVarOk {
|
|
localVarQueryParams.Add("resourceVersion", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["timeoutSeconds"].(int32); localVarOk {
|
|
localVarQueryParams.Add("timeoutSeconds", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["watch"].(bool); localVarOk {
|
|
localVarQueryParams.Add("watch", parameterToString(localVarTempParam, ""))
|
|
}
|
|
// to determine the Content-Type header
|
|
localVarHttpContentTypes := []string{ "*/*", }
|
|
|
|
// set Content-Type header
|
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
|
if localVarHttpContentType != "" {
|
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
|
}
|
|
|
|
// to determine the Accept header
|
|
localVarHttpHeaderAccepts := []string{
|
|
"application/json",
|
|
"application/yaml",
|
|
"application/vnd.kubernetes.protobuf",
|
|
}
|
|
|
|
// set Accept header
|
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
|
if localVarHttpHeaderAccept != "" {
|
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
|
}
|
|
if ctx != nil {
|
|
// API Key Authentication
|
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
|
var key string
|
|
if auth.Prefix != "" {
|
|
key = auth.Prefix + " " + auth.Key
|
|
} else {
|
|
key = auth.Key
|
|
}
|
|
localVarHeaderParams["authorization"] = key
|
|
}
|
|
}
|
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
|
if err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
localVarHttpResponse, err := a.client.callAPI(r)
|
|
if err != nil || localVarHttpResponse == nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
defer localVarHttpResponse.Body.Close()
|
|
if localVarHttpResponse.StatusCode >= 300 {
|
|
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
|
|
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
|
|
}
|
|
|
|
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
/* RbacAuthorizationV1ApiService
|
|
delete collection of ClusterRoleBinding
|
|
* @param ctx context.Context for authentication, logging, tracing, etc.
|
|
@param optional (nil or map[string]interface{}) with one or more of:
|
|
@param "pretty" (string) If 'true', then the output is pretty printed.
|
|
@param "continue_" (string) The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.
|
|
@param "fieldSelector" (string) A selector to restrict the list of returned objects by their fields. Defaults to everything.
|
|
@param "includeUninitialized" (bool) If true, partially initialized resources are included in the response.
|
|
@param "labelSelector" (string) A selector to restrict the list of returned objects by their labels. Defaults to everything.
|
|
@param "limit" (int32) limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.
|
|
@param "resourceVersion" (string) When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.
|
|
@param "timeoutSeconds" (int32) Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.
|
|
@param "watch" (bool) Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.
|
|
@return V1Status*/
|
|
func (a *RbacAuthorizationV1ApiService) DeleteCollectionClusterRoleBinding(ctx context.Context, localVarOptionals map[string]interface{}) (V1Status, *http.Response, error) {
|
|
var (
|
|
localVarHttpMethod = strings.ToUpper("Delete")
|
|
localVarPostBody interface{}
|
|
localVarFileName string
|
|
localVarFileBytes []byte
|
|
successPayload V1Status
|
|
)
|
|
|
|
// create path and map variables
|
|
localVarPath := a.client.cfg.BasePath + "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings"
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
localVarQueryParams := url.Values{}
|
|
localVarFormParams := url.Values{}
|
|
|
|
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["continue_"], "string", "continue_"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["fieldSelector"], "string", "fieldSelector"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["includeUninitialized"], "bool", "includeUninitialized"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["labelSelector"], "string", "labelSelector"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["resourceVersion"], "string", "resourceVersion"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["timeoutSeconds"], "int32", "timeoutSeconds"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["watch"], "bool", "watch"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
|
|
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["continue_"].(string); localVarOk {
|
|
localVarQueryParams.Add("continue", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["fieldSelector"].(string); localVarOk {
|
|
localVarQueryParams.Add("fieldSelector", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["includeUninitialized"].(bool); localVarOk {
|
|
localVarQueryParams.Add("includeUninitialized", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["labelSelector"].(string); localVarOk {
|
|
localVarQueryParams.Add("labelSelector", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk {
|
|
localVarQueryParams.Add("limit", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["resourceVersion"].(string); localVarOk {
|
|
localVarQueryParams.Add("resourceVersion", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["timeoutSeconds"].(int32); localVarOk {
|
|
localVarQueryParams.Add("timeoutSeconds", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["watch"].(bool); localVarOk {
|
|
localVarQueryParams.Add("watch", parameterToString(localVarTempParam, ""))
|
|
}
|
|
// to determine the Content-Type header
|
|
localVarHttpContentTypes := []string{ "*/*", }
|
|
|
|
// set Content-Type header
|
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
|
if localVarHttpContentType != "" {
|
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
|
}
|
|
|
|
// to determine the Accept header
|
|
localVarHttpHeaderAccepts := []string{
|
|
"application/json",
|
|
"application/yaml",
|
|
"application/vnd.kubernetes.protobuf",
|
|
}
|
|
|
|
// set Accept header
|
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
|
if localVarHttpHeaderAccept != "" {
|
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
|
}
|
|
if ctx != nil {
|
|
// API Key Authentication
|
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
|
var key string
|
|
if auth.Prefix != "" {
|
|
key = auth.Prefix + " " + auth.Key
|
|
} else {
|
|
key = auth.Key
|
|
}
|
|
localVarHeaderParams["authorization"] = key
|
|
}
|
|
}
|
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
|
if err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
localVarHttpResponse, err := a.client.callAPI(r)
|
|
if err != nil || localVarHttpResponse == nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
defer localVarHttpResponse.Body.Close()
|
|
if localVarHttpResponse.StatusCode >= 300 {
|
|
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
|
|
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
|
|
}
|
|
|
|
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
/* RbacAuthorizationV1ApiService
|
|
delete collection of Role
|
|
* @param ctx context.Context for authentication, logging, tracing, etc.
|
|
@param namespace object name and auth scope, such as for teams and projects
|
|
@param optional (nil or map[string]interface{}) with one or more of:
|
|
@param "pretty" (string) If 'true', then the output is pretty printed.
|
|
@param "continue_" (string) The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.
|
|
@param "fieldSelector" (string) A selector to restrict the list of returned objects by their fields. Defaults to everything.
|
|
@param "includeUninitialized" (bool) If true, partially initialized resources are included in the response.
|
|
@param "labelSelector" (string) A selector to restrict the list of returned objects by their labels. Defaults to everything.
|
|
@param "limit" (int32) limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.
|
|
@param "resourceVersion" (string) When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.
|
|
@param "timeoutSeconds" (int32) Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.
|
|
@param "watch" (bool) Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.
|
|
@return V1Status*/
|
|
func (a *RbacAuthorizationV1ApiService) DeleteCollectionNamespacedRole(ctx context.Context, namespace string, localVarOptionals map[string]interface{}) (V1Status, *http.Response, error) {
|
|
var (
|
|
localVarHttpMethod = strings.ToUpper("Delete")
|
|
localVarPostBody interface{}
|
|
localVarFileName string
|
|
localVarFileBytes []byte
|
|
successPayload V1Status
|
|
)
|
|
|
|
// create path and map variables
|
|
localVarPath := a.client.cfg.BasePath + "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles"
|
|
localVarPath = strings.Replace(localVarPath, "{"+"namespace"+"}", fmt.Sprintf("%v", namespace), -1)
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
localVarQueryParams := url.Values{}
|
|
localVarFormParams := url.Values{}
|
|
|
|
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["continue_"], "string", "continue_"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["fieldSelector"], "string", "fieldSelector"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["includeUninitialized"], "bool", "includeUninitialized"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["labelSelector"], "string", "labelSelector"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["resourceVersion"], "string", "resourceVersion"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["timeoutSeconds"], "int32", "timeoutSeconds"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["watch"], "bool", "watch"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
|
|
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["continue_"].(string); localVarOk {
|
|
localVarQueryParams.Add("continue", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["fieldSelector"].(string); localVarOk {
|
|
localVarQueryParams.Add("fieldSelector", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["includeUninitialized"].(bool); localVarOk {
|
|
localVarQueryParams.Add("includeUninitialized", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["labelSelector"].(string); localVarOk {
|
|
localVarQueryParams.Add("labelSelector", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk {
|
|
localVarQueryParams.Add("limit", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["resourceVersion"].(string); localVarOk {
|
|
localVarQueryParams.Add("resourceVersion", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["timeoutSeconds"].(int32); localVarOk {
|
|
localVarQueryParams.Add("timeoutSeconds", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["watch"].(bool); localVarOk {
|
|
localVarQueryParams.Add("watch", parameterToString(localVarTempParam, ""))
|
|
}
|
|
// to determine the Content-Type header
|
|
localVarHttpContentTypes := []string{ "*/*", }
|
|
|
|
// set Content-Type header
|
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
|
if localVarHttpContentType != "" {
|
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
|
}
|
|
|
|
// to determine the Accept header
|
|
localVarHttpHeaderAccepts := []string{
|
|
"application/json",
|
|
"application/yaml",
|
|
"application/vnd.kubernetes.protobuf",
|
|
}
|
|
|
|
// set Accept header
|
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
|
if localVarHttpHeaderAccept != "" {
|
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
|
}
|
|
if ctx != nil {
|
|
// API Key Authentication
|
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
|
var key string
|
|
if auth.Prefix != "" {
|
|
key = auth.Prefix + " " + auth.Key
|
|
} else {
|
|
key = auth.Key
|
|
}
|
|
localVarHeaderParams["authorization"] = key
|
|
}
|
|
}
|
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
|
if err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
localVarHttpResponse, err := a.client.callAPI(r)
|
|
if err != nil || localVarHttpResponse == nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
defer localVarHttpResponse.Body.Close()
|
|
if localVarHttpResponse.StatusCode >= 300 {
|
|
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
|
|
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
|
|
}
|
|
|
|
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
/* RbacAuthorizationV1ApiService
|
|
delete collection of RoleBinding
|
|
* @param ctx context.Context for authentication, logging, tracing, etc.
|
|
@param namespace object name and auth scope, such as for teams and projects
|
|
@param optional (nil or map[string]interface{}) with one or more of:
|
|
@param "pretty" (string) If 'true', then the output is pretty printed.
|
|
@param "continue_" (string) The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.
|
|
@param "fieldSelector" (string) A selector to restrict the list of returned objects by their fields. Defaults to everything.
|
|
@param "includeUninitialized" (bool) If true, partially initialized resources are included in the response.
|
|
@param "labelSelector" (string) A selector to restrict the list of returned objects by their labels. Defaults to everything.
|
|
@param "limit" (int32) limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.
|
|
@param "resourceVersion" (string) When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.
|
|
@param "timeoutSeconds" (int32) Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.
|
|
@param "watch" (bool) Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.
|
|
@return V1Status*/
|
|
func (a *RbacAuthorizationV1ApiService) DeleteCollectionNamespacedRoleBinding(ctx context.Context, namespace string, localVarOptionals map[string]interface{}) (V1Status, *http.Response, error) {
|
|
var (
|
|
localVarHttpMethod = strings.ToUpper("Delete")
|
|
localVarPostBody interface{}
|
|
localVarFileName string
|
|
localVarFileBytes []byte
|
|
successPayload V1Status
|
|
)
|
|
|
|
// create path and map variables
|
|
localVarPath := a.client.cfg.BasePath + "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings"
|
|
localVarPath = strings.Replace(localVarPath, "{"+"namespace"+"}", fmt.Sprintf("%v", namespace), -1)
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
localVarQueryParams := url.Values{}
|
|
localVarFormParams := url.Values{}
|
|
|
|
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["continue_"], "string", "continue_"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["fieldSelector"], "string", "fieldSelector"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["includeUninitialized"], "bool", "includeUninitialized"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["labelSelector"], "string", "labelSelector"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["resourceVersion"], "string", "resourceVersion"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["timeoutSeconds"], "int32", "timeoutSeconds"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["watch"], "bool", "watch"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
|
|
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["continue_"].(string); localVarOk {
|
|
localVarQueryParams.Add("continue", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["fieldSelector"].(string); localVarOk {
|
|
localVarQueryParams.Add("fieldSelector", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["includeUninitialized"].(bool); localVarOk {
|
|
localVarQueryParams.Add("includeUninitialized", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["labelSelector"].(string); localVarOk {
|
|
localVarQueryParams.Add("labelSelector", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk {
|
|
localVarQueryParams.Add("limit", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["resourceVersion"].(string); localVarOk {
|
|
localVarQueryParams.Add("resourceVersion", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["timeoutSeconds"].(int32); localVarOk {
|
|
localVarQueryParams.Add("timeoutSeconds", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["watch"].(bool); localVarOk {
|
|
localVarQueryParams.Add("watch", parameterToString(localVarTempParam, ""))
|
|
}
|
|
// to determine the Content-Type header
|
|
localVarHttpContentTypes := []string{ "*/*", }
|
|
|
|
// set Content-Type header
|
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
|
if localVarHttpContentType != "" {
|
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
|
}
|
|
|
|
// to determine the Accept header
|
|
localVarHttpHeaderAccepts := []string{
|
|
"application/json",
|
|
"application/yaml",
|
|
"application/vnd.kubernetes.protobuf",
|
|
}
|
|
|
|
// set Accept header
|
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
|
if localVarHttpHeaderAccept != "" {
|
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
|
}
|
|
if ctx != nil {
|
|
// API Key Authentication
|
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
|
var key string
|
|
if auth.Prefix != "" {
|
|
key = auth.Prefix + " " + auth.Key
|
|
} else {
|
|
key = auth.Key
|
|
}
|
|
localVarHeaderParams["authorization"] = key
|
|
}
|
|
}
|
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
|
if err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
localVarHttpResponse, err := a.client.callAPI(r)
|
|
if err != nil || localVarHttpResponse == nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
defer localVarHttpResponse.Body.Close()
|
|
if localVarHttpResponse.StatusCode >= 300 {
|
|
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
|
|
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
|
|
}
|
|
|
|
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
/* RbacAuthorizationV1ApiService
|
|
delete a Role
|
|
* @param ctx context.Context for authentication, logging, tracing, etc.
|
|
@param name name of the Role
|
|
@param namespace object name and auth scope, such as for teams and projects
|
|
@param body
|
|
@param optional (nil or map[string]interface{}) with one or more of:
|
|
@param "pretty" (string) If 'true', then the output is pretty printed.
|
|
@param "gracePeriodSeconds" (int32) The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.
|
|
@param "orphanDependents" (bool) Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.
|
|
@param "propagationPolicy" (string) Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.
|
|
@return V1Status*/
|
|
func (a *RbacAuthorizationV1ApiService) DeleteNamespacedRole(ctx context.Context, name string, namespace string, body V1DeleteOptions, localVarOptionals map[string]interface{}) (V1Status, *http.Response, error) {
|
|
var (
|
|
localVarHttpMethod = strings.ToUpper("Delete")
|
|
localVarPostBody interface{}
|
|
localVarFileName string
|
|
localVarFileBytes []byte
|
|
successPayload V1Status
|
|
)
|
|
|
|
// create path and map variables
|
|
localVarPath := a.client.cfg.BasePath + "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}"
|
|
localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1)
|
|
localVarPath = strings.Replace(localVarPath, "{"+"namespace"+"}", fmt.Sprintf("%v", namespace), -1)
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
localVarQueryParams := url.Values{}
|
|
localVarFormParams := url.Values{}
|
|
|
|
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["gracePeriodSeconds"], "int32", "gracePeriodSeconds"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["orphanDependents"], "bool", "orphanDependents"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["propagationPolicy"], "string", "propagationPolicy"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
|
|
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["gracePeriodSeconds"].(int32); localVarOk {
|
|
localVarQueryParams.Add("gracePeriodSeconds", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["orphanDependents"].(bool); localVarOk {
|
|
localVarQueryParams.Add("orphanDependents", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["propagationPolicy"].(string); localVarOk {
|
|
localVarQueryParams.Add("propagationPolicy", parameterToString(localVarTempParam, ""))
|
|
}
|
|
// to determine the Content-Type header
|
|
localVarHttpContentTypes := []string{ "*/*", }
|
|
|
|
// set Content-Type header
|
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
|
if localVarHttpContentType != "" {
|
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
|
}
|
|
|
|
// to determine the Accept header
|
|
localVarHttpHeaderAccepts := []string{
|
|
"application/json",
|
|
"application/yaml",
|
|
"application/vnd.kubernetes.protobuf",
|
|
}
|
|
|
|
// set Accept header
|
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
|
if localVarHttpHeaderAccept != "" {
|
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
|
}
|
|
// body params
|
|
localVarPostBody = &body
|
|
if ctx != nil {
|
|
// API Key Authentication
|
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
|
var key string
|
|
if auth.Prefix != "" {
|
|
key = auth.Prefix + " " + auth.Key
|
|
} else {
|
|
key = auth.Key
|
|
}
|
|
localVarHeaderParams["authorization"] = key
|
|
}
|
|
}
|
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
|
if err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
localVarHttpResponse, err := a.client.callAPI(r)
|
|
if err != nil || localVarHttpResponse == nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
defer localVarHttpResponse.Body.Close()
|
|
if localVarHttpResponse.StatusCode >= 300 {
|
|
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
|
|
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
|
|
}
|
|
|
|
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
/* RbacAuthorizationV1ApiService
|
|
delete a RoleBinding
|
|
* @param ctx context.Context for authentication, logging, tracing, etc.
|
|
@param name name of the RoleBinding
|
|
@param namespace object name and auth scope, such as for teams and projects
|
|
@param body
|
|
@param optional (nil or map[string]interface{}) with one or more of:
|
|
@param "pretty" (string) If 'true', then the output is pretty printed.
|
|
@param "gracePeriodSeconds" (int32) The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.
|
|
@param "orphanDependents" (bool) Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.
|
|
@param "propagationPolicy" (string) Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.
|
|
@return V1Status*/
|
|
func (a *RbacAuthorizationV1ApiService) DeleteNamespacedRoleBinding(ctx context.Context, name string, namespace string, body V1DeleteOptions, localVarOptionals map[string]interface{}) (V1Status, *http.Response, error) {
|
|
var (
|
|
localVarHttpMethod = strings.ToUpper("Delete")
|
|
localVarPostBody interface{}
|
|
localVarFileName string
|
|
localVarFileBytes []byte
|
|
successPayload V1Status
|
|
)
|
|
|
|
// create path and map variables
|
|
localVarPath := a.client.cfg.BasePath + "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}"
|
|
localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1)
|
|
localVarPath = strings.Replace(localVarPath, "{"+"namespace"+"}", fmt.Sprintf("%v", namespace), -1)
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
localVarQueryParams := url.Values{}
|
|
localVarFormParams := url.Values{}
|
|
|
|
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["gracePeriodSeconds"], "int32", "gracePeriodSeconds"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["orphanDependents"], "bool", "orphanDependents"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["propagationPolicy"], "string", "propagationPolicy"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
|
|
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["gracePeriodSeconds"].(int32); localVarOk {
|
|
localVarQueryParams.Add("gracePeriodSeconds", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["orphanDependents"].(bool); localVarOk {
|
|
localVarQueryParams.Add("orphanDependents", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["propagationPolicy"].(string); localVarOk {
|
|
localVarQueryParams.Add("propagationPolicy", parameterToString(localVarTempParam, ""))
|
|
}
|
|
// to determine the Content-Type header
|
|
localVarHttpContentTypes := []string{ "*/*", }
|
|
|
|
// set Content-Type header
|
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
|
if localVarHttpContentType != "" {
|
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
|
}
|
|
|
|
// to determine the Accept header
|
|
localVarHttpHeaderAccepts := []string{
|
|
"application/json",
|
|
"application/yaml",
|
|
"application/vnd.kubernetes.protobuf",
|
|
}
|
|
|
|
// set Accept header
|
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
|
if localVarHttpHeaderAccept != "" {
|
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
|
}
|
|
// body params
|
|
localVarPostBody = &body
|
|
if ctx != nil {
|
|
// API Key Authentication
|
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
|
var key string
|
|
if auth.Prefix != "" {
|
|
key = auth.Prefix + " " + auth.Key
|
|
} else {
|
|
key = auth.Key
|
|
}
|
|
localVarHeaderParams["authorization"] = key
|
|
}
|
|
}
|
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
|
if err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
localVarHttpResponse, err := a.client.callAPI(r)
|
|
if err != nil || localVarHttpResponse == nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
defer localVarHttpResponse.Body.Close()
|
|
if localVarHttpResponse.StatusCode >= 300 {
|
|
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
|
|
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
|
|
}
|
|
|
|
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
/* RbacAuthorizationV1ApiService
|
|
get available resources
|
|
* @param ctx context.Context for authentication, logging, tracing, etc.
|
|
@return V1ApiResourceList*/
|
|
func (a *RbacAuthorizationV1ApiService) GetAPIResources(ctx context.Context) (V1ApiResourceList, *http.Response, error) {
|
|
var (
|
|
localVarHttpMethod = strings.ToUpper("Get")
|
|
localVarPostBody interface{}
|
|
localVarFileName string
|
|
localVarFileBytes []byte
|
|
successPayload V1ApiResourceList
|
|
)
|
|
|
|
// create path and map variables
|
|
localVarPath := a.client.cfg.BasePath + "/apis/rbac.authorization.k8s.io/v1/"
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
localVarQueryParams := url.Values{}
|
|
localVarFormParams := url.Values{}
|
|
|
|
|
|
// to determine the Content-Type header
|
|
localVarHttpContentTypes := []string{ "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", }
|
|
|
|
// set Content-Type header
|
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
|
if localVarHttpContentType != "" {
|
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
|
}
|
|
|
|
// to determine the Accept header
|
|
localVarHttpHeaderAccepts := []string{
|
|
"application/json",
|
|
"application/yaml",
|
|
"application/vnd.kubernetes.protobuf",
|
|
}
|
|
|
|
// set Accept header
|
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
|
if localVarHttpHeaderAccept != "" {
|
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
|
}
|
|
if ctx != nil {
|
|
// API Key Authentication
|
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
|
var key string
|
|
if auth.Prefix != "" {
|
|
key = auth.Prefix + " " + auth.Key
|
|
} else {
|
|
key = auth.Key
|
|
}
|
|
localVarHeaderParams["authorization"] = key
|
|
}
|
|
}
|
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
|
if err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
localVarHttpResponse, err := a.client.callAPI(r)
|
|
if err != nil || localVarHttpResponse == nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
defer localVarHttpResponse.Body.Close()
|
|
if localVarHttpResponse.StatusCode >= 300 {
|
|
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
|
|
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
|
|
}
|
|
|
|
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
/* RbacAuthorizationV1ApiService
|
|
list or watch objects of kind ClusterRole
|
|
* @param ctx context.Context for authentication, logging, tracing, etc.
|
|
@param optional (nil or map[string]interface{}) with one or more of:
|
|
@param "pretty" (string) If 'true', then the output is pretty printed.
|
|
@param "continue_" (string) The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.
|
|
@param "fieldSelector" (string) A selector to restrict the list of returned objects by their fields. Defaults to everything.
|
|
@param "includeUninitialized" (bool) If true, partially initialized resources are included in the response.
|
|
@param "labelSelector" (string) A selector to restrict the list of returned objects by their labels. Defaults to everything.
|
|
@param "limit" (int32) limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.
|
|
@param "resourceVersion" (string) When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.
|
|
@param "timeoutSeconds" (int32) Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.
|
|
@param "watch" (bool) Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.
|
|
@return V1ClusterRoleList*/
|
|
func (a *RbacAuthorizationV1ApiService) ListClusterRole(ctx context.Context, localVarOptionals map[string]interface{}) (V1ClusterRoleList, *http.Response, error) {
|
|
var (
|
|
localVarHttpMethod = strings.ToUpper("Get")
|
|
localVarPostBody interface{}
|
|
localVarFileName string
|
|
localVarFileBytes []byte
|
|
successPayload V1ClusterRoleList
|
|
)
|
|
|
|
// create path and map variables
|
|
localVarPath := a.client.cfg.BasePath + "/apis/rbac.authorization.k8s.io/v1/clusterroles"
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
localVarQueryParams := url.Values{}
|
|
localVarFormParams := url.Values{}
|
|
|
|
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["continue_"], "string", "continue_"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["fieldSelector"], "string", "fieldSelector"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["includeUninitialized"], "bool", "includeUninitialized"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["labelSelector"], "string", "labelSelector"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["resourceVersion"], "string", "resourceVersion"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["timeoutSeconds"], "int32", "timeoutSeconds"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["watch"], "bool", "watch"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
|
|
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["continue_"].(string); localVarOk {
|
|
localVarQueryParams.Add("continue", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["fieldSelector"].(string); localVarOk {
|
|
localVarQueryParams.Add("fieldSelector", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["includeUninitialized"].(bool); localVarOk {
|
|
localVarQueryParams.Add("includeUninitialized", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["labelSelector"].(string); localVarOk {
|
|
localVarQueryParams.Add("labelSelector", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk {
|
|
localVarQueryParams.Add("limit", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["resourceVersion"].(string); localVarOk {
|
|
localVarQueryParams.Add("resourceVersion", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["timeoutSeconds"].(int32); localVarOk {
|
|
localVarQueryParams.Add("timeoutSeconds", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["watch"].(bool); localVarOk {
|
|
localVarQueryParams.Add("watch", parameterToString(localVarTempParam, ""))
|
|
}
|
|
// to determine the Content-Type header
|
|
localVarHttpContentTypes := []string{ "*/*", }
|
|
|
|
// set Content-Type header
|
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
|
if localVarHttpContentType != "" {
|
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
|
}
|
|
|
|
// to determine the Accept header
|
|
localVarHttpHeaderAccepts := []string{
|
|
"application/json",
|
|
"application/yaml",
|
|
"application/vnd.kubernetes.protobuf",
|
|
"application/json;stream=watch",
|
|
"application/vnd.kubernetes.protobuf;stream=watch",
|
|
}
|
|
|
|
// set Accept header
|
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
|
if localVarHttpHeaderAccept != "" {
|
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
|
}
|
|
if ctx != nil {
|
|
// API Key Authentication
|
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
|
var key string
|
|
if auth.Prefix != "" {
|
|
key = auth.Prefix + " " + auth.Key
|
|
} else {
|
|
key = auth.Key
|
|
}
|
|
localVarHeaderParams["authorization"] = key
|
|
}
|
|
}
|
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
|
if err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
localVarHttpResponse, err := a.client.callAPI(r)
|
|
if err != nil || localVarHttpResponse == nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
defer localVarHttpResponse.Body.Close()
|
|
if localVarHttpResponse.StatusCode >= 300 {
|
|
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
|
|
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
|
|
}
|
|
|
|
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
/* RbacAuthorizationV1ApiService
|
|
list or watch objects of kind ClusterRoleBinding
|
|
* @param ctx context.Context for authentication, logging, tracing, etc.
|
|
@param optional (nil or map[string]interface{}) with one or more of:
|
|
@param "pretty" (string) If 'true', then the output is pretty printed.
|
|
@param "continue_" (string) The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.
|
|
@param "fieldSelector" (string) A selector to restrict the list of returned objects by their fields. Defaults to everything.
|
|
@param "includeUninitialized" (bool) If true, partially initialized resources are included in the response.
|
|
@param "labelSelector" (string) A selector to restrict the list of returned objects by their labels. Defaults to everything.
|
|
@param "limit" (int32) limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.
|
|
@param "resourceVersion" (string) When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.
|
|
@param "timeoutSeconds" (int32) Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.
|
|
@param "watch" (bool) Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.
|
|
@return V1ClusterRoleBindingList*/
|
|
func (a *RbacAuthorizationV1ApiService) ListClusterRoleBinding(ctx context.Context, localVarOptionals map[string]interface{}) (V1ClusterRoleBindingList, *http.Response, error) {
|
|
var (
|
|
localVarHttpMethod = strings.ToUpper("Get")
|
|
localVarPostBody interface{}
|
|
localVarFileName string
|
|
localVarFileBytes []byte
|
|
successPayload V1ClusterRoleBindingList
|
|
)
|
|
|
|
// create path and map variables
|
|
localVarPath := a.client.cfg.BasePath + "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings"
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
localVarQueryParams := url.Values{}
|
|
localVarFormParams := url.Values{}
|
|
|
|
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["continue_"], "string", "continue_"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["fieldSelector"], "string", "fieldSelector"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["includeUninitialized"], "bool", "includeUninitialized"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["labelSelector"], "string", "labelSelector"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["resourceVersion"], "string", "resourceVersion"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["timeoutSeconds"], "int32", "timeoutSeconds"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["watch"], "bool", "watch"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
|
|
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["continue_"].(string); localVarOk {
|
|
localVarQueryParams.Add("continue", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["fieldSelector"].(string); localVarOk {
|
|
localVarQueryParams.Add("fieldSelector", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["includeUninitialized"].(bool); localVarOk {
|
|
localVarQueryParams.Add("includeUninitialized", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["labelSelector"].(string); localVarOk {
|
|
localVarQueryParams.Add("labelSelector", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk {
|
|
localVarQueryParams.Add("limit", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["resourceVersion"].(string); localVarOk {
|
|
localVarQueryParams.Add("resourceVersion", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["timeoutSeconds"].(int32); localVarOk {
|
|
localVarQueryParams.Add("timeoutSeconds", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["watch"].(bool); localVarOk {
|
|
localVarQueryParams.Add("watch", parameterToString(localVarTempParam, ""))
|
|
}
|
|
// to determine the Content-Type header
|
|
localVarHttpContentTypes := []string{ "*/*", }
|
|
|
|
// set Content-Type header
|
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
|
if localVarHttpContentType != "" {
|
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
|
}
|
|
|
|
// to determine the Accept header
|
|
localVarHttpHeaderAccepts := []string{
|
|
"application/json",
|
|
"application/yaml",
|
|
"application/vnd.kubernetes.protobuf",
|
|
"application/json;stream=watch",
|
|
"application/vnd.kubernetes.protobuf;stream=watch",
|
|
}
|
|
|
|
// set Accept header
|
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
|
if localVarHttpHeaderAccept != "" {
|
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
|
}
|
|
if ctx != nil {
|
|
// API Key Authentication
|
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
|
var key string
|
|
if auth.Prefix != "" {
|
|
key = auth.Prefix + " " + auth.Key
|
|
} else {
|
|
key = auth.Key
|
|
}
|
|
localVarHeaderParams["authorization"] = key
|
|
}
|
|
}
|
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
|
if err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
localVarHttpResponse, err := a.client.callAPI(r)
|
|
if err != nil || localVarHttpResponse == nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
defer localVarHttpResponse.Body.Close()
|
|
if localVarHttpResponse.StatusCode >= 300 {
|
|
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
|
|
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
|
|
}
|
|
|
|
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
/* RbacAuthorizationV1ApiService
|
|
list or watch objects of kind Role
|
|
* @param ctx context.Context for authentication, logging, tracing, etc.
|
|
@param namespace object name and auth scope, such as for teams and projects
|
|
@param optional (nil or map[string]interface{}) with one or more of:
|
|
@param "pretty" (string) If 'true', then the output is pretty printed.
|
|
@param "continue_" (string) The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.
|
|
@param "fieldSelector" (string) A selector to restrict the list of returned objects by their fields. Defaults to everything.
|
|
@param "includeUninitialized" (bool) If true, partially initialized resources are included in the response.
|
|
@param "labelSelector" (string) A selector to restrict the list of returned objects by their labels. Defaults to everything.
|
|
@param "limit" (int32) limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.
|
|
@param "resourceVersion" (string) When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.
|
|
@param "timeoutSeconds" (int32) Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.
|
|
@param "watch" (bool) Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.
|
|
@return V1RoleList*/
|
|
func (a *RbacAuthorizationV1ApiService) ListNamespacedRole(ctx context.Context, namespace string, localVarOptionals map[string]interface{}) (V1RoleList, *http.Response, error) {
|
|
var (
|
|
localVarHttpMethod = strings.ToUpper("Get")
|
|
localVarPostBody interface{}
|
|
localVarFileName string
|
|
localVarFileBytes []byte
|
|
successPayload V1RoleList
|
|
)
|
|
|
|
// create path and map variables
|
|
localVarPath := a.client.cfg.BasePath + "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles"
|
|
localVarPath = strings.Replace(localVarPath, "{"+"namespace"+"}", fmt.Sprintf("%v", namespace), -1)
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
localVarQueryParams := url.Values{}
|
|
localVarFormParams := url.Values{}
|
|
|
|
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["continue_"], "string", "continue_"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["fieldSelector"], "string", "fieldSelector"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["includeUninitialized"], "bool", "includeUninitialized"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["labelSelector"], "string", "labelSelector"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["resourceVersion"], "string", "resourceVersion"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["timeoutSeconds"], "int32", "timeoutSeconds"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["watch"], "bool", "watch"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
|
|
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["continue_"].(string); localVarOk {
|
|
localVarQueryParams.Add("continue", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["fieldSelector"].(string); localVarOk {
|
|
localVarQueryParams.Add("fieldSelector", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["includeUninitialized"].(bool); localVarOk {
|
|
localVarQueryParams.Add("includeUninitialized", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["labelSelector"].(string); localVarOk {
|
|
localVarQueryParams.Add("labelSelector", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk {
|
|
localVarQueryParams.Add("limit", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["resourceVersion"].(string); localVarOk {
|
|
localVarQueryParams.Add("resourceVersion", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["timeoutSeconds"].(int32); localVarOk {
|
|
localVarQueryParams.Add("timeoutSeconds", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["watch"].(bool); localVarOk {
|
|
localVarQueryParams.Add("watch", parameterToString(localVarTempParam, ""))
|
|
}
|
|
// to determine the Content-Type header
|
|
localVarHttpContentTypes := []string{ "*/*", }
|
|
|
|
// set Content-Type header
|
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
|
if localVarHttpContentType != "" {
|
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
|
}
|
|
|
|
// to determine the Accept header
|
|
localVarHttpHeaderAccepts := []string{
|
|
"application/json",
|
|
"application/yaml",
|
|
"application/vnd.kubernetes.protobuf",
|
|
"application/json;stream=watch",
|
|
"application/vnd.kubernetes.protobuf;stream=watch",
|
|
}
|
|
|
|
// set Accept header
|
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
|
if localVarHttpHeaderAccept != "" {
|
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
|
}
|
|
if ctx != nil {
|
|
// API Key Authentication
|
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
|
var key string
|
|
if auth.Prefix != "" {
|
|
key = auth.Prefix + " " + auth.Key
|
|
} else {
|
|
key = auth.Key
|
|
}
|
|
localVarHeaderParams["authorization"] = key
|
|
}
|
|
}
|
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
|
if err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
localVarHttpResponse, err := a.client.callAPI(r)
|
|
if err != nil || localVarHttpResponse == nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
defer localVarHttpResponse.Body.Close()
|
|
if localVarHttpResponse.StatusCode >= 300 {
|
|
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
|
|
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
|
|
}
|
|
|
|
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
/* RbacAuthorizationV1ApiService
|
|
list or watch objects of kind RoleBinding
|
|
* @param ctx context.Context for authentication, logging, tracing, etc.
|
|
@param namespace object name and auth scope, such as for teams and projects
|
|
@param optional (nil or map[string]interface{}) with one or more of:
|
|
@param "pretty" (string) If 'true', then the output is pretty printed.
|
|
@param "continue_" (string) The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.
|
|
@param "fieldSelector" (string) A selector to restrict the list of returned objects by their fields. Defaults to everything.
|
|
@param "includeUninitialized" (bool) If true, partially initialized resources are included in the response.
|
|
@param "labelSelector" (string) A selector to restrict the list of returned objects by their labels. Defaults to everything.
|
|
@param "limit" (int32) limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.
|
|
@param "resourceVersion" (string) When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.
|
|
@param "timeoutSeconds" (int32) Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.
|
|
@param "watch" (bool) Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.
|
|
@return V1RoleBindingList*/
|
|
func (a *RbacAuthorizationV1ApiService) ListNamespacedRoleBinding(ctx context.Context, namespace string, localVarOptionals map[string]interface{}) (V1RoleBindingList, *http.Response, error) {
|
|
var (
|
|
localVarHttpMethod = strings.ToUpper("Get")
|
|
localVarPostBody interface{}
|
|
localVarFileName string
|
|
localVarFileBytes []byte
|
|
successPayload V1RoleBindingList
|
|
)
|
|
|
|
// create path and map variables
|
|
localVarPath := a.client.cfg.BasePath + "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings"
|
|
localVarPath = strings.Replace(localVarPath, "{"+"namespace"+"}", fmt.Sprintf("%v", namespace), -1)
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
localVarQueryParams := url.Values{}
|
|
localVarFormParams := url.Values{}
|
|
|
|
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["continue_"], "string", "continue_"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["fieldSelector"], "string", "fieldSelector"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["includeUninitialized"], "bool", "includeUninitialized"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["labelSelector"], "string", "labelSelector"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["resourceVersion"], "string", "resourceVersion"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["timeoutSeconds"], "int32", "timeoutSeconds"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["watch"], "bool", "watch"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
|
|
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["continue_"].(string); localVarOk {
|
|
localVarQueryParams.Add("continue", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["fieldSelector"].(string); localVarOk {
|
|
localVarQueryParams.Add("fieldSelector", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["includeUninitialized"].(bool); localVarOk {
|
|
localVarQueryParams.Add("includeUninitialized", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["labelSelector"].(string); localVarOk {
|
|
localVarQueryParams.Add("labelSelector", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk {
|
|
localVarQueryParams.Add("limit", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["resourceVersion"].(string); localVarOk {
|
|
localVarQueryParams.Add("resourceVersion", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["timeoutSeconds"].(int32); localVarOk {
|
|
localVarQueryParams.Add("timeoutSeconds", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["watch"].(bool); localVarOk {
|
|
localVarQueryParams.Add("watch", parameterToString(localVarTempParam, ""))
|
|
}
|
|
// to determine the Content-Type header
|
|
localVarHttpContentTypes := []string{ "*/*", }
|
|
|
|
// set Content-Type header
|
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
|
if localVarHttpContentType != "" {
|
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
|
}
|
|
|
|
// to determine the Accept header
|
|
localVarHttpHeaderAccepts := []string{
|
|
"application/json",
|
|
"application/yaml",
|
|
"application/vnd.kubernetes.protobuf",
|
|
"application/json;stream=watch",
|
|
"application/vnd.kubernetes.protobuf;stream=watch",
|
|
}
|
|
|
|
// set Accept header
|
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
|
if localVarHttpHeaderAccept != "" {
|
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
|
}
|
|
if ctx != nil {
|
|
// API Key Authentication
|
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
|
var key string
|
|
if auth.Prefix != "" {
|
|
key = auth.Prefix + " " + auth.Key
|
|
} else {
|
|
key = auth.Key
|
|
}
|
|
localVarHeaderParams["authorization"] = key
|
|
}
|
|
}
|
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
|
if err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
localVarHttpResponse, err := a.client.callAPI(r)
|
|
if err != nil || localVarHttpResponse == nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
defer localVarHttpResponse.Body.Close()
|
|
if localVarHttpResponse.StatusCode >= 300 {
|
|
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
|
|
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
|
|
}
|
|
|
|
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
/* RbacAuthorizationV1ApiService
|
|
list or watch objects of kind RoleBinding
|
|
* @param ctx context.Context for authentication, logging, tracing, etc.
|
|
@param optional (nil or map[string]interface{}) with one or more of:
|
|
@param "continue_" (string) The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.
|
|
@param "fieldSelector" (string) A selector to restrict the list of returned objects by their fields. Defaults to everything.
|
|
@param "includeUninitialized" (bool) If true, partially initialized resources are included in the response.
|
|
@param "labelSelector" (string) A selector to restrict the list of returned objects by their labels. Defaults to everything.
|
|
@param "limit" (int32) limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.
|
|
@param "pretty" (string) If 'true', then the output is pretty printed.
|
|
@param "resourceVersion" (string) When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.
|
|
@param "timeoutSeconds" (int32) Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.
|
|
@param "watch" (bool) Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.
|
|
@return V1RoleBindingList*/
|
|
func (a *RbacAuthorizationV1ApiService) ListRoleBindingForAllNamespaces(ctx context.Context, localVarOptionals map[string]interface{}) (V1RoleBindingList, *http.Response, error) {
|
|
var (
|
|
localVarHttpMethod = strings.ToUpper("Get")
|
|
localVarPostBody interface{}
|
|
localVarFileName string
|
|
localVarFileBytes []byte
|
|
successPayload V1RoleBindingList
|
|
)
|
|
|
|
// create path and map variables
|
|
localVarPath := a.client.cfg.BasePath + "/apis/rbac.authorization.k8s.io/v1/rolebindings"
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
localVarQueryParams := url.Values{}
|
|
localVarFormParams := url.Values{}
|
|
|
|
if err := typeCheckParameter(localVarOptionals["continue_"], "string", "continue_"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["fieldSelector"], "string", "fieldSelector"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["includeUninitialized"], "bool", "includeUninitialized"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["labelSelector"], "string", "labelSelector"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["resourceVersion"], "string", "resourceVersion"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["timeoutSeconds"], "int32", "timeoutSeconds"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["watch"], "bool", "watch"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
if localVarTempParam, localVarOk := localVarOptionals["continue_"].(string); localVarOk {
|
|
localVarQueryParams.Add("continue", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["fieldSelector"].(string); localVarOk {
|
|
localVarQueryParams.Add("fieldSelector", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["includeUninitialized"].(bool); localVarOk {
|
|
localVarQueryParams.Add("includeUninitialized", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["labelSelector"].(string); localVarOk {
|
|
localVarQueryParams.Add("labelSelector", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk {
|
|
localVarQueryParams.Add("limit", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
|
|
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["resourceVersion"].(string); localVarOk {
|
|
localVarQueryParams.Add("resourceVersion", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["timeoutSeconds"].(int32); localVarOk {
|
|
localVarQueryParams.Add("timeoutSeconds", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["watch"].(bool); localVarOk {
|
|
localVarQueryParams.Add("watch", parameterToString(localVarTempParam, ""))
|
|
}
|
|
// to determine the Content-Type header
|
|
localVarHttpContentTypes := []string{ "*/*", }
|
|
|
|
// set Content-Type header
|
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
|
if localVarHttpContentType != "" {
|
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
|
}
|
|
|
|
// to determine the Accept header
|
|
localVarHttpHeaderAccepts := []string{
|
|
"application/json",
|
|
"application/yaml",
|
|
"application/vnd.kubernetes.protobuf",
|
|
"application/json;stream=watch",
|
|
"application/vnd.kubernetes.protobuf;stream=watch",
|
|
}
|
|
|
|
// set Accept header
|
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
|
if localVarHttpHeaderAccept != "" {
|
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
|
}
|
|
if ctx != nil {
|
|
// API Key Authentication
|
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
|
var key string
|
|
if auth.Prefix != "" {
|
|
key = auth.Prefix + " " + auth.Key
|
|
} else {
|
|
key = auth.Key
|
|
}
|
|
localVarHeaderParams["authorization"] = key
|
|
}
|
|
}
|
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
|
if err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
localVarHttpResponse, err := a.client.callAPI(r)
|
|
if err != nil || localVarHttpResponse == nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
defer localVarHttpResponse.Body.Close()
|
|
if localVarHttpResponse.StatusCode >= 300 {
|
|
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
|
|
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
|
|
}
|
|
|
|
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
/* RbacAuthorizationV1ApiService
|
|
list or watch objects of kind Role
|
|
* @param ctx context.Context for authentication, logging, tracing, etc.
|
|
@param optional (nil or map[string]interface{}) with one or more of:
|
|
@param "continue_" (string) The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.
|
|
@param "fieldSelector" (string) A selector to restrict the list of returned objects by their fields. Defaults to everything.
|
|
@param "includeUninitialized" (bool) If true, partially initialized resources are included in the response.
|
|
@param "labelSelector" (string) A selector to restrict the list of returned objects by their labels. Defaults to everything.
|
|
@param "limit" (int32) limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.
|
|
@param "pretty" (string) If 'true', then the output is pretty printed.
|
|
@param "resourceVersion" (string) When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.
|
|
@param "timeoutSeconds" (int32) Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.
|
|
@param "watch" (bool) Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.
|
|
@return V1RoleList*/
|
|
func (a *RbacAuthorizationV1ApiService) ListRoleForAllNamespaces(ctx context.Context, localVarOptionals map[string]interface{}) (V1RoleList, *http.Response, error) {
|
|
var (
|
|
localVarHttpMethod = strings.ToUpper("Get")
|
|
localVarPostBody interface{}
|
|
localVarFileName string
|
|
localVarFileBytes []byte
|
|
successPayload V1RoleList
|
|
)
|
|
|
|
// create path and map variables
|
|
localVarPath := a.client.cfg.BasePath + "/apis/rbac.authorization.k8s.io/v1/roles"
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
localVarQueryParams := url.Values{}
|
|
localVarFormParams := url.Values{}
|
|
|
|
if err := typeCheckParameter(localVarOptionals["continue_"], "string", "continue_"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["fieldSelector"], "string", "fieldSelector"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["includeUninitialized"], "bool", "includeUninitialized"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["labelSelector"], "string", "labelSelector"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["resourceVersion"], "string", "resourceVersion"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["timeoutSeconds"], "int32", "timeoutSeconds"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
if err := typeCheckParameter(localVarOptionals["watch"], "bool", "watch"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
if localVarTempParam, localVarOk := localVarOptionals["continue_"].(string); localVarOk {
|
|
localVarQueryParams.Add("continue", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["fieldSelector"].(string); localVarOk {
|
|
localVarQueryParams.Add("fieldSelector", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["includeUninitialized"].(bool); localVarOk {
|
|
localVarQueryParams.Add("includeUninitialized", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["labelSelector"].(string); localVarOk {
|
|
localVarQueryParams.Add("labelSelector", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk {
|
|
localVarQueryParams.Add("limit", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
|
|
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["resourceVersion"].(string); localVarOk {
|
|
localVarQueryParams.Add("resourceVersion", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["timeoutSeconds"].(int32); localVarOk {
|
|
localVarQueryParams.Add("timeoutSeconds", parameterToString(localVarTempParam, ""))
|
|
}
|
|
if localVarTempParam, localVarOk := localVarOptionals["watch"].(bool); localVarOk {
|
|
localVarQueryParams.Add("watch", parameterToString(localVarTempParam, ""))
|
|
}
|
|
// to determine the Content-Type header
|
|
localVarHttpContentTypes := []string{ "*/*", }
|
|
|
|
// set Content-Type header
|
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
|
if localVarHttpContentType != "" {
|
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
|
}
|
|
|
|
// to determine the Accept header
|
|
localVarHttpHeaderAccepts := []string{
|
|
"application/json",
|
|
"application/yaml",
|
|
"application/vnd.kubernetes.protobuf",
|
|
"application/json;stream=watch",
|
|
"application/vnd.kubernetes.protobuf;stream=watch",
|
|
}
|
|
|
|
// set Accept header
|
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
|
if localVarHttpHeaderAccept != "" {
|
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
|
}
|
|
if ctx != nil {
|
|
// API Key Authentication
|
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
|
var key string
|
|
if auth.Prefix != "" {
|
|
key = auth.Prefix + " " + auth.Key
|
|
} else {
|
|
key = auth.Key
|
|
}
|
|
localVarHeaderParams["authorization"] = key
|
|
}
|
|
}
|
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
|
if err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
localVarHttpResponse, err := a.client.callAPI(r)
|
|
if err != nil || localVarHttpResponse == nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
defer localVarHttpResponse.Body.Close()
|
|
if localVarHttpResponse.StatusCode >= 300 {
|
|
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
|
|
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
|
|
}
|
|
|
|
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
/* RbacAuthorizationV1ApiService
|
|
partially update the specified ClusterRole
|
|
* @param ctx context.Context for authentication, logging, tracing, etc.
|
|
@param name name of the ClusterRole
|
|
@param body
|
|
@param optional (nil or map[string]interface{}) with one or more of:
|
|
@param "pretty" (string) If 'true', then the output is pretty printed.
|
|
@return V1ClusterRole*/
|
|
func (a *RbacAuthorizationV1ApiService) PatchClusterRole(ctx context.Context, name string, body interface{}, localVarOptionals map[string]interface{}) (V1ClusterRole, *http.Response, error) {
|
|
var (
|
|
localVarHttpMethod = strings.ToUpper("Patch")
|
|
localVarPostBody interface{}
|
|
localVarFileName string
|
|
localVarFileBytes []byte
|
|
successPayload V1ClusterRole
|
|
)
|
|
|
|
// create path and map variables
|
|
localVarPath := a.client.cfg.BasePath + "/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}"
|
|
localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1)
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
localVarQueryParams := url.Values{}
|
|
localVarFormParams := url.Values{}
|
|
|
|
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
|
|
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
|
|
}
|
|
// to determine the Content-Type header
|
|
localVarHttpContentTypes := []string{ "application/json-patch+json", "application/merge-patch+json", "application/strategic-merge-patch+json", }
|
|
|
|
// set Content-Type header
|
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
|
if localVarHttpContentType != "" {
|
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
|
}
|
|
|
|
// to determine the Accept header
|
|
localVarHttpHeaderAccepts := []string{
|
|
"application/json",
|
|
"application/yaml",
|
|
"application/vnd.kubernetes.protobuf",
|
|
}
|
|
|
|
// set Accept header
|
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
|
if localVarHttpHeaderAccept != "" {
|
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
|
}
|
|
// body params
|
|
localVarPostBody = &body
|
|
if ctx != nil {
|
|
// API Key Authentication
|
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
|
var key string
|
|
if auth.Prefix != "" {
|
|
key = auth.Prefix + " " + auth.Key
|
|
} else {
|
|
key = auth.Key
|
|
}
|
|
localVarHeaderParams["authorization"] = key
|
|
}
|
|
}
|
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
|
if err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
localVarHttpResponse, err := a.client.callAPI(r)
|
|
if err != nil || localVarHttpResponse == nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
defer localVarHttpResponse.Body.Close()
|
|
if localVarHttpResponse.StatusCode >= 300 {
|
|
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
|
|
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
|
|
}
|
|
|
|
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
/* RbacAuthorizationV1ApiService
|
|
partially update the specified ClusterRoleBinding
|
|
* @param ctx context.Context for authentication, logging, tracing, etc.
|
|
@param name name of the ClusterRoleBinding
|
|
@param body
|
|
@param optional (nil or map[string]interface{}) with one or more of:
|
|
@param "pretty" (string) If 'true', then the output is pretty printed.
|
|
@return V1ClusterRoleBinding*/
|
|
func (a *RbacAuthorizationV1ApiService) PatchClusterRoleBinding(ctx context.Context, name string, body interface{}, localVarOptionals map[string]interface{}) (V1ClusterRoleBinding, *http.Response, error) {
|
|
var (
|
|
localVarHttpMethod = strings.ToUpper("Patch")
|
|
localVarPostBody interface{}
|
|
localVarFileName string
|
|
localVarFileBytes []byte
|
|
successPayload V1ClusterRoleBinding
|
|
)
|
|
|
|
// create path and map variables
|
|
localVarPath := a.client.cfg.BasePath + "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}"
|
|
localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1)
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
localVarQueryParams := url.Values{}
|
|
localVarFormParams := url.Values{}
|
|
|
|
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
|
|
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
|
|
}
|
|
// to determine the Content-Type header
|
|
localVarHttpContentTypes := []string{ "application/json-patch+json", "application/merge-patch+json", "application/strategic-merge-patch+json", }
|
|
|
|
// set Content-Type header
|
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
|
if localVarHttpContentType != "" {
|
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
|
}
|
|
|
|
// to determine the Accept header
|
|
localVarHttpHeaderAccepts := []string{
|
|
"application/json",
|
|
"application/yaml",
|
|
"application/vnd.kubernetes.protobuf",
|
|
}
|
|
|
|
// set Accept header
|
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
|
if localVarHttpHeaderAccept != "" {
|
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
|
}
|
|
// body params
|
|
localVarPostBody = &body
|
|
if ctx != nil {
|
|
// API Key Authentication
|
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
|
var key string
|
|
if auth.Prefix != "" {
|
|
key = auth.Prefix + " " + auth.Key
|
|
} else {
|
|
key = auth.Key
|
|
}
|
|
localVarHeaderParams["authorization"] = key
|
|
}
|
|
}
|
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
|
if err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
localVarHttpResponse, err := a.client.callAPI(r)
|
|
if err != nil || localVarHttpResponse == nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
defer localVarHttpResponse.Body.Close()
|
|
if localVarHttpResponse.StatusCode >= 300 {
|
|
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
|
|
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
|
|
}
|
|
|
|
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
/* RbacAuthorizationV1ApiService
|
|
partially update the specified Role
|
|
* @param ctx context.Context for authentication, logging, tracing, etc.
|
|
@param name name of the Role
|
|
@param namespace object name and auth scope, such as for teams and projects
|
|
@param body
|
|
@param optional (nil or map[string]interface{}) with one or more of:
|
|
@param "pretty" (string) If 'true', then the output is pretty printed.
|
|
@return V1Role*/
|
|
func (a *RbacAuthorizationV1ApiService) PatchNamespacedRole(ctx context.Context, name string, namespace string, body interface{}, localVarOptionals map[string]interface{}) (V1Role, *http.Response, error) {
|
|
var (
|
|
localVarHttpMethod = strings.ToUpper("Patch")
|
|
localVarPostBody interface{}
|
|
localVarFileName string
|
|
localVarFileBytes []byte
|
|
successPayload V1Role
|
|
)
|
|
|
|
// create path and map variables
|
|
localVarPath := a.client.cfg.BasePath + "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}"
|
|
localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1)
|
|
localVarPath = strings.Replace(localVarPath, "{"+"namespace"+"}", fmt.Sprintf("%v", namespace), -1)
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
localVarQueryParams := url.Values{}
|
|
localVarFormParams := url.Values{}
|
|
|
|
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
|
|
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
|
|
}
|
|
// to determine the Content-Type header
|
|
localVarHttpContentTypes := []string{ "application/json-patch+json", "application/merge-patch+json", "application/strategic-merge-patch+json", }
|
|
|
|
// set Content-Type header
|
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
|
if localVarHttpContentType != "" {
|
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
|
}
|
|
|
|
// to determine the Accept header
|
|
localVarHttpHeaderAccepts := []string{
|
|
"application/json",
|
|
"application/yaml",
|
|
"application/vnd.kubernetes.protobuf",
|
|
}
|
|
|
|
// set Accept header
|
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
|
if localVarHttpHeaderAccept != "" {
|
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
|
}
|
|
// body params
|
|
localVarPostBody = &body
|
|
if ctx != nil {
|
|
// API Key Authentication
|
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
|
var key string
|
|
if auth.Prefix != "" {
|
|
key = auth.Prefix + " " + auth.Key
|
|
} else {
|
|
key = auth.Key
|
|
}
|
|
localVarHeaderParams["authorization"] = key
|
|
}
|
|
}
|
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
|
if err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
localVarHttpResponse, err := a.client.callAPI(r)
|
|
if err != nil || localVarHttpResponse == nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
defer localVarHttpResponse.Body.Close()
|
|
if localVarHttpResponse.StatusCode >= 300 {
|
|
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
|
|
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
|
|
}
|
|
|
|
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
/* RbacAuthorizationV1ApiService
|
|
partially update the specified RoleBinding
|
|
* @param ctx context.Context for authentication, logging, tracing, etc.
|
|
@param name name of the RoleBinding
|
|
@param namespace object name and auth scope, such as for teams and projects
|
|
@param body
|
|
@param optional (nil or map[string]interface{}) with one or more of:
|
|
@param "pretty" (string) If 'true', then the output is pretty printed.
|
|
@return V1RoleBinding*/
|
|
func (a *RbacAuthorizationV1ApiService) PatchNamespacedRoleBinding(ctx context.Context, name string, namespace string, body interface{}, localVarOptionals map[string]interface{}) (V1RoleBinding, *http.Response, error) {
|
|
var (
|
|
localVarHttpMethod = strings.ToUpper("Patch")
|
|
localVarPostBody interface{}
|
|
localVarFileName string
|
|
localVarFileBytes []byte
|
|
successPayload V1RoleBinding
|
|
)
|
|
|
|
// create path and map variables
|
|
localVarPath := a.client.cfg.BasePath + "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}"
|
|
localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1)
|
|
localVarPath = strings.Replace(localVarPath, "{"+"namespace"+"}", fmt.Sprintf("%v", namespace), -1)
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
localVarQueryParams := url.Values{}
|
|
localVarFormParams := url.Values{}
|
|
|
|
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
|
|
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
|
|
}
|
|
// to determine the Content-Type header
|
|
localVarHttpContentTypes := []string{ "application/json-patch+json", "application/merge-patch+json", "application/strategic-merge-patch+json", }
|
|
|
|
// set Content-Type header
|
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
|
if localVarHttpContentType != "" {
|
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
|
}
|
|
|
|
// to determine the Accept header
|
|
localVarHttpHeaderAccepts := []string{
|
|
"application/json",
|
|
"application/yaml",
|
|
"application/vnd.kubernetes.protobuf",
|
|
}
|
|
|
|
// set Accept header
|
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
|
if localVarHttpHeaderAccept != "" {
|
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
|
}
|
|
// body params
|
|
localVarPostBody = &body
|
|
if ctx != nil {
|
|
// API Key Authentication
|
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
|
var key string
|
|
if auth.Prefix != "" {
|
|
key = auth.Prefix + " " + auth.Key
|
|
} else {
|
|
key = auth.Key
|
|
}
|
|
localVarHeaderParams["authorization"] = key
|
|
}
|
|
}
|
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
|
if err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
localVarHttpResponse, err := a.client.callAPI(r)
|
|
if err != nil || localVarHttpResponse == nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
defer localVarHttpResponse.Body.Close()
|
|
if localVarHttpResponse.StatusCode >= 300 {
|
|
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
|
|
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
|
|
}
|
|
|
|
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
/* RbacAuthorizationV1ApiService
|
|
read the specified ClusterRole
|
|
* @param ctx context.Context for authentication, logging, tracing, etc.
|
|
@param name name of the ClusterRole
|
|
@param optional (nil or map[string]interface{}) with one or more of:
|
|
@param "pretty" (string) If 'true', then the output is pretty printed.
|
|
@return V1ClusterRole*/
|
|
func (a *RbacAuthorizationV1ApiService) ReadClusterRole(ctx context.Context, name string, localVarOptionals map[string]interface{}) (V1ClusterRole, *http.Response, error) {
|
|
var (
|
|
localVarHttpMethod = strings.ToUpper("Get")
|
|
localVarPostBody interface{}
|
|
localVarFileName string
|
|
localVarFileBytes []byte
|
|
successPayload V1ClusterRole
|
|
)
|
|
|
|
// create path and map variables
|
|
localVarPath := a.client.cfg.BasePath + "/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}"
|
|
localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1)
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
localVarQueryParams := url.Values{}
|
|
localVarFormParams := url.Values{}
|
|
|
|
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
|
|
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
|
|
}
|
|
// to determine the Content-Type header
|
|
localVarHttpContentTypes := []string{ "*/*", }
|
|
|
|
// set Content-Type header
|
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
|
if localVarHttpContentType != "" {
|
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
|
}
|
|
|
|
// to determine the Accept header
|
|
localVarHttpHeaderAccepts := []string{
|
|
"application/json",
|
|
"application/yaml",
|
|
"application/vnd.kubernetes.protobuf",
|
|
}
|
|
|
|
// set Accept header
|
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
|
if localVarHttpHeaderAccept != "" {
|
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
|
}
|
|
if ctx != nil {
|
|
// API Key Authentication
|
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
|
var key string
|
|
if auth.Prefix != "" {
|
|
key = auth.Prefix + " " + auth.Key
|
|
} else {
|
|
key = auth.Key
|
|
}
|
|
localVarHeaderParams["authorization"] = key
|
|
}
|
|
}
|
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
|
if err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
localVarHttpResponse, err := a.client.callAPI(r)
|
|
if err != nil || localVarHttpResponse == nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
defer localVarHttpResponse.Body.Close()
|
|
if localVarHttpResponse.StatusCode >= 300 {
|
|
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
|
|
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
|
|
}
|
|
|
|
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
/* RbacAuthorizationV1ApiService
|
|
read the specified ClusterRoleBinding
|
|
* @param ctx context.Context for authentication, logging, tracing, etc.
|
|
@param name name of the ClusterRoleBinding
|
|
@param optional (nil or map[string]interface{}) with one or more of:
|
|
@param "pretty" (string) If 'true', then the output is pretty printed.
|
|
@return V1ClusterRoleBinding*/
|
|
func (a *RbacAuthorizationV1ApiService) ReadClusterRoleBinding(ctx context.Context, name string, localVarOptionals map[string]interface{}) (V1ClusterRoleBinding, *http.Response, error) {
|
|
var (
|
|
localVarHttpMethod = strings.ToUpper("Get")
|
|
localVarPostBody interface{}
|
|
localVarFileName string
|
|
localVarFileBytes []byte
|
|
successPayload V1ClusterRoleBinding
|
|
)
|
|
|
|
// create path and map variables
|
|
localVarPath := a.client.cfg.BasePath + "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}"
|
|
localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1)
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
localVarQueryParams := url.Values{}
|
|
localVarFormParams := url.Values{}
|
|
|
|
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
|
|
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
|
|
}
|
|
// to determine the Content-Type header
|
|
localVarHttpContentTypes := []string{ "*/*", }
|
|
|
|
// set Content-Type header
|
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
|
if localVarHttpContentType != "" {
|
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
|
}
|
|
|
|
// to determine the Accept header
|
|
localVarHttpHeaderAccepts := []string{
|
|
"application/json",
|
|
"application/yaml",
|
|
"application/vnd.kubernetes.protobuf",
|
|
}
|
|
|
|
// set Accept header
|
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
|
if localVarHttpHeaderAccept != "" {
|
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
|
}
|
|
if ctx != nil {
|
|
// API Key Authentication
|
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
|
var key string
|
|
if auth.Prefix != "" {
|
|
key = auth.Prefix + " " + auth.Key
|
|
} else {
|
|
key = auth.Key
|
|
}
|
|
localVarHeaderParams["authorization"] = key
|
|
}
|
|
}
|
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
|
if err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
localVarHttpResponse, err := a.client.callAPI(r)
|
|
if err != nil || localVarHttpResponse == nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
defer localVarHttpResponse.Body.Close()
|
|
if localVarHttpResponse.StatusCode >= 300 {
|
|
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
|
|
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
|
|
}
|
|
|
|
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
/* RbacAuthorizationV1ApiService
|
|
read the specified Role
|
|
* @param ctx context.Context for authentication, logging, tracing, etc.
|
|
@param name name of the Role
|
|
@param namespace object name and auth scope, such as for teams and projects
|
|
@param optional (nil or map[string]interface{}) with one or more of:
|
|
@param "pretty" (string) If 'true', then the output is pretty printed.
|
|
@return V1Role*/
|
|
func (a *RbacAuthorizationV1ApiService) ReadNamespacedRole(ctx context.Context, name string, namespace string, localVarOptionals map[string]interface{}) (V1Role, *http.Response, error) {
|
|
var (
|
|
localVarHttpMethod = strings.ToUpper("Get")
|
|
localVarPostBody interface{}
|
|
localVarFileName string
|
|
localVarFileBytes []byte
|
|
successPayload V1Role
|
|
)
|
|
|
|
// create path and map variables
|
|
localVarPath := a.client.cfg.BasePath + "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}"
|
|
localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1)
|
|
localVarPath = strings.Replace(localVarPath, "{"+"namespace"+"}", fmt.Sprintf("%v", namespace), -1)
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
localVarQueryParams := url.Values{}
|
|
localVarFormParams := url.Values{}
|
|
|
|
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
|
|
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
|
|
}
|
|
// to determine the Content-Type header
|
|
localVarHttpContentTypes := []string{ "*/*", }
|
|
|
|
// set Content-Type header
|
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
|
if localVarHttpContentType != "" {
|
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
|
}
|
|
|
|
// to determine the Accept header
|
|
localVarHttpHeaderAccepts := []string{
|
|
"application/json",
|
|
"application/yaml",
|
|
"application/vnd.kubernetes.protobuf",
|
|
}
|
|
|
|
// set Accept header
|
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
|
if localVarHttpHeaderAccept != "" {
|
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
|
}
|
|
if ctx != nil {
|
|
// API Key Authentication
|
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
|
var key string
|
|
if auth.Prefix != "" {
|
|
key = auth.Prefix + " " + auth.Key
|
|
} else {
|
|
key = auth.Key
|
|
}
|
|
localVarHeaderParams["authorization"] = key
|
|
}
|
|
}
|
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
|
if err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
localVarHttpResponse, err := a.client.callAPI(r)
|
|
if err != nil || localVarHttpResponse == nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
defer localVarHttpResponse.Body.Close()
|
|
if localVarHttpResponse.StatusCode >= 300 {
|
|
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
|
|
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
|
|
}
|
|
|
|
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
/* RbacAuthorizationV1ApiService
|
|
read the specified RoleBinding
|
|
* @param ctx context.Context for authentication, logging, tracing, etc.
|
|
@param name name of the RoleBinding
|
|
@param namespace object name and auth scope, such as for teams and projects
|
|
@param optional (nil or map[string]interface{}) with one or more of:
|
|
@param "pretty" (string) If 'true', then the output is pretty printed.
|
|
@return V1RoleBinding*/
|
|
func (a *RbacAuthorizationV1ApiService) ReadNamespacedRoleBinding(ctx context.Context, name string, namespace string, localVarOptionals map[string]interface{}) (V1RoleBinding, *http.Response, error) {
|
|
var (
|
|
localVarHttpMethod = strings.ToUpper("Get")
|
|
localVarPostBody interface{}
|
|
localVarFileName string
|
|
localVarFileBytes []byte
|
|
successPayload V1RoleBinding
|
|
)
|
|
|
|
// create path and map variables
|
|
localVarPath := a.client.cfg.BasePath + "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}"
|
|
localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1)
|
|
localVarPath = strings.Replace(localVarPath, "{"+"namespace"+"}", fmt.Sprintf("%v", namespace), -1)
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
localVarQueryParams := url.Values{}
|
|
localVarFormParams := url.Values{}
|
|
|
|
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
|
|
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
|
|
}
|
|
// to determine the Content-Type header
|
|
localVarHttpContentTypes := []string{ "*/*", }
|
|
|
|
// set Content-Type header
|
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
|
if localVarHttpContentType != "" {
|
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
|
}
|
|
|
|
// to determine the Accept header
|
|
localVarHttpHeaderAccepts := []string{
|
|
"application/json",
|
|
"application/yaml",
|
|
"application/vnd.kubernetes.protobuf",
|
|
}
|
|
|
|
// set Accept header
|
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
|
if localVarHttpHeaderAccept != "" {
|
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
|
}
|
|
if ctx != nil {
|
|
// API Key Authentication
|
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
|
var key string
|
|
if auth.Prefix != "" {
|
|
key = auth.Prefix + " " + auth.Key
|
|
} else {
|
|
key = auth.Key
|
|
}
|
|
localVarHeaderParams["authorization"] = key
|
|
}
|
|
}
|
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
|
if err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
localVarHttpResponse, err := a.client.callAPI(r)
|
|
if err != nil || localVarHttpResponse == nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
defer localVarHttpResponse.Body.Close()
|
|
if localVarHttpResponse.StatusCode >= 300 {
|
|
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
|
|
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
|
|
}
|
|
|
|
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
/* RbacAuthorizationV1ApiService
|
|
replace the specified ClusterRole
|
|
* @param ctx context.Context for authentication, logging, tracing, etc.
|
|
@param name name of the ClusterRole
|
|
@param body
|
|
@param optional (nil or map[string]interface{}) with one or more of:
|
|
@param "pretty" (string) If 'true', then the output is pretty printed.
|
|
@return V1ClusterRole*/
|
|
func (a *RbacAuthorizationV1ApiService) ReplaceClusterRole(ctx context.Context, name string, body V1ClusterRole, localVarOptionals map[string]interface{}) (V1ClusterRole, *http.Response, error) {
|
|
var (
|
|
localVarHttpMethod = strings.ToUpper("Put")
|
|
localVarPostBody interface{}
|
|
localVarFileName string
|
|
localVarFileBytes []byte
|
|
successPayload V1ClusterRole
|
|
)
|
|
|
|
// create path and map variables
|
|
localVarPath := a.client.cfg.BasePath + "/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}"
|
|
localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1)
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
localVarQueryParams := url.Values{}
|
|
localVarFormParams := url.Values{}
|
|
|
|
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
|
|
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
|
|
}
|
|
// to determine the Content-Type header
|
|
localVarHttpContentTypes := []string{ "*/*", }
|
|
|
|
// set Content-Type header
|
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
|
if localVarHttpContentType != "" {
|
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
|
}
|
|
|
|
// to determine the Accept header
|
|
localVarHttpHeaderAccepts := []string{
|
|
"application/json",
|
|
"application/yaml",
|
|
"application/vnd.kubernetes.protobuf",
|
|
}
|
|
|
|
// set Accept header
|
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
|
if localVarHttpHeaderAccept != "" {
|
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
|
}
|
|
// body params
|
|
localVarPostBody = &body
|
|
if ctx != nil {
|
|
// API Key Authentication
|
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
|
var key string
|
|
if auth.Prefix != "" {
|
|
key = auth.Prefix + " " + auth.Key
|
|
} else {
|
|
key = auth.Key
|
|
}
|
|
localVarHeaderParams["authorization"] = key
|
|
}
|
|
}
|
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
|
if err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
localVarHttpResponse, err := a.client.callAPI(r)
|
|
if err != nil || localVarHttpResponse == nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
defer localVarHttpResponse.Body.Close()
|
|
if localVarHttpResponse.StatusCode >= 300 {
|
|
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
|
|
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
|
|
}
|
|
|
|
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
/* RbacAuthorizationV1ApiService
|
|
replace the specified ClusterRoleBinding
|
|
* @param ctx context.Context for authentication, logging, tracing, etc.
|
|
@param name name of the ClusterRoleBinding
|
|
@param body
|
|
@param optional (nil or map[string]interface{}) with one or more of:
|
|
@param "pretty" (string) If 'true', then the output is pretty printed.
|
|
@return V1ClusterRoleBinding*/
|
|
func (a *RbacAuthorizationV1ApiService) ReplaceClusterRoleBinding(ctx context.Context, name string, body V1ClusterRoleBinding, localVarOptionals map[string]interface{}) (V1ClusterRoleBinding, *http.Response, error) {
|
|
var (
|
|
localVarHttpMethod = strings.ToUpper("Put")
|
|
localVarPostBody interface{}
|
|
localVarFileName string
|
|
localVarFileBytes []byte
|
|
successPayload V1ClusterRoleBinding
|
|
)
|
|
|
|
// create path and map variables
|
|
localVarPath := a.client.cfg.BasePath + "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}"
|
|
localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1)
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
localVarQueryParams := url.Values{}
|
|
localVarFormParams := url.Values{}
|
|
|
|
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
|
|
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
|
|
}
|
|
// to determine the Content-Type header
|
|
localVarHttpContentTypes := []string{ "*/*", }
|
|
|
|
// set Content-Type header
|
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
|
if localVarHttpContentType != "" {
|
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
|
}
|
|
|
|
// to determine the Accept header
|
|
localVarHttpHeaderAccepts := []string{
|
|
"application/json",
|
|
"application/yaml",
|
|
"application/vnd.kubernetes.protobuf",
|
|
}
|
|
|
|
// set Accept header
|
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
|
if localVarHttpHeaderAccept != "" {
|
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
|
}
|
|
// body params
|
|
localVarPostBody = &body
|
|
if ctx != nil {
|
|
// API Key Authentication
|
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
|
var key string
|
|
if auth.Prefix != "" {
|
|
key = auth.Prefix + " " + auth.Key
|
|
} else {
|
|
key = auth.Key
|
|
}
|
|
localVarHeaderParams["authorization"] = key
|
|
}
|
|
}
|
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
|
if err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
localVarHttpResponse, err := a.client.callAPI(r)
|
|
if err != nil || localVarHttpResponse == nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
defer localVarHttpResponse.Body.Close()
|
|
if localVarHttpResponse.StatusCode >= 300 {
|
|
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
|
|
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
|
|
}
|
|
|
|
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
/* RbacAuthorizationV1ApiService
|
|
replace the specified Role
|
|
* @param ctx context.Context for authentication, logging, tracing, etc.
|
|
@param name name of the Role
|
|
@param namespace object name and auth scope, such as for teams and projects
|
|
@param body
|
|
@param optional (nil or map[string]interface{}) with one or more of:
|
|
@param "pretty" (string) If 'true', then the output is pretty printed.
|
|
@return V1Role*/
|
|
func (a *RbacAuthorizationV1ApiService) ReplaceNamespacedRole(ctx context.Context, name string, namespace string, body V1Role, localVarOptionals map[string]interface{}) (V1Role, *http.Response, error) {
|
|
var (
|
|
localVarHttpMethod = strings.ToUpper("Put")
|
|
localVarPostBody interface{}
|
|
localVarFileName string
|
|
localVarFileBytes []byte
|
|
successPayload V1Role
|
|
)
|
|
|
|
// create path and map variables
|
|
localVarPath := a.client.cfg.BasePath + "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}"
|
|
localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1)
|
|
localVarPath = strings.Replace(localVarPath, "{"+"namespace"+"}", fmt.Sprintf("%v", namespace), -1)
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
localVarQueryParams := url.Values{}
|
|
localVarFormParams := url.Values{}
|
|
|
|
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
|
|
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
|
|
}
|
|
// to determine the Content-Type header
|
|
localVarHttpContentTypes := []string{ "*/*", }
|
|
|
|
// set Content-Type header
|
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
|
if localVarHttpContentType != "" {
|
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
|
}
|
|
|
|
// to determine the Accept header
|
|
localVarHttpHeaderAccepts := []string{
|
|
"application/json",
|
|
"application/yaml",
|
|
"application/vnd.kubernetes.protobuf",
|
|
}
|
|
|
|
// set Accept header
|
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
|
if localVarHttpHeaderAccept != "" {
|
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
|
}
|
|
// body params
|
|
localVarPostBody = &body
|
|
if ctx != nil {
|
|
// API Key Authentication
|
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
|
var key string
|
|
if auth.Prefix != "" {
|
|
key = auth.Prefix + " " + auth.Key
|
|
} else {
|
|
key = auth.Key
|
|
}
|
|
localVarHeaderParams["authorization"] = key
|
|
}
|
|
}
|
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
|
if err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
localVarHttpResponse, err := a.client.callAPI(r)
|
|
if err != nil || localVarHttpResponse == nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
defer localVarHttpResponse.Body.Close()
|
|
if localVarHttpResponse.StatusCode >= 300 {
|
|
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
|
|
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
|
|
}
|
|
|
|
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
/* RbacAuthorizationV1ApiService
|
|
replace the specified RoleBinding
|
|
* @param ctx context.Context for authentication, logging, tracing, etc.
|
|
@param name name of the RoleBinding
|
|
@param namespace object name and auth scope, such as for teams and projects
|
|
@param body
|
|
@param optional (nil or map[string]interface{}) with one or more of:
|
|
@param "pretty" (string) If 'true', then the output is pretty printed.
|
|
@return V1RoleBinding*/
|
|
func (a *RbacAuthorizationV1ApiService) ReplaceNamespacedRoleBinding(ctx context.Context, name string, namespace string, body V1RoleBinding, localVarOptionals map[string]interface{}) (V1RoleBinding, *http.Response, error) {
|
|
var (
|
|
localVarHttpMethod = strings.ToUpper("Put")
|
|
localVarPostBody interface{}
|
|
localVarFileName string
|
|
localVarFileBytes []byte
|
|
successPayload V1RoleBinding
|
|
)
|
|
|
|
// create path and map variables
|
|
localVarPath := a.client.cfg.BasePath + "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}"
|
|
localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1)
|
|
localVarPath = strings.Replace(localVarPath, "{"+"namespace"+"}", fmt.Sprintf("%v", namespace), -1)
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
localVarQueryParams := url.Values{}
|
|
localVarFormParams := url.Values{}
|
|
|
|
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
|
|
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
|
|
}
|
|
// to determine the Content-Type header
|
|
localVarHttpContentTypes := []string{ "*/*", }
|
|
|
|
// set Content-Type header
|
|
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
|
if localVarHttpContentType != "" {
|
|
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
|
}
|
|
|
|
// to determine the Accept header
|
|
localVarHttpHeaderAccepts := []string{
|
|
"application/json",
|
|
"application/yaml",
|
|
"application/vnd.kubernetes.protobuf",
|
|
}
|
|
|
|
// set Accept header
|
|
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
|
if localVarHttpHeaderAccept != "" {
|
|
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
|
}
|
|
// body params
|
|
localVarPostBody = &body
|
|
if ctx != nil {
|
|
// API Key Authentication
|
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
|
var key string
|
|
if auth.Prefix != "" {
|
|
key = auth.Prefix + " " + auth.Key
|
|
} else {
|
|
key = auth.Key
|
|
}
|
|
localVarHeaderParams["authorization"] = key
|
|
}
|
|
}
|
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
|
if err != nil {
|
|
return successPayload, nil, err
|
|
}
|
|
|
|
localVarHttpResponse, err := a.client.callAPI(r)
|
|
if err != nil || localVarHttpResponse == nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
defer localVarHttpResponse.Body.Close()
|
|
if localVarHttpResponse.StatusCode >= 300 {
|
|
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
|
|
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
|
|
}
|
|
|
|
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|
|
|
|
return successPayload, localVarHttpResponse, err
|
|
}
|
|
|