Skip to content

Latest commit

 

History

History
892 lines (716 loc) · 25.9 KB

File metadata and controls

892 lines (716 loc) · 25.9 KB

Specific Provisioner Micro Service v2.1.0

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

Microservice responsible to handle provisioning and access control requests for one or more data product components.

SpecificProvisioner

All the provisioning related operations

provision

Code samples

Shell
# You can also use wget
    curl -X POST /v1/provision \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json'
JavaScript
const inputBody = '{
  "descriptorKind": "DATAPRODUCT_DESCRIPTOR",
  "descriptor": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json'
};

fetch('/v1/provision',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
Java
URL obj = new URL("/v1/provision");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());
Python
import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.post('/v1/provision', headers = headers)

print(r.json())

POST /v1/provision

Deploy a data product starting from its descriptor

Body parameter

{
  "descriptorKind": "DATAPRODUCT_DESCRIPTOR",
  "descriptor": "string"
}

Parameters

Name In Type Required Description
body body ProvisioningRequest true A provisioning request descriptor wrapped as a string into a simple object

Example responses

200 Response

{
  "status": "RUNNING",
  "result": "string"
}

Responses

Status Meaning Description Schema
200 OK It synchronously returns the request result ProvisioningStatus
202 Accepted If successful returns a provisioning deployment task token that can be used for polling the request status string
400 Bad Request Invalid input ValidationError
500 Internal Server Error System problem SystemError
This operation does not require authentication

getStatus

Code samples

Shell
# You can also use wget
curl -X GET /v1/provision/{token}/status \
  -H 'Accept: application/json'
JavaScript
const headers = {
  'Accept':'application/json'
};
const token = "";

fetch(`/v1/provision/${token}/status`,
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
Java
String token = "";
URL obj = new URL("/v1/provision/"+token+"/status");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());
Python
import requests
headers = {
  'Accept': 'application/json'
}
token = ''

r = requests.get(f'/v1/provision/{token}/status', headers = headers)

print(r.json())

GET /v1/provision/{token}/status

Get the status for a provisioning request

Parameters

Name In Type Required Description
token path string true token that identifies the request

Example responses

200 Response

{
  "status": "RUNNING",
  "result": "string"
}

Responses

Status Meaning Description Schema
200 OK The request status ProvisioningStatus
400 Bad Request Invalid input ValidationError
500 Internal Server Error System problem SystemError
This operation does not require authentication

validate

Code samples

Shell
# You can also use wget
curl -X POST /v1/validate \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json'
JavaScript
const inputBody = '{
  "descriptorKind": "DATAPRODUCT_DESCRIPTOR",
  "descriptor": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json'
};

fetch('/v1/validate',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
Java
URL obj = new URL("/v1/validate");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());
Python
import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.post('/v1/validate', headers = headers)

print(r.json())

POST /v1/validate

Validate a provisioning request

Body parameter

{
  "descriptorKind": "DATAPRODUCT_DESCRIPTOR",
  "descriptor": "string"
}

Parameters

Name In Type Required Description
body body ProvisioningRequest true A provisioning request descriptor wrapped as a string into a simple object

Example responses

200 Response

{
  "valid": true,
  "error": {
    "errors": [
      "string"
    ],
    "userMessage": "string",
    "input": "string",
    "inputErrorField": "string",
    "moreInfo": {
      "problems": [
        "string"
      ],
      "solutions": [
        "string"
      ]
    }
  }
}

Responses

Status Meaning Description Schema
200 OK It synchronously returns a specific reply containing the validation result ValidationResult
500 Internal Server Error System problem SystemError
This operation does not require authentication

unprovision

Code samples

Shell
# You can also use wget
curl -X POST /v1/unprovision \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json'
JavaScript
const inputBody = '{
  "descriptorKind": "DATAPRODUCT_DESCRIPTOR",
  "descriptor": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json'
};

fetch('/v1/unprovision',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
Java
URL obj = new URL("/v1/unprovision");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());
Python
import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.post('/v1/unprovision', headers = headers)

print(r.json())

POST /v1/unprovision

Undeploy a data product starting from its descriptor

Body parameter

{
  "descriptorKind": "DATAPRODUCT_DESCRIPTOR",
  "descriptor": "string"
}

Parameters

Name In Type Required Description
body body ProvisioningRequest true A provisioning request descriptor wrapped as a string into a simple object

Example responses

200 Response

{
  "status": "RUNNING",
  "result": "string"
}

Responses

