Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

1.  Create Logical Cloud

Code Block
languagejs
themeMidnight
titleLogical Cloud Creation API
URL: /v2/projects/<project-name>/logical-clouds
POST BODY:
{
 "name": "logical-cloud-1",   //unique name for the new logical cloud
 "description": "logical cloud for walmart finance department",  //description for the logical cloud
 "user" : {
    "name" : "user-1",  //name of user for this cloud
    "type" : "certificate",   //type of authentication credentials used by user (certificate, APIKey, UNPW)
    "certificate" : "/path/to/user1/crt" ,  //Path to user certificate
    "permissions" : {
       "apiGroups" : ["stable.example.com"]
       "resources" : ["secrets", "pods"]
       "verbs" : ["get", "watch", "list", "create"]
     }
  }
}

Return Status: 201
Return Body:
{
  "name" : "logical-cloud-1"
  "user" : "user-1"
  "Message" : "logical cloud and associated user successfully created"
}

...

2.  Get Logical Cloud kubeconfig

Code Block
languagejsthemeMidnight
titleGet Logical cloud kubeconfig
URL: /v2/projects/<project-name>/logical-clouds/<logical-cloud-name>/kubeconfig
GET
Return Status: 201
Return Body :
{
apiVersion: v1
clusters:
- cluster:
	certificate-authority: path/to/my/cafile
    server: http://2.2.2.2:6443
  name: cluster-abc
- cluster:
    certificate-authority: path/to/my/cafile
    server: https://1.1.1.1:6443
  name: cluster-xyz
contexts:
- context:
    cluster: kubernetes
    namespace: ns-1
    user: user-1
  name: logical-cloud-1
current-context: logical-cloud-1
kind: Config
preferences: {}
users:
- name: user-1
  user:
    client-certificate: path/to/my/client/cert
    client-key: path/to/my/client/key
}

...

3.  PUT (Change logical cloud contents)

Code Block
theme
languagejs
MidnighttitlePUT Logical Cloud
URL: /v2/projects/<project-name>/logical-clouds/<name>
PUT BODY:
{
 "description": "logical cloud for walmart finance department",  //description for the logical cloud
 "user" : {
    "name" : "user-1",  //name of user for this cloud
    "type" : "certificate",   //type of authentication credentials used by user (certificate, APIKey, UNPW)
    "certificate" : "/path/to/user1/crt" ,  //Path to user certificate
    "permissions" : {
       "apiGroups" : ["stable.example.com"]
       "resources" : ["secrets", "pods"]
       "verbs" : ["get", "watch", "list", "create"]
     }
  }
}

...

4. POST (Associate cluster with logical cloud )

Code Block
languagejsthemeMidnight
titleAssociate logical cloud with cluster
URL: /v2/projecs/<project-name>/logical-clouds/<logical-cloud-name>/cluster-references/
POST BODY:
{
 "name": "cluster-1",  //cluster name
 "description" : "edge a cluster" //cluster description
}

...

5. POST (Create namespace for logical cloud)

Code Block
theme
languagejsMidnight
titleCreate namespace for logical cloud
URL: /v2/projects/<project-name>/logical-clouds/<logical-cloud-name>/namespaces
POST BODY:
{
 "namespace" : "ns-1" // namespace for logical cloud 1
 "description" : "logical-cloud-1 namespaces"
}

...

6.  POST (Apply all the created configuration)

Code Block
languagejsthemeMidnight
titleApply configuration
URL: /v2/projects/<project-name>/logical-clouds/<logical-cloud-name>/apply
POST BODY:
{
 "name" : "lc-1-operation" // Give the operation a name that can be queried for status
 "description" : "Description"
}

...

7. GET (Check status of operation)

Code Block
languagejsthemeMidnight
titleApply configuration
URL: /v2/projects/<project-name>/logical-clouds/<logical-cloud-name>/apply/<operation name>
GET BODY:
GET
Return Status: 201
Return Body :
{ "status" : "in progress"}

...