跳转到: 导航, 搜索

Manila/API

目录

OpenStack 共享文件系统管理服务 API v1 规范

本文档描述了如何开发使用 Manila 服务 API v1 进行身份验证的应用程序。本文档还描述了如何将服务与 Manila 服务 API v1 集成。

术语表

为了有效地使用共享文件系统管理服务 API,您应该了解几个关键概念

共享

A remote mountable filesystem. It can only be attached to several instances at a time.

共享类型

Share protocol (NFS, CIFS)

快照

A point in time copy of the data contained in a share.

共享网络

stores network information that will be used by share servers, where shares are hosted.

安全服务

stores information for configuring clients for LDAP, Kerberos or Active Directory on 'share server'. It should be attached to share-network, if assumed to be used.

共享服务器

is created by multitenant backend drivers, where shares are hosted. Using 'generic' driver, it is Nova's VMs, using 'cluster_mode' driver from NetApp it is 'vserver's...

卷类型

designed for filtering/choosing 'backends' before creation of share. Behaviour same as in 'Cinder' project.

高级任务流程

Manila 的高级任务流程如下

租户创建一个共享。例如,租户在网络中创建一个 30G NFS 共享,名为 share1,指定由 ID 为 '%some-share-network-id%' 的共享网络和后端 'netapp' 使用卷类型。

$ manila create nfs 30 --name share1 --description "Description of share" --share-network-id %some-share-network-id% --volume-type netapp

身份验证

您可以使用 cURL 尝试身份验证过程,分为两个步骤:获取令牌;将令牌发送到服务。通过提供您的用户名和 API 密钥或密码来获取身份验证令牌。以下是两种方法的示例:您可以通过提供用户名和密码来请求令牌。


$ curl -X POST https://:5000/v2.0/tokens -d '{"auth":{"passwordCredentials":{"username": "joecool", "password":"coolword"}, "tenantId":"5"}}' -H 'Content-type: application/json'

成功的身份验证返回一个令牌,您可以将其用作您的身份已通过身份验证的证据。要使用令牌,请将其作为 X-Auth-Token 标头传递给其他服务。身份验证还会返回服务目录,其中列出了您可以用于云服务的端点。使用身份验证令牌向您想要使用的服务发送 GET 请求。身份验证令牌通常有效期为 24 小时。应用程序应设计为在从服务端点收到 401(未授权)响应后重新进行身份验证。


请求/响应类型

Manila API 支持 JSON 和 XML 数据序列化格式。请求格式使用 Content-Type 标头指定,并且是包含请求体的调用的必需项。可以通过使用 Accept 标头或在请求 URI 中添加 .xml 或 .json 扩展名来指定响应格式。请注意,响应的序列化格式可能与请求不同。如果未指定响应格式,则默认使用 JSON。如果使用 Accept 标头和查询扩展名同时指定了冲突的格式,则查询扩展名优先。

注意:manila 目前支持 XML 容器类型,在实现 nova 的 bp 后:https://blueprints.launchpad.net/nova/+spec/remove-v3-xml-api 决定停止支持并在 manila 中测试此容器类型。

表 2.1. 响应格式

格式 Accept 标头 查询扩展名 默认
JSON application/json .json Yes
XML application/xml .xml

API 操作

共享

创建共享

POST /v1/<tenant_id>/shares

Content-Type: application/json

Accept: application/json


JSON 请求

{
   "share": {
       "volume_type": "%volume_type%",
       "name": "test",
       "snapshot_id": null,
       "description": "test description",
       "metadata": {
           "key1": "value1",
           "key2": "value2",
       },
       "share_proto": "nfs",
       "share_network_id": "%share_network_id%",
       "size": 1
   }
}

JSON 响应

{
   "share": {
       "id": %share_id%", 
       "links": [
           {"href": "http://%ip%:8786/v1/%tenant_id%/shares/%share_id%", "rel": "self"},
           {"href": "http://%ip%:8786/%tenant_id%/shares/%share_id%", "rel": "bookmark"}
       ],
       "name": "test"
   }
}
列出带有详细信息的共享

GET /v1/<tenant_id>/shares/detail

Accept: application/json


JSON 响应

