Set default port to 8585

Change-Id: I834be2e4444202aa8ee7eaaeecf26e0ca2f24eef
This commit is contained in:
Martyn Taylor 2013-09-24 14:58:19 +01:00
parent c77822bff3
commit 2fa7f23752
10 changed files with 49 additions and 49 deletions

View File

@ -81,7 +81,7 @@ that in this section.
the client, so in the above case, you could get the list of foos the client, so in the above case, you could get the list of foos
with:: 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 For doing something simple, like a poc controller that doesn't
return any objects, you can return plain text as so:: return any objects, you can return plain text as so::

View File

@ -74,7 +74,7 @@ output) with::
Then, launch the app and try curl to see if it works:: Then, launch the app and try curl to see if it works::
$ tuskar-api --config-file etc/tuskar/tuskar.conf $ 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 Assuming this is your first time running with a new database, you should
simply get '[]' back from curl above. Currently the api supports only simply get '[]' back from curl above. Currently the api supports only

View File

@ -118,7 +118,7 @@ The *service_type* attribute describe whether this ResourceClass is *storage* or
{ {
"id":1, "id":1,
"links":[ "links":[
{ "href":"http://0.0.0.0:6385/v1/rack/1", { "href":"http://0.0.0.0:8585/v1/rack/1",
"rel":"self" "rel":"self"
} }
] ]

View File

@ -38,7 +38,7 @@ create
}], }],
"slots": 1 "slots": 1
} }
' http://0.0.0.0:6385/v1/racks ' http://0.0.0.0:8585/v1/racks
create with ResourceClass create with ResourceClass
~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~
@ -68,34 +68,34 @@ create with ResourceClass
"id":1, "id":1,
"links":[ "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" "rel":"self"
} }
] ]
} }
} }
' http://0.0.0.0:6385/v1/racks ' http://0.0.0.0:8585/v1/racks
delete delete
~~~~~~ ~~~~~~
:: ::
curl -vX DELETE http://localhost:6385/v1/racks/1 curl -vX DELETE http://localhost:8585/v1/racks/1
update 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) 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>`_ `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: 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 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 update an existing Flavor in a specified ResourceClass
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -177,7 +177,7 @@ update an existing Flavor in a specified ResourceClass
], ],
"max_vms": 9999, "max_vms": 9999,
"name": "tiny_update" }' "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 **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 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" } "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>`_ `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 response
^^^^^^^^ ^^^^^^^^
@ -223,7 +223,7 @@ response
"id":1, "id":1,
"links":[ "links":[
{ {
"href":"http://0.0.0.0:6385/v1/rack/1", "href":"http://0.0.0.0:8585/v1/rack/1",
"rel":"self" "rel":"self"
} }
] ]
@ -231,7 +231,7 @@ response
], ],
"links":[ "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" "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 create without Racks
~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~
@ -254,7 +254,7 @@ create without Racks
"service_type": "compute", "service_type": "compute",
"name": "test-chassis" "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 create with Rack and Flavor definitions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -267,7 +267,7 @@ create with Rack and Flavor definitions
"service_type":"compute", "service_type":"compute",
"racks": [ "racks": [
{ "id":1, { "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": [ "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)** **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 update
~~~~~~ ~~~~~~
@ -311,21 +311,21 @@ the racks array attribute accordingly.
"id": 1, "id": 1,
"links": [ "links": [
{ {
"href":"http://0.0.0.0:6385/v1/racks/1", "href":"http://0.0.0.0:8585/v1/racks/1",
"rel":"self" "rel":"self"
} }
] ]
} }
] ]
} }
' http://0.0.0.0:6385/v1/resource_classes/13`` ' http://0.0.0.0:8585/v1/resource_classes/13``
delete 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>`_ 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>`_ `back to top <#index>`_

View File

@ -56,7 +56,7 @@ Node only.
], ],
"slots": 3 "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 ' curl -vX POST -H 'Content-Type: application/json' -H 'Accept: application/json' -v -d '
{ {
@ -82,7 +82,7 @@ Node only.
], ],
"slots": 3 "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 ' curl -vX POST -H 'Content-Type: application/json' -H 'Accept: application/json' -v -d '
{ {
@ -101,7 +101,7 @@ Node only.
}], }],
"slots": 3 "slots": 3
} }
' http://0.0.0.0:6385/v1/racks ' http://0.0.0.0:8585/v1/racks
Create Resource Classes Create Resource Classes
----------------------- -----------------------
@ -118,11 +118,11 @@ and a total of six Nodes. The non-compute Resoure Class contains one Rack and o
"racks": [ "racks": [
{ {
"id":1, "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, "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": [ "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 ' 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": [ "racks": [
{ {
"id":3, "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 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

View File

@ -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", "service_type": "compute",
"racks": [], "racks": [],
"id": 1, "id": 1,
"links": [{ "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" "rel": "self"
}], }],
"name": "test-chassis" "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 Create a Resource Class with a Rack
----------------------------------- -----------------------------------
@ -41,14 +41,14 @@ Create a Resource Class with a Rack
"id": 1, "id": 1,
"links": [ "links": [
{ {
"href":"http://0.0.0.0:6385/v1/racks/1", "href":"http://0.0.0.0:8585/v1/racks/1",
"rel":"self" "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) 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", "name": "test-chassis",
"racks":[] "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) 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, "id": 2,
"links": [ "links": [
{ {
"href":"http://0.0.0.0:6385/v1/racks/2", "href":"http://0.0.0.0:8585/v1/racks/2",
"rel":"self" "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 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

View File

@ -25,7 +25,7 @@
#tuskar_api_bind_ip=0.0.0.0 #tuskar_api_bind_ip=0.0.0.0
# The port for the Tuskar API server (integer value) # The port for the Tuskar API server (integer value)
#tuskar_api_port=6385 #tuskar_api_port=8585
# #

View File

@ -143,7 +143,7 @@ def generate_uuid():
def generate_data(): def generate_data():
logging.basicConfig(format='%(message)s', level=logging.DEBUG) logging.basicConfig(format='%(message)s', level=logging.DEBUG)
conn = httplib.HTTPConnection('localhost', 6385) conn = httplib.HTTPConnection('localhost', 8585)
base_url = '/v1' base_url = '/v1'

View File

@ -28,7 +28,7 @@ API_SERVICE_OPTS = [
help='IP for the Tuskar API server to bind to', help='IP for the Tuskar API server to bind to',
), ),
cfg.IntOpt('tuskar_api_port', cfg.IntOpt('tuskar_api_port',
default=6385, default=8585,
help='The port for the Tuskar API server', help='The port for the Tuskar API server',
), ),
] ]

View File

@ -62,7 +62,7 @@ def get_test_rack(**kwargs):
if kwargs.get('resource_class', False): if kwargs.get('resource_class', False):
rack.resource_class = Relation( rack.resource_class = Relation(
id=kwargs.get('rc_id', 1), 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')]) str(kwargs.get('rc_id', 1)), rel='self')])
return rack return rack
@ -89,7 +89,7 @@ def get_test_rack_node(**kwargs):
def get_test_resource_class_rack(**kwargs): def get_test_resource_class_rack(**kwargs):
rack_id = kwargs.get('id', 1) rack_id = kwargs.get('id', 1)
rc_rack = Relation(id=rack_id, 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')]) str(rack_id), rel='self')])
return rc_rack return rc_rack