Skip to content

Latest commit

 

History

History
871 lines (670 loc) · 18 KB

File metadata and controls

871 lines (670 loc) · 18 KB

Snowflake Specific Provisioner API

Scroll down for code samples, example requests and responses.

SpecificProvisioner

All the provisioning related operations

provision

Code samples

Shell
# You can also use wget
curl -X POST /datamesh.mwaaspecificprovisioner/{{version}}/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('/datamesh.mwaaspecificprovisioner/{{version}}/provision',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
Java
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('/datamesh.mwaaspecificprovisioner/{{version}}/provision', headers = headers)

print(r.json())

POST /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 /datamesh.mwaaspecificprovisioner/{{version}}/provision/{token}/status \
  -H 'Accept: application/json'
JavaScript
const headers = {
  'Accept':'application/json'
};

fetch('/datamesh.mwaaspecificprovisioner/{{version}}/provision/{token}/status',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
Java
URL obj = new URL("/datamesh.mwaaspecificprovisioner/{{version}}/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'
}

r = requests.get('/datamesh.mwaaspecificprovisioner/{{version}}/provision/{token}/status', headers = headers)

print(r.json())

GET /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 /datamesh.mwaaspecificprovisioner/{{version}}/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('/datamesh.mwaaspecificprovisioner/{{version}}/validate',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
Java
URL obj = new URL("/datamesh.mwaaspecificprovisioner/{{version}}/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('/datamesh.mwaaspecificprovisioner/{{version}}/validate', headers = headers)

print(r.json())

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

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

# You can also use wget
curl -X POST /datamesh.mwaaspecificprovisioner/{{version}}/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('/datamesh.mwaaspecificprovisioner/{{version}}/unprovision',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
Java
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('/datamesh.mwaaspecificprovisioner/{{version}}/unprovision', headers = headers)

print(r.json())

POST /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 /datamesh.mwaaspecificprovisioner/{{version}}/updateacl \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json'
JavaScript
const inputBody = '{
  "acl": {
    "users": [
      "string"
    ],
    "groups": [
      "string"
    ]
  },
  "provisionInfo": {
    "request": "string",
    "result": "string"
  }
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json'
};

fetch('/datamesh.mwaaspecificprovisioner/{{version}}/updateacl',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
Java
URL obj = new URL("/datamesh.mwaaspecificprovisioner/{{version}}/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('/datamesh.mwaaspecificprovisioner/{{version}}/updateacl', headers = headers)

print(r.json())

POST /updateacl

Request the access to a specific provisioner component

Body parameter

{
  "acl": {
    "users": [
      "string"
    ],
    "groups": [
      "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

{
  "acl": {
    "users": [
      "string"
    ],
    "groups": [
      "string"
    ]
  },
  "provisionInfo": {
    "request": "string",
    "result": "string"
  }
}

Properties

Name Type Required Restrictions Description
acl Acl 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 false none none

Enumerated Values

Property Value
status RUNNING
status COMPLETED
status FAILED

ValidationResult

{
  "valid": true,
  "error": {
    "errors": [
      "string"
    ]
  }
}

Properties

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

ValidationError

{
  "errors": [
    "string"
  ]
}

Properties

Name Type Required Restrictions Description
errors [string] true none none

Acl

{
  "users": [
    "string"
  ],
  "groups": [
    "string"
  ]
}

Properties

Name Type Required Restrictions Description
users [string] true none none
groups [string] true none none

ProvisionInfo

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

Properties

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

SystemError

{
  "error": "string"
}

Properties

Name Type Required Restrictions Description
error string true none none