GET /rest/v1/targettypes

Implementation notes

Handles the GET request of retrieving all target types within Bosch IoT Rollouts. Required Permission: READ_TARGET

Get target types

CURL

$ curl 'https://management-api.host.com/rest/v1/targettypes' -i -X GET \
    -H 'Accept: application/json'

Request URL

GET /rest/v1/targettypes HTTP/1.1
Accept: application/json
Host: management-api.host.com

Request query parameter

Parameter Description

limit

The maximum number of entries in a page (default is 50).

sort

The query parameter sort allows to define the sort order for the result of a query. A sort criteria consists of the name of a field and the sort direction (ASC for ascending and DESC descending). The sequence of the sort criteria (multiple can be used) defines the sort order of the entities in the result.

offset

The paging offset (default is 0).

q

Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for available fields.

Request parameter example

GET /rest/v1/targettypes?offset=0&limit=2&sort=name%3AASC&q=name%3D%3DtargetType* HTTP/1.1
Accept: application/json
Host: management-api.host.com

Response (Status 200)

Response fields

Path Type Description Allowed Values

size

Number

Current page size

total

Number

Total number of elements

content

Array

List of target types

content[].id

Number

The technical identifier of the entity

content[].name

String

The name of the entity

content[].description

String

The description of the entity

content[].colour

String

The colour of the entity

content[].createdAt

Number

Entity was originally created at (timestamp UTC in milliseconds)

content[].createdBy

String

Entity was originally created by (User, AMQP-Controller, anonymous etc.)

content[].lastModifiedAt

Number

Entity was last modified at (timestamp UTC in milliseconds)

content[].lastModifiedBy

String

Entity was last modified by (User, AMQP-Controller, anonymous etc.)

Response example

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 801

{
  "content" : [ {
    "createdBy" : "bumlux",
    "createdAt" : 1652720971901,
    "lastModifiedBy" : "bumlux",
    "lastModifiedAt" : 1652720971901,
    "name" : "targetType1",
    "description" : "targetType1 description",
    "colour" : "#000000",
    "_links" : {
      "self" : {
        "href" : "https://management-api.host.com/rest/v1/targettypes/9"
      }
    },
    "id" : 9
  }, {
    "createdBy" : "bumlux",
    "createdAt" : 1652720971917,
    "lastModifiedBy" : "bumlux",
    "lastModifiedAt" : 1652720971917,
    "name" : "targetType2",
    "description" : "targetType2 description",
    "colour" : "#000000",
    "_links" : {
      "self" : {
        "href" : "https://management-api.host.com/rest/v1/targettypes/10"
      }
    },
    "id" : 10
  } ],
  "total" : 2,
  "size" : 2
}

Error responses

HTTP Status Code Reason Response Model

400 Bad Request

Bad Request - e.g. invalid parameters

401 Unauthorized

The request requires user authentication.

403 Forbidden

Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or data volume restriction applies.

See Error body

405 Method Not Allowed

The http request method is not allowed on the resource.

406 Not Acceptable

In case accept header is specified and not application/json.

429 Too Many Request

Too many requests. The server will refuse further attempts and the client has to wait another second.

POST /rest/v1/targettypes

Implementation notes

Handles the POST request for creating new target types within Bosch IoT Rollouts. The request body must always be a list of types. Required Permission: CREATE_TARGET

Create target types

CURL

$ curl 'https://management-api.host.com/rest/v1/targettypes' -i -X POST \
    -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -d '[ {
  "colour" : "#ffffff",
  "name" : "targetType1",
  "description" : "targetType1 description"
}, {
  "compatibledistributionsettypes" : [ {
    "id" : 12
  } ],
  "colour" : "#000000",
  "name" : "targetType2",
  "description" : "targetType2 description"
} ]'

Request URL

POST /rest/v1/targettypes HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 262
Host: management-api.host.com

[ {
  "colour" : "#ffffff",
  "name" : "targetType1",
  "description" : "targetType1 description"
}, {
  "compatibledistributionsettypes" : [ {
    "id" : 12
  } ],
  "colour" : "#000000",
  "name" : "targetType2",
  "description" : "targetType2 description"
} ]

Request fields

Path Type Description Allowed Values Mandatory

[]name

String

The name of the entity

X

[]description

String

The description of the entity

[]colour

String

The colour of the entity

[]compatibledistributionsettypes

Array

Array of distribution set types that are compatible to that target type

Response (Status 201)

Response fields

Path Type Description Allowed Values

[]id

Number

The technical identifier of the entity

[]name

String

The name of the entity

[]description

String

The description of the entity

[]colour

String

The colour of the entity

[]createdAt

Number

