Container Service
Container Type - State Machine...
Update state machine configuration of container type
1min
PUT
This API is for updating the current state-machine configuration (states, sub-states, and state transition rules) of a container type specified by the containerTypeName.
- Events - Represents array of Events. An event contains event name, event data,if any.
- Event Name - Represents name of the event for state transition.
- Event data - data expected with the event and validation, if any, for the event data.
- States List of main states with its substates and transitions.
Important: The state machine cannot be partially updated. Moreover, for each non-terminal sub-state, at least one state transition rule is expected.
PARAMETER | DESCRIPTION | TYPE | VALIDATION |
---|---|---|---|
events * | Represents an array of Events. An event contains event name, event data, if any. | ||
ㅤ↳event * | Represents name of the event for state transition. | string | Example: createdToOpened |
ㅤ↳eventType | Specifies event is transitional or not. TRANSITIONAL- Transitonal event is an event that upon invocation it will change the state of the container.NON_TRANSITIONAL- Transitonal event is an event that upon invocation it will not change the state of the container. | string | default: TRANSITIONALEnum: [ TRANSITIONAL, NON_TRANSITIONAL ] |
ㅤ↳eventData | Data expected with the event and validation, if any, for the event data. | ||
ㅤㅤ↳name * | Name of validation keys of an event. | string | minLength: 1 maxLength: 32 |
ㅤㅤ↳type | Event data type | string | Enum: [string, number, boolean, object, array] |
ㅤㅤ↳validation | Validation rules for a string or number value. | ||
ㅤㅤㅤ↳range | Field to specify the range that the attribute value must lie. In case of "string" data type, range will be the length of string value. | ||
ㅤㅤㅤㅤ↳min | The min value, inclusive. | number | |
ㅤㅤㅤㅤ↳max | The max value, inclusive. | number | |
ㅤㅤㅤ↳regex | Regex that the data should match. | string | minLength: 1 maxLength: 512 |
ㅤㅤㅤ↳valueOneOf | Enum of accepted values. | minItems: 1 maxItems: 16 | |
ㅤㅤㅤ↳required | Specifies whether the value is required or optional. | boolean | Default: false |
ㅤㅤㅤ↳blocking | Specifies whether we need to block the event transition in case the attribute validation is failed or not. | boolean | Default: true |
states * | List of main states with its sub-states and transitions. | ||
created * | State created. | ||
ㅤ↳name * | Name of the state. | string | |
ㅤ↳defaultSubstate * | Represents default substate for this state. | string | |
ㅤ↳substates * | minItems: 1 | ||
ㅤㅤ↳name * | Name of the sub-state. | string | minLength: 3 maxLength: 32 |
ㅤㅤ↳transitions * | Represents an array of transition rules for this substate. Transition Rule for this state. Contains events and the destination state. | ||
ㅤㅤㅤ↳event * | Represents name of the event for state transition. | string | minLength: 3 maxLength: 32 |
ㅤㅤㅤ↳destination * | Name of the main state and its sub-state. | string | Example: createdminLength: 3 maxLength: 32 |
ㅤㅤ↳ttl | Time to live associated with each state of a container. | ||
ㅤㅤㅤ↳time * | Time to live is associated with the state of a container. | string | pattern: Time string in days, hours, minutes, and seconds.minLength: 2Example - 30m, 1d 12h, 1d 12h 30m 45s etc. |
ㅤㅤㅤ↳destination * | Represents destination state to which this instance should be transitioned to after ttl expiry. | string | |
ㅤㅤ↳callback | Represents callback URL, which can be called to get any info about state transition of a container or its terminal ttl expiry. | string | A valid URL. |
opened * | It signifies readiness of container to begin containerization process. | ||
ㅤ↳name * | Name of the state. | string | |
ㅤ↳defaultSubstate * | Represents default substate for this state. | string | |
ㅤ↳substates * | minItems: 1 | ||
ㅤㅤ↳name * | Name of the sub-state. | string | minLength: 3 maxLength: 32 |
ㅤㅤ↳transitions * | Represents an array of transition rules for this substate. Transition Rule for this state. Contains events and the destination state. | ||
ㅤㅤㅤ↳event * | Represents name of the event for state transition. | string | minLength: 3 maxLength: 32 |
ㅤㅤㅤ↳destination * | Name of the main state and its sub-state. | string | Example: createdminLength: 3 maxLength: 32 |
ㅤㅤ↳ttl | Time to live associated with each state of a container. | ||
ㅤㅤㅤ↳time * | Time to live is associated with the state of a container. | string | pattern: Time string in days, hours, minutes, and seconds.minLength: 2Example - 30m, 1d 12h, 1d 12h 30m 45s etc. |
ㅤㅤㅤ↳destination * | Represents destination state to which this instance should be transitioned to after ttl expiry. | string | |
ㅤㅤ↳callback | Represents callback URL, which can be called to get any info about state transition of a container or its terminal ttl expiry. | string | A valid URL. |
closed * | It signifies the termination of containerization process. | ||
ㅤ↳name * | Name of the state. | string | |
ㅤ↳defaultSubstate * | Represents default substate for this state. | string | |
ㅤ↳substates * | minItems: 1 | ||
ㅤㅤ↳name * | Name of the sub-state. | string | minLength: 3 maxLength: 32 |
ㅤㅤ↳transitions * | Represents an array of transition rules for this substate. Transition Rule for this state. Contains events and the destination state. | ||
ㅤㅤㅤ↳event * | Represents name of the event for state transition. | string | minLength: 3 maxLength: 32 |
ㅤㅤㅤ↳destination * | Name of the main state and its sub-state. | string | Example: createdminLength: 3 maxLength: 32 |
ㅤㅤ↳ttl | Time to live associated with each state of a container. | ||
ㅤㅤㅤ↳time * | Time to live is associated with the state of a container. | string | pattern: Time string in days, hours, minutes, and seconds.minLength: 2Example - 30m, 1d 12h, 1d 12h 30m 45s etc. |
ㅤㅤㅤ↳destination * | Represents destination state to which this instance should be transitioned to after ttl expiry. | string | |
ㅤㅤ↳callback | Represents callback URL, which can be called to get any info about state transition of a container or its terminal ttl expiry. | string | A valid URL. |
completed * | End of the lifecycle of a container. | ||
ㅤ↳name * | Name of the state. | string | |
ㅤ↳defaultSubstate * | Represents default substate for this state. | string | |
ㅤ↳substates * | minItems: 1 | ||
ㅤㅤ↳name * | Name of the sub-state. | string | minLength: 3 maxLength: 32 |
ㅤㅤ↳transitions * | Represents an array of transition rules for this substate. Transition Rule for this state. Contains events and the destination state. | ||
ㅤㅤㅤ↳event * | Represents name of the event for state transition. | string | minLength: 3 maxLength: 32 |
ㅤㅤㅤ↳destination * | Name of the main state and its sub-state. | string | Example: createdminLength: 3 maxLength: 32 |
ㅤㅤ↳ttl | Time to live associated with each state of a container. | ||
ㅤㅤㅤ↳time * | Time to live is associated with the state of a container. | string | pattern: Time string in days, hours, minutes, and seconds.minLength: 2Example - 30m, 1d 12h, 1d 12h 30m 45s etc. |
ㅤㅤㅤ↳destination * | Represents destination state to which this instance should be transitioned to after ttl expiry. | string | |
ㅤㅤ↳callback | Represents callback URL, which can be called to get any info about state transition of a container or its terminal ttl expiry. | string | A valid URL. |
terminalStates | Terminal state. | sting | |
terminalTTL * | Specifies the time to live for a data entry in the database. Specified for a tenant. | string | Default: 30d Example: 10d5h3m0s minLength: 2 maxLength: 12 |
callback | Represents callback URL, which can be called to get any info about state transition of a container or its terminal ttl expiry. | string | A valid URL. |
*This is required. | |||
HTTP Status Code Summary |
Code | Description |
---|---|
200 - OK | Everything worked as expected. |
400 - Bad Request | The request was unacceptable, often due to missing a required parameter. |
401 - Unauthorized | No valid API key provided. |
404 - Not Found | The requested resource doesn't exist. |
503 - Server Error | Something went wrong.. (These are rare.) |
Path Parameters
containerTypeName
string
*
Header Parameters
X-COREOS-REQUEST-ID
string
*
X-COREOS-TID
string
*
X-COREOS-ACCESS
string
*
X-COREOS-USERINFO
string
Body Parameters
body
StateMachineUpdateRequest
*
Description
Update container type state machine
states
States
*
Responses
200
OK
SuccessResponse
data
object
request
Request
400
Bad Request
ErrorResponse
error
Error
request
Request
401
Unauthorized
ErrorResponse
error
Error
request
Request
404
Not Found
ErrorResponse
error
Error
request
Request
503
Server Error
ErrorResponse
error
Error
request
Request
Curl
JS
Ruby
Python
1curl --location --globoff --request PUT 'https://{tenantSubdomain}.io/core/api/v2/containers/container-types/{containerTypeName}/config/state-machine' \
2--header 'Accept: application/json' \
3--header 'Content-Type: application/json' \
4--data '{
5 "states": {
6 "created": {},
7 "opened": {},
8 "closed": {},
9 "completed": {}
10 }
11}'
Responses
200
400
401
404
503
1// OK
2{
3 "data": {
4 "id": ""
5 },
6 "request": {
7 "uri": "",
8 "method": "",
9 "queryString": "",
10 "body": {}
11 }
12}
Updated 24 Aug 2023
Did this page help you?