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>"}

...

> 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.

...

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.

POST

Code Block
languagejs
titlePOST
linenumberstrue
URL: /v2/projects/{project-name}/composite-apps/{composite-app-name}/{verison}/profiles
POST BODY:
{
    "profile-name": "test",
    "description":  "<description>",
}

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

...

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.

...

Generic Placement Intent API is used to create generic placement intents for sub-applications in an application. Intent created using this API will be added to an Intent Group for use during instantiation.

POST

Code Block
languagejs
titlePOST
linenumberstrue
URL: /v2/projects/{project-name}/composite-apps/{composite-app-name}/{version}/generic-placement-intents
POST BODY:
{
   "generic-placement-intent-name":"intent-1",
   "description": "<description>",
   "logical-cloud": "logical-cloud-name"  //name of logical cloud to use for instantiation. The DCM API will provide the list of clusters that are part of the logical-cloud

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

...

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"
                 }
              ]
           }
        ]
	}
}

...

Deployment Intent Group API is used to create Intent Groups that can then will be used at instantiation time. Some intents that can be part of an Intent Group are Generic Placement Intent, HPA Intent, and traffic controller Intent.

POST

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

RETURN STATUS: 201
RETURN BODY: 
{ 
  "deployment-intent-group-name": "<intent-group-name>",
  "description": "<description>"
}

...

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"
      }
}

...

Instantiation API to instantiate composite app based on intent-group. Destroy API deletes the app and Status API returns the resources 

POST

Code Block
languagejs
titlePOST
linenumberstrue
URL: /v2/projects/{project-name}/composite-apps/{composite-app-name}/{version}/deployment-intent-groups/{deployment-intent-group-name}/initantiate
POST BODY:
{
    "name": <name>
    "description": <description>,
	//override-values overrides values from the helm charts and allows for instantiation time
    //variable overrides.
    "override-values": [
  	 {"app-name":[{"imageRepository":"registry.hub.docker.com"}]},
     {"app-name":[{"imageRepository":"registry.hub.docker.com"}]}
    ]
}

RETURN STATUS: 201
RETURN BODY: 
{  
    "name": <name>
    "description": <description>,
	//override-values overrides values from the helm charts and allows for instantiation time
    //variable overrides.
    "override-values": [
  	 {"app-name":[{"imageRepository":"registry.hub.docker.com"}]},
     {"app-name":[{"imageRepository":"registry.hub.docker.com"}]}
    ]
}

URL: /v2/projects/{project-name}/composite-apps/{composite-app-name}/{version}/deployment-intent-groups/{deployment-intent-group-name}/status
POST BODY:
{
	"name": <name>
}

RETURN STATUS: 201
RETURN BODY: 
{  
  "name": "<name>",
  "composite-app-name": "test-rbdef",
  "composite-app-version": "v1",
  "profile-name": "test-rbdef",
  "intent-group": "intent-group-1"
  "namespace": "testinstallns",
  "resources": [
    {
      "GVK": {
        "Group": "",
        "Version": "v1",
        "Kind": "Service"
      },
      "cluster-name": "cluster1",
      "Name": "mongo",
      "status": "Running"
    },
    {
      "GVK": {
        "Group": "",
        "Version": "v1",
        "Kind": "Service"
      },
      "cluster-name": "cluster2",
      "Name": "mongo-read",
      "status": "Terminated"
    }
  ]
  
}

URL: /v2/projects/{project-name}/composite-apps/{composite-app-name}/{version}/deployment-intent-groups/{deployment-intent-group-name}/destroy
POST BODY:
{
   "name": <name>
    
}
RETURN STATUS: 201
RETURN BODY: 
{  
    "name": <name>
}

...

API to support Reachability for a Kubernetes Cloud. This API will be used to upload configuration information for the cluster

POST

Code Block
languagejs
titlePOST
linenumberstrue
URL: /v2/clusters
POST BODY:
{
    “cluster-name” : “<name>”,  // Must be unique 
    "description": <description>
}

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

...

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>”
}

...

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

POST

Code Block
languagejs
titlePOST
linenumberstrue
URL: /v2/clusters/{cluster-name}/kv-pairs
POST BODY:
{
   "kv":[
      {
         "key1":"val1"
      },
      {
         "key2":"val2"
      }
   ]
}

RETURN STATUS: 201
RETURN BODY: 
{ 
    "kv":[
      {
         "key1":"val1"
      },
      {
         "key2":"val2"
      }
   ]
}

...