diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 64a0962f..06d7e0f2 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -81,7 +81,7 @@ that in this section. the client, so in the above case, you could get the list of foos with:: - curl http://0.0.0.0:6385/v1/foos + curl http://0.0.0.0:8585/v1/foos For doing something simple, like a poc controller that doesn't return any objects, you can return plain text as so:: diff --git a/INSTALL.rst b/INSTALL.rst index 41c23b18..06ab7579 100644 --- a/INSTALL.rst +++ b/INSTALL.rst @@ -74,7 +74,7 @@ output) with:: Then, launch the app and try curl to see if it works:: $ tuskar-api --config-file etc/tuskar/tuskar.conf - $ curl -v -X GET -H 'Accept: application/json' http://0.0.0.0:6385/v1/resource_classes/ | python -mjson.tool + $ curl -v -X GET -H 'Accept: application/json' http://0.0.0.0:8585/v1/resource_classes/ | python -mjson.tool Assuming this is your first time running with a new database, you should simply get '[]' back from curl above. Currently the api supports only diff --git a/docs/api/api.md b/docs/api/api.md index 01c8dc19..4a7bef84 100644 --- a/docs/api/api.md +++ b/docs/api/api.md @@ -118,7 +118,7 @@ The *service_type* attribute describe whether this ResourceClass is *storage* or { "id":1, "links":[ - { "href":"http://0.0.0.0:6385/v1/rack/1", + { "href":"http://0.0.0.0:8585/v1/rack/1", "rel":"self" } ] diff --git a/docs/api/curl.rst b/docs/api/curl.rst index 524e75ac..0c33dc21 100644 --- a/docs/api/curl.rst +++ b/docs/api/curl.rst @@ -38,7 +38,7 @@ create }], "slots": 1 } - ' http://0.0.0.0:6385/v1/racks + ' http://0.0.0.0:8585/v1/racks create with ResourceClass ~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -68,34 +68,34 @@ create with ResourceClass "id":1, "links":[ { - "href":"http://0.0.0.0:6385/v1/resource_clases/1", + "href":"http://0.0.0.0:8585/v1/resource_clases/1", "rel":"self" } ] } } - ' http://0.0.0.0:6385/v1/racks + ' http://0.0.0.0:8585/v1/racks delete ~~~~~~ :: - curl -vX DELETE http://localhost:6385/v1/racks/1 + curl -vX DELETE http://localhost:8585/v1/racks/1 update ~~~~~~ :: - curl -v -X PUT -H 'Content-Type: application/json' -H 'Accept: application/json' -v -d '{ "name": "new_name" }' http://0.0.0.0:6385/v1/racks/1 + curl -v -X PUT -H 'Content-Type: application/json' -H 'Accept: application/json' -v -d '{ "name": "new_name" }' http://0.0.0.0:8585/v1/racks/1 update (change nodes to Rack 1) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :: - curl -v -X PUT -H 'Content-Type: application/json' -H 'Accept: application/json' -v -d '{ "nodes": [ { "id": "1" }, { "id": "2"}] }' http://0.0.0.0:6385/v1/racks/1 + curl -v -X PUT -H 'Content-Type: application/json' -H 'Accept: application/json' -v -d '{ "nodes": [ { "id": "1" }, { "id": "2"}] }' http://0.0.0.0:8585/v1/racks/1 `back to top <#index>`_ @@ -132,7 +132,7 @@ create a new Flavor for a specific ResourceClass } ] }' - http://0.0.0.0:6385/v1/resource_classes/1/flavors`` + http://0.0.0.0:8585/v1/resource_classes/1/flavors`` Flavors can also be created as part of `ResourceClass create <#rc_with_flavors>`_ operation: @@ -141,14 +141,14 @@ get Flavor(s) for a particular ResourceClass :: - curl -H "Accept: application/xml" http://0.0.0.0:6385/v1/resource_classes/1/flavors(/2) + curl -H "Accept: application/xml" http://0.0.0.0:8585/v1/resource_classes/1/flavors(/2) delete a specific Flavor from a given ResourceClass ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :: - curl -X DELETE -H "Accept: application/xml" http://0.0.0.0:6385/v1/resource_classes/1/flavors/1 + curl -X DELETE -H "Accept: application/xml" http://0.0.0.0:8585/v1/resource_classes/1/flavors/1 update an existing Flavor in a specified ResourceClass ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -177,7 +177,7 @@ update an existing Flavor in a specified ResourceClass ], "max_vms": 9999, "name": "tiny_update" }' - http://0.0.0.0:6385/v1/resource_classes/1/flavors/3`` + http://0.0.0.0:8585/v1/resource_classes/1/flavors/3`` **NOTE:** The above operation can be performed to change only part of a given flavor - such as updating the name or max\_vms, or even a specific @@ -195,7 +195,7 @@ For example, to update the 'cpu' capacity and 'max\_vms': "unit" : "count" } ] }' - http://0.0.0.0:6385/v1/resource_classes/1/flavors/3`` + http://0.0.0.0:8585/v1/resource_classes/1/flavors/3`` `back to top <#index>`_ @@ -207,7 +207,7 @@ get a specific ResourceClass :: - curl -H 'Accept: application/json' http://0.0.0.0:6385/v1/resource_classes/1 + curl -H 'Accept: application/json' http://0.0.0.0:8585/v1/resource_classes/1 response ^^^^^^^^ @@ -223,7 +223,7 @@ response "id":1, "links":[ { - "href":"http://0.0.0.0:6385/v1/rack/1", + "href":"http://0.0.0.0:8585/v1/rack/1", "rel":"self" } ] @@ -231,7 +231,7 @@ response ], "links":[ { - "href":"http://0.0.0.0:6385/v1/resource_classes/11", + "href":"http://0.0.0.0:8585/v1/resource_classes/11", "rel":"self" } ] @@ -242,7 +242,7 @@ get collection :: - curl -H 'Accept: application/json' http://0.0.0.0:6385/v1/resource_classes + curl -H 'Accept: application/json' http://0.0.0.0:8585/v1/resource_classes create without Racks ~~~~~~~~~~~~~~~~~~~~ @@ -254,7 +254,7 @@ create without Racks "service_type": "compute", "name": "test-chassis" } - ' http://0.0.0.0:6385/v1/resource_classes + ' http://0.0.0.0:8585/v1/resource_classes create with Rack and Flavor definitions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -267,7 +267,7 @@ create with Rack and Flavor definitions "service_type":"compute", "racks": [ { "id":1, - "links":[{"href":"http://0.0.0.0:6385/v1/racks/1","rel":"self"}] + "links":[{"href":"http://0.0.0.0:8585/v1/racks/1","rel":"self"}] } ], "flavors": [ @@ -286,13 +286,13 @@ create with Rack and Flavor definitions } ] } - ' http://0.0.0.0:6385/v1/resource_classes + ' http://0.0.0.0:8585/v1/resource_classes **as a one-liner (copy/paste)** :: - curl -iX POST -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{"service_type": "compute_1","name": "test-chassis", "service_type":"compute","racks":[{"id":1,"links":[{"href":"http://0.0.0.0:6385/v1/racks/1","rel":"self"}]}], "flavors": [{"name" : "x-large", "capacities" : [ { "name": "cpu", "value" : "4", "unit" : "count" }, { "name": "memory", "value" : "8192", "unit" : "MiB" }, { "name": "storage", "value" : "1024", "unit" : "GiB" }]}]}' http://0.0.0.0:6385/v1/resource_classes + curl -iX POST -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{"service_type": "compute_1","name": "test-chassis", "service_type":"compute","racks":[{"id":1,"links":[{"href":"http://0.0.0.0:8585/v1/racks/1","rel":"self"}]}], "flavors": [{"name" : "x-large", "capacities" : [ { "name": "cpu", "value" : "4", "unit" : "count" }, { "name": "memory", "value" : "8192", "unit" : "MiB" }, { "name": "storage", "value" : "1024", "unit" : "GiB" }]}]}' http://0.0.0.0:8585/v1/resource_classes update ~~~~~~ @@ -311,21 +311,21 @@ the racks array attribute accordingly. "id": 1, "links": [ { - "href":"http://0.0.0.0:6385/v1/racks/1", + "href":"http://0.0.0.0:8585/v1/racks/1", "rel":"self" } ] } ] } - ' http://0.0.0.0:6385/v1/resource_classes/13`` + ' http://0.0.0.0:8585/v1/resource_classes/13`` delete ~~~~~~ :: - curl -X DELETE http://0.0.0.0:6385/v1/resource_classes/1`` `back to + curl -X DELETE http://0.0.0.0:8585/v1/resource_classes/1`` `back to top <#index>`_ @@ -340,6 +340,6 @@ Tuskar. :: - curl -XPOST -H 'Content-Type:application/json' -H 'Accept: application/json' http://0.0.0.0:6385/v1/data_centers/ + curl -XPOST -H 'Content-Type:application/json' -H 'Accept: application/json' http://0.0.0.0:8585/v1/data_centers/ `back to top <#index>`_ diff --git a/docs/demo-data-script.rst b/docs/demo-data-script.rst index edecd808..e69a7b00 100644 --- a/docs/demo-data-script.rst +++ b/docs/demo-data-script.rst @@ -56,7 +56,7 @@ Node only. ], "slots": 3 } - ' http://0.0.0.0:6385/v1/racks + ' http://0.0.0.0:8585/v1/racks curl -vX POST -H 'Content-Type: application/json' -H 'Accept: application/json' -v -d ' { @@ -82,7 +82,7 @@ Node only. ], "slots": 3 } - ' http://0.0.0.0:6385/v1/racks + ' http://0.0.0.0:8585/v1/racks curl -vX POST -H 'Content-Type: application/json' -H 'Accept: application/json' -v -d ' { @@ -101,7 +101,7 @@ Node only. }], "slots": 3 } - ' http://0.0.0.0:6385/v1/racks + ' http://0.0.0.0:8585/v1/racks Create Resource Classes ----------------------- @@ -118,11 +118,11 @@ and a total of six Nodes. The non-compute Resoure Class contains one Rack and o "racks": [ { "id":1, - "links":[{"href":"http://0.0.0.0:6385/v1/racks/1","rel":"self"}] + "links":[{"href":"http://0.0.0.0:8585/v1/racks/1","rel":"self"}] }, { "id":2, - "links":[{"href":"http://0.0.0.0:6385/v1/racks/2","rel":"self"}] + "links":[{"href":"http://0.0.0.0:8585/v1/racks/2","rel":"self"}] } ], "flavors": [ @@ -141,7 +141,7 @@ and a total of six Nodes. The non-compute Resoure Class contains one Rack and o } ] } - ' http://0.0.0.0:6385/v1/resource_classes + ' http://0.0.0.0:8585/v1/resource_classes curl -iX POST -H 'Content-Type: application/json' -H 'Accept: application/json' -d ' { @@ -150,11 +150,11 @@ and a total of six Nodes. The non-compute Resoure Class contains one Rack and o "racks": [ { "id":3, - "links":[{"href":"http://0.0.0.0:6385/v1/racks/3","rel":"self"}] + "links":[{"href":"http://0.0.0.0:8585/v1/racks/3","rel":"self"}] } ] } - ' http://0.0.0.0:6385/v1/resource_classes + ' http://0.0.0.0:8585/v1/resource_classes Generate HEAT Template ---------------------- @@ -163,4 +163,4 @@ This command generates the HEAT template based on the Tuskar description. :: - curl http://0.0.0.0:6385/v1/data_centers + curl http://0.0.0.0:8585/v1/data_centers diff --git a/docs/resource-class-demo-script.rst b/docs/resource-class-demo-script.rst index 1fc9bed7..ffcff30c 100644 --- a/docs/resource-class-demo-script.rst +++ b/docs/resource-class-demo-script.rst @@ -7,14 +7,14 @@ Get a Resource Class :: - curl -H 'Accept: application/json' http://0.0.0.0:6385/v1/resource_classes/1 + curl -H 'Accept: application/json' http://0.0.0.0:8585/v1/resource_classes/1 { "service_type": "compute", "racks": [], "id": 1, "links": [{ - "href": "http://0.0.0.0:6385/v1/resource_classes/1", + "href": "http://0.0.0.0:8585/v1/resource_classes/1", "rel": "self" }], "name": "test-chassis" @@ -25,7 +25,7 @@ Get the Resource Class Collection :: - curl -H 'Accept: application/json' http://0.0.0.0:6385/v1/resource_classes/ + curl -H 'Accept: application/json' http://0.0.0.0:8585/v1/resource_classes/ Create a Resource Class with a Rack ----------------------------------- @@ -41,14 +41,14 @@ Create a Resource Class with a Rack "id": 1, "links": [ { - "href":"http://0.0.0.0:6385/v1/racks/1", + "href":"http://0.0.0.0:8585/v1/racks/1", "rel":"self" } ] } ] } - ' http://0.0.0.0:6385/v1/resource_classes`` + ' http://0.0.0.0:8585/v1/resource_classes`` Update the Racks on a Resource Class (Remove Racks) --------------------------------------------------- @@ -61,7 +61,7 @@ Update the Racks on a Resource Class (Remove Racks) "name": "test-chassis", "racks":[] } - ' http://0.0.0.0:6385/v1/resource_classes/13`` + ' http://0.0.0.0:8585/v1/resource_classes/13`` Update the Racks on a Resource Class (Add a Rack) ------------------------------------------------- @@ -77,18 +77,18 @@ Update the Racks on a Resource Class (Add a Rack) "id": 2, "links": [ { - "href":"http://0.0.0.0:6385/v1/racks/2", + "href":"http://0.0.0.0:8585/v1/racks/2", "rel":"self" } ] } ] } - ' http://0.0.0.0:6385/v1/resource_classes/13`` + ' http://0.0.0.0:8585/v1/resource_classes/13`` Delete a Resource Class ----------------------- :: - curl -iX DELETE -H 'Accept: application/json' http://0.0.0.0:6385/v1/resource_classes/13 + curl -iX DELETE -H 'Accept: application/json' http://0.0.0.0:8585/v1/resource_classes/13 diff --git a/etc/tuskar/tuskar.conf.sample b/etc/tuskar/tuskar.conf.sample index 87a74429..58756ec8 100644 --- a/etc/tuskar/tuskar.conf.sample +++ b/etc/tuskar/tuskar.conf.sample @@ -25,7 +25,7 @@ #tuskar_api_bind_ip=0.0.0.0 # The port for the Tuskar API server (integer value) -#tuskar_api_port=6385 +#tuskar_api_port=8585 # diff --git a/tools/sample_data.py b/tools/sample_data.py index 6298ca5a..8cb53be9 100644 --- a/tools/sample_data.py +++ b/tools/sample_data.py @@ -143,7 +143,7 @@ def generate_uuid(): def generate_data(): logging.basicConfig(format='%(message)s', level=logging.DEBUG) - conn = httplib.HTTPConnection('localhost', 6385) + conn = httplib.HTTPConnection('localhost', 8585) base_url = '/v1' diff --git a/tuskar/api/__init__.py b/tuskar/api/__init__.py index 9a6970cc..04ebab1e 100644 --- a/tuskar/api/__init__.py +++ b/tuskar/api/__init__.py @@ -28,7 +28,7 @@ API_SERVICE_OPTS = [ help='IP for the Tuskar API server to bind to', ), cfg.IntOpt('tuskar_api_port', - default=6385, + default=8585, help='The port for the Tuskar API server', ), ] diff --git a/tuskar/tests/db/utils.py b/tuskar/tests/db/utils.py index 8fd38d93..b36ccc7a 100644 --- a/tuskar/tests/db/utils.py +++ b/tuskar/tests/db/utils.py @@ -62,7 +62,7 @@ def get_test_rack(**kwargs): if kwargs.get('resource_class', False): rack.resource_class = Relation( id=kwargs.get('rc_id', 1), - links=[Link(href='http://0.0.0.0:6385/resource_classes/' + + links=[Link(href='http://0.0.0.0:8585/resource_classes/' + str(kwargs.get('rc_id', 1)), rel='self')]) return rack @@ -89,7 +89,7 @@ def get_test_rack_node(**kwargs): def get_test_resource_class_rack(**kwargs): rack_id = kwargs.get('id', 1) rc_rack = Relation(id=rack_id, - links=[Link(href='http://0.0.0.0:6385/v1/racks/' + + links=[Link(href='http://0.0.0.0:8585/v1/racks/' + str(rack_id), rel='self')]) return rc_rack