ves-io-schema-k8s_cluster_role-API-Replace

Examples of replacing k8sclusterrole

Usecase:

Replace k8s-cluster-role-1 to modify rule

Request using vesctl:

vesctl configuration replace k8s_cluster_role -i k8s_cluster_role.yaml

where file k8sclusterrole.yaml has following contents (k8sclusterrole.ReplaceRequest):

metadata:
  name: k8s-cluster-role-1
  namespace: system
spec:
  policyRuleList:
    policyRule:
    - resourceList:
        apiGroups:
        - rbac.authorization.k8s.io
        resourceInstances:
        - ResourceAll
        resourceTypes:
        - role
        verbs:
        - use

vesctl yaml response: None

Request using curl:

curl -X 'PUT' -d '{"metadata":{"name":"k8s-cluster-role-1","namespace":"system"},"spec":{"policyRuleList":{"policyRule":[{"resourceList":{"apiGroups":["rbac.authorization.k8s.io"],"resourceTypes":["role"],"resourceInstances":["ResourceAll"],"verbs":["use"]}}]}}}' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build817539475_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/system/k8s_cluster_roles/k8s-cluster-role-1'

curl response:

HTTP/1.1 200 OK
Content-Length: 4
Content-Type: application/json
Date: Mon, 22 Feb 2021 15:44:04 GMT
Vary: Accept-Encoding

{

}