Status Meaning Description Schema
200 OK It synchronously returns the request result ProvisioningStatus
202 Accepted If successful returns a provisioning deployment task token that can be used for polling the request status string
400 Bad Request Invalid input ValidationError
500 Internal Server Error System problem SystemError
This operation does not require authentication

updateacl

Code samples

Shell
# You can also use wget
curl -X POST /v1/updateacl \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json'
JavaScript
const inputBody = '{
  "refs": [
    "string"
  ],
  "provisionInfo": {
    "request": "string",
    "result": "string"
  }
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json'
};

fetch('/v1/updateacl',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
Java
URL obj = new URL("/v1/updateacl");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());
Python
import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.post('/v1/updateacl', headers = headers)

print(r.json())

POST /v1/updateacl

Request the access to a specific provisioner component

Body parameter

{
  "refs": [
    "string"
  ],
  "provisionInfo": {
    "request": "string",
    "result": "string"
  }
}

Parameters

Name In Type Required Description
body body UpdateAclRequest true An access request object

Example responses

200 Response

{
  "status": "RUNNING",
  "result": "string"
}

Responses

Status Meaning Description Schema
200 OK It synchronously returns the access request response ProvisioningStatus
202 Accepted It synchronously returns the access request response string
400 Bad Request Invalid input ValidationError
500 Internal Server Error System problem SystemError
This operation does not require authentication

Schemas

UpdateAclRequest

{
  "refs": [
    "string"
  ],
  "provisionInfo": {
    "request": "string",
    "result": "string"
  }
}

Properties

Name Type Required Restrictions Description
refs [string] true none none
provisionInfo ProvisionInfo true none none

DescriptorKind

"DATAPRODUCT_DESCRIPTOR"

Properties

Name Type Required Restrictions Description
anonymous string false none none

Enumerated Values

Property Value
anonymous DATAPRODUCT_DESCRIPTOR
anonymous COMPONENT_DESCRIPTOR
anonymous DATAPRODUCT_DESCRIPTOR_WITH_RESULTS

ProvisioningRequest

{
  "descriptorKind": "DATAPRODUCT_DESCRIPTOR",
  "descriptor": "string"
}

Properties

Name Type Required Restrictions Description
descriptorKind DescriptorKind true none none
descriptor string true none A provisioning request in yaml format

ProvisioningStatus

{
  "status": "RUNNING",
  "result": "string"
}

Properties

Name Type Required Restrictions Description
status string true none none
result string true none none

Enumerated Values

Property Value
status RUNNING
status COMPLETED
status FAILED

ValidationResult

{
  "valid": true,
  "error": {
    "errors": [
      "string"
    ],
    "userMessage": "string",
    "input": "string",
    "inputErrorField": "string",
    "moreInfo": {
      "problems": [
        "string"
      ],
      "solutions": [
        "string"
      ]
    }
  }
}

Properties

Name Type Required Restrictions Description
valid boolean true none none
error ValidationError false none none

ProvisionInfo

{
  "request": "string",
  "result": "string"
}

Properties

Name Type Required Restrictions Description
request string true none none
result string true none none

ValidationError

{
  "errors": [
    "string"
  ],
  "userMessage": "string",
  "input": "string",
  "inputErrorField": "string",
  "moreInfo": {
    "problems": [
      "string"
    ],
    "solutions": [
      "string"
    ]
  }
}

Properties

Name Type Required Restrictions Description
errors [string] true none none
userMessage string false none User-readable message to be displayed
input string false none Optional field to include the file or descriptor that raised the error
inputErrorField string false none Optional field to include the field path (in dot format) that raised the error
moreInfo ErrorMoreInfo false none Object that will include the more in-depth, specific information about the error

SystemError

{
  "error": "string",
  "userMessage": "string",
  "input": "string",
  "inputErrorField": "string",
  "moreInfo": {
    "problems": [
      "string"
    ],
    "solutions": [
      "string"
    ]
  }
}

Properties

Name Type Required Restrictions Description
error string true none none
userMessage string false none User-readable message to be displayed
input string false none Optional field to include the file or descriptor that raised the error
inputErrorField string false none Optional field to include the field path (in dot format) that raised the error
moreInfo ErrorMoreInfo false none Object that will include the more in-depth, specific information about the error

ErrorMoreInfo

{
  "problems": [
    "string"
  ],
  "solutions": [
    "string"
  ]
}

Object that will include the more in-depth, specific information about the error

Properties

Name Type Required Restrictions Description
problems [string] true none Array of possible multiple problems: i.e. multiple validations failed
solutions [string] true none Array of possible solutions that the developer gives to the user to solve the issue