Versions Compared

Key

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

...

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.

Upload Terraform template to gopaddle repository

Code Block
languagebash
themeEmacs
POST /api/{accountID}https://portal.gopaddle.io/gateway/v1/{projectID}/terraform/upload/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"
}

...

Code Block
languagebash
themeEmacs
GET /api/{accountID}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"
   }
}

...

Code Block
languagebash
themeEmacs
GET /api/{accountID}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"
    }
  ]
}

...

Code Block
languagebash
themeEmacs
GET /api/{accountID}https://portal.gopaddle.io/gateway/v1/{ProjectID}/terraform
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"
}

...

Code Block
languagebash
themeEmacs
POST /api/{accountID}https://portal.gopaddle.io/gateway/v1/{ProjectID}/terraform/{templateID}/launch/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"
}

...

Code Block
languagebash
themeEmacs
GET /api/{accountID}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"
}

...

Code Block
languagebash
themeEmacs
GET /api/{accountID}https://portal.gopaddle.io/gateway/v1/{ProjectID}/terraform/{templateID}/activity/{activityID{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"
    }
  ]
}

...

Code Block
languagebash
themeEmacs
GET  /api/{accountID}https://portal.gopaddle.io/gateway/v1/{ProjectID}/terraform/{templateID}/status
Header:
{
Authorization: token <bearer_token>
}

Response:
{
  "status": "Running"
}

...

Code Block
languagebash
themeEmacs
DELETE /api/{accountID}https://portal.gopaddle.io/gateway/v1/{projectID}/terraform/{templateID}
Header:
{
Authorization: token <bearer_token>
}

Response:
{
	"message": "Template tmp8a2b4bc5e00b4e458aeb12ce36b9b6b9ccf1 deleted successfully"
}

...