diff --git a/craton/api/v1/schemas.py b/craton/api/v1/schemas.py index 549feac..a6b194b 100644 --- a/craton/api/v1/schemas.py +++ b/craton/api/v1/schemas.py @@ -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 = { diff --git a/doc/source/dev/install.rst b/doc/source/dev/install.rst index ff51f7b..dffd884 100755 --- a/doc/source/dev/install.rst +++ b/doc/source/dev/install.rst @@ -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" \ diff --git a/doc/source/hosts.rst b/doc/source/hosts.rst index 80a96af..8783a05 100644 --- a/doc/source/hosts.rst +++ b/doc/source/hosts.rst @@ -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" \