repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_documentation_string stringlengths 1 47.2k | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|
pycontribs/pyrax | pyrax/clouddns.py | CloudDNSClient.list_records | def list_records(self, domain, limit=None, offset=None):
"""
Returns a list of all records configured for the specified domain.
"""
return domain.list_records(limit=limit, offset=offset) | python | def list_records(self, domain, limit=None, offset=None):
"""
Returns a list of all records configured for the specified domain.
"""
return domain.list_records(limit=limit, offset=offset) | Returns a list of all records configured for the specified domain. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/clouddns.py#L1237-L1241 |
pycontribs/pyrax | pyrax/clouddns.py | CloudDNSClient.search_records | def search_records(self, domain, record_type, name=None, data=None):
"""
Returns a list of all records configured for the specified domain
that match the supplied search criteria.
"""
return domain.search_records(record_type=record_type,
name=name, data=data) | python | def search_records(self, domain, record_type, name=None, data=None):
"""
Returns a list of all records configured for the specified domain
that match the supplied search criteria.
"""
return domain.search_records(record_type=record_type,
name=name, data=data) | Returns a list of all records configured for the specified domain
that match the supplied search criteria. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/clouddns.py#L1265-L1271 |
pycontribs/pyrax | pyrax/clouddns.py | CloudDNSClient.find_record | def find_record(self, domain, record_type, name=None, data=None):
"""
Returns a single record for this domain that matches the supplied
search criteria.
If no record matches, a DomainRecordNotFound exception will be raised.
If more than one matches, a DomainRecordNotUnique excep... | python | def find_record(self, domain, record_type, name=None, data=None):
"""
Returns a single record for this domain that matches the supplied
search criteria.
If no record matches, a DomainRecordNotFound exception will be raised.
If more than one matches, a DomainRecordNotUnique excep... | Returns a single record for this domain that matches the supplied
search criteria.
If no record matches, a DomainRecordNotFound exception will be raised.
If more than one matches, a DomainRecordNotUnique exception will
be raised. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/clouddns.py#L1275-L1285 |
pycontribs/pyrax | pyrax/clouddns.py | CloudDNSClient.update_record | def update_record(self, domain, record, data=None, priority=None, ttl=None,
comment=None):
"""
Modifies an existing record for a domain.
"""
return domain.update_record(record, data=data, priority=priority,
ttl=ttl, comment=comment) | python | def update_record(self, domain, record, data=None, priority=None, ttl=None,
comment=None):
"""
Modifies an existing record for a domain.
"""
return domain.update_record(record, data=data, priority=priority,
ttl=ttl, comment=comment) | Modifies an existing record for a domain. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/clouddns.py#L1316-L1322 |
pycontribs/pyrax | pyrax/clouddns.py | CloudDNSClient.update_ptr_record | def update_ptr_record(self, device, record, domain_name, data=None,
ttl=None, comment=None):
"""
Updates a PTR record with the supplied values.
"""
return self._manager.update_ptr_record(device, record, domain_name,
data=data, ttl=ttl, comment=comment) | python | def update_ptr_record(self, device, record, domain_name, data=None,
ttl=None, comment=None):
"""
Updates a PTR record with the supplied values.
"""
return self._manager.update_ptr_record(device, record, domain_name,
data=data, ttl=ttl, comment=comment) | Updates a PTR record with the supplied values. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/clouddns.py#L1365-L1371 |
pycontribs/pyrax | pyrax/clouddns.py | CloudDNSClient.delete_ptr_records | def delete_ptr_records(self, device, ip_address=None):
"""
Deletes the PTR records for the specified device. If 'ip_address'
is supplied, only the PTR records with that IP address will be deleted.
"""
return self._manager.delete_ptr_records(device, ip_address=ip_address) | python | def delete_ptr_records(self, device, ip_address=None):
"""
Deletes the PTR records for the specified device. If 'ip_address'
is supplied, only the PTR records with that IP address will be deleted.
"""
return self._manager.delete_ptr_records(device, ip_address=ip_address) | Deletes the PTR records for the specified device. If 'ip_address'
is supplied, only the PTR records with that IP address will be deleted. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/clouddns.py#L1374-L1379 |
pycontribs/pyrax | pyrax/clouddns.py | CloudDNSClient.get_absolute_limits | def get_absolute_limits(self):
"""
Returns a dict with the absolute limits for the current account.
"""
resp, body = self.method_get("/limits")
absolute_limits = body.get("limits", {}).get("absolute")
return absolute_limits | python | def get_absolute_limits(self):
"""
Returns a dict with the absolute limits for the current account.
"""
resp, body = self.method_get("/limits")
absolute_limits = body.get("limits", {}).get("absolute")
return absolute_limits | Returns a dict with the absolute limits for the current account. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/clouddns.py#L1382-L1388 |
pycontribs/pyrax | pyrax/clouddns.py | CloudDNSClient.get_rate_limits | def get_rate_limits(self):
"""
Returns a dict with the current rate limit information for domain
and status requests.
"""
resp, body = self.method_get("/limits")
rate_limits = body.get("limits", {}).get("rate")
ret = []
for rate_limit in rate_limits:
... | python | def get_rate_limits(self):
"""
Returns a dict with the current rate limit information for domain
and status requests.
"""
resp, body = self.method_get("/limits")
rate_limits = body.get("limits", {}).get("rate")
ret = []
for rate_limit in rate_limits:
... | Returns a dict with the current rate limit information for domain
and status requests. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/clouddns.py#L1391-L1404 |
pycontribs/pyrax | pyrax/clouddns.py | ResultsIterator.next | def next(self):
"""
Return the next available item. If there are no more items in the
local 'results' list, check if there is a 'next_uri' value. If so,
use that to get the next page of results from the API, and return
the first item from that query.
"""
try:
... | python | def next(self):
"""
Return the next available item. If there are no more items in the
local 'results' list, check if there is a 'next_uri' value. If so,
use that to get the next page of results from the API, and return
the first item from that query.
"""
try:
... | Return the next available item. If there are no more items in the
local 'results' list, check if there is a 'next_uri' value. If so,
use that to get the next page of results from the API, and return
the first item from that query. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/clouddns.py#L1437-L1464 |
pycontribs/pyrax | pyrax/identity/rax_identity.py | RaxIdentity._read_credential_file | def _read_credential_file(self, cfg):
"""
Parses the credential file with Rackspace-specific labels.
"""
self.username = cfg.get("rackspace_cloud", "username")
try:
self.password = cfg.get("rackspace_cloud", "api_key", raw=True)
except ConfigParser.NoOptionErr... | python | def _read_credential_file(self, cfg):
"""
Parses the credential file with Rackspace-specific labels.
"""
self.username = cfg.get("rackspace_cloud", "username")
try:
self.password = cfg.get("rackspace_cloud", "api_key", raw=True)
except ConfigParser.NoOptionErr... | Parses the credential file with Rackspace-specific labels. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/identity/rax_identity.py#L31-L40 |
pycontribs/pyrax | pyrax/identity/rax_identity.py | RaxIdentity._format_credentials | def _format_credentials(self):
"""
Returns the current credentials in the format expected by the
authentication service. Note that by default Rackspace credentials
expect 'api_key' instead of 'password'. However, if authentication
fails, return the creds in standard password form... | python | def _format_credentials(self):
"""
Returns the current credentials in the format expected by the
authentication service. Note that by default Rackspace credentials
expect 'api_key' instead of 'password'. However, if authentication
fails, return the creds in standard password form... | Returns the current credentials in the format expected by the
authentication service. Note that by default Rackspace credentials
expect 'api_key' instead of 'password'. However, if authentication
fails, return the creds in standard password format, in case they are
using a username / pas... | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/identity/rax_identity.py#L43-L57 |
pycontribs/pyrax | pyrax/identity/rax_identity.py | RaxIdentity.set_credentials | def set_credentials(self, username, password=None, region=None,
tenant_id=None, authenticate=False):
"""
Sets the username and password directly. Because Rackspace auth uses
the api_key, make sure that any old values are cleared.
"""
self.api_key = None
super(... | python | def set_credentials(self, username, password=None, region=None,
tenant_id=None, authenticate=False):
"""
Sets the username and password directly. Because Rackspace auth uses
the api_key, make sure that any old values are cleared.
"""
self.api_key = None
super(... | Sets the username and password directly. Because Rackspace auth uses
the api_key, make sure that any old values are cleared. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/identity/rax_identity.py#L60-L68 |
pycontribs/pyrax | pyrax/identity/rax_identity.py | RaxIdentity.authenticate | def authenticate(self, username=None, password=None, api_key=None,
tenant_id=None, connect=False):
"""
If the user's credentials include an API key, the default behavior will
work. But if they are using a password, the initial attempt will fail,
so try again, but this time us... | python | def authenticate(self, username=None, password=None, api_key=None,
tenant_id=None, connect=False):
"""
If the user's credentials include an API key, the default behavior will
work. But if they are using a password, the initial attempt will fail,
so try again, but this time us... | If the user's credentials include an API key, the default behavior will
work. But if they are using a password, the initial attempt will fail,
so try again, but this time using the standard password format.
The 'connect' parameter is retained for backwards compatibility. It no
longer ha... | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/identity/rax_identity.py#L71-L87 |
pycontribs/pyrax | pyrax/identity/rax_identity.py | RaxIdentity.auth_with_token | def auth_with_token(self, token, tenant_id=None, tenant_name=None):
"""
If a valid token is already known, this call will use it to generate
the service catalog.
"""
# Implementation note:
# Rackspace auth uses one tenant ID for the object_store services and
# ano... | python | def auth_with_token(self, token, tenant_id=None, tenant_name=None):
"""
If a valid token is already known, this call will use it to generate
the service catalog.
"""
# Implementation note:
# Rackspace auth uses one tenant ID for the object_store services and
# ano... | If a valid token is already known, this call will use it to generate
the service catalog. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/identity/rax_identity.py#L90-L118 |
pycontribs/pyrax | pyrax/identity/rax_identity.py | RaxIdentity._parse_response | def _parse_response(self, resp):
"""Gets the authentication information from the returned JSON."""
super(RaxIdentity, self)._parse_response(resp)
user = resp["access"]["user"]
defreg = user.get("RAX-AUTH:defaultRegion")
if defreg:
self._default_region = defreg | python | def _parse_response(self, resp):
"""Gets the authentication information from the returned JSON."""
super(RaxIdentity, self)._parse_response(resp)
user = resp["access"]["user"]
defreg = user.get("RAX-AUTH:defaultRegion")
if defreg:
self._default_region = defreg | Gets the authentication information from the returned JSON. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/identity/rax_identity.py#L121-L127 |
pycontribs/pyrax | pyrax/identity/rax_identity.py | RaxIdentity.get_client | def get_client(self, service, region, public=True, cached=True):
"""
Returns the client object for the specified service and region.
By default the public endpoint is used. If you wish to work with a
services internal endpoints, specify `public=False`.
By default, if a client h... | python | def get_client(self, service, region, public=True, cached=True):
"""
Returns the client object for the specified service and region.
By default the public endpoint is used. If you wish to work with a
services internal endpoints, specify `public=False`.
By default, if a client h... | Returns the client object for the specified service and region.
By default the public endpoint is used. If you wish to work with a
services internal endpoints, specify `public=False`.
By default, if a client has already been created for the given service,
region, and public values, tha... | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/identity/rax_identity.py#L130-L151 |
pycontribs/pyrax | pyrax/identity/rax_identity.py | RaxIdentity.get_user | def get_user(self, user_id=None, username=None, email=None):
"""
Returns the user specified by either ID, username or email.
Since more than user can have the same email address, searching by that
term will return a list of 1 or more User objects. Searching by
username or ID wil... | python | def get_user(self, user_id=None, username=None, email=None):
"""
Returns the user specified by either ID, username or email.
Since more than user can have the same email address, searching by that
term will return a list of 1 or more User objects. Searching by
username or ID wil... | Returns the user specified by either ID, username or email.
Since more than user can have the same email address, searching by that
term will return a list of 1 or more User objects. Searching by
username or ID will return a single User.
If a user_id that doesn't belong to the current ... | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/identity/rax_identity.py#L178-L210 |
pycontribs/pyrax | pyrax/identity/rax_identity.py | RaxIdentity.update_user | def update_user(self, user, email=None, username=None,
uid=None, defaultRegion=None, enabled=None):
"""
Allows you to update settings for a given user.
"""
user_id = utils.get_id(user)
uri = "users/%s" % user_id
upd = {"id": user_id}
if email is not No... | python | def update_user(self, user, email=None, username=None,
uid=None, defaultRegion=None, enabled=None):
"""
Allows you to update settings for a given user.
"""
user_id = utils.get_id(user)
uri = "users/%s" % user_id
upd = {"id": user_id}
if email is not No... | Allows you to update settings for a given user. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/identity/rax_identity.py#L213-L234 |
pycontribs/pyrax | pyrax/identity/rax_identity.py | RaxIdentity.reset_api_key | def reset_api_key(self, user=None):
"""
Resets the API key for the specified user, or if no user is specified,
for the current user. Returns the newly-created API key.
Resetting an API key does not invalidate any authenticated sessions,
nor does it revoke any tokens.
"""... | python | def reset_api_key(self, user=None):
"""
Resets the API key for the specified user, or if no user is specified,
for the current user. Returns the newly-created API key.
Resetting an API key does not invalidate any authenticated sessions,
nor does it revoke any tokens.
"""... | Resets the API key for the specified user, or if no user is specified,
for the current user. Returns the newly-created API key.
Resetting an API key does not invalidate any authenticated sessions,
nor does it revoke any tokens. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/identity/rax_identity.py#L237-L252 |
pycontribs/pyrax | pyrax/autoscale.py | ScalingGroup._make_policies | def _make_policies(self):
"""
Convert the 'scalingPolicies' dictionary into AutoScalePolicy objects.
"""
self.policies = [AutoScalePolicy(self.manager, dct, self)
for dct in self.scalingPolicies] | python | def _make_policies(self):
"""
Convert the 'scalingPolicies' dictionary into AutoScalePolicy objects.
"""
self.policies = [AutoScalePolicy(self.manager, dct, self)
for dct in self.scalingPolicies] | Convert the 'scalingPolicies' dictionary into AutoScalePolicy objects. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/autoscale.py#L42-L47 |
pycontribs/pyrax | pyrax/autoscale.py | ScalingGroup.update | def update(self, name=None, cooldown=None, min_entities=None,
max_entities=None, metadata=None):
"""
Updates this ScalingGroup. One or more of the attributes can be
specified.
NOTE: if you specify metadata, it will *replace* any existing metadata.
If you want to add ... | python | def update(self, name=None, cooldown=None, min_entities=None,
max_entities=None, metadata=None):
"""
Updates this ScalingGroup. One or more of the attributes can be
specified.
NOTE: if you specify metadata, it will *replace* any existing metadata.
If you want to add ... | Updates this ScalingGroup. One or more of the attributes can be
specified.
NOTE: if you specify metadata, it will *replace* any existing metadata.
If you want to add to it, you either need to pass the complete dict of
metadata, or call the update_metadata() method. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/autoscale.py#L71-L83 |
pycontribs/pyrax | pyrax/autoscale.py | ScalingGroup.add_policy | def add_policy(self, name, policy_type, cooldown, change=None,
is_percent=False, desired_capacity=None, args=None):
"""
Adds a policy with the given values to this scaling group. The
'change' parameter is treated as an absolute amount, unless
'is_percent' is True, in which ca... | python | def add_policy(self, name, policy_type, cooldown, change=None,
is_percent=False, desired_capacity=None, args=None):
"""
Adds a policy with the given values to this scaling group. The
'change' parameter is treated as an absolute amount, unless
'is_percent' is True, in which ca... | Adds a policy with the given values to this scaling group. The
'change' parameter is treated as an absolute amount, unless
'is_percent' is True, in which case it is treated as a percentage. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/autoscale.py#L134-L143 |
pycontribs/pyrax | pyrax/autoscale.py | ScalingGroup.execute_policy | def execute_policy(self, policy):
"""
Executes the specified policy for this scaling group.
"""
return self.manager.execute_policy(scaling_group=self, policy=policy) | python | def execute_policy(self, policy):
"""
Executes the specified policy for this scaling group.
"""
return self.manager.execute_policy(scaling_group=self, policy=policy) | Executes the specified policy for this scaling group. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/autoscale.py#L172-L176 |
pycontribs/pyrax | pyrax/autoscale.py | ScalingGroup.delete_policy | def delete_policy(self, policy):
"""
Deletes the specified policy from this scaling group.
"""
return self.manager.delete_policy(scaling_group=self, policy=policy) | python | def delete_policy(self, policy):
"""
Deletes the specified policy from this scaling group.
"""
return self.manager.delete_policy(scaling_group=self, policy=policy) | Deletes the specified policy from this scaling group. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/autoscale.py#L179-L183 |
pycontribs/pyrax | pyrax/autoscale.py | ScalingGroup.add_webhook | def add_webhook(self, policy, name, metadata=None):
"""
Adds a webhook to the specified policy.
"""
return self.manager.add_webhook(self, policy, name, metadata=metadata) | python | def add_webhook(self, policy, name, metadata=None):
"""
Adds a webhook to the specified policy.
"""
return self.manager.add_webhook(self, policy, name, metadata=metadata) | Adds a webhook to the specified policy. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/autoscale.py#L186-L190 |
pycontribs/pyrax | pyrax/autoscale.py | ScalingGroup.update_webhook_metadata | def update_webhook_metadata(self, policy, webhook, metadata):
"""
Adds the given metadata dict to the existing metadata for the specified
webhook.
"""
return self.manager.update_webhook_metadata(self, policy, webhook,
metadata) | python | def update_webhook_metadata(self, policy, webhook, metadata):
"""
Adds the given metadata dict to the existing metadata for the specified
webhook.
"""
return self.manager.update_webhook_metadata(self, policy, webhook,
metadata) | Adds the given metadata dict to the existing metadata for the specified
webhook. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/autoscale.py#L209-L215 |
pycontribs/pyrax | pyrax/autoscale.py | ScalingGroup.delete_webhook | def delete_webhook(self, policy, webhook):
"""
Deletes the specified webhook from the specified policy.
"""
return self.manager.delete_webhook(self, policy, webhook) | python | def delete_webhook(self, policy, webhook):
"""
Deletes the specified webhook from the specified policy.
"""
return self.manager.delete_webhook(self, policy, webhook) | Deletes the specified webhook from the specified policy. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/autoscale.py#L218-L222 |
pycontribs/pyrax | pyrax/autoscale.py | ScalingGroupManager.get_state | def get_state(self, scaling_group):
"""
Returns the current state of the specified scaling group as a
dictionary.
"""
uri = "/%s/%s/state" % (self.uri_base, utils.get_id(scaling_group))
resp, resp_body = self.api.method_get(uri)
data = resp_body["group"]
r... | python | def get_state(self, scaling_group):
"""
Returns the current state of the specified scaling group as a
dictionary.
"""
uri = "/%s/%s/state" % (self.uri_base, utils.get_id(scaling_group))
resp, resp_body = self.api.method_get(uri)
data = resp_body["group"]
r... | Returns the current state of the specified scaling group as a
dictionary. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/autoscale.py#L289-L303 |
pycontribs/pyrax | pyrax/autoscale.py | ScalingGroupManager.pause | def pause(self, scaling_group):
"""
Pauses all execution of the policies for the specified scaling group.
"""
uri = "/%s/%s/pause" % (self.uri_base, utils.get_id(scaling_group))
resp, resp_body = self.api.method_post(uri)
return None | python | def pause(self, scaling_group):
"""
Pauses all execution of the policies for the specified scaling group.
"""
uri = "/%s/%s/pause" % (self.uri_base, utils.get_id(scaling_group))
resp, resp_body = self.api.method_post(uri)
return None | Pauses all execution of the policies for the specified scaling group. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/autoscale.py#L306-L312 |
pycontribs/pyrax | pyrax/autoscale.py | ScalingGroupManager.get_configuration | def get_configuration(self, scaling_group):
"""
Returns the scaling group's configuration in a dictionary.
"""
uri = "/%s/%s/config" % (self.uri_base, utils.get_id(scaling_group))
resp, resp_body = self.api.method_get(uri)
return resp_body.get("groupConfiguration") | python | def get_configuration(self, scaling_group):
"""
Returns the scaling group's configuration in a dictionary.
"""
uri = "/%s/%s/config" % (self.uri_base, utils.get_id(scaling_group))
resp, resp_body = self.api.method_get(uri)
return resp_body.get("groupConfiguration") | Returns the scaling group's configuration in a dictionary. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/autoscale.py#L324-L330 |
pycontribs/pyrax | pyrax/autoscale.py | ScalingGroupManager.replace | def replace(self, scaling_group, name, cooldown, min_entities,
max_entities, metadata=None):
"""
Replace an existing ScalingGroup configuration. All of the attributes
must be specified If you wish to delete any of the optional attributes,
pass them in as None.
"""
... | python | def replace(self, scaling_group, name, cooldown, min_entities,
max_entities, metadata=None):
"""
Replace an existing ScalingGroup configuration. All of the attributes
must be specified If you wish to delete any of the optional attributes,
pass them in as None.
"""
... | Replace an existing ScalingGroup configuration. All of the attributes
must be specified If you wish to delete any of the optional attributes,
pass them in as None. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/autoscale.py#L333-L344 |
pycontribs/pyrax | pyrax/autoscale.py | ScalingGroupManager.update | def update(self, scaling_group, name=None, cooldown=None,
min_entities=None, max_entities=None, metadata=None):
"""
Updates an existing ScalingGroup. One or more of the attributes can
be specified.
NOTE: if you specify metadata, it will *replace* any existing metadata.
... | python | def update(self, scaling_group, name=None, cooldown=None,
min_entities=None, max_entities=None, metadata=None):
"""
Updates an existing ScalingGroup. One or more of the attributes can
be specified.
NOTE: if you specify metadata, it will *replace* any existing metadata.
... | Updates an existing ScalingGroup. One or more of the attributes can
be specified.
NOTE: if you specify metadata, it will *replace* any existing metadata.
If you want to add to it, you either need to pass the complete dict of
metadata, or call the update_metadata() method. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/autoscale.py#L347-L373 |
pycontribs/pyrax | pyrax/autoscale.py | ScalingGroupManager.update_metadata | def update_metadata(self, scaling_group, metadata):
"""
Adds the given metadata dict to the existing metadata for the scaling
group.
"""
if not isinstance(scaling_group, ScalingGroup):
scaling_group = self.get(scaling_group)
curr_meta = scaling_group.metadata
... | python | def update_metadata(self, scaling_group, metadata):
"""
Adds the given metadata dict to the existing metadata for the scaling
group.
"""
if not isinstance(scaling_group, ScalingGroup):
scaling_group = self.get(scaling_group)
curr_meta = scaling_group.metadata
... | Adds the given metadata dict to the existing metadata for the scaling
group. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/autoscale.py#L376-L385 |
pycontribs/pyrax | pyrax/autoscale.py | ScalingGroupManager.get_launch_config | def get_launch_config(self, scaling_group):
"""
Returns the launch configuration for the specified scaling group.
"""
key_map = {
"OS-DCF:diskConfig": "disk_config",
"flavorRef": "flavor",
"imageRef": "image",
}
uri = "/%s/%s/launch" % ... | python | def get_launch_config(self, scaling_group):
"""
Returns the launch configuration for the specified scaling group.
"""
key_map = {
"OS-DCF:diskConfig": "disk_config",
"flavorRef": "flavor",
"imageRef": "image",
}
uri = "/%s/%s/launch" % ... | Returns the launch configuration for the specified scaling group. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/autoscale.py#L388-L407 |
pycontribs/pyrax | pyrax/autoscale.py | ScalingGroupManager.replace_launch_config | def replace_launch_config(self, scaling_group, launch_config_type,
server_name, image, flavor, disk_config=None, metadata=None,
personality=None, networks=None, load_balancers=None,
key_name=None, config_drive=False, user_data=None):
"""
Replace an existing launch con... | python | def replace_launch_config(self, scaling_group, launch_config_type,
server_name, image, flavor, disk_config=None, metadata=None,
personality=None, networks=None, load_balancers=None,
key_name=None, config_drive=False, user_data=None):
"""
Replace an existing launch con... | Replace an existing launch configuration. All of the attributes must be
specified. If you wish to delete any of the optional attributes, pass
them in as None. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/autoscale.py#L410-L427 |
pycontribs/pyrax | pyrax/autoscale.py | ScalingGroupManager.update_launch_config | def update_launch_config(self, scaling_group, server_name=None, image=None,
flavor=None, disk_config=None, metadata=None, personality=None,
networks=None, load_balancers=None, key_name=None, config_drive=False,
user_data=None):
"""
Updates the server launch configurat... | python | def update_launch_config(self, scaling_group, server_name=None, image=None,
flavor=None, disk_config=None, metadata=None, personality=None,
networks=None, load_balancers=None, key_name=None, config_drive=False,
user_data=None):
"""
Updates the server launch configurat... | Updates the server launch configuration for an existing scaling group.
One or more of the available attributes can be specified.
NOTE: if you specify metadata, it will *replace* any existing metadata.
If you want to add to it, you either need to pass the complete dict of
metadata, or ca... | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/autoscale.py#L430-L482 |
pycontribs/pyrax | pyrax/autoscale.py | ScalingGroupManager.update_launch_metadata | def update_launch_metadata(self, scaling_group, metadata):
"""
Adds the given metadata dict to the existing metadata for the scaling
group's launch configuration.
"""
if not isinstance(scaling_group, ScalingGroup):
scaling_group = self.get(scaling_group)
curr_... | python | def update_launch_metadata(self, scaling_group, metadata):
"""
Adds the given metadata dict to the existing metadata for the scaling
group's launch configuration.
"""
if not isinstance(scaling_group, ScalingGroup):
scaling_group = self.get(scaling_group)
curr_... | Adds the given metadata dict to the existing metadata for the scaling
group's launch configuration. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/autoscale.py#L485-L495 |
pycontribs/pyrax | pyrax/autoscale.py | ScalingGroupManager.add_policy | def add_policy(self, scaling_group, name, policy_type, cooldown,
change=None, is_percent=False, desired_capacity=None, args=None):
"""
Adds a policy with the given values to the specified scaling group. The
'change' parameter is treated as an absolute amount, unless
'is_perce... | python | def add_policy(self, scaling_group, name, policy_type, cooldown,
change=None, is_percent=False, desired_capacity=None, args=None):
"""
Adds a policy with the given values to the specified scaling group. The
'change' parameter is treated as an absolute amount, unless
'is_perce... | Adds a policy with the given values to the specified scaling group. The
'change' parameter is treated as an absolute amount, unless
'is_percent' is True, in which case it is treated as a percentage. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/autoscale.py#L498-L513 |
pycontribs/pyrax | pyrax/autoscale.py | ScalingGroupManager.list_policies | def list_policies(self, scaling_group):
"""
Returns a list of all policies defined for the specified scaling group.
"""
uri = "/%s/%s/policies" % (self.uri_base, utils.get_id(scaling_group))
resp, resp_body = self.api.method_get(uri)
return [AutoScalePolicy(self, data, sc... | python | def list_policies(self, scaling_group):
"""
Returns a list of all policies defined for the specified scaling group.
"""
uri = "/%s/%s/policies" % (self.uri_base, utils.get_id(scaling_group))
resp, resp_body = self.api.method_get(uri)
return [AutoScalePolicy(self, data, sc... | Returns a list of all policies defined for the specified scaling group. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/autoscale.py#L531-L538 |
pycontribs/pyrax | pyrax/autoscale.py | ScalingGroupManager.replace_policy | def replace_policy(self, scaling_group, policy, name,
policy_type, cooldown, change=None, is_percent=False,
desired_capacity=None, args=None):
"""
Replace an existing policy. All of the attributes must be specified. If
you wish to delete any of the optional attributes, pa... | python | def replace_policy(self, scaling_group, policy, name,
policy_type, cooldown, change=None, is_percent=False,
desired_capacity=None, args=None):
"""
Replace an existing policy. All of the attributes must be specified. If
you wish to delete any of the optional attributes, pa... | Replace an existing policy. All of the attributes must be specified. If
you wish to delete any of the optional attributes, pass them in as
None. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/autoscale.py#L552-L566 |
pycontribs/pyrax | pyrax/autoscale.py | ScalingGroupManager.update_policy | def update_policy(self, scaling_group, policy, name=None, policy_type=None,
cooldown=None, change=None, is_percent=False,
desired_capacity=None, args=None):
"""
Updates the specified policy. One or more of the parameters may be
specified.
"""
uri = "/%s/%s... | python | def update_policy(self, scaling_group, policy, name=None, policy_type=None,
cooldown=None, change=None, is_percent=False,
desired_capacity=None, args=None):
"""
Updates the specified policy. One or more of the parameters may be
specified.
"""
uri = "/%s/%s... | Updates the specified policy. One or more of the parameters may be
specified. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/autoscale.py#L569-L603 |
pycontribs/pyrax | pyrax/autoscale.py | ScalingGroupManager.execute_policy | def execute_policy(self, scaling_group, policy):
"""
Executes the specified policy for this scaling group.
"""
uri = "/%s/%s/policies/%s/execute" % (self.uri_base,
utils.get_id(scaling_group), utils.get_id(policy))
resp, resp_body = self.api.method_post(uri)
... | python | def execute_policy(self, scaling_group, policy):
"""
Executes the specified policy for this scaling group.
"""
uri = "/%s/%s/policies/%s/execute" % (self.uri_base,
utils.get_id(scaling_group), utils.get_id(policy))
resp, resp_body = self.api.method_post(uri)
... | Executes the specified policy for this scaling group. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/autoscale.py#L606-L613 |
pycontribs/pyrax | pyrax/autoscale.py | ScalingGroupManager.delete_policy | def delete_policy(self, scaling_group, policy):
"""
Deletes the specified policy from the scaling group.
"""
uri = "/%s/%s/policies/%s" % (self.uri_base,
utils.get_id(scaling_group), utils.get_id(policy))
resp, resp_body = self.api.method_delete(uri) | python | def delete_policy(self, scaling_group, policy):
"""
Deletes the specified policy from the scaling group.
"""
uri = "/%s/%s/policies/%s" % (self.uri_base,
utils.get_id(scaling_group), utils.get_id(policy))
resp, resp_body = self.api.method_delete(uri) | Deletes the specified policy from the scaling group. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/autoscale.py#L616-L622 |
pycontribs/pyrax | pyrax/autoscale.py | ScalingGroupManager.add_webhook | def add_webhook(self, scaling_group, policy, name, metadata=None):
"""
Adds a webhook to the specified policy.
"""
uri = "/%s/%s/policies/%s/webhooks" % (self.uri_base,
utils.get_id(scaling_group), utils.get_id(policy))
body = self._create_webhook_body(name, metad... | python | def add_webhook(self, scaling_group, policy, name, metadata=None):
"""
Adds a webhook to the specified policy.
"""
uri = "/%s/%s/policies/%s/webhooks" % (self.uri_base,
utils.get_id(scaling_group), utils.get_id(policy))
body = self._create_webhook_body(name, metad... | Adds a webhook to the specified policy. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/autoscale.py#L632-L643 |
pycontribs/pyrax | pyrax/autoscale.py | ScalingGroupManager.list_webhooks | def list_webhooks(self, scaling_group, policy):
"""
Returns a list of all webhooks for the specified policy.
"""
uri = "/%s/%s/policies/%s/webhooks" % (self.uri_base,
utils.get_id(scaling_group), utils.get_id(policy))
resp, resp_body = self.api.method_get(uri)
... | python | def list_webhooks(self, scaling_group, policy):
"""
Returns a list of all webhooks for the specified policy.
"""
uri = "/%s/%s/policies/%s/webhooks" % (self.uri_base,
utils.get_id(scaling_group), utils.get_id(policy))
resp, resp_body = self.api.method_get(uri)
... | Returns a list of all webhooks for the specified policy. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/autoscale.py#L646-L654 |
pycontribs/pyrax | pyrax/autoscale.py | ScalingGroupManager.replace_webhook | def replace_webhook(self, scaling_group, policy, webhook, name,
metadata=None):
"""
Replace an existing webhook. All of the attributes must be specified.
If you wish to delete any of the optional attributes, pass them in as
None.
"""
uri = "/%s/%s/policies/%s/... | python | def replace_webhook(self, scaling_group, policy, webhook, name,
metadata=None):
"""
Replace an existing webhook. All of the attributes must be specified.
If you wish to delete any of the optional attributes, pass them in as
None.
"""
uri = "/%s/%s/policies/%s/... | Replace an existing webhook. All of the attributes must be specified.
If you wish to delete any of the optional attributes, pass them in as
None. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/autoscale.py#L669-L683 |
pycontribs/pyrax | pyrax/autoscale.py | ScalingGroupManager.update_webhook | def update_webhook(self, scaling_group, policy, webhook, name=None,
metadata=None):
"""
Updates the specified webhook. One or more of the parameters may be
specified.
"""
uri = "/%s/%s/policies/%s/webhooks/%s" % (self.uri_base,
utils.get_id(scaling_gro... | python | def update_webhook(self, scaling_group, policy, webhook, name=None,
metadata=None):
"""
Updates the specified webhook. One or more of the parameters may be
specified.
"""
uri = "/%s/%s/policies/%s/webhooks/%s" % (self.uri_base,
utils.get_id(scaling_gro... | Updates the specified webhook. One or more of the parameters may be
specified. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/autoscale.py#L686-L703 |
pycontribs/pyrax | pyrax/autoscale.py | ScalingGroupManager.update_webhook_metadata | def update_webhook_metadata(self, scaling_group, policy, webhook, metadata):
"""
Adds the given metadata dict to the existing metadata for the specified
webhook.
"""
if not isinstance(webhook, AutoScaleWebhook):
webhook = self.get_webhook(scaling_group, policy, webhoo... | python | def update_webhook_metadata(self, scaling_group, policy, webhook, metadata):
"""
Adds the given metadata dict to the existing metadata for the specified
webhook.
"""
if not isinstance(webhook, AutoScaleWebhook):
webhook = self.get_webhook(scaling_group, policy, webhoo... | Adds the given metadata dict to the existing metadata for the specified
webhook. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/autoscale.py#L706-L716 |
pycontribs/pyrax | pyrax/autoscale.py | ScalingGroupManager.delete_webhook | def delete_webhook(self, scaling_group, policy, webhook):
"""
Deletes the specified webhook from the specified policy.
"""
uri = "/%s/%s/policies/%s/webhooks/%s" % (self.uri_base,
utils.get_id(scaling_group), utils.get_id(policy),
utils.get_id(webhook))
... | python | def delete_webhook(self, scaling_group, policy, webhook):
"""
Deletes the specified webhook from the specified policy.
"""
uri = "/%s/%s/policies/%s/webhooks/%s" % (self.uri_base,
utils.get_id(scaling_group), utils.get_id(policy),
utils.get_id(webhook))
... | Deletes the specified webhook from the specified policy. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/autoscale.py#L719-L727 |
pycontribs/pyrax | pyrax/autoscale.py | ScalingGroupManager._resolve_lbs | def _resolve_lbs(load_balancers):
"""
Takes either a single LB reference or a list of references and returns
the dictionary required for creating a Scaling Group.
References can be either a dict that matches the structure required by
the autoscale API, a CloudLoadBalancer instan... | python | def _resolve_lbs(load_balancers):
"""
Takes either a single LB reference or a list of references and returns
the dictionary required for creating a Scaling Group.
References can be either a dict that matches the structure required by
the autoscale API, a CloudLoadBalancer instan... | Takes either a single LB reference or a list of references and returns
the dictionary required for creating a Scaling Group.
References can be either a dict that matches the structure required by
the autoscale API, a CloudLoadBalancer instance, or the ID of the load
balancer. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/autoscale.py#L731-L767 |
pycontribs/pyrax | pyrax/autoscale.py | ScalingGroupManager._encode_personality | def _encode_personality(self, personality):
"""
Personality files must be base64-encoded before transmitting.
"""
if personality is None:
personality = []
else:
personality = utils.coerce_to_list(personality)
for pfile in personality:
... | python | def _encode_personality(self, personality):
"""
Personality files must be base64-encoded before transmitting.
"""
if personality is None:
personality = []
else:
personality = utils.coerce_to_list(personality)
for pfile in personality:
... | Personality files must be base64-encoded before transmitting. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/autoscale.py#L770-L781 |
pycontribs/pyrax | pyrax/autoscale.py | ScalingGroupManager._create_body | def _create_body(self, name, cooldown, min_entities, max_entities,
launch_config_type, server_name, image, flavor, disk_config=None,
metadata=None, personality=None, networks=None,
load_balancers=None, scaling_policies=None, group_metadata=None,
key_name=None, config_driv... | python | def _create_body(self, name, cooldown, min_entities, max_entities,
launch_config_type, server_name, image, flavor, disk_config=None,
metadata=None, personality=None, networks=None,
load_balancers=None, scaling_policies=None, group_metadata=None,
key_name=None, config_driv... | Used to create the dict required to create any of the following:
A Scaling Group | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/autoscale.py#L784-L809 |
pycontribs/pyrax | pyrax/autoscale.py | AutoScalePolicy.add_webhook | def add_webhook(self, name, metadata=None):
"""
Adds a webhook to this policy.
"""
return self.manager.add_webhook(self.scaling_group, self, name,
metadata=metadata) | python | def add_webhook(self, name, metadata=None):
"""
Adds a webhook to this policy.
"""
return self.manager.add_webhook(self.scaling_group, self, name,
metadata=metadata) | Adds a webhook to this policy. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/autoscale.py#L906-L911 |
pycontribs/pyrax | pyrax/autoscale.py | AutoScalePolicy.get_webhook | def get_webhook(self, webhook):
"""
Gets the detail for the specified webhook.
"""
return self.manager.get_webhook(self.scaling_group, self, webhook) | python | def get_webhook(self, webhook):
"""
Gets the detail for the specified webhook.
"""
return self.manager.get_webhook(self.scaling_group, self, webhook) | Gets the detail for the specified webhook. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/autoscale.py#L921-L925 |
pycontribs/pyrax | pyrax/autoscale.py | AutoScalePolicy.update_webhook | def update_webhook(self, webhook, name=None, metadata=None):
"""
Updates the specified webhook. One or more of the parameters may be
specified.
"""
return self.manager.update_webhook(self.scaling_group, policy=self,
webhook=webhook, name=name, metadata=metadata) | python | def update_webhook(self, webhook, name=None, metadata=None):
"""
Updates the specified webhook. One or more of the parameters may be
specified.
"""
return self.manager.update_webhook(self.scaling_group, policy=self,
webhook=webhook, name=name, metadata=metadata) | Updates the specified webhook. One or more of the parameters may be
specified. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/autoscale.py#L928-L934 |
pycontribs/pyrax | pyrax/autoscale.py | AutoScalePolicy.update_webhook_metadata | def update_webhook_metadata(self, webhook, metadata):
"""
Adds the given metadata dict to the existing metadata for the specified
webhook.
"""
return self.manager.update_webhook_metadata(self.scaling_group, self,
webhook, metadata) | python | def update_webhook_metadata(self, webhook, metadata):
"""
Adds the given metadata dict to the existing metadata for the specified
webhook.
"""
return self.manager.update_webhook_metadata(self.scaling_group, self,
webhook, metadata) | Adds the given metadata dict to the existing metadata for the specified
webhook. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/autoscale.py#L937-L943 |
pycontribs/pyrax | pyrax/autoscale.py | AutoScalePolicy.delete_webhook | def delete_webhook(self, webhook):
"""
Deletes the specified webhook from this policy.
"""
return self.manager.delete_webhook(self.scaling_group, self, webhook) | python | def delete_webhook(self, webhook):
"""
Deletes the specified webhook from this policy.
"""
return self.manager.delete_webhook(self.scaling_group, self, webhook) | Deletes the specified webhook from this policy. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/autoscale.py#L946-L950 |
pycontribs/pyrax | pyrax/autoscale.py | AutoScaleWebhook.update | def update(self, name=None, metadata=None):
"""
Updates this webhook. One or more of the parameters may be specified.
"""
return self.policy.update_webhook(self, name=name, metadata=metadata) | python | def update(self, name=None, metadata=None):
"""
Updates this webhook. One or more of the parameters may be specified.
"""
return self.policy.update_webhook(self, name=name, metadata=metadata) | Updates this webhook. One or more of the parameters may be specified. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/autoscale.py#L968-L972 |
pycontribs/pyrax | pyrax/autoscale.py | AutoScaleClient._configure_manager | def _configure_manager(self):
"""
Creates a manager to handle autoscale operations.
"""
self._manager = ScalingGroupManager(self,
resource_class=ScalingGroup, response_key="group",
uri_base="groups") | python | def _configure_manager(self):
"""
Creates a manager to handle autoscale operations.
"""
self._manager = ScalingGroupManager(self,
resource_class=ScalingGroup, response_key="group",
uri_base="groups") | Creates a manager to handle autoscale operations. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/autoscale.py#L996-L1002 |
pycontribs/pyrax | pyrax/autoscale.py | AutoScaleClient.replace | def replace(self, scaling_group, name, cooldown, min_entities,
max_entities, metadata=None):
"""
Replace an existing ScalingGroup configuration. All of the attributes
must be specified. If you wish to delete any of the optional
attributes, pass them in as None.
"""
... | python | def replace(self, scaling_group, name, cooldown, min_entities,
max_entities, metadata=None):
"""
Replace an existing ScalingGroup configuration. All of the attributes
must be specified. If you wish to delete any of the optional
attributes, pass them in as None.
"""
... | Replace an existing ScalingGroup configuration. All of the attributes
must be specified. If you wish to delete any of the optional
attributes, pass them in as None. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/autoscale.py#L1030-L1038 |
pycontribs/pyrax | pyrax/autoscale.py | AutoScaleClient.update | def update(self, scaling_group, name=None, cooldown=None, min_entities=None,
max_entities=None, metadata=None):
"""
Updates an existing ScalingGroup. One or more of the attributes can be
specified.
NOTE: if you specify metadata, it will *replace* any existing metadata.
... | python | def update(self, scaling_group, name=None, cooldown=None, min_entities=None,
max_entities=None, metadata=None):
"""
Updates an existing ScalingGroup. One or more of the attributes can be
specified.
NOTE: if you specify metadata, it will *replace* any existing metadata.
... | Updates an existing ScalingGroup. One or more of the attributes can be
specified.
NOTE: if you specify metadata, it will *replace* any existing metadata.
If you want to add to it, you either need to pass the complete dict of
metadata, or call the update_metadata() method. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/autoscale.py#L1041-L1053 |
pycontribs/pyrax | pyrax/autoscale.py | AutoScaleClient.replace_launch_config | def replace_launch_config(self, scaling_group, launch_config_type,
server_name, image, flavor, disk_config=None, metadata=None,
personality=None, networks=None, load_balancers=None,
key_name=None):
"""
Replace an existing launch configuration. All of the attributes mu... | python | def replace_launch_config(self, scaling_group, launch_config_type,
server_name, image, flavor, disk_config=None, metadata=None,
personality=None, networks=None, load_balancers=None,
key_name=None):
"""
Replace an existing launch configuration. All of the attributes mu... | Replace an existing launch configuration. All of the attributes must be
specified. If you wish to delete any of the optional attributes, pass
them in as None. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/autoscale.py#L1078-L1091 |
pycontribs/pyrax | pyrax/autoscale.py | AutoScaleClient.update_launch_config | def update_launch_config(self, scaling_group, server_name=None, image=None,
flavor=None, disk_config=None, metadata=None, personality=None,
networks=None, load_balancers=None, key_name=None, config_drive=False,
user_data=None):
"""
Updates the server launch configurat... | python | def update_launch_config(self, scaling_group, server_name=None, image=None,
flavor=None, disk_config=None, metadata=None, personality=None,
networks=None, load_balancers=None, key_name=None, config_drive=False,
user_data=None):
"""
Updates the server launch configurat... | Updates the server launch configuration for an existing scaling group.
One or more of the available attributes can be specified.
NOTE: if you specify metadata, it will *replace* any existing metadata.
If you want to add to it, you either need to pass the complete dict of
metadata, or ca... | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/autoscale.py#L1094-L1111 |
pycontribs/pyrax | pyrax/autoscale.py | AutoScaleClient.add_policy | def add_policy(self, scaling_group, name, policy_type, cooldown,
change=None, is_percent=False, desired_capacity=None, args=None):
"""
Adds a policy with the given values to the specified scaling group. The
'change' parameter is treated as an absolute amount, unless
'is_perce... | python | def add_policy(self, scaling_group, name, policy_type, cooldown,
change=None, is_percent=False, desired_capacity=None, args=None):
"""
Adds a policy with the given values to the specified scaling group. The
'change' parameter is treated as an absolute amount, unless
'is_perce... | Adds a policy with the given values to the specified scaling group. The
'change' parameter is treated as an absolute amount, unless
'is_percent' is True, in which case it is treated as a percentage. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/autoscale.py#L1122-L1131 |
pycontribs/pyrax | pyrax/autoscale.py | AutoScaleClient.update_policy | def update_policy(self, scaling_group, policy, name=None, policy_type=None,
cooldown=None, change=None, is_percent=False,
desired_capacity=None, args=None):
"""
Updates the specified policy. One or more of the parameters may be
specified.
"""
return self._... | python | def update_policy(self, scaling_group, policy, name=None, policy_type=None,
cooldown=None, change=None, is_percent=False,
desired_capacity=None, args=None):
"""
Updates the specified policy. One or more of the parameters may be
specified.
"""
return self._... | Updates the specified policy. One or more of the parameters may be
specified. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/autoscale.py#L1161-L1171 |
pycontribs/pyrax | pyrax/autoscale.py | AutoScaleClient.execute_policy | def execute_policy(self, scaling_group, policy):
"""
Executes the specified policy for the scaling group.
"""
return self._manager.execute_policy(scaling_group=scaling_group,
policy=policy) | python | def execute_policy(self, scaling_group, policy):
"""
Executes the specified policy for the scaling group.
"""
return self._manager.execute_policy(scaling_group=scaling_group,
policy=policy) | Executes the specified policy for the scaling group. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/autoscale.py#L1174-L1179 |
pycontribs/pyrax | pyrax/autoscale.py | AutoScaleClient.delete_policy | def delete_policy(self, scaling_group, policy):
"""
Deletes the specified policy from the scaling group.
"""
return self._manager.delete_policy(scaling_group=scaling_group,
policy=policy) | python | def delete_policy(self, scaling_group, policy):
"""
Deletes the specified policy from the scaling group.
"""
return self._manager.delete_policy(scaling_group=scaling_group,
policy=policy) | Deletes the specified policy from the scaling group. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/autoscale.py#L1182-L1187 |
pycontribs/pyrax | pyrax/autoscale.py | AutoScaleClient.add_webhook | def add_webhook(self, scaling_group, policy, name, metadata=None):
"""
Adds a webhook to the specified policy.
"""
return self._manager.add_webhook(scaling_group, policy, name,
metadata=metadata) | python | def add_webhook(self, scaling_group, policy, name, metadata=None):
"""
Adds a webhook to the specified policy.
"""
return self._manager.add_webhook(scaling_group, policy, name,
metadata=metadata) | Adds a webhook to the specified policy. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/autoscale.py#L1190-L1195 |
pycontribs/pyrax | pyrax/autoscale.py | AutoScaleClient.get_webhook | def get_webhook(self, scaling_group, policy, webhook):
"""
Gets the detail for the specified webhook.
"""
return self._manager.get_webhook(scaling_group, policy, webhook) | python | def get_webhook(self, scaling_group, policy, webhook):
"""
Gets the detail for the specified webhook.
"""
return self._manager.get_webhook(scaling_group, policy, webhook) | Gets the detail for the specified webhook. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/autoscale.py#L1205-L1209 |
pycontribs/pyrax | pyrax/autoscale.py | AutoScaleClient.replace_webhook | def replace_webhook(self, scaling_group, policy, webhook, name,
metadata=None):
"""
Replace an existing webhook. All of the attributes must be specified.
If you wish to delete any of the optional attributes, pass them in as
None.
"""
return self._manager.repla... | python | def replace_webhook(self, scaling_group, policy, webhook, name,
metadata=None):
"""
Replace an existing webhook. All of the attributes must be specified.
If you wish to delete any of the optional attributes, pass them in as
None.
"""
return self._manager.repla... | Replace an existing webhook. All of the attributes must be specified.
If you wish to delete any of the optional attributes, pass them in as
None. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/autoscale.py#L1212-L1220 |
pycontribs/pyrax | pyrax/autoscale.py | AutoScaleClient.update_webhook | def update_webhook(self, scaling_group, policy, webhook, name=None,
metadata=None):
"""
Updates the specified webhook. One or more of the parameters may be
specified.
"""
return self._manager.update_webhook(scaling_group=scaling_group,
policy=policy, w... | python | def update_webhook(self, scaling_group, policy, webhook, name=None,
metadata=None):
"""
Updates the specified webhook. One or more of the parameters may be
specified.
"""
return self._manager.update_webhook(scaling_group=scaling_group,
policy=policy, w... | Updates the specified webhook. One or more of the parameters may be
specified. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/autoscale.py#L1223-L1230 |
pycontribs/pyrax | pyrax/autoscale.py | AutoScaleClient.update_webhook_metadata | def update_webhook_metadata(self, scaling_group, policy, webhook, metadata):
"""
Adds the given metadata dict to the existing metadata for the specified
webhook.
"""
return self._manager.update_webhook_metadata(scaling_group, policy,
webhook, metadata) | python | def update_webhook_metadata(self, scaling_group, policy, webhook, metadata):
"""
Adds the given metadata dict to the existing metadata for the specified
webhook.
"""
return self._manager.update_webhook_metadata(scaling_group, policy,
webhook, metadata) | Adds the given metadata dict to the existing metadata for the specified
webhook. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/autoscale.py#L1233-L1239 |
pycontribs/pyrax | pyrax/autoscale.py | AutoScaleClient.delete_webhook | def delete_webhook(self, scaling_group, policy, webhook):
"""
Deletes the specified webhook from the policy.
"""
return self._manager.delete_webhook(scaling_group, policy, webhook) | python | def delete_webhook(self, scaling_group, policy, webhook):
"""
Deletes the specified webhook from the policy.
"""
return self._manager.delete_webhook(scaling_group, policy, webhook) | Deletes the specified webhook from the policy. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/autoscale.py#L1242-L1246 |
pycontribs/pyrax | pyrax/resource.py | BaseResource.human_id | def human_id(self):
"""Subclasses may override this to provide a pretty ID which can be used
for bash completion.
"""
if self.NAME_ATTR in self.__dict__ and self.HUMAN_ID:
return utils.to_slug(getattr(self, self.NAME_ATTR))
return None | python | def human_id(self):
"""Subclasses may override this to provide a pretty ID which can be used
for bash completion.
"""
if self.NAME_ATTR in self.__dict__ and self.HUMAN_ID:
return utils.to_slug(getattr(self, self.NAME_ATTR))
return None | Subclasses may override this to provide a pretty ID which can be used
for bash completion. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/resource.py#L57-L63 |
pycontribs/pyrax | pyrax/resource.py | BaseResource._add_details | def _add_details(self, info):
"""
Takes the dict returned by the API call and sets the
corresponding attributes on the object.
"""
for (key, val) in six.iteritems(info):
if isinstance(key, six.text_type) and six.PY2:
key = key.encode(pyrax.get_encoding... | python | def _add_details(self, info):
"""
Takes the dict returned by the API call and sets the
corresponding attributes on the object.
"""
for (key, val) in six.iteritems(info):
if isinstance(key, six.text_type) and six.PY2:
key = key.encode(pyrax.get_encoding... | Takes the dict returned by the API call and sets the
corresponding attributes on the object. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/resource.py#L66-L76 |
pycontribs/pyrax | pyrax/resource.py | BaseResource.get | def get(self):
"""Gets the details for the object."""
# set 'loaded' first ... so if we have to bail, we know we tried.
self.loaded = True
if not hasattr(self.manager, "get"):
return
if not self.get_details:
return
new = self.manager.get(self)
... | python | def get(self):
"""Gets the details for the object."""
# set 'loaded' first ... so if we have to bail, we know we tried.
self.loaded = True
if not hasattr(self.manager, "get"):
return
if not self.get_details:
return
new = self.manager.get(self)
... | Gets the details for the object. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/resource.py#L107-L117 |
pycontribs/pyrax | pyrax/resource.py | BaseResource.delete | def delete(self):
"""Deletes the object."""
# set 'loaded' first ... so if we have to bail, we know we tried.
self.loaded = True
if not hasattr(self.manager, "delete"):
return
self.manager.delete(self) | python | def delete(self):
"""Deletes the object."""
# set 'loaded' first ... so if we have to bail, we know we tried.
self.loaded = True
if not hasattr(self.manager, "delete"):
return
self.manager.delete(self) | Deletes the object. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/resource.py#L122-L128 |
pycontribs/pyrax | pyrax/client.py | BaseClient.list | def list(self, limit=None, marker=None):
"""
Returns a list of resource objects. Pagination is supported through the
optional 'marker' and 'limit' parameters.
"""
return self._manager.list(limit=limit, marker=marker) | python | def list(self, limit=None, marker=None):
"""
Returns a list of resource objects. Pagination is supported through the
optional 'marker' and 'limit' parameters.
"""
return self._manager.list(limit=limit, marker=marker) | Returns a list of resource objects. Pagination is supported through the
optional 'marker' and 'limit' parameters. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/client.py#L86-L91 |
pycontribs/pyrax | pyrax/client.py | BaseClient.request | def request(self, uri, method, *args, **kwargs):
"""
Formats the request into a dict representing the headers
and body that will be used to make the API call.
"""
if self.timeout:
kwargs["timeout"] = self.timeout
kwargs["verify"] = self.verify_ssl
kwar... | python | def request(self, uri, method, *args, **kwargs):
"""
Formats the request into a dict representing the headers
and body that will be used to make the API call.
"""
if self.timeout:
kwargs["timeout"] = self.timeout
kwargs["verify"] = self.verify_ssl
kwar... | Formats the request into a dict representing the headers
and body that will be used to make the API call. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/client.py#L164-L185 |
pycontribs/pyrax | pyrax/client.py | BaseClient._time_request | def _time_request(self, uri, method, **kwargs):
"""Wraps the request call and records the elapsed time."""
start_time = time.time()
resp, body = self.request(uri, method, **kwargs)
self.times.append(("%s %s" % (method, uri),
start_time, time.time()))
return resp, ... | python | def _time_request(self, uri, method, **kwargs):
"""Wraps the request call and records the elapsed time."""
start_time = time.time()
resp, body = self.request(uri, method, **kwargs)
self.times.append(("%s %s" % (method, uri),
start_time, time.time()))
return resp, ... | Wraps the request call and records the elapsed time. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/client.py#L188-L194 |
pycontribs/pyrax | pyrax/client.py | BaseClient._api_request | def _api_request(self, uri, method, **kwargs):
"""
Manages the request by adding any auth information, and retries
the request after authenticating if the initial request returned
and Unauthorized exception.
"""
id_svc = self.identity
if not all((self.management_u... | python | def _api_request(self, uri, method, **kwargs):
"""
Manages the request by adding any auth information, and retries
the request after authenticating if the initial request returned
and Unauthorized exception.
"""
id_svc = self.identity
if not all((self.management_u... | Manages the request by adding any auth information, and retries
the request after authenticating if the initial request returned
and Unauthorized exception. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/client.py#L197-L238 |
pycontribs/pyrax | pyrax/manager.py | BaseManager.list | def list(self, limit=None, marker=None, return_raw=False, other_keys=None):
"""
Returns a list of resource objects. Pagination is supported through the
optional 'marker' and 'limit' parameters.
Some APIs do not follow the typical pattern in their responses, and the
BaseManager s... | python | def list(self, limit=None, marker=None, return_raw=False, other_keys=None):
"""
Returns a list of resource objects. Pagination is supported through the
optional 'marker' and 'limit' parameters.
Some APIs do not follow the typical pattern in their responses, and the
BaseManager s... | Returns a list of resource objects. Pagination is supported through the
optional 'marker' and 'limit' parameters.
Some APIs do not follow the typical pattern in their responses, and the
BaseManager subclasses will have to parse the raw response to get the
desired information. For those ... | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/manager.py#L62-L90 |
pycontribs/pyrax | pyrax/manager.py | BaseManager.head | def head(self, item):
"""Makes a HEAD request on a specific item."""
uri = "/%s/%s" % (self.uri_base, utils.get_id(item))
return self._head(uri) | python | def head(self, item):
"""Makes a HEAD request on a specific item."""
uri = "/%s/%s" % (self.uri_base, utils.get_id(item))
return self._head(uri) | Makes a HEAD request on a specific item. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/manager.py#L93-L96 |
pycontribs/pyrax | pyrax/manager.py | BaseManager.get | def get(self, item):
"""Gets a specific item."""
uri = "/%s/%s" % (self.uri_base, utils.get_id(item))
return self._get(uri) | python | def get(self, item):
"""Gets a specific item."""
uri = "/%s/%s" % (self.uri_base, utils.get_id(item))
return self._get(uri) | Gets a specific item. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/manager.py#L99-L102 |
pycontribs/pyrax | pyrax/manager.py | BaseManager.create | def create(self, name, *args, **kwargs):
"""
Subclasses need to implement the _create_body() method to return a dict
that will be used for the API request body.
For cases where no response is returned from the API on creation, pass
`return_none=True` so that the _create method d... | python | def create(self, name, *args, **kwargs):
"""
Subclasses need to implement the _create_body() method to return a dict
that will be used for the API request body.
For cases where no response is returned from the API on creation, pass
`return_none=True` so that the _create method d... | Subclasses need to implement the _create_body() method to return a dict
that will be used for the API request body.
For cases where no response is returned from the API on creation, pass
`return_none=True` so that the _create method doesn't expect one.
For cases where you do not want t... | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/manager.py#L105-L126 |
pycontribs/pyrax | pyrax/manager.py | BaseManager.delete | def delete(self, item):
"""Deletes the specified item."""
uri = "/%s/%s" % (self.uri_base, utils.get_id(item))
return self._delete(uri) | python | def delete(self, item):
"""Deletes the specified item."""
uri = "/%s/%s" % (self.uri_base, utils.get_id(item))
return self._delete(uri) | Deletes the specified item. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/manager.py#L138-L141 |
pycontribs/pyrax | pyrax/manager.py | BaseManager._list | def _list(self, uri, obj_class=None, body=None, return_raw=False,
other_keys=None):
"""
Handles the communication with the API when getting
a full listing of the resources managed by this class.
"""
if body:
resp, resp_body = self.api.method_post(uri, body... | python | def _list(self, uri, obj_class=None, body=None, return_raw=False,
other_keys=None):
"""
Handles the communication with the API when getting
a full listing of the resources managed by this class.
"""
if body:
resp, resp_body = self.api.method_post(uri, body... | Handles the communication with the API when getting
a full listing of the resources managed by this class. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/manager.py#L144-L166 |
pycontribs/pyrax | pyrax/manager.py | BaseManager._data_from_response | def _data_from_response(self, resp_body, key=None):
"""
This works for most API responses, but some don't structure their
listing responses the same way, so overriding this method allows
subclasses to handle extraction for those outliers.
"""
if key:
data = re... | python | def _data_from_response(self, resp_body, key=None):
"""
This works for most API responses, but some don't structure their
listing responses the same way, so overriding this method allows
subclasses to handle extraction for those outliers.
"""
if key:
data = re... | This works for most API responses, but some don't structure their
listing responses the same way, so overriding this method allows
subclasses to handle extraction for those outliers. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/manager.py#L169-L187 |
pycontribs/pyrax | pyrax/manager.py | BaseManager._head | def _head(self, uri):
"""
Handles the communication with the API when performing a HEAD request
on a specific resource managed by this class. Returns the headers
contained in the response.
"""
resp, resp_body = self.api.method_head(uri)
return resp | python | def _head(self, uri):
"""
Handles the communication with the API when performing a HEAD request
on a specific resource managed by this class. Returns the headers
contained in the response.
"""
resp, resp_body = self.api.method_head(uri)
return resp | Handles the communication with the API when performing a HEAD request
on a specific resource managed by this class. Returns the headers
contained in the response. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/manager.py#L190-L197 |
pycontribs/pyrax | pyrax/manager.py | BaseManager._get | def _get(self, uri):
"""
Handles the communication with the API when getting
a specific resource managed by this class.
"""
resp, resp_body = self.api.method_get(uri)
return self.resource_class(self, resp_body, self.response_key,
loaded=True) | python | def _get(self, uri):
"""
Handles the communication with the API when getting
a specific resource managed by this class.
"""
resp, resp_body = self.api.method_get(uri)
return self.resource_class(self, resp_body, self.response_key,
loaded=True) | Handles the communication with the API when getting
a specific resource managed by this class. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/manager.py#L200-L207 |
pycontribs/pyrax | pyrax/manager.py | BaseManager._create | def _create(self, uri, body, return_none=False, return_raw=False,
return_response=None, **kwargs):
"""
Handles the communication with the API when creating a new
resource managed by this class.
"""
self.run_hooks("modify_body_for_create", body, **kwargs)
resp,... | python | def _create(self, uri, body, return_none=False, return_raw=False,
return_response=None, **kwargs):
"""
Handles the communication with the API when creating a new
resource managed by this class.
"""
self.run_hooks("modify_body_for_create", body, **kwargs)
resp,... | Handles the communication with the API when creating a new
resource managed by this class. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/manager.py#L210-L228 |
pycontribs/pyrax | pyrax/manager.py | BaseManager._update | def _update(self, uri, body, **kwargs):
"""
Handles the communication with the API when updating
a specific resource managed by this class.
"""
self.run_hooks("modify_body_for_update", body, **kwargs)
resp, resp_body = self.api.method_put(uri, body=body)
return re... | python | def _update(self, uri, body, **kwargs):
"""
Handles the communication with the API when updating
a specific resource managed by this class.
"""
self.run_hooks("modify_body_for_update", body, **kwargs)
resp, resp_body = self.api.method_put(uri, body=body)
return re... | Handles the communication with the API when updating
a specific resource managed by this class. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/manager.py#L239-L246 |
pycontribs/pyrax | pyrax/manager.py | BaseManager.action | def action(self, item, action_type, body={}):
"""
Several API calls are lumped under the 'action' API. This
is the generic handler for such calls.
"""
uri = "/%s/%s/action" % (self.uri_base, utils.get_id(item))
action_body = {action_type: body}
return self.api.met... | python | def action(self, item, action_type, body={}):
"""
Several API calls are lumped under the 'action' API. This
is the generic handler for such calls.
"""
uri = "/%s/%s/action" % (self.uri_base, utils.get_id(item))
action_body = {action_type: body}
return self.api.met... | Several API calls are lumped under the 'action' API. This
is the generic handler for such calls. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/manager.py#L249-L256 |
pycontribs/pyrax | pyrax/manager.py | BaseManager.find | def find(self, **kwargs):
"""
Finds a single item with attributes matching ``**kwargs``.
This isn't very efficient: it loads the entire list then filters on
the Python side.
"""
matches = self.findall(**kwargs)
num_matches = len(matches)
if not num_matche... | python | def find(self, **kwargs):
"""
Finds a single item with attributes matching ``**kwargs``.
This isn't very efficient: it loads the entire list then filters on
the Python side.
"""
matches = self.findall(**kwargs)
num_matches = len(matches)
if not num_matche... | Finds a single item with attributes matching ``**kwargs``.
This isn't very efficient: it loads the entire list then filters on
the Python side. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/manager.py#L259-L276 |
pycontribs/pyrax | pyrax/base_identity.py | Service._ep_for_region | def _ep_for_region(self, region):
"""
Given a region, returns the Endpoint for that region, or the Endpoint
for the ALL region if no match is found. If no match is found, None
is returned, and it is up to the calling method to handle it
appropriately.
"""
rgn = re... | python | def _ep_for_region(self, region):
"""
Given a region, returns the Endpoint for that region, or the Endpoint
for the ALL region if no match is found. If no match is found, None
is returned, and it is up to the calling method to handle it
appropriately.
"""
rgn = re... | Given a region, returns the Endpoint for that region, or the Endpoint
for the ALL region if no match is found. If no match is found, None
is returned, and it is up to the calling method to handle it
appropriately. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/base_identity.py#L95-L113 |
pycontribs/pyrax | pyrax/base_identity.py | Service.get_client | def get_client(self, region):
"""
Returns an instance of the appropriate client class for the given
region. If there is no endpoint for that region, a NoEndpointForRegion
exception is raised.
"""
ep = self._ep_for_region(region)
if not ep:
raise exc.No... | python | def get_client(self, region):
"""
Returns an instance of the appropriate client class for the given
region. If there is no endpoint for that region, a NoEndpointForRegion
exception is raised.
"""
ep = self._ep_for_region(region)
if not ep:
raise exc.No... | Returns an instance of the appropriate client class for the given
region. If there is no endpoint for that region, a NoEndpointForRegion
exception is raised. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/base_identity.py#L116-L127 |
pycontribs/pyrax | pyrax/base_identity.py | Endpoint.get_new_client | def get_new_client(self, public=True):
"""
Returns a new instance of the client for this endpoint.
"""
return self._get_client(public=public, cached=False) | python | def get_new_client(self, public=True):
"""
Returns a new instance of the client for this endpoint.
"""
return self._get_client(public=public, cached=False) | Returns a new instance of the client for this endpoint. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/base_identity.py#L170-L174 |
pycontribs/pyrax | pyrax/base_identity.py | Endpoint.get | def get(self, url_type):
"""
Accepts either 'public' or 'private' as a parameter, and returns the
corresponding value for 'public_url' or 'private_url', respectively.
"""
lowtype = url_type.lower()
if lowtype == "public":
return self.public_url
elif lo... | python | def get(self, url_type):
"""
Accepts either 'public' or 'private' as a parameter, and returns the
corresponding value for 'public_url' or 'private_url', respectively.
"""
lowtype = url_type.lower()
if lowtype == "public":
return self.public_url
elif lo... | Accepts either 'public' or 'private' as a parameter, and returns the
corresponding value for 'public_url' or 'private_url', respectively. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/base_identity.py#L212-L224 |
pycontribs/pyrax | pyrax/base_identity.py | Endpoint._create_client | def _create_client(self, clt_class, url, public=True, special=False):
"""
Creates a client instance for the service.
"""
if self.service == "compute" and not special:
# Novaclient requires different parameters.
client = pyrax.connect_to_cloudservers(region=self.re... | python | def _create_client(self, clt_class, url, public=True, special=False):
"""
Creates a client instance for the service.
"""
if self.service == "compute" and not special:
# Novaclient requires different parameters.
client = pyrax.connect_to_cloudservers(region=self.re... | Creates a client instance for the service. | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/base_identity.py#L247-L259 |
pycontribs/pyrax | pyrax/base_identity.py | BaseIdentity.get_client | def get_client(self, service, region, public=True, cached=True,
client_class=None):
"""
Returns the client object for the specified service and region.
By default the public endpoint is used. If you wish to work with a
services internal endpoints, specify `public=False`.
... | python | def get_client(self, service, region, public=True, cached=True,
client_class=None):
"""
Returns the client object for the specified service and region.
By default the public endpoint is used. If you wish to work with a
services internal endpoints, specify `public=False`.
... | Returns the client object for the specified service and region.
By default the public endpoint is used. If you wish to work with a
services internal endpoints, specify `public=False`.
By default, if a client has already been created for the given service,
region, and public values, tha... | https://github.com/pycontribs/pyrax/blob/9ddfd5064b3a292d7337906f3b2d5dce95b50b99/pyrax/base_identity.py#L382-L408 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.