|
|
@@ -94,11 +94,20 @@ const createClient = (config) => {
|
|
|
})
|
|
|
} else {
|
|
|
log(`New stack ${opts.name}`)
|
|
|
- return await call('POST', `/api/stacks?method=${encodeURIComponent(opts.method)}&type=${encodeURIComponent(type)}&endpointId=${encodeURIComponent(opts.endpointId)}`, {
|
|
|
+ const stack = await call('POST', `/api/stacks?method=${encodeURIComponent(opts.method)}&type=${encodeURIComponent(type)}&endpointId=${encodeURIComponent(opts.endpointId)}`, {
|
|
|
Name: opts.name,
|
|
|
StackFileContent: (opts.warning ? warning : '') + opts.stackFileContent,
|
|
|
SwarmID: opts.swarmId
|
|
|
})
|
|
|
+ await call('POST', '/api/resource_controls', {
|
|
|
+ Type: 'stack',
|
|
|
+ Public: true,
|
|
|
+ ResourceID: opts.name,
|
|
|
+ Users: [],
|
|
|
+ Teams: [],
|
|
|
+ SubResourceIDs: []
|
|
|
+ })
|
|
|
+ return stack
|
|
|
}
|
|
|
}
|
|
|
return { getEndpoints, getSwarms, getStacks, upsertStack, deleteStack }
|