授予访问“作业”选项卡的权限

授予访问“作业”选项卡的权限

您可以授予访问 作业 选项卡的用户权限。新用户默认没有权限。

注意:此过程授予访问作业选项卡及其内部所有作业的全部用户权限。如果您希望配置更加细分的用户访问权限,请参阅 .

使用 UI 授予访问权限

前提条件:

  • 不具有 权限. 的 DC/OS 用户账户。
  1. 以具有 superuser 权限的用户身份登录 DC/OS UI。

    图 1. 登录 UI

  2. 选择组织,然后选择用户

  3. 选择要授予权限的用户名或组名。

    图 2. 选择要授予权限的用户或组

  1. 权限选项卡上,单击添加权限

  2. 单击插入权限字符串以切换对话框。

    添加权限

    图 3. 添加权限

  3. 权限字符串字段中复制并粘贴权限。根据您的 选择权限字符串,单击添加权限,然后单击关闭

DC/OS 作业任务和详情

  1. dcos:adminrouter:ops:mesos full
  2. dcos:adminrouter:ops:slave full

DC/OS 作业选项卡

  1. dcos:adminrouter:service:metronome full
  2. dcos:service:metronome:metronome:jobs full
  1. dcos:adminrouter:ops:mesos full
  2. dcos:adminrouter:ops:slave full
  3. dcos:mesos:master:framework:role:* read
  4. dcos:mesos:master:executor:app_id read
  5. dcos:mesos:master:task:app_id read
  6. dcos:mesos:agent:framework:role:* read
  7. dcos:mesos:agent:executor:app_id read
  8. dcos:mesos:agent:task:app_id read
  9. dcos:mesos:agent:sandbox:app_id read

使用 API 授予访问权限

前提条件:

  • 必须 安装 DC/OS CLI 并以超级用户登户身份登录。
  • 您必须 ,才能发布此部分的 curl 命令。

Notes

  • 服务资源通常包括 / 必须在 curl 请求中以 %252F 替换的字符,如下例所示。
  • 使用 API 管理权限时,您必须在授予之前先创建权限。如果权限已存在,API 将返回提示信息,您可以继续分配权限。

DC/OS 作业选项卡

    1. curl -X PUT --cacert dcos-ca.crt -H "Authorization: token=$(dcos config show core.dcos_acs_token)" \
    2. $(dcos config show core.dcos_url)/acs/api/v1/acls/dcos:adminrouter:service:metronome/users/<uid>/full
    3. curl -X PUT --cacert dcos-ca.crt -H "Authorization: token=$(dcos config show core.dcos_acs_token)" \
    4. $(dcos config show core.dcos_url)/acs/api/v1/acls/dcos:service:metronome:metronome:jobs/users/<uid>/full

注意:要向组而不是向用户授予权限,应将 /users/"uid" 替换为 /groups/"gid".

  1. 创建权限。

    1. curl -X PUT --cacert dcos-ca.crt -H "Authorization: token=$(dcos config show core.dcos_acs_token)" \
    2. -H 'Content-Type: application/json' \
    3. $(dcos config show core.dcos_url)/acs/api/v1/acls/dcos:adminrouter:ops:mesos \
    4. -d '{"description":"Grants access to the Mesos master API/UI and task details"}'
    5. curl -X PUT --cacert dcos-ca.crt -H "Authorization: token=$(dcos config show core.dcos_acs_token)" \
    6. -H 'Content-Type: application/json' \
    7. $(dcos config show core.dcos_url)/acs/api/v1/acls/dcos:adminrouter:ops:slave \
    8. -d '{"description":"Grants access to the Mesos agent API/UI and task details such as logs"}'
  2. 向用户授予以下特权 uid.

    1. curl -X PUT --cacert dcos-ca.crt -H "Authorization: token=$(dcos config show core.dcos_acs_token)" \
    2. curl -X PUT --cacert dcos-ca.crt -H "Authorization: token=$(dcos config show core.dcos_acs_token)" \
    3. $(dcos config show core.dcos_url)/acs/api/v1/acls/dcos:adminrouter:ops:slave/users/<uid>/full

注意:要向组而不是向用户授予权限,应将 /users/"uid" 替换为 /groups/"gid".

DC/OS 作业选项卡

  1. 创建权限。

  2. 向用户授予以下特权 uid.

    1. curl -X PUT --cacert dcos-ca.crt -H "Authorization: token=$(dcos config show core.dcos_acs_token)" \
    2. $(dcos config show core.dcos_url)/acs/api/v1/acls/dcos:adminrouter:service:metronome/users/<uid>/full
    3. curl -X PUT --cacert dcos-ca.crt -H "Authorization: token=$(dcos config show core.dcos_acs_token)" \
    4. $(dcos config show core.dcos_url)/acs/api/v1/acls/dcos:service:metronome:metronome:jobs/users/<uid>/full

注意:要向组而不是向用户授予权限,应将 /users/"uid" 替换为 /groups/"gid".

