Versions Compared

Key

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

...

Composite Application names are unique within a Project. Composite application resource represents a collection of applications and each application is represented by helm charts. Each Helm chart is wrapped in tar.gz format.

POST

Code Block
languagejs
titlePOST
linenumberstrue
URL: /v2/projects/{project-name}/composite-apps
POST BODY:
{
    "name": "<name>",
    "description": "<description>"
    "version": "<version of the composite app>"
}

RETURN STATUS: 201
RETURN BODY: {  "name": "<name>",
  "description": "<description>"}

...

Code Block
languagejs
titleGET, DELETE
linenumberstrue
GET
URL: /v2/projects/{project-name}/composite-apps/{composite-app-name}/{version}

RETURN STATUS: 200
RETURN BODY: 
{  
  "name": "<name>",
  "description": "<description>"
  "version": "<version of the composite app>"
}

DELETE
URL: /v2/projects/{project-name}/composite-apps/{composite-app-name}/{version}

RETURN STATUS: 204

Adding applications to composite app

Format of the Helm chart for the application wrapped in tar.gz 

> cd vagrant/tests/vnfs/testrb/helm
> find vault-consul-dev
vault-consul-dev
vault-consul-dev/Chart.yaml
vault-consul-dev/values.yaml
vault-consul-dev/templates
vault-consul-dev/templates/service.yaml
vault-consul-dev/templates/deployment.yaml
vault-consul-dev/charts
vault-consul-dev/charts/common/values.yaml
vault-consul-dev/charts/common/templates/_service.tpl
vault-consul-dev/charts/common/templates/_repository.tpl
vault-consul-dev/charts/common/templates/_name.tpl
vault-consul-dev/charts/common/templates/_namespace.tpl
vault-consul-dev/charts/common/templates
vault-consul-dev/charts/common/Chart.yaml
vault-consul-dev/charts/common
 
#Create a tar.gz for upload
> tar -cf vault-consul-dev.tar vault-consul-dev
> gzip vault-consul-dev.tar


POST

This POST is a multipart POST. With the POST body containing the data about the application and the tar.gz uploaded in multipart form.

Code Block
languagejs
titlePOST
linenumberstrue
URL: /v2/projects/{project-name}/composite-apps/{composite-app-name}/{version}/apps
POST BODY:
{
    "app-name": "<name>", // Name of the application
    "description": "<description>"
}

RETURN STATUS: 201
RETURN BODY: {  "name": "<name>",
  "description": "<description>"}

...

Code Block
languagejs
titleGET, DELETE
linenumberstrue
GET
URL: /v2/projects/{project-name}/composite-apps/{composite-app-name}/{version}/apps/{app-name}

RETURN STATUS: 200
RETURN BODY: 
{  
  "name": "<name>",
  "description": "<description>"
}
Multipart response containing the tar.gz of the Helm chart for the app

DELETE
URL: /v2/projects/{project-name}/composite-apps/{composite-app-name}/{version}/apps/{app-name}

RETURN STATUS: 204

Profile API

Once the definitions for applications are created, profiles are created to customize the applications. Later on, they are instantiated in Kubernetes by the instantiation API.

...

Code Block
languagejs
titleGET, DELETE
linenumberstrue
GET
URL: /v2/project/{project-name}/composite-apps/{composite-app-name}/{version}/profiles/{profile-name}

RETURN STATUS: 200
RETURN BODY: 
{  
  "name": "test",
  "description": "<description>"
}

DELETE
URL: /v2/projects/{project-name}/composite-apps/{app-name}/{app-version}/profiles/{profile-name}

RETURN STATUS: 204

Adding profile per application

A per application profile contains the following:

...

Create the profile artifact
Creating a Profile Artifact

1
2
3
4
5
6
7
8
9
10
11
12
13

> cd vagrant/tests/vnfs/testrb/helm/profile
> find .
manifest.yaml
override_values.yaml
testfol
testfol/subdir
testfol/subdir/deployment.yaml
 
#Create profile tar.gz
> cd profile
> tar -cf profile.tar *
> gzip profile.tar
> mv profile.tar.gz ../

The manifest file contains the following:
manifest.yaml

1
2
3
4
5
6
7