{
   "shares": [
       {
            "status": "available",
            "export_location": %ip%:/opt/stack/data/manila/mnt/share-%share_id%,
            "name": "test",
            "links": [
                {"href": "http://%ip%:8786/v1/%tenant_id%/shares/%share_id%", "rel": "self"},
                {"href": "http://%ip%:8786/%tenant_id%/shares/%share_id%", "rel": "bookmark"}
            ],
            "availability_zone": "nova",
            "created_at": "2014-05-30T12:14:31.000000",
            "description": null,
            "share_proto": "NFS",
            "share_network_id": "%share_network_id%",
            "metadata": {
                "key1": "value1",
                "key2": "value2",
            },
            "host": "hostname@backendname",
            "volume_type": "%volume_type%",
            "snapshot_id": null,
            "project_id": "%project_id(tenant_id)%",
            "id": "%share_id%",
            "size": 1
       },
       {
            "status": "available",
            "export_location": null, 
            "name": "somename",
            "links": [
                {"href": "http://%ip%:8786/v1/%tenant_id%/shares/%share_id%", "rel": "self"},
                {"href": "http://%ip%:8786/%tenant_id%/shares/%share_id%", "rel": "bookmark"}
            ], 
            "availability_zone": "nova", 
            "created_at": "2014-05-30T12:12:55.000000", 
            "description": "somedescription", 
            "share_proto": "NFS", 
            "share_network_id": "%share_network_id%", 
            "metadata": {},
             "host": "hostname2@backendname2", 
            "volume_type": "%volume_type%",
             "snapshot_id": "%snapshot_id%",
            "project_id": "%project_id(tenant_id)%",
             "id": "%share_id%",
             "size": 1
       }
   ]
}
显示共享

GET /v1/<tenant_id>/shares/<share_id>

Accept: application/json

JSON 响应

{
   "share": {
       "status": "available",
       "export_location": "%ip%:/opt/stack/data/manila/mnt/share-%share_id%",
       "name": "name_of_cifs_share",
       "links": [
           {"href": "http://%ip%:8786/v1/%tenant_id%/shares/%share_id%", "rel": "self"},
           {"href": "http://%ip%:8786/%tenant_id%/shares/%share_id%", "rel": "bookmark"}
       ],
       "availability_zone": "nova",
       "created_at": "2014-05-30T11:31:13.000000",
       "description": "some description",
       "share_proto": "CIFS",
       "share_network_id": "%share_network_id%",
       "metadata": {
           "key1": "value1", 
           "key2": "value2"
       },
       "host": "hostname@backendname",
       "volume_type": "%volume_type%",
       "snapshot_id": null,
       "project_id": "%project_id%",
       "id": "%share_id%",
       "size": 5
   }
}
更新共享

PUT /v1/<tenant_id>/shares/<share_id>

Accept: application/json

JSON 请求

{
    "share": {
       "display_description": "New description",
       "display_name": "newname"
   }
}

JSON 响应

{
   "share": {
       "availability_zone": "nova",
       "created_at": "2013-10-02T09:58:12.000000",
       "description": "New description",
       "share_network_id": "%share_network_id%",
       "export_location": "localhost:/opt/stack/data/manila/mnt/share-%share_id%",
       "id": "%share_id%",
       "links": [
           {
               "href": "https://:8786/v1/%tenant_id%/shares/%share_id%",
               "rel": "self"
           },
           {
               "href": "https://:8786/%tenant_id%/shares/%share_id%",
               "rel": "bookmark"
           }
       ],
       "name": "newname",
       "volume_type": "%volume_type%",
       "share_proto": "NFS",
       "size": 2,
       "snapshot_id": null,
       "status": "available",
       "project_id": "%project_id%",
       "host": "hostname@backendname",
       "metadata": {
                    "key1": "value1", 
                    "key2": "value2"
       }
   }
}
删除共享

DELETE /v1/<tenant_id>/shares/<share_id>

显示共享元数据

GET /v1/<tenant_id>/shares/<share_id>/metadata

Accept: application/json

JSON 响应

{
    "metadata": {
       "key1": "value1",
       "key2": "value2"
   }
}
更新共享元数据

PUT /v1/<tenant_id>/shares/<share_id>/metadata

Accept: application/json

JSON 请求

{
    "metadata": {
       "key1": "value1"
   }
}

JSON 响应

{
    "metadata": {
       "key1": "value1"
   }
}
设置共享元数据

POST /v1/<tenant_id>/shares/<share_id>/metadata

Accept: application/json

JSON 请求

