Rename resource_data/url attributes to manifest/manifest_url
This depends on server side changes. See: https://review.openstack.org/#/c/147759/ Change-Id: I4bcc4f3e6982b4066f5c54fa9987c1045edfdb63
This commit is contained in:
@@ -39,7 +39,7 @@ POD2 = {'id': 124,
|
|||||||
'labels': {'foo': 'bar'},
|
'labels': {'foo': 'bar'},
|
||||||
'status': 'Running'
|
'status': 'Running'
|
||||||
}
|
}
|
||||||
CREATE_POD = {'pod_definition_url': 'file:///a/b.json'}
|
CREATE_POD = {'manifest_url': 'file:///a/b.json'}
|
||||||
UPDATED_POD = copy.deepcopy(POD1)
|
UPDATED_POD = copy.deepcopy(POD1)
|
||||||
NEW_DESCR = 'new-description'
|
NEW_DESCR = 'new-description'
|
||||||
UPDATED_POD['description'] = NEW_DESCR
|
UPDATED_POD['description'] = NEW_DESCR
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ RC2 = {'id': 124,
|
|||||||
'selector': {'name': 'bar2'},
|
'selector': {'name': 'bar2'},
|
||||||
'replicas': 2
|
'replicas': 2
|
||||||
}
|
}
|
||||||
CREATE_RC = {'rc_definition_url': 'file:///a/b.json'}
|
CREATE_RC = {'manifest_url': 'file:///a/b.json'}
|
||||||
UPDATED_RC = copy.deepcopy(RC1)
|
UPDATED_RC = copy.deepcopy(RC1)
|
||||||
NEW_REPLICAS = 3
|
NEW_REPLICAS = 3
|
||||||
UPDATED_RC['replicas'] = NEW_REPLICAS
|
UPDATED_RC['replicas'] = NEW_REPLICAS
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ SERVICE2 = {'id': 124,
|
|||||||
'ip': '10.0.0.4',
|
'ip': '10.0.0.4',
|
||||||
'port': 8081
|
'port': 8081
|
||||||
}
|
}
|
||||||
CREATE_SVC = {'service_definition_url': 'file:///a/b.json'}
|
CREATE_SVC = {'manifest_url': 'file:///a/b.json'}
|
||||||
UPDATED_SVC = copy.deepcopy(SERVICE1)
|
UPDATED_SVC = copy.deepcopy(SERVICE1)
|
||||||
NEW_SELECTOR = {'name': 'bar3'}
|
NEW_SELECTOR = {'name': 'bar3'}
|
||||||
UPDATED_SVC['selector'] = NEW_SELECTOR
|
UPDATED_SVC['selector'] = NEW_SELECTOR
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ from magnumclient.common import utils
|
|||||||
from magnumclient import exceptions
|
from magnumclient import exceptions
|
||||||
|
|
||||||
|
|
||||||
CREATION_ATTRIBUTES = ['bay_uuid', 'pod_definition_url', 'pod_data']
|
CREATION_ATTRIBUTES = ['bay_uuid', 'manifest', 'manifest_url']
|
||||||
|
|
||||||
|
|
||||||
class Pod(base.Resource):
|
class Pod(base.Resource):
|
||||||
|
|||||||
@@ -17,8 +17,7 @@ from magnumclient.common import utils
|
|||||||
from magnumclient import exceptions
|
from magnumclient import exceptions
|
||||||
|
|
||||||
|
|
||||||
CREATION_ATTRIBUTES = ['bay_uuid', 'rc_definition_url',
|
CREATION_ATTRIBUTES = ['bay_uuid', 'manifest', 'manifest_url']
|
||||||
'replicationcontroller_data']
|
|
||||||
|
|
||||||
|
|
||||||
class ReplicationController(base.Resource):
|
class ReplicationController(base.Resource):
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ from magnumclient.common import base
|
|||||||
from magnumclient.common import utils
|
from magnumclient.common import utils
|
||||||
from magnumclient import exceptions
|
from magnumclient import exceptions
|
||||||
|
|
||||||
CREATION_ATTRIBUTES = ['bay_uuid', 'service_definition_url', 'service_data']
|
CREATION_ATTRIBUTES = ['bay_uuid', 'manifest', 'manifest_url']
|
||||||
|
|
||||||
|
|
||||||
class Service(base.Resource):
|
class Service(base.Resource):
|
||||||
|
|||||||
@@ -191,11 +191,11 @@ def do_pod_list(cs, args):
|
|||||||
{'versions': _print_list_field('versions')})
|
{'versions': _print_list_field('versions')})
|
||||||
|
|
||||||
|
|
||||||
@utils.arg('--pod-url',
|
@utils.arg('--manifest-url',
|
||||||
metavar='<pod-url>',
|
metavar='<manifest_url>',
|
||||||
help='Name/URL of the pod file to use for creating PODs.')
|
help='Name/URL of the pod file to use for creating PODs.')
|
||||||
@utils.arg('--pod-file',
|
@utils.arg('--manifest',
|
||||||
metavar='<pod-file>',
|
metavar='<manifest>',
|
||||||
help='File path of the pod file to use for creating PODs.')
|
help='File path of the pod file to use for creating PODs.')
|
||||||
@utils.arg('--bay-id',
|
@utils.arg('--bay-id',
|
||||||
required=True,
|
required=True,
|
||||||
@@ -204,12 +204,12 @@ def do_pod_list(cs, args):
|
|||||||
def do_pod_create(cs, args):
|
def do_pod_create(cs, args):
|
||||||
"""Create a pod."""
|
"""Create a pod."""
|
||||||
opts = {}
|
opts = {}
|
||||||
opts['pod_definition_url'] = args.pod_url
|
opts['manifest_url'] = args.manifest_url
|
||||||
opts['bay_uuid'] = args.bay_id
|
opts['bay_uuid'] = args.bay_id
|
||||||
|
|
||||||
if args.pod_file is not None and os.path.isfile(args.pod_file):
|
if args.manifest is not None and os.path.isfile(args.manifest):
|
||||||
with open(args.pod_file, 'r') as f:
|
with open(args.manifest, 'r') as f:
|
||||||
opts['pod_data'] = f.read()
|
opts['manifest'] = f.read()
|
||||||
|
|
||||||
node = cs.pods.create(**opts)
|
node = cs.pods.create(**opts)
|
||||||
_show_pod(node)
|
_show_pod(node)
|
||||||
@@ -243,12 +243,12 @@ def do_rc_list(cs, args):
|
|||||||
{'versions': _print_list_field('versions')})
|
{'versions': _print_list_field('versions')})
|
||||||
|
|
||||||
|
|
||||||
@utils.arg('--rc-url',
|
@utils.arg('--manifest-url',
|
||||||
metavar='<rc_url>',
|
metavar='<manifest_url>',
|
||||||
help='Name/URL of the replication controller file to use for '
|
help='Name/URL of the replication controller file to use for '
|
||||||
'creating replication controllers.')
|
'creating replication controllers.')
|
||||||
@utils.arg('--rc-file',
|
@utils.arg('--manifest',
|
||||||
metavar='<rc_file>',
|
metavar='<manifest>',
|
||||||
help='File path of the replication controller file to use for '
|
help='File path of the replication controller file to use for '
|
||||||
'creating replication controllers.')
|
'creating replication controllers.')
|
||||||
@utils.arg('--bay-id',
|
@utils.arg('--bay-id',
|
||||||
@@ -258,12 +258,12 @@ def do_rc_list(cs, args):
|
|||||||
def do_rc_create(cs, args):
|
def do_rc_create(cs, args):
|
||||||
"""Create a replication controller."""
|
"""Create a replication controller."""
|
||||||
opts = {}
|
opts = {}
|
||||||
opts['rc_definition_url'] = args.rc_url
|
opts['manifest_url'] = args.manifest_url
|
||||||
opts['bay_uuid'] = args.bay_id
|
opts['bay_uuid'] = args.bay_id
|
||||||
|
|
||||||
if args.rc_file is not None and os.path.isfile(args.rc_file):
|
if args.manifest is not None and os.path.isfile(args.manifest):
|
||||||
with open(args.rc_file, 'r') as f:
|
with open(args.manifest, 'r') as f:
|
||||||
opts['replicationcontroller_data'] = f.read()
|
opts['manifest'] = f.read()
|
||||||
|
|
||||||
rc = cs.rcs.create(**opts)
|
rc = cs.rcs.create(**opts)
|
||||||
_show_rc(rc)
|
_show_rc(rc)
|
||||||
@@ -295,11 +295,11 @@ def do_service_list(cs, args):
|
|||||||
{'versions': _print_list_field('versions')})
|
{'versions': _print_list_field('versions')})
|
||||||
|
|
||||||
|
|
||||||
@utils.arg('--service-url',
|
@utils.arg('--manifest-url',
|
||||||
metavar='<service-url>',
|
metavar='<manifest_url>',
|
||||||
help='Name/URL of the serivce file to use for creating services.')
|
help='Name/URL of the serivce file to use for creating services.')
|
||||||
@utils.arg('--service-file',
|
@utils.arg('--manifest',
|
||||||
metavar='<service-file>',
|
metavar='<manifest>',
|
||||||
help='File path of the service file to use for creating services.')
|
help='File path of the service file to use for creating services.')
|
||||||
@utils.arg('--bay-id',
|
@utils.arg('--bay-id',
|
||||||
required=True,
|
required=True,
|
||||||
@@ -308,12 +308,12 @@ def do_service_list(cs, args):
|
|||||||
def do_service_create(cs, args):
|
def do_service_create(cs, args):
|
||||||
"""Create a service."""
|
"""Create a service."""
|
||||||
opts = {}
|
opts = {}
|
||||||
opts['service_definition_url'] = args.service_url
|
opts['manifest_url'] = args.manifest_url
|
||||||
opts['bay_uuid'] = args.bay_id
|
opts['bay_uuid'] = args.bay_id
|
||||||
|
|
||||||
if args.service_file is not None and os.path.isfile(args.service_file):
|
if args.manifest is not None and os.path.isfile(args.manifest):
|
||||||
with open(args.service_file, 'r') as f:
|
with open(args.manifest, 'r') as f:
|
||||||
opts['service_data'] = f.read()
|
opts['manifest'] = f.read()
|
||||||
|
|
||||||
service = cs.services.create(**opts)
|
service = cs.services.create(**opts)
|
||||||
_show_service(service)
|
_show_service(service)
|
||||||
|
|||||||
Reference in New Issue
Block a user