Entity was originally created at (timestamp UTC in milliseconds)

[]createdBy

String

Entity was originally created by (User, AMQP-Controller, anonymous etc.)

[]lastModifiedAt

Number

Entity was last modified at (timestamp UTC in milliseconds)

[]lastModifiedBy

String

Entity was last modified by (User, AMQP-Controller, anonymous etc.)

Response example

HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 696

[ {
  "createdBy" : "bumlux",
  "createdAt" : 1652720970933,
  "lastModifiedBy" : "bumlux",
  "lastModifiedAt" : 1652720970933,
  "name" : "targetType1",
  "description" : "targetType1 description",
  "colour" : "#ffffff",
  "_links" : {
    "self" : {
      "href" : "https://management-api.host.com/rest/v1/targettypes/4"
    }
  },
  "id" : 4
}, {
  "createdBy" : "bumlux",
  "createdAt" : 1652720970936,
  "lastModifiedBy" : "bumlux",
  "lastModifiedAt" : 1652720970936,
  "name" : "targetType2",
  "description" : "targetType2 description",
  "colour" : "#000000",
  "_links" : {
    "self" : {
      "href" : "https://management-api.host.com/rest/v1/targettypes/3"
    }
  },
  "id" : 3
} ]

Error responses

HTTP Status Code Reason Response Model

400 Bad Request

Bad Request - e.g. invalid parameters

401 Unauthorized

The request requires user authentication.

403 Forbidden

Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or data volume restriction applies.

See Error body

404 Not Found

Target type was not found.

See Error body

405 Method Not Allowed

The http request method is not allowed on the resource.

406 Not Acceptable

In case accept header is specified and not application/json.

409 Conflict

Target type already exists

See Error body

415 Unsupported Media Type

The request was attempt with a media-type which is not supported by the server for this resource.

429 Too Many Request

Too many requests. The server will refuse further attempts and the client has to wait another second.

DELETE /rest/v1/targettypes/{targetTypeId}

Implementation Notes

Handles the DELETE request for a single target type within Bosch IoT Rollouts. Required Permission: DELETE_TARGET

Delete target type

CURL

$ curl 'https://management-api.host.com/rest/v1/targettypes/2' -i -X DELETE

Request URL

DELETE /rest/v1/targettypes/2 HTTP/1.1
Host: management-api.host.com

Request path parameter

Parameter Description

targetTypeId

The technical identifier of the entity

Error responses

HTTP Status Code Reason Response Model

400 Bad Request

Bad Request - e.g. invalid parameters

401 Unauthorized

The request requires user authentication.

403 Forbidden

Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or data volume restriction applies.

See Error body

404 Not Found

Target type was not found.

See Error body

405 Method Not Allowed

The http request method is not allowed on the resource.

406 Not Acceptable

In case accept header is specified and not application/json.

429 Too Many Request

Too many requests. The server will refuse further attempts and the client has to wait another second.

GET /rest/v1/targettypes/{targetTypeId}

Implementation notes

Handles the GET request of retrieving a single target type within Bosch IoT Rollouts. Required Permission: READ_TARGET

Get target type

CURL

$ curl 'https://management-api.host.com/rest/v1/targettypes/8' -i -X GET \
    -H 'Accept: application/json'

Request URL

GET /rest/v1/targettypes/8 HTTP/1.1
Accept: application/json
Host: management-api.host.com

Request path parameter

Parameter Description

targetTypeId

The technical identifier of the entity

Response (Status 200)

Response fields

Path Type Description Allowed Values

id

Number

The technical identifier of the entity

name

String

The name of the entity

description

String

The description of the entity

colour

String

The colour of the entity

createdAt

Number

Entity was originally created at (timestamp UTC in milliseconds)

createdBy

String

Entity was originally created by (User, AMQP-Controller, anonymous etc.)

lastModifiedAt

Number

Entity was last modified at (timestamp UTC in milliseconds)

lastModifiedBy

String

Entity was last modified by (User, AMQP-Controller, anonymous etc.)

_links.compatibledistributionsettypes.href

String

Link to the compatible distribution set types in this target type

Response example

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 493

{
  "createdBy" : "bumlux",
  "createdAt" : 1652720971532,
  "lastModifiedBy" : "bumlux",
  "lastModifiedAt" : 1652720971532,
  "name" : "TargetType",
  "description" : "TargetType description",
  "colour" : "#000000",
  "_links" : {
    "self" : {
      "href" : "https://management-api.host.com/rest/v1/targettypes/8"
    },
    "compatibledistributionsettypes" : {
      "href" : "https://management-api.host.com/rest/v1/targettypes/8/compatibledistributionsettypes"
    }
  },
  "id" : 8
}

