open-consul/ui/packages/consul-ui/mock-api/v1/acl/_
John Cowen 5875e4b15b
ui: Move mocks into the ui project (#9084)
* Add consul-api-double under api

* Update config to reflect api change

* Remove consul-api-double as a dependency

* api -> mock-api

* Fixup mocks path for staging
2020-11-05 16:03:49 +00:00

29 lines
772 B
Plaintext

${
location.pathname.get(2) === 'policy' && http.method === 'PUT' ? `
{
"ID": "${fake.random.uuid()}-1",
"Name": "${body.Name || ''}",
"Description": "${body.Description || ''}",
"Datacenters": ${fake.helpers.randomize(['null', '["dc-1", "dc-2"]'])},
"Rules": "${body.Rules || ''}"
}
` : location.pathname.get(2) === 'token' && http.method === 'PUT' ?
`
{
"AccessorID":"${fake.random.uuid()}-1",
"SecretID":"${fake.random.uuid()}",
"Name": "${body.Name || ''}",
"Policies": ["dc2-service-register", "global-service-read"],
"CreateTime":"2017-08-23T22:47:14.695408057Z",
"CreateIndex":7,
"ModifyIndex":7
}
` : location.pathname.get(2) === 'role' && http.method === 'PUT' ?
`
{
"ID": "${fake.random.uuid()}-1"
}
` : `true`
}