OS1 Services
...
Container
Integrate with Containers
How to: Change the Container state
3min
for information about prerequisites, see integrate with containers docid\ v8jhivhg c9txkmpqsbxu before you can containerize a child container, must set the parent and child containers to the appropriate lifecycle state for more information about lifecycle states, see the 'lifecycle of a container' in container docid 84wc3sojyiq92xsenyfzo the parent container must be in the opened state, and the child container must be in the closed state by default, the state of a new container is created to set a container to opened , you must specify an event code of e 025 and a reason code of r 0001 in the request body to set the parent container to opened , call the apply event on the container docid\ rnmz4ynzmzmp eeom xkh endpoint and pass a request body similar to the following { "eventcode" "e 025", "timestamp" 1661375504, "reasoncode" "r 0001", "data" { }, "source" { "appid" "sid3", "userid" "sid2", "locid" "sid2" } } the response body will look similar to the following { "data" { "id" "pallet1 11dafb08 f309 5b1d 8d31 7761a75c99ee", "state" "opened\ opened" }, "request" { "uri" "/core/api/v2/containers/boxtwo 11dafb08 f309 5b1d 8d31 7761a75c99ee/state/event", "method" "put", "querystring" "{}", "body" { "eventcode" "e 025", "timestamp" 1661375504, "reasoncode" "r 0001", "data" {}, "source" { "appid" "sid3", "userid" "sid2", "locid" "sid2" }, "propagate" false } } } app id is required and should be set to the client id of your app for information about registering an app and retrieving the client id, see the "register an app" section of getting started with building apps docid\ pimc8bwv2 c2qtgzc rvv a leaf container must be in the closed state to be containerized states are sequential a new container is in the created state, you must set the container to opened and then to closed to set the child box container to opened , call the apply event on the container docid\ rnmz4ynzmzmp eeom xkh endpoint and pass a request body similar to the following { "data" { "id" "pallet1 1a3057a3 fc75 40ed ac28 989c9d3d1551", "state" "opened\ opened", "event" { "eventcode" "e 026", "reasoncode" "r 0001", "timestamp" 1661375504, "propagate" false, "data" {}, "source" { "appid" "sid3", "userid" "sid2", "locid" "sid2" } }, "statechange" true } } to set the child box container to closed , call the apply event on the container docid\ rnmz4ynzmzmp eeom xkh endpoint and pass a request body that specifies an event code of e 026 { "eventcode" "e 026", "timestamp" 1661375504, "reasoncode" "r 0001", "data" { }, "source" { "appid" "sid3", "userid" "sid2", "locid" "sid2" } }