Add 'networks' quota in quota sample files

'networks' quota can be available based on config value.
api-ref should show that for quota-set APIs and also sample files
so that it can be tested somewhere.

Also adding it to quota class APIs sample files also.
Closes-Bug: #1702201

Change-Id: I84d562a8ca10826dea4675d74669b5de64ff0ed0
This commit is contained in:
ghanshyam 2017-06-30 12:31:29 +03:00 committed by Ghanshyam Mann
parent b25b66e284
commit e332797e42
24 changed files with 64 additions and 22 deletions

View File

@ -51,6 +51,7 @@ Response
- security_groups: security_groups_quota - security_groups: security_groups_quota
- server_groups: server_groups - server_groups: server_groups
- server_group_members: server_group_members - server_group_members: server_group_members
- networks: networks_quota_set_optional
**Example Show A Quota: JSON response** **Example Show A Quota: JSON response**
@ -99,6 +100,7 @@ Request
- security_groups: security_groups_quota_optional - security_groups: security_groups_quota_optional
- server_groups: server_groups_quota_optional - server_groups: server_groups_quota_optional
- server_group_members: server_group_members_quota_optional - server_group_members: server_group_members_quota_optional
- networks: networks_quota_set_optional
**Example Update Quotas: JSON request** **Example Update Quotas: JSON request**
@ -130,6 +132,7 @@ Response
- security_groups: security_groups_quota - security_groups: security_groups_quota
- server_groups: server_groups - server_groups: server_groups
- server_group_members: server_group_members - server_group_members: server_group_members
- networks: networks_quota_set_optional
**Example Update Quotas: JSON response** **Example Update Quotas: JSON response**
@ -203,6 +206,7 @@ Response
- security_groups: security_groups_quota - security_groups: security_groups_quota
- server_groups: server_groups - server_groups: server_groups
- server_group_members: server_group_members - server_group_members: server_group_members
- networks: networks_quota_set_optional
**Example List Default Quotas For Tenant: JSON response** **Example List Default Quotas For Tenant: JSON response**
@ -254,6 +258,7 @@ Response
- security_groups: security_groups_quota_details - security_groups: security_groups_quota_details
- server_groups: server_groups_quota_details - server_groups: server_groups_quota_details
- server_group_members: server_group_members_quota_details - server_group_members: server_group_members_quota_details
- networks: networks_quota_set_optional
**Example Show A Quota: JSON response** **Example Show A Quota: JSON response**

View File

@ -3807,12 +3807,15 @@ networks:
in: body in: body
required: true required: true
type: object type: object
networks_quota_optional: networks_quota_optional: &networks_quota_optional
description: | description: |
The number of private networks that can be created per project. The number of private networks that can be created per project.
in: body in: body
required: false required: false
type: integer type: integer
networks_quota_set_optional:
<<: *networks_quota_optional
max_version: 2.35
new_file: new_file:
description: | description: |
The name of the qcow2 file that Block Storage creates, which becomes the active The name of the qcow2 file that Block Storage creates, which becomes the active

View File

@ -12,6 +12,7 @@
"metadata_items": 128, "metadata_items": 128,
"ram": 51200, "ram": 51200,
"security_group_rules": 20, "security_group_rules": 20,
"security_groups": 10 "security_groups": 10,
"networks": 3
} }
} }

View File

@ -11,6 +11,7 @@
"injected_file_path_bytes": 255, "injected_file_path_bytes": 255,
"security_groups": 10, "security_groups": 10,
"security_group_rules": 20, "security_group_rules": 20,
"key_pairs": 100 "key_pairs": 100,
"networks": 3
} }
} }

View File

@ -11,6 +11,7 @@
"metadata_items": 128, "metadata_items": 128,
"ram": 51200, "ram": 51200,
"security_group_rules": 20, "security_group_rules": 20,
"security_groups": 10 "security_groups": 10,
"networks": 3
} }
} }

View File

@ -14,6 +14,7 @@
"security_group_rules": 20, "security_group_rules": 20,
"security_groups": 10, "security_groups": 10,
"server_groups": 10, "server_groups": 10,
"server_group_members": 10 "server_group_members": 10,
"networks": 3
} }
} }

View File

@ -70,6 +70,11 @@
"in_use": 0, "in_use": 0,
"limit": 10, "limit": 10,
"reserved": 0 "reserved": 0
},
"networks": {
"in_use": 2,
"limit": 3,
"reserved": 0
} }
} }
} }

View File

@ -14,6 +14,7 @@
"security_group_rules": 20, "security_group_rules": 20,
"security_groups": 10, "security_groups": 10,
"server_groups": 10, "server_groups": 10,
"server_group_members": 10 "server_group_members": 10,
"networks": 3
} }
} }

View File

@ -13,6 +13,7 @@
"security_group_rules": 20, "security_group_rules": 20,
"security_groups": 10, "security_groups": 10,
"server_groups": 10, "server_groups": 10,
"server_group_members": 10 "server_group_members": 10,
"networks": 3
} }
} }

