# Create or update a computation specification

Create or update a computation specification. The request must contain all the input and output data-type IDs which are used to define the computation specification. These data-types must have previously been created. As an example, a computation specification could be defined as a specification for a compute which takes two pieces of input data and calculates a single piece of output data. The specification for this compute would take two input data-types and output a single output data-type.

Endpoint: PUT /computation-specs/{computationSpecId}
Version: 1.0.0
Security: bearer, appkey

## Security:

  - `bearer` (unknown)
    apiKey in header Authorization

  - `appkey` (unknown)
    apiKey in header appkey

## Path parameters:

  - `computationSpecId` (string, required)
    The computation specification ID.

## Header parameters:

  - `slb-partition-id` (string, required)
    Data partition id.

## Request body:

  - `application/json` (unknown)
    The computation specification to be created or updated.

## Request fields (application/json):

  - `id` (string, required)
    The id of the specification. The id should be of the form
'{authority}:{spec-type}:{id}', where '{authority}' is the owning
authority of the specification, '{spec-type}' is one of 'data-types',
'computation-specs' or 'workflow-specs'.
    Example: slb:data-types:custom-specification

  - `name` (string, required)
    The name of the specification.
    Example: A custom data-type

  - `version` (integer, required)
    The version of the specification definition.
    Example: 1

  - `archived` (boolean)
    Whether this specification has been marked as archived.
    Example: false

  - `description` (string, required)
    The description of the specification.
    Example: A specification

  - `inputDataTypeIds` (array, required)
    The input data-type IDs for the computation specification.
    Example: [{"id":"decline-curves","version":1},{"id":"drilling-constraints","version":1},{"id":"facility-constraints","version":1}]

  - `inputDataTypeIds.id` (string, required)
    The specification ID.
    Example: 01DV2RPKYS5NYBAR6TNMJ8TNT8

  - `inputDataTypeIds.version` (integer, required)
    The version of the specification of the given ID.
    Example: 1

  - `outputDataTypeIds` (array, required)
    The output data-type IDs for the computation specification.
    Example: [{"id":"production-forecast","version":1}]

  - `annotations` (array)
    The annotations for the computation specification.
    Example: [{"address":{"type":"DataTypeInput","computationIndex":0,"dataTypeIndex":0},"key":"name","value":"Decline Curves","createdBy":"user@slb.com"},{"address":{"type":"DataTypeInput","computationIndex":0,"d…

  - `annotations.address` (object)
    An address used to describe the location of a Spec within a WorkflowSpec. Used to enrich the spec model with additional attributes such as specifying the location of a data container or providing annotations.
    Example: {"type":"DataTypeInput","computationIndex":0,"dataTypeIndex":0}

  - `annotations.address.type` (string, required)
    Whether the address refers to a data-type input, a data-type output or a computation specification.
    Enum: "Invalid", "Computation", "DataTypeInput", "DataTypeOutput", "Workflow"

  - `annotations.address.computationIndex` (integer)
    The zero based index of the Computation Spec.
    Example: 0

  - `annotations.address.dataTypeIndex` (integer)
    The zero based index of a data-type with respect to a computation specification. Inputs and outputs are treated as separate ordered lists.
    Example: 1

  - `annotations.key` (string)
    Free form content with relevant information for the given address.
    Example: name

  - `annotations.value` (string)
    Free form content with relevant information for the given address.
    Example: Decline Curves

  - `annotations.createdBy` (string)
    The user who created this annotation.
    Example: user@slb.com

## Response 200:

  - `200` (unknown)
    Computation specification updated successfully.

## Response 200 fields (application/json):

  - `id` (string, required)
    The ID of the specification.
    Example: 01DV2RPKYS5NYBAR6TNMJ8TNT8

  - `name` (string, required)
    The name of the specification.
    Example: A custom data-type

  - `version` (integer, required)
    The version of the specification definition.
    Example: 1

  - `latest` (boolean, required)
    Whether this is the latest version of the given specification.
    Example: true

  - `archived` (boolean, required)
    Whether this specification has been marked as archived.
    Example: false

  - `description` (string, required)
    The description of the specification.
    Example: A specification

  - `createdBy` (string, required)
    The ID of the user who created the specification.
    Example: user@slb.com

  - `createdAt` (string, required)
    The date the specification was created.
    Example: 2020-01-01T00:00:00.000Z

  - `inputDataTypeIds` (array, required)
    The input data-type IDs for the computation specification.
    Example: [{"id":"decline-curves","version":1},{"id":"drilling-constraints","version":1},{"id":"facility-constraints","version":1}]

  - `inputDataTypeIds.id` (string, required)
    The specification ID.
    Example: 01DV2RPKYS5NYBAR6TNMJ8TNT8

  - `inputDataTypeIds.version` (integer, required)
    The version of the specification of the given ID.
    Example: 1

  - `outputDataTypeIds` (array, required)
    The output data-type IDs for the computation specification.
    Example: [{"id":"production-forecast","version":1}]

  - `annotations` (array)
    The annotations for the computation specification. These annotations can be used to annotate the computation specification with useful information such as a 'name'.
    Example: [{"address":{"type":"DataTypeInput","computationIndex":0,"dataTypeIndex":0},"key":"name","value":"Decline Curves","createdBy":"user@slb.com"},{"address":{"type":"DataTypeInput","computationIndex":0,"d…

  - `annotations.address` (object)
    An address used to describe the location of a Spec within a WorkflowSpec. Used to enrich the spec model with additional attributes such as specifying the location of a data container or providing annotations.
    Example: {"type":"DataTypeInput","computationIndex":0,"dataTypeIndex":0}

  - `annotations.address.type` (string, required)
    Whether the address refers to a data-type input, a data-type output or a computation specification.
    Enum: "Invalid", "Computation", "DataTypeInput", "DataTypeOutput", "Workflow"

  - `annotations.address.computationIndex` (integer)
    The zero based index of the Computation Spec.
    Example: 0

  - `annotations.address.dataTypeIndex` (integer)
    The zero based index of a data-type with respect to a computation specification. Inputs and outputs are treated as separate ordered lists.
    Example: 1

  - `annotations.key` (string)
    Free form content with relevant information for the given address.
    Example: name

  - `annotations.value` (string)
    Free form content with relevant information for the given address.
    Example: Decline Curves

  - `annotations.createdBy` (string)
    The user who created this annotation.
    Example: user@slb.com

## Response 201:

  - `201` (unknown)
    Computation specification created successfully.

## Response 201 fields (application/json):

  - `id` (string, required)
    The ID of the specification.
    Example: 01DV2RPKYS5NYBAR6TNMJ8TNT8

  - `name` (string, required)
    The name of the specification.
    Example: A custom data-type

  - `version` (integer, required)
    The version of the specification definition.
    Example: 1

  - `latest` (boolean, required)
    Whether this is the latest version of the given specification.
    Example: true

  - `archived` (boolean, required)
    Whether this specification has been marked as archived.
    Example: false

  - `description` (string, required)
    The description of the specification.
    Example: A specification

  - `createdBy` (string, required)
    The ID of the user who created the specification.
    Example: user@slb.com

  - `createdAt` (string, required)
    The date the specification was created.
    Example: 2020-01-01T00:00:00.000Z

  - `inputDataTypeIds` (array, required)
    The input data-type IDs for the computation specification.
    Example: [{"id":"decline-curves","version":1},{"id":"drilling-constraints","version":1},{"id":"facility-constraints","version":1}]

  - `inputDataTypeIds.id` (string, required)
    The specification ID.
    Example: 01DV2RPKYS5NYBAR6TNMJ8TNT8

  - `inputDataTypeIds.version` (integer, required)
    The version of the specification of the given ID.
    Example: 1

  - `outputDataTypeIds` (array, required)
    The output data-type IDs for the computation specification.
    Example: [{"id":"production-forecast","version":1}]

  - `annotations` (array)
    The annotations for the computation specification. These annotations can be used to annotate the computation specification with useful information such as a 'name'.
    Example: [{"address":{"type":"DataTypeInput","computationIndex":0,"dataTypeIndex":0},"key":"name","value":"Decline Curves","createdBy":"user@slb.com"},{"address":{"type":"DataTypeInput","computationIndex":0,"d…

  - `annotations.address` (object)
    An address used to describe the location of a Spec within a WorkflowSpec. Used to enrich the spec model with additional attributes such as specifying the location of a data container or providing annotations.
    Example: {"type":"DataTypeInput","computationIndex":0,"dataTypeIndex":0}

  - `annotations.address.type` (string, required)
    Whether the address refers to a data-type input, a data-type output or a computation specification.
    Enum: "Invalid", "Computation", "DataTypeInput", "DataTypeOutput", "Workflow"

  - `annotations.address.computationIndex` (integer)
    The zero based index of the Computation Spec.
    Example: 0

  - `annotations.address.dataTypeIndex` (integer)
    The zero based index of a data-type with respect to a computation specification. Inputs and outputs are treated as separate ordered lists.
    Example: 1

  - `annotations.key` (string)
    Free form content with relevant information for the given address.
    Example: name

  - `annotations.value` (string)
    Free form content with relevant information for the given address.
    Example: Decline Curves

  - `annotations.createdBy` (string)
    The user who created this annotation.
    Example: user@slb.com

## Response 400:

  - `400` (unknown)
    Unauthorized.

## Response 400 fields (application/json):

  - `data` (object, required)

  - `data.code` (integer, required)
    The HTTP status code.
    Example: 500

  - `data.message` (string)
    The error message.
    Example: internal server error

## Response 401:

  - `401` (unknown)
    Unauthorized.

## Response 401 fields (application/json):

  - `data` (object, required)

  - `data.code` (integer, required)
    The HTTP status code.
    Example: 500

  - `data.message` (string)
    The error message.
    Example: internal server error

## Response default:

  - `default` (unknown)
    Unexpected error.

## Response default fields (application/json):

  - `data` (object, required)

  - `data.code` (integer, required)
    The HTTP status code.
    Example: 500

  - `data.message` (string)
    The error message.
    Example: internal server error

