# DO NOT CHANGE THIS FILE! This file is auto-generated by facade.py.
# Changes will be overwritten/lost when the file is regenerated.
from juju.client.facade import Type, ReturnMapping
from juju.client._definitions import *
[docs]class AllModelWatcherFacade(Type):
name = 'AllModelWatcher'
version = 4
schema = {'definitions': {'AllWatcherNextResults': {'additionalProperties': False,
'properties': {'deltas': {'items': {'$ref': '#/definitions/Delta'},
'type': 'array'}},
'required': ['deltas'],
'type': 'object'},
'Delta': {'additionalProperties': False,
'properties': {'entity': {'additionalProperties': True,
'type': 'object'},
'removed': {'type': 'boolean'}},
'required': ['removed', 'entity'],
'type': 'object'}},
'properties': {'Next': {'description': 'Next will return the current state of '
'everything on the first call\n'
'and subsequent calls will',
'properties': {'Result': {'$ref': '#/definitions/AllWatcherNextResults'}},
'type': 'object'},
'Stop': {'description': 'Stop stops the watcher.',
'type': 'object'}},
'type': 'object'}
[docs] @ReturnMapping(AllWatcherNextResults)
async def Next(self):
'''
Next will return the current state of everything on the first call
and subsequent calls will
Returns -> AllWatcherNextResults
'''
# map input types to rpc msg
_params = dict()
msg = dict(type='AllModelWatcher',
request='Next',
version=4,
params=_params)
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(None)
async def Stop(self):
'''
Stop stops the watcher.
Returns -> None
'''
# map input types to rpc msg
_params = dict()
msg = dict(type='AllModelWatcher',
request='Stop',
version=4,
params=_params)
reply = await self.rpc(msg)
return reply
[docs] async def rpc(self, msg):
'''
Patch rpc method to add Id.
'''
if not hasattr(self, 'Id'):
raise RuntimeError('Missing "Id" field')
msg['Id'] = id
from .facade import TypeEncoder
reply = await self.connection.rpc(msg, encoder=TypeEncoder)
return reply
[docs]class ApplicationOffersFacade(Type):
name = 'ApplicationOffers'
version = 4
schema = {'definitions': {'AddApplicationOffer': {'additionalProperties': False,
'properties': {'application-description': {'type': 'string'},
'application-name': {'type': 'string'},
'endpoints': {'patternProperties': {'.*': {'type': 'string'}},
'type': 'object'},
'model-tag': {'type': 'string'},
'offer-name': {'type': 'string'},
'owner-tag': {'type': 'string'}},
'required': ['model-tag',
'offer-name',
'application-name',
'application-description',
'endpoints'],
'type': 'object'},
'AddApplicationOffers': {'additionalProperties': False,
'properties': {'Offers': {'items': {'$ref': '#/definitions/AddApplicationOffer'},
'type': 'array'}},
'required': ['Offers'],
'type': 'object'},
'ApplicationOfferAdminDetails': {'additionalProperties': False,
'properties': {'ApplicationOfferDetails': {'$ref': '#/definitions/ApplicationOfferDetails'},
'application-description': {'type': 'string'},
'application-name': {'type': 'string'},
'bindings': {'patternProperties': {'.*': {'type': 'string'}},
'type': 'object'},
'charm-url': {'type': 'string'},
'connections': {'items': {'$ref': '#/definitions/OfferConnection'},
'type': 'array'},
'endpoints': {'items': {'$ref': '#/definitions/RemoteEndpoint'},
'type': 'array'},
'offer-name': {'type': 'string'},
'offer-url': {'type': 'string'},
'offer-uuid': {'type': 'string'},
'source-model-tag': {'type': 'string'},
'spaces': {'items': {'$ref': '#/definitions/RemoteSpace'},
'type': 'array'},
'users': {'items': {'$ref': '#/definitions/OfferUserDetails'},
'type': 'array'}},
'required': ['source-model-tag',
'offer-uuid',
'offer-url',
'offer-name',
'application-description',
'ApplicationOfferDetails',
'application-name',
'charm-url'],
'type': 'object'},
'ApplicationOfferDetails': {'additionalProperties': False,
'properties': {'application-description': {'type': 'string'},
'bindings': {'patternProperties': {'.*': {'type': 'string'}},
'type': 'object'},
'endpoints': {'items': {'$ref': '#/definitions/RemoteEndpoint'},
'type': 'array'},
'offer-name': {'type': 'string'},
'offer-url': {'type': 'string'},
'offer-uuid': {'type': 'string'},
'source-model-tag': {'type': 'string'},
'spaces': {'items': {'$ref': '#/definitions/RemoteSpace'},
'type': 'array'},
'users': {'items': {'$ref': '#/definitions/OfferUserDetails'},
'type': 'array'}},
'required': ['source-model-tag',
'offer-uuid',
'offer-url',
'offer-name',
'application-description'],
'type': 'object'},
'ApplicationOfferResult': {'additionalProperties': False,
'properties': {'error': {'$ref': '#/definitions/Error'},
'result': {'$ref': '#/definitions/ApplicationOfferAdminDetails'}},
'type': 'object'},
'ApplicationOffersResults': {'additionalProperties': False,
'properties': {'results': {'items': {'$ref': '#/definitions/ApplicationOfferResult'},
'type': 'array'}},
'type': 'object'},
'ConsumeOfferDetails': {'additionalProperties': False,
'properties': {'external-controller': {'$ref': '#/definitions/ExternalControllerInfo'},
'macaroon': {'$ref': '#/definitions/Macaroon'},
'offer': {'$ref': '#/definitions/ApplicationOfferDetails'}},
'type': 'object'},
'ConsumeOfferDetailsArg': {'additionalProperties': False,
'properties': {'offer-urls': {'$ref': '#/definitions/OfferURLs'},
'user-tag': {'type': 'string'}},
'required': ['offer-urls'],
'type': 'object'},
'ConsumeOfferDetailsResult': {'additionalProperties': False,
'properties': {'ConsumeOfferDetails': {'$ref': '#/definitions/ConsumeOfferDetails'},
'error': {'$ref': '#/definitions/Error'},
'external-controller': {'$ref': '#/definitions/ExternalControllerInfo'},
'macaroon': {'$ref': '#/definitions/Macaroon'},
'offer': {'$ref': '#/definitions/ApplicationOfferDetails'}},
'required': ['ConsumeOfferDetails'],
'type': 'object'},
'ConsumeOfferDetailsResults': {'additionalProperties': False,
'properties': {'results': {'items': {'$ref': '#/definitions/ConsumeOfferDetailsResult'},
'type': 'array'}},
'type': 'object'},
'DestroyApplicationOffers': {'additionalProperties': False,
'properties': {'force': {'type': 'boolean'},
'offer-urls': {'items': {'type': 'string'},
'type': 'array'}},
'required': ['offer-urls'],
'type': 'object'},
'EndpointFilterAttributes': {'additionalProperties': False,
'properties': {'interface': {'type': 'string'},
'name': {'type': 'string'},
'role': {'type': 'string'}},
'required': ['role',
'interface',
'name'],
'type': 'object'},
'EntityStatus': {'additionalProperties': False,
'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True,
'type': 'object'}},
'type': 'object'},
'info': {'type': 'string'},
'since': {'format': 'date-time',
'type': 'string'},
'status': {'type': 'string'}},
'required': ['status', 'info', 'since'],
'type': 'object'},
'Error': {'additionalProperties': False,
'properties': {'code': {'type': 'string'},
'info': {'patternProperties': {'.*': {'additionalProperties': True,
'type': 'object'}},
'type': 'object'},
'message': {'type': 'string'}},
'required': ['message', 'code'],
'type': 'object'},
'ErrorResult': {'additionalProperties': False,
'properties': {'error': {'$ref': '#/definitions/Error'}},
'type': 'object'},
'ErrorResults': {'additionalProperties': False,
'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'},
'type': 'array'}},
'required': ['results'],
'type': 'object'},
'ExternalControllerInfo': {'additionalProperties': False,
'properties': {'addrs': {'items': {'type': 'string'},
'type': 'array'},
'ca-cert': {'type': 'string'},
'controller-alias': {'type': 'string'},
'controller-tag': {'type': 'string'}},
'required': ['controller-tag',
'controller-alias',
'addrs',
'ca-cert'],
'type': 'object'},
'Macaroon': {'additionalProperties': False, 'type': 'object'},
'ModifyOfferAccess': {'additionalProperties': False,
'properties': {'access': {'type': 'string'},
'action': {'type': 'string'},
'offer-url': {'type': 'string'},
'user-tag': {'type': 'string'}},
'required': ['user-tag',
'action',
'access',
'offer-url'],
'type': 'object'},
'ModifyOfferAccessRequest': {'additionalProperties': False,
'properties': {'changes': {'items': {'$ref': '#/definitions/ModifyOfferAccess'},
'type': 'array'}},
'required': ['changes'],
'type': 'object'},
'OfferConnection': {'additionalProperties': False,
'properties': {'endpoint': {'type': 'string'},
'ingress-subnets': {'items': {'type': 'string'},
'type': 'array'},
'relation-id': {'type': 'integer'},
'source-model-tag': {'type': 'string'},
'status': {'$ref': '#/definitions/EntityStatus'},
'username': {'type': 'string'}},
'required': ['source-model-tag',
'relation-id',
'username',
'endpoint',
'status',
'ingress-subnets'],
'type': 'object'},
'OfferFilter': {'additionalProperties': False,
'properties': {'allowed-users': {'items': {'type': 'string'},
'type': 'array'},
'application-description': {'type': 'string'},
'application-name': {'type': 'string'},
'application-user': {'type': 'string'},
'connected-users': {'items': {'type': 'string'},
'type': 'array'},
'endpoints': {'items': {'$ref': '#/definitions/EndpointFilterAttributes'},
'type': 'array'},
'model-name': {'type': 'string'},
'offer-name': {'type': 'string'},
'owner-name': {'type': 'string'}},
'required': ['owner-name',
'model-name',
'offer-name',
'application-name',
'application-description',
'application-user',
'endpoints',
'connected-users',
'allowed-users'],
'type': 'object'},
'OfferFilters': {'additionalProperties': False,
'properties': {'Filters': {'items': {'$ref': '#/definitions/OfferFilter'},
'type': 'array'}},
'required': ['Filters'],
'type': 'object'},
'OfferURLs': {'additionalProperties': False,
'properties': {'bakery-version': {'type': 'integer'},
'offer-urls': {'items': {'type': 'string'},
'type': 'array'}},
'type': 'object'},
'OfferUserDetails': {'additionalProperties': False,
'properties': {'access': {'type': 'string'},
'display-name': {'type': 'string'},
'user': {'type': 'string'}},
'required': ['user',
'display-name',
'access'],
'type': 'object'},
'QueryApplicationOffersResults': {'additionalProperties': False,
'properties': {'results': {'items': {'$ref': '#/definitions/ApplicationOfferAdminDetails'},
'type': 'array'}},
'required': ['results'],
'type': 'object'},
'RemoteApplicationInfo': {'additionalProperties': False,
'properties': {'description': {'type': 'string'},
'endpoints': {'items': {'$ref': '#/definitions/RemoteEndpoint'},
'type': 'array'},
'icon-url-path': {'type': 'string'},
'model-tag': {'type': 'string'},
'name': {'type': 'string'},
'offer-url': {'type': 'string'},
'source-model-label': {'type': 'string'}},
'required': ['model-tag',
'name',
'description',
'offer-url',
'endpoints',
'icon-url-path'],
'type': 'object'},
'RemoteApplicationInfoResult': {'additionalProperties': False,
'properties': {'error': {'$ref': '#/definitions/Error'},
'result': {'$ref': '#/definitions/RemoteApplicationInfo'}},
'type': 'object'},
'RemoteApplicationInfoResults': {'additionalProperties': False,
'properties': {'results': {'items': {'$ref': '#/definitions/RemoteApplicationInfoResult'},
'type': 'array'}},
'required': ['results'],
'type': 'object'},
'RemoteEndpoint': {'additionalProperties': False,
'properties': {'interface': {'type': 'string'},
'limit': {'type': 'integer'},
'name': {'type': 'string'},
'role': {'type': 'string'}},
'required': ['name',
'role',
'interface',
'limit'],
'type': 'object'},
'RemoteSpace': {'additionalProperties': False,
'properties': {'cloud-type': {'type': 'string'},
'name': {'type': 'string'},
'provider-attributes': {'patternProperties': {'.*': {'additionalProperties': True,
'type': 'object'}},
'type': 'object'},
'provider-id': {'type': 'string'},
'subnets': {'items': {'$ref': '#/definitions/Subnet'},
'type': 'array'}},
'required': ['cloud-type',
'name',
'provider-id',
'provider-attributes',
'subnets'],
'type': 'object'},
'Subnet': {'additionalProperties': False,
'properties': {'cidr': {'type': 'string'},
'life': {'type': 'string'},
'provider-id': {'type': 'string'},
'provider-network-id': {'type': 'string'},
'provider-space-id': {'type': 'string'},
'space-tag': {'type': 'string'},
'status': {'type': 'string'},
'vlan-tag': {'type': 'integer'},
'zones': {'items': {'type': 'string'},
'type': 'array'}},
'required': ['cidr',
'vlan-tag',
'life',
'space-tag',
'zones'],
'type': 'object'}},
'properties': {'ApplicationOffers': {'description': 'ApplicationOffers gets '
'details about remote '
'applications that match '
'given URLs.',
'properties': {'Params': {'$ref': '#/definitions/OfferURLs'},
'Result': {'$ref': '#/definitions/ApplicationOffersResults'}},
'type': 'object'},
'DestroyOffers': {'description': 'DestroyOffers removes the '
'offers specified by the '
'given URLs, forcing if '
'necessary.',
'properties': {'Params': {'$ref': '#/definitions/DestroyApplicationOffers'},
'Result': {'$ref': '#/definitions/ErrorResults'}},
'type': 'object'},
'FindApplicationOffers': {'description': 'FindApplicationOffers '
'gets details about '
'remote applications '
'that match given '
'filter.',
'properties': {'Params': {'$ref': '#/definitions/OfferFilters'},
'Result': {'$ref': '#/definitions/QueryApplicationOffersResults'}},
'type': 'object'},
'GetConsumeDetails': {'description': 'GetConsumeDetails '
'returns the details '
'necessary to pass to '
'another model\n'
'to allow the specified '
'args user to consume the '
'offers represented by '
'the args URLs.',
'properties': {'Params': {'$ref': '#/definitions/ConsumeOfferDetailsArg'},
'Result': {'$ref': '#/definitions/ConsumeOfferDetailsResults'}},
'type': 'object'},
'ListApplicationOffers': {'description': 'ListApplicationOffers '
'gets deployed '
'details about '
'application offers '
'that match given '
'filter.\n'
'The results contain '
'details about the '
'deployed '
'applications such as '
'connection count.',
'properties': {'Params': {'$ref': '#/definitions/OfferFilters'},
'Result': {'$ref': '#/definitions/QueryApplicationOffersResults'}},
'type': 'object'},
'ModifyOfferAccess': {'description': 'ModifyOfferAccess '
'changes the application '
'offer access granted to '
'users.',
'properties': {'Params': {'$ref': '#/definitions/ModifyOfferAccessRequest'},
'Result': {'$ref': '#/definitions/ErrorResults'}},
'type': 'object'},
'Offer': {'description': 'Offer makes application endpoints '
'available for consumption at a '
'specified URL.',
'properties': {'Params': {'$ref': '#/definitions/AddApplicationOffers'},
'Result': {'$ref': '#/definitions/ErrorResults'}},
'type': 'object'},
'RemoteApplicationInfo': {'description': 'RemoteApplicationInfo '
'returns information '
'about the requested '
'remote application.\n'
'This call currently '
'has no client side '
'API, only there for '
'the Dashboard at '
'this stage.',
'properties': {'Params': {'$ref': '#/definitions/OfferURLs'},
'Result': {'$ref': '#/definitions/RemoteApplicationInfoResults'}},
'type': 'object'}},
'type': 'object'}
[docs] @ReturnMapping(ApplicationOffersResults)
async def ApplicationOffers(self, bakery_version=None, offer_urls=None):
'''
ApplicationOffers gets details about remote applications that match given URLs.
bakery_version : int
offer_urls : typing.Sequence[str]
Returns -> ApplicationOffersResults
'''
if bakery_version is not None and not isinstance(bakery_version, int):
raise Exception("Expected bakery_version to be a int, received: {}".format(type(bakery_version)))
if offer_urls is not None and not isinstance(offer_urls, (bytes, str, list)):
raise Exception("Expected offer_urls to be a Sequence, received: {}".format(type(offer_urls)))
# map input types to rpc msg
_params = dict()
msg = dict(type='ApplicationOffers',
request='ApplicationOffers',
version=4,
params=_params)
_params['bakery-version'] = bakery_version
_params['offer-urls'] = offer_urls
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(ErrorResults)
async def DestroyOffers(self, force=None, offer_urls=None):
'''
DestroyOffers removes the offers specified by the given URLs, forcing if necessary.
force : bool
offer_urls : typing.Sequence[str]
Returns -> ErrorResults
'''
if force is not None and not isinstance(force, bool):
raise Exception("Expected force to be a bool, received: {}".format(type(force)))
if offer_urls is not None and not isinstance(offer_urls, (bytes, str, list)):
raise Exception("Expected offer_urls to be a Sequence, received: {}".format(type(offer_urls)))
# map input types to rpc msg
_params = dict()
msg = dict(type='ApplicationOffers',
request='DestroyOffers',
version=4,
params=_params)
_params['force'] = force
_params['offer-urls'] = offer_urls
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(QueryApplicationOffersResults)
async def FindApplicationOffers(self, filters=None):
'''
FindApplicationOffers gets details about remote applications that match given filter.
filters : typing.Sequence[~OfferFilter]
Returns -> QueryApplicationOffersResults
'''
if filters is not None and not isinstance(filters, (bytes, str, list)):
raise Exception("Expected filters to be a Sequence, received: {}".format(type(filters)))
# map input types to rpc msg
_params = dict()
msg = dict(type='ApplicationOffers',
request='FindApplicationOffers',
version=4,
params=_params)
_params['Filters'] = filters
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(ConsumeOfferDetailsResults)
async def GetConsumeDetails(self, offer_urls=None, user_tag=None):
'''
GetConsumeDetails returns the details necessary to pass to another model
to allow the specified args user to consume the offers represented by the args URLs.
offer_urls : OfferURLs
user_tag : str
Returns -> ConsumeOfferDetailsResults
'''
if offer_urls is not None and not isinstance(offer_urls, (dict, OfferURLs)):
raise Exception("Expected offer_urls to be a OfferURLs, received: {}".format(type(offer_urls)))
if user_tag is not None and not isinstance(user_tag, (bytes, str)):
raise Exception("Expected user_tag to be a str, received: {}".format(type(user_tag)))
# map input types to rpc msg
_params = dict()
msg = dict(type='ApplicationOffers',
request='GetConsumeDetails',
version=4,
params=_params)
_params['offer-urls'] = offer_urls
_params['user-tag'] = user_tag
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(QueryApplicationOffersResults)
async def ListApplicationOffers(self, filters=None):
'''
ListApplicationOffers gets deployed details about application offers that match given filter.
The results contain details about the deployed applications such as connection count.
filters : typing.Sequence[~OfferFilter]
Returns -> QueryApplicationOffersResults
'''
if filters is not None and not isinstance(filters, (bytes, str, list)):
raise Exception("Expected filters to be a Sequence, received: {}".format(type(filters)))
# map input types to rpc msg
_params = dict()
msg = dict(type='ApplicationOffers',
request='ListApplicationOffers',
version=4,
params=_params)
_params['Filters'] = filters
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(ErrorResults)
async def ModifyOfferAccess(self, changes=None):
'''
ModifyOfferAccess changes the application offer access granted to users.
changes : typing.Sequence[~ModifyOfferAccess]
Returns -> ErrorResults
'''
if changes is not None and not isinstance(changes, (bytes, str, list)):
raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes)))
# map input types to rpc msg
_params = dict()
msg = dict(type='ApplicationOffers',
request='ModifyOfferAccess',
version=4,
params=_params)
_params['changes'] = changes
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(ErrorResults)
async def Offer(self, offers=None):
'''
Offer makes application endpoints available for consumption at a specified URL.
offers : typing.Sequence[~AddApplicationOffer]
Returns -> ErrorResults
'''
if offers is not None and not isinstance(offers, (bytes, str, list)):
raise Exception("Expected offers to be a Sequence, received: {}".format(type(offers)))
# map input types to rpc msg
_params = dict()
msg = dict(type='ApplicationOffers',
request='Offer',
version=4,
params=_params)
_params['Offers'] = offers
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(RemoteApplicationInfoResults)
async def RemoteApplicationInfo(self, bakery_version=None, offer_urls=None):
'''
RemoteApplicationInfo returns information about the requested remote application.
This call currently has no client side API, only there for the Dashboard at this stage.
bakery_version : int
offer_urls : typing.Sequence[str]
Returns -> RemoteApplicationInfoResults
'''
if bakery_version is not None and not isinstance(bakery_version, int):
raise Exception("Expected bakery_version to be a int, received: {}".format(type(bakery_version)))
if offer_urls is not None and not isinstance(offer_urls, (bytes, str, list)):
raise Exception("Expected offer_urls to be a Sequence, received: {}".format(type(offer_urls)))
# map input types to rpc msg
_params = dict()
msg = dict(type='ApplicationOffers',
request='RemoteApplicationInfo',
version=4,
params=_params)
_params['bakery-version'] = bakery_version
_params['offer-urls'] = offer_urls
reply = await self.rpc(msg)
return reply
[docs]class InstancePollerFacade(Type):
name = 'InstancePoller'
version = 4
schema = {'definitions': {'Address': {'additionalProperties': False,
'properties': {'cidr': {'type': 'string'},
'config-type': {'type': 'string'},
'is-secondary': {'type': 'boolean'},
'scope': {'type': 'string'},
'space-id': {'type': 'string'},
'space-name': {'type': 'string'},
'type': {'type': 'string'},
'value': {'type': 'string'}},
'required': ['value', 'type', 'scope'],
'type': 'object'},
'BoolResult': {'additionalProperties': False,
'properties': {'error': {'$ref': '#/definitions/Error'},
'result': {'type': 'boolean'}},
'required': ['result'],
'type': 'object'},
'BoolResults': {'additionalProperties': False,
'properties': {'results': {'items': {'$ref': '#/definitions/BoolResult'},
'type': 'array'}},
'required': ['results'],
'type': 'object'},
'Entities': {'additionalProperties': False,
'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'},
'type': 'array'}},
'required': ['entities'],
'type': 'object'},
'Entity': {'additionalProperties': False,
'properties': {'tag': {'type': 'string'}},
'required': ['tag'],
'type': 'object'},
'EntityStatusArgs': {'additionalProperties': False,
'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True,
'type': 'object'}},
'type': 'object'},
'info': {'type': 'string'},
'status': {'type': 'string'},
'tag': {'type': 'string'}},
'required': ['tag',
'status',
'info',
'data'],
'type': 'object'},
'Error': {'additionalProperties': False,
'properties': {'code': {'type': 'string'},
'info': {'patternProperties': {'.*': {'additionalProperties': True,
'type': 'object'}},
'type': 'object'},
'message': {'type': 'string'}},
'required': ['message', 'code'],
'type': 'object'},
'ErrorResult': {'additionalProperties': False,
'properties': {'error': {'$ref': '#/definitions/Error'}},
'type': 'object'},
'ErrorResults': {'additionalProperties': False,
'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'},
'type': 'array'}},
'required': ['results'],
'type': 'object'},
'LifeResult': {'additionalProperties': False,
'properties': {'error': {'$ref': '#/definitions/Error'},
'life': {'type': 'string'}},
'required': ['life'],
'type': 'object'},
'LifeResults': {'additionalProperties': False,
'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'},
'type': 'array'}},
'required': ['results'],
'type': 'object'},
'MachineAddresses': {'additionalProperties': False,
'properties': {'addresses': {'items': {'$ref': '#/definitions/Address'},
'type': 'array'},
'tag': {'type': 'string'}},
'required': ['tag', 'addresses'],
'type': 'object'},
'MachineAddressesResult': {'additionalProperties': False,
'properties': {'addresses': {'items': {'$ref': '#/definitions/Address'},
'type': 'array'},
'error': {'$ref': '#/definitions/Error'}},
'required': ['addresses'],
'type': 'object'},
'MachineAddressesResults': {'additionalProperties': False,
'properties': {'results': {'items': {'$ref': '#/definitions/MachineAddressesResult'},
'type': 'array'}},
'required': ['results'],
'type': 'object'},
'ModelConfigResult': {'additionalProperties': False,
'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True,
'type': 'object'}},
'type': 'object'}},
'required': ['config'],
'type': 'object'},
'NetworkConfig': {'additionalProperties': False,
'properties': {'address': {'type': 'string'},
'addresses': {'items': {'$ref': '#/definitions/Address'},
'type': 'array'},
'cidr': {'type': 'string'},
'config-type': {'type': 'string'},
'device-index': {'type': 'integer'},
'disabled': {'type': 'boolean'},
'dns-search-domains': {'items': {'type': 'string'},
'type': 'array'},
'dns-servers': {'items': {'type': 'string'},
'type': 'array'},
'gateway-address': {'type': 'string'},
'interface-name': {'type': 'string'},
'interface-type': {'type': 'string'},
'is-default-gateway': {'type': 'boolean'},
'mac-address': {'type': 'string'},
'mtu': {'type': 'integer'},
'no-auto-start': {'type': 'boolean'},
'origin': {'type': 'string'},
'parent-interface-name': {'type': 'string'},
'provider-address-id': {'type': 'string'},
'provider-id': {'type': 'string'},
'provider-network-id': {'type': 'string'},
'provider-space-id': {'type': 'string'},
'provider-subnet-id': {'type': 'string'},
'provider-vlan-id': {'type': 'string'},
'routes': {'items': {'$ref': '#/definitions/NetworkRoute'},
'type': 'array'},
'shadow-addresses': {'items': {'$ref': '#/definitions/Address'},
'type': 'array'},
'virtual-port-type': {'type': 'string'},
'vlan-tag': {'type': 'integer'}},
'required': ['device-index',
'mac-address',
'cidr',
'mtu',
'provider-id',
'provider-network-id',
'provider-subnet-id',
'provider-space-id',
'provider-address-id',
'provider-vlan-id',
'vlan-tag',
'interface-name',
'parent-interface-name',
'interface-type',
'disabled'],
'type': 'object'},
'NetworkRoute': {'additionalProperties': False,
'properties': {'destination-cidr': {'type': 'string'},
'gateway-ip': {'type': 'string'},
'metric': {'type': 'integer'}},
'required': ['destination-cidr',
'gateway-ip',
'metric'],
'type': 'object'},
'NotifyWatchResult': {'additionalProperties': False,
'properties': {'NotifyWatcherId': {'type': 'string'},
'error': {'$ref': '#/definitions/Error'}},
'required': ['NotifyWatcherId'],
'type': 'object'},
'ProviderNetworkConfig': {'additionalProperties': False,
'properties': {'config': {'items': {'$ref': '#/definitions/NetworkConfig'},
'type': 'array'},
'tag': {'type': 'string'}},
'required': ['tag', 'config'],
'type': 'object'},
'SetMachinesAddresses': {'additionalProperties': False,
'properties': {'machine-addresses': {'items': {'$ref': '#/definitions/MachineAddresses'},
'type': 'array'}},
'required': ['machine-addresses'],
'type': 'object'},
'SetProviderNetworkConfig': {'additionalProperties': False,
'properties': {'args': {'items': {'$ref': '#/definitions/ProviderNetworkConfig'},
'type': 'array'}},
'required': ['args'],
'type': 'object'},
'SetProviderNetworkConfigResult': {'additionalProperties': False,
'properties': {'addresses': {'items': {'$ref': '#/definitions/Address'},
'type': 'array'},
'error': {'$ref': '#/definitions/Error'},
'modified': {'type': 'boolean'}},
'required': ['addresses',
'modified'],
'type': 'object'},
'SetProviderNetworkConfigResults': {'additionalProperties': False,
'properties': {'results': {'items': {'$ref': '#/definitions/SetProviderNetworkConfigResult'},
'type': 'array'}},
'required': ['results'],
'type': 'object'},
'SetStatus': {'additionalProperties': False,
'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'},
'type': 'array'}},
'required': ['entities'],
'type': 'object'},
'StatusResult': {'additionalProperties': False,
'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True,
'type': 'object'}},
'type': 'object'},
'error': {'$ref': '#/definitions/Error'},
'id': {'type': 'string'},
'info': {'type': 'string'},
'life': {'type': 'string'},
'since': {'format': 'date-time',
'type': 'string'},
'status': {'type': 'string'}},
'required': ['id',
'life',
'status',
'info',
'data',
'since'],
'type': 'object'},
'StatusResults': {'additionalProperties': False,
'properties': {'results': {'items': {'$ref': '#/definitions/StatusResult'},
'type': 'array'}},
'required': ['results'],
'type': 'object'},
'StringResult': {'additionalProperties': False,
'properties': {'error': {'$ref': '#/definitions/Error'},
'result': {'type': 'string'}},
'required': ['result'],
'type': 'object'},
'StringResults': {'additionalProperties': False,
'properties': {'results': {'items': {'$ref': '#/definitions/StringResult'},
'type': 'array'}},
'required': ['results'],
'type': 'object'},
'StringsWatchResult': {'additionalProperties': False,
'properties': {'changes': {'items': {'type': 'string'},
'type': 'array'},
'error': {'$ref': '#/definitions/Error'},
'watcher-id': {'type': 'string'}},
'required': ['watcher-id'],
'type': 'object'}},
'properties': {'AreManuallyProvisioned': {'description': 'AreManuallyProvisioned '
'returns whether '
'each given entity '
'is\n'
'manually '
'provisioned or not. '
'Only machine tags '
'are accepted.',
'properties': {'Params': {'$ref': '#/definitions/Entities'},
'Result': {'$ref': '#/definitions/BoolResults'}},
'type': 'object'},
'InstanceId': {'description': 'InstanceId returns the provider '
'specific instance id for each '
'given\n'
'machine or an '
'CodeNotProvisioned error, if '
'not set.',
'properties': {'Params': {'$ref': '#/definitions/Entities'},
'Result': {'$ref': '#/definitions/StringResults'}},
'type': 'object'},
'InstanceStatus': {'description': 'InstanceStatus returns the '
'instance status for each '
'given entity.\n'
'Only machine tags are '
'accepted.',
'properties': {'Params': {'$ref': '#/definitions/Entities'},
'Result': {'$ref': '#/definitions/StatusResults'}},
'type': 'object'},
'Life': {'description': 'Life returns the life status of every '
'supplied entity, where available.',
'properties': {'Params': {'$ref': '#/definitions/Entities'},
'Result': {'$ref': '#/definitions/LifeResults'}},
'type': 'object'},
'ModelConfig': {'description': 'ModelConfig returns the '
"current model's configuration.",
'properties': {'Result': {'$ref': '#/definitions/ModelConfigResult'}},
'type': 'object'},
'ProviderAddresses': {'description': 'ProviderAddresses '
'returns the list of all '
'known provider '
'addresses\n'
'for each given entity. '
'Only machine tags are '
'accepted.',
'properties': {'Params': {'$ref': '#/definitions/Entities'},
'Result': {'$ref': '#/definitions/MachineAddressesResults'}},
'type': 'object'},
'SetInstanceStatus': {'description': 'SetInstanceStatus '
'updates the instance '
'status for each given '
'entity.\n'
'Only machine tags are '
'accepted.',
'properties': {'Params': {'$ref': '#/definitions/SetStatus'},
'Result': {'$ref': '#/definitions/ErrorResults'}},
'type': 'object'},
'SetProviderAddresses': {'description': 'SetProviderAddresses '
'updates the list of '
'known provider '
'addresses\n'
'for each given '
'entity. Only machine '
'tags are accepted.',
'properties': {'Params': {'$ref': '#/definitions/SetMachinesAddresses'},
'Result': {'$ref': '#/definitions/ErrorResults'}},
'type': 'object'},
'SetProviderNetworkConfig': {'description': 'SetProviderNetworkConfig '
'updates the '
'provider '
'addresses for one '
'or more\n'
'machines.\n'
'\n'
"What's more, if "
'the client '
'request includes '
'provider-specific '
'IDs (e.g.\n'
'network, subnet '
'or address IDs), '
'this method will '
'also iterate any '
'present\n'
'link layer '
'devices (and '
'their addresses) '
'and merge in any '
'missing\n'
'provider-specific '
'information.',
'properties': {'Params': {'$ref': '#/definitions/SetProviderNetworkConfig'},
'Result': {'$ref': '#/definitions/SetProviderNetworkConfigResults'}},
'type': 'object'},
'Status': {'description': 'Status returns the status of each '
'given entity.',
'properties': {'Params': {'$ref': '#/definitions/Entities'},
'Result': {'$ref': '#/definitions/StatusResults'}},
'type': 'object'},
'WatchForModelConfigChanges': {'description': 'WatchForModelConfigChanges '
'returns a '
'NotifyWatcher '
'that observes\n'
'changes to the '
'model '
'configuration.\n'
'Note that '
'although the '
'NotifyWatchResult '
'contains an '
'Error field,\n'
"it's not used "
'because we are '
'only returning '
'a single '
'watcher,\n'
'so we use the '
'regular error '
'return.',
'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}},
'type': 'object'},
'WatchModelMachineStartTimes': {'description': 'WatchModelMachineStartTimes '
'watches the '
'non-container '
'machines in '
'the model\n'
'for changes to '
'the Life or '
'AgentStartTime '
'fields and '
'reports them '
'as a batch.',
'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}},
'type': 'object'},
'WatchModelMachines': {'description': 'WatchModelMachines '
'returns a '
'StringsWatcher that '
'notifies of\n'
'changes to the life '
'cycles of the top level '
'machines in the '
'current\n'
'model.',
'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}},
'type': 'object'}},
'type': 'object'}
[docs] @ReturnMapping(BoolResults)
async def AreManuallyProvisioned(self, entities=None):
'''
AreManuallyProvisioned returns whether each given entity is
manually provisioned or not. Only machine tags are accepted.
entities : typing.Sequence[~Entity]
Returns -> BoolResults
'''
if entities is not None and not isinstance(entities, (bytes, str, list)):
raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities)))
# map input types to rpc msg
_params = dict()
msg = dict(type='InstancePoller',
request='AreManuallyProvisioned',
version=4,
params=_params)
_params['entities'] = entities
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(StringResults)
async def InstanceId(self, entities=None):
'''
InstanceId returns the provider specific instance id for each given
machine or an CodeNotProvisioned error, if not set.
entities : typing.Sequence[~Entity]
Returns -> StringResults
'''
if entities is not None and not isinstance(entities, (bytes, str, list)):
raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities)))
# map input types to rpc msg
_params = dict()
msg = dict(type='InstancePoller',
request='InstanceId',
version=4,
params=_params)
_params['entities'] = entities
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(StatusResults)
async def InstanceStatus(self, entities=None):
'''
InstanceStatus returns the instance status for each given entity.
Only machine tags are accepted.
entities : typing.Sequence[~Entity]
Returns -> StatusResults
'''
if entities is not None and not isinstance(entities, (bytes, str, list)):
raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities)))
# map input types to rpc msg
_params = dict()
msg = dict(type='InstancePoller',
request='InstanceStatus',
version=4,
params=_params)
_params['entities'] = entities
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(LifeResults)
async def Life(self, entities=None):
'''
Life returns the life status of every supplied entity, where available.
entities : typing.Sequence[~Entity]
Returns -> LifeResults
'''
if entities is not None and not isinstance(entities, (bytes, str, list)):
raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities)))
# map input types to rpc msg
_params = dict()
msg = dict(type='InstancePoller',
request='Life',
version=4,
params=_params)
_params['entities'] = entities
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(ModelConfigResult)
async def ModelConfig(self):
'''
ModelConfig returns the current model's configuration.
Returns -> ModelConfigResult
'''
# map input types to rpc msg
_params = dict()
msg = dict(type='InstancePoller',
request='ModelConfig',
version=4,
params=_params)
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(MachineAddressesResults)
async def ProviderAddresses(self, entities=None):
'''
ProviderAddresses returns the list of all known provider addresses
for each given entity. Only machine tags are accepted.
entities : typing.Sequence[~Entity]
Returns -> MachineAddressesResults
'''
if entities is not None and not isinstance(entities, (bytes, str, list)):
raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities)))
# map input types to rpc msg
_params = dict()
msg = dict(type='InstancePoller',
request='ProviderAddresses',
version=4,
params=_params)
_params['entities'] = entities
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(ErrorResults)
async def SetInstanceStatus(self, entities=None):
'''
SetInstanceStatus updates the instance status for each given entity.
Only machine tags are accepted.
entities : typing.Sequence[~EntityStatusArgs]
Returns -> ErrorResults
'''
if entities is not None and not isinstance(entities, (bytes, str, list)):
raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities)))
# map input types to rpc msg
_params = dict()
msg = dict(type='InstancePoller',
request='SetInstanceStatus',
version=4,
params=_params)
_params['entities'] = entities
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(ErrorResults)
async def SetProviderAddresses(self, machine_addresses=None):
'''
SetProviderAddresses updates the list of known provider addresses
for each given entity. Only machine tags are accepted.
machine_addresses : typing.Sequence[~MachineAddresses]
Returns -> ErrorResults
'''
if machine_addresses is not None and not isinstance(machine_addresses, (bytes, str, list)):
raise Exception("Expected machine_addresses to be a Sequence, received: {}".format(type(machine_addresses)))
# map input types to rpc msg
_params = dict()
msg = dict(type='InstancePoller',
request='SetProviderAddresses',
version=4,
params=_params)
_params['machine-addresses'] = machine_addresses
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(SetProviderNetworkConfigResults)
async def SetProviderNetworkConfig(self, args=None):
'''
SetProviderNetworkConfig updates the provider addresses for one or more
machines.
What's more, if the client request includes provider-specific IDs (e.g.
network, subnet or address IDs), this method will also iterate any present
link layer devices (and their addresses) and merge in any missing
provider-specific information.
args : typing.Sequence[~ProviderNetworkConfig]
Returns -> SetProviderNetworkConfigResults
'''
if args is not None and not isinstance(args, (bytes, str, list)):
raise Exception("Expected args to be a Sequence, received: {}".format(type(args)))
# map input types to rpc msg
_params = dict()
msg = dict(type='InstancePoller',
request='SetProviderNetworkConfig',
version=4,
params=_params)
_params['args'] = args
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(StatusResults)
async def Status(self, entities=None):
'''
Status returns the status of each given entity.
entities : typing.Sequence[~Entity]
Returns -> StatusResults
'''
if entities is not None and not isinstance(entities, (bytes, str, list)):
raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities)))
# map input types to rpc msg
_params = dict()
msg = dict(type='InstancePoller',
request='Status',
version=4,
params=_params)
_params['entities'] = entities
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(StringsWatchResult)
async def WatchModelMachineStartTimes(self):
'''
WatchModelMachineStartTimes watches the non-container machines in the model
for changes to the Life or AgentStartTime fields and reports them as a batch.
Returns -> StringsWatchResult
'''
# map input types to rpc msg
_params = dict()
msg = dict(type='InstancePoller',
request='WatchModelMachineStartTimes',
version=4,
params=_params)
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(StringsWatchResult)
async def WatchModelMachines(self):
'''
WatchModelMachines returns a StringsWatcher that notifies of
changes to the life cycles of the top level machines in the current
model.
Returns -> StringsWatchResult
'''
# map input types to rpc msg
_params = dict()
msg = dict(type='InstancePoller',
request='WatchModelMachines',
version=4,
params=_params)
reply = await self.rpc(msg)
return reply
[docs]class ModelGenerationFacade(Type):
name = 'ModelGeneration'
version = 4
schema = {'definitions': {'BoolResult': {'additionalProperties': False,
'properties': {'error': {'$ref': '#/definitions/Error'},
'result': {'type': 'boolean'}},
'required': ['result'],
'type': 'object'},
'BranchArg': {'additionalProperties': False,
'properties': {'branch': {'type': 'string'}},
'required': ['branch'],
'type': 'object'},
'BranchInfoArgs': {'additionalProperties': False,
'properties': {'branches': {'items': {'type': 'string'},
'type': 'array'},
'detailed': {'type': 'boolean'}},
'required': ['branches', 'detailed'],
'type': 'object'},
'BranchResults': {'additionalProperties': False,
'properties': {'error': {'$ref': '#/definitions/Error'},
'generations': {'items': {'$ref': '#/definitions/Generation'},
'type': 'array'}},
'required': ['generations'],
'type': 'object'},
'BranchTrackArg': {'additionalProperties': False,
'properties': {'branch': {'type': 'string'},
'entities': {'items': {'$ref': '#/definitions/Entity'},
'type': 'array'},
'num-units': {'type': 'integer'}},
'required': ['branch', 'entities'],
'type': 'object'},
'Entity': {'additionalProperties': False,
'properties': {'tag': {'type': 'string'}},
'required': ['tag'],
'type': 'object'},
'Error': {'additionalProperties': False,
'properties': {'code': {'type': 'string'},
'info': {'patternProperties': {'.*': {'additionalProperties': True,
'type': 'object'}},
'type': 'object'},
'message': {'type': 'string'}},
'required': ['message', 'code'],
'type': 'object'},
'ErrorResult': {'additionalProperties': False,
'properties': {'error': {'$ref': '#/definitions/Error'}},
'type': 'object'},
'ErrorResults': {'additionalProperties': False,
'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'},
'type': 'array'}},
'required': ['results'],
'type': 'object'},
'Generation': {'additionalProperties': False,
'properties': {'applications': {'items': {'$ref': '#/definitions/GenerationApplication'},
'type': 'array'},
'branch': {'type': 'string'},
'completed': {'type': 'integer'},
'completed-by': {'type': 'string'},
'created': {'type': 'integer'},
'created-by': {'type': 'string'},
'generation-id': {'type': 'integer'}},
'required': ['branch',
'created',
'created-by',
'applications'],
'type': 'object'},
'GenerationApplication': {'additionalProperties': False,
'properties': {'application': {'type': 'string'},
'config': {'patternProperties': {'.*': {'additionalProperties': True,
'type': 'object'}},
'type': 'object'},
'pending': {'items': {'type': 'string'},
'type': 'array'},
'progress': {'type': 'string'},
'tracking': {'items': {'type': 'string'},
'type': 'array'}},
'required': ['application',
'progress',
'config'],
'type': 'object'},
'GenerationId': {'additionalProperties': False,
'properties': {'generation-id': {'type': 'integer'}},
'required': ['generation-id'],
'type': 'object'},
'GenerationResult': {'additionalProperties': False,
'properties': {'error': {'$ref': '#/definitions/Error'},
'generation': {'$ref': '#/definitions/Generation'}},
'required': ['generation'],
'type': 'object'},
'IntResult': {'additionalProperties': False,
'properties': {'error': {'$ref': '#/definitions/Error'},
'result': {'type': 'integer'}},
'required': ['result'],
'type': 'object'}},
'properties': {'AbortBranch': {'description': 'AbortBranch aborts the input '
'branch, marking it complete. '
'However no\n'
'changes are made applicable to '
'the whole model. No units may '
'be assigned\n'
'to the branch when aborting.',
'properties': {'Params': {'$ref': '#/definitions/BranchArg'},
'Result': {'$ref': '#/definitions/ErrorResult'}},
'type': 'object'},
'AddBranch': {'description': 'AddBranch adds a new branch with '
'the input name to the model.',
'properties': {'Params': {'$ref': '#/definitions/BranchArg'},
'Result': {'$ref': '#/definitions/ErrorResult'}},
'type': 'object'},
'BranchInfo': {'description': 'BranchInfo will return details '
'of branch identified by the '
'input argument,\n'
'including units on the branch '
'and the configuration disjoint '
'with the\n'
'master generation.\n'
'An error is returned if no '
'in-flight branch matching in '
'input is found.',
'properties': {'Params': {'$ref': '#/definitions/BranchInfoArgs'},
'Result': {'$ref': '#/definitions/BranchResults'}},
'type': 'object'},
'CommitBranch': {'description': 'CommitBranch commits the '
'input branch, making its '
'changes applicable to\n'
'the whole model and marking '
'it complete.',
'properties': {'Params': {'$ref': '#/definitions/BranchArg'},
'Result': {'$ref': '#/definitions/IntResult'}},
'type': 'object'},
'HasActiveBranch': {'description': 'HasActiveBranch returns a '
'true result if the input '
'model has an "in-flight"\n'
'branch matching the input '
'name.',
'properties': {'Params': {'$ref': '#/definitions/BranchArg'},
'Result': {'$ref': '#/definitions/BoolResult'}},
'type': 'object'},
'ListCommits': {'description': 'ListCommits will return the '
'commits, hence only branches '
'with generation_id higher than '
'0',
'properties': {'Result': {'$ref': '#/definitions/BranchResults'}},
'type': 'object'},
'ShowCommit': {'description': 'ShowCommit will return details '
'a commit given by its '
'generationId\n'
'An error is returned if either '
'no branch can be found '
'corresponding to the generation '
'id.\n'
'Or the generation id given is '
'below 1.',
'properties': {'Params': {'$ref': '#/definitions/GenerationId'},
'Result': {'$ref': '#/definitions/GenerationResult'}},
'type': 'object'},
'TrackBranch': {'description': 'TrackBranch marks the input '
'units and/or applications as '
'tracking the input\n'
'branch, causing them to '
'realise changes made under '
'that branch.',
'properties': {'Params': {'$ref': '#/definitions/BranchTrackArg'},
'Result': {'$ref': '#/definitions/ErrorResults'}},
'type': 'object'}},
'type': 'object'}
[docs] @ReturnMapping(ErrorResult)
async def AbortBranch(self, branch=None):
'''
AbortBranch aborts the input branch, marking it complete. However no
changes are made applicable to the whole model. No units may be assigned
to the branch when aborting.
branch : str
Returns -> ErrorResult
'''
if branch is not None and not isinstance(branch, (bytes, str)):
raise Exception("Expected branch to be a str, received: {}".format(type(branch)))
# map input types to rpc msg
_params = dict()
msg = dict(type='ModelGeneration',
request='AbortBranch',
version=4,
params=_params)
_params['branch'] = branch
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(ErrorResult)
async def AddBranch(self, branch=None):
'''
AddBranch adds a new branch with the input name to the model.
branch : str
Returns -> ErrorResult
'''
if branch is not None and not isinstance(branch, (bytes, str)):
raise Exception("Expected branch to be a str, received: {}".format(type(branch)))
# map input types to rpc msg
_params = dict()
msg = dict(type='ModelGeneration',
request='AddBranch',
version=4,
params=_params)
_params['branch'] = branch
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(BranchResults)
async def BranchInfo(self, branches=None, detailed=None):
'''
BranchInfo will return details of branch identified by the input argument,
including units on the branch and the configuration disjoint with the
master generation.
An error is returned if no in-flight branch matching in input is found.
branches : typing.Sequence[str]
detailed : bool
Returns -> BranchResults
'''
if branches is not None and not isinstance(branches, (bytes, str, list)):
raise Exception("Expected branches to be a Sequence, received: {}".format(type(branches)))
if detailed is not None and not isinstance(detailed, bool):
raise Exception("Expected detailed to be a bool, received: {}".format(type(detailed)))
# map input types to rpc msg
_params = dict()
msg = dict(type='ModelGeneration',
request='BranchInfo',
version=4,
params=_params)
_params['branches'] = branches
_params['detailed'] = detailed
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(IntResult)
async def CommitBranch(self, branch=None):
'''
CommitBranch commits the input branch, making its changes applicable to
the whole model and marking it complete.
branch : str
Returns -> IntResult
'''
if branch is not None and not isinstance(branch, (bytes, str)):
raise Exception("Expected branch to be a str, received: {}".format(type(branch)))
# map input types to rpc msg
_params = dict()
msg = dict(type='ModelGeneration',
request='CommitBranch',
version=4,
params=_params)
_params['branch'] = branch
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(BoolResult)
async def HasActiveBranch(self, branch=None):
'''
HasActiveBranch returns a true result if the input model has an "in-flight"
branch matching the input name.
branch : str
Returns -> BoolResult
'''
if branch is not None and not isinstance(branch, (bytes, str)):
raise Exception("Expected branch to be a str, received: {}".format(type(branch)))
# map input types to rpc msg
_params = dict()
msg = dict(type='ModelGeneration',
request='HasActiveBranch',
version=4,
params=_params)
_params['branch'] = branch
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(BranchResults)
async def ListCommits(self):
'''
ListCommits will return the commits, hence only branches with generation_id higher than 0
Returns -> BranchResults
'''
# map input types to rpc msg
_params = dict()
msg = dict(type='ModelGeneration',
request='ListCommits',
version=4,
params=_params)
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(GenerationResult)
async def ShowCommit(self, generation_id=None):
'''
ShowCommit will return details a commit given by its generationId
An error is returned if either no branch can be found corresponding to the generation id.
Or the generation id given is below 1.
generation_id : int
Returns -> GenerationResult
'''
if generation_id is not None and not isinstance(generation_id, int):
raise Exception("Expected generation_id to be a int, received: {}".format(type(generation_id)))
# map input types to rpc msg
_params = dict()
msg = dict(type='ModelGeneration',
request='ShowCommit',
version=4,
params=_params)
_params['generation-id'] = generation_id
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(ErrorResults)
async def TrackBranch(self, branch=None, entities=None, num_units=None):
'''
TrackBranch marks the input units and/or applications as tracking the input
branch, causing them to realise changes made under that branch.
branch : str
entities : typing.Sequence[~Entity]
num_units : int
Returns -> ErrorResults
'''
if branch is not None and not isinstance(branch, (bytes, str)):
raise Exception("Expected branch to be a str, received: {}".format(type(branch)))
if entities is not None and not isinstance(entities, (bytes, str, list)):
raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities)))
if num_units is not None and not isinstance(num_units, int):
raise Exception("Expected num_units to be a int, received: {}".format(type(num_units)))
# map input types to rpc msg
_params = dict()
msg = dict(type='ModelGeneration',
request='TrackBranch',
version=4,
params=_params)
_params['branch'] = branch
_params['entities'] = entities
_params['num-units'] = num_units
reply = await self.rpc(msg)
return reply
[docs]class SSHClientFacade(Type):
name = 'SSHClient'
version = 4
schema = {'definitions': {'CloudCredential': {'additionalProperties': False,
'properties': {'attrs': {'patternProperties': {'.*': {'type': 'string'}},
'type': 'object'},
'auth-type': {'type': 'string'},
'redacted': {'items': {'type': 'string'},
'type': 'array'}},
'required': ['auth-type'],
'type': 'object'},
'CloudSpec': {'additionalProperties': False,
'properties': {'cacertificates': {'items': {'type': 'string'},
'type': 'array'},
'credential': {'$ref': '#/definitions/CloudCredential'},
'endpoint': {'type': 'string'},
'identity-endpoint': {'type': 'string'},
'is-controller-cloud': {'type': 'boolean'},
'name': {'type': 'string'},
'region': {'type': 'string'},
'skip-tls-verify': {'type': 'boolean'},
'storage-endpoint': {'type': 'string'},
'type': {'type': 'string'}},
'required': ['type', 'name'],
'type': 'object'},
'CloudSpecResult': {'additionalProperties': False,
'properties': {'error': {'$ref': '#/definitions/Error'},
'result': {'$ref': '#/definitions/CloudSpec'}},
'type': 'object'},
'Entities': {'additionalProperties': False,
'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'},
'type': 'array'}},
'required': ['entities'],
'type': 'object'},
'Entity': {'additionalProperties': False,
'properties': {'tag': {'type': 'string'}},
'required': ['tag'],
'type': 'object'},
'Error': {'additionalProperties': False,
'properties': {'code': {'type': 'string'},
'info': {'patternProperties': {'.*': {'additionalProperties': True,
'type': 'object'}},
'type': 'object'},
'message': {'type': 'string'}},
'required': ['message', 'code'],
'type': 'object'},
'SSHAddressResult': {'additionalProperties': False,
'properties': {'address': {'type': 'string'},
'error': {'$ref': '#/definitions/Error'}},
'type': 'object'},
'SSHAddressResults': {'additionalProperties': False,
'properties': {'results': {'items': {'$ref': '#/definitions/SSHAddressResult'},
'type': 'array'}},
'required': ['results'],
'type': 'object'},
'SSHAddressesResult': {'additionalProperties': False,
'properties': {'addresses': {'items': {'type': 'string'},
'type': 'array'},
'error': {'$ref': '#/definitions/Error'}},
'required': ['addresses'],
'type': 'object'},
'SSHAddressesResults': {'additionalProperties': False,
'properties': {'results': {'items': {'$ref': '#/definitions/SSHAddressesResult'},
'type': 'array'}},
'required': ['results'],
'type': 'object'},
'SSHProxyResult': {'additionalProperties': False,
'properties': {'use-proxy': {'type': 'boolean'}},
'required': ['use-proxy'],
'type': 'object'},
'SSHPublicKeysResult': {'additionalProperties': False,
'properties': {'error': {'$ref': '#/definitions/Error'},
'public-keys': {'items': {'type': 'string'},
'type': 'array'}},
'type': 'object'},
'SSHPublicKeysResults': {'additionalProperties': False,
'properties': {'results': {'items': {'$ref': '#/definitions/SSHPublicKeysResult'},
'type': 'array'}},
'required': ['results'],
'type': 'object'}},
'properties': {'AllAddresses': {'description': 'AllAddresses reports all '
'addresses that might have SSH '
'listening for each\n'
'entity in args. The result is '
'sorted with public addresses '
'first.\n'
'Machines and units are '
'supported as entity types.',
'properties': {'Params': {'$ref': '#/definitions/Entities'},
'Result': {'$ref': '#/definitions/SSHAddressesResults'}},
'type': 'object'},
'ModelCredentialForSSH': {'description': 'ModelCredentialForSSH '
'returns a cloud spec '
'for ssh purpose.\n'
'This facade call is '
'only used for k8s '
'model.',
'properties': {'Result': {'$ref': '#/definitions/CloudSpecResult'}},
'type': 'object'},
'PrivateAddress': {'description': 'PrivateAddress reports the '
'preferred private network '
'address for one or\n'
'more entities. Machines and '
'units are supported.',
'properties': {'Params': {'$ref': '#/definitions/Entities'},
'Result': {'$ref': '#/definitions/SSHAddressResults'}},
'type': 'object'},
'Proxy': {'description': 'Proxy returns whether SSH '
'connections should be proxied '
'through the\n'
'controller hosts for the model '
'associated with the API connection.',
'properties': {'Result': {'$ref': '#/definitions/SSHProxyResult'}},
'type': 'object'},
'PublicAddress': {'description': 'PublicAddress reports the '
'preferred public network '
'address for one\n'
'or more entities. Machines '
'and units are supported.',
'properties': {'Params': {'$ref': '#/definitions/Entities'},
'Result': {'$ref': '#/definitions/SSHAddressResults'}},
'type': 'object'},
'PublicKeys': {'description': 'PublicKeys returns the public '
'SSH hosts for one or more\n'
'entities. Machines and units '
'are supported.',
'properties': {'Params': {'$ref': '#/definitions/Entities'},
'Result': {'$ref': '#/definitions/SSHPublicKeysResults'}},
'type': 'object'}},
'type': 'object'}
[docs] @ReturnMapping(SSHAddressesResults)
async def AllAddresses(self, entities=None):
'''
AllAddresses reports all addresses that might have SSH listening for each
entity in args. The result is sorted with public addresses first.
Machines and units are supported as entity types.
entities : typing.Sequence[~Entity]
Returns -> SSHAddressesResults
'''
if entities is not None and not isinstance(entities, (bytes, str, list)):
raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities)))
# map input types to rpc msg
_params = dict()
msg = dict(type='SSHClient',
request='AllAddresses',
version=4,
params=_params)
_params['entities'] = entities
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(SSHAddressResults)
async def PrivateAddress(self, entities=None):
'''
PrivateAddress reports the preferred private network address for one or
more entities. Machines and units are supported.
entities : typing.Sequence[~Entity]
Returns -> SSHAddressResults
'''
if entities is not None and not isinstance(entities, (bytes, str, list)):
raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities)))
# map input types to rpc msg
_params = dict()
msg = dict(type='SSHClient',
request='PrivateAddress',
version=4,
params=_params)
_params['entities'] = entities
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(SSHProxyResult)
async def Proxy(self):
'''
Proxy returns whether SSH connections should be proxied through the
controller hosts for the model associated with the API connection.
Returns -> SSHProxyResult
'''
# map input types to rpc msg
_params = dict()
msg = dict(type='SSHClient',
request='Proxy',
version=4,
params=_params)
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(SSHAddressResults)
async def PublicAddress(self, entities=None):
'''
PublicAddress reports the preferred public network address for one
or more entities. Machines and units are supported.
entities : typing.Sequence[~Entity]
Returns -> SSHAddressResults
'''
if entities is not None and not isinstance(entities, (bytes, str, list)):
raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities)))
# map input types to rpc msg
_params = dict()
msg = dict(type='SSHClient',
request='PublicAddress',
version=4,
params=_params)
_params['entities'] = entities
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(SSHPublicKeysResults)
async def PublicKeys(self, entities=None):
'''
PublicKeys returns the public SSH hosts for one or more
entities. Machines and units are supported.
entities : typing.Sequence[~Entity]
Returns -> SSHPublicKeysResults
'''
if entities is not None and not isinstance(entities, (bytes, str, list)):
raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities)))
# map input types to rpc msg
_params = dict()
msg = dict(type='SSHClient',
request='PublicKeys',
version=4,
params=_params)
_params['entities'] = entities
reply = await self.rpc(msg)
return reply
[docs]class StorageProvisionerFacade(Type):
name = 'StorageProvisioner'
version = 4
schema = {'definitions': {'BlockDevice': {'additionalProperties': False,
'properties': {'BusAddress': {'type': 'string'},
'DeviceLinks': {'items': {'type': 'string'},
'type': 'array'},
'DeviceName': {'type': 'string'},
'FilesystemType': {'type': 'string'},
'HardwareId': {'type': 'string'},
'InUse': {'type': 'boolean'},
'Label': {'type': 'string'},
'MountPoint': {'type': 'string'},
'SerialId': {'type': 'string'},
'Size': {'type': 'integer'},
'UUID': {'type': 'string'},
'WWN': {'type': 'string'}},
'required': ['DeviceName',
'DeviceLinks',
'Label',
'UUID',
'HardwareId',
'WWN',
'BusAddress',
'Size',
'FilesystemType',
'InUse',
'MountPoint',
'SerialId'],
'type': 'object'},
'BlockDeviceResult': {'additionalProperties': False,
'properties': {'error': {'$ref': '#/definitions/Error'},
'result': {'$ref': '#/definitions/BlockDevice'}},
'required': ['result'],
'type': 'object'},
'BlockDeviceResults': {'additionalProperties': False,
'properties': {'results': {'items': {'$ref': '#/definitions/BlockDeviceResult'},
'type': 'array'}},
'type': 'object'},
'Entities': {'additionalProperties': False,
'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'},
'type': 'array'}},
'required': ['entities'],
'type': 'object'},
'Entity': {'additionalProperties': False,
'properties': {'tag': {'type': 'string'}},
'required': ['tag'],
'type': 'object'},
'EntityStatusArgs': {'additionalProperties': False,
'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True,
'type': 'object'}},
'type': 'object'},
'info': {'type': 'string'},
'status': {'type': 'string'},
'tag': {'type': 'string'}},
'required': ['tag',
'status',
'info',
'data'],
'type': 'object'},
'Error': {'additionalProperties': False,
'properties': {'code': {'type': 'string'},
'info': {'patternProperties': {'.*': {'additionalProperties': True,
'type': 'object'}},
'type': 'object'},
'message': {'type': 'string'}},
'required': ['message', 'code'],
'type': 'object'},
'ErrorResult': {'additionalProperties': False,
'properties': {'error': {'$ref': '#/definitions/Error'}},
'type': 'object'},
'ErrorResults': {'additionalProperties': False,
'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'},
'type': 'array'}},
'required': ['results'],
'type': 'object'},
'Filesystem': {'additionalProperties': False,
'properties': {'filesystem-tag': {'type': 'string'},
'info': {'$ref': '#/definitions/FilesystemInfo'},
'volume-tag': {'type': 'string'}},
'required': ['filesystem-tag', 'info'],
'type': 'object'},
'FilesystemAttachment': {'additionalProperties': False,
'properties': {'filesystem-tag': {'type': 'string'},
'info': {'$ref': '#/definitions/FilesystemAttachmentInfo'},
'machine-tag': {'type': 'string'}},
'required': ['filesystem-tag',
'machine-tag',
'info'],
'type': 'object'},
'FilesystemAttachmentInfo': {'additionalProperties': False,
'properties': {'mount-point': {'type': 'string'},
'read-only': {'type': 'boolean'}},
'type': 'object'},
'FilesystemAttachmentParams': {'additionalProperties': False,
'properties': {'filesystem-id': {'type': 'string'},
'filesystem-tag': {'type': 'string'},
'instance-id': {'type': 'string'},
'machine-tag': {'type': 'string'},
'mount-point': {'type': 'string'},
'provider': {'type': 'string'},
'read-only': {'type': 'boolean'}},
'required': ['filesystem-tag',
'machine-tag',
'provider'],
'type': 'object'},
'FilesystemAttachmentParamsResult': {'additionalProperties': False,
'properties': {'error': {'$ref': '#/definitions/Error'},
'result': {'$ref': '#/definitions/FilesystemAttachmentParams'}},
'required': ['result'],
'type': 'object'},
'FilesystemAttachmentParamsResults': {'additionalProperties': False,
'properties': {'results': {'items': {'$ref': '#/definitions/FilesystemAttachmentParamsResult'},
'type': 'array'}},
'type': 'object'},
'FilesystemAttachmentResult': {'additionalProperties': False,
'properties': {'error': {'$ref': '#/definitions/Error'},
'result': {'$ref': '#/definitions/FilesystemAttachment'}},
'required': ['result'],
'type': 'object'},
'FilesystemAttachmentResults': {'additionalProperties': False,
'properties': {'results': {'items': {'$ref': '#/definitions/FilesystemAttachmentResult'},
'type': 'array'}},
'type': 'object'},
'FilesystemAttachments': {'additionalProperties': False,
'properties': {'filesystem-attachments': {'items': {'$ref': '#/definitions/FilesystemAttachment'},
'type': 'array'}},
'required': ['filesystem-attachments'],
'type': 'object'},
'FilesystemInfo': {'additionalProperties': False,
'properties': {'filesystem-id': {'type': 'string'},
'pool': {'type': 'string'},
'size': {'type': 'integer'}},
'required': ['filesystem-id',
'pool',
'size'],
'type': 'object'},
'FilesystemParams': {'additionalProperties': False,
'properties': {'attachment': {'$ref': '#/definitions/FilesystemAttachmentParams'},
'attributes': {'patternProperties': {'.*': {'additionalProperties': True,
'type': 'object'}},
'type': 'object'},
'filesystem-tag': {'type': 'string'},
'provider': {'type': 'string'},
'size': {'type': 'integer'},
'tags': {'patternProperties': {'.*': {'type': 'string'}},
'type': 'object'},
'volume-tag': {'type': 'string'}},
'required': ['filesystem-tag',
'size',
'provider'],
'type': 'object'},
'FilesystemParamsResult': {'additionalProperties': False,
'properties': {'error': {'$ref': '#/definitions/Error'},
'result': {'$ref': '#/definitions/FilesystemParams'}},
'required': ['result'],
'type': 'object'},
'FilesystemParamsResults': {'additionalProperties': False,
'properties': {'results': {'items': {'$ref': '#/definitions/FilesystemParamsResult'},
'type': 'array'}},
'type': 'object'},
'FilesystemResult': {'additionalProperties': False,
'properties': {'error': {'$ref': '#/definitions/Error'},
'result': {'$ref': '#/definitions/Filesystem'}},
'required': ['result'],
'type': 'object'},
'FilesystemResults': {'additionalProperties': False,
'properties': {'results': {'items': {'$ref': '#/definitions/FilesystemResult'},
'type': 'array'}},
'type': 'object'},
'Filesystems': {'additionalProperties': False,
'properties': {'filesystems': {'items': {'$ref': '#/definitions/Filesystem'},
'type': 'array'}},
'required': ['filesystems'],
'type': 'object'},
'LifeResult': {'additionalProperties': False,
'properties': {'error': {'$ref': '#/definitions/Error'},
'life': {'type': 'string'}},
'required': ['life'],
'type': 'object'},
'LifeResults': {'additionalProperties': False,
'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'},
'type': 'array'}},
'required': ['results'],
'type': 'object'},
'MachineStorageId': {'additionalProperties': False,
'properties': {'attachment-tag': {'type': 'string'},
'machine-tag': {'type': 'string'}},
'required': ['machine-tag',
'attachment-tag'],
'type': 'object'},
'MachineStorageIds': {'additionalProperties': False,
'properties': {'ids': {'items': {'$ref': '#/definitions/MachineStorageId'},
'type': 'array'}},
'required': ['ids'],
'type': 'object'},
'MachineStorageIdsWatchResult': {'additionalProperties': False,
'properties': {'changes': {'items': {'$ref': '#/definitions/MachineStorageId'},
'type': 'array'},
'error': {'$ref': '#/definitions/Error'},
'watcher-id': {'type': 'string'}},
'required': ['watcher-id',
'changes'],
'type': 'object'},
'MachineStorageIdsWatchResults': {'additionalProperties': False,
'properties': {'results': {'items': {'$ref': '#/definitions/MachineStorageIdsWatchResult'},
'type': 'array'}},
'required': ['results'],
'type': 'object'},
'NotifyWatchResult': {'additionalProperties': False,
'properties': {'NotifyWatcherId': {'type': 'string'},
'error': {'$ref': '#/definitions/Error'}},
'required': ['NotifyWatcherId'],
'type': 'object'},
'NotifyWatchResults': {'additionalProperties': False,
'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'},
'type': 'array'}},
'required': ['results'],
'type': 'object'},
'RemoveFilesystemParams': {'additionalProperties': False,
'properties': {'destroy': {'type': 'boolean'},
'filesystem-id': {'type': 'string'},
'provider': {'type': 'string'}},
'required': ['provider',
'filesystem-id'],
'type': 'object'},
'RemoveFilesystemParamsResult': {'additionalProperties': False,
'properties': {'error': {'$ref': '#/definitions/Error'},
'result': {'$ref': '#/definitions/RemoveFilesystemParams'}},
'required': ['result'],
'type': 'object'},
'RemoveFilesystemParamsResults': {'additionalProperties': False,
'properties': {'results': {'items': {'$ref': '#/definitions/RemoveFilesystemParamsResult'},
'type': 'array'}},
'type': 'object'},
'RemoveVolumeParams': {'additionalProperties': False,
'properties': {'destroy': {'type': 'boolean'},
'provider': {'type': 'string'},
'volume-id': {'type': 'string'}},
'required': ['provider', 'volume-id'],
'type': 'object'},
'RemoveVolumeParamsResult': {'additionalProperties': False,
'properties': {'error': {'$ref': '#/definitions/Error'},
'result': {'$ref': '#/definitions/RemoveVolumeParams'}},
'required': ['result'],
'type': 'object'},
'RemoveVolumeParamsResults': {'additionalProperties': False,
'properties': {'results': {'items': {'$ref': '#/definitions/RemoveVolumeParamsResult'},
'type': 'array'}},
'type': 'object'},
'SetStatus': {'additionalProperties': False,
'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'},
'type': 'array'}},
'required': ['entities'],
'type': 'object'},
'StringResult': {'additionalProperties': False,
'properties': {'error': {'$ref': '#/definitions/Error'},
'result': {'type': 'string'}},
'required': ['result'],
'type': 'object'},
'StringResults': {'additionalProperties': False,
'properties': {'results': {'items': {'$ref': '#/definitions/StringResult'},
'type': 'array'}},
'required': ['results'],
'type': 'object'},
'StringsWatchResult': {'additionalProperties': False,
'properties': {'changes': {'items': {'type': 'string'},
'type': 'array'},
'error': {'$ref': '#/definitions/Error'},
'watcher-id': {'type': 'string'}},
'required': ['watcher-id'],
'type': 'object'},
'StringsWatchResults': {'additionalProperties': False,
'properties': {'results': {'items': {'$ref': '#/definitions/StringsWatchResult'},
'type': 'array'}},
'required': ['results'],
'type': 'object'},
'Volume': {'additionalProperties': False,
'properties': {'info': {'$ref': '#/definitions/VolumeInfo'},
'volume-tag': {'type': 'string'}},
'required': ['volume-tag', 'info'],
'type': 'object'},
'VolumeAttachment': {'additionalProperties': False,
'properties': {'info': {'$ref': '#/definitions/VolumeAttachmentInfo'},
'machine-tag': {'type': 'string'},
'volume-tag': {'type': 'string'}},
'required': ['volume-tag',
'machine-tag',
'info'],
'type': 'object'},
'VolumeAttachmentInfo': {'additionalProperties': False,
'properties': {'bus-address': {'type': 'string'},
'device-link': {'type': 'string'},
'device-name': {'type': 'string'},
'plan-info': {'$ref': '#/definitions/VolumeAttachmentPlanInfo'},
'read-only': {'type': 'boolean'}},
'type': 'object'},
'VolumeAttachmentParams': {'additionalProperties': False,
'properties': {'instance-id': {'type': 'string'},
'machine-tag': {'type': 'string'},
'provider': {'type': 'string'},
'read-only': {'type': 'boolean'},
'volume-id': {'type': 'string'},
'volume-tag': {'type': 'string'}},
'required': ['volume-tag',
'machine-tag',
'provider'],
'type': 'object'},
'VolumeAttachmentParamsResult': {'additionalProperties': False,
'properties': {'error': {'$ref': '#/definitions/Error'},
'result': {'$ref': '#/definitions/VolumeAttachmentParams'}},
'required': ['result'],
'type': 'object'},
'VolumeAttachmentParamsResults': {'additionalProperties': False,
'properties': {'results': {'items': {'$ref': '#/definitions/VolumeAttachmentParamsResult'},
'type': 'array'}},
'type': 'object'},
'VolumeAttachmentPlan': {'additionalProperties': False,
'properties': {'block-device': {'$ref': '#/definitions/BlockDevice'},
'life': {'type': 'string'},
'machine-tag': {'type': 'string'},
'plan-info': {'$ref': '#/definitions/VolumeAttachmentPlanInfo'},
'volume-tag': {'type': 'string'}},
'required': ['volume-tag',
'machine-tag',
'plan-info'],
'type': 'object'},
'VolumeAttachmentPlanInfo': {'additionalProperties': False,
'properties': {'device-attributes': {'patternProperties': {'.*': {'type': 'string'}},
'type': 'object'},
'device-type': {'type': 'string'}},
'type': 'object'},
'VolumeAttachmentPlanResult': {'additionalProperties': False,
'properties': {'error': {'$ref': '#/definitions/Error'},
'result': {'$ref': '#/definitions/VolumeAttachmentPlan'}},
'required': ['result'],
'type': 'object'},
'VolumeAttachmentPlanResults': {'additionalProperties': False,
'properties': {'results': {'items': {'$ref': '#/definitions/VolumeAttachmentPlanResult'},
'type': 'array'}},
'type': 'object'},
'VolumeAttachmentPlans': {'additionalProperties': False,
'properties': {'volume-plans': {'items': {'$ref': '#/definitions/VolumeAttachmentPlan'},
'type': 'array'}},
'required': ['volume-plans'],
'type': 'object'},
'VolumeAttachmentResult': {'additionalProperties': False,
'properties': {'error': {'$ref': '#/definitions/Error'},
'result': {'$ref': '#/definitions/VolumeAttachment'}},
'required': ['result'],
'type': 'object'},
'VolumeAttachmentResults': {'additionalProperties': False,
'properties': {'results': {'items': {'$ref': '#/definitions/VolumeAttachmentResult'},
'type': 'array'}},
'type': 'object'},
'VolumeAttachments': {'additionalProperties': False,
'properties': {'volume-attachments': {'items': {'$ref': '#/definitions/VolumeAttachment'},
'type': 'array'}},
'required': ['volume-attachments'],
'type': 'object'},
'VolumeInfo': {'additionalProperties': False,
'properties': {'hardware-id': {'type': 'string'},
'persistent': {'type': 'boolean'},
'pool': {'type': 'string'},
'size': {'type': 'integer'},
'volume-id': {'type': 'string'},
'wwn': {'type': 'string'}},
'required': ['volume-id', 'size', 'persistent'],
'type': 'object'},
'VolumeParams': {'additionalProperties': False,
'properties': {'attachment': {'$ref': '#/definitions/VolumeAttachmentParams'},
'attributes': {'patternProperties': {'.*': {'additionalProperties': True,
'type': 'object'}},
'type': 'object'},
'provider': {'type': 'string'},
'size': {'type': 'integer'},
'tags': {'patternProperties': {'.*': {'type': 'string'}},
'type': 'object'},
'volume-tag': {'type': 'string'}},
'required': ['volume-tag',
'size',
'provider'],
'type': 'object'},
'VolumeParamsResult': {'additionalProperties': False,
'properties': {'error': {'$ref': '#/definitions/Error'},
'result': {'$ref': '#/definitions/VolumeParams'}},
'required': ['result'],
'type': 'object'},
'VolumeParamsResults': {'additionalProperties': False,
'properties': {'results': {'items': {'$ref': '#/definitions/VolumeParamsResult'},
'type': 'array'}},
'type': 'object'},
'VolumeResult': {'additionalProperties': False,
'properties': {'error': {'$ref': '#/definitions/Error'},
'result': {'$ref': '#/definitions/Volume'}},
'required': ['result'],
'type': 'object'},
'VolumeResults': {'additionalProperties': False,
'properties': {'results': {'items': {'$ref': '#/definitions/VolumeResult'},
'type': 'array'}},
'type': 'object'},
'Volumes': {'additionalProperties': False,
'properties': {'volumes': {'items': {'$ref': '#/definitions/Volume'},
'type': 'array'}},
'required': ['volumes'],
'type': 'object'}},
'properties': {'AttachmentLife': {'description': 'AttachmentLife returns the '
'lifecycle state of each '
'specified machine\n'
'storage attachment.',
'properties': {'Params': {'$ref': '#/definitions/MachineStorageIds'},
'Result': {'$ref': '#/definitions/LifeResults'}},
'type': 'object'},
'CreateVolumeAttachmentPlans': {'properties': {'Params': {'$ref': '#/definitions/VolumeAttachmentPlans'},
'Result': {'$ref': '#/definitions/ErrorResults'}},
'type': 'object'},
'EnsureDead': {'description': 'EnsureDead calls EnsureDead on '
'each given entity from state. '
'It\n'
'will fail if the entity is not '
"present. If it's Alive, nothing "
'will\n'
'happen (see state/EnsureDead() '
'for units or machines).',
'properties': {'Params': {'$ref': '#/definitions/Entities'},
'Result': {'$ref': '#/definitions/ErrorResults'}},
'type': 'object'},
'FilesystemAttachmentParams': {'description': 'FilesystemAttachmentParams '
'returns the '
'parameters for '
'creating the '
'filesystem\n'
'attachments '
'with the '
'specified IDs.',
'properties': {'Params': {'$ref': '#/definitions/MachineStorageIds'},
'Result': {'$ref': '#/definitions/FilesystemAttachmentParamsResults'}},
'type': 'object'},
'FilesystemAttachments': {'description': 'FilesystemAttachments '
'returns details of '
'filesystem '
'attachments with the '
'specified IDs.',
'properties': {'Params': {'$ref': '#/definitions/MachineStorageIds'},
'Result': {'$ref': '#/definitions/FilesystemAttachmentResults'}},
'type': 'object'},
'FilesystemParams': {'description': 'FilesystemParams returns '
'the parameters for '
'creating the filesystems\n'
'with the specified tags.',
'properties': {'Params': {'$ref': '#/definitions/Entities'},
'Result': {'$ref': '#/definitions/FilesystemParamsResults'}},
'type': 'object'},
'Filesystems': {'description': 'Filesystems returns details of '
'filesystems with the specified '
'tags.',
'properties': {'Params': {'$ref': '#/definitions/Entities'},
'Result': {'$ref': '#/definitions/FilesystemResults'}},
'type': 'object'},
'InstanceId': {'description': 'InstanceId returns the provider '
'specific instance id for each '
'given\n'
'machine or an '
'CodeNotProvisioned error, if '
'not set.',
'properties': {'Params': {'$ref': '#/definitions/Entities'},
'Result': {'$ref': '#/definitions/StringResults'}},
'type': 'object'},
'Life': {'description': 'Life returns the life status of every '
'supplied entity, where available.',
'properties': {'Params': {'$ref': '#/definitions/Entities'},
'Result': {'$ref': '#/definitions/LifeResults'}},
'type': 'object'},
'Remove': {'description': 'Remove removes volumes and '
'filesystems from state.',
'properties': {'Params': {'$ref': '#/definitions/Entities'},
'Result': {'$ref': '#/definitions/ErrorResults'}},
'type': 'object'},
'RemoveAttachment': {'description': 'RemoveAttachment removes '
'the specified machine '
'storage attachments\n'
'from state.',
'properties': {'Params': {'$ref': '#/definitions/MachineStorageIds'},
'Result': {'$ref': '#/definitions/ErrorResults'}},
'type': 'object'},
'RemoveFilesystemParams': {'description': 'RemoveFilesystemParams '
'returns the '
'parameters for '
'destroying or\n'
'releasing the '
'filesystems with '
'the specified tags.',
'properties': {'Params': {'$ref': '#/definitions/Entities'},
'Result': {'$ref': '#/definitions/RemoveFilesystemParamsResults'}},
'type': 'object'},
'RemoveVolumeAttachmentPlan': {'properties': {'Params': {'$ref': '#/definitions/MachineStorageIds'},
'Result': {'$ref': '#/definitions/ErrorResults'}},
'type': 'object'},
'RemoveVolumeParams': {'description': 'RemoveVolumeParams '
'returns the parameters '
'for destroying\n'
'or releasing the '
'volumes with the '
'specified tags.',
'properties': {'Params': {'$ref': '#/definitions/Entities'},
'Result': {'$ref': '#/definitions/RemoveVolumeParamsResults'}},
'type': 'object'},
'SetFilesystemAttachmentInfo': {'description': 'SetFilesystemAttachmentInfo '
'records the '
'details of '
'newly '
'provisioned '
'filesystem\n'
'attachments.',
'properties': {'Params': {'$ref': '#/definitions/FilesystemAttachments'},
'Result': {'$ref': '#/definitions/ErrorResults'}},
'type': 'object'},
'SetFilesystemInfo': {'description': 'SetFilesystemInfo '
'records the details of '
'newly provisioned '
'filesystems.',
'properties': {'Params': {'$ref': '#/definitions/Filesystems'},
'Result': {'$ref': '#/definitions/ErrorResults'}},
'type': 'object'},
'SetStatus': {'description': 'SetStatus sets the status of '
'each given entity.',
'properties': {'Params': {'$ref': '#/definitions/SetStatus'},
'Result': {'$ref': '#/definitions/ErrorResults'}},
'type': 'object'},
'SetVolumeAttachmentInfo': {'description': 'SetVolumeAttachmentInfo '
'records the '
'details of newly '
'provisioned '
'volume\n'
'attachments.',
'properties': {'Params': {'$ref': '#/definitions/VolumeAttachments'},
'Result': {'$ref': '#/definitions/ErrorResults'}},
'type': 'object'},
'SetVolumeAttachmentPlanBlockInfo': {'properties': {'Params': {'$ref': '#/definitions/VolumeAttachmentPlans'},
'Result': {'$ref': '#/definitions/ErrorResults'}},
'type': 'object'},
'SetVolumeInfo': {'description': 'SetVolumeInfo records the '
'details of newly provisioned '
'volumes.',
'properties': {'Params': {'$ref': '#/definitions/Volumes'},
'Result': {'$ref': '#/definitions/ErrorResults'}},
'type': 'object'},
'VolumeAttachmentParams': {'description': 'VolumeAttachmentParams '
'returns the '
'parameters for '
'creating the '
'volume\n'
'attachments with '
'the specified IDs.',
'properties': {'Params': {'$ref': '#/definitions/MachineStorageIds'},
'Result': {'$ref': '#/definitions/VolumeAttachmentParamsResults'}},
'type': 'object'},
'VolumeAttachmentPlans': {'description': 'VolumeAttachmentPlans '
'returns details of '
'volume attachment '
'plans with the '
'specified IDs.',
'properties': {'Params': {'$ref': '#/definitions/MachineStorageIds'},
'Result': {'$ref': '#/definitions/VolumeAttachmentPlanResults'}},
'type': 'object'},
'VolumeAttachments': {'description': 'VolumeAttachments '
'returns details of '
'volume attachments with '
'the specified IDs.',
'properties': {'Params': {'$ref': '#/definitions/MachineStorageIds'},
'Result': {'$ref': '#/definitions/VolumeAttachmentResults'}},
'type': 'object'},
'VolumeBlockDevices': {'description': 'VolumeBlockDevices '
'returns details of the '
'block devices '
'corresponding to the\n'
'volume attachments with '
'the specified IDs.',
'properties': {'Params': {'$ref': '#/definitions/MachineStorageIds'},
'Result': {'$ref': '#/definitions/BlockDeviceResults'}},
'type': 'object'},
'VolumeParams': {'description': 'VolumeParams returns the '
'parameters for creating or '
'destroying\n'
'the volumes with the '
'specified tags.',
'properties': {'Params': {'$ref': '#/definitions/Entities'},
'Result': {'$ref': '#/definitions/VolumeParamsResults'}},
'type': 'object'},
'Volumes': {'description': 'Volumes returns details of volumes '
'with the specified tags.',
'properties': {'Params': {'$ref': '#/definitions/Entities'},
'Result': {'$ref': '#/definitions/VolumeResults'}},
'type': 'object'},
'WatchApplications': {'description': 'WatchApplications starts '
'a StringsWatcher to '
'watch CAAS applications\n'
'deployed to this model.',
'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}},
'type': 'object'},
'WatchBlockDevices': {'description': 'WatchBlockDevices '
'watches for changes to '
"the specified machines' "
'block devices.',
'properties': {'Params': {'$ref': '#/definitions/Entities'},
'Result': {'$ref': '#/definitions/NotifyWatchResults'}},
'type': 'object'},
'WatchFilesystemAttachments': {'description': 'WatchFilesystemAttachments '
'watches for '
'changes to '
'filesystem '
'attachments\n'
'scoped to the '
'entity with the '
'tag passed to '
'NewState.',
'properties': {'Params': {'$ref': '#/definitions/Entities'},
'Result': {'$ref': '#/definitions/MachineStorageIdsWatchResults'}},
'type': 'object'},
'WatchFilesystems': {'description': 'WatchFilesystems watches '
'for changes to '
'filesystems scoped\n'
'to the entity with the '
'tag passed to NewState.',
'properties': {'Params': {'$ref': '#/definitions/Entities'},
'Result': {'$ref': '#/definitions/StringsWatchResults'}},
'type': 'object'},
'WatchMachines': {'description': 'WatchMachines watches for '
'changes to the specified '
'machines.',
'properties': {'Params': {'$ref': '#/definitions/Entities'},
'Result': {'$ref': '#/definitions/NotifyWatchResults'}},
'type': 'object'},
'WatchVolumeAttachmentPlans': {'description': 'WatchVolumeAttachmentPlans '
'watches for '
'changes to '
'volume '
'attachments for '
'a machine for '
'the purpose of '
'allowing\n'
'that machine to '
'run any '
'initialization '
'needed, for '
'that volume to '
'actually appear '
'as a block '
'device (ie: '
'iSCSI)',
'properties': {'Params': {'$ref': '#/definitions/Entities'},
'Result': {'$ref': '#/definitions/MachineStorageIdsWatchResults'}},
'type': 'object'},
'WatchVolumeAttachments': {'description': 'WatchVolumeAttachments '
'watches for changes '
'to volume '
'attachments scoped '
'to\n'
'the entity with the '
'tag passed to '
'NewState.',
'properties': {'Params': {'$ref': '#/definitions/Entities'},
'Result': {'$ref': '#/definitions/MachineStorageIdsWatchResults'}},
'type': 'object'},
'WatchVolumes': {'description': 'WatchVolumes watches for '
'changes to volumes scoped to '
'the\n'
'entity with the tag passed to '
'NewState.',
'properties': {'Params': {'$ref': '#/definitions/Entities'},
'Result': {'$ref': '#/definitions/StringsWatchResults'}},
'type': 'object'}},
'type': 'object'}
[docs] @ReturnMapping(LifeResults)
async def AttachmentLife(self, ids=None):
'''
AttachmentLife returns the lifecycle state of each specified machine
storage attachment.
ids : typing.Sequence[~MachineStorageId]
Returns -> LifeResults
'''
if ids is not None and not isinstance(ids, (bytes, str, list)):
raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids)))
# map input types to rpc msg
_params = dict()
msg = dict(type='StorageProvisioner',
request='AttachmentLife',
version=4,
params=_params)
_params['ids'] = ids
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(ErrorResults)
async def CreateVolumeAttachmentPlans(self, volume_plans=None):
'''
volume_plans : typing.Sequence[~VolumeAttachmentPlan]
Returns -> ErrorResults
'''
if volume_plans is not None and not isinstance(volume_plans, (bytes, str, list)):
raise Exception("Expected volume_plans to be a Sequence, received: {}".format(type(volume_plans)))
# map input types to rpc msg
_params = dict()
msg = dict(type='StorageProvisioner',
request='CreateVolumeAttachmentPlans',
version=4,
params=_params)
_params['volume-plans'] = volume_plans
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(ErrorResults)
async def EnsureDead(self, entities=None):
'''
EnsureDead calls EnsureDead on each given entity from state. It
will fail if the entity is not present. If it's Alive, nothing will
happen (see state/EnsureDead() for units or machines).
entities : typing.Sequence[~Entity]
Returns -> ErrorResults
'''
if entities is not None and not isinstance(entities, (bytes, str, list)):
raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities)))
# map input types to rpc msg
_params = dict()
msg = dict(type='StorageProvisioner',
request='EnsureDead',
version=4,
params=_params)
_params['entities'] = entities
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(FilesystemAttachmentParamsResults)
async def FilesystemAttachmentParams(self, ids=None):
'''
FilesystemAttachmentParams returns the parameters for creating the filesystem
attachments with the specified IDs.
ids : typing.Sequence[~MachineStorageId]
Returns -> FilesystemAttachmentParamsResults
'''
if ids is not None and not isinstance(ids, (bytes, str, list)):
raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids)))
# map input types to rpc msg
_params = dict()
msg = dict(type='StorageProvisioner',
request='FilesystemAttachmentParams',
version=4,
params=_params)
_params['ids'] = ids
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(FilesystemAttachmentResults)
async def FilesystemAttachments(self, ids=None):
'''
FilesystemAttachments returns details of filesystem attachments with the specified IDs.
ids : typing.Sequence[~MachineStorageId]
Returns -> FilesystemAttachmentResults
'''
if ids is not None and not isinstance(ids, (bytes, str, list)):
raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids)))
# map input types to rpc msg
_params = dict()
msg = dict(type='StorageProvisioner',
request='FilesystemAttachments',
version=4,
params=_params)
_params['ids'] = ids
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(FilesystemParamsResults)
async def FilesystemParams(self, entities=None):
'''
FilesystemParams returns the parameters for creating the filesystems
with the specified tags.
entities : typing.Sequence[~Entity]
Returns -> FilesystemParamsResults
'''
if entities is not None and not isinstance(entities, (bytes, str, list)):
raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities)))
# map input types to rpc msg
_params = dict()
msg = dict(type='StorageProvisioner',
request='FilesystemParams',
version=4,
params=_params)
_params['entities'] = entities
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(FilesystemResults)
async def Filesystems(self, entities=None):
'''
Filesystems returns details of filesystems with the specified tags.
entities : typing.Sequence[~Entity]
Returns -> FilesystemResults
'''
if entities is not None and not isinstance(entities, (bytes, str, list)):
raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities)))
# map input types to rpc msg
_params = dict()
msg = dict(type='StorageProvisioner',
request='Filesystems',
version=4,
params=_params)
_params['entities'] = entities
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(StringResults)
async def InstanceId(self, entities=None):
'''
InstanceId returns the provider specific instance id for each given
machine or an CodeNotProvisioned error, if not set.
entities : typing.Sequence[~Entity]
Returns -> StringResults
'''
if entities is not None and not isinstance(entities, (bytes, str, list)):
raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities)))
# map input types to rpc msg
_params = dict()
msg = dict(type='StorageProvisioner',
request='InstanceId',
version=4,
params=_params)
_params['entities'] = entities
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(LifeResults)
async def Life(self, entities=None):
'''
Life returns the life status of every supplied entity, where available.
entities : typing.Sequence[~Entity]
Returns -> LifeResults
'''
if entities is not None and not isinstance(entities, (bytes, str, list)):
raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities)))
# map input types to rpc msg
_params = dict()
msg = dict(type='StorageProvisioner',
request='Life',
version=4,
params=_params)
_params['entities'] = entities
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(ErrorResults)
async def Remove(self, entities=None):
'''
Remove removes volumes and filesystems from state.
entities : typing.Sequence[~Entity]
Returns -> ErrorResults
'''
if entities is not None and not isinstance(entities, (bytes, str, list)):
raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities)))
# map input types to rpc msg
_params = dict()
msg = dict(type='StorageProvisioner',
request='Remove',
version=4,
params=_params)
_params['entities'] = entities
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(ErrorResults)
async def RemoveAttachment(self, ids=None):
'''
RemoveAttachment removes the specified machine storage attachments
from state.
ids : typing.Sequence[~MachineStorageId]
Returns -> ErrorResults
'''
if ids is not None and not isinstance(ids, (bytes, str, list)):
raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids)))
# map input types to rpc msg
_params = dict()
msg = dict(type='StorageProvisioner',
request='RemoveAttachment',
version=4,
params=_params)
_params['ids'] = ids
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(RemoveFilesystemParamsResults)
async def RemoveFilesystemParams(self, entities=None):
'''
RemoveFilesystemParams returns the parameters for destroying or
releasing the filesystems with the specified tags.
entities : typing.Sequence[~Entity]
Returns -> RemoveFilesystemParamsResults
'''
if entities is not None and not isinstance(entities, (bytes, str, list)):
raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities)))
# map input types to rpc msg
_params = dict()
msg = dict(type='StorageProvisioner',
request='RemoveFilesystemParams',
version=4,
params=_params)
_params['entities'] = entities
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(ErrorResults)
async def RemoveVolumeAttachmentPlan(self, ids=None):
'''
ids : typing.Sequence[~MachineStorageId]
Returns -> ErrorResults
'''
if ids is not None and not isinstance(ids, (bytes, str, list)):
raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids)))
# map input types to rpc msg
_params = dict()
msg = dict(type='StorageProvisioner',
request='RemoveVolumeAttachmentPlan',
version=4,
params=_params)
_params['ids'] = ids
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(RemoveVolumeParamsResults)
async def RemoveVolumeParams(self, entities=None):
'''
RemoveVolumeParams returns the parameters for destroying
or releasing the volumes with the specified tags.
entities : typing.Sequence[~Entity]
Returns -> RemoveVolumeParamsResults
'''
if entities is not None and not isinstance(entities, (bytes, str, list)):
raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities)))
# map input types to rpc msg
_params = dict()
msg = dict(type='StorageProvisioner',
request='RemoveVolumeParams',
version=4,
params=_params)
_params['entities'] = entities
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(ErrorResults)
async def SetFilesystemAttachmentInfo(self, filesystem_attachments=None):
'''
SetFilesystemAttachmentInfo records the details of newly provisioned filesystem
attachments.
filesystem_attachments : typing.Sequence[~FilesystemAttachment]
Returns -> ErrorResults
'''
if filesystem_attachments is not None and not isinstance(filesystem_attachments, (bytes, str, list)):
raise Exception("Expected filesystem_attachments to be a Sequence, received: {}".format(type(filesystem_attachments)))
# map input types to rpc msg
_params = dict()
msg = dict(type='StorageProvisioner',
request='SetFilesystemAttachmentInfo',
version=4,
params=_params)
_params['filesystem-attachments'] = filesystem_attachments
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(ErrorResults)
async def SetFilesystemInfo(self, filesystems=None):
'''
SetFilesystemInfo records the details of newly provisioned filesystems.
filesystems : typing.Sequence[~Filesystem]
Returns -> ErrorResults
'''
if filesystems is not None and not isinstance(filesystems, (bytes, str, list)):
raise Exception("Expected filesystems to be a Sequence, received: {}".format(type(filesystems)))
# map input types to rpc msg
_params = dict()
msg = dict(type='StorageProvisioner',
request='SetFilesystemInfo',
version=4,
params=_params)
_params['filesystems'] = filesystems
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(ErrorResults)
async def SetStatus(self, entities=None):
'''
SetStatus sets the status of each given entity.
entities : typing.Sequence[~EntityStatusArgs]
Returns -> ErrorResults
'''
if entities is not None and not isinstance(entities, (bytes, str, list)):
raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities)))
# map input types to rpc msg
_params = dict()
msg = dict(type='StorageProvisioner',
request='SetStatus',
version=4,
params=_params)
_params['entities'] = entities
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(ErrorResults)
async def SetVolumeAttachmentInfo(self, volume_attachments=None):
'''
SetVolumeAttachmentInfo records the details of newly provisioned volume
attachments.
volume_attachments : typing.Sequence[~VolumeAttachment]
Returns -> ErrorResults
'''
if volume_attachments is not None and not isinstance(volume_attachments, (bytes, str, list)):
raise Exception("Expected volume_attachments to be a Sequence, received: {}".format(type(volume_attachments)))
# map input types to rpc msg
_params = dict()
msg = dict(type='StorageProvisioner',
request='SetVolumeAttachmentInfo',
version=4,
params=_params)
_params['volume-attachments'] = volume_attachments
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(ErrorResults)
async def SetVolumeAttachmentPlanBlockInfo(self, volume_plans=None):
'''
volume_plans : typing.Sequence[~VolumeAttachmentPlan]
Returns -> ErrorResults
'''
if volume_plans is not None and not isinstance(volume_plans, (bytes, str, list)):
raise Exception("Expected volume_plans to be a Sequence, received: {}".format(type(volume_plans)))
# map input types to rpc msg
_params = dict()
msg = dict(type='StorageProvisioner',
request='SetVolumeAttachmentPlanBlockInfo',
version=4,
params=_params)
_params['volume-plans'] = volume_plans
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(ErrorResults)
async def SetVolumeInfo(self, volumes=None):
'''
SetVolumeInfo records the details of newly provisioned volumes.
volumes : typing.Sequence[~Volume]
Returns -> ErrorResults
'''
if volumes is not None and not isinstance(volumes, (bytes, str, list)):
raise Exception("Expected volumes to be a Sequence, received: {}".format(type(volumes)))
# map input types to rpc msg
_params = dict()
msg = dict(type='StorageProvisioner',
request='SetVolumeInfo',
version=4,
params=_params)
_params['volumes'] = volumes
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(VolumeAttachmentParamsResults)
async def VolumeAttachmentParams(self, ids=None):
'''
VolumeAttachmentParams returns the parameters for creating the volume
attachments with the specified IDs.
ids : typing.Sequence[~MachineStorageId]
Returns -> VolumeAttachmentParamsResults
'''
if ids is not None and not isinstance(ids, (bytes, str, list)):
raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids)))
# map input types to rpc msg
_params = dict()
msg = dict(type='StorageProvisioner',
request='VolumeAttachmentParams',
version=4,
params=_params)
_params['ids'] = ids
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(VolumeAttachmentPlanResults)
async def VolumeAttachmentPlans(self, ids=None):
'''
VolumeAttachmentPlans returns details of volume attachment plans with the specified IDs.
ids : typing.Sequence[~MachineStorageId]
Returns -> VolumeAttachmentPlanResults
'''
if ids is not None and not isinstance(ids, (bytes, str, list)):
raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids)))
# map input types to rpc msg
_params = dict()
msg = dict(type='StorageProvisioner',
request='VolumeAttachmentPlans',
version=4,
params=_params)
_params['ids'] = ids
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(VolumeAttachmentResults)
async def VolumeAttachments(self, ids=None):
'''
VolumeAttachments returns details of volume attachments with the specified IDs.
ids : typing.Sequence[~MachineStorageId]
Returns -> VolumeAttachmentResults
'''
if ids is not None and not isinstance(ids, (bytes, str, list)):
raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids)))
# map input types to rpc msg
_params = dict()
msg = dict(type='StorageProvisioner',
request='VolumeAttachments',
version=4,
params=_params)
_params['ids'] = ids
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(BlockDeviceResults)
async def VolumeBlockDevices(self, ids=None):
'''
VolumeBlockDevices returns details of the block devices corresponding to the
volume attachments with the specified IDs.
ids : typing.Sequence[~MachineStorageId]
Returns -> BlockDeviceResults
'''
if ids is not None and not isinstance(ids, (bytes, str, list)):
raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids)))
# map input types to rpc msg
_params = dict()
msg = dict(type='StorageProvisioner',
request='VolumeBlockDevices',
version=4,
params=_params)
_params['ids'] = ids
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(VolumeParamsResults)
async def VolumeParams(self, entities=None):
'''
VolumeParams returns the parameters for creating or destroying
the volumes with the specified tags.
entities : typing.Sequence[~Entity]
Returns -> VolumeParamsResults
'''
if entities is not None and not isinstance(entities, (bytes, str, list)):
raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities)))
# map input types to rpc msg
_params = dict()
msg = dict(type='StorageProvisioner',
request='VolumeParams',
version=4,
params=_params)
_params['entities'] = entities
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(VolumeResults)
async def Volumes(self, entities=None):
'''
Volumes returns details of volumes with the specified tags.
entities : typing.Sequence[~Entity]
Returns -> VolumeResults
'''
if entities is not None and not isinstance(entities, (bytes, str, list)):
raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities)))
# map input types to rpc msg
_params = dict()
msg = dict(type='StorageProvisioner',
request='Volumes',
version=4,
params=_params)
_params['entities'] = entities
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(StringsWatchResult)
async def WatchApplications(self):
'''
WatchApplications starts a StringsWatcher to watch CAAS applications
deployed to this model.
Returns -> StringsWatchResult
'''
# map input types to rpc msg
_params = dict()
msg = dict(type='StorageProvisioner',
request='WatchApplications',
version=4,
params=_params)
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(NotifyWatchResults)
async def WatchBlockDevices(self, entities=None):
'''
WatchBlockDevices watches for changes to the specified machines' block devices.
entities : typing.Sequence[~Entity]
Returns -> NotifyWatchResults
'''
if entities is not None and not isinstance(entities, (bytes, str, list)):
raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities)))
# map input types to rpc msg
_params = dict()
msg = dict(type='StorageProvisioner',
request='WatchBlockDevices',
version=4,
params=_params)
_params['entities'] = entities
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(MachineStorageIdsWatchResults)
async def WatchFilesystemAttachments(self, entities=None):
'''
WatchFilesystemAttachments watches for changes to filesystem attachments
scoped to the entity with the tag passed to NewState.
entities : typing.Sequence[~Entity]
Returns -> MachineStorageIdsWatchResults
'''
if entities is not None and not isinstance(entities, (bytes, str, list)):
raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities)))
# map input types to rpc msg
_params = dict()
msg = dict(type='StorageProvisioner',
request='WatchFilesystemAttachments',
version=4,
params=_params)
_params['entities'] = entities
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(StringsWatchResults)
async def WatchFilesystems(self, entities=None):
'''
WatchFilesystems watches for changes to filesystems scoped
to the entity with the tag passed to NewState.
entities : typing.Sequence[~Entity]
Returns -> StringsWatchResults
'''
if entities is not None and not isinstance(entities, (bytes, str, list)):
raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities)))
# map input types to rpc msg
_params = dict()
msg = dict(type='StorageProvisioner',
request='WatchFilesystems',
version=4,
params=_params)
_params['entities'] = entities
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(NotifyWatchResults)
async def WatchMachines(self, entities=None):
'''
WatchMachines watches for changes to the specified machines.
entities : typing.Sequence[~Entity]
Returns -> NotifyWatchResults
'''
if entities is not None and not isinstance(entities, (bytes, str, list)):
raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities)))
# map input types to rpc msg
_params = dict()
msg = dict(type='StorageProvisioner',
request='WatchMachines',
version=4,
params=_params)
_params['entities'] = entities
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(MachineStorageIdsWatchResults)
async def WatchVolumeAttachmentPlans(self, entities=None):
'''
WatchVolumeAttachmentPlans watches for changes to volume attachments for a machine for the purpose of allowing
that machine to run any initialization needed, for that volume to actually appear as a block device (ie: iSCSI)
entities : typing.Sequence[~Entity]
Returns -> MachineStorageIdsWatchResults
'''
if entities is not None and not isinstance(entities, (bytes, str, list)):
raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities)))
# map input types to rpc msg
_params = dict()
msg = dict(type='StorageProvisioner',
request='WatchVolumeAttachmentPlans',
version=4,
params=_params)
_params['entities'] = entities
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(MachineStorageIdsWatchResults)
async def WatchVolumeAttachments(self, entities=None):
'''
WatchVolumeAttachments watches for changes to volume attachments scoped to
the entity with the tag passed to NewState.
entities : typing.Sequence[~Entity]
Returns -> MachineStorageIdsWatchResults
'''
if entities is not None and not isinstance(entities, (bytes, str, list)):
raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities)))
# map input types to rpc msg
_params = dict()
msg = dict(type='StorageProvisioner',
request='WatchVolumeAttachments',
version=4,
params=_params)
_params['entities'] = entities
reply = await self.rpc(msg)
return reply
[docs] @ReturnMapping(StringsWatchResults)
async def WatchVolumes(self, entities=None):
'''
WatchVolumes watches for changes to volumes scoped to the
entity with the tag passed to NewState.
entities : typing.Sequence[~Entity]
Returns -> StringsWatchResults
'''
if entities is not None and not isinstance(entities, (bytes, str, list)):
raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities)))
# map input types to rpc msg
_params = dict()
msg = dict(type='StorageProvisioner',
request='WatchVolumes',
version=4,
params=_params)
_params['entities'] = entities
reply = await self.rpc(msg)
return reply