Introduction
This document covers both Integrated Edge Cloud(IEC) Type 1 & 2. The north bound APIs to interact with gopaddle to upload, launch, view, list and delete the blueprint is listed below. This is yet another approach to deploy the blueprint and maintain it using an intuitive UI.
Steps to generate the bearer token
- Subscribe to gopaddle by signing up at https://portal.gopaddle.io
- Once you login to the gopaddle account, select the project or create a new project. To create a project, choose the settings option in the top navigation panel and select Project. Once the project is created, navigate to the project and choose the project ID from the browser navigation panel.
- Navigate to the settings option in the top navigation panel and click on Teams option.
- Create a new role with All permissions across All resources.
- Add a new user with the above role.
- Select the API token option for the user and generate the new token. This token can be used as the bearer token in the REST API calls.
REST APIs
Upload Terraform template to gopaddle repository
POST https://portal.gopaddle.io/gateway/v1/{projectID}/terraform/upload Header: { Authorization: token <bearer_token> } Request: { "fileName":"terraform", "fileContent" : <Content in []bytes> } Response: { "message": "Uploading terraform template", "requestID": "a9fbd75c-8b17-4523-b024-81be7d860ca2", "activityID": "act2a53ed2de3e3de4ffbe8183e3f652bd7eefc", "templateID": "tmp3a2c220ae6d30e482beab5ce9a6f242d434d" }
Get an uploaded template from gopaddle
GET https://portal.gopaddle.io/gateway/v1/{projectID}/terraform/{templateID} Header: { Authorization: token <bearer_token> } Response: { "id":"tmp8a2b4bc5e00b4e458aeb12ce36b9b6b9ccf1", "templateGraph":<base64 string>, "project":"", "fileName":"sample", "createdTime":"2021-05-14 03:21:19.399387876 +0000 UTC", "dependencyRef":[ ], "owner":{ "id":"1" } }
Retrieve the key file associated with a template from gopaddle
GET https://portal.gopaddle.io/gateway/v1/{projectID}/terraform/{templateID}/keyFile Header: { Authorization: token <bearer_token> } Response: { "keyFile": { "variable": [ { "aws_region": [ { "default": "us-east-2", "description": "aws_region" } ] }, { "aws_instance": [ { "default": "t2.small", "description": "instance_type" } ] }, { "aws_ami": [ { "default": "ami-0b9064170e32bde34", "description": "aws_ami" } ] }, { "access_key": [ { "default": "<access_key>", "description": "access_key" } ] }, { "secret_key": [ { "default": "<secret_key>", "description": "secret_key" } ] }, { "aws_subnet_id": [ { "default": "subnet-d64dcabe", "description": "subnet_id" } ] }, { "key_name": [ { "default": "terraform", "description": "key_name" } ] }, { "vpc_id": [ { "default": "vpc-561e9f3e", "description": "vpc_id" } ] } ] }, "files": [ { "fileContent": "<base64Encoded_filecontent>", "name": "terraform.pem" }, { "fileContent": "<base64Encoded_filecontent>", "name": "token" } ] }
List all the uploaded templates from gopaddle
GET https://portal.gopaddle.io/gateway/v1/{ProjectID}/terraform?read-type=templateList Header: { Authorization: token <bearer_token> } Response: { "paginationCount": 1, "templates": [ { "id": "tmp8a2b4bc5e00b4e458aeb12ce36b9b6b9ccf1", "templateGraph": <base64 string> "name": "", "project": "", "fileName": "sample", "createdTime": "2021-05-13 08:28:10.584356353 +0000 UTC", "dependencyRef": [], "owner": { "id": "1" } } ], "count": 1, "requestID": "b3948ae9-e42e-4446-8946-a66ba42f29ee" }
Launch a template from gopaddle
POST https://portal.gopaddle.io/gateway/v1/{ProjectID}/terraform/{templateID}/launch Header: { Authorization: token <bearer_token> } Request: { "files":{ "keyFile":<keyFileContent>, "files":[ { "fileContent":<base64Encoded_filecontent>, "name":"terraform.pem" }, { "fileContent":<base64Encoded_filecontent>, "name":"token" } ] } } Response: { "message": "Template launch triggered", "templateID": "tmp6a431367ea6eae4218eb3ffeb39179a745f2", "activityID": "act1ae38985e9984e43d7ea6d2edc5c4f752cf2" }
Get all activities associated with a launch operation from gopaddle
GET https://portal.gopaddle.io/gateway/v1/{ProjectID}/terraform/{templateID}/activity Header: { Authorization: token <bearer_token> } Response: { "Activities": [ { "templateID": "tmp0a2bc500eecb6e48cdea4dce81aa874d59e8", "id": "actcac0d817e00f8e49a5e9e22ed20b0adceab4", "operation": "terraform", "summaries": [ { "state": "Running", "description": "Validating terraform file", "eventName": "TERRAFORM_INIT", "timestamp": "2021-05-28 06:08:43.691868604 +0000 UTC", "level": "Info" }, { "state": "Running", "description": "Creating the terraform template", "eventName": "TERRAFORM_INIT", "timestamp": "2021-05-28 06:08:43.872481208 +0000 UTC", "level": "Info" }, { "state": "Running", "description": "terraform plan executed.", "eventName": "TERRAFORM_INIT", "timestamp": "2021-05-28 06:10:12.917442967 +0000 UTC", "level": "Info" }, { "state": "Running", "description": "created the terraform grpah.png", "eventName": "TERRAFORM_GRAPH", "timestamp": "2021-05-28 06:10:16.075130017 +0000 UTC", "level": "Info" }, { "state": "Running", "description": "uploaded the terraform template", "eventName": "TERRAFORM_INIT", "timestamp": "2021-05-28 06:10:16.621650279 +0000 UTC", "level": "Info" } ], "operationType": "TERRAFORM_INIT", "status": "Running", "updatedTime": "2021-05-28 06:08:43.466032275 +0000 UTC" } ], "paginationCount": 1, "count": 1, "requestID": "51624d1e-fe68-4949-9c1a-d9a1f3cf7046" }
Get details of a specific activity from gopaddle
GET https://portal.gopaddle.io/gateway/v1/{ProjectID}/terraform/{templateID}/activity/{activityID} Header: { Authorization: token <bearer_token> } Response: { "accountID": "1a56b4adge67fg4622ga052g93280b35c5ee", "id": "actcac0d817e00f8e49a5e9e22ed20b0adceab4", "templateID": "tmp0a2bc500eecb6e48cdea4dce81aa874d59e8", "operationType": "TERRAFORM_INIT", "operation": "terraform", "status": "Running", "updatedTime": "2021-05-28 06:08:43.466032275 +0000 UTC", "summaries": [ { "level": "Info", "state": "Running", "eventName": "TERRAFORM_INIT", "description": "Validating terraform file", "timeStamp": "2021-05-28 06:08:43.691868604 +0000 UTC" }, { "level": "Info", "state": "Running", "eventName": "TERRAFORM_INIT", "description": "Creating the terraform template", "timeStamp": "2021-05-28 06:08:43.872481208 +0000 UTC" }, { "level": "Info", "state": "Running", "eventName": "TERRAFORM_INIT", "description": "terraform plan executed.", "timeStamp": "2021-05-28 06:10:12.917442967 +0000 UTC" }, { "level": "Info", "state": "Running", "eventName": "TERRAFORM_GRAPH", "description": "created the terraform grpah.png", "timeStamp": "2021-05-28 06:10:16.075130017 +0000 UTC" }, { "level": "Info", "state": "Running", "eventName": "TERRAFORM_INIT", "description": "uploaded the terraform template", "timeStamp": "2021-05-28 06:10:16.621650279 +0000 UTC" } ] }
Get the status of the cluster launch in gopaddle
GET https://portal.gopaddle.io/gateway/v1/{ProjectID}/terraform/{templateID}/status Header: { Authorization: token <bearer_token> } Response: { "status": "Running" }
Delete a template from gopaddle
DELETE https://portal.gopaddle.io/gateway/v1/{projectID}/terraform/{templateID} Header: { Authorization: token <bearer_token> } Response: { "message": "Template tmp8a2b4bc5e00b4e458aeb12ce36b9b6b9ccf1 deleted successfully" }