PCEI R4 API Document is located at this link.
PCEI Release 5 APIs
North Bound Interface APIs for:
- Kubernetes Edge Cluster Registration into Multi-Cluster Orchestrator (ONAP/EMCO). This API will allow to retrieve the K8S cluster config from Git and onboard it onto the orchestrator’s cluster provider registry.
- Terraform Plan Execution against target providers (Cloud, Equinix, Openstack). This API will allow to retrieve the Terraform plans from a Git repository and run them from the orchestrator’s workflow engine (CDS).
- Helm Chart Onboarding into ONAP for Service and App Registration. This API will allow to retrieve Helm charts from a Git repository and create a Service and Application definitions within the Orchestrator for a specific tenant.
- Service Instance creation and App deployment onto target Kubernetes clusters. This API will allow to create Service Instances based on the Services/Apps defined (as in point 3 above) in the orchestrator and deploy the Apps onto the target Kubernetes clusters (onboarded using point 1 above).
Kubernetes Edge Cluster Registration API
# You can refer to the below EMCO REST API link to get more details about the JSON payload # https://wiki.onap.org/display/DW/V2+API+Specification # Note:- You should update the attribute values for USER_INPUT_XXX parameters # USER_INPUT_EMCO_V2_API_URL_PREFIX : here update the amcop installed machine ip with portno(30480). # ex : http://<amcop server ip>>:30480/v2 # USER_INPUT_GIT_URL - git project url where kubconfig file exists # ex : https://gitlab.com/api/v4/projects/27142906/repository/files/edge-k8s-pcei-azure-config/raw?ref=development # USER_INPUT_GIT_DOWNLOAD_FOLDER : This shouldn't be modified. Always use "/opt/app/onap/blueprints/deploy/kubeconfig". # USER_INPUT_GIT_ACCESS_TOKEN - refer main readme file for "how to generate git access token" steps. $ vi request-payload.json { "actionIdentifiers": { "mode": "sync", "blueprintName": "emco-api-executor", "blueprintVersion": "1.0.0", "actionName": "emco-k8s-cluster-register-workflow" }, "payload": { "emco-k8s-cluster-register-workflow-request": { "emco-k8s-cluster-register-workflow-properties": { "emco-v2-api-url-prefix": "USER_INPUT_EMCO_V2_API_URL_PREFIX", "git-url": "USER_INPUT_GIT_URL", "git-access-token": "USER_INPUT_GIT_ACCESS_TOKEN", "git-download-folder": "/opt/app/onap/blueprints/deploy/kubeconfig", "emco-v2-cluster-provider-parameters": { "cluster-providers-payload": { "metadata": { "name": "USER_INPUT_NAME", "description": "USER_INPUT_DESCRIPTION", "userData1": "USER_INPUT_USERDATA1", "userData2": "USER_INPUT_USERDATA2" } } }, "emco-v2-cluster-parameters": { "cluster-providers-cluster-payload": { "metadata": { "name": "USER_INPUT_NAME", "description": "USER_INPUT_DESCRIPTION", "userData1": "USER_INPUT_USERDATA1", "userData2": "USER_INPUT_USERDATA2" } } }, "emco-v2-cluster-label-parameters": { "cluster-label-payload": { "label-name": "USER_INPUT_LABEL_NAME" } } } } }, "commonHeader": { "subRequestId": "143748f9-3cd5-4910-81c9-a4601ff2ea58", "requestId": "e5eb1f1e-3386-435d-b290-d49d8af8db4c", "originatorId": "SDNC_DG" } }
Terraform Plan Execution API
# Note that "terraform-action" attribute value should be "apply" # USER_INPUT_CDS_PY_EXEC_POD_IP : Use below command to get the CDS pyexecutor IP # kubectl get pods -n onap -o wide | grep dev-cds-py-executor | awk '{print $6}' # USER_INPUT_GIT_URL ex . "https://gitlab.com/api/v4" # USER_INPUT_GIT_ACCESS_TOKEN - refer main readme to generate the git access token. # USER_INPUT_GIT_PROJECT_ID : Git terraform project id. ex. 26901776 # USER_INPUT_GIT_BRANCH - git branch name ex. "development" # USER_INPUT_GIT_DOWNLOAD_FOLDER - Always give "/opt/app/onap/blueprints/deploy" # USER_INPUT_GIT_ARCHIVE_FILE_NAME - any tar file name ex. "terraform-plans-poc.tar.gz" # USER_INPUT_TERRAFORM_VARS_FILE_NAME - override file from git project ex. "terraform.tfvars" # USER_INPUT_TERRAFORM_PLAN_FOLDER - give correct git terraform plan folder name ex ."demo-azure-connectivity" { "commonHeader": { "originatorId": "System", "requestId": "123456", "subRequestId": "1234-12234" }, "actionIdentifiers": { "blueprintName": "terraform-plan-executor", "blueprintVersion": "1.0.0", "actionName": "remote-python", "mode": "sync" }, "payload": { "remote-python-request": { "cds-py-exec-pod-ip": "USER_INPUT_CDS_PY_EXEC_POD_IP", "git-url": "USER_INPUT_GIT_URL", "git-access-token": "USER_INPUT_GIT_ACCESS_TOKEN", "git-project-id": "USER_INPUT_GIT_PROJECT_ID", "git-branch": "USER_INPUT_GIT_BRANCH", "git-download-folder": "/opt/app/onap/blueprints/deploy", "git-archive-file-name": "USER_INPUT_GIT_ARCHIVE_FILE_NAME", "terraform-var-file-name": "USER_INPUT_TERRAFORM_VARS_FILE_NAME", "terraform-plan-folder": "USER_INPUT_TERRAFORM_PLAN_FOLDER", "terraform-variable-override": { "USER_INPUT_VAR_NAME_1": "USER_INPUT_VAR_VALUE_1", "USER_INPUT_VAR_NAME_2": "USER_INPUT_VAR_VALUE_2" }, "terraform-environment-variables": { "ARM_SUBSCRIPTION_ID": "USER_INPUT_ARM_SUBSCRIPTION_ID", "ARM_CLIENT_ID": "USER_INPUT_ARM_CLIENT_ID", "ARM_CLIENT_SECRET": "USER_INPUT_ARM_CLIENT_SECRET", "ARM_TENANT_ID": "USER_INPUT_ARM_TENANT_ID", "ARM_ACCESS_KEY": "USER_INPUT_ARM_ACCESS_KEY" }, "terraform-action": "apply", "terraform-workspace-name": "USER_INPUT_TERRAFORM_WORKSPACE_NAME" } } } { "commonHeader": { "originatorId": "System", "requestId": "123456", "subRequestId": "1234-12234" }, "actionIdentifiers": { "blueprintName": "terraform-plan-executor", "blueprintVersion": "1.0.0", "actionName": "remote-python", "mode": "sync" }, "payload": { "remote-python-request": { "cds-py-exec-pod-ip": "USER_INPUT_CDS_PY_EXEC_POD_IP", "git-url": "USER_INPUT_GIT_URL", "git-access-token": "USER_INPUT_GIT_ACCESS_TOKEN", "git-project-id": "USER_INPUT_GIT_PROJECT_ID", "git-branch": "USER_INPUT_GIT_BRANCH", "git-archive-file-name": "USER_INPUT_GIT_ARCHIVE_FILE_NAME", "git-download-folder": "USER_INPUT_GIT_DOWNLOAD_FOLDER", "terraform-plan-folder": "USER_INPUT_TERRAFORM_PLAN_FOLDER", "terraform-var-file-name": "USER_INPUT_TERRAFORM_VARS_FILE_NAME", "terraform-environment-variables": { }, "terraform-variable-override": { equinix_client_id": "USER_INPUT_EQUINIX_CLIENT_ID", "equinix_client_secret": "USER_INPUT_EQUINIX_CLIENT_SECRET", "equinix_port_name": "USER_INPUT_EQUINIX_PORT_NAME", "aws_access_key": "USER_INPUT_AWS_ACCESS_KEY", "aws_secret_key": "USER_INPUT_AWS_SECRET_KEY", "aws_region": "USER_INPUT_AWS_REGION", "aws_metro_code":"USER_INPUT_AWS_METRO_CODE", "aws_account_id":"USER_INPUT_AWS_ACCOUNT_ID" }, "terraform-action": "apply", "terraform-workspace-name": "USER_INPUT_TERRAFORM_WORKSPACE_NAME" } } } { "commonHeader": { "originatorId": "System", "requestId": "123456", "subRequestId": "1234-12234" }, "actionIdentifiers": { "blueprintName": "terraform-plan-executor", "blueprintVersion": "1.0.0", "actionName": "remote-python", "mode": "sync" }, "payload": { "remote-python-request": { "cds-py-exec-pod-ip": "USER_INPUT_CDS_PY_EXEC_POD_IP", "git-url": "USER_INPUT_GIT_URL", "git-access-token": "USER_INPUT_GIT_ACCESS_TOKEN", "git-project-id": "USER_INPUT_GIT_PROJECT_ID", "git-branch": "USER_INPUT_GIT_BRANCH", "git-archive-file-name": "USER_INPUT_GIT_ARCHIVE_FILE_NAME", "git-download-folder": "USER_INPUT_GIT_DOWNLOAD_FOLDER", "terraform-plan-folder": "USER_INPUT_TERRAFORM_PLAN_FOLDER", "terraform-var-file-name": "USER_INPUT_TERRAFORM_VARS_FILE_NAME", "terraform-environment-variables": { "OS_AUTH_URL": "USER_INPUT_OS_AUTH_URL", "OS_USERNAME": "USER_INPUT_OS_USERNAME", "OS_PASSWORD": "USER_INPUT_OS_PASSWORD", "OS_REGION_NAME": "USER_INPUT_OS_REGION_NAME", "OS_PROJECT_NAME": "USER_INPUT_OS_PROJECT_NAME", "OS_PROJECT_DOMAIN_NAME": "USER_INPUT_OS_PROJECT_DOMAIN_NAME", "OS_USER_DOMAIN_NAME": "USER_INPUT_OS_USER_DOMAIN_NAME", "OS_IDENTITY_API_VERSION": "USER_INPUT_OS_IDENTITY_API_VERSION" }, "terraform-variable-override": { "USER_INPUT_VARIABLE_NAME": "USER_INPUT_VARIABLE_VALUE" }, "terraform-action": "apply", "terraform-workspace-name": "USER_INPUT_TERRAFORM_WORKSPACE_NAME" } } }