Skip to content

Schema

Core Schema Service related methods

Adds a schema to the schema repository with status INTERNAL.

Request

Adds a schema to the schema repository. The schemaIdentity must be unique. The authority, source and entityType will be registered if not present. If lower minor versions are registered the service validates the new schema against breaking changes; if breaking changes are discovered the request fails.

Note: The schema must not reference other schemas with status DEVELOPMENT. By default scope to a schema will be set as INTERNAL
Required roles 'users.datalake.editors' or 'users.datalake.admins' groups to create schema.

Security
bearer
Headers
data-partition-idstringrequired

desired data partition id

Bodyapplication/jsonrequired

Schema description and schema to add

schemaobjectrequired
Example:
{}
schemaInfoobject(Schema Info)required

Schema info including status, creation and schemaIdentity

Example:
{ "schemaIdentity": { "authority": "osdu", "source": "wks", "entityType": "wellbore", "schemaVersionMajor": 1, "schemaVersionMinor": 0, "schemaVersionPatch": 0 }, "status": "DEVELOPMENT" }
curl -i -X POST \
  https://as5.api.enterprisedata.slb.com/api/schema-service/v1/schema \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -H 'data-partition-id: string' \
  -d '{
    "schemaInfo": {
      "schemaIdentity": {
        "authority": "osdu",
        "source": "wks",
        "entityType": "wellbore",
        "schemaVersionMajor": 1,
        "schemaVersionMinor": 0,
        "schemaVersionPatch": 0
      },
      "status": "DEVELOPMENT"
    },
    "schema": {}
  }'

Responses

Schema created

Bodyapplication/json
createdBystring

The user who created the schema. This value is taken from API caller token.

Example:"user@opendes.com"
dateCreatedstring, (date-time)

The UTC date time of the entity creation

Example:"2019-05-23 11:16:03+00:00"
schemaIdentityobject(SchemaIdentity)required

Schema authority source and type description

scopestring

Schema Scope - is it internal or shared. This is a system defined attribute based on partition-id passed.

Enum:"INTERNAL""SHARED"
Example:"INTERNAL"
statusstringrequired

Schema lifecycle status

Enum:"PUBLISHED""OBSOLETE""DEVELOPMENT"
supersededByobject(SchemaIdentity)

Schema authority source and type description

Response
{ "createdBy": "user@opendes.com", "dateCreated": "2019-05-23 11:16:03+00:00", "schemaIdentity": { "authority": "osdu", "entityType": "wellbore", "id": "osdu:wks:wellbore:1.0.0", "schemaVersionMajor": 1, "schemaVersionMinor": 1, "schemaVersionPatch": 0, "source": "wks" }, "scope": "INTERNAL", "status": "PUBLISHED", "supersededBy": { "authority": "osdu", "entityType": "wellbore", "id": "osdu:wks:wellbore:1.0.0", "schemaVersionMajor": 1, "schemaVersionMinor": 1, "schemaVersionPatch": 0, "source": "wks" } }