{
    "metadata": {
       "key1": "value1"
   }
}

JSON 响应

{
    "metadata": {
       "key1": "value1", 
       "key2": "value2"
   }
}
取消设置共享元数据

DELETE /v1/<tenant_id>/shares/<share_id>/metadata/<key>

共享操作

允许访问

POST /v1/<tenant_id>/shares/<share_id>/action

Accept: application/json

JSON 请求

{
    "os-allow_access": {
       "access_to": "1.1.1.1",
       "access_type": "ip"
   }
}

JSON 响应

{
    "access": {
       "access_to": "1.1.1.1",
       "access_type": "ip",
       "created_at": "2013-10-02T10:29:36.539532",
       "deleted": false,
       "deleted_at": null,
       "id": "%access_rule_id%",
       "share_id": "%share_id%",
       "state": "new",
       "updated_at": null
   }
}
拒绝访问

POST /v1/<tenant_id>/shares/<share_id>/action

Accept: application/json

JSON 请求

{
     "os-deny_access": {
       "access_id": "%access_rule_id%"
   }
}
列出访问规则

POST /v1/<tenant_id>/shares/<share_id>/action

Accept: application/json

JSON 请求

{
    "os-access_list": null
}

JSON 响应

{
    "access_list": [
       {
           "access_to": "1.1.1.1",
           "access_type": "ip",
           "id": "%access_rule_id%",
           "state": "active"
       }
   ]
}
重置共享状态

POST /v1/<tenant_id>/shares/<share_id>/action

Accept: application/json

JSON 请求

{
    "os-reset_status": {"status": "error"}
}

JSON 响应为空

快照

创建快照

POST /v1/<tenant_id>/snapshots

Accept: application/json

JSON 请求

{
    "snapshot": {
       "description": null,
       "force": false,
       "name": null,
       "share_id": "%share_id%"
   }
}

JSON 响应

{
    "snapshot": {
       "id": "%snapshot_id%",
       "links": [
           {
               "href": "https://:8786/v1/%tenant_id%/snapshots/%snapshot_id%",
               "rel": "self"
           },
           {
               "href": "https://:8786/%tenant_id%/snapshots/%snapshot_id%",
               "rel": "bookmark"
           }
       ],
       "name": null
   }
}
列出带有详细信息的快照

GET /v1/<tenant_id>/snapshots/detail

Accept: application/json

JSON 响应

{
    "snapshots": [
        {
            "status": "available",
            "share_id": "%share_id%",
            "description": "test-desc",
            "links": [
                {"href": "http://%ip%:8786/v1/%tenant_id%/snapshots/%snapshot_id%", "rel": "self"},
                {"href": "http://%ip%:8786/%tenant_id%/snapshots/%snapshot_id%", "rel": "bookmark"}
            ],
            "id": "%snapshot_id%",
            "size": 1,
            "name": "snap-test",
            "created_at": "2014-05-30T17:20:37.000000",
            "export_location": "10.254.0.3:/shares/share-%share_id%",
            "share_proto": "NFS",
            "share_size": 1
        },
        {
            "status": "available",
            "share_id": "%share_id%",
            "description": "test-desc",
            "links": [
                {"href": "http://%ip%:8786/v1/%tenant_id%/snapshots/%snapshot_id%", "rel": "self"},
                {"href": "http://%ip%:8786/%tenant_id%/snapshots/%snapshot_id%", "rel": "bookmark"}
            ], 
            "id": "%snapshot_id%",
            "size": 1, 
            "name": "snap-test",
            "created_at": "2014-05-30T17:20:24.000000",
            "export_location": "10.254.0.3:/shares/share-%share_id%",
            "share_proto": "NFS",
            "share_size": 1
        }
    ]
}
显示快照

GET /v1/<tenant_id>/snapshots/<snapshot_id>

Accept: application/json

JSON 响应

{
    "snapshot": {
        "status": "available",
        "share_id": "%share_id%",
        "description": "test-desc",
        "links": [
            {"href": "http://%ip%:8786/v1/%tenant_id%/snapshots/%snapshot_id%", "rel": "self"},
            {"href": "http://%ip%:8786/%tenant_id%/snapshots/%snapshot_id%", "rel": "bookmark"}
        ],
        "id": "%snapshot_id%",
        "size": 1,
        "name": "snap-test",
        "created_at": "2014-05-30T17:20:37.000000",
        "export_location": "10.254.0.3:/shares/share-%share_id%",
        "share_proto": "NFS",
        "share_size": 1
    }
}
更新快照

