@ -43,31 +43,31 @@ class ClusterTemplatePatchType(types.JsonPatchType):
class ClusterTemplate ( base . APIBase ) :
""" API representation of a clustert emplate.
""" API representation of a ClusterT emplate.
This class enforces type checking and value constraints , and converts
between the internal object model and the API representation of
a clustert emplate.
a ClusterT emplate.
"""
uuid = types . uuid
""" Unique UUID for this clustert emplate """
""" Unique UUID for this ClusterT emplate """
name = wtypes . StringType ( min_length = 1 , max_length = 255 )
""" The name of the clustert emplate """
""" The name of the ClusterT emplate """
coe = wtypes . Enum ( str , * fields . BayType . ALL , mandatory = True )
""" The Container Orchestration Engine for this clustertemplate """
image_id = wsme . wsattr ( wtypes . StringType ( min_length = 1 , max_length = 255 ) ,
mandatory = True )
""" The image name or UUID to use as an image for this clustert emplate """
""" The image name or UUID to use as an image for this ClusterT emplate """
flavor_id = wtypes . StringType ( min_length = 1 , max_length = 255 )
""" The flavor of this clustert emplate """
""" The flavor of this ClusterT emplate """
master_flavor_id = wtypes . StringType ( min_length = 1 , max_length = 255 )
""" The flavor of the master node for this clustert emplate """
""" The flavor of the master node for this ClusterT emplate """
dns_nameserver = wtypes . IPv4AddressType ( )
""" The DNS nameserver address """
@ -77,13 +77,13 @@ class ClusterTemplate(base.APIBase):
""" The name or id of the nova ssh keypair """
external_network_id = wtypes . StringType ( min_length = 1 , max_length = 255 )
""" The external network to attach the c luster """
""" The external network to attach to the C luster """
fixed_network = wtypes . StringType ( min_length = 1 , max_length = 255 )
""" The fixed network name to attach the c luster """
""" The fixed network name to attach to the C luster """
fixed_subnet = wtypes . StringType ( min_length = 1 , max_length = 255 )
""" The fixed subnet name to attach the c luster """
""" The fixed subnet name to attach to the C luster """
network_driver = wtypes . StringType ( min_length = 1 , max_length = 255 )
""" The name of the driver used for instantiating container networks """
@ -95,10 +95,10 @@ class ClusterTemplate(base.APIBase):
""" The size in GB of the docker volume """
cluster_distro = wtypes . StringType ( min_length = 1 , max_length = 255 )
""" The Cluster distro for the cluster, ex - coreos, fedora-atomi c. """
""" The Cluster distro for the Cluster, e.g. coreos, fedora-atomic, et c. """
links = wsme . wsattr ( [ link . Link ] , readonly = True )
""" A list containing a self link and associated clustert emplate links """
""" A list containing a self link and associated ClusterT emplate links """
http_proxy = wtypes . StringType ( min_length = 1 , max_length = 255 )
""" Address of a proxy that will receive all HTTP requests and relay them.
@ -111,12 +111,12 @@ class ClusterTemplate(base.APIBase):
"""
no_proxy = wtypes . StringType ( min_length = 1 , max_length = 255 )
""" A comma separated list of ips for which proxies should not
""" A comma separated list of IPs for which proxies should not be
used in the cluster
"""
volume_driver = wtypes . StringType ( min_length = 1 , max_length = 255 )
""" The name of the driver used for instantiating container volume driver """
""" The name of the driver used for instantiating container volumes """
registry_enabled = wsme . wsattr ( types . boolean , default = False )
""" Indicates whether the docker registry is enabled """
@ -128,26 +128,26 @@ class ClusterTemplate(base.APIBase):
""" Indicates whether the TLS should be disabled """
public = wsme . wsattr ( types . boolean , default = False )
""" Indicates whether the clustert emplate is public or not. """
""" Indicates whether the ClusterT emplate is public or not. """
server_type = wsme . wsattr ( wtypes . StringType ( min_length = 1 ,
max_length = 255 ) ,
default = ' vm ' )
""" Server type for this clustert emplate """
""" Server type for this ClusterT emplate """
insecure_registry = wtypes . StringType ( min_length = 1 , max_length = 255 )
""" insecure registry url when create clustert emplate """
""" Insecure registry URL when creating a ClusterT emplate """
docker_storage_driver = wtypes . Enum ( str , * fields . DockerStorageDriver . ALL )
""" Docker storage driver """
master_lb_enabled = wsme . wsattr ( types . boolean , default = False )
""" Indicates whether created bay s should have a load balancer for master
""" Indicates whether created cluster s should have a load balancer for master
nodes or not .
"""
floating_ip_enabled = wsme . wsattr ( types . boolean , default = True )
""" Indicates whether created bay s should have a floating ip or not. """
""" Indicates whether created cluster s should have a floating ip or not. """
def __init__ ( self , * * kwargs ) :
self . fields = [ ]
@ -170,8 +170,8 @@ class ClusterTemplate(base.APIBase):
return cluster_template
@classmethod
def convert_with_links ( cls , rpc_baymodel ) :
cluster_template = ClusterTemplate ( * * rpc_baymodel . as_dict ( ) )
def convert_with_links ( cls , rpc_cluster_template ) :
cluster_template = ClusterTemplate ( * * rpc_cluster_template . as_dict ( ) )
return cls . _convert_with_links ( cluster_template ,
pecan . request . host_url )
@ -210,19 +210,19 @@ class ClusterTemplate(base.APIBase):
class ClusterTemplateCollection ( collection . Collection ) :
""" API representation of a collection of clustert emplates. """
""" API representation of a collection of ClusterT emplates. """
clustertemplates = [ ClusterTemplate ]
""" A list containing clustert emplates objects """
""" A list containing ClusterT emplates objects """
def __init__ ( self , * * kwargs ) :
self . _type = ' clustertemplates '
@staticmethod
def convert_with_links ( rpc_baymodel s , limit , url = None , * * kwargs ) :
def convert_with_links ( rpc_cluster_template s , limit , url = None , * * kwargs ) :
collection = ClusterTemplateCollection ( )
collection . clustertemplates = [ ClusterTemplate . convert_with_links ( p )
for p in rpc_baymodel s ]
for p in rpc_cluster_template s ]
collection . next = collection . get_next ( limit , url = url , * * kwargs )
return collection
@ -274,7 +274,7 @@ class ClusterTemplatesController(base.Controller):
wtypes . text )
def get_all ( self , marker = None , limit = None , sort_key = ' id ' ,
sort_dir = ' asc ' ) :
""" Retrieve a list of baymodel s.
""" Retrieve a list of ClusterTemplate s.
: param marker : pagination marker for large data sets .
: param limit : maximum number of resources to return in a single result .
@ -291,7 +291,7 @@ class ClusterTemplatesController(base.Controller):
wtypes . text )
def detail ( self , marker = None , limit = None , sort_key = ' id ' ,
sort_dir = ' asc ' ) :
""" Retrieve a list of clustert emplates with detail.
""" Retrieve a list of ClusterT emplates with detail.
: param marker : pagination marker for large data sets .
: param limit : maximum number of resources to return in a single result .
@ -314,10 +314,10 @@ class ClusterTemplatesController(base.Controller):
@expose . expose ( ClusterTemplate , types . uuid_or_name )
def get_one ( self , cluster_template_ident ) :
""" Retrieve information about the given clustert emplate.
""" Retrieve information about the given ClusterT emplate.
: param cluster_template_ident : UUID or logical name of a
clustert emplate.
ClusterT emplate.
"""
context = pecan . request . context
cluster_template = api_utils . get_resource ( ' BayModel ' ,
@ -333,9 +333,9 @@ class ClusterTemplatesController(base.Controller):
@validation . enforce_volume_driver_types_create ( )
@validation . enforce_volume_storage_size_create ( )
def post ( self , cluster_template ) :
""" Create a new cluster_t emplate.
""" Create a new ClusterT emplate.
: param cluster_template : a cluster_t emplate within the request body .
: param cluster_template : a ClusterT emplate within the request body .
"""
context = pecan . request . context
policy . enforce ( context , ' clustertemplate:create ' ,
@ -375,12 +375,12 @@ class ClusterTemplatesController(base.Controller):
@validation . enforce_network_driver_types_update ( )
@validation . enforce_volume_driver_types_update ( )
def patch ( self , cluster_template_ident , patch ) :
""" Update an existing cluster_t emplate.
""" Update an existing ClusterT emplate.
: param cluster_template_ident : UUID or logic name of a
cluster_t emplate.
ClusterT emplate.
: param patch : a json PATCH document to apply to this
cluster_t emplate.
ClusterT emplate.
"""
context = pecan . request . context
cluster_template = api_utils . get_resource ( ' BayModel ' ,
@ -398,7 +398,7 @@ class ClusterTemplatesController(base.Controller):
new_cluster_template_dict = new_cluster_template . as_dict ( )
attr_validator . validate_os_resources ( context ,
new_cluster_template_dict )
# check permissions when updating baymodel public flag
# check permissions when updating ClusterTemplate public flag
if cluster_template . public != new_cluster_template . public :
if not policy . enforce ( context , " clustertemplate:publish " , None ,
do_raise = False ) :
@ -421,10 +421,10 @@ class ClusterTemplatesController(base.Controller):
@expose . expose ( None , types . uuid_or_name , status_code = 204 )
def delete ( self , cluster_template_ident ) :
""" Delete a cluster_t emplate.
""" Delete a ClusterT emplate.
: param cluster_template_ident : UUID or logical name of a
cluster_t emplate.
ClusterT emplate.
"""
context = pecan . request . context
cluster_template = api_utils . get_resource ( ' BayModel ' ,