Commit a0d41c99 authored by Daniel Scholl's avatar Daniel Scholl
Browse files

Add Manifest Ingest Check

parent 8967939a
......@@ -5,7 +5,7 @@
k8-gitops-manifests/
osdu-charts/
custom.tfvars
custom*.tfvars
dev.tfvars
.envrc*
......
# -------HTTP REST CLIENT -------
# https://marketplace.visualstudio.com/items?itemName=humao.rest-client
## This script provides a few samples for calling schema.
# -----------------------
# OAUTH (Variables)
# -----------------------
###
@login_base = login.microsoftonline.com/{{TENANT_ID}}
@oauth_token_host = {{login_base}}/oauth2/v2.0/token
@scopes = {{CLIENT_ID}}/.default openid profile offline_access
# -----------------------
# OAUTH refresh_token
# -----------------------
###
# @name refresh
POST https://{{oauth_token_host}} HTTP/1.1
Content-Type: application/x-www-form-urlencoded
grant_type=refresh_token
&client_id={{CLIENT_ID}}
&client_secret={{CLIENT_SECRET}}
&refresh_token={{INITIAL_TOKEN}}
&scope={{scopes}}
# -----------------------
# API (Variables)
# -----------------------
###
@access_token = {{refresh.response.body.access_token}}
@ENDPOINT = https://{{OSDU_HOST}}
@ENTITLEMENTS_HOST = {{ENDPOINT}}/entitlements/v1
@LEGAL_HOST = {{ENDPOINT}}/api/legal/v1
@SCHEMA_HOST = {{ENDPOINT}}/api/schema-service/v1
@WORKLFOW_HOST = {{ENDPOINT}}/api/workflow/v1
@data_partition_id = opendes
@kind = {{data_partition_id}}:wks:Manifest:1.0.0
@workflow_name = osdu_ingest
@tag = {{data_partition_id}}-public-usa-check-1
# -----------------------
# API: os-entitlements
# -----------------------
###
# @name getGroups
GET {{ENTITLEMENTS_HOST}}/groups
Authorization: Bearer {{access_token}}
Accept: application/json
data-partition-id: {{data_partition_id}}
# -----------------------
# INITIALIZE
# -----------------------
###
# @name createTag
POST {{LEGAL_HOST}}/legaltags
Authorization: Bearer {{access_token}}
Content-Type: application/json
data-partition-id: {{data_partition_id}}
{
"name": "{{tag}}",
"description": "This tag is used by Data Upload Scripts",
"properties": {
"countryOfOrigin": [
"US"
],
"contractId": "A1234",
"expirationDate": "2021-12-31",
"originator": "MyCompany",
"dataType": "Transferred Data",
"securityClassification": "Public",
"personalData": "No Personal Data",
"exportClassification": "EAR99"
}
}
# -----------------------
# API LEGAL
# -----------------------
###
# @name getTag
GET {{LEGAL_HOST}}/legaltags/{{tag}}
Authorization: Bearer {{access_token}}
Accept: application/json
data-partition-id: {{data_partition_id}}
# -----------------------
# API: schema
# -----------------------
###
# @name getSchemaById
GET {{SCHEMA_HOST}}/schema/{{kind}}
Authorization: Bearer {{access_token}}
Accept: application/json
data-partition-id: {{data_partition_id}}
# -----------------------
# API: workflow
# -----------------------
###
# @name runWorkflow
POST {{WORKLFOW_HOST}}/workflow/{{workflow_name}}/workflowRun
Authorization: Bearer {{access_token}}
Content-Type: application/json
data-partition-id: {{data_partition_id}}
{
"executionContext": {
"Payload": {
"AppKey": "test-app",
"data-partition-id": "{{data_partition_id}}"
},
"manifest": {
"kind": "{{kind}}",
"ReferenceData": [
{
"id": "{{data_partition_id}}:reference-data--ProcessingParameterType:3D%20Kirchhoff%20Depth%20Migration",
"kind": "{{data_partition_id}}:wks:reference-data--ProcessingParameterType:1.0.0",
"acl": {
"viewers": [
"data.default.viewer@{{data_partition_id}}.contoso.com"
],
"owners": [
"data.default.owner@{{data_partition_id}}.contoso.com"
]
},
"legal": {
"legaltags": [
"{{tag}}"
],
"otherRelevantDataCountries": [
"US"
]
},
"data": {
"Name": "3D Kirchhoff Depth Migration",
"ID": "3D%20Kirchhoff%20Depth%20Migration",
"Code": "3D Kirchhoff Depth Migration",
"Source": "Workbook Published/ProcessingParameterType.1.0.0.xlsx; commit SHA 0b4db59a."
}
}
]
}
}
}
# -------HTTP REST CLIENT -------
# https://marketplace.visualstudio.com/items?itemName=humao.rest-client
## This script will help test the core services and an end to end flow.
# -----------------------
# OAUTH (Variables)
# -----------------------
###
@login_base = login.microsoftonline.com/{{TENANT_ID}}
@oauth_token_host = {{login_base}}/oauth2/v2.0/token
@scopes = {{CLIENT_ID}}/.default openid profile offline_access
# -----------------------
# OAUTH refresh_token
# -----------------------
###
# @name refresh
POST https://{{oauth_token_host}} HTTP/1.1
Content-Type: application/x-www-form-urlencoded
grant_type=refresh_token
&client_id={{CLIENT_ID}}
&client_secret={{CLIENT_SECRET}}
&refresh_token={{INITIAL_TOKEN}}
&scope={{scopes}}
# -----------------------
# API (Variables)
# -----------------------
###
@access_token = {{refresh.response.body.access_token}}
@ENDPOINT = https://{{OSDU_HOST}}
@ENTITLEMENTS_HOST = {{ENDPOINT}}/entitlements/v1
@LEGAL_HOST = {{ENDPOINT}}/api/legal/v1
@STORAGE_HOST = {{ENDPOINT}}/api/storage/v2
@SEARCH_HOST = {{ENDPOINT}}/api/search/v2
@data_partition_id = opendes
@tag = {{data_partition_id}}-public-usa-check-1
@kind = {{data_partition_id}}:qatest:dummy:0.0.1
@index = {{data_partition_id}}-qatest-dummy-0.0.1
# -----------------------
# API: os-entitlements
# -----------------------
###
# @name getGroups
GET {{ENTITLEMENTS_HOST}}/groups
Authorization: Bearer {{access_token}}
Accept: application/json
data-partition-id: {{data_partition_id}}
# -----------------------
# INITIALIZE
# -----------------------
###
# @name createTag
POST {{LEGAL_HOST}}/legaltags
Authorization: Bearer {{access_token}}
Content-Type: application/json
data-partition-id: {{data_partition_id}}
{
"name": "{{tag}}",
"description": "This tag is used by Data Upload Scripts",
"properties": {
"countryOfOrigin": [
"US"
],
"contractId": "A1234",
"expirationDate": "2021-12-31",
"originator": "MyCompany",
"dataType": "Transferred Data",
"securityClassification": "Public",
"personalData": "No Personal Data",
"exportClassification": "EAR99"
}
}
###
# @name createSchema
POST {{STORAGE_HOST}}/schemas
Authorization: Bearer {{access_token}}
Content-Type: application/json
data-partition-id: {{data_partition_id}}
{
"kind": "{{kind}}",
"schema": [
{
"path": "Field",
"kind": "string"
},
{
"path": "Location",
"kind": "core:dl:geopoint:1.0.0"
},
{
"path": "Basin",
"kind": "string"
},
{
"path": "County",
"kind": "string"
},
{
"path": "State",
"kind": "string"
},
{
"path": "Country",
"kind": "string"
},
{
"path": "WellStatus",
"kind": "string"
},
{
"path": "OriginalOperator",
"kind": "string"
},
{
"path": "WellName",
"kind": "string"
},
{
"path": "WellType",
"kind": "string"
},
{
"path": "EmptyAttribute",
"kind": "string"
},
{
"path": "Rank",
"kind": "int"
},
{
"path": "Score",
"kind": "int"
},
{
"path": "Established",
"kind": "datetime"
},
{
"path": "InvalidInteger",
"kind": "int"
}
],
"ext": null
}
# -----------------------
# API LEGAL
# -----------------------
###
# @name getTag
GET {{LEGAL_HOST}}/legaltags/{{tag}}
Authorization: Bearer {{access_token}}
Accept: application/json
data-partition-id: {{data_partition_id}}
# -----------------------
# API STORAGE
# -----------------------
###
# @name getSchema
GET {{STORAGE_HOST}}/schemas/{{kind}}
Authorization: Bearer {{access_token}}
Accept: application/json
data-partition-id: {{data_partition_id}}
###
# @name createRecord
PUT {{STORAGE_HOST}}/records
Authorization: Bearer {{access_token}}
Content-Type: application/json
data-partition-id: {{data_partition_id}}
[
{
"kind": "{{kind}}",
"acl": {
"viewers": [
"data.default.viewer@{{data_partition_id}}.contoso.com"
],
"owners": [
"data.default.owner@{{data_partition_id}}.contoso.com"
]
},
"legal": {
"legaltags": [
"{{tag}}"
],
"otherRelevantDataCountries": [
"US"
],
"status": "compliant"
},
"data": {
"Field": "MyField",
"Basin": "MyBasin",
"Country": "MyCountry"
}
}
]
@id = {{createRecord.response.body.recordIds[0]}}
###
# @name GetRecord
GET {{STORAGE_HOST}}/records/{{id}}
Authorization: Bearer {{access_token}}
Accept: application/json
data-partition-id: {{data_partition_id}}
###
# @name GetRecordByKind
GET {{STORAGE_HOST}}/query/records?kind={{kind}}
Authorization: Bearer {{access_token}}
Accept: application/json
data-partition-id: {{data_partition_id}}
###
# @name searchRecord
POST {{SEARCH_HOST}}/query
Authorization: Bearer {{access_token}}
Content-Type: application/json
data-partition-id: {{data_partition_id}}
{
"kind": "{{kind}}",
"offset": 0,
"limit": 1
}
@all_totalCount = {{searchRecord.response.body.totalCount}}
@record_id = {{searchRecord.response.body.results[0].id}}
###
# @name getElastic
GET {{ES_HOST}}/{{index}}
Authorization: Basic {{ES_AUTH_TOKEN}}
Accept: application/json
# -----------------------
# CLEANUP
# -----------------------
###
# @name deleteRecord
DELETE {{STORAGE_HOST}}/records/{{id}}
Authorization: Bearer {{access_token}}
Accept: application/json
data-partition-id: {{data_partition_id}}
###
# @name deleteElastic
DELETE {{ES_HOST}}/{{index}}
Authorization: Basic {{ES_AUTH_TOKEN}}
Accept: application/json
###
# @name deleteSchema
DELETE {{STORAGE_HOST}}/schemas/{{kind}}
Authorization: Bearer {{access_token}}
Accept: application/json
data-partition-id: {{data_partition_id}}
###
# @name deleteTag
DELETE {{LEGAL_HOST}}/legaltags/{{tag}}
Authorization: Bearer {{access_token}}
Accept: application/json
data-partition-id: {{data_partition_id}}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment