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_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): if True these values came from the
server, and we use the data types in our endpoints.
If False, we are client side and we need to include
oneOf and discriminator classes inside the data types in our endpoints
Returns:
(valid_classes, dict_valid_class_to_child_types_mixed):
valid_classes (tuple): the valid classes that the current item
should be
dict_valid_class_to_child_types_mixed (dict):
valid_class (class): this is the key
child_types_mixed (list/dict/tuple): describes the valid child
types
"""
valid_classes = []
child_req_types_by_current_type = {}
for required_type in required_types_mixed:
if isinstance(required_type, list):
valid_classes.append(list)
child_req_types_by_current_type[list] = required_type
elif isinstance(required_type, tuple):
valid_classes.append(tuple)
child_req_types_by_current_type[tuple] = required_type
elif isinstance(required_type, dict):
valid_classes.append(dict)
child_req_types_by_current_type[dict] = required_type[str]
else:
valid_classes.extend(get_possible_classes(required_type, spec_property_naming))
return tuple(valid_classes), child_req_types_by_current_type | 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 our endpoints.
If False, we are client side and we need to include
oneOf and discriminator classes inside the data types in our endpoints
Returns:
(valid_classes, dict_valid_class_to_child_types_mixed):
valid_classes (tuple): the valid classes that the current item
should be
dict_valid_class_to_child_types_mixed (dict):
valid_class (class): this is the key
child_types_mixed (list/dict/tuple): describes the valid child
types
| 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. The assumption is the model_class
may have undeclared properties (additionalProperties attribute in the OAS
document).
"""
if getattr(model_class, 'attribute_map', None) is None:
return input_dict
output_dict = {}
reversed_attr_map = {value: key for key, value in
model_class.attribute_map.items()}
for javascript_key, value in input_dict.items():
python_key = reversed_attr_map.get(javascript_key)
if python_key is None:
# if the key is unknown, it is in error or it is an
# additionalProperties variable
python_key = javascript_key
output_dict[python_key] = value
return output_dict |
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 properties (additionalProperties attribute in the OAS
document).
| 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 discriminator property.
discr_value (any): the discriminator value.
cls_visited (list): list of model classes that have been visited.
Used to determine the discriminator class without
visiting circular references indefinitely.
Returns:
used_model_class (class/None): the chosen child class that will be used
to deserialize the data, for example dog.Dog.
If a class is not found, None is returned.
"""
if model_class in cls_visited:
# The class has already been visited and no suitable class was found.
return None
cls_visited.append(model_class)
used_model_class = None
if discr_name in model_class.discriminator:
class_name_to_discr_class = model_class.discriminator[discr_name]
used_model_class = class_name_to_discr_class.get(discr_value)
if used_model_class is None:
# We didn't find a discriminated class in class_name_to_discr_class.
# So look in the ancestor or descendant discriminators
# The discriminator mapping may exist in a descendant (anyOf, oneOf)
# or ancestor (allOf).
# Ancestor example: in the GrandparentAnimal -> ParentPet -> ChildCat
# hierarchy, the discriminator mappings may be defined at any level
# in the hierarchy.
# Descendant example: mammal -> whale/zebra/Pig -> BasquePig/DanishPig
# if we try to make BasquePig from mammal, we need to travel through
# the oneOf descendant discriminators to find BasquePig
descendant_classes = model_class._composed_schemas.get('oneOf', ()) + \
model_class._composed_schemas.get('anyOf', ())
ancestor_classes = model_class._composed_schemas.get('allOf', ())
possible_classes = descendant_classes + ancestor_classes
for cls in possible_classes:
# Check if the schema has inherited discriminators.
if hasattr(cls, 'discriminator') and cls.discriminator is not None:
used_model_class = get_discriminator_class(
cls, discr_name, discr_value, cls_visited)
if used_model_class is not None:
return used_model_class
return used_model_class | 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.
Used to determine the discriminator class without
visiting circular references indefinitely.
Returns:
used_model_class (class/None): the chosen child class that will be used
to deserialize the data, for example dog.Dog.
If a class is not found, None is returned.
| 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): the model class
path_to_item (list): path to the model in the received data
check_type (bool): whether to check the data tupe for the values in
the model
configuration (Configuration): the instance to use to convert files
spec_property_naming (bool): True if the variable names in the input
data are serialized names as specified in the OpenAPI document.
False if the variables names in the input data are python
variable names in PEP-8 snake case.
Returns:
model instance
Raise:
ApiTypeError
ApiValueError
ApiKeyError
"""
kw_args = dict(_check_type=check_type,
_path_to_item=path_to_item,
_configuration=configuration,
_spec_property_naming=spec_property_naming)
if issubclass(model_class, ModelSimple):
return model_class(model_data, **kw_args)
elif isinstance(model_data, list):
return model_class(*model_data, **kw_args)
if isinstance(model_data, dict):
kw_args.update(model_data)
return model_class(**kw_args)
elif isinstance(model_data, PRIMITIVE_TYPES):
return model_class(model_data, **kw_args) | 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 tupe for the values in
the model
configuration (Configuration): the instance to use to convert files
spec_property_naming (bool): True if the variable names in the input
data are serialized names as specified in the OpenAPI document.
False if the variables names in the input data are python
variable names in PEP-8 snake case.
Returns:
model instance
Raise:
ApiTypeError
ApiValueError
ApiKeyError
| 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
configuration (Configuration): the instance to use to convert files
Keyword Args:
content_disposition (str): the value of the Content-Disposition
header
Returns:
(file_type): the deserialized file which is open
The user is responsible for closing and reading the file
"""
fd, path = tempfile.mkstemp(dir=configuration.temp_folder_path)
os.close(fd)
os.remove(path)
if content_disposition:
filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?',
content_disposition).group(1)
path = os.path.join(os.path.dirname(path), filename)
with open(path, "wb") as f:
if isinstance(response_data, str):
# change str to bytes so we can write it
response_data = response_data.encode('utf-8')
f.write(response_data)
f = open(path, "rb")
return f | 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 Args:
content_disposition (str): the value of the Content-Disposition
header
Returns:
(file_type): the deserialized file which is open
The user is responsible for closing and reading the file
| 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 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 the input
data are serialized names as specified in the OpenAPI document.
False if the variables names in the input data are python
variable names in PEP-8 snake case.
key_type (bool): if True we need to convert a key type (not supported)
must_convert (bool): if True we must convert
check_type (bool): if True we check the type or the returned data in
ModelComposed/ModelNormal/ModelSimple instances
Returns:
instance (any) the fixed item
Raises:
ApiTypeError
ApiValueError
ApiKeyError
"""
valid_classes_ordered = order_response_types(valid_classes)
valid_classes_coercible = remove_uncoercible(
valid_classes_ordered, input_value, spec_property_naming)
if not valid_classes_coercible or key_type:
# we do not handle keytype errors, json will take care
# of this for us
if configuration is None or not configuration.discard_unknown_keys:
raise get_type_error(input_value, path_to_item, valid_classes,
key_type=key_type)
for valid_class in valid_classes_coercible:
try:
if issubclass(valid_class, OpenApiModel):
return deserialize_model(input_value, valid_class,
path_to_item, check_type,
configuration, spec_property_naming)
elif valid_class == file_type:
return deserialize_file(input_value, configuration)
return deserialize_primitive(input_value, valid_class,
path_to_item)
except (ApiTypeError, ApiValueError, ApiKeyError) as conversion_exc:
if must_convert:
raise conversion_exc
# if we have conversion errors when must_convert == False
# we ignore the exception and move on to the next class
continue
# we were unable to convert, must_convert == False
return input_value |
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 the input
data are serialized names as specified in the OpenAPI document.
False if the variables names in the input data are python
variable names in PEP-8 snake case.
key_type (bool): if True we need to convert a key type (not supported)
must_convert (bool): if True we must convert
check_type (bool): if True we check the type or the returned data in
ModelComposed/ModelNormal/ModelSimple instances
Returns:
instance (any) the fixed item
Raises:
ApiTypeError
ApiValueError
ApiKeyError
| 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 composed schema, and a child schema is
the 'null' type.
Args:
input_type (type): the class of the input_value that we are
checking
Returns:
bool
"""
if input_type is none_type:
return True
if issubclass(input_type, OpenApiModel) and input_type._nullable:
return True
if issubclass(input_type, ModelComposed):
# If oneOf/anyOf, check if the 'null' type is one of the allowed types.
for t in input_type._composed_schemas.get('oneOf', ()):
if is_type_nullable(t): return True
for t in input_type._composed_schemas.get('anyOf', ()):
if is_type_nullable(t): return True
return False |
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
the 'null' type.
Args:
input_type (type): the class of the input_value that we are
checking
Returns:
bool
| 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_class_simple in valid_classes
if not valid_type and (
issubclass(input_class_simple, OpenApiModel) or
input_class_simple is none_type):
for valid_class in valid_classes:
if input_class_simple is none_type and is_type_nullable(valid_class):
# Schema is oneOf/anyOf and the 'null' type is one of the allowed types.
return True
if not (issubclass(valid_class, OpenApiModel) and valid_class.discriminator):
continue
discr_propertyname_py = list(valid_class.discriminator.keys())[0]
discriminator_classes = (
valid_class.discriminator[discr_propertyname_py].values()
)
valid_type = is_valid_type(input_class_simple, discriminator_classes)
if valid_type:
return True
return valid_type |
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
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
path_to_item: (list) the path to the data being validated
this stores a list of keys or indices to get to the data being
validated
spec_property_naming (bool): True if the variable names in the input
data are serialized names as specified in the OpenAPI document.
False if the variables names in the input data are python
variable names in PEP-8 snake case.
_check_type: (boolean) if true, type will be checked and conversion
will be attempted.
configuration: (Configuration): the configuration class to use
when converting file_type items.
If passed, conversion will be attempted when possible
If not passed, no conversions will be attempted and
exceptions will be raised
Returns:
the correctly typed value
Raises:
ApiTypeError
"""
results = get_required_type_classes(required_types_mixed, spec_property_naming)
valid_classes, child_req_types_by_current_type = results
input_class_simple = get_simple_class(input_value)
valid_type = is_valid_type(input_class_simple, valid_classes)
if not valid_type:
if configuration:
# if input_value is not valid_type try to convert it
converted_instance = attempt_convert_item(
input_value,
valid_classes,
path_to_item,
configuration,
spec_property_naming,
key_type=False,
must_convert=True
)
return converted_instance
else:
raise get_type_error(input_value, path_to_item, valid_classes,
key_type=False)
# input_value's type is in valid_classes
if len(valid_classes) > 1 and configuration:
# there are valid classes which are not the current class
valid_classes_coercible = remove_uncoercible(
valid_classes, input_value, spec_property_naming, must_convert=False)
if valid_classes_coercible:
converted_instance = attempt_convert_item(
input_value,
valid_classes_coercible,
path_to_item,
configuration,
spec_property_naming,
key_type=False,
must_convert=False
)
return converted_instance
if child_req_types_by_current_type == {}:
# all types are of the required types and there are no more inner
# variables left to look at
return input_value
inner_required_types = child_req_types_by_current_type.get(
type(input_value)
)
if inner_required_types is None:
# for this type, there are not more inner variables left to look at
return input_value
if isinstance(input_value, list):
if input_value == []:
# allow an empty list
return input_value
for index, inner_value in enumerate(input_value):
inner_path = list(path_to_item)
inner_path.append(index)
input_value[index] = validate_and_convert_types(
inner_value,
inner_required_types,
inner_path,
spec_property_naming,
_check_type,
configuration=configuration
)
elif isinstance(input_value, dict):
if input_value == {}:
# allow an empty dict
return input_value
for inner_key, inner_val in input_value.items():
inner_path = list(path_to_item)
inner_path.append(inner_key)
if get_simple_class(inner_key) != str:
raise get_type_error(inner_key, inner_path, valid_classes,
key_type=True)
input_value[inner_key] = validate_and_convert_types(
inner_val,
inner_required_types,
inner_path,
spec_property_naming,
_check_type,
configuration=configuration
)
return input_value | 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
path_to_item: (list) the path to the data being validated
this stores a list of keys or indices to get to the data being
validated
spec_property_naming (bool): True if the variable names in the input
data are serialized names as specified in the OpenAPI document.
False if the variables names in the input data are python
variable names in PEP-8 snake case.
_check_type: (boolean) if true, type will be checked and conversion
will be attempted.
configuration: (Configuration): the configuration class to use
when converting file_type items.
If passed, conversion will be attempted when possible
If not passed, no conversions will be attempted and
exceptions will be raised
Returns:
the correctly typed value
Raises:
ApiTypeError
| 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 from
attribute_map
"""
result = {}
model_instances = [model_instance]
if model_instance._composed_schemas:
model_instances.extend(model_instance._composed_instances)
for model_instance in model_instances:
for attr, value in model_instance._data_store.items():
if serialize:
# we use get here because additional property key names do not
# exist in attribute_map
attr = model_instance.attribute_map.get(attr, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: model_to_dict(x, serialize=serialize)
if hasattr(x, '_data_store') else x, value
))
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0],
model_to_dict(item[1], serialize=serialize))
if hasattr(item[1], '_data_store') else item,
value.items()
))
elif isinstance(value, ModelSimple):
result[attr] = value.value
elif hasattr(value, '_data_store'):
result[attr] = model_to_dict(value, serialize=serialize)
else:
result[attr] = value
return result | 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 classes for current_item's
value
key_type (bool): False if our value is a value in a dict
True if it is a key in a dict
False if our item is an item in a list
"""
key_or_value = 'value'
if key_type:
key_or_value = 'key'
valid_classes_phrase = get_valid_classes_phrase(valid_classes)
msg = (
"Invalid type for variable '{0}'. Required {1} type {2} and "
"passed type was {3}".format(
var_name,
key_or_value,
valid_classes_phrase,
type(var_value).__name__,
)
)
return msg |
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 in a dict
True if it is a key in a dict
False if our item is an item in a list
| 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:
return 'is {0}'.format(all_class_names[0])
return "is one of [{0}]".format(", ".join(all_class_names)) | 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_instances (list)
"""
composed_instances = []
for allof_class in self._composed_schemas['allOf']:
# no need to handle changing js keys to python because
# for composed schemas, allof parameters are included in the
# composed schema and were changed to python keys in __new__
# extract a dict of only required keys from fixed_model_args
kwargs = {}
var_names = set(allof_class.openapi_types.keys())
for var_name in var_names:
if var_name in model_args:
kwargs[var_name] = model_args[var_name]
# and use it to make the instance
kwargs.update(constant_args)
try:
allof_instance = allof_class(**kwargs)
composed_instances.append(allof_instance)
except Exception as ex:
raise ApiValueError(
"Invalid inputs given to generate an instance of '%s'. The "
"input data was invalid for the allOf schema '%s' in the composed "
"schema '%s'. Error=%s" % (
allof_class.__name__,
allof_class.__name__,
self.__class__.__name__,
str(ex)
)
) from ex
return composed_instances |
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 (dict): var_name to var_value
args that every model requires, including configuration, server
and path to item.
Returns
anyof_instances (list)
"""
anyof_instances = []
if len(self._composed_schemas['anyOf']) == 0:
return anyof_instances
for anyof_class in self._composed_schemas['anyOf']:
# The composed oneOf schema allows the 'null' type and the input data
# is the null value. This is a OAS >= 3.1 feature.
if anyof_class is none_type:
# skip none_types because we are deserializing dict data.
# none_type deserialization is handled in the __new__ method
continue
# transform js keys to python keys in fixed_model_args
fixed_model_args = change_keys_js_to_python(model_args, anyof_class)
# extract a dict of only required keys from these_model_vars
kwargs = {}
var_names = set(anyof_class.openapi_types.keys())
for var_name in var_names:
if var_name in fixed_model_args:
kwargs[var_name] = fixed_model_args[var_name]
# do not try to make a model with no input args
if len(kwargs) == 0:
continue
# and use it to make the instance
kwargs.update(constant_args)
try:
anyof_instance = anyof_class(**kwargs)
anyof_instances.append(anyof_instance)
except Exception:
pass
if len(anyof_instances) == 0:
raise ApiValueError(
"Invalid inputs given to generate an instance of %s. None of the "
"anyOf schemas matched the inputs." %
self.__class__.__name__
)
return anyof_instances |
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 requires, including configuration, server
and path to item.
Returns
anyof_instances (list)
| 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.
Openapi schemas are python classes.
Exceptions are raised if:
- 0 or > 1 oneOf schema matches the model_args input data
- no anyOf schema matches the model_args input data
- any of the allOf schemas do not match the model_args input data
Args:
constant_args (dict): these are the args that every model requires
model_args (dict): these are the required and optional spec args that
were passed in to make this model
self (class): the class that we are instantiating
This class contains self._composed_schemas
Returns:
composed_info (list): length three
composed_instances (list): the composed instances which are not
self
var_name_to_model_instances (dict): a dict going from var_name
to the model_instance which holds that var_name
the model_instance may be self or an instance of one of the
classes in self.composed_instances()
additional_properties_model_instances (list): a list of the
model instances which have the property
additional_properties_type. This list can include self
"""
# create composed_instances
composed_instances = []
allof_instances = get_allof_instances(self, model_args, constant_args)
composed_instances.extend(allof_instances)
oneof_instance = get_oneof_instance(self.__class__, model_args, constant_args)
if oneof_instance is not None:
composed_instances.append(oneof_instance)
anyof_instances = get_anyof_instances(self, model_args, constant_args)
composed_instances.extend(anyof_instances)
# map variable names to composed_instances
var_name_to_model_instances = get_var_name_to_model_instances(
self, composed_instances)
# set additional_properties_model_instances
additional_properties_model_instances = (
get_additional_properties_model_instances(composed_instances, self)
)
# set any remaining values
unused_args = get_unused_args(self, composed_instances, model_args)
if len(unused_args) > 0 and \
len(additional_properties_model_instances) == 0 and \
(self._configuration is None or
not self._configuration.discard_unknown_keys):
raise ApiValueError(
"Invalid input arguments input when making an instance of "
"class %s. Not all inputs were used. The unused input data "
"is %s" % (self.__class__.__name__, unused_args)
)
# no need to add additional_properties to var_name_to_model_instances here
# because additional_properties_model_instances will direct us to that
# instance when we use getattr or setattr
# and we update var_name_to_model_instances in setattr
return [
composed_instances,
var_name_to_model_instances,
additional_properties_model_instances,
unused_args
] |
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:
- 0 or > 1 oneOf schema matches the model_args input data
- no anyOf schema matches the model_args input data
- any of the allOf schemas do not match the model_args input data
Args:
constant_args (dict): these are the args that every model requires
model_args (dict): these are the required and optional spec args that
were passed in to make this model
self (class): the class that we are instantiating
This class contains self._composed_schemas
Returns:
composed_info (list): length three
composed_instances (list): the composed instances which are not
self
var_name_to_model_instances (dict): a dict going from var_name
to the model_instance which holds that var_name
the model_instance may be self or an instance of one of the
classes in self.composed_instances()
additional_properties_model_instances (list): a list of the
model instances which have the property
additional_properties_type. This list can include self
| 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 parameters in the url
:param headers: http request headers
:param body: request json body, for `application/json`
:param post_params: request post parameters,
`application/x-www-form-urlencoded`
and `multipart/form-data`
:param _preload_content: if False, the urllib3.HTTPResponse object will
be returned without reading/decoding response
data. Default is True.
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
"""
method = method.upper()
assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT',
'PATCH', 'OPTIONS']
if post_params and body:
raise ApiValueError(
"body parameter cannot be used with post_params parameter."
)
post_params = post_params or {}
headers = headers or {}
timeout = None
if _request_timeout:
if isinstance(_request_timeout, (int, float)): # noqa: E501,F821
timeout = urllib3.Timeout(total=_request_timeout)
elif (isinstance(_request_timeout, tuple) and
len(_request_timeout) == 2):
timeout = urllib3.Timeout(
connect=_request_timeout[0], read=_request_timeout[1])
if 'Content-Type' not in headers:
headers['Content-Type'] = 'application/json'
try:
# For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE`
if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']:
if query_params:
url += '?' + urlencode(query_params)
if re.search('json', headers['Content-Type'], re.IGNORECASE):
request_body = None
if body is not None:
request_body = json.dumps(body)
r = self.pool_manager.request(
method, url,
body=request_body,
preload_content=_preload_content,
timeout=timeout,
headers=headers)
elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501
r = self.pool_manager.request(
method, url,
fields=post_params,
encode_multipart=False,
preload_content=_preload_content,
timeout=timeout,
headers=headers)
elif headers['Content-Type'] == 'multipart/form-data':
# must del headers['Content-Type'], or the correct
# Content-Type which generated by urllib3 will be
# overwritten.
del headers['Content-Type']
r = self.pool_manager.request(
method, url,
fields=post_params,
encode_multipart=True,
preload_content=_preload_content,
timeout=timeout,
headers=headers)
# Pass a `string` parameter directly in the body to support
# other content types than Json when `body` argument is
# provided in serialized form
elif isinstance(body, str) or isinstance(body, bytes):
request_body = body
r = self.pool_manager.request(
method, url,
body=request_body,
preload_content=_preload_content,
timeout=timeout,
headers=headers)
else:
# Cannot generate the request from given parameters
msg = """Cannot prepare a request message for provided
arguments. Please check that your arguments match
declared content type."""
raise ApiException(status=0, reason=msg)
# For `GET`, `HEAD`
else:
r = self.pool_manager.request(method, url,
fields=query_params,
preload_content=_preload_content,
timeout=timeout,
headers=headers)
except urllib3.exceptions.SSLError as e:
msg = "{0}\n{1}".format(type(e).__name__, str(e))
raise ApiException(status=0, reason=msg)
if _preload_content:
r = RESTResponse(r)
# log response body
logger.debug("response body: %s", r.data)
if not 200 <= r.status <= 299:
raise ApiException(http_resp=r)
return r | 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,
`application/x-www-form-urlencoded`
and `multipart/form-data`
:param _preload_content: if False, the urllib3.HTTPResponse object will
be returned without reading/decoding response
data. Default is True.
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
| 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 pass async_req=True
>>> thread = api.get_autoscaler_count(service, instance, async_req=True)
>>> result = thread.get()
Args:
service (str): Service name
instance (str): Instance name
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
AutoscalerCountMsg
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
)
kwargs['_return_http_data_only'] = kwargs.get(
'_return_http_data_only', True
)
kwargs['_preload_content'] = kwargs.get(
'_preload_content', True
)
kwargs['_request_timeout'] = kwargs.get(
'_request_timeout', None
)
kwargs['_check_input_type'] = kwargs.get(
'_check_input_type', True
)
kwargs['_check_return_type'] = kwargs.get(
'_check_return_type', True
)
kwargs['_host_index'] = kwargs.get('_host_index')
kwargs['service'] = \
service
kwargs['instance'] = \
instance
return self.call_with_http_info(**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 async_req=True
>>> thread = api.get_autoscaler_count(service, instance, async_req=True)
>>> result = thread.get()
Args:
service (str): Service name
instance (str): Instance name
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
AutoscalerCountMsg
If the method is called asynchronously, returns the request
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 make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.set_autoscaling_override(service, instance, autoscaling_override, async_req=True)
>>> result = thread.get()
Args:
service (str): Service name
instance (str): Instance name
autoscaling_override (AutoscalingOverride):
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
InlineResponse202
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
)
kwargs['_return_http_data_only'] = kwargs.get(
'_return_http_data_only', True
)
kwargs['_preload_content'] = kwargs.get(
'_preload_content', True
)
kwargs['_request_timeout'] = kwargs.get(
'_request_timeout', None
)
kwargs['_check_input_type'] = kwargs.get(
'_check_input_type', True
)
kwargs['_check_return_type'] = kwargs.get(
'_check_return_type', True
)
kwargs['_host_index'] = kwargs.get('_host_index')
kwargs['service'] = \
service
kwargs['instance'] = \
instance
kwargs['autoscaling_override'] = \
autoscaling_override
return self.call_with_http_info(**kwargs) | 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, async_req=True)
>>> result = thread.get()
Args:
service (str): Service name
instance (str): Instance name
autoscaling_override (AutoscalingOverride):
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
InlineResponse202
If the method is called asynchronously, returns the request
thread.
| __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
asynchronous HTTP request, please pass async_req=True
>>> thread = api.update_autoscaler_count(service, instance, autoscaler_count_msg, async_req=True)
>>> result = thread.get()
Args:
service (str): Service name
instance (str): Instance name
autoscaler_count_msg (AutoscalerCountMsg):
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
AutoscalerCountMsg
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
)
kwargs['_return_http_data_only'] = kwargs.get(
'_return_http_data_only', True
)
kwargs['_preload_content'] = kwargs.get(
'_preload_content', True
)
kwargs['_request_timeout'] = kwargs.get(
'_request_timeout', None
)
kwargs['_check_input_type'] = kwargs.get(
'_check_input_type', True
)
kwargs['_check_return_type'] = kwargs.get(
'_check_return_type', True
)
kwargs['_host_index'] = kwargs.get('_host_index')
kwargs['service'] = \
service
kwargs['instance'] = \
instance
kwargs['autoscaler_count_msg'] = \
autoscaler_count_msg
return self.call_with_http_info(**kwargs) | 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)
>>> result = thread.get()
Args:
service (str): Service name
instance (str): Instance name
autoscaler_count_msg (AutoscalerCountMsg):
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
AutoscalerCountMsg
If the method is called asynchronously, returns the request
thread.
| __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.delete_service_autoscaler_pause(async_req=True)
>>> result = thread.get()
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
None
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
)
kwargs['_return_http_data_only'] = kwargs.get(
'_return_http_data_only', True
)
kwargs['_preload_content'] = kwargs.get(
'_preload_content', True
)
kwargs['_request_timeout'] = kwargs.get(
'_request_timeout', None
)
kwargs['_check_input_type'] = kwargs.get(
'_check_input_type', True
)
kwargs['_check_return_type'] = kwargs.get(
'_check_return_type', True
)
kwargs['_host_index'] = kwargs.get('_host_index')
return self.call_with_http_info(**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.delete_service_autoscaler_pause(async_req=True)
>>> result = thread.get()
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
None
If the method is called asynchronously, returns the request
thread.
| __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_req=True)
>>> result = thread.get()
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
DeployQueue
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
)
kwargs['_return_http_data_only'] = kwargs.get(
'_return_http_data_only', True
)
kwargs['_preload_content'] = kwargs.get(
'_preload_content', True
)
kwargs['_request_timeout'] = kwargs.get(
'_request_timeout', None
)
kwargs['_check_input_type'] = kwargs.get(
'_check_input_type', True
)
kwargs['_check_return_type'] = kwargs.get(
'_check_return_type', True
)
kwargs['_host_index'] = kwargs.get('_host_index')
return self.call_with_http_info(**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_req=True)
>>> result = thread.get()
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
DeployQueue
If the method is called asynchronously, returns the request
thread.
| __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.get_service_autoscaler_pause(async_req=True)
>>> result = thread.get()
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
str
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
)
kwargs['_return_http_data_only'] = kwargs.get(
'_return_http_data_only', True
)
kwargs['_preload_content'] = kwargs.get(
'_preload_content', True
)
kwargs['_request_timeout'] = kwargs.get(
'_request_timeout', None
)
kwargs['_check_input_type'] = kwargs.get(
'_check_input_type', True
)
kwargs['_check_return_type'] = kwargs.get(
'_check_return_type', True
)
kwargs['_host_index'] = kwargs.get('_host_index')
return self.call_with_http_info(**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.get_service_autoscaler_pause(async_req=True)
>>> result = thread.get()
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
str
If the method is called asynchronously, returns the request
thread.
| __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(async_req=True)
>>> result = thread.get()
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
str
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
)
kwargs['_return_http_data_only'] = kwargs.get(
'_return_http_data_only', True
)
kwargs['_preload_content'] = kwargs.get(
'_preload_content', True
)
kwargs['_request_timeout'] = kwargs.get(
'_request_timeout', None
)
kwargs['_check_input_type'] = kwargs.get(
'_check_input_type', True
)
kwargs['_check_return_type'] = kwargs.get(
'_check_return_type', True
)
kwargs['_host_index'] = kwargs.get('_host_index')
return self.call_with_http_info(**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(async_req=True)
>>> result = thread.get()
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
str
If the method is called asynchronously, returns the request
thread.
| __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=True
>>> thread = api.update_service_autoscaler_pause(inline_object, async_req=True)
>>> result = thread.get()
Args:
inline_object (InlineObject):
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
None
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
)
kwargs['_return_http_data_only'] = kwargs.get(
'_return_http_data_only', True
)
kwargs['_preload_content'] = kwargs.get(
'_preload_content', True
)
kwargs['_request_timeout'] = kwargs.get(
'_request_timeout', None
)
kwargs['_check_input_type'] = kwargs.get(
'_check_input_type', True
)
kwargs['_check_return_type'] = kwargs.get(
'_check_return_type', True
)
kwargs['_host_index'] = kwargs.get('_host_index')
kwargs['inline_object'] = \
inline_object
return self.call_with_http_info(**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=True
>>> thread = api.update_service_autoscaler_pause(inline_object, async_req=True)
>>> result = thread.get()
Args:
inline_object (InlineObject):
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
None
If the method is called asynchronously, returns the request
thread.
| __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
asynchronous HTTP request, please pass async_req=True
>>> thread = api.remote_run_poll(service, instance, job_name, user, async_req=True)
>>> result = thread.get()
Args:
service (str): Service name
instance (str): Instance name
job_name (str): Job name
user (str): User requesting job
Keyword Args:
toolbox (bool): Whether this is a toolbox job. [optional]
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
RemoteRunOutcome
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
)
kwargs['_return_http_data_only'] = kwargs.get(
'_return_http_data_only', True
)
kwargs['_preload_content'] = kwargs.get(
'_preload_content', True
)
kwargs['_request_timeout'] = kwargs.get(
'_request_timeout', None
)
kwargs['_check_input_type'] = kwargs.get(
'_check_input_type', True
)
kwargs['_check_return_type'] = kwargs.get(
'_check_return_type', True
)
kwargs['_host_index'] = kwargs.get('_host_index')
kwargs['service'] = \
service
kwargs['instance'] = \
instance
kwargs['job_name'] = \
job_name
kwargs['user'] = \
user
return self.call_with_http_info(**kwargs) | 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 = thread.get()
Args:
service (str): Service name
instance (str): Instance name
job_name (str): Job name
user (str): User requesting job
Keyword Args:
toolbox (bool): Whether this is a toolbox job. [optional]
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
RemoteRunOutcome
If the method is called asynchronously, returns the request
thread.
| __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, please pass async_req=True
>>> thread = api.remote_run_start(service, instance, remote_run_start, async_req=True)
>>> result = thread.get()
Args:
service (str): Service name
instance (str): Instance name
remote_run_start (RemoteRunStart):
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
RemoteRunOutcome
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
)
kwargs['_return_http_data_only'] = kwargs.get(
'_return_http_data_only', True
)
kwargs['_preload_content'] = kwargs.get(
'_preload_content', True
)
kwargs['_request_timeout'] = kwargs.get(
'_request_timeout', None
)
kwargs['_check_input_type'] = kwargs.get(
'_check_input_type', True
)
kwargs['_check_return_type'] = kwargs.get(
'_check_return_type', True
)
kwargs['_host_index'] = kwargs.get('_host_index')
kwargs['service'] = \
service
kwargs['instance'] = \
instance
kwargs['remote_run_start'] = \
remote_run_start
return self.call_with_http_info(**kwargs) | 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()
Args:
service (str): Service name
instance (str): Instance name
remote_run_start (RemoteRunStart):
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
RemoteRunOutcome
If the method is called asynchronously, returns the request
thread.
| __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, please pass async_req=True
>>> thread = api.remote_run_stop(service, instance, remote_run_stop, async_req=True)
>>> result = thread.get()
Args:
service (str): Service name
instance (str): Instance name
remote_run_stop (RemoteRunStop):
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
RemoteRunOutcome
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
)
kwargs['_return_http_data_only'] = kwargs.get(
'_return_http_data_only', True
)
kwargs['_preload_content'] = kwargs.get(
'_preload_content', True
)
kwargs['_request_timeout'] = kwargs.get(
'_request_timeout', None
)
kwargs['_check_input_type'] = kwargs.get(
'_check_input_type', True
)
kwargs['_check_return_type'] = kwargs.get(
'_check_return_type', True
)
kwargs['_host_index'] = kwargs.get('_host_index')
kwargs['service'] = \
service
kwargs['instance'] = \
instance
kwargs['remote_run_stop'] = \
remote_run_stop
return self.call_with_http_info(**kwargs) | 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()
Args:
service (str): Service name
instance (str): Instance name
remote_run_stop (RemoteRunStop):
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
RemoteRunOutcome
If the method is called asynchronously, returns the request
thread.
| __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
asynchronous HTTP request, please pass async_req=True
>>> thread = api.remote_run_token(service, instance, user, async_req=True)
>>> result = thread.get()
Args:
service (str): Service name
instance (str): Instance name
user (str): User name
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
RemoteRunToken
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
)
kwargs['_return_http_data_only'] = kwargs.get(
'_return_http_data_only', True
)
kwargs['_preload_content'] = kwargs.get(
'_preload_content', True
)
kwargs['_request_timeout'] = kwargs.get(
'_request_timeout', None
)
kwargs['_check_input_type'] = kwargs.get(
'_check_input_type', True
)
kwargs['_check_return_type'] = kwargs.get(
'_check_return_type', True
)
kwargs['_host_index'] = kwargs.get('_host_index')
kwargs['service'] = \
service
kwargs['instance'] = \
instance
kwargs['user'] = \
user
return self.call_with_http_info(**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
asynchronous HTTP request, please pass async_req=True
>>> thread = api.remote_run_token(service, instance, user, async_req=True)
>>> result = thread.get()
Args:
service (str): Service name
instance (str): Instance name
user (str): User name
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
RemoteRunToken
If the method is called asynchronously, returns the request
thread.
| __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_req=True)
>>> result = thread.get()
Keyword Args:
groupings ([str]): comma separated list of keys to group by. [optional]
filter ([str]): List of slave filters in format 'filter=attr_name:value1,value2&filter=attr2:value3,value4'. Matches attr_name=(value1 OR value2) AND attr2=(value3 OR value4). [optional]
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
Resource
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
)
kwargs['_return_http_data_only'] = kwargs.get(
'_return_http_data_only', True
)
kwargs['_preload_content'] = kwargs.get(
'_preload_content', True
)
kwargs['_request_timeout'] = kwargs.get(
'_request_timeout', None
)
kwargs['_check_input_type'] = kwargs.get(
'_check_input_type', True
)
kwargs['_check_return_type'] = kwargs.get(
'_check_return_type', True
)
kwargs['_host_index'] = kwargs.get('_host_index')
return self.call_with_http_info(**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_req=True)
>>> result = thread.get()
Keyword Args:
groupings ([str]): comma separated list of keys to group by. [optional]
filter ([str]): List of slave filters in format 'filter=attr_name:value1,value2&filter=attr2:value3,value4'. Matches attr_name=(value1 OR value2) AND attr2=(value3 OR value4). [optional]
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
Resource
If the method is called asynchronously, returns the request
thread.
| __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, please pass async_req=True
>>> thread = api.bounce_status_instance(service, instance, async_req=True)
>>> result = thread.get()
Args:
service (str): Service name
instance (str): Instance name
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
InstanceBounceStatus
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
)
kwargs['_return_http_data_only'] = kwargs.get(
'_return_http_data_only', True
)
kwargs['_preload_content'] = kwargs.get(
'_preload_content', True
)
kwargs['_request_timeout'] = kwargs.get(
'_request_timeout', None
)
kwargs['_check_input_type'] = kwargs.get(
'_check_input_type', True
)
kwargs['_check_return_type'] = kwargs.get(
'_check_return_type', True
)
kwargs['_host_index'] = kwargs.get('_host_index')
kwargs['service'] = \
service
kwargs['instance'] = \
instance
return self.call_with_http_info(**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, please pass async_req=True
>>> thread = api.bounce_status_instance(service, instance, async_req=True)
>>> result = thread.get()
Args:
service (str): Service name
instance (str): Instance name
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
InstanceBounceStatus
If the method is called asynchronously, returns the request
thread.
| __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
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delay_instance(service, instance, async_req=True)
>>> result = thread.get()
Args:
service (str): Service name
instance (str): Instance name
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
{str: (bool, date, datetime, dict, float, int, list, str, none_type)}
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
)
kwargs['_return_http_data_only'] = kwargs.get(
'_return_http_data_only', True
)
kwargs['_preload_content'] = kwargs.get(
'_preload_content', True
)
kwargs['_request_timeout'] = kwargs.get(
'_request_timeout', None
)
kwargs['_check_input_type'] = kwargs.get(
'_check_input_type', True
)
kwargs['_check_return_type'] = kwargs.get(
'_check_return_type', True
)
kwargs['_host_index'] = kwargs.get('_host_index')
kwargs['service'] = \
service
kwargs['instance'] = \
instance
return self.call_with_http_info(**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
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delay_instance(service, instance, async_req=True)
>>> result = thread.get()
Args:
service (str): Service name
instance (str): Instance name
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
{str: (bool, date, datetime, dict, float, int, list, str, none_type)}
If the method is called asynchronously, returns the request
thread.
| __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 async_req=True
>>> thread = api.get_flink_cluster_config(service, instance, async_req=True)
>>> result = thread.get()
Args:
service (str): Service name
instance (str): Instance name
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
FlinkConfig
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
)
kwargs['_return_http_data_only'] = kwargs.get(
'_return_http_data_only', True
)
kwargs['_preload_content'] = kwargs.get(
'_preload_content', True
)
kwargs['_request_timeout'] = kwargs.get(
'_request_timeout', None
)
kwargs['_check_input_type'] = kwargs.get(
'_check_input_type', True
)
kwargs['_check_return_type'] = kwargs.get(
'_check_return_type', True
)
kwargs['_host_index'] = kwargs.get('_host_index')
kwargs['service'] = \
service
kwargs['instance'] = \
instance
return self.call_with_http_info(**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 async_req=True
>>> thread = api.get_flink_cluster_config(service, instance, async_req=True)
>>> result = thread.get()
Args:
service (str): Service name
instance (str): Instance name
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
FlinkConfig
If the method is called asynchronously, returns the request
thread.
| __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
asynchronous HTTP request, please pass async_req=True
>>> thread = api.get_flink_cluster_job_details(service, instance, job_id, async_req=True)
>>> result = thread.get()
Args:
service (str): Service name
instance (str): Instance name
job_id (str): Job id
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
FlinkJobDetails
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
)
kwargs['_return_http_data_only'] = kwargs.get(
'_return_http_data_only', True
)
kwargs['_preload_content'] = kwargs.get(
'_preload_content', True
)
kwargs['_request_timeout'] = kwargs.get(
'_request_timeout', None
)
kwargs['_check_input_type'] = kwargs.get(
'_check_input_type', True
)
kwargs['_check_return_type'] = kwargs.get(
'_check_return_type', True
)
kwargs['_host_index'] = kwargs.get('_host_index')
kwargs['service'] = \
service
kwargs['instance'] = \
instance
kwargs['job_id'] = \
job_id
return self.call_with_http_info(**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
asynchronous HTTP request, please pass async_req=True
>>> thread = api.get_flink_cluster_job_details(service, instance, job_id, async_req=True)
>>> result = thread.get()
Args:
service (str): Service name
instance (str): Instance name
job_id (str): Job id
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
FlinkJobDetails
If the method is called asynchronously, returns the request
thread.
| __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 async_req=True
>>> thread = api.get_flink_cluster_overview(service, instance, async_req=True)
>>> result = thread.get()
Args:
service (str): Service name
instance (str): Instance name
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
FlinkClusterOverview
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
)
kwargs['_return_http_data_only'] = kwargs.get(
'_return_http_data_only', True
)
kwargs['_preload_content'] = kwargs.get(
'_preload_content', True
)
kwargs['_request_timeout'] = kwargs.get(
'_request_timeout', None
)
kwargs['_check_input_type'] = kwargs.get(
'_check_input_type', True
)
kwargs['_check_return_type'] = kwargs.get(
'_check_return_type', True
)
kwargs['_host_index'] = kwargs.get('_host_index')
kwargs['service'] = \
service
kwargs['instance'] = \
instance
return self.call_with_http_info(**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 async_req=True
>>> thread = api.get_flink_cluster_overview(service, instance, async_req=True)
>>> result = thread.get()
Args:
service (str): Service name
instance (str): Instance name
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
FlinkClusterOverview
If the method is called asynchronously, returns the request
thread.
| __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
asynchronous HTTP request, please pass async_req=True
>>> thread = api.instance_set_state(service, instance, desired_state, async_req=True)
>>> result = thread.get()
Args:
service (str): Service name
instance (str): Instance name
desired_state (str): Desired state
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
None
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
)
kwargs['_return_http_data_only'] = kwargs.get(
'_return_http_data_only', True
)
kwargs['_preload_content'] = kwargs.get(
'_preload_content', True
)
kwargs['_request_timeout'] = kwargs.get(
'_request_timeout', None
)
kwargs['_check_input_type'] = kwargs.get(
'_check_input_type', True
)
kwargs['_check_return_type'] = kwargs.get(
'_check_return_type', True
)
kwargs['_host_index'] = kwargs.get('_host_index')
kwargs['service'] = \
service
kwargs['instance'] = \
instance
kwargs['desired_state'] = \
desired_state
return self.call_with_http_info(**kwargs) | 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)
>>> result = thread.get()
Args:
service (str): Service name
instance (str): Instance name
desired_state (str): Desired state
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
None
If the method is called asynchronously, returns the request
thread.
| __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, please pass async_req=True
>>> thread = api.list_flink_cluster_jobs(service, instance, async_req=True)
>>> result = thread.get()
Args:
service (str): Service name
instance (str): Instance name
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
FlinkJobs
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
)
kwargs['_return_http_data_only'] = kwargs.get(
'_return_http_data_only', True
)
kwargs['_preload_content'] = kwargs.get(
'_preload_content', True
)
kwargs['_request_timeout'] = kwargs.get(
'_request_timeout', None
)
kwargs['_check_input_type'] = kwargs.get(
'_check_input_type', True
)
kwargs['_check_return_type'] = kwargs.get(
'_check_return_type', True
)
kwargs['_host_index'] = kwargs.get('_host_index')
kwargs['service'] = \
service
kwargs['instance'] = \
instance
return self.call_with_http_info(**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, please pass async_req=True
>>> thread = api.list_flink_cluster_jobs(service, instance, async_req=True)
>>> result = thread.get()
Args:
service (str): Service name
instance (str): Instance name
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
FlinkJobs
If the method is called asynchronously, returns the request
thread.
| __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
>>> thread = api.list_instances(service, async_req=True)
>>> result = thread.get()
Args:
service (str): Service name
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
InlineResponse2001
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
)
kwargs['_return_http_data_only'] = kwargs.get(
'_return_http_data_only', True
)
kwargs['_preload_content'] = kwargs.get(
'_preload_content', True
)
kwargs['_request_timeout'] = kwargs.get(
'_request_timeout', None
)
kwargs['_check_input_type'] = kwargs.get(
'_check_input_type', True
)
kwargs['_check_return_type'] = kwargs.get(
'_check_return_type', True
)
kwargs['_host_index'] = kwargs.get('_host_index')
kwargs['service'] = \
service
return self.call_with_http_info(**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
>>> thread = api.list_instances(service, async_req=True)
>>> result = thread.get()
Args:
service (str): Service name
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
InlineResponse2001
If the method is called asynchronously, returns the request
thread.
| __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_req=True
>>> thread = api.list_services_for_cluster(async_req=True)
>>> result = thread.get()
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
InlineResponse200
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
)
kwargs['_return_http_data_only'] = kwargs.get(
'_return_http_data_only', True
)
kwargs['_preload_content'] = kwargs.get(
'_preload_content', True
)
kwargs['_request_timeout'] = kwargs.get(
'_request_timeout', None
)
kwargs['_check_input_type'] = kwargs.get(
'_check_input_type', True
)
kwargs['_check_return_type'] = kwargs.get(
'_check_return_type', True
)
kwargs['_host_index'] = kwargs.get('_host_index')
return self.call_with_http_info(**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_req=True
>>> thread = api.list_services_for_cluster(async_req=True)
>>> result = thread.get()
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
InlineResponse200
If the method is called asynchronously, returns the request
thread.
| __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 async_req=True
>>> thread = api.status_instance(service, instance, async_req=True)
>>> result = thread.get()
Args:
service (str): Service name
instance (str): Instance name
Keyword Args:
verbose (int): Include verbose status information. [optional]
include_envoy (bool): Include Envoy information. [optional]
include_mesos (bool): Include Mesos information. [optional]
new (bool): Use new version of paasta status for services. [optional]
all_namespaces (bool): Search all namespaces for running copies. [optional]
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
InstanceStatus
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
)
kwargs['_return_http_data_only'] = kwargs.get(
'_return_http_data_only', True
)
kwargs['_preload_content'] = kwargs.get(
'_preload_content', True
)
kwargs['_request_timeout'] = kwargs.get(
'_request_timeout', None
)
kwargs['_check_input_type'] = kwargs.get(
'_check_input_type', True
)
kwargs['_check_return_type'] = kwargs.get(
'_check_return_type', True
)
kwargs['_host_index'] = kwargs.get('_host_index')
kwargs['service'] = \
service
kwargs['instance'] = \
instance
return self.call_with_http_info(**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 async_req=True
>>> thread = api.status_instance(service, instance, async_req=True)
>>> result = thread.get()
Args:
service (str): Service name
instance (str): Instance name
Keyword Args:
verbose (int): Include verbose status information. [optional]
include_envoy (bool): Include Envoy information. [optional]
include_mesos (bool): Include Mesos information. [optional]
new (bool): Use new version of paasta status for services. [optional]
all_namespaces (bool): Search all namespaces for running copies. [optional]
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
InstanceStatus
If the method is called asynchronously, returns the request
thread.
| __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
asynchronous HTTP request, please pass async_req=True
>>> thread = api.task_instance(service, instance, task_id, async_req=True)
>>> result = thread.get()
Args:
service (str): Service name
instance (str): Instance name
task_id (str): mesos task id
Keyword Args:
verbose (bool): Return slave and executor for task. [optional]
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
{str: (bool, date, datetime, dict, float, int, list, str, none_type)}
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
)
kwargs['_return_http_data_only'] = kwargs.get(
'_return_http_data_only', True
)
kwargs['_preload_content'] = kwargs.get(
'_preload_content', True
)
kwargs['_request_timeout'] = kwargs.get(
'_request_timeout', None
)
kwargs['_check_input_type'] = kwargs.get(
'_check_input_type', True
)
kwargs['_check_return_type'] = kwargs.get(
'_check_return_type', True
)
kwargs['_host_index'] = kwargs.get('_host_index')
kwargs['service'] = \
service
kwargs['instance'] = \
instance
kwargs['task_id'] = \
task_id
return self.call_with_http_info(**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
asynchronous HTTP request, please pass async_req=True
>>> thread = api.task_instance(service, instance, task_id, async_req=True)
>>> result = thread.get()
Args:
service (str): Service name
instance (str): Instance name
task_id (str): mesos task id
Keyword Args:
verbose (bool): Return slave and executor for task. [optional]
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
{str: (bool, date, datetime, dict, float, int, list, str, none_type)}
If the method is called asynchronously, returns the request
thread.
| __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 pass async_req=True
>>> thread = api.tasks_instance(service, instance, async_req=True)
>>> result = thread.get()
Args:
service (str): Service name
instance (str): Instance name
Keyword Args:
slave_hostname (str): slave hostname to filter tasks by. [optional]
verbose (bool): Return slave and executor for task. [optional]
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
InstanceTasks
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
)
kwargs['_return_http_data_only'] = kwargs.get(
'_return_http_data_only', True
)
kwargs['_preload_content'] = kwargs.get(
'_preload_content', True
)
kwargs['_request_timeout'] = kwargs.get(
'_request_timeout', None
)
kwargs['_check_input_type'] = kwargs.get(
'_check_input_type', True
)
kwargs['_check_return_type'] = kwargs.get(
'_check_return_type', True
)
kwargs['_host_index'] = kwargs.get('_host_index')
kwargs['service'] = \
service
kwargs['instance'] = \
instance
return self.call_with_http_info(**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 pass async_req=True
>>> thread = api.tasks_instance(service, instance, async_req=True)
>>> result = thread.get()
Args:
service (str): Service name
instance (str): Instance name
Keyword Args:
slave_hostname (str): slave hostname to filter tasks by. [optional]
verbose (bool): Return slave and executor for task. [optional]
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
InstanceTasks
If the method is called asynchronously, returns the request
thread.
| __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.
"""
return {
'framework_id': (str,), # noqa: E501
'launch_time': (str,), # noqa: E501
'run_id': (str,), # noqa: E501
} |
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 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.
"""
return {
'calculated_instances': (int,), # noqa: E501
'desired_instances': (int,), # noqa: E501
'status': (str,), # noqa: E501
} |
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/autoscaler_count_msg.py | https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model/autoscaler_count_msg.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.
"""
return {
'min_instances': (int,), # noqa: E501
'expire_after': (float,), # noqa: E501
} |
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/autoscaling_override.py | https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model/autoscaling_override.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.
"""
lazy_import()
return {
'available_service_instances': ([DeployQueueServiceInstance],), # noqa: E501
'unavailable_service_instances': ([DeployQueueServiceInstance],), # noqa: E501
} |
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/deploy_queue.py | https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model/deploy_queue.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.
"""
return {
'bounce_by': (float,), # noqa: E501
'bounce_start_time': (float,), # noqa: E501
'enqueue_time': (float,), # noqa: E501
'failures': (int,), # noqa: E501
'instance': (str,), # noqa: E501
'processed_count': (int,), # noqa: E501
'service': (str,), # noqa: E501
'wait_until': (float,), # noqa: E501
'watcher': (str,), # noqa: E501
} |
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/deploy_queue_service_instance.py | https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model/deploy_queue_service_instance.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.
"""
return {
'address': (str,), # noqa: E501
'eds_health_status': (str,), # noqa: E501
'has_associated_task': (bool,), # noqa: E501
'hostname': (str,), # noqa: E501
'port_value': (int,), # noqa: E501
'weight': (int,), # noqa: E501
} |
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/envoy_backend.py | https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model/envoy_backend.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.
"""
lazy_import()
return {
'backends': ([EnvoyBackend],), # noqa: E501
'is_proxied_through_casper': (bool,), # noqa: E501
'name': (str,), # noqa: E501
'running_backends_count': (int,), # noqa: E501
} |
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/envoy_location.py | https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model/envoy_location.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.
"""
lazy_import()
return {
'expected_backends_per_location': (int,), # noqa: E501
'locations': ([EnvoyLocation],), # noqa: E501
'registration': (str,), # noqa: E501
} |
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/envoy_status.py | https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model/envoy_status.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.
"""
return {
'taskmanagers': (int,), # noqa: E501
'slots_total': (int,), # noqa: E501
'slots_available': (int,), # noqa: E501
'jobs_running': (int,), # noqa: E501
'jobs_finished': (int,), # noqa: E501
'jobs_cancelled': (int,), # noqa: E501
'jobs_failed': (int,), # noqa: E501
} |
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/flink_cluster_overview.py | https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model/flink_cluster_overview.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.
"""
return {
'flink_version': (str,), # noqa: E501
'flink_revision': (str,), # noqa: E501
} |
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/flink_config.py | https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model/flink_config.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.
"""
return {
'id': (str,), # noqa: E501
'status': (str,), # noqa: E501
} |
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/flink_job.py | https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model/flink_job.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.
"""
lazy_import()
return {
'jobs': ([FlinkJob],), # noqa: E501
} |
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/flink_jobs.py | https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model/flink_jobs.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.
"""
return {
'jid': (str,), # noqa: E501
'name': (str,), # noqa: E501
'state': (str,), # noqa: E501
'start_time': (float,), # noqa: E501
} |
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/flink_job_details.py | https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model/flink_job_details.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.
"""
return {
'error_message': (str,), # noqa: E501
'value': (float,), # noqa: E501
} |
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/float_and_error.py | https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model/float_and_error.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.
"""
return {
'current_value': (str,), # noqa: E501
'name': (str,), # noqa: E501
'target_value': (str,), # noqa: E501
} |
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/hpa_metric.py | https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model/hpa_metric.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.
"""
return {
'minutes': (int,), # noqa: E501
} |
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/inline_object.py | https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model/inline_object.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.
"""
return {
'services': ([[bool, date, datetime, dict, float, int, list, str, none_type]],), # noqa: E501
} |
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/inline_response200.py | https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model/inline_response200.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.
"""
return {
'instances': ([str],), # noqa: E501
} |
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/inline_response2001.py | https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model/inline_response2001.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.
"""
return {
'service': (str,), # noqa: E501
'instance': (str,), # noqa: E501
'min_instances': (int,), # noqa: E501
'expire_after': (float,), # noqa: E501
'status': (str,), # noqa: E501
} |
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/inline_response202.py | https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model/inline_response202.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.
"""
return {
'reason': (str,), # noqa: E501
} |
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/inline_response403.py | https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model/inline_response403.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.
"""
return {
'active_shas': ([[str, none_type]],), # noqa: E501
'active_versions': ([[str, none_type]],), # noqa: E501
'app_count': (int,), # noqa: E501
'deploy_status': (str,), # noqa: E501
'desired_state': (str,), # noqa: E501
'expected_instance_count': (int,), # noqa: E501
'running_instance_count': (int,), # noqa: E501
} |
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/instance_bounce_status.py | https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model/instance_bounce_status.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.
"""
lazy_import()
return {
'instance': (str,), # noqa: E501
'service': (str,), # noqa: E501
'smartstack': (SmartstackStatus,), # noqa: E501
'envoy': (EnvoyStatus,), # noqa: E501
} |
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/instance_mesh_status.py | https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model/instance_mesh_status.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.
"""
lazy_import()
return {
'adhoc': (InstanceStatusAdhoc,), # noqa: E501
'flink': (InstanceStatusFlink,), # noqa: E501
'flinkeks': (InstanceStatusFlink,), # noqa: E501
'git_sha': (str,), # noqa: E501
'version': (str,), # noqa: E501
'instance': (str,), # noqa: E501
'cassandracluster': (InstanceStatusCassandracluster,), # noqa: E501
'kafkacluster': (InstanceStatusKafkacluster,), # noqa: E501
'kubernetes': (InstanceStatusKubernetes,), # noqa: E501
'kubernetes_v2': (InstanceStatusKubernetesV2,), # noqa: E501
'service': (str,), # noqa: E501
'tron': (InstanceStatusTron,), # noqa: E501
} |
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/instance_status.py | https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model/instance_status.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.
"""
lazy_import()
return {
'value': ([AdhocLaunchHistory],),
} |
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/instance_status_adhoc.py | https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model/instance_status_adhoc.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.
"""
return {
'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501
'status': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501
} |
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/instance_status_cassandracluster.py | https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model/instance_status_cassandracluster.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.
"""
return {
'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501
'status': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501
} |
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/instance_status_flink.py | https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model/instance_status_flink.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.
"""
return {
'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501
'status': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501
} |
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/instance_status_kafkacluster.py | https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model/instance_status_kafkacluster.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.
"""
lazy_import()
return {
'app_count': (int,), # noqa: E501
'bounce_method': (str,), # noqa: E501
'desired_state': (str,), # noqa: E501
'active_shas': ([[str, none_type]],), # noqa: E501
'active_versions': ([[str, none_type]],), # noqa: E501
'app_id': (str,), # noqa: E501
'autoscaling_status': (InstanceStatusKubernetesAutoscalingStatus,), # noqa: E501
'backoff_seconds': (int,), # noqa: E501
'create_timestamp': (float,), # noqa: E501
'deploy_status': (str,), # noqa: E501
'deploy_status_message': (str,), # noqa: E501
'error_message': (str,), # noqa: E501
'expected_instance_count': (int,), # noqa: E501
'namespace': (str,), # noqa: E501
'pods': ([KubernetesPod],), # noqa: E501
'replicasets': ([KubernetesReplicaSet],), # noqa: E501
'running_instance_count': (int,), # noqa: E501
'smartstack': (SmartstackStatus,), # noqa: E501
'envoy': (EnvoyStatus,), # noqa: E501
'evicted_count': (int,), # noqa: E501
} |
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/instance_status_kubernetes.py | https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model/instance_status_kubernetes.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.
"""
lazy_import()
return {
'desired_replicas': (int,), # noqa: E501
'last_scale_time': (str,), # noqa: E501
'max_instances': (int,), # noqa: E501
'metrics': ([HPAMetric],), # noqa: E501
'min_instances': (int,), # noqa: E501
} |
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/instance_status_kubernetes_autoscaling_status.py | https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model/instance_status_kubernetes_autoscaling_status.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.
"""
lazy_import()
return {
'app_name': (str,), # noqa: E501
'autoscaling_status': (InstanceStatusKubernetesAutoscalingStatus,), # noqa: E501
'desired_state': (str,), # noqa: E501
'desired_instances': (int,), # noqa: E501
'error_message': (str,), # noqa: E501
'versions': ([KubernetesVersion],), # noqa: E501
'envoy': (EnvoyStatus,), # noqa: E501
} |
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/instance_status_kubernetes_v2.py | https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model/instance_status_kubernetes_v2.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.
"""
return {
'job_name': (str,), # noqa: E501
'job_url': (str,), # noqa: E501
'action_command': (str,), # noqa: E501
'action_name': (str,), # noqa: E501
'action_raw_command': (str,), # noqa: E501
'action_start_time': (str,), # noqa: E501
'action_state': (str,), # noqa: E501
'action_stderr': (str,), # noqa: E501
'action_stdout': (str,), # noqa: E501
'job_schedule': (str,), # noqa: E501
'job_status': (str,), # noqa: E501
} |
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/instance_status_tron.py | https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model/instance_status_tron.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.
"""
return {
'value': ([object],),
} |
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/instance_tasks.py | https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model/instance_tasks.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.
"""
return {
'error_message': (str,), # noqa: E501
'value': (int,), # noqa: E501
} |
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/integer_and_error.py | https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model/integer_and_error.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.
"""
lazy_import()
return {
'name': (str,), # noqa: E501
'tail_lines': (TaskTailLines,), # noqa: E501
} |
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/kubernetes_container.py | https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model/kubernetes_container.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.
"""
lazy_import()
return {
'name': (str,), # noqa: E501
'state': (str,), # noqa: E501
'last_state': (str, none_type,), # noqa: E501
'restart_count': (int, none_type,), # noqa: E501
'reason': (str, none_type,), # noqa: E501
'message': (str, none_type,), # noqa: E501
'last_reason': (str, none_type,), # noqa: E501
'last_message': (str, none_type,), # noqa: E501
'last_duration': (float, none_type,), # noqa: E501
'last_timestamp': (float, none_type,), # noqa: E501
'previous_tail_lines': (TaskTailLines,), # noqa: E501
'timestamp': (float, none_type,), # noqa: E501
'healthcheck_grace_period': (int,), # noqa: E501
'healthcheck_cmd': (KubernetesHealthcheck,), # noqa: E501
'tail_lines': (TaskTailLines,), # noqa: E501
} |
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/kubernetes_container_v2.py | https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model/kubernetes_container_v2.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.
"""
return {
'http_url': (str, none_type,), # noqa: E501
'tcp_port': (str, none_type,), # noqa: E501
'cmd': (str, none_type,), # noqa: E501
} |
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/kubernetes_healthcheck.py | https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model/kubernetes_healthcheck.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.
"""
lazy_import()
return {
'containers': ([KubernetesContainer],), # noqa: E501
'deployed_timestamp': (float,), # noqa: E501
'host': (str, none_type,), # noqa: E501
'message': (str, none_type,), # noqa: E501
'name': (str,), # noqa: E501
'phase': (str, none_type,), # noqa: E501
'ready': (bool,), # noqa: E501
'reason': (str, none_type,), # noqa: E501
'events': ([KubernetesPodEvent],), # noqa: E501
} |
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/kubernetes_pod.py | https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model/kubernetes_pod.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.
"""
return {
'message': (str,), # noqa: E501
'time_stamp': (str,), # noqa: E501
'error': (str, none_type,), # noqa: E501
} |
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/kubernetes_pod_event.py | https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model/kubernetes_pod_event.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.
"""
lazy_import()
return {
'name': (str,), # noqa: E501
'ip': (str, none_type,), # noqa: E501
'host': (str, none_type,), # noqa: E501
'create_timestamp': (float,), # noqa: E501
'delete_timestamp': (float, none_type,), # noqa: E501
'phase': (str,), # noqa: E501
'ready': (bool,), # noqa: E501
'mesh_ready': (bool, none_type,), # noqa: E501
'scheduled': (bool,), # noqa: E501
'reason': (str, none_type,), # noqa: E501
'message': (str, none_type,), # noqa: E501
'events': ([KubernetesPodEvent],), # noqa: E501
'containers': ([KubernetesContainerV2],), # noqa: E501
} |
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/kubernetes_pod_v2.py | https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model/kubernetes_pod_v2.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.
"""
return {
'create_timestamp': (float,), # noqa: E501
'name': (str,), # noqa: E501
'ready_replicas': (int,), # noqa: E501
'replicas': (int,), # noqa: E501
'git_sha': (str, none_type,), # noqa: E501
'config_sha': (str, none_type,), # noqa: E501
} |
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/kubernetes_replica_set.py | https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model/kubernetes_replica_set.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.
"""
lazy_import()
return {
'type': (str,), # noqa: E501
'create_timestamp': (float,), # noqa: E501
'git_sha': (str,), # noqa: E501
'image_version': (str, none_type,), # noqa: E501
'config_sha': (str,), # noqa: E501
'name': (str,), # noqa: E501
'pods': ([KubernetesPodV2],), # noqa: E501
'replicas': (int,), # noqa: E501
'ready_replicas': (int,), # noqa: E501
'namespace': (str,), # noqa: E501
} |
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/kubernetes_version.py | https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model/kubernetes_version.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.
"""
return {
'status': (int,), # noqa: E501
'message': (str,), # noqa: E501
'pod_name': (str,), # noqa: E501
'pod_address': (str,), # noqa: E501
'job_name': (str,), # noqa: E501
'namespace': (str,), # noqa: E501
} |
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/remote_run_outcome.py | https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model/remote_run_outcome.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.
"""
return {
'user': (str,), # noqa: E501
'interactive': (bool,), # noqa: E501
'recreate': (bool,), # noqa: E501
'max_duration': (int,), # noqa: E501
'toolbox': (bool,), # noqa: E501
} |
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/remote_run_start.py | https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model/remote_run_start.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.
"""
return {
'user': (str,), # noqa: E501
'toolbox': (bool,), # noqa: E501
} |
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/remote_run_stop.py | https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model/remote_run_stop.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.
"""
return {
'token': (str,), # noqa: E501
} |
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/remote_run_token.py | https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model/remote_run_token.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.
"""
lazy_import()
return {
'value': ([ResourceItem],),
} |
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/resource.py | https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model/resource.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.
"""
lazy_import()
return {
'cpus': (ResourceValue,), # noqa: E501
'disk': (ResourceValue,), # noqa: E501
'groupings': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501
'mem': (ResourceValue,), # noqa: E501
'gpus': (ResourceValue,), # noqa: E501
} |
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/resource_item.py | https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model/resource_item.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.
"""
return {
'free': (float,), # noqa: E501
'total': (float,), # noqa: E501
'used': (float,), # noqa: E501
} |
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/resource_value.py | https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model/resource_value.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.
"""
return {
'check_code': (str,), # noqa: E501
'check_duration': (int,), # noqa: E501
'check_status': (str,), # noqa: E501
'has_associated_task': (bool,), # noqa: E501
'hostname': (str,), # noqa: E501
'last_change': (int,), # noqa: E501
'port': (int,), # noqa: E501
'status': (str,), # noqa: E501
} |
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/smartstack_backend.py | https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model/smartstack_backend.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.
"""
lazy_import()
return {
'backends': ([SmartstackBackend],), # noqa: E501
'name': (str,), # noqa: E501
'running_backends_count': (int,), # noqa: E501
} |
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/smartstack_location.py | https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model/smartstack_location.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.
"""
lazy_import()
return {
'expected_backends_per_location': (int,), # noqa: E501
'locations': ([SmartstackLocation],), # noqa: E501
'registration': (str,), # noqa: E501
} |
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/smartstack_status.py | https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model/smartstack_status.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.
"""
return {
'error_message': (str,), # noqa: E501
'stderr': ([str],), # noqa: E501
'stdout': ([str],), # noqa: E501
} |
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/task_tail_lines.py | https://github.com/Yelp/paasta/blob/master/paasta_tools/paastaapi/model/task_tail_lines.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.secrets.kv.read_secret_metadata(
path=key_name, mount_point="keystore"
)
for key_version in meta_response["data"]["versions"].keys():
key_response = client.secrets.kv.read_secret_version(
path=key_name, version=key_version, mount_point="keystore"
)
crypto_keys.append(
{
"key_name": key_name,
"key_version": key_response["data"]["metadata"]["version"],
"key": key_response["data"]["data"]["key"],
}
)
except hvac.exceptions.VaultError:
log.warning(
f"Could not fetch key versions for {key_name} on {self.ecosystems[0]}"
)
pass
return crypto_keys |
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 config matches the new config.
"""
current_config = self._get("/api/config", {"name": namespace, "no_header": 1})
if skip_if_unchanged:
if yaml.safe_load(new_config) == yaml.safe_load(current_config["config"]):
log.debug("No change in config, skipping update.")
return
return self._post(
"/api/config",
data={
"name": namespace,
"config": new_config,
"hash": current_config["hash"],
"check": 0,
},
) | 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 update_namespaces(
self, new_configs: Dict[str, str], skip_if_unchanged: bool = 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 config matches the new config.
"""
current_configs: Dict[str, Dict[str, str]] = self._get("/api/config") # type: ignore # we don't have a good way to share types between tron/paasta
responses: Dict[str, str] = {}
for namespace, new_config in new_configs.items():
current_config = current_configs.get(namespace, {})
if skip_if_unchanged:
if yaml.safe_load(new_config) == yaml.safe_load(
current_config["config"]
):
log.debug("No change in config, skipping update.")
continue
responses[namespace] = self._post(
"/api/config",
data={
"name": namespace,
"config": new_config,
"hash": current_config["hash"],
"check": 0,
},
)
return responses | 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_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 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, next):
return CommandContext(next(filler), current)
return functools.reduce(build, context_objects, None) | 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 "SUCCESS"
return "UNKNOWN" | 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.