Merge "Include project_id only where needed"

This commit is contained in:
Jenkins 2017-03-21 13:03:14 +00:00 committed by Gerrit Code Review
commit 3d5677c92b
3 changed files with 12 additions and 9 deletions

View File

@ -61,6 +61,9 @@ DefinitionLinks = {
# such that a resource can not be created with these in request body.
blacklisted_create_properties = ["id", "created_at", "updated_at"]
# Blacklisted create properties with project_id addition
blacklisted_with_project_id = blacklisted_create_properties + ["project_id"]
def _remove_properties(properties, remove_list):
props = copy.copy(properties)
@ -181,7 +184,7 @@ DefinitionHostCreate = {
"type": "object",
"additionalProperties": False,
"properties": _remove_properties(HostProperties,
blacklisted_create_properties),
blacklisted_with_project_id),
}
CellProperties = {
@ -239,7 +242,7 @@ DefinitionsCellCreate = {
"type": "object",
"additionalProperties": False,
"properties": _remove_properties(CellProperties,
blacklisted_create_properties),
blacklisted_with_project_id),
}
RegionProperties = {
@ -299,7 +302,7 @@ DefinitionsRegionCreate = {
"type": "object",
"additionalProperties": False,
"properties": _remove_properties(RegionProperties,
blacklisted_create_properties),
blacklisted_with_project_id),
}
CloudProperties = {
@ -354,7 +357,7 @@ DefinitionsCloudCreate = {
"type": "object",
"additionalProperties": False,
"properties": _remove_properties(CloudProperties,
blacklisted_create_properties),
blacklisted_with_project_id),
}
UserProperties = {
@ -510,7 +513,7 @@ DefinitionNetworkCreate = {
"type": "object",
"additionalProperties": False,
"properties": _remove_properties(NetworkProperties,
blacklisted_create_properties),
blacklisted_with_project_id),
}
@ -600,7 +603,7 @@ DefinitionNetworkInterfaceCreate = {
"type": "object",
"additionalProperties": False,
"properties": _remove_properties(NetworkInterfaceProperties,
blacklisted_create_properties),
blacklisted_with_project_id),
}
NetworkDeviceProperties = {
@ -692,7 +695,7 @@ DefinitionNetworkDeviceCreate = {
"type": "object",
"additionalProperties": False,
"properties": _remove_properties(NetworkDeviceProperties,
blacklisted_create_properties),
blacklisted_with_project_id),
}
DefinitionNoParams = {

View File

@ -182,7 +182,7 @@ Create a Region
* To create region, execute the following command::
# curl -i "http://${MY_IP}:7780/v1/regions" \
-d '{"name": "DFW", "project_id": "717e9a216e2d44e0bc848398563bda06", "cloud_id": 1}' \
-d '{"name": "DFW", "cloud_id": 1}' \
-H "Content-Type: application/json" \
-H "X-Auth-Token: demo" \
-H "X-Auth-User: demo" \

View File

@ -58,7 +58,7 @@ Example Host Create
.. code-block:: bash
curl -i "http://${MY_IP}:7780/v1/hosts" \
-d '{"name": "fooHost", "region_id": 1, "ip_address": "11.11.11.14", "device_type": "Phone", "project_id": "717e9a216e2d44e0bc848398563bda06"}' \
-d '{"name": "fooHost", "region_id": 1, "ip_address": "11.11.11.14", "device_type": "Phone"}' \
-H "Content-Type: application/json" \
-H "X-Auth-Token: demo" \
-H "X-Auth-User: demo" \