PUT /v1/<tenant_id>/snapshots/<snapshot_id>

Accept: application/json

JSON 请求

{
   "snapshot": {
       "display_description": "New description",
       "display_name": "newname"
   }
}

JSON 响应

{
    "snapshot": {
        "status": "available",
        "share_id": "%share_id%",
        "description": "New description",
        "links": [
            {"href": "http://%ip%:8786/v1/%tenant_id%/snapshots/%snapshot_id%", "rel": "self"},
            {"href": "http://%ip%:8786/%tenant_id%/snapshots/%snapshot_id%", "rel": "bookmark"}
        ],
        "id": "%snapshot_id%",
        "size": 1,
        "name": "newname",
        "created_at": "2014-05-30T17:20:37.000000",
        "export_location": "10.254.0.3:/shares/share-%share_id%",
        "share_proto": "NFS",
        "share_size": 1
    }
}
删除快照

DELETE /v1/<tenant_id>/snapshots/<snapshot_id>

Accept: application/json

快照操作

重置快照状态

POST /v1/<tenant_id>/snapshots/<snapshot_id>/action

Accept: application/json

JSON 请求

{
    "os-reset_status": {"status": "error"}
}

JSON 响应为空

共享网络

创建共享网络

POST /v1/<tenant_id>/share-networks

Content-Type: application/json

Accept: application/json


JSON 请求

{
   "share_network": {
       "name": "test_name",
       "description": "test_description",
       "neutron_net_id": "some_neutron_net_id",
       "neutron_subnet_id": "some_neutron_subnet_id",
   }
}

JSON 响应

{
    "share_network": {
       "id": "%share_network_id%",
       "name": "test_name",
       "description": "test_description",
       "neutron_net_id": "%some_neutron_net_id%",
       "neutron_subnet_id": "%some_neutron_subnet_id%",
       "segmentation_id": null,
       "network_type": null,
       "status": null,
       "created_at": "2009-10-11T12:13:14.000000",
       "updated_at": null,
       "ip_version": null,
       "cidr": null,
       "project_id": "%project_id%",
   }
}
列出共享网络

GET /v1/<tenant_id>/share-networks

Accept: application/json


JSON 响应

{
    "share_networks": [
       {
           "id": "%share_network_id%",
           "name": "private",
           "status": null
       }
   ]
}
列出带有详细信息的共享网络

GET /v1/<tenant_id>/share-networks/detail

Accept: application/json


JSON 响应

{
    "share_networks": [
        {
            "status": null,
            "name": "private",
            "segmentation_id": null,
            "created_at": "2014-05-30T17:14:24.000000",
            "neutron_subnet_id": "%neutron_subnet_id%",
            "updated_at": null,
            "network_type": null,
            "neutron_net_id": "%neutron_net_id%",
            "ip_version": null,
            "cidr": null,
            "project_id": "%project_id%",
            "id": "%share_network_id%",
            "description": null
        }
    ]
}
显示共享网络

GET /v1/<tenant_id>/share-networks/<share_network_id>

Accept: application/json

JSON 响应

{
    "share_network":
       {
           "id": "%share_network_id%",
           "name": "private",
           "status": null
           "segmentation_id": null,
           "created_at": "2014-05-30T17:14:24.000000",
           "neutron_subnet_id": "neutron_subnet_id",
           "updated_at": null,
           "network_type": null,
           "neutron_net_id": "%neutron_net_id%",
           "ip_version": null,
           "cidr": null,
           "project_id": "%project_id%",
           "description": null
       }
}
更新共享网络

PUT /v1/<tenant_id>/share-networks/<share_network_id>

Accept: application/json

JSON 请求

{
    "share_network": {
       "description": "newdesc",
       "name": "newname"
   }
}

JSON 响应

{
    "share_network": {
        "status": null,
        "name": "newname",
        "segmentation_id": null,
        "created_at": "2014-05-30T17:56:55.000000",
        "neutron_subnet_id": null,
        "updated_at": "2014-05-30T17:57:07.000000",
        "network_type": null,
        "neutron_net_id": null,
        "ip_version": null, "cidr": null,
        "project_id": "%project_id%",
        "id": "%share_network_id%",
        "description": "newdesc"
    }
}
删除共享网络

