Powered by Algolia

    Sample Workflows

    Introduction

    This page outlines a sample workflow for a use case where a user (either a tenant or an admin) that is already registered performs these steps, all with the use of APIs:

    • Login to the Spectro Cloud management console.
    • Create a cluster profile named cluster-profile-1 with the these (example) layers -
      • OS: Ubuntu, 18.4.X (LTS).
      • Kubernetes: select version 1.17.X.
      • Network: Calico 3.10.X.
      • Storage: vSphere Storage Class.
    • Create a cluster in VMware.
    • Update the cluster profile to bring the Kubernetes version to 1.18.X.
    • Update the cluster to reflect the changes of the Kubernetes version.

    For example, let us consider a non-admin user with the email janedoe@thefirm.com and the password password1234.

    Authentication

    POST → https://api.spectrocloud.com/v1alpha1/auth/authenticate

    REQUEST

    BODY:

    {
    "emailId": "janedoe@thefirm.com",
    "password": "password1234"
    }

    RESPONSE

    HTTP CODE: 200

    DESCRIPTION: OK

    RESPONSE BODY:

    {
    "Authorization": "string"
    }

    With this the user is authenticated successfully.

    Creating a cluster profile

    POST → https://api.spectrocloud.com/v1alpha1/clusterprofiles

    BODY:

    {
    "metadata": {
    "annotations": "object",
    "creationTimestamp": "date-time",
    "deletionTimestamp": "date-time",
    "labels": "object",
    "name": "cluster-profile-1",
    "namespace": "string",
    "resourceVersion": "string",
    "selfLink": "string",
    "uid": "string"
    },
    "spec": {
    "template": {
    "cloudType": "vmware",
    "packs": [
    {
    "name": "string",
    "tag": "string",
    "uid": "string",
    "values": "string"
    }
    {
    "name": "string",
    "tag": "string",
    "uid": "string",
    "values": "string"
    }
    {
    "name": "string",
    "tag": "string",
    "uid": "string",
    "values": "string"
    }
    {
    "name": "string",
    "tag": "string",
    "uid": "string",
    "values": "string"
    }
    ],
    "type": "string"
    }
    }
    }

    RESPONSE

    HTTP CODE: 201

    DESCRIPTION: Created successfully

    RESPONSE BODY:

    {
    "uid": "string"
    }

    Creating a VMware cluster

    POST → https://api.spectrocloud.com/v1alpha1/spectroclusters/vsphere

    REQUEST

    BODY:

    {
    "metadata": {
    "annotations": "object",
    "creationTimestamp": "date-time",
    "deletionTimestamp": "date-time",
    "labels": "object",
    "name": "string",
    "namespace": "string",
    "resourceVersion": "string",
    "selfLink": "string",
    "uid": "string"
    },
    "spec": {
    "cloudAccountUid": "string",
    "cloudConfig": {
    "network": {
    "networkName": "string"
    },
    "ntpServers": [
    "string"
    ],
    "placement": {
    "cluster": "string",
    "datacenter": "string",
    "datastore": "string",
    "folder": "string",
    "imageTemplateFolder": "string",
    "resourcePool": "string"
    },
    "sshKeys": [
    "string"
    ]
    },
    "machinepoolconfig": [
    {
    "cloudConfig": {
    "instanceType": {
    "diskGiB": "integer",
    "memoryMiB": "integer",
    "numCPUs": "integer"
    }
    },
    "poolConfig": {
    "isControlPlane": "boolean",
    "labels": [
    "string"
    ],
    "name": "string",
    "size": "integer",
    "useControlPlaneAsWorker": "boolean"
    },
    "profileConfig": {
    "infraProfileUid": "string",
    "packValues": [
    {
    "name": "string",
    "tag": "string",
    "values": "string"
    }
    ]
    }
    }
    ],
    "packValues": [
    {
    "name": "string",
    "tag": "string",
    "values": "string"
    }
    ],
    "profileUid": "string"
    }
    }

    RESPONSE

    HTTP CODE: 201

    DESCRIPTION: Created successfully

    RESPONSE BODY:

    {
    "uid": "string"
    }

    Updating the Cluster Profile

    PUT → https://api.spectrocloud.com/v1alpha1/clusterprofiles/{uid}/packs/{packName}/versions/{packVersion}/values

    RESPONSE

    HTTP CODE: 204

    DESCRIPTION: The resource was updated successfully

    Updating the cluster

    PUT → https://api.spectrocloud.com/v1alpha1/spectroclusters/vsphere/{uid}

    REQUEST

    {
    "metadata": {
    "annotations": "object",
    "creationTimestamp": "date-time",
    "deletionTimestamp": "date-time",
    "labels": "object",
    "name": "string",
    "namespace": "string",
    "resourceVersion": "string",
    "selfLink": "string",
    "uid": "string"
    },
    "spec": {
    "cloudAccountUid": "string",
    "cloudConfig": {
    "network": {
    "networkName": "string"
    },
    "ntpServers": [
    "string"
    ],
    "placement": {
    "cluster": "string",
    "datacenter": "string",
    "datastore": "string",
    "folder": "string",
    "imageTemplateFolder": "string",
    "resourcePool": "string"
    },
    "sshKeys": [
    "string"
    ]
    },
    "machinepoolconfig": [
    {
    "cloudConfig": {
    "instanceType": {
    "diskGiB": "integer",
    "memoryMiB": "integer",
    "numCPUs": "integer"
    }
    },
    "poolConfig": {
    "isControlPlane": "boolean",
    "labels": [
    "string"
    ],
    "name": "string",
    "size": "integer",
    "useControlPlaneAsWorker": "boolean"
    },
    "profileConfig": {
    "infraProfileUid": "string",
    "packValues": [
    {
    "name": "string",
    "tag": "string",
    "values": "string"
    }
    ]
    }
    }
    ],
    "packValues": [
    {
    "name": "string",
    "tag": "string",
    "values": "string"
    }
    ],
    "profileUid": "string"
    }
    }

    RESPONSE

    HTTP CODE: 204

    DESCRIPTION: The resource was updated successfully