I'm writing devops pipelines in a Docker Enterprise 3.2 environment.
I am able to fetch all stacks
from the UCP API. Now I need to fetch single stacks
but the documentation seems to omit completely this resource.
Is there anything as:
ucp_url/api/stacks/my_awesome_stack_name
or
ucp_url/api/stacks?name=my_awesome_stack_name
?
The field namespace
is the identifier of the stack. Calling api/stacks/my_namespace
will get the desired stack.
After fiddling a bit with the documentation and the api, I realized that the stacks
resource is just another collection that can be selected using its identifier.
When you invoke api/stacks
you'll receive a collection of stacks looking like this:
[
{
"namespace": "my_awesome_namespace_1",
"services": []
...
"namespace": "my_awesome_namespace_2",
"services": []
...
}
]
I simply tried api/stacks/my_awesome_namespace_1
and received the desired object in json format.
I believe the most important thing to this answer is that this method could be generalized to any UCP resource.
my_awesome_resource/my_awesome_resource_identifier