Error responses

HTTP Status Code Reason Response Model

400 Bad Request

Bad Request - e.g. invalid parameters

401 Unauthorized

The request requires user authentication.

403 Forbidden

Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or data volume restriction applies.

See Error body

404 Not Found

Target type was not found.

See Error body

405 Method Not Allowed

The http request method is not allowed on the resource.

406 Not Acceptable

In case accept header is specified and not application/json.

429 Too Many Request

Too many requests. The server will refuse further attempts and the client has to wait another second.

PUT /rest/v1/targettypes/{targetTypeId}

Implementation notes

Handles the PUT request for a single target type within Bosch IoT Rollouts. Required Permission: UPDATE_TARGET

Update target type

CURL

$ curl 'https://management-api.host.com/rest/v1/targettypes/7' -i -X PUT \
    -H 'Content-Type: application/json' \
    -d '{
  "colour" : "#aaafff",
  "name" : "updatedTypeName",
  "description" : "an updated description"
}'

Request URL

PUT /rest/v1/targettypes/7 HTTP/1.1
Content-Type: application/json
Content-Length: 100
Host: management-api.host.com

{
  "colour" : "#aaafff",
  "name" : "updatedTypeName",
  "description" : "an updated description"
}

Request path parameter

Parameter Description

targetTypeId

The technical identifier of the entity

Request fields

Path Type Description Allowed Values Mandatory

description

String

The description of the entity

name

String

The name of the entity

colour

String

The colour of the entity

Response (Status 200)

Response fields

Path Type Description Allowed Values

id

Number

The technical identifier of the entity

name

String

The name of the entity

description

String

The description of the entity

colour

String

The colour of the entity

createdAt

Number

Entity was originally created at (timestamp UTC in milliseconds)

createdBy

String

Entity was originally created by (User, AMQP-Controller, anonymous etc.)

lastModifiedAt

Number

Entity was last modified at (timestamp UTC in milliseconds)

lastModifiedBy

String

Entity was last modified by (User, AMQP-Controller, anonymous etc.)

_links.compatibledistributionsettypes.href

String

Link to the compatible distribution set types in this target type

Response example

HTTP/1.1 200 OK
Content-Type: application/hal+json
Content-Length: 498

{
  "createdBy" : "bumlux",
  "createdAt" : 1652720971251,
  "lastModifiedBy" : "bumlux",
  "lastModifiedAt" : 1652720971267,
  "name" : "updatedTypeName",
  "description" : "an updated description",
  "colour" : "#aaafff",
  "_links" : {
    "self" : {
      "href" : "https://management-api.host.com/rest/v1/targettypes/7"
    },
    "compatibledistributionsettypes" : {
      "href" : "https://management-api.host.com/rest/v1/targettypes/7/compatibledistributionsettypes"
    }
  },
  "id" : 7
}

Error responses

HTTP Status Code Reason Response Model

400 Bad Request

Bad Request - e.g. invalid parameters

401 Unauthorized

The request requires user authentication.

403 Forbidden

Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or data volume restriction applies.

See Error body

404 Not Found

Target type was not found.

See Error body

405 Method Not Allowed

The http request method is not allowed on the resource.

406 Not Acceptable

In case accept header is specified and not application/json.

409 Conflict

E.g. in case an entity is created or modified by another user in another request at the same time. You may retry your modification request.

See Error body

415 Unsupported Media Type

The request was attempt with a media-type which is not supported by the server for this resource.

429 Too Many Request

Too many requests. The server will refuse further attempts and the client has to wait another second.

GET /rest/v1/targettypes/{targetTypeId}/compatibledistributionsettypes

Implementation notes

Handles the GET request of retrieving the list of compatible distribution set types in that target type. Required Permission: READ_TARGET, READ_REPOSITORY

Lists all compatible distribution set types

CURL

$ curl 'https://management-api.host.com/rest/v1/targettypes/1/compatibledistributionsettypes' -i -X GET \
    -H 'Accept: application/json'

Request URL

GET /rest/v1/targettypes/1/compatibledistributionsettypes HTTP/1.1
Accept: application/json
Host: management-api.host.com

Request path parameter

Parameter Description

targetTypeId

The technical identifier of the entity

Response (Status 200)

Response fields

Path Type Description Allowed Values

[]id

Number

The technical identifier of the entity

[]key

String

Functional key of the distribution set type.

[]name

String

The name of the entity

[]description

String

The description of the entity

[]colour

String

The colour of the entity

[]createdAt

Number

Entity was originally created at (timestamp UTC in milliseconds)

[]createdBy

String

Entity was originally created by (User, AMQP-Controller, anonymous etc.)

