A mapping is a custom transformation, translating the source format to a format that can be ingested into CDF. Mappings are written in the Cognite transformation language. For more details see documentation here.
Required capabilities:
hostedExtractors:READ
List all mappings in a given project. If more than limit mappings exist, a cursor for pagination will be returned with the response.
List of mappings and an optional cursor.
The response for a bad request.
Validation Error
mapping_list = client.hosted_extractors.mappings.list(limit=5) for mapping in client.hosted_extractors.mappings: mapping # do something with the mapping for mapping_list in client.hosted_extractors.mappings(chunk_size=25): mapping_list # do something with the mappings
{- "items": [
- {
- "externalId": "my.known.id",
- "mapping": {
- "expression": "string"
}, - "input": {
- "type": "protobuf",
- "messageName": "string",
- "files": [
- {
- "fileName": "string"
}
]
}, - "published": true,
- "name": "string",
- "description": "string",
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "createdTime": 1730204346000,
- "lastUpdatedTime": 1730204346000
}
], - "nextCursor": "string"
}Required capabilities:
hostedExtractors:WRITE
Create up to 100 mappings.
Mappings to create.
required | Array of objects (Items) [ 1 .. 10 ] characters |
List of created mappings
The response for a bad request.
Validation Error
{- "items": [
- {
- "externalId": "my.known.id",
- "mapping": {
- "expression": "string"
}, - "input": {
- "type": "protobuf",
- "messageName": "string",
- "files": [
- {
- "fileName": "string",
- "content": "string"
}
]
}, - "published": true,
- "name": "string",
- "description": "string",
- "metadata": {
- "property1": "string",
- "property2": "string"
}
}
]
}{- "items": [
- {
- "externalId": "my.known.id",
- "mapping": {
- "expression": "string"
}, - "input": {
- "type": "protobuf",
- "messageName": "string",
- "files": [
- {
- "fileName": "string"
}
]
}, - "published": true,
- "name": "string",
- "description": "string",
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "createdTime": 1730204346000,
- "lastUpdatedTime": 1730204346000
}
]
}Required capabilities:
hostedExtractors:READ
Retrieve a list of up to 100 mappings by their external ID, optionally ignoring unknown IDs.
List of retrieved mappings.
The response for a bad request.
Validation Error
{- "items": [
- {
- "externalId": "my.known.id"
}
], - "ignoreUnknownIds": true
}{- "items": [
- {
- "externalId": "my.known.id",
- "mapping": {
- "expression": "string"
}, - "input": {
- "type": "protobuf",
- "messageName": "string",
- "files": [
- {
- "fileName": "string"
}
]
}, - "published": true,
- "name": "string",
- "description": "string",
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "createdTime": 1730204346000,
- "lastUpdatedTime": 1730204346000
}
]
}Required capabilities:
hostedExtractors:WRITE
Delete a list of mappings by their external ID. This operation will fail if any mapping in the request is associated with a job, unless the force query parameter is set to true.
Empty response
The response for a bad request.
Validation Error
{- "items": [
- {
- "externalId": "my.known.id"
}
], - "ignoreUnknownIds": true,
- "force": true
}{ }Required capabilities:
hostedExtractors:WRITE
Update up to 100 mappings.
Mappings to update.
required | Array of objects (Items) [ 1 .. 10 ] items |
List of updated mappings.
The response for a bad request.
Validation Error
{- "items": [
- {
- "externalId": "my.known.id",
- "update": {
- "mapping": {
- "set": {
- "expression": "string"
}
}, - "input": {
- "set": {
- "type": "protobuf",
- "messageName": "string",
- "files": [
- {
- "fileName": null,
- "content": null
}
]
}
}, - "published": {
- "set": true
}, - "name": {
- "set": "string"
}, - "description": {
- "set": "string"
}, - "metadata": {
- "set": {
- "property1": "string",
- "property2": "string"
}
}
}
}
]
}{- "items": [
- {
- "externalId": "my.known.id",
- "mapping": {
- "expression": "string"
}, - "input": {
- "type": "protobuf",
- "messageName": "string",
- "files": [
- {
- "fileName": "string"
}
]
}, - "published": true,
- "name": "string",
- "description": "string",
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "createdTime": 1730204346000,
- "lastUpdatedTime": 1730204346000
}
]
}