DELETE /v1/<tenant_id>/share-networks/<share_network_id>

将安全服务添加到共享网络

POST /v1/<tenant_id>/share-networks/<share_network_id>/action

Accept: application/json

JSON 请求

{
    "add_security_service": {
        "security_service_id": "%security_service_id%"
    }
}

JSON 响应

{
    "share_network": {
        "status": null,
        "name": "test",
        "segmentation_id": null,
        "created_at": "2014-06-02T13:57:48.000000",
        "neutron_subnet_id": null,
        "updated_at": null,
        "network_type": null,
        "neutron_net_id": null,
        "ip_version": null,
        "cidr": null, 
        "project_id": "%project_id%",
        "id": "%share_network_id%",
        "description": null
     }
}
从共享网络中删除安全服务

POST /v1/<tenant_id>/share-networks/<share_network_id>/action

Accept: application/json

JSON 请求

{
    "remove_security_service": {
        "security_service_id": "%security_service_id%"
    }
}

JSON 响应

{
    "share_network": {
        "status": null,
        "name": "test",
        "segmentation_id": null,
        "created_at": "2014-06-02T13:57:48.000000",
        "neutron_subnet_id": null,
        "updated_at": null,
        "network_type": null,
        "neutron_net_id": null,
        "ip_version": null,
        "cidr": null, 
        "project_id": "%project_id%",
        "id": "%share_network_id%",
        "description": null
     }
}

安全服务

创建安全服务

POST /v1/<tenant_id>/security-services

Content-Type: application/json

Accept: application/json


JSON 请求

{
    "security_service": {
        "domain": "domain",
        "name": "name",
        "dns_ip": "dns-ip",
        "sid": "security",
        "password": "password",
        "type": "ldap",
        "description": "description"
    }
}

JSON 响应

{
    "security_service": {
        "status": "NEW",
        "domain": "domain",
        "description": "description",
        "dns_ip": "dns-ip",
        "updated_at": null,
        "password": "password",
        "id": "%security_service_id%",
        "name": "name",
        "created_at": "2014-06-02T08:45:53.685967",
        "server": null,
        "sid": "security",
        "project_id": "%project_id%",
        "type": "ldap"
    }
}
列出安全服务

GET /v1/<tenant_id>/security-services

Accept: application/json


JSON 响应

{
    "security_services": [
        {
            "status": "NEW",
            "type": "ldap",
            "id": "%security_service_id%",
            "name": "name"
        }
    ]
}
列出带有详细信息的安全服务

GET /v1/<tenant_id>/security-services/detail

Accept: application/json


JSON 响应

{
    "security_services": [
        {
            "status": "NEW",
            "domain": "domain",
            "description": "description",
            "dns_ip": "dns-ip",
            "updated_at": null,
            "password": "password",
            "id": "%security_service_id%",
            "name": "name",
            "created_at": "2014-06-02T08:45:53.000000",
            "server": null,
            "sid": "security",
            "project_id": "%project_id%",
            "type": "ldap"
        }
    ]
}
列出共享网络的安全服务

GET /v1/<tenant_id>/security-services?share_network_id=%share_network_id%

Accept: application/json

JSON 响应

{
    "security_services": [
        {
            "status": "NEW",
            "type": "ldap",
            "id": "%security_service_id%",
            "name": "name"
        }
    ]
}
显示安全服务

GET /v1/<tenant_id>/security-services/<security_service_id>

Accept: application/json

JSON 响应

{
    "security_service": {
        "status": "NEW",
        "domain": "domain",
        "description": "description",
        "dns_ip": "dns-ip",
        "updated_at": null,
        "password": "password",
        "id": "%security_service_id%",
        "name": "name",
        "created_at": "2014-06-02T08:45:53.000000",
        "server": null,
        "sid": "security",
        "project_id": "%project_id%",
        "type": "ldap"
    }
}
更新安全服务

PUT /v1/<tenant_id>/security-services/<security_service_id>

Accept: application/json

JSON 请求

{
    "security_service": {
        "domain": "newdomain",
        "description": "newdescription",
        "dns_ip": "newdns-ip",
        "sid": "newsecurity",
        "password": "newpassword",
        "name": "newname"
    }
}

JSON 响应