[]lastModifiedAt

Number

Entity was last modified at (timestamp UTC in milliseconds)

[]lastModifiedBy

String

Entity was last modified by (User, AMQP-Controller, anonymous etc.)

[]deleted

Boolean

Deleted flag, used for soft deleted entities

Response example

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 504

[ {
  "createdBy" : "bumlux",
  "createdAt" : 1652720970597,
  "lastModifiedBy" : "bumlux",
  "lastModifiedAt" : 1652720970597,
  "name" : "OS (FW) mandatory, runtime (FW) and app (SW) optional",
  "description" : "turpis pretium laoreet facilisi tempus netus neque cursus habitant natoque",
  "key" : "test_default_ds_type",
  "deleted" : false,
  "colour" : "black",
  "_links" : {
    "self" : {
      "href" : "https://management-api.host.com/rest/v1/distributionsettypes/4"
    }
  },
  "id" : 4
} ]

Error responses

HTTP Status Code Reason Response Model

400 Bad Request

Bad Request - e.g. invalid parameters

401 Unauthorized

The request requires user authentication.

403 Forbidden

Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or data volume restriction applies.

See Error body

404 Not Found

Distribution set type was not found.

See Error body

405 Method Not Allowed

The http request method is not allowed on the resource.

406 Not Acceptable

In case accept header is specified and not application/json.

429 Too Many Request

Too many requests. The server will refuse further attempts and the client has to wait another second.

POST /rest/v1/targettypes/{targetTypeId}/compatibledistributionsettypes

Implementation notes

Handles the POST request for adding compatible distribution set types to a target type. Required Permission: UPDATE_TARGET and READ_REPOSITORY

Add compatible distribution set type

CURL

$ curl 'https://management-api.host.com/rest/v1/targettypes/5/compatibledistributionsettypes' -i -X POST \
    -H 'Content-Type: application/json' \
    -d '[ {
  "id" : 17
}, {
  "id" : 18
} ]'

Request URL

POST /rest/v1/targettypes/5/compatibledistributionsettypes HTTP/1.1
Content-Type: application/json
Content-Length: 36
Host: management-api.host.com

[ {
  "id" : 17
}, {
  "id" : 18
} ]

Request path parameter

Parameter Description

targetTypeId

The technical identifier of the entity

Request fields

Path Type Description Allowed Values Mandatory

[]id

Number

The technical identifier of the entity

X

Error responses

HTTP Status Code Reason Response Model

400 Bad Request

Bad Request - e.g. invalid parameters

401 Unauthorized

The request requires user authentication.

403 Forbidden

Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or data volume restriction applies.

See Error body

404 Not Found

Distribution set type was not found.

See Error body

405 Method Not Allowed

The http request method is not allowed on the resource.

406 Not Acceptable

In case accept header is specified and not application/json.

409 Conflict

Distribution set type already exists

See Error body

415 Unsupported Media Type

The request was attempt with a media-type which is not supported by the server for this resource.

429 Too Many Request

Too many requests. The server will refuse further attempts and the client has to wait another second.

DELETE /rest/v1/targettypes/{targetTypeId}/compatibledistributionsettypes/{distributionSetTypeId}

Implementation Notes

Handles the DELETE request for removing a distribution set type from a single target type. Required Permission: UPDATE_TARGET and READ_REPOSITORY

Remove compatible distribution set type from target type

CURL

$ curl 'https://management-api.host.com/rest/v1/targettypes/6/compatibledistributionsettypes/23' -i -X DELETE \
    -H 'Content-Type: application/json'

Request URL

DELETE /rest/v1/targettypes/6/compatibledistributionsettypes/23 HTTP/1.1
Content-Type: application/json
Host: management-api.host.com

Request path parameter

Parameter Description

targetTypeId

The technical identifier of the entity

distributionSetTypeId

The technical identifier of the entity

Error responses

HTTP Status Code Reason Response Model

400 Bad Request

Bad Request - e.g. invalid parameters

401 Unauthorized

The request requires user authentication.

403 Forbidden

Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or data volume restriction applies.

See Error body

404 Not Found

Distribution set type was not found.

See Error body

405 Method Not Allowed

The http request method is not allowed on the resource.

406 Not Acceptable

In case accept header is specified and not application/json.

429 Too Many Request

Too many requests. The server will refuse further attempts and the client has to wait another second.

Additional content

Error body

{
  "errorCode": "string",
  "exceptionClass": "string",
  "message": "string",
  "parameters": [
    "string"
  ]
}

Field description

Field

Description

errorCode

A error code/key set by server

exceptionClass

The involved exceptionClass

message

An error message set by the server

parameters

A list of parameters