code
stringlengths
66
870k
docstring
stringlengths
19
26.7k
func_name
stringlengths
1
138
language
stringclasses
1 value
repo
stringlengths
7
68
path
stringlengths
5
324
url
stringlengths
46
389
license
stringclasses
7 values
def get_api_key_with_prefix(self, identifier, alias=None): """Gets API key (with prefix if set). :param identifier: The identifier of apiKey. :param alias: The alternative identifier of apiKey. :return: The token for api key authentication. """ if self.refresh_api_key_ho...
Gets API key (with prefix if set). :param identifier: The identifier of apiKey. :param alias: The alternative identifier of apiKey. :return: The token for api key authentication.
get_api_key_with_prefix
python
Yelp/paasta
paasta_tools/paastaapi/configuration.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/configuration.py
Apache-2.0
def get_basic_auth_token(self): """Gets HTTP basic authentication header (string). :return: The token for basic HTTP authentication. """ username = "" if self.username is not None: username = self.username password = "" if self.password is not None: ...
Gets HTTP basic authentication header (string). :return: The token for basic HTTP authentication.
get_basic_auth_token
python
Yelp/paasta
paasta_tools/paastaapi/configuration.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/configuration.py
Apache-2.0
def to_debug_report(self): """Gets the essential information for debugging. :return: The report for debugging. """ return "Python SDK Debug Report:\n"\ "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: 1.2.0\n"\ ...
Gets the essential information for debugging. :return: The report for debugging.
to_debug_report
python
Yelp/paasta
paasta_tools/paastaapi/configuration.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/configuration.py
Apache-2.0
def get_host_settings(self): """Gets an array of host settings :return: An array of host settings """ return [ { 'url': "{scheme}://{host}/{basePath}", 'description': "No description provided", 'variables': { ...
Gets an array of host settings :return: An array of host settings
get_host_settings
python
Yelp/paasta
paasta_tools/paastaapi/configuration.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/configuration.py
Apache-2.0
def get_host_from_settings(self, index, variables=None, servers=None): """Gets host URL based on the index and variables :param index: array index of the host settings :param variables: hash of variable and the corresponding value :param servers: an array of host settings or None ...
Gets host URL based on the index and variables :param index: array index of the host settings :param variables: hash of variable and the corresponding value :param servers: an array of host settings or None :return: URL based on host settings
get_host_from_settings
python
Yelp/paasta
paasta_tools/paastaapi/configuration.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/configuration.py
Apache-2.0
def __init__(self, msg, path_to_item=None): """ Args: msg (str): the exception message Keyword Args: path_to_item (list) the path to the exception in the received_data dict. None if unset """ self.path_to_item = path_to_item full_...
Args: msg (str): the exception message Keyword Args: path_to_item (list) the path to the exception in the received_data dict. None if unset
__init__
python
Yelp/paasta
paasta_tools/paastaapi/exceptions.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/exceptions.py
Apache-2.0
def __init__(self, msg, path_to_item=None): """ Raised when an attribute reference or assignment fails. Args: msg (str): the exception message Keyword Args: path_to_item (None/list) the path to the exception in the received_data dict """ ...
Raised when an attribute reference or assignment fails. Args: msg (str): the exception message Keyword Args: path_to_item (None/list) the path to the exception in the received_data dict
__init__
python
Yelp/paasta
paasta_tools/paastaapi/exceptions.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/exceptions.py
Apache-2.0
def __init__(self, msg, path_to_item=None): """ Args: msg (str): the exception message Keyword Args: path_to_item (None/list) the path to the exception in the received_data dict """ self.path_to_item = path_to_item full_msg = msg ...
Args: msg (str): the exception message Keyword Args: path_to_item (None/list) the path to the exception in the received_data dict
__init__
python
Yelp/paasta
paasta_tools/paastaapi/exceptions.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/exceptions.py
Apache-2.0
def allows_single_value_input(cls): """ This function returns True if the input composed schema model or any descendant model allows a value only input This is true for cases where oneOf contains items like: oneOf: - float - NumberWithValidation - StringEnum - ArrayModel ...
This function returns True if the input composed schema model or any descendant model allows a value only input This is true for cases where oneOf contains items like: oneOf: - float - NumberWithValidation - StringEnum - ArrayModel - null TODO: lru_cache this
allows_single_value_input
python
Yelp/paasta
paasta_tools/paastaapi/model_utils.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model_utils.py
Apache-2.0
def composed_model_input_classes(cls): """ This function returns a list of the possible models that can be accepted as inputs. TODO: lru_cache this """ if issubclass(cls, ModelSimple) or cls in PRIMITIVE_TYPES: return [cls] elif issubclass(cls, ModelNormal): if cls.discrimina...
This function returns a list of the possible models that can be accepted as inputs. TODO: lru_cache this
composed_model_input_classes
python
Yelp/paasta
paasta_tools/paastaapi/model_utils.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model_utils.py
Apache-2.0
def __setitem__(self, name, value): """set the value of an attribute using square-bracket notation: `instance[attr] = val`""" if name in self.required_properties: self.__dict__[name] = value return self.set_attribute(name, value)
set the value of an attribute using square-bracket notation: `instance[attr] = val`
__setitem__
python
Yelp/paasta
paasta_tools/paastaapi/model_utils.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model_utils.py
Apache-2.0
def get(self, name, default=None): """returns the value of an attribute or some default value if the attribute was not set""" if name in self.required_properties: return self.__dict__[name] return self.__dict__['_data_store'].get(name, default)
returns the value of an attribute or some default value if the attribute was not set
get
python
Yelp/paasta
paasta_tools/paastaapi/model_utils.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model_utils.py
Apache-2.0
def __getitem__(self, name): """get the value of an attribute using square-bracket notation: `instance[attr]`""" if name in self: return self.get(name) raise ApiAttributeError( "{0} has no attribute '{1}'".format( type(self).__name__, name), [...
get the value of an attribute using square-bracket notation: `instance[attr]`
__getitem__
python
Yelp/paasta
paasta_tools/paastaapi/model_utils.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model_utils.py
Apache-2.0
def __contains__(self, name): """used by `in` operator to check if an attrbute value was set in an instance: `'attr' in instance`""" if name in self.required_properties: return name in self.__dict__ return name in self.__dict__['_data_store']
used by `in` operator to check if an attrbute value was set in an instance: `'attr' in instance`
__contains__
python
Yelp/paasta
paasta_tools/paastaapi/model_utils.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model_utils.py
Apache-2.0
def __eq__(self, other): """Returns true if both objects are equal""" if not isinstance(other, self.__class__): return False this_val = self._data_store['value'] that_val = other._data_store['value'] types = set() types.add(this_val.__class__) types.a...
Returns true if both objects are equal
__eq__
python
Yelp/paasta
paasta_tools/paastaapi/model_utils.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model_utils.py
Apache-2.0
def get_simple_class(input_value): """Returns an input_value's simple class that we will use for type checking Python2: float and int will return int, where int is the python3 int backport str and unicode will return str, where str is the python3 str backport Note: float and int ARE both instances o...
Returns an input_value's simple class that we will use for type checking Python2: float and int will return int, where int is the python3 int backport str and unicode will return str, where str is the python3 str backport Note: float and int ARE both instances of int backport Note: str_py2 and unico...
get_simple_class
python
Yelp/paasta
paasta_tools/paastaapi/model_utils.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model_utils.py
Apache-2.0
def check_allowed_values(allowed_values, input_variable_path, input_values): """Raises an exception if the input_values are not allowed Args: allowed_values (dict): the allowed_values dict input_variable_path (tuple): the path to the input variable input_values (list/str/int/float/date/...
Raises an exception if the input_values are not allowed Args: allowed_values (dict): the allowed_values dict input_variable_path (tuple): the path to the input variable input_values (list/str/int/float/date/datetime): the values that we are checking to see if they are in allowed...
check_allowed_values
python
Yelp/paasta
paasta_tools/paastaapi/model_utils.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model_utils.py
Apache-2.0
def is_json_validation_enabled(schema_keyword, configuration=None): """Returns true if JSON schema validation is enabled for the specified validation keyword. This can be used to skip JSON schema structural validation as requested in the configuration. Args: schema_keyword (string): the name of...
Returns true if JSON schema validation is enabled for the specified validation keyword. This can be used to skip JSON schema structural validation as requested in the configuration. Args: schema_keyword (string): the name of a JSON schema validation keyword. configuration (Configuration): t...
is_json_validation_enabled
python
Yelp/paasta
paasta_tools/paastaapi/model_utils.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model_utils.py
Apache-2.0
def check_validations( validations, input_variable_path, input_values, configuration=None): """Raises an exception if the input_values are invalid Args: validations (dict): the validation dictionary. input_variable_path (tuple): the path to the input variable. input_valu...
Raises an exception if the input_values are invalid Args: validations (dict): the validation dictionary. input_variable_path (tuple): the path to the input variable. input_values (list/str/int/float/date/datetime): the values that we are checking. configuration (Configur...
check_validations
python
Yelp/paasta
paasta_tools/paastaapi/model_utils.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model_utils.py
Apache-2.0
def order_response_types(required_types): """Returns the required types sorted in coercion order Args: required_types (list/tuple): collection of classes or instance of list or dict with class information inside it. Returns: (list): coercion order sorted collection of classes o...
Returns the required types sorted in coercion order Args: required_types (list/tuple): collection of classes or instance of list or dict with class information inside it. Returns: (list): coercion order sorted collection of classes or instance of list or dict with class...
order_response_types
python
Yelp/paasta
paasta_tools/paastaapi/model_utils.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model_utils.py
Apache-2.0
def get_discriminated_classes(cls): """ Returns all the classes that a discriminator converts to TODO: lru_cache this """ possible_classes = [] key = list(cls.discriminator.keys())[0] if is_type_nullable(cls): possible_classes.append(cls) for discr_cls in cls.discriminator[key].v...
Returns all the classes that a discriminator converts to TODO: lru_cache this
get_discriminated_classes
python
Yelp/paasta
paasta_tools/paastaapi/model_utils.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model_utils.py
Apache-2.0
def get_required_type_classes(required_types_mixed, spec_property_naming): """Converts the tuple required_types into a tuple and a dict described below Args: required_types_mixed (tuple/list): will contain either classes or instance of list or dict spec_property_naming (bool): i...
Converts the tuple required_types into a tuple and a dict described below Args: required_types_mixed (tuple/list): will contain either classes or instance of list or dict spec_property_naming (bool): if True these values came from the server, and we use the data types in...
get_required_type_classes
python
Yelp/paasta
paasta_tools/paastaapi/model_utils.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model_utils.py
Apache-2.0
def change_keys_js_to_python(input_dict, model_class): """ Converts from javascript_key keys in the input_dict to python_keys in the output dict using the mapping in model_class. If the input_dict contains a key which does not declared in the model_class, the key is added to the output dict as is. T...
Converts from javascript_key keys in the input_dict to python_keys in the output dict using the mapping in model_class. If the input_dict contains a key which does not declared in the model_class, the key is added to the output dict as is. The assumption is the model_class may have undeclared prope...
change_keys_js_to_python
python
Yelp/paasta
paasta_tools/paastaapi/model_utils.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model_utils.py
Apache-2.0
def get_discriminator_class(model_class, discr_name, discr_value, cls_visited): """Returns the child class specified by the discriminator. Args: model_class (OpenApiModel): the model class. discr_name (string): the name of the discriminato...
Returns the child class specified by the discriminator. Args: model_class (OpenApiModel): the model class. discr_name (string): the name of the discriminator property. discr_value (any): the discriminator value. cls_visited (list): list of model classes that have been visited. ...
get_discriminator_class
python
Yelp/paasta
paasta_tools/paastaapi/model_utils.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model_utils.py
Apache-2.0
def deserialize_model(model_data, model_class, path_to_item, check_type, configuration, spec_property_naming): """Deserializes model_data to model instance. Args: model_data (int/str/float/bool/none_type/list/dict): data to instantiate the model model_class (OpenApiModel):...
Deserializes model_data to model instance. Args: model_data (int/str/float/bool/none_type/list/dict): data to instantiate the model model_class (OpenApiModel): the model class path_to_item (list): path to the model in the received data check_type (bool): whether to check the data tu...
deserialize_model
python
Yelp/paasta
paasta_tools/paastaapi/model_utils.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model_utils.py
Apache-2.0
def deserialize_file(response_data, configuration, content_disposition=None): """Deserializes body to file Saves response body into a file in a temporary folder, using the filename from the `Content-Disposition` header if provided. Args: param response_data (str): the file data to write ...
Deserializes body to file Saves response body into a file in a temporary folder, using the filename from the `Content-Disposition` header if provided. Args: param response_data (str): the file data to write configuration (Configuration): the instance to use to convert files Keyword A...
deserialize_file
python
Yelp/paasta
paasta_tools/paastaapi/model_utils.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model_utils.py
Apache-2.0
def attempt_convert_item(input_value, valid_classes, path_to_item, configuration, spec_property_naming, key_type=False, must_convert=False, check_type=True): """ Args: input_value (any): the data to convert valid_classes (any): the classes that a...
Args: input_value (any): the data to convert valid_classes (any): the classes that are valid path_to_item (list): the path to the item to convert configuration (Configuration): the instance to use to convert files spec_property_naming (bool): True if the variable names in th...
attempt_convert_item
python
Yelp/paasta
paasta_tools/paastaapi/model_utils.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model_utils.py
Apache-2.0
def is_type_nullable(input_type): """ Returns true if None is an allowed value for the specified input_type. A type is nullable if at least one of the following conditions is true: 1. The OAS 'nullable' attribute has been specified, 1. The type is the 'null' type, 1. The type is a anyOf/oneOf c...
Returns true if None is an allowed value for the specified input_type. A type is nullable if at least one of the following conditions is true: 1. The OAS 'nullable' attribute has been specified, 1. The type is the 'null' type, 1. The type is a anyOf/oneOf composed schema, and a child schema is ...
is_type_nullable
python
Yelp/paasta
paasta_tools/paastaapi/model_utils.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model_utils.py
Apache-2.0
def is_valid_type(input_class_simple, valid_classes): """ Args: input_class_simple (class): the class of the input_value that we are checking valid_classes (tuple): the valid classes that the current item should be Returns: bool """ valid_type = input_...
Args: input_class_simple (class): the class of the input_value that we are checking valid_classes (tuple): the valid classes that the current item should be Returns: bool
is_valid_type
python
Yelp/paasta
paasta_tools/paastaapi/model_utils.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model_utils.py
Apache-2.0
def validate_and_convert_types(input_value, required_types_mixed, path_to_item, spec_property_naming, _check_type, configuration=None): """Raises a TypeError is there is a problem, otherwise returns value Args: input_value (any): the data to validate/convert requi...
Raises a TypeError is there is a problem, otherwise returns value Args: input_value (any): the data to validate/convert required_types_mixed (list/dict/tuple): A list of valid classes, or a list tuples of valid classes, or a dict where the value is a tuple of value classes ...
validate_and_convert_types
python
Yelp/paasta
paasta_tools/paastaapi/model_utils.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model_utils.py
Apache-2.0
def model_to_dict(model_instance, serialize=True): """Returns the model properties as a dict Args: model_instance (one of your model instances): the model instance that will be converted to a dict. Keyword Args: serialize (bool): if True, the keys in the dict will be values fro...
Returns the model properties as a dict Args: model_instance (one of your model instances): the model instance that will be converted to a dict. Keyword Args: serialize (bool): if True, the keys in the dict will be values from attribute_map
model_to_dict
python
Yelp/paasta
paasta_tools/paastaapi/model_utils.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model_utils.py
Apache-2.0
def type_error_message(var_value=None, var_name=None, valid_classes=None, key_type=None): """ Keyword Args: var_value (any): the variable which has the type_error var_name (str): the name of the variable which has the typ error valid_classes (tuple): the accepted c...
Keyword Args: var_value (any): the variable which has the type_error var_name (str): the name of the variable which has the typ error valid_classes (tuple): the accepted classes for current_item's value key_type (bool): False if our value is a value...
type_error_message
python
Yelp/paasta
paasta_tools/paastaapi/model_utils.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model_utils.py
Apache-2.0
def get_valid_classes_phrase(input_classes): """Returns a string phrase describing what types are allowed """ all_classes = list(input_classes) all_classes = sorted(all_classes, key=lambda cls: cls.__name__) all_class_names = [cls.__name__ for cls in all_classes] if len(all_class_names) == 1: ...
Returns a string phrase describing what types are allowed
get_valid_classes_phrase
python
Yelp/paasta
paasta_tools/paastaapi/model_utils.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model_utils.py
Apache-2.0
def get_allof_instances(self, model_args, constant_args): """ Args: self: the class we are handling model_args (dict): var_name to var_value used to make instances constant_args (dict): var_name to var_value used to make instances Returns composed_ins...
Args: self: the class we are handling model_args (dict): var_name to var_value used to make instances constant_args (dict): var_name to var_value used to make instances Returns composed_instances (list)
get_allof_instances
python
Yelp/paasta
paasta_tools/paastaapi/model_utils.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model_utils.py
Apache-2.0
def get_anyof_instances(self, model_args, constant_args): """ Args: self: the class we are handling model_args (dict): var_name to var_value The input data, e.g. the payload that must match at least one anyOf child schema in the OpenAPI document. constant_args (di...
Args: self: the class we are handling model_args (dict): var_name to var_value The input data, e.g. the payload that must match at least one anyOf child schema in the OpenAPI document. constant_args (dict): var_name to var_value args that every model requ...
get_anyof_instances
python
Yelp/paasta
paasta_tools/paastaapi/model_utils.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model_utils.py
Apache-2.0
def validate_get_composed_info(constant_args, model_args, self): """ For composed schemas, generate schema instances for all schemas in the oneOf/anyOf/allOf definition. If additional properties are allowed, also assign those properties on all matched schemas that contain additionalProperties. O...
For composed schemas, generate schema instances for all schemas in the oneOf/anyOf/allOf definition. If additional properties are allowed, also assign those properties on all matched schemas that contain additionalProperties. Openapi schemas are python classes. Exceptions are raised if: - ...
validate_get_composed_info
python
Yelp/paasta
paasta_tools/paastaapi/model_utils.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model_utils.py
Apache-2.0
def request(self, method, url, query_params=None, headers=None, body=None, post_params=None, _preload_content=True, _request_timeout=None): """Perform requests. :param method: http request method :param url: http request url :param query_params: query par...
Perform requests. :param method: http request method :param url: http request url :param query_params: query parameters in the url :param headers: http request headers :param body: request json body, for `application/json` :param post_params: request post parameters, ...
request
python
Yelp/paasta
paasta_tools/paastaapi/rest.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/rest.py
Apache-2.0
def __get_autoscaler_count( self, service, instance, **kwargs ): """Get status of service_name.instance_name # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pa...
Get status of service_name.instance_name # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_autoscaler_count(service, instance, async_req=True) >>> result = thread....
__get_autoscaler_count
python
Yelp/paasta
paasta_tools/paastaapi/api/autoscaler_api.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/api/autoscaler_api.py
Apache-2.0
def __set_autoscaling_override( self, service, instance, autoscaling_override, **kwargs ): """Set a temporary autoscaling override for a service instance # noqa: E501 This method makes a synchronous HTTP request by default. To...
Set a temporary autoscaling override for a service instance # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.set_autoscaling_override(service, instance, autoscaling_override, asy...
__set_autoscaling_override
python
Yelp/paasta
paasta_tools/paastaapi/api/autoscaler_api.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/api/autoscaler_api.py
Apache-2.0
def __update_autoscaler_count( self, service, instance, autoscaler_count_msg, **kwargs ): """Set desired instance count for a service instance # noqa: E501 This method makes a synchronous HTTP request by default. To make an ...
Set desired instance count for a service instance # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.update_autoscaler_count(service, instance, autoscaler_count_msg, async_req=True...
__update_autoscaler_count
python
Yelp/paasta
paasta_tools/paastaapi/api/autoscaler_api.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/api/autoscaler_api.py
Apache-2.0
def __delete_service_autoscaler_pause( self, **kwargs ): """Unpause the autoscaler # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.de...
Unpause the autoscaler # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.delete_service_autoscaler_pause(async_req=True) >>> result = thread.get() Keywor...
__delete_service_autoscaler_pause
python
Yelp/paasta
paasta_tools/paastaapi/api/default_api.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/api/default_api.py
Apache-2.0
def __deploy_queue( self, **kwargs ): """Get deploy queue contents # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.deploy_queue(async...
Get deploy queue contents # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.deploy_queue(async_req=True) >>> result = thread.get() Keyword Args: ...
__deploy_queue
python
Yelp/paasta
paasta_tools/paastaapi/api/default_api.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/api/default_api.py
Apache-2.0
def __get_service_autoscaler_pause( self, **kwargs ): """Get autoscaling pause time # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.g...
Get autoscaling pause time # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_service_autoscaler_pause(async_req=True) >>> result = thread.get() Keywo...
__get_service_autoscaler_pause
python
Yelp/paasta
paasta_tools/paastaapi/api/default_api.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/api/default_api.py
Apache-2.0
def __show_version( self, **kwargs ): """Version of paasta_tools package # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.show_version...
Version of paasta_tools package # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.show_version(async_req=True) >>> result = thread.get() Keyword Args: ...
__show_version
python
Yelp/paasta
paasta_tools/paastaapi/api/default_api.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/api/default_api.py
Apache-2.0
def __update_service_autoscaler_pause( self, inline_object, **kwargs ): """update_service_autoscaler_pause # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=T...
update_service_autoscaler_pause # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.update_service_autoscaler_pause(inline_object, async_req=True) >>> result = thread.ge...
__update_service_autoscaler_pause
python
Yelp/paasta
paasta_tools/paastaapi/api/default_api.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/api/default_api.py
Apache-2.0
def __remote_run_poll( self, service, instance, job_name, user, **kwargs ): """Check if remote run pod is ready # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchron...
Check if remote run pod is ready # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.remote_run_poll(service, instance, job_name, user, async_req=True) >>> result = thre...
__remote_run_poll
python
Yelp/paasta
paasta_tools/paastaapi/api/remote_run_api.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/api/remote_run_api.py
Apache-2.0
def __remote_run_start( self, service, instance, remote_run_start, **kwargs ): """Launch a remote-run pod # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, ...
Launch a remote-run pod # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.remote_run_start(service, instance, remote_run_start, async_req=True) >>> result = thread.get...
__remote_run_start
python
Yelp/paasta
paasta_tools/paastaapi/api/remote_run_api.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/api/remote_run_api.py
Apache-2.0
def __remote_run_stop( self, service, instance, remote_run_stop, **kwargs ): """Stop a remote-run pod # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, plea...
Stop a remote-run pod # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.remote_run_stop(service, instance, remote_run_stop, async_req=True) >>> result = thread.get() ...
__remote_run_stop
python
Yelp/paasta
paasta_tools/paastaapi/api/remote_run_api.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/api/remote_run_api.py
Apache-2.0
def __remote_run_token( self, service, instance, user, **kwargs ): """Get a short lived token for exec into remote-run pod # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchrono...
Get a short lived token for exec into remote-run pod # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.remote_run_token(service, instance, user, async_req=True) >>> re...
__remote_run_token
python
Yelp/paasta
paasta_tools/paastaapi/api/remote_run_api.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/api/remote_run_api.py
Apache-2.0
def __resources( self, **kwargs ): """Get resources in the cluster # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.resources(async_re...
Get resources in the cluster # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.resources(async_req=True) >>> result = thread.get() Keyword Args: ...
__resources
python
Yelp/paasta
paasta_tools/paastaapi/api/resources_api.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/api/resources_api.py
Apache-2.0
def __bounce_status_instance( self, service, instance, **kwargs ): """Get bounce status of service_name.instance_name # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, ...
Get bounce status of service_name.instance_name # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.bounce_status_instance(service, instance, async_req=True) >>> result ...
__bounce_status_instance
python
Yelp/paasta
paasta_tools/paastaapi/api/service_api.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/api/service_api.py
Apache-2.0
def __delay_instance( self, service, instance, **kwargs ): """Get the possible reasons for a deployment delay for a marathon service.instance # noqa: E501 This method makes a synchronous HTTP request by default. To make an asy...
Get the possible reasons for a deployment delay for a marathon service.instance # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.delay_instance(service, instance, async_req=True)...
__delay_instance
python
Yelp/paasta
paasta_tools/paastaapi/api/service_api.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/api/service_api.py
Apache-2.0
def __get_flink_cluster_config( self, service, instance, **kwargs ): """Get config of a flink cluster # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass asyn...
Get config of a flink cluster # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_flink_cluster_config(service, instance, async_req=True) >>> result = thread.get() ...
__get_flink_cluster_config
python
Yelp/paasta
paasta_tools/paastaapi/api/service_api.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/api/service_api.py
Apache-2.0
def __get_flink_cluster_job_details( self, service, instance, job_id, **kwargs ): """Get details of a flink job in a flink cluster # noqa: E501 This method makes a synchronous HTTP request by default. To make an as...
Get details of a flink job in a flink cluster # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_flink_cluster_job_details(service, instance, job_id, async_req=True) ...
__get_flink_cluster_job_details
python
Yelp/paasta
paasta_tools/paastaapi/api/service_api.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/api/service_api.py
Apache-2.0
def __get_flink_cluster_overview( self, service, instance, **kwargs ): """Get overview of a flink cluster # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass ...
Get overview of a flink cluster # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_flink_cluster_overview(service, instance, async_req=True) >>> result = thread.get...
__get_flink_cluster_overview
python
Yelp/paasta
paasta_tools/paastaapi/api/service_api.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/api/service_api.py
Apache-2.0
def __instance_set_state( self, service, instance, desired_state, **kwargs ): """Change state of service_name.instance_name # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchron...
Change state of service_name.instance_name # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.instance_set_state(service, instance, desired_state, async_req=True) >>> r...
__instance_set_state
python
Yelp/paasta
paasta_tools/paastaapi/api/service_api.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/api/service_api.py
Apache-2.0
def __list_flink_cluster_jobs( self, service, instance, **kwargs ): """Get list of flink jobs in a flink cluster # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, pleas...
Get list of flink jobs in a flink cluster # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_flink_cluster_jobs(service, instance, async_req=True) >>> result = thr...
__list_flink_cluster_jobs
python
Yelp/paasta
paasta_tools/paastaapi/api/service_api.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/api/service_api.py
Apache-2.0
def __list_instances( self, service, **kwargs ): """List instances of service_name # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thr...
List instances of service_name # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_instances(service, async_req=True) >>> result = thread.get() Args: ...
__list_instances
python
Yelp/paasta
paasta_tools/paastaapi/api/service_api.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/api/service_api.py
Apache-2.0
def __list_services_for_cluster( self, **kwargs ): """List service names and service instance names on the current cluster # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_r...
List service names and service instance names on the current cluster # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_services_for_cluster(async_req=True) >>> re...
__list_services_for_cluster
python
Yelp/paasta
paasta_tools/paastaapi/api/service_api.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/api/service_api.py
Apache-2.0
def __status_instance( self, service, instance, **kwargs ): """Get status of service_name.instance_name # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass as...
Get status of service_name.instance_name # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.status_instance(service, instance, async_req=True) >>> result = thread.get()...
__status_instance
python
Yelp/paasta
paasta_tools/paastaapi/api/service_api.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/api/service_api.py
Apache-2.0
def __task_instance( self, service, instance, task_id, **kwargs ): """Get mesos task of service_name.instance_name by task_id # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchr...
Get mesos task of service_name.instance_name by task_id # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.task_instance(service, instance, task_id, async_req=True) >>>...
__task_instance
python
Yelp/paasta
paasta_tools/paastaapi/api/service_api.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/api/service_api.py
Apache-2.0
def __tasks_instance( self, service, instance, **kwargs ): """Get mesos tasks of service_name.instance_name # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pas...
Get mesos tasks of service_name.instance_name # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.tasks_instance(service, instance, async_req=True) >>> result = thread.g...
__tasks_instance
python
Yelp/paasta
paasta_tools/paastaapi/api/service_api.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/api/service_api.py
Apache-2.0
def openapi_types(): """ This must be a method because a model may have properties that are of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ retu...
This must be a method because a model may have properties that are of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type.
openapi_types
python
Yelp/paasta
paasta_tools/paastaapi/model/adhoc_launch_history.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model/adhoc_launch_history.py
Apache-2.0
def get_key_versions( self, key_name: str, ) -> List[CryptoKey]: """ Retrieve all versions of Vault key based on its metadata """ client = self.clients[self.ecosystems[0]] crypto_keys: List[CryptoKey] = [] try: meta_response = client.secret...
Retrieve all versions of Vault key based on its metadata
get_key_versions
python
Yelp/paasta
paasta_tools/secret_providers/vault.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/secret_providers/vault.py
Apache-2.0
def update_namespace(self, namespace, new_config, skip_if_unchanged=True): """Updates the configuration for a namespace. :param namespace: str :param new_config: str, should be valid YAML. :param skip_if_unchanged: boolean. If False, will send the update even if the current ...
Updates the configuration for a namespace. :param namespace: str :param new_config: str, should be valid YAML. :param skip_if_unchanged: boolean. If False, will send the update even if the current config matches the new config.
update_namespace
python
Yelp/paasta
paasta_tools/tron/client.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/tron/client.py
Apache-2.0
def list_namespaces(self): """Gets the namespaces that are currently configured.""" response = self._get("/api") return response.get("namespaces", [])
Gets the namespaces that are currently configured.
list_namespaces
python
Yelp/paasta
paasta_tools/tron/client.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/tron/client.py
Apache-2.0
def build_filled_context(*context_objects): """Create a CommandContext chain from context_objects, using a Filler object to pass to each CommandContext. Can be used to validate a format string. """ if not context_objects: return CommandContext() filler = Filler() def build(current,...
Create a CommandContext chain from context_objects, using a Filler object to pass to each CommandContext. Can be used to validate a format string.
build_filled_context
python
Yelp/paasta
paasta_tools/tron/tron_command_context.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/tron/tron_command_context.py
Apache-2.0
def __init__(self, base=None, next=None): """ base - Object to look for attributes in next - Next place to look for more pieces of context Generally this will be another instance of CommandContext """ self.base = base or {} self.next = next or {}
base - Object to look for attributes in next - Next place to look for more pieces of context Generally this will be another instance of CommandContext
__init__
python
Yelp/paasta
paasta_tools/tron/tron_command_context.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/tron/tron_command_context.py
Apache-2.0
def cleanup_job_status(self): """Provide 'SUCCESS' or 'FAILURE' to a cleanup action context based on the status of the other steps """ if self.job_run.action_runs.is_failed: return "FAILURE" elif self.job_run.action_runs.is_complete_without_cleanup: return...
Provide 'SUCCESS' or 'FAILURE' to a cleanup action context based on the status of the other steps
cleanup_job_status
python
Yelp/paasta
paasta_tools/tron/tron_command_context.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/tron/tron_command_context.py
Apache-2.0
def __getitem__(self, name): """Attempt to parse date arithmetic syntax and apply to run_time.""" run_time = self.job_run.run_time time_value = tron_timeutils.DateArithmetic.parse(name, run_time) if time_value: return time_value raise KeyError(name)
Attempt to parse date arithmetic syntax and apply to run_time.
__getitem__
python
Yelp/paasta
paasta_tools/tron/tron_command_context.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/tron/tron_command_context.py
Apache-2.0
def delta_total_seconds(td): """Equivalent to timedelta.total_seconds() available in Python 2.7.""" microseconds, seconds, days = td.microseconds, td.seconds, td.days return (microseconds + (seconds + days * 24 * 3600) * 10**6) / 10**6
Equivalent to timedelta.total_seconds() available in Python 2.7.
delta_total_seconds
python
Yelp/paasta
paasta_tools/tron/tron_timeutils.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/tron/tron_timeutils.py
Apache-2.0
def macro_timedelta(start_date, years=0, months=0, days=0, hours=0): """Since datetime doesn't provide timedeltas at the year or month level, this function generates timedeltas of the appropriate sizes. """ delta = datetime.timedelta(days=days, hours=hours) new_month = start_date.month + months ...
Since datetime doesn't provide timedeltas at the year or month level, this function generates timedeltas of the appropriate sizes.
macro_timedelta
python
Yelp/paasta
paasta_tools/tron/tron_timeutils.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/tron/tron_timeutils.py
Apache-2.0
def duration(start_time, end_time=None): """Get a timedelta between end_time and start_time, where end_time defaults to now(). """ if not start_time: return None last_time = end_time if end_time else current_time() return last_time - start_time
Get a timedelta between end_time and start_time, where end_time defaults to now().
duration
python
Yelp/paasta
paasta_tools/tron/tron_timeutils.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/tron/tron_timeutils.py
Apache-2.0
def parse(cls, date_str, dt=None): """Parse a date arithmetic pattern (Ex: 'shortdate-1'). Supports date strings: shortdate, year, month, day, unixtime, daynumber. Supports subtraction and addition operations of integers. Time unit is based on date format (Ex: seconds for unixtime, days ...
Parse a date arithmetic pattern (Ex: 'shortdate-1'). Supports date strings: shortdate, year, month, day, unixtime, daynumber. Supports subtraction and addition operations of integers. Time unit is based on date format (Ex: seconds for unixtime, days for day).
parse
python
Yelp/paasta
paasta_tools/tron/tron_timeutils.py
https://github.com/Yelp/paasta/blob/master/paasta_tools/tron/tron_timeutils.py
Apache-2.0
async def test_async_ttl_cache_dont_overwrite_new_cache_entry(): """Make sure that we don't overwrite a new cache entry that was placed while we were waiting to handle the result of a previously cached future """ range_continue_event = asyncio.Event() update_cache_event = asyncio.Event() return_...
Make sure that we don't overwrite a new cache entry that was placed while we were waiting to handle the result of a previously cached future
test_async_ttl_cache_dont_overwrite_new_cache_entry
python
Yelp/paasta
tests/test_async_utils.py
https://github.com/Yelp/paasta/blob/master/tests/test_async_utils.py
Apache-2.0
async def test_async_ttl_cache_recover_if_cache_entry_removed(): """Ensure we handle the case where we encounter an exception in the cached future but another coroutine awaiting the same future ran first and alraedy deleted the cache entry""" range_continue_event = asyncio.Event() num_awaiters_await...
Ensure we handle the case where we encounter an exception in the cached future but another coroutine awaiting the same future ran first and alraedy deleted the cache entry
test_async_ttl_cache_recover_if_cache_entry_removed
python
Yelp/paasta
tests/test_async_utils.py
https://github.com/Yelp/paasta/blob/master/tests/test_async_utils.py
Apache-2.0
async def test_async_ttl_cache_for_class_members_doesnt_leak_mem(): """Ensure that we aren't leaking memory""" x = 42 instance_caches = defaultdict(dict) class TestClass: @async_ttl_cache(ttl=None, cleanup_self=True, cache=instance_caches) async def f(self): return x o...
Ensure that we aren't leaking memory
test_async_ttl_cache_for_class_members_doesnt_leak_mem
python
Yelp/paasta
tests/test_async_utils.py
https://github.com/Yelp/paasta/blob/master/tests/test_async_utils.py
Apache-2.0
def test_brutal_bounce_no_existing_apps(self): """When marathon is unaware of a service, brutal bounce should try to create a marathon app.""" new_config = {"id": "foo.bar.12345"} happy_tasks = [] assert bounce_lib.brutal_bounce( new_config=new_config, ne...
When marathon is unaware of a service, brutal bounce should try to create a marathon app.
test_brutal_bounce_no_existing_apps
python
Yelp/paasta
tests/test_bounce_lib.py
https://github.com/Yelp/paasta/blob/master/tests/test_bounce_lib.py
Apache-2.0
def test_brutal_bounce_done(self): """When marathon has the desired app, and there are no other copies of the service running, brutal bounce should neither start nor stop anything.""" new_config = {"id": "foo.bar.12345", "instances": 5} happy_tasks = [mock.Mock() for _ in range(...
When marathon has the desired app, and there are no other copies of the service running, brutal bounce should neither start nor stop anything.
test_brutal_bounce_done
python
Yelp/paasta
tests/test_bounce_lib.py
https://github.com/Yelp/paasta/blob/master/tests/test_bounce_lib.py
Apache-2.0
def test_brutal_bounce_mid_bounce(self): """When marathon has the desired app, but there are other copies of the service running, brutal bounce should stop the old ones.""" new_config = {"id": "foo.bar.12345", "instances": 5} happy_tasks = [mock.Mock() for _ in range(5)] old_app...
When marathon has the desired app, but there are other copies of the service running, brutal bounce should stop the old ones.
test_brutal_bounce_mid_bounce
python
Yelp/paasta
tests/test_bounce_lib.py
https://github.com/Yelp/paasta/blob/master/tests/test_bounce_lib.py
Apache-2.0
def test_brutal_bounce_old_but_no_new(self): """When marathon does not have the desired app, but there are other copies of the service running, brutal bounce should stop the old ones and start the new one.""" new_config = {"id": "foo.bar.12345", "instances": 5} old_app_live_happ...
When marathon does not have the desired app, but there are other copies of the service running, brutal bounce should stop the old ones and start the new one.
test_brutal_bounce_old_but_no_new
python
Yelp/paasta
tests/test_bounce_lib.py
https://github.com/Yelp/paasta/blob/master/tests/test_bounce_lib.py
Apache-2.0
def test_upthendown_bounce_no_existing_apps(self): """When marathon is unaware of a service, upthendown bounce should try to create a marathon app.""" new_config = {"id": "foo.bar.12345"} happy_tasks = [] assert bounce_lib.upthendown_bounce( new_config=new_config, ...
When marathon is unaware of a service, upthendown bounce should try to create a marathon app.
test_upthendown_bounce_no_existing_apps
python
Yelp/paasta
tests/test_bounce_lib.py
https://github.com/Yelp/paasta/blob/master/tests/test_bounce_lib.py
Apache-2.0
def test_upthendown_bounce_old_but_no_new(self): """When marathon has the desired app, but there are other copies of the service running, upthendown bounce should start the new one. but not stop the old one yet.""" new_config = {"id": "foo.bar.12345", "instances": 5} old_app_liv...
When marathon has the desired app, but there are other copies of the service running, upthendown bounce should start the new one. but not stop the old one yet.
test_upthendown_bounce_old_but_no_new
python
Yelp/paasta
tests/test_bounce_lib.py
https://github.com/Yelp/paasta/blob/master/tests/test_bounce_lib.py
Apache-2.0
def test_upthendown_bounce_mid_bounce(self): """When marathon has the desired app, and there are other copies of the service running, but the new app is not fully up, upthendown bounce should not stop the old ones.""" new_config = {"id": "foo.bar.12345", "instances": 5} happy_ta...
When marathon has the desired app, and there are other copies of the service running, but the new app is not fully up, upthendown bounce should not stop the old ones.
test_upthendown_bounce_mid_bounce
python
Yelp/paasta
tests/test_bounce_lib.py
https://github.com/Yelp/paasta/blob/master/tests/test_bounce_lib.py
Apache-2.0
def test_upthendown_bounce_cleanup(self): """When marathon has the desired app, and there are other copies of the service running, and the new app is fully up, upthendown bounce should stop the old ones.""" new_config = {"id": "foo.bar.12345", "instances": 5} happy_tasks = [mock...
When marathon has the desired app, and there are other copies of the service running, and the new app is fully up, upthendown bounce should stop the old ones.
test_upthendown_bounce_cleanup
python
Yelp/paasta
tests/test_bounce_lib.py
https://github.com/Yelp/paasta/blob/master/tests/test_bounce_lib.py
Apache-2.0
def test_upthendown_bounce_done(self): """When marathon has the desired app, and there are no other copies of the service running, upthendown bounce should neither start nor stop anything.""" new_config = {"id": "foo.bar.12345", "instances": 5} happy_tasks = [mock.Mock() for _ i...
When marathon has the desired app, and there are no other copies of the service running, upthendown bounce should neither start nor stop anything.
test_upthendown_bounce_done
python
Yelp/paasta
tests/test_bounce_lib.py
https://github.com/Yelp/paasta/blob/master/tests/test_bounce_lib.py
Apache-2.0
def test_crossover_bounce_no_existing_apps(self): """When marathon is unaware of a service, crossover bounce should try to create a marathon app.""" new_config = {"id": "foo.bar.12345", "instances": 5} happy_tasks = [] old_app_live_happy_tasks = [] old_app_live_unhappy_ta...
When marathon is unaware of a service, crossover bounce should try to create a marathon app.
test_crossover_bounce_no_existing_apps
python
Yelp/paasta
tests/test_bounce_lib.py
https://github.com/Yelp/paasta/blob/master/tests/test_bounce_lib.py
Apache-2.0
def test_crossover_bounce_old_but_no_new(self): """When marathon only has old apps for this service, crossover bounce should start the new one, but not kill any old tasks yet.""" new_config = {"id": "foo.bar.12345", "instances": 5} happy_tasks = [] old_app_live_happy_tasks = [mo...
When marathon only has old apps for this service, crossover bounce should start the new one, but not kill any old tasks yet.
test_crossover_bounce_old_but_no_new
python
Yelp/paasta
tests/test_bounce_lib.py
https://github.com/Yelp/paasta/blob/master/tests/test_bounce_lib.py
Apache-2.0
def test_crossover_bounce_old_app_is_happy_but_no_new_app_happy_tasks(self): """When marathon only has old apps for this service and margin_factor != 1, crossover bounce should start the new app and kill some old tasks.""" new_config = {"id": "foo.bar.12345", "instances": 100} happy_tas...
When marathon only has old apps for this service and margin_factor != 1, crossover bounce should start the new app and kill some old tasks.
test_crossover_bounce_old_app_is_happy_but_no_new_app_happy_tasks
python
Yelp/paasta
tests/test_bounce_lib.py
https://github.com/Yelp/paasta/blob/master/tests/test_bounce_lib.py
Apache-2.0
def test_crossover_bounce_some_unhappy_old_some_happy_old_no_new(self): """When marathon only has old apps for this service, and some of them are unhappy (maybe they've been recently started), the crossover bounce should start a new app and prefer killing the unhappy tasks over the happy ones. "...
When marathon only has old apps for this service, and some of them are unhappy (maybe they've been recently started), the crossover bounce should start a new app and prefer killing the unhappy tasks over the happy ones.
test_crossover_bounce_some_unhappy_old_some_happy_old_no_new
python
Yelp/paasta
tests/test_bounce_lib.py
https://github.com/Yelp/paasta/blob/master/tests/test_bounce_lib.py
Apache-2.0
def test_crossover_bounce_some_unhappy_old_no_happy_old_no_new_tasks_no_excess( self, ): """When marathon only has old apps for this service, and all of their tasks are unhappy, and there are no excess tasks, the crossover bounce should start a new app and not kill any old tasks. """...
When marathon only has old apps for this service, and all of their tasks are unhappy, and there are no excess tasks, the crossover bounce should start a new app and not kill any old tasks.
test_crossover_bounce_some_unhappy_old_no_happy_old_no_new_tasks_no_excess
python
Yelp/paasta
tests/test_bounce_lib.py
https://github.com/Yelp/paasta/blob/master/tests/test_bounce_lib.py
Apache-2.0
def test_crossover_bounce_lots_of_unhappy_old_no_happy_old_no_new(self): """When marathon has a new app and multiple old apps, no new tasks are up, all old tasks are unhappy, and there are too many tasks running, the crossover bounce should kill some (but not all) of the old tasks. This...
When marathon has a new app and multiple old apps, no new tasks are up, all old tasks are unhappy, and there are too many tasks running, the crossover bounce should kill some (but not all) of the old tasks. This represents a situation where
test_crossover_bounce_lots_of_unhappy_old_no_happy_old_no_new
python
Yelp/paasta
tests/test_bounce_lib.py
https://github.com/Yelp/paasta/blob/master/tests/test_bounce_lib.py
Apache-2.0
def test_crossover_bounce_lots_of_unhappy_old_some_happy_old_new_app_exists_no_new_tasks( self, ): """When marathon has a new app and multiple old apps, no new tasks are up, one of the old apps is healthy and the other is not, only unhealthy tasks should get killed. """ new_...
When marathon has a new app and multiple old apps, no new tasks are up, one of the old apps is healthy and the other is not, only unhealthy tasks should get killed.
test_crossover_bounce_lots_of_unhappy_old_some_happy_old_new_app_exists_no_new_tasks
python
Yelp/paasta
tests/test_bounce_lib.py
https://github.com/Yelp/paasta/blob/master/tests/test_bounce_lib.py
Apache-2.0
def test_crossover_bounce_mid_bounce(self): """When marathon has the desired app, and there are other copies of the service running, but the new app is not fully up, crossover bounce should only stop a few of the old instances.""" new_config = {"id": "foo.bar.12345", "instances": 5} hap...
When marathon has the desired app, and there are other copies of the service running, but the new app is not fully up, crossover bounce should only stop a few of the old instances.
test_crossover_bounce_mid_bounce
python
Yelp/paasta
tests/test_bounce_lib.py
https://github.com/Yelp/paasta/blob/master/tests/test_bounce_lib.py
Apache-2.0
def test_crossover_bounce_mid_bounce_some_happy_old_some_unhappy_old(self): """When marathon has the desired app, and there are other copies of the service running, and some of those older tasks are unhappy, we should prefer killing the unhappy tasks.""" new_config = {"id": "foo.bar.12345", "in...
When marathon has the desired app, and there are other copies of the service running, and some of those older tasks are unhappy, we should prefer killing the unhappy tasks.
test_crossover_bounce_mid_bounce_some_happy_old_some_unhappy_old
python
Yelp/paasta
tests/test_bounce_lib.py
https://github.com/Yelp/paasta/blob/master/tests/test_bounce_lib.py
Apache-2.0
def test_crossover_bounce_mid_bounce_some_happy_old_lots_of_unhappy_old(self): """When marathon has the desired app, and there are other copies of the service running, and there are more unhappy old tasks than excess tasks, we should only kill unhappy tasks. """ new_config = {"id": "foo...
When marathon has the desired app, and there are other copies of the service running, and there are more unhappy old tasks than excess tasks, we should only kill unhappy tasks.
test_crossover_bounce_mid_bounce_some_happy_old_lots_of_unhappy_old
python
Yelp/paasta
tests/test_bounce_lib.py
https://github.com/Yelp/paasta/blob/master/tests/test_bounce_lib.py
Apache-2.0
def test_crossover_bounce_mid_bounce_no_happy_old_lots_of_unhappy_old(self): """When marathon has the desired app, and there are other copies of the service running, but none of the old tasks are happy, and there are excess tasks, we should kill some (but not all) unhappy old tasks.""" new_confi...
When marathon has the desired app, and there are other copies of the service running, but none of the old tasks are happy, and there are excess tasks, we should kill some (but not all) unhappy old tasks.
test_crossover_bounce_mid_bounce_no_happy_old_lots_of_unhappy_old
python
Yelp/paasta
tests/test_bounce_lib.py
https://github.com/Yelp/paasta/blob/master/tests/test_bounce_lib.py
Apache-2.0
def test_crossover_bounce_done(self): """When marathon has the desired app, and there are no other copies of the service running, crossover bounce should neither start nor stop anything.""" new_config = {"id": "foo.bar.12345", "instances": 5} happy_tasks = [mock.Mock() for _ in ...
When marathon has the desired app, and there are no other copies of the service running, crossover bounce should neither start nor stop anything.
test_crossover_bounce_done
python
Yelp/paasta
tests/test_bounce_lib.py
https://github.com/Yelp/paasta/blob/master/tests/test_bounce_lib.py
Apache-2.0
def test_downthenup_bounce_no_existing_apps(self): """When marathon is unaware of a service, downthenup bounce should try to create a marathon app.""" new_config = {"id": "foo.bar.12345", "instances": 5} happy_tasks = [] old_app_live_happy_tasks = [] old_app_live_unhappy_...
When marathon is unaware of a service, downthenup bounce should try to create a marathon app.
test_downthenup_bounce_no_existing_apps
python
Yelp/paasta
tests/test_bounce_lib.py
https://github.com/Yelp/paasta/blob/master/tests/test_bounce_lib.py
Apache-2.0
def test_downthenup_bounce_old_but_no_new(self): """When marathon has only old copies of the service, downthenup_bounce should kill them and not start a new one yet.""" new_config = {"id": "foo.bar.12345", "instances": 5} happy_tasks = [] old_app_live_happy_tasks = [mock.Mock() f...
When marathon has only old copies of the service, downthenup_bounce should kill them and not start a new one yet.
test_downthenup_bounce_old_but_no_new
python
Yelp/paasta
tests/test_bounce_lib.py
https://github.com/Yelp/paasta/blob/master/tests/test_bounce_lib.py
Apache-2.0