DC/OS 作业任务和详情

  1. 创建权限。

    1. curl -X PUT --cacert dcos-ca.crt -H "Authorization: token=$(dcos config show core.dcos_acs_token)" \
    2. -H 'Content-Type: application/json' \
    3. $(dcos config show core.dcos_url)/acs/api/v1/acls/dcos:adminrouter:ops:mesos \
    4. -d '{"description":"Grants access to the Mesos master API/UI and task details"}'
    5. curl -X PUT --cacert dcos-ca.crt -H "Authorization: token=$(dcos config show core.dcos_acs_token)" \
    6. -H 'Content-Type: application/json' \
    7. $(dcos config show core.dcos_url)/acs/api/v1/acls/dcos:adminrouter:ops:slave \
    8. -d '{"description":"Grants access to the Mesos agent API/UI and task details such as logs"}'
    9. curl -X PUT --cacert dcos-ca.crt -H "Authorization: token=$(dcos config show core.dcos_acs_token)" \
    10. -H 'Content-Type: application/json' \
    11. $(dcos config show core.dcos_url)/acs/api/v1/acls/dcos:mesos:master:framework:role:* \
    12. -d '{"description":"Grants access to register as or view Mesos master information about frameworks registered with the Mesos default role"}'
    13. curl -X PUT --cacert dcos-ca.crt -H "Authorization: token=$(dcos config show core.dcos_acs_token)" \
    14. -H 'Content-Type: application/json' \
    15. -d '{"description":"Grants access to all executors on the Mesos master"}'
    16. curl -X PUT --cacert dcos-ca.crt -H "Authorization: token=$(dcos config show core.dcos_acs_token)" \
    17. -H 'Content-Type: application/json' \
    18. $(dcos config show core.dcos_url)/acs/api/v1/acls/dcos:mesos:master:task:app_id \
    19. -d '{"description":"Grants access to all tasks on the Mesos master"}'
    20. curl -X PUT --cacert dcos-ca.crt -H "Authorization: token=$(dcos config show core.dcos_acs_token)" \
    21. -H 'Content-Type: application/json' \
    22. -d '{"description":"Grants access to view Mesos agent information about frameworks registered with the Mesos default role"}'
    23. curl -X PUT --cacert dcos-ca.crt -H "Authorization: token=$(dcos config show core.dcos_acs_token)" \
    24. -H 'Content-Type: application/json' \
    25. $(dcos config show core.dcos_url)/acs/api/v1/acls/dcos:mesos:agent:executor:app_id \
    26. -d '{"description":"Grants access to all executors running on the Mesos agent"}'
    27. curl -X PUT --cacert dcos-ca.crt -H "Authorization: token=$(dcos config show core.dcos_acs_token)" \
    28. -H 'Content-Type: application/json' \
    29. $(dcos config show core.dcos_url)/acs/api/v1/acls/dcos:mesos:agent:task:app_id \
    30. -d '{"description":"Grants access to all tasks running on the Mesos agent"}'
    31. curl -X PUT --cacert dcos-ca.crt -H "Authorization: token=$(dcos config show core.dcos_acs_token)" \
    32. -H 'Content-Type: application/json' \
    33. $(dcos config show core.dcos_url)/acs/api/v1/acls/dcos:mesos:agent:sandbox:app_id \
    34. -d '{"description":"Grants access to the sandboxes on the Mesos agent"}'
    1. curl -X PUT --cacert dcos-ca.crt -H "Authorization: token=$(dcos config show core.dcos_acs_token)" \
    2. $(dcos config show core.dcos_url)/acs/api/v1/acls/dcos:adminrouter:ops:mesos/users/<uid>/full
    3. curl -X PUT --cacert dcos-ca.crt -H "Authorization: token=$(dcos config show core.dcos_acs_token)" \
    4. $(dcos config show core.dcos_url)/acs/api/v1/acls/dcos:adminrouter:ops:slave/users/<uid>/full
    5. curl -X PUT --cacert dcos-ca.crt -H "Authorization: token=$(dcos config show core.dcos_acs_token)" \
    6. $(dcos config show core.dcos_url)/acs/api/v1/acls/dcos:mesos:master:framework:role:*/users/<uid>/read
    7. curl -X PUT --cacert dcos-ca.crt -H "Authorization: token=$(dcos config show core.dcos_acs_token)" \
    8. $(dcos config show core.dcos_url)/acs/api/v1/acls/dcos:mesos:master:executor:app_id/users/<uid>/read
    9. curl -X PUT --cacert dcos-ca.crt -H "Authorization: token=$(dcos config show core.dcos_acs_token)" \
    10. $(dcos config show core.dcos_url)/acs/api/v1/acls/dcos:mesos:master:task:app_id/users/<uid>/read
    11. curl -X PUT --cacert dcos-ca.crt -H "Authorization: token=$(dcos config show core.dcos_acs_token)" \
    12. $(dcos config show core.dcos_url)/acs/api/v1/acls/dcos:mesos:agent:framework:role:*/users/<uid>/read
    13. curl -X PUT --cacert dcos-ca.crt -H "Authorization: token=$(dcos config show core.dcos_acs_token)" \
    14. $(dcos config show core.dcos_url)/acs/api/v1/acls/dcos:mesos:agent:executor:app_id/users/<uid>/read
    15. curl -X PUT --cacert dcos-ca.crt -H "Authorization: token=$(dcos config show core.dcos_acs_token)" \
    16. $(dcos config show core.dcos_url)/acs/api/v1/acls/dcos:mesos:agent:task:app_id/users/<uid>/read
    17. curl -X PUT --cacert dcos-ca.crt -H "Authorization: token=$(dcos config show core.dcos_acs_token)" \
    18. $(dcos config show core.dcos_url)/acs/api/v1/acls/dcos:mesos:agent:sandbox:app_id/users/<uid>/read

注意:要向组而不是向用户授予权限,应将 /users/"uid" 替换为 .