{
    "security_service": {
        "status": "NEW",
        "domain": "newdomain",
        "description": "newdescription",
        "dns_ip": "newdns-ip",
        "updated_at": "2014-06-02T08:55:25.809860",
        "password": "newpassword",
        "id": "%security_service_id%",
        "name": "newname",
        "created_at": "2014-06-02T08:45:53.000000",
        "server": null,
        "sid": "newsecurity",
        "project_id": "%project_id%",
        "type": "ldap"
    }
}
删除安全服务

DELETE /v1/<tenant_id>/security-services/<security_service_id>

共享服务器

列出共享服务器

GET /v1/<tenant_id>/share-servers

Accept: application/json

JSON 响应

{
    "share_servers": [
        {
            "status": "ACTIVE",
            "updated_at": "2014-06-03T13:52:04.000000",
            "share_network_name": "private",
            "host": "localhost@paris",
            "project_id": "%project_id%",
            "id": "e9a6fa06-833f-4ab6-aa20-5d5abf8737c5"
        }
    ]
}
显示共享服务器

GET /v1/<tenant_id>/share-server/<share_server_id>

Accept: application/json

JSON 响应

{
    "share_server": {
        "status": "ACTIVE",
        "backend_details": {
            "instance_id": "%instance_id%",
            "ip": "10.254.0.3",
            "username": "ubuntu",
            "password": "ubuntu",
            "pk_path": "/home/stack/.ssh/manila-service0ce582d2-671e-4286-af25-74f8f40fe4d6"
        },
        "created_at": "2014-06-03T13:49:10.000000",
        "updated_at": "2014-06-03T13:52:04.000000",
        "share_network_name": "private",
        "host": "localhost@paris",
        "project_id": "%project_id%",
        "id": "%share_server_id%"
    }
}
显示共享服务器的详细信息

GET /v1/<tenant_id>/share-server/<share_server_id>/details

Accept: application/json

JSON 响应

{
    "details": {
        "instance_id": "%instance_id%",
        "ip": "10.254.0.3",
        "username": "ubuntu",
        "password": "ubuntu",
        "pk_path": "/home/stack/.ssh/manila-service0ce582d2-671e-4286-af25-74f8f40fe4d6"
    }
}

限制

列出限制

GET /v1/<tenant_id>/limits

Content-Type: application/json

Accept: application/json

JSON 响应

{
    "limits": {
        "rate": [],
        "absolute": {
            "totalShareNetworksUsed": 3,
            "maxTotalShareGigabytes": 1000,
            "maxTotalShareNetworks": 5,
            "totalSharesUsed": 10,
            "totalShareGigabytesUsed": 11,
            "totalShareSnapshotsUsed": 1,
            "maxTotalShares": 10,
            "maxTotalShareSnapshots": 10
        }
    }
}

扩展

列出扩展

GET /v1/<tenant_id>/extensions

Content-Type: application/json

Accept: application/json

JSON 响应

{
    "extensions": [
        {
            "updated": "2013-06-09T00:00:00+00:00",
            "name": "ExtendedQuotas",
            "links": [],
            "namespace": "https://docs.openstack.org/compute/ext/extended_quotas/api/v1.1",
            "alias": "os-extended-quotas",
            "description": "Adds ability for admins to delete quota\n    and optionally force the update Quota command.\n    "
        },
        {
            "updated": "2012-03-12T00:00:00+00:00",
            "name": "QuotaClasses",
            "links": [],
            "namespace": "https://docs.openstack.org/volume/ext/quota-classes-sets/api/v1.1",
            "alias": "os-quota-class-sets",
            "description": "Quota classes management support"
        },
        {
            "updated": "2011-08-08T00:00:00+00:00",
            "name": "Quotas",
            "links": [], 
            "namespace": "https://docs.openstack.org/compute/ext/quotas-sets/api/v1.1",
            "alias": "os-quota-sets",
            "description": "Quotas management support"
        },
        {
            "updated": "2011-08-24T00:00:00+00:00",
            "name": "TypesManage",
            "links": [],
            "namespace": "https://docs.openstack.org/share/ext/types-manage/api/v1",
            "alias": "os-types-manage",
            "description": "Types manage support."
        },
        {
            "updated": "2013-07-18T00:00:00+00:00",
            "name": "UserQuotas",
            "links": [],
            "namespace": "https://docs.openstack.org/compute/ext/user_quotas/api/v1.1",
            "alias": "os-user-quotas",
            "description": "Project user quota support."
        },
        {
            "updated": "2012-08-14T00:00:00+00:00",
            "name": "ShareActions",
            "links": [],
            "namespace": "",
            "alias": "share-actions",
            "description": "Enable share actions."
        },
        {
            "updated": "2011-08-24T00:00:00+00:00",
            "name": "TypesExtraSpecs",
            "links": [],
            "namespace": "https://docs.openstack.org/share/ext/types-extra-specs/api/v1",
            "alias": "os-types-extra-specs",
            "description": "Type extra specs support."
        },
        {
            "updated": "2012-08-25T00:00:00+00:00",
            "name": "AdminActions",
            "links": [],
            "namespace": "https://docs.openstack.org/share/ext/admin-actions/api/v1.1",
            "alias": "os-admin-actions",
            "description": "Enable admin actions."
        },
        {
            "updated": "2012-10-28T00:00:00-00:00",
            "name": "Services",
            "links": [],
            "namespace": "https://docs.openstack.org/volume/ext/services/api/v2",
            "alias": "os-services",
            "description": "Services support"
        },
        {
            "updated": "2014-03-27T00:00:00+00:00",
            "name": "UsedLimits", 
            "links": [],
            "namespace": "https://docs.openstack.org/share/ext/used-limits/api/v1.0",
            "alias": "os-used-limits",
            "description": "Provide data on limited resources that are being used."
        }
    ]
}

