Skip to content

Creates a metadata for a file

Request

This API creates a metadata record for a file that is already uploaded. The Metadata is linked to the file via FileSource provided in the request body.

If FileSource attribute is missing in the request body or there is no file present, then the request fails with an error.

When metadata is successfully updated in the system, it returns the Id of the file metadata record.

Required roles: 'service.file.editors'. Users added to groups 'users.datalake.editors', 'users.datalake.admins', 'users.datalake.ops' would be added to group 'service.file.editors' by default.

Security
bearer
Headers
data-partition-idstringrequired

desired data partition id.

Example:slb-osdu-prod-des-prod-testing
Bodyapplication/json

File metadata content

kindstringrequired

Kind of data being ingested. Must follow the naming convention:{schema-authority}:wks:dataset--File.Generic:{version}.

Example:"osdu:wks:dataset--File.Generic:1.0.0"
legalobject(Legal Meta Data)required

Legal meta data like legal tags, relevant other countries, legal status.

dataobject(File Metadata)required

The file data container containing all necessary details of the file record

ancestryobject(Parent List)
tagsobject

Data flow job id to track data flow.

Example:
{ "dataflowId": "dataflowId" }
curl -i -X POST \
  https://as5.api.enterprisedata.slb.com/api/file/v2/files/metadata \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -H 'data-partition-id: slb-osdu-prod-des-prod-testing' \
  -d '{
    "kind": "osdu:wks:dataset--File.Generic:1.0.0",
    "acl": {
      "viewers": [
        "data.default.viewers@{datapartition}.{domain}.com"
      ],
      "owners": [
        "data.default.owners@{datapartition}.{domain}.com"
      ]
    },
    "legal": {
      "legaltags": [
        "slb-osdu-prod-des-prod-testing-sample-legaltag"
      ],
      "otherRelevantDataCountries": [
        "US"
      ],
      "status": "compliant"
    },
    "data": {
      "ExtensionProperties": {
        "Name": "File",
        "Classification": "Raw File",
        "Description": "An text further describing this file example.",
        "ExternalIds": [
          "string"
        ],
        "FileDateCreated": "2013-03-22 11:16:03+00:00",
        "FileDateModified": "2013-03-22 11:16:03+00:00",
        "FileContentsDetails": {
          "TargetKind": "os:npd:wellbore:1:*.*",
          "FileType": "csv",
          "FrameOfReference": [
            {
              "kind": "CRS",
              "name": "[\"NAD27 * OGP-Usa Conus / North Dakota South [32021,15851]\",\"ft\"]",
              "persistableReference": "{\"scaleOffset\":{\"scale\":0.3048006096012192,\"offset\":0.0},\"symbol\":\"ftUS\",\"baseMeasurement\":{\"ancestry\":\"Length\",\"type\":\"UM\"},\"type\":\"USO\"}",
              "propertyNames": [
                "elevationFromMsl",
                "\"totalDepthMdDriller",
                "wellHeadProjected"
              ],
              "propertyValues": [
                "F",
                "ftUS",
                "deg"
              ],
              "uncertainty": 0,
              "property1": {},
              "property2": {}
            }
          ],
          "ExtensionProperties": {
            "kind": "os:npd:csvFileExtDetails:1.0.0"
          },
          "ParentReference": "CSBE0417"
        },
        "relationships": {
          "parentEntity": {
            "confidence": 1,
            "id": "data_partition:namespace:entity_845934c40e8d922bc57b678990d55722",
            "name": "Survey ST2016",
            "version": 0
          },
          "relatedItems": {
            "confidences": [
              0
            ],
            "ids": [
              "string"
            ],
            "names": [
              "string"
            ],
            "versions": [
              0
            ]
          }
        }
      },
      "Name": "string",
      "Description": "string",
      "TotalSize": "string",
      "EncodingFormatTypeID": "string",
      "SchemaFormatTypeID": "string",
      "Endian": "BIG",
      "DatasetProperties": {
        "FileSourceInfo": {
          "Name": "string",
          "PreLoadFilePath": "string",
          "FileSource": "string",
          "PreloadFileCreateUser": "string",
          "PreloadFileCreateDate": "string",
          "PreloadFileModifyUser": "string",
          "PreloadFileModifyDate": "string",
          "FileSize": "string",
          "EncodingFormatTypeID": "string",
          "Checksum": "string",
          "ChecksumAlgorithm": "string"
        }
      },
      "Checksum": "string",
      "ResourceHomeRegionID": "string",
      "ResourceHostRegionIDs": [
        "string"
      ],
      "ResourceCurationStatus": "string",
      "ResourceLifecycleStatus": "string",
      "ResourceSecurityClassification": "string",
      "Source": "string",
      "ExistenceKind": "string"
    },
    "ancestry": {
      "parents": [
        "string"
      ]
    },
    "meta": [
      {
        "kind": "CRS",
        "name": "[\"NAD27 * OGP-Usa Conus / North Dakota South [32021,15851]\",\"ft\"]",
        "persistableReference": "{\"scaleOffset\":{\"scale\":0.3048006096012192,\"offset\":0.0},\"symbol\":\"ftUS\",\"baseMeasurement\":{\"ancestry\":\"Length\",\"type\":\"UM\"},\"type\":\"USO\"}",
        "propertyNames": [
          "elevationFromMsl",
          "\"totalDepthMdDriller",
          "wellHeadProjected"
        ],
        "propertyValues": [
          "F",
          "ftUS",
          "deg"
        ],
        "uncertainty": 0,
        "property1": {},
        "property2": {}
      }
    ],
    "tags": {
      "dataflowId": "dataflowId"
    }
  }'

Responses

Metadata created

Bodyapplication/json
Idstring
Response
{ "Id": "string" }