Container owner API

  • 0
  • 1
  • Question
  • Updated 2 months ago
  • Answered
Hello there,

I am fetching the container details using API: GET /resources/json/delphix/jetstream/container

Although the container has multiple owners, this value is returning as "null". Is there a another API I can fetch the owners and add/delete them?

POST /resources/json/delphix/selfservice/container/{ref}/addOwner
Is not working for me!

Many Thanks.
Photo of EnterpriseMan

EnterpriseMan

  • 630 Points 500 badge 2x thumb

Posted 2 months ago

  • 0
  • 1
Photo of Adam Bowen

Adam Bowen, Official Rep

  • 17,884 Points 10k badge 2x thumb
You are right that doing a get on a container always returns 'null' for the owners. This is likely a bug, and I have an inquiry into our engineers. For adding/removing an owner, you can do the following, replacing JS_DATA_CONTAINER-1 with the reference for your container and USER-2 with the reference for your delphix user. The json below is your post body.:

=== POST /resources/json/delphix/selfservice/container/JS_DATA_CONTAINER-1/addOwner ===
{
    "type": "JSDataContainerModifyOwnerParameters",
    "owner": "USER-2"
}
(Edited)
Photo of EnterpriseMan

EnterpriseMan

  • 630 Points 500 badge 2x thumb
Hi there,
sorry for the delayed response, but this does not work for me.

p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #000000} span.s1 {font-variant-ligatures: no-common-ligatures}

curl -X POST -k https://$DE/resources/json/delphix/selfservice/container/JS_DATA_CONTAINER-27/addOwner  \

    -b ~/cookies.txt -H "Content-Type: application/json" |python -mjson.tool

{

    "type": "JSDataContainerModifyOwnerParameters",

    "owner": "USER-2"

}

{

    "error": {

        "action": "Provide the input parameter and try again.",

        "commandOutput": null,

        "details": "Missing required input of type \"JSDataContainerModifyOwnerParameters\".",

        "diagnoses": [],

        "id": "exception.webservices.api.input.missing",

        "type": "APIError"

    },

    "status": "ERROR",

    "type": "ErrorResult"

}
Photo of Adam Bowen

Adam Bowen, Official Rep

  • 17,884 Points 10k badge 2x thumb
Official Response
Not sure why you are piping your json into the json.tool module. Try without it instead. i.e.

curl -X POST -k https://$DE/resources/json/delphix/selfservice/container/JS_DATA_CONTAINER-27/addOwner  \

    -b ~/cookies.txt -H "Content-Type: application/json" -d @- <<EOF

{

    "type": "JSDataContainerModifyOwnerParameters",

    "owner": "USER-2"

}
EOF
Photo of EnterpriseMan

EnterpriseMan

  • 630 Points 500 badge 2x thumb
Thanks!!, removing the tool worked well.