open-consul/ui/packages/consul-ui/mock-api/v1/namespaces

65 lines
1.4 KiB
Plaintext
Raw Normal View History

[
{
"Name": "default",
"Description": "The default namespace",
"ACLs": {
"PolicyDefaults": [
${range(env('CONSUL_POLICY_COUNT', 3)).map((i) => `
{
"ID": "${fake.random.uuid()}-${i}",
"Name": "${fake.hacker.noun()}-policy"
}
`)}
],
"RoleDefaults": [
${range(env('CONSUL_ROLE_COUNT', 3)).map((i) => `
{
"ID": "${fake.random.uuid()}-${i}",
"Name": "${fake.hacker.noun()}-role"
}
`)}
]
}
}
${range(
env(
'CONSUL_NSPACE_COUNT',
Math.floor(
(
Math.random() * env('CONSUL_NSPACE_MAX', 10)
) + parseInt(env('CONSUL_NSPACE_MIN', 1))
)
) - 1
).map(i => `
${i === 0 ? `
,
` : ``}
{
"Name": "${fake.hacker.noun()}-ns-${i}",
"ACLs": {
"PolicyDefaults": [
${range(env('CONSUL_POLICY_COUNT', 3)).map((i) => `
{
"ID": "${fake.random.uuid()}-${i}",
"Name": "${fake.hacker.noun()}-policy"
}
`)}
],
"RoleDefaults": [
${range(env('CONSUL_ROLE_COUNT', 3)).map((i) => `
{
"ID": "${fake.random.uuid()}-${i}",
"Name": "${fake.hacker.noun()}-role"
}
`)}
]
},
${fake.random.boolean() ? `
"Description": "${fake.lorem.sentence()}",
` : ``}
"CreateIndex": 12,
"ModifyIndex": 16
}
`)}
]