服务

列出服务

GET /v1/<tenant_id>/os-services

Content-Type: application/json

Accept: application/json

JSON 响应

{
    "services": [
        {
            "status": "enabled",
            "binary": "manila-scheduler",
            "zone": "nova",
            "state": "up",
            "updated_at": "2014-06-02T14:57:52.000000",
            "host": "nosb-devstack"
        },
        {
            "status": "enabled",
            "binary": "manila-share", 
            "zone": "nova", 
            "state": "up", 
            "updated_at": "2014-06-02T14:57:52.000000", 
            "host": "nosb-devstack@paris"
        },
        {"status": "enabled", 
            "binary": "manila-share", 
            "zone": "nova", 
            "state": "up", 
            "updated_at": "2014-06-02T14:57:47.000000", 
            "host": "nosb-devstack@london"
        }
    ]
}
使用过滤器列出服务

GET /v1/<tenant_id>/os-services?status=enabled&binary=manila-share&host=nosb-devstack%40london&state=up&zone=nova

Content-Type: application/json

Accept: application/json

JSON 响应

{
    "services": [
        {
            "status": "enabled", 
            "binary": "manila-share", 
            "zone": "nova", 
            "state": "up", 
            "updated_at": "2014-06-02T14:57:47.000000", 
            "host": "nosb-devstack@london"
        }
    ]
}

卷类型

创建卷类型

POST /v1/<tenant_id>/types/%volume_type_id%

Content-Type: application/json

Accept: application/json

JSON 请求

{
   "volume_type": {
       "name": "test",
   }
}

JSON 响应

{
    "volume_type": {
        "extra_specs": {},
        "name": "test",
        "id": "%volume_type_id%"
    }
}
为卷类型设置键

POST /v1/<tenant_id>/types/%volume_type_id%/extra_specs

Content-Type: application/json

Accept: application/json

JSON 请求

{
    "extra_specs": {
        "k": "v"
    }
}

JSON 响应

{
    "extra_specs": {
        "k": "v"
    }
}
取消设置卷类型的键

DELETE /v1/<tenant_id>/types/%volume_type_id%/extra_specs/%key%

Content-Type: application/json

Accept: application/json

JSON 请求

{
    "extra_specs": {
        "k": "v"
    }
}

JSON 响应为空

列出卷类型

GET /v1/<tenant_id>/types

Content-Type: application/json

Accept: application/json

JSON 响应

{
    "volume_types": [
        {
            "extra_specs": {"q": "w"},
            "name": "test",
            "id": "%volume_type_id%"
        }, 
    ]
}
列出卷类型的额外规格

GET /v1/<tenant_id>/types/<volume_type_id>/extra_specs

Content-Type: application/json

Accept: application/json

JSON 响应

{
    "extra_specs": {
        "share_backend_name": "TEST_BACKEND"
    }
}
删除卷类型

DELETE /v1/<tenant_id>/types/<volume_type_id>