The following document describes the v2 api for the scheduler.
Tip |
---|
For the V1 API, please refer to MultiCloud K8s-Plugin-service API |
Projects API
Projects API
The project allows Projects are new concept that has been introduced in the v2 api. They allow multi-tenancy in the application from a user perspective.
...
Code Block |
---|
language | bash |
---|
title | POST |
---|
linenumbers | true |
---|
|
POST
URL: /v2/projectprojects
POST BODY:
{
name: "Name of Project" //must be unique
}
RETURN STATUS: 201
RETURN BODY:
{
name: "name of the project"
} |
GET, DELETE
Code Block |
---|
language | bash |
---|
title | GET, DELETE |
---|
linenumbers | true |
---|
|
GET
URL: /v2/project/{project-namemetadata": {
"name": "<name>",
"description": "<description>",
"userData1": "<user data>",
"userData2": "<user data>"
}
}
RETURN STATUS: 200201
RETURN BODY:
{
"metadata": {
"name": ""<name>"Name, of
Project" //must "description": "<description>",
"userData1": "<user data>",
"userData2": "<user data>"
}
} |
GET, DELETE
Code Block |
---|
language | bash |
---|
title | GET, DELETE |
---|
linenumbers | true |
---|
|
GETbe unique
}
DELETE
URL: /v2/projectprojects/{project-name}
RETURN STATUS: 200
RETURN BODY: 204 |
Resource Bundle API
The resource bundle API is now keyed off the Project API
Resource Bundle Names and Versions are unique within a Project.
POST
Code Block |
---|
language | js |
---|
title | POST |
---|
linenumbers | true |
---|
|
URL: /v2/project/{project-name}/rb
POST BODY:
{
"metadata": {
"rb-name": "test-rbdef<name>",
"rb-versiondescription": "v1<description>",
"descriptionuserData1": "testing resource bundle definition api<user data>",
}
RETURN STATUS: 201
RETURN BODY: { "rb-nameuserData2": "test-rbdef",
"rb-version": "v1",
"description": "testing resource bundle definition api",} |
...
<user data>"
}
}
DELETE
URL: /v2/projects/{project-name}
RETURN STATUS: 204
|
Code Block |
---|
language | jsbash |
---|
title | GET, DELETE |
---|
linenumbers | true |
---|
|
GET
URL: /v2/projectprojects/{project-name}/rb/{rb-name}/{rb-version}
RETURN STATUS: 200
RETURN BODY:
{
"metadata": {
"rb-name": "test-rbdef<name>",
"rb-versiondescription": "v1<description>",
"descriptionuserData1": "<user data>"testing,
resource bundle definition api""userData2": "<user data>"
}
}
DELETE
URL: /v2/projectprojects/{project-name}/rb/{rb-name}/{rb-version}
RETURN STATUS: 204
|
Profile API
The Profile API is now keyed off the new rb API based on projects
Composite Application API
Composite Application Profile names are unique within a resource bundle and version.
Changes with respect to V1 API:
...
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 |
---|
language | js |
---|
title | POST |
---|
linenumbers | true |
---|
|
URL: /v2/projectprojects/{project-name}/rb/{rb-name}/{rb-version}/profilecomposite-apps
POST BODY:
{
"profile-namemetadata":{
"test-rbdef "name":"<name>",
"namespacedescription":"<description>",
"onap"userData1":"<user data>",
//Kubernetes namespace to install the charts in
"userData2":"<user data>"
},
"descriptionspec":{
"version":"testing<version resourceof bundlethe definitioncomposite api",app>"
}
}
RETURN STATUS: 201
RETURN BODY:
{
"rb-namemetadata":{
"test-rbdef "name":"<name>",
"rb-versiondescription": "v1<description>",
"profile-nameuserData1": "test-rbdef"<user data>",
"namespaceuserData2":"<user "v1"data>"
},
"descriptionspec":{
"version":"testing<version resourceof bundlethe definitioncomposite apiapp>"
}
} |
GET, DELETE
Code Block |
---|
language | js |
---|
title | GET, DELETE |
---|
linenumbers | true |
---|
|
GET
URL: /v2/projectprojects/{project-name}/rbcomposite-apps/{rbcomposite-app-name}/{rb-version}/profile/{profile-name}
RETURN STATUS: 200
RETURN BODY:
{
"metadata":{
"rb-name": "test-rbdef<name>",
"rb-versiondescription": "v1<description>",
"profile-nameuserData1": "test-rbdef"<user data>",
"namespaceuserData2":"<user "v1"data>"
},
"descriptionspec":{
"testing resource bundle definition api"
}
DELETE
URL: /v2/project"version":"<version of the composite app>"
}
}
DELETE
URL: /v2/projects/{project-name}/rbcomposite-apps/{rbcomposite-app-name}/{rb-version}/profile/{profile-name}
RETURN STATUS: 204 |
Intent Group API
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 Connectivity Intent.
POST
Adding applications to composite app
Format of the Helm chart for the application wrapped in tar.gz
> cd vagrant /tests/vnfs/test/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
> 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 |
---|
language | js |
---|
title | POST |
---|
linenumbers | true |
---|
|
URL: /v2/projects/{project-name}/composite-apps/{composite-app-name}/{version}/apps
POST BODY:
{
"metadata":{
"name":"<name>",
"description":"<description>",
"userData1":"<user data>",
"userData2":"<user data>"
}
}
RETURN STATUS: 201
RETURN BODY:
{
"metadata":{
"name":"<name>",
"description":"<description>",
"userData1":"<user data>",
"userData2":"<user data>"
}
} |
GET, DELETE
Code Block |
---|
language | js |
---|
title | GET, DELETE |
---|
linenumbers | true |
---|
|
GET
URL: /v2/projects/{project-name}/composite-apps/{composite-app-name}/{version}/apps/{app-name}
RETURN STATUS: 200
RETURN BODY:
{
"metadata":{
"name":"<name>",
"description":"<description>",
"userData1":"<user data>",
"userData2":"<user data>"
}
}
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.
POST
Code Block |
---|
language | js |
---|
title | POST |
---|
linenumbers | true |
---|
|
URL: /v2/projects/{project-name}/composite-apps/{composite-app-name}/{verison}/composite-profiles
POST BODY:
{
"metadata":{
"name":"<name>",
"description":"<description>",
"userData1":"<user data>",
"userData2":"<user data>"
}
}
RETURN STATUS: 201
RETURN BODY:
{
"metadata":{
"name":"<name>",
"description":"<description>",
"userData1":"<user data>",
"userData2":"<user data>"
}
} |
GET, DELETE
Code Block |
---|
language | js |
---|
title | GET, DELETE |
---|
linenumbers | true |
---|
|
GET
URL: /v2/project/{project-name}/composite-apps/{composite-app-name}/{version}/composite-profiles/{composite-profile-name}
RETURN STATUS: 200
RETURN BODY:
{
"metadata":{
"name":"<name>",
"description":"<description>",
"userData1":"<user data>",
"userData2":"<user data>"
}
}
DELETE
URL: /v2/projects/{project-name}/composite-apps/{app-name}/{app-version}/composite-profiles/{composite-profile-name}
RETURN STATUS: 204 |
Adding profile per application
A per application profile contains the following:
- manifest.yaml
- Contains the details for the profile and everything contained within
- A HELM values override yaml file.
- It can have any name as long as it matches the corresponding entry in the manifest.yaml
- Any number of files organized in a folder structure
- All these files should have a corresponding entry in manifest.yaml file
Sample Profile is described below:
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/test/helm/profile
> find .
manifest.yaml
override_values.yaml
testfol
testfol /subdir
testfol /subdir/deployment .yaml
> 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 |
---|
language | js |
---|
title | POST |
---|
linenumbers | true |
---|
|
URL: /v2/projects/{project-name}/composite-apps/{composite-app-name}/{verison}/composite-profiles/{composite-profile-name}/profiles
POST BODY:
{
"metadata":{
"name":"<name>",
"description":"<description>",
"userData1":"<user data>",
"userData2":"<user data>"
},
"spec":{
"app-name": "<name>", // Must match the name given in composite-apps/apps API
}
}
Multipart request containg tar.gz of the profile
RETURN STATUS: 201
RETURN BODY:
{
"metadata":{
"name":"<name>",
"description":"<description>",
"userData1":"<user data>",
"userData2":"<user data>"
},
"spec":{
"app-name": "<name>", // Must match the name given in composite-apps/apps API
}
} |
GET, DELETE
Code Block |
---|
language | js |
---|
title | GET, DELETE |
---|
linenumbers | true |
---|
|
GET
URL: /v2/project/{project-name}/composite-apps/{composite-app-name}/{version}/composite-profiles/{composite-profile-name}/profiles/{profile-name}
RETURN STATUS: 200
RETURN BODY:
{
"metadata":{
"name":"<name>",
"description":"<description>",
"userData1":"<user data>",
"userData2":"<user data>"
},
"spec":{
"app-name": "<name>", // Must match the name given in composite-apps/apps API
}
}
Multipart response containing the tar.gz of the profile
GET (Query)
URL: /v2/project/{project-name}/composite-apps/{composite-app-name}/{version}/composite-profiles/{composite-profile-name}/profiles?app-name=<app-name>
RETURN STATUS: 200
RETURN BODY:
{
"app-name": "<name>"
}
Multipart response containing the tar.gz of the profile
DELETE
URL: /v2/project/{project-name}/composite-apps/{composite-app-name}/{version}/composite-profiles/{composite-profile-name}/profiles/{profile-name}
RETURN STATUS: 204 |
Generic Placement Intent API
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 |
---|
language | js |
---|
title | POST |
---|
linenumbers | true |
---|
|
URL: /v2/projects/{project-name}/composite-apps/{composite-app-name}/{version}/generic-placement-intents
POST BODY:
{
"metadata":{
"name":"<name>",
"description":"<description>",
"userData1":"<user data>",
"userData2":"<user data>"
},
"spec":{
"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:
{
"metadata":{
"name":"<name>",
"description":"<description>",
"userData1":"<user data>",
"userData2":"<user data>"
},
"spec":{
"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
}
} |
GET, DELETE
Code Block |
---|
language | js |
---|
title | Get, Delete |
---|
linenumbers | true |
---|
|
GET
URL: /v2/projects/{project-name}/composite-apps/{composite-app-name}/{version}/generic-placement-intents/{intent-name}
RETURN STATUS: 200
RETURN BODY:
{
"metadata":{
"name":"<name>",
"description":"<description>",
"userData1":"<user data>",
"userData2":"<user data>"
},
"spec":{
"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
}
}
DELETE
URL: /v2/project/{project-name}/composite-apps/{composite-app-name}/{version}/generic-placement-intents/{intent-name}
RETURN STATUS: 204
|
Adding placement intent for each application in the composite-app
POST
Code Block |
---|
language | js |
---|
title | POST |
---|
linenumbers | true |
---|
|
URL: /v2/project/{project-name}/composite-apps/{composite-app-name}/{version}/generic-placement-intent/{intent-name}/app-intents
POST BODY:
{
"metadata":{
"name":"<name>",
"description":"<description>",
"userData1":"<user data>",
"userData2":"<user data>"
},
"spec":{
"app-name":"name",
"intent":{
"allOf":[
{
"provider-name":"aws"
"cluster-name":"edge1"
},
{
"provider-name":"aws"
"cluster-name":"edge2"
},
{
"anyOf":[
{
"provider-name":"aws"
"cluster-label-name":"east-us1"
},
{
"provider-name":"aws"
"cluster-label-name":"east-us2"
}
]
}
]
}
}
}
RETURN STATUS: 201
RETURN BODY:
{
"metadata":{
"name":"<name>",
"description":"<description>",
"userData1":"<user data>",
"userData2":"<user data>"
},
"spec":{
"app-name":"name",
"intent":{
"allOf":[
{
"provider-name":"aws"
"cluster-name":"edge1"
},
{
"provider-name":"aws"
"cluster-name":"edge2"
},
{
"anyOf":[
{
"provider-name":"aws"
"cluster-label-name":"east-us1"
},
{
"provider-name":"aws"
"cluster-label-name":"east-us2"
}
]
}
]
}
}
} |
GET, DELETE
Code Block |
---|
language | js |
---|
title | Get, Delete |
---|
linenumbers | true |
---|
|
GET
URL: /v2/project/{project-name}/composite-apps/{composite-app-name}/{version}/generic-placement-intent/{intent-name}/app-intents
RETURN STATUS: 200
RETURN BODY:
{
"applications":[
{
"name":"app1",
"anyOf":[
{
"provider-name":"aws"
"cluster-name":"edge1"
},
{
"provider-name":"aws"
"cluster-name":"edge2"
}
]
},
{
"name":"app2",
"allOf":[
{
"provider-name":"aws"
"cluster-name":"edge1"
},
{
"provider-name":"aws"
"cluster-name":"edge2"
}
]
},
{
"name":"app3",
"allOf":[
{
"provider-name":"aws"
"cluster-name":"edge1"
},
{
"provider-name":"aws"
"cluster-name":"edge2"
},
{
"anyOf":[
{
"provider-name":"aws"
"cluster-label-name":"east-us1"
},
{
"provider-name":"aws"
"cluster-label-name":"east-us2"
}
]
}
]
}
]
}
GET
URL: /v2/project/{project-name}/composite-apps/{composite-app-name}/{version}/generic-placement-intent/{intent-name}/app-intents/{intent-name}
RETURN STATUS: 200
RETURN BODY:
{
"metadata":{
"name":"<name>",
"description":"<description>",
"userData1":"<user data>",
"userData2":"<user data>"
},
"spec":{
"app-name":"name",
"intent":{
"allOf":[
{
"provider-name":"aws"
"cluster-name":"edge1"
},
{
"provider-name":"aws"
"cluster-name":"edge2"
},
{
"anyOf":[
{
"provider-name":"aws"
"cluster-label-name":"east-us1"
},
{
"provider-name":"aws"
"cluster-label-name":"east-us2"
}
]
}
]
}
}
}
GET (Query)
URL: /v2/project/{project-name}/composite-apps/{composite-app-name}/{version}/generic-placement-intent/{intent-name}/app-intents?app-name=<app-name>
RETURN STATUS: 200
RETURN BODY:
{
"intent":{
"allOf":[
{
"provider-name":"aws"
"cluster-name":"edge1"
},
{
"provider-name":"aws"
"cluster-name":"edge2"
},
{
"anyOf":[
{
"provider-name":"aws"
"cluster-label-name":"east-us1"
},
{
"provider-name":"aws"
"cluster-label-name":"east-us2"
}
]
}
]
}
}
DELETE
URL: /v2/project/{project-name}/composite-apps/{composite-app-name}/{version}/generic-placement-intent/{intent-name}/apps-intents/{intent-name}
RETURN STATUS: 204
|
Deployment Intent Group API
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 |
---|
language | js |
---|
title | POST |
---|
linenumbers | true |
---|
|
URL: /v2/projects/{project-name}/composite-apps/{composite-app-name}/{version}/deployment-intent-groups
POST BODY:
{
"metadata":{
"name":"<name>",
"description":"<description>",
"userData1":"<user data>",
"userData2":"<user data>"
},
"spec":{
"profile":"<profile-name>",
"version":"<version of the deployment>",
"override-values":[
{
"app-name":"<name>",
"values":[
{
"imageRepository":"registry.hub.docker.com"
}
]
},
{
"app-name":"<name>",
"values":[
{
"imageRepository":"registry.hub.docker.com"
}
]
}
]
}
}
RETURN STATUS: 201
RETURN BODY:
{
"metadata":{
"name":"<name>",
"description":"<description>",
"userData1":"<user data>",
"userData2":"<user data>"
},
"spec":{
"profile":"<profile-name>",
"version":"<version of the deployment>",
"override-values":[
{
"app-name":"<name>",
"values":[
{
"imageRepository":"registry.hub.docker.com"
}
]
},
{
"app-name":"<name>",
"values":[
{
"imageRepository":"registry.hub.docker.com"
}
]
}
]
}
} |
GET, DELETE
Code Block |
---|
language | js |
---|
title | Get, Delete |
---|
linenumbers | true |
---|
|
GET
URL: /v2/projects/{project-name}/composite-apps/{composite-app-name}/{version}/deployment-intent-groups/{deployment-intent-group-name}
RETURN STATUS: 200
RETURN BODY:
{
"metadata":{
"name":"<name>",
"description":"<description>",
"userData1":"<user data>",
"userData2":"<user data>"
},
"spec":{
"profile":"<profile-name>",
"version":"<version of the deployment>",
"status": "approved", // approved or not-approved
"override-values":[
{
"app-name":"<name>",
"values":
{
"imageRepository":"registry.hub.docker.com",
"another_key":"another_value"
}
},
{
"app-name":"<name>",
"values":
{
|
Code Block |
---|
language | js |
---|
title | POST |
---|
linenumbers | true |
---|
|
URL: /v2/intent-group
POST BODY:
{
"intent-group-name":"intent-group-1",
"description":"Intent Group for Customer1",
"group":[
{
"genericimageRepository":"xyz-generic-placement-intent"
},registry.hub.docker.com",
"another_key":"another_value"
{
"hpa":"xyz-hpa-intent"}
},
{
"traffic":"xyz-traffic-intent"}
}]
]}
}
RETURN STATUS: 201
RETURN BODY:
{
"intent-name": "intent-group-1",
"description": "Intent Group for Customer1"
} |
...
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 |
---|
language | js |
---|
title | POST |
---|
linenumbers | true |
---|
|
GET
URL: /v2/intent-group/{intent-group-name}
RETURN STATUS: 200
RETURN BODY:
{
"intent-group-name":"intent-group-1",
"description":"Intent Group for Customer1",v2/projects/{project-name}/composite-apps/{composite-app-name}/{version}/deployment-intent-groups/{deployment-intent-group-name}/intents
POST BODY:
{
"groupmetadata":[{
{
"name":"<name>",
"genericdescription":"xyz-generic-placement-intent"
<description>",
}"userData1":"<user data>",
{ "userData2":"<user data>"
},
"hpaspec":"xyz-hpa-intent"
},{
"intent":{
"trafficgeneric-placement-intent":"xyz-generic-trafficplacement-intent"
}
]
}
DELETE
URL: /v2/intent-group/{intent-group-name}
RETURN STATUS: 204
|
Generic Placement Intent API
Generic Placement Intent API is used to create generic placement intents for sub-applications in an application and will be added to an Intent Group.
POST
Code Block |
---|
language | js |
---|
title | POST |
---|
linenumbers | true |
---|
|
URL: /v2/intent/placement/generic
POST BODY:
{}
RETURN STATUS: 201
RETURN BODY:
{
"intent-namemetadata":"intent-1",
{
"descriptionname":"Intent-1 for Customer1<name>",
"applicationsdescription":[
{
"<description>",
"nameuserData1":"app1<user data>",
"anyOfuserData2":["<user data>"
},
"spec":{
{
"intent":{
"clustergeneric-placement-nameintent":"edge1"xyz-generic-placement-intent"
}
},
{
}
} |
GET, DELETE
Code Block |
---|
language | js |
---|
title | Get, Delete |
---|
linenumbers | true |
---|
|
GET
URL: /v2/projects/{project-name}/composite-apps/{composite-app-name}/{version}/deployment-intent-groups/{deployment-intent-group-name}/intents/{intent-name}
{
"metadata":{
"cluster-name":"edge2<name>",
}
]
},
{
"description":"<description>",
"nameuserData1":"app2<user data>",
"allOfuserData2":["<user data>"
},
"spec":{
{
"intent":{
"clustergeneric-placement-nameintent":"edge1xyz-generic-placement-intent"
}
},
{
}
}
GET
URL: /v2/projects/{project-name}/composite-apps/{composite-app-name}/{version}/deployment-intent-groups/{deployment-intent-group-name}/intents
RETURN STATUS: 200
RETURN BODY:
{
"cluster-nameintent":"edge2"[
}
]
},
{
{
"namegeneric-placement-intent":"app3",generic-placement-intent-name"
"allOf":[
},
{
"cluster-namehpa":"edge1hpa-placement-intent-name"
},
{
"cluster-nametraffic":"edge2traffic-intent-name"
}
]
},
GET {
(Query)
URL: /v2/projects/{project-name}/composite-apps/{composite-app-name}/{version}/deployment-intent-groups/{deployment-intent-group-name}/intents?intent=<intent>
{
"anyOf":[
{
"label-name":"east-us1"
},
{
"label-name":"east-us2"
}
]
}
]
}
]generic-placement-intent":"xyz-generic-placement-intent"
}
DELETE
URL: /v2/projects/{project-name}/composite-apps/{composite-app-name}/{version}/deployment-intent-groups/{deployment-intent-group-name}/intents/{intent-name}
RETURN STATUS: 204
|
Instantiation, Destroy, Status API
Instantiation API to instantiate composite app based on intent-group. Destroy API deletes the app and Status API returns the resources
POST
Code Block |
---|
language | js |
---|
title | POST |
---|
linenumbers | true |
---|
|
URL: /v2/projects/{project-name}/composite-apps/{composite-app-name}/{version}/deployment-intent-groups/{deployment-intent-group-name}/approve
POST BODY:
{
}
RETURN STATUS: 201
RETURN BODY:
{
}
URL: /v2/projects/{project-name}/composite-apps/{composite-app-name}/{version}/deployment-intent-groups/{deployment-intent-group-name}/instantiate
POST BODY:
{
}
RETURN STATUS: 201
RETURN BODY:
{
}
URL: /v2/projects/{project-name}/composite-apps/{composite-app-name}/{version}/deployment-intent-groups/{deployment-intent-group-name}/destroy
POST BODY:
{
}
"intent-name": "intent-1",
"description": "Intent-1 for Customer1"
} |
GET, DELETE
Code Block |
---|
language | js |
---|
title | POST |
---|
linenumbers | true |
---|
|
GETRETURN STATUS: 201
RETURN BODY:
{
}
URL: /v2/projects/{project-name}/composite-apps/{composite-app-name}/{version}/deployment-intent/placement/generic/{intent-name-groups/{deployment-intent-group-name}/status
POST BODY:
{
}
RETURN STATUS: 200201
RETURN BODY:
{
"intent-name": "intent-1<name>",
"descriptioncomposite-app-name": "Intent-1 for Customer1test-app",
"composite-app-version": "applications":[
{
v1",
"profile-name": "app1test-app-profile",
"anyOfintent-group":[
{ "intent-group-1"
"namespace": "testinstallns",
"resources":
[
{
"clusterapp-name": "edge1collectd",
"clusters": [
},{
{
"name": "cluster1",
"cluster-nameresources":"edge2" [
}{
]
},
"GVK": {
{
"nameGroup": "app2",
"allOf":[
{"Version": "v1",
"cluster-nameKind": "edge1Service"
},
{
"Name": "mongo",
"cluster-namestatus": "edge2Running"
},
]{
},
"GVK": {
"nameGroup": "app3",
"allOf":[
{"Version": "v1",
"cluster-nameKind": "edge1Service"
},
{
"Name": "mongo-read",
"cluster-namestatus": "edge2Terminated"
},
{]
}
]
}
]
Status "anyOf":[
{
Queries:
URL: /v2/projects/{project-name}/composite-apps/{composite-app-name}/{version}/deployment-intent-groups/{deployment-intent-group-name}/status?output=<output-type>&app=<app-name>&cluster=<cluster-name>&resource=<resource-name>
output-type can be small or full.
Query can be a combination of the app, cluster and resources.
|
Cluster Registration API
API to support Reachability for a Kubernetes Cloud. This API will be used to upload configuration information for the cluster
POST
Code Block |
---|
language | js |
---|
title | POST |
---|
linenumbers | true |
---|
|
URL: /v2/cluster-providers
POST BODY:
{
"metadata":{
"label-name":"east-us1<name>",
"description":"<description>",
}"userData1":"<user data>",
"userData2":"<user data>"
}
}
RETURN STATUS: 201
RETURN BODY:
{
"metadata":{
"name":"<name>",
"description":"<description>",
"label-nameuserData1":"east-us2"<user data>",
"userData2":"<user data>"
}
} |
GET, DELETE
Code Block |
---|
language | js |
---|
title | Get, Delete |
---|
linenumbers | true |
---|
|
GET
URL: /v2/cluster-providers/{provider-name}
RETURN STATUS: 200
RETURN BODY:
{
}"metadata":{
"name":"<name>",
]
"description":"<description>",
}"userData1":"<user data>",
]
"userData2":"<user data>"
}
]}
}
DELETE
URL: /v2/intent/placement/genericcluster-providers/{intentprovider-name}
RETURN STATUS: 204
|
Instantiation API
Instantiation API is now based on the Profile API instead of having its own URL root.
POST
This POST is a multipart POST. With the POST body containing the data about the cluster and the kubeconfig uploaded in multipart form.
...
Code Block |
---|
language | js |
---|
title | POST |
---|
linenumbers | true |
---|
|
URL: /v2/project/{project-name}/rb/{rb-name}/{rb-version}/profile/{profile/v2/cluster-providers/{provider-name}/instanceclusters
POST BODY:
{
"logical-cloud "metadata": "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
"intent-group": "intent-group-name", //name of intent-group to use for collecting intents which will be used during instantiation
//override-values overrides values from the helm charts and allows for instantiation time
//variable overrides.
"override-values": {
imageRepository: "registry.hub.docker.com"
}
{
"name":"<name>",
"description":"<description>",
"userData1":"<user data>",
"userData2":"<user data>"
}
}
RETURN STATUS: 201
RETURN BODY:
{
"metadata":{
"name":"<name>",
"description":"<description>",
"userData1":"<user data>",
"userData2":"<user data>"
}
} |
GET, DELETE
Code Block |
---|
language | js |
---|
title | Get, Delete |
---|
linenumbers | true |
---|
|
GET
URL: /v2/cluster-providers/{provider-name}/clusters/{cluster-name}
RETURN STATUS: 201200
RETURN BODY:
{
"id": "laughing_robinson",
"rb-namemetadata": "test-rbdef",{
"rb-version": "v1",
"profile-name": "test-rbdef<name>",
"cloudRegiondescription": "kud<description>",
"namespaceuserData1":"<user "testinstallnsdata>",
"resourcesuserData2":"<user [data>"
{
"GVK": {
"Group": "",
"Version": "v1",
"Kind": "Service"
},
"Name": "mongo"
},
{
"GVK": {
"Group": "",
"Version": "v1",
"Kind": "Service"
},
"Name": "mongo-read"
}
]
} |
...
}
}
DELETE
URL: /v2/cluster-providers/{provider-name}/clusters/{cluster-name}
RETURN STATUS: 204
|
Add Label to a cluster
POST
Code Block |
---|
language | js |
---|
title | POST |
---|
linenumbers | true |
---|
|
URL: /v2/cluster-providers/{provider-name}/clusters/{cluster-name}/labels
POST BODY:
{
“label-name” : “<label>”
}
RETURN STATUS: 201
RETURN BODY:
{
“label-name” : “<label>”
} |
GET, DELETE
Code Block |
---|
language | js |
---|
title | Get, Delete |
---|
linenumbers | true |
---|
|
GET
URL: /v2/cluster-providers/{provider-name}/clusters/{cluster-name}/labels/<label>
RETURN STATUS: 200
RETURN BODY:
{
“label-name” : “<label>”
}
GET (Query)
URL: /v2/cluster-providers/{provider-name}/clusters?label=<label>
RETURN STATUS: 200
RETURN BODY:
[<list of clusters>]
DELETE
URL: /v2/cluster-providers/{provider-name}/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.
POST
Code Block |
---|
language | js |
---|
title | GET, DELETEPOST |
---|
linenumbers | true |
---|
|
GET
URL: /v2/projectcluster-providers/{projectprovider-name}/rbclusters/{rbcluster-name}/{rb-version}/profile/{profile-name}/instance/{instance-id}
RETURN STATUS: 200
RETURN BODY:
{
"id": "laughing_robinson",
"rb-name": "test-rbdef",
"rb-version": "v1",
"profile-name": "test-rbdef",
"cloudRegion": "kud",
"namespace": "testinstallns",
"resources": [
{
"GVK": {
kv-pairs
POST BODY:
{
"metadata":{
"name":"<name>",
"description":"<description>",
"userData1":"<user data>",
"userData2":"<user data>"
},
"spec":{
"kv":[
{
"key1":"val1"
},
{
"key2":"val2"
}
]
}
}
RETURN STATUS: 201
RETURN BODY:
{
"metadata":{
"Groupname": "<name>",
"Versiondescription": "v1<description>",
"KinduserData1": "Service"
}<user data>",
"NameuserData2":"<user "mongodata>"
},
"spec":{
"GVKkv":[
{
"Groupkey1": "val1",
"Version": "v1" },
"Kind": "Service" {
},
"Namekey2": "mongo-readval2"
}
]
}
DELETE
URL: /v2/project/{project-name}/rb/{rb-name}/{rb-version}/profile/{profile-name}/instance/{instance-id}
RETURN STATUS: 204 |
Cluster Registration API
API to support Reachability for Kubernetes Cloud
GET, DELETE
...
Code Block |
---|
language | js |
---|
title | POSTGet, Delete |
---|
linenumbers | true |
---|
|
GET
URL: /v2/cluster-providers/{provider-name}/clusters/{cluster-registration
POST-name}/kv-pairs/<name>
RETURN STATUS: 200
RETURN BODY:
{
"metadata":{
“cloud-region” : “<name>”, // Must be unique
“cloud-owner” : “<owner>”,
}
RETURN STATUS: 201
RETURN BODY:
{
“cloud-region” : “<name>”, // Must be unique
“cloud-owner” : “<owner>”,
} |
This is a multipart upload and here is how you do the POST for this.
...
#Using a json file containing content as above;
curl -i -F "metadata=<jsonfile;type=application/json" -F file=@/home/user/.kube/config -X POST http:
//
NODE_IP:PORT/v2/cluster-registration
GET, DELETE
Code Block |
---|
language | js |
---|
title | POST |
---|
linenumbers | true |
---|
|
GET
URL: /v2/cluster-registration/{cloud-region-name}
RETURN STATUS: 200
RETURN BODY:
{
“cloud-region” : “<name>”, // Must be unique across
“cloud-owner” : “<owner>”,
}
DELETE
URL: /v2/cluster-registeration/{cloud-region-name}
RETURN STATUS: 204
|
Add Label to a cluster
POST
Code Block |
---|
language | js |
---|
title | POST |
---|
linenumbers | true |
---|
|
"name":"<name>",
"description":"<description>",
"userData1":"<user data>",
"userData2":"<user data>"
},
"spec":{
"kv":[
{
"key1":"val1"
},
{
"key2":"val2"
}
]
}
}
GET (Query)
URL: /v2/cluster-registrationproviders/{cloud-regionprovider-name}/label
POST BODY:
{
“label-name” : “<label>”
}/clusters/{cluster-name}/kv-pairs/<name>?key=<key>
RETURN STATUS: 201200
RETURN BODY:
{
“label-name” : “<label>”
} |
...
"value": "<value>"
}
DELETE
URL: /v2/cluster-providers/{provider-name}/clusters/{cluster-name}/kv-pairs/<name>
RETURN STATUS: 204
|
Orchestrator Controller Registration API
This API allows controllers to register themselves as gRPC servers consumed by the orchestrator.
POST
Code Block |
---|
language | jsbash |
---|
title | POST |
---|
linenumbers | true |
---|
|
GETPOST/PUT
URL: /v2/cluster-registration/{cloud-region-name}/label/<label>
RETURN STATUS: 200
RETURN BODY:
{
“label-name” : “<label>”
}
DELETE
URL: /v2/cluster-registeration/{cloud-region-name}/label/<label>
RETURN STATUS: 204
|
Add key-value pair to a cluster
POST
Code Block |
---|
language | js |
---|
title | POST |
---|
linenumbers | true |
---|
|
URL: /v2/cluster-registration/{cloud-region-name}/kv-pair
POST BODY:
{
"kv":[
{
controllers
POST BODY:
{
"metadata":{
"name":"<name>",
"description":"<description>",
"userData1":"<user data>",
"userData2":"<user data>"
},
"spec":{
"host": "10.7.100.4",
"port": 9029,
"type": "<type of controller>, // placement, action are 2 types supported
"key1priority":"val1"
2
},
}
} |
GET, DELETE
Code Block |
---|
language | bash |
---|
title | GET, DELETE |
---|
linenumbers | true |
---|
|
GET
URL: /v2/controllers/{controller-name}
RETURN STATUS: 200
RETURN BODY:
{
"metadata":{
"key2name":"val2<name>",
}
"description":"<description>",
]
}
RETURN STATUS: 201
RETURN BODY:
{
"kv":[ "userData1":"<user data>",
"userData2":"<user data>"
},
"spec":{
"key1host":"val1" "10.7.100.4",
}"port": 9029,
{
"type": "<type of controller>,
"key2priority":"val2"
2
}
]
} |
...
}
}
DELETE
URL: /v2/controllers/{controller-name}
RETURN STATUS: 204 |
Example CURL Command:
Code Block |
---|
language | jsbash |
---|
title | POST |
---|
linenumbers | true |
---|
|
GET
URL: curl -X GET "http://10.7.100.1:9015/v2/cluster-registration/{cloud-region-name}/kv-pair/<key>
RETURN STATUS: 200
RETURN BODY:
{
"key1":"val1"
}
DELETE
URL: /v2/cluster-registeration/{cloud-region-name}/kv-pair/<key>
RETURN STATUS: 204
controllers/hpa-placement-controller" -H "accept: */*" -H "Content-Type: application/json"
curl -X DELETE "http://10.7.100.1:9015/v2/controllers/hpa-placement-controller" -H "accept: */*" |