Loading...
Loading...
Compare original and translation side by side
fusion-infra-clifusion-infra-clifrolesdotnet tool install --global \
--add-source "https://statoil-proview.pkgs.visualstudio.com/Fusion%20-%20Packages/_packaging/Fusion-Public/nuget/v3/index.json" \
Fusion.Roles.Clifroles --updateDefaultAzureCredentialaz login-t <token>frolesdotnet tool install --global \
--add-source "https://statoil-proview.pkgs.visualstudio.com/Fusion%20-%20Packages/_packaging/Fusion-Public/nuget/v3/index.json" \
Fusion.Roles.Clifroles --updateDefaultAzureCredentialaz login-t <token>$schemaroles-config.json{
"$schema": "https://rolesv2.api.fusion.equinor.com/public/schemas/role-config.schema.json",
"accessRoles": [
{
"systemIdentifier": "my-service",
"name": "MyService.Project.Read",
"description": "Read access to project resources"
}
],
"roles": [
{
"name": "project-viewer",
"displayName": "Project Viewer",
"accessRoleMappings": [
{ "accessRoleIdentifier": "MyService.Project.Read" }
]
}
]
}$schemaroles-config.json{
"$schema": "https://rolesv2.api.fusion.equinor.com/public/schemas/role-config.schema.json",
"accessRoles": [
{
"systemIdentifier": "my-service",
"name": "MyService.Project.Read",
"description": "Read access to project resources"
}
],
"roles": [
{
"name": "project-viewer",
"displayName": "Project Viewer",
"accessRoleMappings": [
{ "accessRoleIdentifier": "MyService.Project.Read" }
]
}
]
}froles create -e ci --file roles-config.json --dry-runfroles create -e ci --file roles-config.json --dry-runundefinedundefined
`create` is **idempotent** — safe to run repeatedly. Resources are matched on natural keys; only changed fields are patched.
`create`命令具有**幂等性** — 可安全重复运行。资源通过自然键匹配;仅修补已更改的字段。froles export my-service -e ci -o current-state.jsoncreatefroles export my-service -e ci -o current-state.jsoncreatecreate| Resource | Natural key | Behaviour |
|---|---|---|
| Scope types | | Create if missing; patch |
| Access roles | | Create if missing; patch if changed |
| Roles / claimable roles | | Create if missing; patch if changed; access role mappings fully reconciled |
| Bindings | | Patch all fields; diff shows role/group additions and removals |
| Role assignments | | Create if missing; skip if exists |
create| 资源 | 自然键 | 行为 |
|---|---|---|
| 作用域类型 | | 不存在则创建;若 |
| 访问角色 | | 不存在则创建;变更则修补 |
| 角色 / 可申领角色 | | 不存在则创建;变更则修补;访问角色映射会被完全协调 |
| 绑定 | | 修补所有字段;差异会显示角色/组的新增和移除 |
| 角色分配 | | 不存在则创建;已存在则跳过 |
| Key | Purpose |
|---|---|
| Continuous integration |
| QA / pre-production |
| Production |
| Training environment |
| 键 | 用途 |
|---|---|
| 持续集成 |
| QA / 预生产 |
| 生产 |
| 培训环境 |
froles --help
froles create --helpfroles --help
froles create --help-t <token>delete role-assignments-t <token>delete role-assignments