首页 | 新闻 | 新品 | 文库 | 方案 | 视频 | 下载 | 商城 | 开发板 | 数据中心 | 座谈新版 | 培训 | 工具 | 博客 | 论坛 | 百科 | GEC | 活动 | 主题月 | 电子展
返回列表 回复 发帖

探索用于 PowerVC 的 OpenStack REST API(2)

探索用于 PowerVC 的 OpenStack REST API(2)

Keystone v3:用户 您可以使用这些 API 获取 keystone 用户列表和关联的组:
  • https://<powervc-ip>/powervc/openstack/identity/v3/users
    用途:获取用户列表。
    操作:GET                        
    正常响应代码:200
    错误响应代码:identityFault                    (400, 500, …)、badRequest (400)、unauthorized (401)、forbidden                    (403)、badMethod (405)、overLimit (413)、serviceUnavailable                    (503)、itemNotFound (404)
  • https://<powervc-ip>/powervc/openstack/identity/v3/users/user_id
    用途:获取一个特定的用户。
    操作:GET                        
    正常响应代码:200
    错误响应代码:identityFault                    (400, 500, …)、badRequest (400)、unauthorized (401)、forbidden                    (403)、badMethod (405)、overLimit (413)、serviceUnavailable                    (503)、itemNotFound (404)
  • https://<powervc-ip>/powervc/openstack/identity/v3/users/user_id/groups
    用途:列出该用户所属的组。
    操作:GET
    正常响应代码:200
    错误响应代码:identityFault                    (400, 500, …)、badRequest (400)、unauthorized (401)、forbidden                    (403)、badMethod (405)、overLimit (413)、serviceUnavailable                    (503)、itemNotFound (404)
Keystone v3:组 您可以使用这些 API 获取 keystone 组列表和关联的用户:
  • https://<powervc-ip>/powervc/openstack/identity/v3/groups
    用途:获取                    keystone 组的列表。
    操作:GET                        
    正常响应代码:200
    错误响应代码:identityFault                    (400, 500, …)、badRequest (400)、unauthorized (401)、forbidden                    (403)、badMethod (405)、overLimit (413)、serviceUnavailable                    (503)、itemNotFound (404)
  • https://<powervc-ip>/powervc/openstack/identity/v3/groups/group_id
    用途:获取一个特定的组。
    操作:GET                        
    正常响应代码:200
    错误响应代码:identityFault                    (400, 500, …)、badRequest (400)、unauthorized (401)、forbidden                    (403)、badMethod (405)、overLimit (413)、serviceUnavailable                    (503)、itemNotFound (404)
  • https://<powervc-ip>/powervc/openstack/identity/v3/groups/group_id/users
    用途:列出属于指定的组的用户。
    操作:GET                        
    正常响应代码:200
    错误响应代码:identityFault                    (400, 500, …)、badRequest (400)、unauthorized (401)、forbidden                    (403)、badMethod (405)、overLimit (413)、serviceUnavailable                    (503)、itemNotFound (404)
Keystone v3:IBM 角色 角色是用户在执行一组特定的操作时呈现出的个性。一个角色包含一组权利和特权。承担该角色的用户继承这些权利和特权。
  • https://<powervc-ip>/powervc/openstack/identity/v3/ibm-roles/users
    用途:获取拥有                    PowerVC 角色权限的用户列表。
    操作:GET                        
    正常响应代码:200
    错误响应代码:identityFault                    (400, 500, …)、badRequest (400)、unauthorized (401)、forbidden                    (403)、badMethod (405)、overLimit (413)、serviceUnavailable                    (503)、itemNotFound (404)
  • https://<powervc-ip>/powervc/openstack/identity/v3/ibm-roles/groups
    用途:获取拥有                    PowerVC 角色权限的组列表。
    操作:GET                        
    正常响应代码:200
    错误响应代码:identityFault                    (400, 500, …)、badRequest (400)、unauthorized (401)、forbidden                    (403)、badMethod (405)、overLimit (413)、serviceUnavailable                    (503)、itemNotFound (404)