---
version: v1
type:
  values: "values_override.yaml"
  configresource:
    - filepath: testfol/subdir/deployment.yaml
      chartpath: vault-consul-dev/templates/deployment.yaml

POST

This POST is a multipart POST. With the POST body containing the data about the profile and the profile tar.gz uploaded in multipart form.

...

Code Block
languagejs
titlePOST
linenumberstrue
GET
URL:  /v2/projects/{project-name}/composite-apps/{composite-app-name}/{version}/generic-placement-intents/{intent-name}

RETURN STATUS: 200
RETURN BODY: 
{
   "intent-name":"intent-1",
   "description": "<description>",
    "logical-cloud": "logical-cloud-name"
}

DELETE
URL: /v2/project/{project-name}/rb/{rb-name}/{rb-version}/generic-placement-intent/{intent-name}

RETURN STATUS: 204

Adding placement intent for each application in the composite-app

POST

Code Block
languagejs
titlePOST
linenumberstrue
URL: /v2/project/{project-name}/composite-apps/{composite-app-name}/{version}/generic-placement-intent/{intent-name}/apps
POST BODY:
{
   "app-name":"name",
   "description": "<description>",
   "intent":
	{
        "allOf":[
           {
              "cluster-name":"edge1"
           },
           {
              "cluster-name":"edge2"
           },
           {
              "anyOf":[
                 {
                    "label-name":"east-us1"
                 },
                 {
                    "label-name":"east-us2"
                 }
              ]
           }
        ]
  }
 

RETURN STATUS: 201
RETURN BODY: 
{ 
  "app-name": "name",
  "description": "<description>",
   "intent":
	{
        "allOf":[
           {
              "cluster-name":"edge1"
           },
           {
              "cluster-name":"edge2"
           },
           {
              "anyOf":[
                 {
                    "label-name":"east-us1"
                 },
                 {
                    "label-name":"east-us2"
                 }
              ]
           }
        ]
	}
}

...

Code Block
languagejs
titlePOST
linenumberstrue
GET
URL: /v2/projects/{project-name}/composite-apps/{composite-app-name}/{version}/deployment-intent-groups/{deployment-intent-group-name}

RETURN STATUS: 200
RETURN BODY: 
{
     "deployment-intent-group-name":"<intent-group-name>",
     "profile": "<profile-name>",
     "version": "<version of the deployment>"
     "description": "<description>"
}

DELETE
URL: /v2/projects/{project-name}/composite-apps/{composite-app-name}/{version}/deployment-intent-groups/{deployment-intent-group-name}

RETURN STATUS: 204

Adding intents to an Intent group

POST

Code Block
languagejs
titlePOST
linenumberstrue
URL: v2/projects/{project-name}/composite-apps/{composite-app-name}/{version}/deployment-intent-groups/{deployment-intent-group-name}/intents
POST BODY:
{
   "intent-name":"<name>",
   "description": "<description>"
   "intent":
      {
         "generic":"xyz-generic-placement-intent"
      }
}

RETURN STATUS: 201
RETURN BODY: 
{ 
  "intent-name": "intent-group-1",
  "description": "Intent Group for Customer1"
   "intent":
      {
         "generic":"xyz-generic-placement-intent"
      }
}

...

Code Block
languagejs
titlePOST
linenumberstrue
GET
URL: /v2/clusters/{cluster-name}

RETURN STATUS: 200
RETURN BODY: 
{
    “cluster-name” : “<name>”,   // Must be unique across
    "description": <description>
}

DELETE
URL: /v2/clusters/{cluster-name}

RETURN STATUS: 204

Add Label to a cluster

POST

Code Block
languagejs
titlePOST
linenumberstrue
URL: /v2/cluster-registration/{cluster-name}/labels
POST BODY:
{
    “label-name” : “<label>”
}

RETURN STATUS: 201
RETURN BODY: 
{ 
     “label-name” : “<label>”
}

...

Code Block
languagejs
titlePOST
linenumberstrue
GET
URL: /v2/clusters/{cluster-name}/labels/<label>

RETURN STATUS: 200
RETURN BODY: 
{
      “label-name” : “<label>”
}

DELETE
URL: /v2/clusters/{cluster-name}/labels/<label>

RETURN STATUS: 204

Add key-value pair to a cluster

Add property to a cluster without the need for change to the API.

...