From 2813c837f63f27c7dd7d3c7ef12392df7ae8906e Mon Sep 17 00:00:00 2001 From: Kevin_Zheng Date: Wed, 11 May 2016 10:37:17 +0800 Subject: [PATCH] api-ref: parameter verification for os-quota-sets checked parameters Part of bp:api-ref-in-rst Change-Id: I0c43e83214aa4a0a54d553ab5c2ef79413753664 --- api-ref/source/os-quota-sets.inc | 99 ++++++++--------- api-ref/source/parameters.yaml | 180 ++++++++++++++++++++++++++----- 2 files changed, 198 insertions(+), 81 deletions(-) diff --git a/api-ref/source/os-quota-sets.inc b/api-ref/source/os-quota-sets.inc index 68ca0bc2a68f..53e392570933 100644 --- a/api-ref/source/os-quota-sets.inc +++ b/api-ref/source/os-quota-sets.inc @@ -1,5 +1,4 @@ .. -*- rst -*- -.. needs:parameter_verification .. needs:example_verification .. needs:body_verification @@ -33,6 +32,7 @@ Request - admin_tenant_id: admin_tenant_id - tenant_id: tenant_id + - user_id: user_id_query_quota Response -------- @@ -41,9 +41,9 @@ Response - quota_set: quota_set - cores: cores - - fixed_ips: fixed_ips + - fixed_ips: fixed_ips_quota - floating_ips: floating_ips - - id: id + - id: quota_tenant_or_user_id_body - injected_file_content_bytes: injected_file_content_bytes - injected_file_path_bytes: injected_file_path_bytes - injected_files: injected_files @@ -51,8 +51,8 @@ Response - key_pairs: key_pairs - metadata_items: metadata_items - ram: ram - - security_group_rules: security_group_rules - - security_groups: security_groups + - security_group_rules: security_group_rules_quota + - security_groups: security_groups_quota - server_groups: server_groups - server_group_members: server_group_members @@ -85,30 +85,23 @@ Request - admin_tenant_id: admin_tenant_id - tenant_id: tenant_id + - user_id: user_id_query_set_quota - quota_set: quota_set - force: force - - cores: cores - - fixed_ips: fixed_ips - - floating_ips: floating_ips - - id: id - - injected_file_content_bytes: injected_file_content_bytes - - injected_file_path_bytes: injected_file_path_bytes - - injected_files: injected_files - - instances: instances - - key_pairs: key_pairs - - metadata_items: metadata_items - - ram: ram + - cores: cores_quota_optional + - fixed_ips: fixed_ips_quota_optional + - floating_ips: floating_ips_quota_optional + - injected_file_content_bytes: injected_file_content_bytes_quota_optional + - injected_file_path_bytes: injected_file_path_bytes_quota_optional + - injected_files: injected_files_quota_optional + - instances: instances_quota_optional + - key_pairs: key_pairs_quota_optional + - metadata_items: metadata_items_quota_optional + - ram: ram_quota_optional - security_group_rules: security_group_rules - - security_groups: security_groups - - server_groups: server_groups - - server_group_members: server_group_members - -Query Parameters -~~~~~~~~~~~~~~~~ - -.. rest_parameters:: parameters.yaml - - - user_id: user_id + - security_groups: security_groups_quota_optional + - server_groups: server_groups_quota_optional + - server_group_members: server_group_members_quota_optional **Example Update Quotas: JSON request** @@ -122,9 +115,8 @@ Response - quota_set: quota_set - cores: cores - - fixed_ips: fixed_ips + - fixed_ips: fixed_ips_quota - floating_ips: floating_ips - - id: id - injected_file_content_bytes: injected_file_content_bytes - injected_file_path_bytes: injected_file_path_bytes - injected_files: injected_files @@ -132,8 +124,8 @@ Response - key_pairs: key_pairs - metadata_items: metadata_items - ram: ram - - security_group_rules: security_group_rules - - security_groups: security_groups + - security_group_rules: security_group_rules_quota + - security_groups: security_groups_quota - server_groups: server_groups - server_group_members: server_group_members @@ -162,13 +154,7 @@ Request - admin_tenant_id: admin_tenant_id - tenant_id: tenant_id - -Query Parameters -~~~~~~~~~~~~~~~~ - -.. rest_parameters:: parameters.yaml - - - user_id: user_id + - user_id: user_id_query_quota_delete Response -------- @@ -201,9 +187,9 @@ Response - quota_set: quota_set - cores: cores - - fixed_ips: fixed_ips + - fixed_ips: fixed_ips_quota - floating_ips: floating_ips - - id: id + - id: quota_tenant_or_user_id_body - injected_file_content_bytes: injected_file_content_bytes - injected_file_path_bytes: injected_file_path_bytes - injected_files: injected_files @@ -211,8 +197,8 @@ Response - key_pairs: key_pairs - metadata_items: metadata_items - ram: ram - - security_group_rules: security_group_rules - - security_groups: security_groups + - security_group_rules: security_group_rules_quota + - security_groups: security_groups_quota - server_groups: server_groups - server_group_members: server_group_members @@ -243,6 +229,7 @@ Request - admin_tenant_id: admin_tenant_id - tenant_id: tenant_id + - user_id: user_id_query_quota Response -------- @@ -250,21 +237,21 @@ Response .. rest_parameters:: parameters.yaml - quota_set: quota_set - - cores: cores - - fixed_ips: fixed_ips - - floating_ips: floating_ips - - id: id - - injected_file_content_bytes: injected_file_content_bytes - - injected_file_path_bytes: injected_file_path_bytes - - injected_files: injected_files - - instances: instances - - key_pairs: key_pairs - - metadata_items: metadata_items - - ram: ram - - security_group_rules: security_group_rules - - security_groups: security_groups - - server_groups: server_groups - - server_group_members: server_group_members + - cores: cores_quota_details + - fixed_ips: fixed_ips_quota_details + - floating_ips: floating_ips_quota_details + - id: quota_tenant_or_user_id_body + - injected_file_content_bytes: injected_file_content_bytes_quota_details + - injected_file_path_bytes: injected_file_path_bytes_quota_details + - injected_files: injected_files_quota_details + - instances: instances_quota_details + - key_pairs: key_pairs_quota_details + - metadata_items: metadata_items_quota_details + - ram: ram_quota_details + - security_group_rules: security_group_rules_quota_details + - security_groups: security_groups_quota_details + - server_groups: server_groups_quota_details + - server_group_members: server_group_members_quota_details **Example Show A Quota: JSON response** diff --git a/api-ref/source/parameters.yaml b/api-ref/source/parameters.yaml index e883e82f0c1c..4fcb875c3069 100644 --- a/api-ref/source/parameters.yaml +++ b/api-ref/source/parameters.yaml @@ -552,6 +552,24 @@ user_id_1: in: query required: false type: string +user_id_query_quota: + description: | + ID of user to list the quotas for. + in: query + required: false + type: string +user_id_query_quota_delete: + description: | + ID of user to delete quotas for. + in: query + required: false + type: string +user_id_query_set_quota: + description: | + ID of user to set the quotas for. + in: query + required: false + type: string # variables in body accessIPv4: @@ -791,7 +809,14 @@ cores: in: body required: true type: integer -cores_1: +cores_quota_details: + description: | + The object of detailed cores quota, including in_use, limit and + reserved number of cores. + in: body + required: true + type: object +cores_quota_optional: description: | The number of allowed instance cores for each tenant. in: body @@ -1006,14 +1031,21 @@ fixed_ips_1: in: body required: true type: array -fixed_ips_2: +fixed_ips_quota: description: | The number of allowed fixed IP addresses for each tenant. Must be equal to or greater than the number of allowed instances. in: body required: true type: integer -fixed_ips_3: +fixed_ips_quota_details: + description: | + The object of detailed fixed ips quota, including in_use, limit and + reserved number of fixed ips. + in: body + required: true + type: object +fixed_ips_quota_optional: description: | The number of allowed fixed IP addresses for each tenant. Must be equal to or greater than the number of allowed instances. @@ -1051,7 +1083,14 @@ floating_ips: in: body required: true type: integer -floating_ips_1: +floating_ips_quota_details: + description: | + The object of detailed floating ips quota, including in_use, limit and + reserved number of floating ips. + in: body + required: true + type: object +floating_ips_quota_optional: description: | The number of allowed floating IP addresses for each tenant. in: body @@ -1305,7 +1344,15 @@ injected_file_content_bytes: in: body required: true type: integer -injected_file_content_bytes_1: +injected_file_content_bytes_quota_details: + description: | + The object of detailed injected file content bytes quota, + including in_use, limit and reserved number of injected + file content bytes. + in: body + required: true + type: object +injected_file_content_bytes_quota_optional: description: | The number of allowed bytes of content for each injected file. in: body @@ -1317,7 +1364,15 @@ injected_file_path_bytes: in: body required: true type: integer -injected_file_path_bytes_1: +injected_file_path_bytes_quota_details: + description: | + The object of detailed injected file path bytes quota, + including in_use, limit and reserved number of injected + file path bytes. + in: body + required: true + type: object +injected_file_path_bytes_quota_optional: description: | The number of allowed bytes for each injected file path. in: body @@ -1329,7 +1384,14 @@ injected_files: in: body required: true type: integer -injected_files_1: +injected_files_quota_details: + description: | + The object of detailed injected files quota, including in_use, limit and + reserved number of injected files. + in: body + required: true + type: object +injected_files_quota_optional: description: | The number of allowed injected files for each tenant. in: body @@ -1347,7 +1409,14 @@ instances: in: body required: true type: integer -instances_1: +instances_quota_details: + description: | + The object of detailed instances quota, including in_use, limit and + reserved number of instances. + in: body + required: true + type: object +instances_quota_optional: description: | The number of allowed instances for each tenant. in: body @@ -1402,7 +1471,14 @@ key_pairs: in: body required: true type: integer -key_pairs_1: +key_pairs_quota_details: + description: | + The object of detailed key pairs quota, including in_use, limit and + reserved number of key pairs. + in: body + required: true + type: object +key_pairs_quota_optional: description: | The number of allowed key pairs for each user. in: body @@ -1499,7 +1575,14 @@ metadata_items: in: body required: true type: integer -metadata_items_1: +metadata_items_quota_details: + description: | + The object of detailed key metadata items quota, including in_use, + limit and reserved number of metadata items. + in: body + required: true + type: object +metadata_items_quota_optional: description: | The number of allowed metadata items for each instance. in: body @@ -1912,13 +1995,26 @@ quota_set: in: body required: true type: string +quota_tenant_or_user_id_body: + description: | + The UUID of the tenant/user the quotas listed for. + in: body + required: true + type: string ram: description: | The amount of allowed instance RAM, in MB, for each tenant. in: body required: true type: integer -ram_1: +ram_quota_details: + description: | + The object of detailed key ram quota, including in_use, + limit and reserved number of ram. + in: body + required: true + type: object +ram_quota_optional: description: | The amount of allowed instance RAM, in MB, for each tenant. in: body @@ -2077,6 +2173,19 @@ security_group_rules: in: body required: false type: integer +security_group_rules_quota: + description: | + The number of allowed rules for each security group. + in: body + required: true + type: integer +security_group_rules_quota_details: + description: | + The object of detailed security group rules quota, including in_use, + limit and reserved number of security group rules. + in: body + required: true + type: object security_groups: description: | One or more security groups. Specify the name of the security group in the ``name`` @@ -2085,24 +2194,31 @@ security_groups: in: body required: false type: array -security_groups_1: - description: | - The number of allowed security groups for each tenant. - in: body - required: true - type: integer -security_groups_3: - description: | - The number of allowed security groups for each tenant. - in: body - required: false - type: integer security_groups_obj: description: | Security groups object. in: body required: true type: array +security_groups_quota: + description: | + The number of allowed security groups for each tenant. + in: body + required: true + type: integer +security_groups_quota_details: + description: | + The object of detailed security groups, including in_use, + limit and reserved number of security groups. + in: body + required: true + type: object +security_groups_quota_optional: + description: | + The number of allowed security groups for each tenant. + in: body + required: false + type: integer server: description: | server. @@ -2130,7 +2246,14 @@ server_group_members: in: body required: true type: integer -server_group_members_1: +server_group_members_quota_details: + description: | + The object of detailed server group members, including in_use, + limit and reserved number of server group members. + in: body + required: true + type: object +server_group_members_quota_optional: description: | The number of allowed members for each server group. in: body @@ -2148,7 +2271,14 @@ server_groups_1: in: body required: true type: array -server_groups_2: +server_groups_quota_details: + description: | + The object of detailed server groups, including in_use, + limit and reserved number of server groups. + in: body + required: true + type: object +server_groups_quota_optional: description: | The number of allowed server groups for each tenant. in: body