组件:Nova Nova 是 OpenStack Compute 的项目名称,是一个云计算结构控制器,也是 IaaS                系统的主要部分。它管理计算资源的生命周期和操作。
获取 Nova 示例请求和响应正文文件
Nova 服务器 可以使用这些 API 来管理虚拟服务器:
  • https://<powervc-ip>/powervc/openstack/compute/v2/tenant_id/servers
    用途:创建一个新的虚拟服务器或虚拟机。
    操作:POST                        
    正常响应代码:OK                    (200)
    错误响应代码:Bad Request (400)、Server Error                    (500)
  • https://<powervc-ip>/powervc/openstack/compute/v2/tenant_id/servers
    用途:获取虚拟服务器列表。
    操作:GET                        
    正常响应代码:OK                    (200)
    错误响应代码:Not Found (404)、Server Error                    (500)
  • https://<powervc-ip>/powervc/openstack/compute/v2/tenant_id/servers/detail
    用途:获取所有虚拟服务器的详细信息。
    操作:GET
    正常响应代码:OK                        (200)
    错误响应代码:Not Found (404)、Server Error                    (500)
  • https://<powervc-ip>/powervc/openstack/compute/v2/tenant_id/servers/server_id
    用途:获取一个指定的虚拟服务器的详细信息。
    操作:GET
    正常响应代码:OK                        (200)
    错误响应代码:Not Found (404)、Server Error                    (500)
  • https://<powervc-ip>/powervc/openstack/compute/v2/tenant_id/servers/server_id
    用途:删除一个指定的虚拟服务器。
    操作:DELETE                        
    正常响应代码:No Content                        (204)
    错误响应代码:Bad Request (400)、Not Found                    (404)、Server Error (500)
    没有请求或响应正文
  • https://<powervc-ip>/powervc/openstack/compute/v2/tenant_id/servers/server_id/action
    用途:调整指定的服务器。在请求的正文中指定                    resize                    操作。
    用途:确认一个即将执行的调整操作。在请求的正文中指定                    confirmResize                    操作。
    用途:将一个服务器实时迁移到新主机,而不必重新启动。在请求的正文中指定                    os-migrateLive                    操作。
    用途:停止一个运行的服务器,将它的状态更改为 STOPPED。在请求的正文中指定                    os-stop 操作。
    用途:启动一个停止的服务器,将它的状态更改为                    ACTIVE。在请求的正文中指定 os-start                    操作。
    用途:重新启动指定的服务器。在请求的正文中指定 reboot                        操作。
    用途:捕获虚拟机来创建新镜像。
    操作:POST                        
    正常响应代码:OK                    (200)
    错误响应代码:Bad Request (400)、Server Error                    (500)
Nova 卷附加可使用这些 API 将存储卷附加到虚拟服务器并与其分离:
  • https://<powervc-ip>/powervc/openstack/compute/v2/tenant_id/servers/server_id/os-volume_attachments
    用途:将一个卷附加到指定的服务器。
    操作:POST
    正常响应代码:OK                        (200)
    错误响应代码:Bad Request (400)、Server Error                    (500)
  • https://<powervc-ip>/powervc/openstack/compute/v2/tenant_id/servers/server_id/os-volume_attachments
    用途:列出指定的服务器上附加的卷。
    操作:GET
    正常响应代码:OK                        (200)
    错误响应代码:Not Found (404)、Server Error                    (500)
  • https://<powervc-ip>/powervc/openstack/compute/v2/tenant_id/servers/server_id/os-volume_attachments/attachment_id
    用途:列出指定的卷附加                    ID 的卷详细信息。
    操作:GET
    正常响应代码:OK                        (200)
    错误响应代码:Not Found (404)、Server Error                    (500)
  • https://<powervc-ip>/powervc/openstack/compute/v2/tenant_id/servers/server_id/os-volume_attachments/attachment_id
    用途:将指定的卷与指定的服务器分离。
    操作:DELETE
    正常响应代码:No                    Content (204)、202(Accepted)
    错误响应代码:Bad Request                    (400)、Not Found (404)、Server Error (500)
    没有请求或响应正文                    
Nova 扩展可以获取服务器上所有可用的扩展的列表和详细信息:
  • https://<powervc-ip>/powervc/openstack/compute/v2/tenant_id/extensions
    用途:列出所有可用的扩展。
    操作:GET
    正常响应代码:OK                        (200)
    错误响应代码:Not Found (404)、Server Error                    (500)
  • https://<powervc-ip>/powervc/openstack/compute/v2/tenant_id/extensions/{alias}
    用途:获取一个特定扩展的详细信息。扩展使在                    API                        中引入新特性时无需版本更改,它们可用于引入特定于供应商的功能。
    操作:GET
    正常响应代码:OK                        (200)
    错误响应代码:Not Found (404)、Server Error                    (500)
返回列表