View File

@ -13,6 +13,7 @@
"security_group_rules": 20, "security_group_rules": 20,
"security_groups": 45, "security_groups": 45,
"server_groups": 10, "server_groups": 10,
"server_group_members": 10 "server_group_members": 10,
"networks": 3
} }
} }

View File

@ -14,6 +14,7 @@
"security_group_rules": 20, "security_group_rules": 20,
"security_groups": 10, "security_groups": 10,
"server_groups": 10, "server_groups": 10,
"server_group_members": 10 "server_group_members": 10,
"networks": 3
} }
} }

View File

@ -13,6 +13,7 @@
"security_group_rules": 20, "security_group_rules": 20,
"security_groups": 10, "security_groups": 10,
"server_groups": 10, "server_groups": 10,
"server_group_members": 10 "server_group_members": 10,
"networks": 3
} }
} }

View File

@ -93,6 +93,11 @@ class ApiSampleTestBaseV21(testscenarios.WithScenarios,
# NOTE(danms): Disable base automatic DB (and cells) config # NOTE(danms): Disable base automatic DB (and cells) config
self.USES_DB = False self.USES_DB = False
self.USES_DB_SELF = True self.USES_DB_SELF = True
# This is to enable the network quota which is being registered
# based on CONF.enable_network_quota. Need this to test the
# network quota in quota sample tests.
self.flags(enable_network_quota=True)
self.useFixture(fixtures.RegisterNetworkQuota())
# super class call is delayed here so that we have the right # super class call is delayed here so that we have the right
# paste and conf before loading all the services, as we can't # paste and conf before loading all the services, as we can't

View File

@ -12,6 +12,7 @@
"metadata_items": 128, "metadata_items": 128,
"ram": 51200, "ram": 51200,
"security_group_rules": 20, "security_group_rules": 20,
"security_groups": 10 "security_groups": 10,
"networks": 3
} }
} }

View File

@ -11,6 +11,7 @@
"injected_file_path_bytes": 255, "injected_file_path_bytes": 255,
"security_groups": 10, "security_groups": 10,
"security_group_rules": 20, "security_group_rules": 20,
"key_pairs": 100 "key_pairs": 100,
"networks": 3
} }
} }

View File

@ -11,6 +11,7 @@
"metadata_items": 128, "metadata_items": 128,
"ram": 51200, "ram": 51200,
"security_group_rules": 20, "security_group_rules": 20,
"security_groups": 10 "security_groups": 10,
"networks": 3
} }
} }

View File

@ -14,6 +14,7 @@
"security_group_rules": 20, "security_group_rules": 20,
"security_groups": 10, "security_groups": 10,
"server_groups": 10, "server_groups": 10,
"server_group_members": 10 "server_group_members": 10,
"networks": 3
} }
} }

View File

@ -70,6 +70,11 @@
"in_use": 0, "in_use": 0,
"limit": 10, "limit": 10,
"reserved": 0 "reserved": 0
},
"networks": {
"in_use": 2,
"limit": 3,
"reserved": 0
} }
} }
} }

View File

@ -14,6 +14,7 @@
"security_group_rules": 20, "security_group_rules": 20,
"security_groups": 10, "security_groups": 10,
"server_groups": 10, "server_groups": 10,
"server_group_members": 10 "server_group_members": 10,
"networks": 3
} }
} }

View File

@ -13,6 +13,7 @@
"security_group_rules": 20, "security_group_rules": 20,
"security_groups": 10, "security_groups": 10,
"server_groups": 10, "server_groups": 10,
"server_group_members": 10 "server_group_members": 10,
"networks": 3
} }
} }

View File

@ -14,6 +14,7 @@
"security_groups": 10, "security_groups": 10,
"server_groups": 10, "server_groups": 10,
"server_group_members": 10, "server_group_members": 10,
"id": "fake_tenant" "id": "fake_tenant",
"networks": 3
} }
} }

View File

@ -13,6 +13,7 @@
"security_group_rules": 20, "security_group_rules": 20,
"security_groups": 45, "security_groups": 45,
"server_groups": 10, "server_groups": 10,
"server_group_members": 10 "server_group_members": 10,
"networks": 3
} }
} }

View File

@ -14,6 +14,7 @@
"security_group_rules": 20, "security_group_rules": 20,
"security_groups": 10, "security_groups": 10,
"server_groups": 10, "server_groups": 10,
"server_group_members": 10 "server_group_members": 10,
"networks": 3
} }
} }

View File

@ -13,6 +13,7 @@
"security_group_rules": 20, "security_group_rules": 20,
"security_groups": 10, "security_groups": 10,
"server_groups": 10, "server_groups": 10,
"server_group_members": 10 "server_group_members": 10,
"networks": 3
} }
} }