Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Fabien Bosquet
infra-azure-provisioning
Commits
5ab5af76
Commit
5ab5af76
authored
Oct 21, 2020
by
Daniel Scholl
Browse files
Updated Documentation for Pipeline support
parent
5cbf70a4
Changes
4
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
5ab5af76
...
...
@@ -268,6 +268,12 @@ __Automated Pipeline Installation__
5.
Setup Service Automation following directions
[
here
](
./docs/service-automation.md
)
.
6.
Register the Data Partition API using the API request located
[
here
](
../tools/rest/partition.http
)
.
7.
Enable Integration Tests for the pipelines.
## Developer Activities
...
...
docs/service-automation.md
View file @
5ab5af76
...
...
@@ -111,7 +111,7 @@ az pipelines variable-group create \
AZURE_LEGAL_SERVICEBUS
=
'$('
${
DATA_PARTITION_NAME
}
'-sb-connection)'
\
AZURE_TENANT_ID
=
'$(tenant-id)'
\
AZURE_TESTER_SERVICEPRINCIPAL_SECRET
=
'$(app-dev-sp-password)'
\
CONTAINER_REGISTRY_NAME
=
'$(container
_
registry)'
\
CONTAINER_REGISTRY_NAME
=
'$(container
-
registry)'
\
DNS_HOST
=
"
$DNS_HOST
"
\
DOMAIN
=
"contoso.com"
\
ELASTIC_ENDPOINT
=
'$('
${
DATA_PARTITION_NAME
}
'-elastic-endpoint)'
\
...
...
@@ -364,7 +364,6 @@ az pipelines create \
-ojson
```
2.
Add a Pipeline for __service-entitlements-azure__ to deploy the Entitlements Service.
> This pipeline may have to be run twice for integration tests to pass due to a preload data issue.
...
...
tools/rest/README.md
View file @
5ab5af76
...
...
@@ -12,7 +12,7 @@ The application created for OSDU by default does not have a Client Secret and on
# This logs your local Azure CLI in using the configured service principal.
az login
--service-principal
-u
$ARM_CLIENT_ID
-p
$ARM_CLIENT_SECRET
--tenant
$ARM_TENANT_ID
GROUP
=
$(
az group list
--query
"[?contains(name, '
${
UNIQUE
}
cr
')].name"
-otsv
)
GROUP
=
$(
az group list
--query
"[?contains(name, '
cr
${
UNIQUE
}
')].name"
-otsv
)
ENV_VAULT
=
$(
az keyvault list
--resource-group
$GROUP
--query
[]
.name
-otsv
)
CLIENT_SECRET
=
$(
az ad app credential reset
--id
$(
az keyvault secret show
--id
https://
${
ENV_VAULT
}
.vault.azure.net/secrets/aad-client-id
--query
value
-otsv
)
--query
password
-otsv
)
...
...
@@ -45,4 +45,4 @@ __Retrieve Additional Values__
The
`INITIAL_TOKEN`
is an open id token. Follow the directions in osduauth to obtain a token and once obtained save the value in settings.
The
`OSDU_HOST`
is your FQDN for your osdu environment.
\ No newline at end of file
The
`OSDU_HOST`
is your FQDN for your osdu environment.
tools/rest/check.http
0 → 100644
View file @
5ab5af76
# -------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 = opendes-public-usa-check-1
@kind = opendes:qatest:dummy:0.0.1
@index = opendes-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": "2020-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@opendes.contoso.com"
],
"owners": [
"data.default.owner@opendes.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 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 searchElastic
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}}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment