Fix API v2.20 formatting

This commit is contained in:
allegroai
2022-09-13 15:08:57 +03:00
parent 0b66b11d53
commit a59f46a485
9 changed files with 1303 additions and 1195 deletions

View File

@@ -106,7 +106,10 @@ class CredentialKey(NonStrictDataModel):
_schema = {
"properties": {
"access_key": {"description": "", "type": ["string", "null"]},
"access_key": {
"description": "Credentials access key",
"type": ["string", "null"]
},
"label": {
"description": "Optional credentials label",
"type": ["string", "null"],
@@ -121,9 +124,7 @@ class CredentialKey(NonStrictDataModel):
"type": "object",
}
def __init__(
self, access_key=None, label=None, last_used=None, last_used_from=None, **kwargs
):
def __init__(self, access_key=None, label=None, last_used=None, last_used_from=None, **kwargs):
super(CredentialKey, self).__init__(**kwargs)
self.access_key = access_key
self.label = label
@@ -247,15 +248,15 @@ class CreateCredentialsResponse(Response):
"credentials": {
"properties": {
"access_key": {
"description": "Credentials " "access " "key",
"description": "Credentials access key",
"type": ["string", "null"],
},
"label": {
"description": "Optional " "credentials " "label",
"description": "Optional credentials label",
"type": ["string", "null"],
},
"secret_key": {
"description": "Credentials " "secret " "key",
"description": "Credentials secret key",
"type": ["string", "null"],
},
},
@@ -548,9 +549,12 @@ class GetCredentialsResponse(Response):
"definitions": {
"credential_key": {
"properties": {
"access_key": {"description": "", "type": ["string", "null"]},
"access_key": {
"description": "Credentials access key",
"type": ["string", "null"]
},
"label": {
"description": "Optional " "credentials " "label",
"description": "Optional credentials label",
"type": ["string", "null"],
},
"last_used": {
@@ -595,9 +599,7 @@ class GetCredentialsResponse(Response):
self.assert_isinstance(value, "credentials", (list, tuple))
if any(isinstance(v, dict) for v in value):
value = [
CredentialKey.from_dict(v) if isinstance(v, dict) else v for v in value
]
value = [CredentialKey.from_dict(v) if isinstance(v, dict) else v for v in value]
else:
self.assert_isinstance(value, "credentials", CredentialKey, is_array=True)
self._property_credentials = value
@@ -634,8 +636,9 @@ class LoginRequest(Request):
"definitions": {},
"properties": {
"expiration_sec": {
"description": "Requested token expiration time in seconds. Not guaranteed, "
"might be overridden by the service",
"description": (
"Requested token expiration time in seconds. Not guaranteed, might be overridden by the service"
),
"type": ["integer", "null"],
}
},
@@ -676,9 +679,7 @@ class LoginResponse(Response):
_schema = {
"definitions": {},
"properties": {
"token": {"description": "Token string", "type": ["string", "null"]}
},
"properties": {"token": {"description": "Token string", "type": ["string", "null"]}},
"type": "object",
}
@@ -714,9 +715,7 @@ class RevokeCredentialsRequest(Request):
_version = "2.20"
_schema = {
"definitions": {},
"properties": {
"access_key": {"description": "Credentials key", "type": ["string", "null"]}
},
"properties": {"access_key": {"description": "Credentials key", "type": ["string", "null"]}},
"required": ["key_id"],
"type": "object",
}

View File

@@ -76,16 +76,7 @@ class MetricsScalarEvent(NonStrictDataModel):
"type": "object",
}
def __init__(
self,
task,
timestamp=None,
iter=None,
metric=None,
variant=None,
value=None,
**kwargs
):
def __init__(self, task, timestamp=None, iter=None, metric=None, variant=None, value=None, **kwargs):
super(MetricsScalarEvent, self).__init__(**kwargs)
self.timestamp = timestamp
self.task = task
@@ -228,16 +219,7 @@ class MetricsVectorEvent(NonStrictDataModel):
"type": "object",
}
def __init__(
self,
task,
timestamp=None,
iter=None,
metric=None,
variant=None,
values=None,
**kwargs
):
def __init__(self, task, timestamp=None, iter=None, metric=None, variant=None, values=None, **kwargs):
super(MetricsVectorEvent, self).__init__(**kwargs)
self.timestamp = timestamp
self.task = task
@@ -329,9 +311,7 @@ class MetricsVectorEvent(NonStrictDataModel):
self.assert_isinstance(value, "values", (list, tuple))
self.assert_isinstance(
value, "values", six.integer_types + (float,), is_array=True
)
self.assert_isinstance(value, "values", six.integer_types + (float,), is_array=True)
self._property_values = value
@@ -380,17 +360,7 @@ class MetricsImageEvent(NonStrictDataModel):
"type": "object",
}
def __init__(
self,
task,
timestamp=None,
iter=None,
metric=None,
variant=None,
key=None,
url=None,
**kwargs
):
def __init__(self, task, timestamp=None, iter=None, metric=None, variant=None, key=None, url=None, **kwargs):
super(MetricsImageEvent, self).__init__(**kwargs)
self.timestamp = timestamp
self.task = task
@@ -501,7 +471,7 @@ class MetricsImageEvent(NonStrictDataModel):
class MetricsPlotEvent(NonStrictDataModel):
"""
An entire plot (not single datapoint) and it's layout.
Used for plotting ROC curves, confidence matrices, etc. when evaluating the net.
Used for plotting ROC curves, confidence matrices, etc. when evaluating the net.
:param timestamp: Epoch milliseconds UTC, will be set by the server if not set.
:type timestamp: float
@@ -522,8 +492,10 @@ class MetricsPlotEvent(NonStrictDataModel):
"""
_schema = {
"description": " An entire plot (not single datapoint) and it's layout. "
" Used for plotting ROC curves, confidence matrices, etc. when evaluating the net.",
"description": (
" An entire plot (not single datapoint) and it's layout. "
" Used for plotting ROC curves, confidence matrices, etc. when evaluating the net."
),
"properties": {
"iter": {"description": "Iteration", "type": "integer"},
"metric": {
@@ -531,8 +503,10 @@ class MetricsPlotEvent(NonStrictDataModel):
"type": "string",
},
"plot_str": {
"description": "An entire plot (not single datapoint) and it's layout."
" Used for plotting ROC curves, confidence matrices, etc. when evaluating the net.",
"description": (
"An entire plot (not single datapoint) and it's layout."
" Used for plotting ROC curves, confidence matrices, etc. when evaluating the net."
),
"type": "string",
},
"skip_validation": {
@@ -555,15 +529,7 @@ class MetricsPlotEvent(NonStrictDataModel):
}
def __init__(
self,
task,
timestamp=None,
iter=None,
metric=None,
variant=None,
plot_str=None,
skip_validation=None,
**kwargs
self, task, timestamp=None, iter=None, metric=None, variant=None, plot_str=None, skip_validation=None, **kwargs
):
super(MetricsPlotEvent, self).__init__(**kwargs)
self.timestamp = timestamp
@@ -809,9 +775,7 @@ class TaskLogEvent(NonStrictDataModel):
"type": "object",
}
def __init__(
self, task, timestamp=None, level=None, worker=None, msg=None, **kwargs
):
def __init__(self, task, timestamp=None, level=None, worker=None, msg=None, **kwargs):
super(TaskLogEvent, self).__init__(**kwargs)
self.timestamp = timestamp
self.task = task
@@ -909,13 +873,13 @@ class DebugImagesResponseTaskMetrics(NonStrictDataModel):
"properties": {
"events": {
"items": {
"description": "Debug " "image " "event",
"description": "Debug image event",
"type": "object",
},
"type": "array",
},
"iter": {
"description": "Iteration " "number",
"description": "Iteration number",
"type": "integer",
},
},
@@ -976,12 +940,12 @@ class DebugImagesResponse(Response):
_schema = {
"properties": {
"metrics": {
"description": "Debug image events grouped by " "tasks and iterations",
"description": "Debug image events grouped by tasks and iterations",
"items": {"$ref": "#/definitions/debug_images_response_task_metrics"},
"type": ["array", "null"],
},
"scroll_id": {
"description": "Scroll ID for getting more " "results",
"description": "Scroll ID for getting more results",
"type": ["string", "null"],
},
},
@@ -1018,16 +982,9 @@ class DebugImagesResponse(Response):
self.assert_isinstance(value, "metrics", (list, tuple))
if any(isinstance(v, dict) for v in value):
value = [
DebugImagesResponseTaskMetrics.from_dict(v)
if isinstance(v, dict)
else v
for v in value
]
value = [DebugImagesResponseTaskMetrics.from_dict(v) if isinstance(v, dict) else v for v in value]
else:
self.assert_isinstance(
value, "metrics", DebugImagesResponseTaskMetrics, is_array=True
)
self.assert_isinstance(value, "metrics", DebugImagesResponseTaskMetrics, is_array=True)
self._property_metrics = value
@@ -1045,11 +1002,11 @@ class PlotsResponseTaskMetrics(NonStrictDataModel):
"items": {
"properties": {
"events": {
"items": {"description": "Plot " "event", "type": "object"},
"items": {"description": "Plot event", "type": "object"},
"type": "array",
},
"iter": {
"description": "Iteration " "number",
"description": "Iteration number",
"type": "integer",
},
},
@@ -1110,12 +1067,12 @@ class PlotsResponse(Response):
_schema = {
"properties": {
"metrics": {
"description": "Plot events grouped by tasks and " "iterations",
"description": "Plot events grouped by tasks and iterations",
"items": {"$ref": "#/definitions/plots_response_task_metrics"},
"type": ["array", "null"],
},
"scroll_id": {
"description": "Scroll ID for getting more " "results",
"description": "Scroll ID for getting more results",
"type": ["string", "null"],
},
},
@@ -1152,14 +1109,9 @@ class PlotsResponse(Response):
self.assert_isinstance(value, "metrics", (list, tuple))
if any(isinstance(v, dict) for v in value):
value = [
PlotsResponseTaskMetrics.from_dict(v) if isinstance(v, dict) else v
for v in value
]
value = [PlotsResponseTaskMetrics.from_dict(v) if isinstance(v, dict) else v for v in value]
else:
self.assert_isinstance(
value, "metrics", PlotsResponseTaskMetrics, is_array=True
)
self.assert_isinstance(value, "metrics", PlotsResponseTaskMetrics, is_array=True)
self._property_metrics = value
@@ -1180,31 +1132,24 @@ class DebugImageSampleResponse(NonStrictDataModel):
"properties": {
"event": {"description": "Debug image event", "type": ["object", "null"]},
"max_iteration": {
"description": "maximal valid iteration for " "the variant",
"description": "maximal valid iteration for the variant",
"type": ["integer", "null"],
},
"min_iteration": {
"description": "minimal valid iteration for " "the variant",
"description": "minimal valid iteration for the variant",
"type": ["integer", "null"],
},
"scroll_id": {
"description": "Scroll ID to pass to the next "
"calls to get_debug_image_sample "
"or next_debug_image_sample",
"description": (
"Scroll ID to pass to the next calls to get_debug_image_sample or next_debug_image_sample"
),
"type": ["string", "null"],
},
},
"type": "object",
}
def __init__(
self,
scroll_id=None,
event=None,
min_iteration=None,
max_iteration=None,
**kwargs
):
def __init__(self, scroll_id=None, event=None, min_iteration=None, max_iteration=None, **kwargs):
super(DebugImageSampleResponse, self).__init__(**kwargs)
self.scroll_id = scroll_id
self.event = event
@@ -1285,31 +1230,22 @@ class PlotSampleResponse(NonStrictDataModel):
"properties": {
"event": {"description": "Plot event", "type": ["object", "null"]},
"max_iteration": {
"description": "maximal valid iteration for " "the variant",
"description": "maximal valid iteration for the variant",
"type": ["integer", "null"],
},
"min_iteration": {
"description": "minimal valid iteration for " "the variant",
"description": "minimal valid iteration for the variant",
"type": ["integer", "null"],
},
"scroll_id": {
"description": "Scroll ID to pass to the next "
"calls to get_plot_sample or "
"next_plot_sample",
"description": "Scroll ID to pass to the next calls to get_plot_sample or next_plot_sample",
"type": ["string", "null"],
},
},
"type": "object",
}
def __init__(
self,
scroll_id=None,
event=None,
min_iteration=None,
max_iteration=None,
**kwargs
):
def __init__(self, scroll_id=None, event=None, min_iteration=None, max_iteration=None, **kwargs):
super(PlotSampleResponse, self).__init__(**kwargs)
self.scroll_id = scroll_id
self.event = event
@@ -1434,8 +1370,10 @@ class AddRequest(CompoundRequest):
"type": "object",
},
"metrics_plot_event": {
"description": " An entire plot (not single datapoint) and it's layout. "
"Used for plotting ROC curves, confidence matrices, etc. when evaluating the net.",
"description": (
" An entire plot (not single datapoint) and it's layout. "
"Used for plotting ROC curves, confidence matrices, etc. when evaluating the net."
),
"properties": {
"iter": {"description": "Iteration", "type": "integer"},
"metric": {
@@ -1443,9 +1381,11 @@ class AddRequest(CompoundRequest):
"type": "string",
},
"plot_str": {
"description": "An entire plot (not single datapoint) and it's layout. "
"Used for plotting ROC curves, confidence matrices, etc. "
"when evaluating the net.",
"description": (
"An entire plot (not single datapoint) and it's layout. "
"Used for plotting ROC curves, confidence matrices, etc. "
"when evaluating the net."
),
"type": "string",
},
"skip_validation": {
@@ -1766,9 +1706,11 @@ class ClearTaskLogRequest(Request):
},
"task": {"description": "Task ID", "type": "string"},
"threshold_sec": {
"description": "The amount of seconds ago to retain the log records. "
"The older log records will be deleted. If not passed or 0 "
"then all the log records for the task will be deleted",
"description": (
"The amount of seconds ago to retain the log records. "
"The older log records will be deleted. If not passed or 0 "
"then all the log records for the task will be deleted"
),
"type": "integer",
},
},
@@ -1893,8 +1835,8 @@ class DebugImagesRequest(Request):
"definitions": {
"task_metric_variants": {
"properties": {
"metric": {"description": "Metric " "name", "type": "string"},
"task": {"description": "Task " "ID", "type": "string"},
"metric": {"description": "Metric name", "type": "string"},
"task": {"description": "Task ID", "type": "string"},
"variants": {
"description": "Metric variant names",
"items": {"type": "string"},
@@ -1916,14 +1858,15 @@ class DebugImagesRequest(Request):
"type": "array",
},
"navigate_earlier": {
"description": "If set then events are retreived from latest "
"iterations to earliest ones. Otherwise from "
"earliest iterations to the latest. The default is True",
"description": (
"If set then events are retreived from latest "
"iterations to earliest ones. Otherwise from "
"earliest iterations to the latest. The default is True"
),
"type": "boolean",
},
"refresh": {
"description": "If set then scroll will be moved to the latest iterations. "
"The default is False",
"description": "If set then scroll will be moved to the latest iterations. The default is False",
"type": "boolean",
},
"scroll_id": {
@@ -1935,15 +1878,7 @@ class DebugImagesRequest(Request):
"type": "object",
}
def __init__(
self,
metrics,
iters=None,
navigate_earlier=None,
refresh=None,
scroll_id=None,
**kwargs
):
def __init__(self, metrics, iters=None, navigate_earlier=None, refresh=None, scroll_id=None, **kwargs):
super(DebugImagesRequest, self).__init__(**kwargs)
self.metrics = metrics
self.iters = iters
@@ -1963,10 +1898,7 @@ class DebugImagesRequest(Request):
self.assert_isinstance(value, "metrics", (list, tuple))
if any(isinstance(v, dict) for v in value):
value = [
TaskMetricVariants.from_dict(v) if isinstance(v, dict) else v
for v in value
]
value = [TaskMetricVariants.from_dict(v) if isinstance(v, dict) else v for v in value]
else:
self.assert_isinstance(value, "metrics", TaskMetricVariants, is_array=True)
self._property_metrics = value
@@ -2160,13 +2092,7 @@ class DownloadTaskLogRequest(Request):
"type": "object",
}
def __init__(
self,
task,
line_type=None,
line_format="{asctime} {worker} {level} {msg}",
**kwargs
):
def __init__(self, task, line_type=None, line_format="{asctime} {worker} {level} {msg}", **kwargs):
super(DownloadTaskLogRequest, self).__init__(**kwargs)
self.task = task
self.line_type = line_type
@@ -2257,26 +2183,30 @@ class GetDebugImageSampleRequest(Request):
"definitions": {},
"properties": {
"iteration": {
"description": "The iteration to bring debug image from. If not specified "
"then the latest reported image is retrieved",
"description": (
"The iteration to bring debug image from. If not specified "
"then the latest reported image is retrieved"
),
"type": "integer",
},
"metric": {"description": "Metric name", "type": "string"},
"navigate_current_metric": {
"default": True,
"description": "If set then subsequent navigation with "
"next_debug_image_sample is done on the debug images for "
"the passed metric only. Otherwise for all the metrics",
"description": (
"If set then subsequent navigation with "
"next_debug_image_sample is done on the debug images for "
"the passed metric only. Otherwise for all the metrics"
),
"type": "boolean",
},
"refresh": {
"description": "If set then scroll state will be "
"refreshed to reflect the latest changes in the debug images",
"description": (
"If set then scroll state will be refreshed to reflect the latest changes in the debug images"
),
"type": "boolean",
},
"scroll_id": {
"description": "Scroll ID from the previous call "
"to get_debug_image_sample or empty",
"description": "Scroll ID from the previous call to get_debug_image_sample or empty",
"type": "string",
},
"task": {"description": "Task ID", "type": "string"},
@@ -2416,7 +2346,7 @@ class GetDebugImageSampleResponse(Response):
"debug_image_sample_response": {
"properties": {
"event": {
"description": "Debug " "image " "event",
"description": "Debug image event",
"type": ["object", "null"],
},
"max_iteration": {
@@ -2428,8 +2358,9 @@ class GetDebugImageSampleResponse(Response):
"type": ["integer", "null"],
},
"scroll_id": {
"description": "Scroll ID to pass to the next calls to get_debug_image_sample "
"or next_debug_image_sample",
"description": (
"Scroll ID to pass to the next calls to get_debug_image_sample or next_debug_image_sample"
),
"type": ["string", "null"],
},
},
@@ -2680,20 +2611,22 @@ class GetPlotSampleRequest(Request):
"definitions": {},
"properties": {
"iteration": {
"description": "The iteration to bring plot from. If not specified then the "
"latest reported plot is retrieved",
"description": (
"The iteration to bring plot from. If not specified then the latest reported plot is retrieved"
),
"type": "integer",
},
"metric": {"description": "Metric name", "type": "string"},
"navigate_current_metric": {
"default": True,
"description": "If set then subsequent navigation with next_plot_sample is done on the "
"plots for the passed metric only. Otherwise for all the metrics",
"description": (
"If set then subsequent navigation with next_plot_sample is done on the "
"plots for the passed metric only. Otherwise for all the metrics"
),
"type": "boolean",
},
"refresh": {
"description": "If set then scroll state will be refreshed to reflect the latest "
"changes in the plots",
"description": "If set then scroll state will be refreshed to reflect the latest changes in the plots",
"type": "boolean",
},
"scroll_id": {
@@ -2849,8 +2782,7 @@ class GetPlotSampleResponse(Response):
"type": ["integer", "null"],
},
"scroll_id": {
"description": "Scroll ID to pass to the next calls to get_plot_sample "
"or next_plot_sample",
"description": "Scroll ID to pass to the next calls to get_plot_sample or next_plot_sample",
"type": ["string", "null"],
},
},
@@ -2977,9 +2909,7 @@ class GetScalarMetricDataResponse(Response):
"type": "object",
}
def __init__(
self, events=None, returned=None, total=None, scroll_id=None, **kwargs
):
def __init__(self, events=None, returned=None, total=None, scroll_id=None, **kwargs):
super(GetScalarMetricDataResponse, self).__init__(**kwargs)
self.events = events
self.returned = returned
@@ -3095,9 +3025,7 @@ class GetScalarMetricsAndVariantsResponse(Response):
_schema = {
"definitions": {},
"properties": {
"metrics": {"additionalProperties": True, "type": ["object", "null"]}
},
"properties": {"metrics": {"additionalProperties": True, "type": ["object", "null"]}},
"type": "object",
}
@@ -3164,15 +3092,7 @@ class GetTaskEventsRequest(Request):
"type": "object",
}
def __init__(
self,
task,
order=None,
scroll_id=None,
batch_size=None,
event_type=None,
**kwargs
):
def __init__(self, task, order=None, scroll_id=None, batch_size=None, event_type=None, **kwargs):
super(GetTaskEventsRequest, self).__init__(**kwargs)
self.task = task
self.order = order
@@ -3290,9 +3210,7 @@ class GetTaskEventsResponse(Response):
"type": "object",
}
def __init__(
self, events=None, returned=None, total=None, scroll_id=None, **kwargs
):
def __init__(self, events=None, returned=None, total=None, scroll_id=None, **kwargs):
super(GetTaskEventsResponse, self).__init__(**kwargs)
self.events = events
self.returned = returned
@@ -3494,22 +3412,28 @@ class GetTaskLogRequest(Request):
"type": "integer",
},
"from_timestamp": {
"description": "Epoch time in UTC ms to use as the navigation start. Optional. If not provided, "
"reference timestamp is determined by the 'navigate_earlier' parameter (if true, "
"reference timestamp is the last timestamp and if false, reference timestamp "
"is the first timestamp)",
"description": (
"Epoch time in UTC ms to use as the navigation start. Optional. If not provided, "
"reference timestamp is determined by the 'navigate_earlier' parameter (if true, "
"reference timestamp is the last timestamp and if false, reference timestamp "
"is the first timestamp)"
),
"type": "number",
},
"navigate_earlier": {
"description": "If set then log events are retreived from the latest to the earliest ones "
"(in timestamp descending order, unless order='asc'). Otherwise from the earliest to "
"the latest ones (in timestamp ascending order, unless order='desc'). "
"The default is True",
"description": (
"If set then log events are retreived from the latest to the earliest ones "
"(in timestamp descending order, unless order='asc'). Otherwise from the earliest to "
"the latest ones (in timestamp ascending order, unless order='desc'). "
"The default is True"
),
"type": "boolean",
},
"order": {
"description": "If set, changes the order in which log events are returned based on the value "
"of 'navigate_earlier'",
"description": (
"If set, changes the order in which log events are returned based on the value "
"of 'navigate_earlier'"
),
"enum": ["asc", "desc"],
"type": "string",
},
@@ -3519,15 +3443,7 @@ class GetTaskLogRequest(Request):
"type": "object",
}
def __init__(
self,
task,
batch_size=None,
navigate_earlier=None,
from_timestamp=None,
order=None,
**kwargs
):
def __init__(self, task, batch_size=None, navigate_earlier=None, from_timestamp=None, order=None, **kwargs):
super(GetTaskLogRequest, self).__init__(**kwargs)
self.task = task
self.batch_size = batch_size
@@ -3869,9 +3785,7 @@ class GetTaskPlotsRequest(Request):
"type": "object",
}
def __init__(
self, task, iters=None, scroll_id=None, metrics=None, no_scroll=False, **kwargs
):
def __init__(self, task, iters=None, scroll_id=None, metrics=None, no_scroll=False, **kwargs):
super(GetTaskPlotsRequest, self).__init__(**kwargs)
self.task = task
self.iters = iters
@@ -3932,9 +3846,7 @@ class GetTaskPlotsRequest(Request):
self.assert_isinstance(value, "metrics", (list, tuple))
if any(isinstance(v, dict) for v in value):
value = [
MetricVariants.from_dict(v) if isinstance(v, dict) else v for v in value
]
value = [MetricVariants.from_dict(v) if isinstance(v, dict) else v for v in value]
else:
self.assert_isinstance(value, "metrics", MetricVariants, is_array=True)
self._property_metrics = value
@@ -4270,7 +4182,11 @@ class MultiTaskScalarMetricsIterHistogramRequest(Request):
"properties": {
"key": {
"$ref": "#/definitions/scalar_key_enum",
"description": "\n Histogram x axis to use:\n iter - iteration number\n iso_time - event time as ISO formatted string\n timestamp - event timestamp as milliseconds since epoch\n ",
"description": (
"\n Histogram x axis to use:\n iter - iteration"
" number\n iso_time - event time as ISO formatted string\n "
" timestamp - event timestamp as milliseconds since epoch\n "
),
},
"samples": {
"description": "The amount of histogram points to return. Optional, the default value is 6000",
@@ -4376,9 +4292,11 @@ class NextDebugImageSampleRequest(Request):
"definitions": {},
"properties": {
"navigate_earlier": {
"description": "If set then get the either previous variant event from the current "
"iteration or (if does not exist) the last variant event from the previous iteration. "
"Otherwise next variant event from the current iteration or first variant event from the next iteration",
"description": (
"If set then get the either previous variant event from the current iteration or (if does not"
" exist) the last variant event from the previous iteration. Otherwise next variant event from the"
" current iteration or first variant event from the next iteration"
),
"type": "boolean",
},
"scroll_id": {
@@ -4465,7 +4383,9 @@ class NextDebugImageSampleResponse(Response):
"type": ["integer", "null"],
},
"scroll_id": {
"description": "Scroll ID to pass to the next calls to get_debug_image_sample or next_debug_image_sample",
"description": (
"Scroll ID to pass to the next calls to get_debug_image_sample or next_debug_image_sample"
),
"type": ["string", "null"],
},
},
@@ -4497,10 +4417,12 @@ class NextPlotSampleRequest(Request):
"definitions": {},
"properties": {
"navigate_earlier": {
"description": "If set then get the either previous variant event from the current "
"iteration or (if does not exist) the last variant event from the previous iteration. "
"Otherwise next variant event from the current iteration or first variant event from the "
"next iteration",
"description": (
"If set then get the either previous variant event from the current "
"iteration or (if does not exist) the last variant event from the previous iteration. "
"Otherwise next variant event from the current iteration or first variant event from the "
"next iteration"
),
"type": "boolean",
},
"scroll_id": {
@@ -4646,8 +4568,10 @@ class PlotsRequest(Request):
"type": "array",
},
"navigate_earlier": {
"description": "If set then events are retreived from latest iterations to earliest ones. "
"Otherwise from earliest iterations to the latest. The default is True",
"description": (
"If set then events are retreived from latest iterations to earliest ones. "
"Otherwise from earliest iterations to the latest. The default is True"
),
"type": "boolean",
},
"refresh": {
@@ -4663,15 +4587,7 @@ class PlotsRequest(Request):
"type": "object",
}
def __init__(
self,
metrics,
iters=None,
navigate_earlier=None,
refresh=None,
scroll_id=None,
**kwargs
):
def __init__(self, metrics, iters=None, navigate_earlier=None, refresh=None, scroll_id=None, **kwargs):
super(PlotsRequest, self).__init__(**kwargs)
self.metrics = metrics
self.iters = iters
@@ -4691,10 +4607,7 @@ class PlotsRequest(Request):
self.assert_isinstance(value, "metrics", (list, tuple))
if any(isinstance(v, dict) for v in value):
value = [
TaskMetricVariants.from_dict(v) if isinstance(v, dict) else v
for v in value
]
value = [TaskMetricVariants.from_dict(v) if isinstance(v, dict) else v for v in value]
else:
self.assert_isinstance(value, "metrics", TaskMetricVariants, is_array=True)
self._property_metrics = value
@@ -4764,8 +4677,7 @@ class ScalarMetricsIterHistogramRequest(Request):
points). Optional, the default value is 6000.
:type samples: int
:param key: Histogram x axis to use: iter - iteration number iso_time - event
time as ISO formatted string timestamp - event timestamp as milliseconds since
epoch
time as ISO formatted string timestamp - event timestamp as milliseconds since epoch
:type key: ScalarKeyEnum
:param metrics: List of metrics and variants
:type metrics: Sequence[MetricVariants]
@@ -4780,7 +4692,7 @@ class ScalarMetricsIterHistogramRequest(Request):
"metric": {"description": "The metric name", "type": "string"},
"type": "object",
"variants": {
"description": "The names of the metric " "variants",
"description": "The names of the metric variants",
"items": {"type": "string"},
"type": "array",
},
@@ -4793,16 +4705,12 @@ class ScalarMetricsIterHistogramRequest(Request):
"properties": {
"key": {
"$ref": "#/definitions/scalar_key_enum",
"description": "\n"
" Histogram x axis "
"to use:\n"
" iter - iteration "
"number\n"
" iso_time - event "
"time as ISO formatted string\n"
" timestamp - event "
"timestamp as milliseconds since "
"epoch\n",
"description": (
"Histogram x axis to use:"
"iter - iteration number"
"iso_time - event time as ISO formatted string"
"timestamp - event timestamp as milliseconds since epoch"
),
},
"metrics": {
"description": "List of metrics and variants",
@@ -4810,7 +4718,10 @@ class ScalarMetricsIterHistogramRequest(Request):
"type": "array",
},
"samples": {
"description": "The amount of histogram points to return (0 to return all the points). Optional, the default value is 6000.",
"description": (
"The amount of histogram points to return (0 to return all the points). Optional, the default value"
" is 6000."
),
"type": "integer",
},
"task": {"description": "Task ID", "type": "string"},
@@ -4884,9 +4795,7 @@ class ScalarMetricsIterHistogramRequest(Request):
self.assert_isinstance(value, "metrics", (list, tuple))
if any(isinstance(v, dict) for v in value):
value = [
MetricVariants.from_dict(v) if isinstance(v, dict) else v for v in value
]
value = [MetricVariants.from_dict(v) if isinstance(v, dict) else v for v in value]
else:
self.assert_isinstance(value, "metrics", MetricVariants, is_array=True)
self._property_metrics = value
@@ -4906,9 +4815,7 @@ class ScalarMetricsIterHistogramResponse(Response):
_schema = {
"definitions": {},
"properties": {
"images": {"items": {"type": "object"}, "type": ["array", "null"]}
},
"properties": {"images": {"items": {"type": "object"}, "type": ["array", "null"]}},
"type": "object",
}
@@ -4963,7 +4870,7 @@ class ScalarMetricsIterRawRequest(Request):
"metric": {"description": "The metric name", "type": "string"},
"type": "object",
"variants": {
"description": "The names of the metric " "variants",
"description": "The names of the metric variants",
"items": {"type": "string"},
"type": "array",
},
@@ -4976,25 +4883,27 @@ class ScalarMetricsIterRawRequest(Request):
"properties": {
"batch_size": {
"default": 10000,
"description": "The number of data points to return for this call. Optional, the default value is 10000. "
" Maximum batch size is 200000",
"description": (
"The number of data points to return for this call. Optional, the default value is 10000. "
" Maximum batch size is 200000"
),
"type": "integer",
},
"count_total": {
"default": False,
"description": "Count the total number of data points. If false, total number of data points is not "
"counted and null is returned",
"description": (
"Count the total number of data points. If false, total number of data points is not "
"counted and null is returned"
),
"type": "boolean",
},
"key": {
"$ref": "#/definitions/scalar_key_enum",
"description": "Array of x axis to return. Supported "
"values:\n"
" iter - iteration "
"number\n"
" timestamp - event "
"timestamp as milliseconds since "
"epoch\n",
"description": (
"Array of x axis to return. Supported values:"
"iter - iteration number"
"timestamp - event timestamp as milliseconds since epoch"
),
},
"metric": {
"$ref": "#/definitions/metric_variants",
@@ -5010,16 +4919,7 @@ class ScalarMetricsIterRawRequest(Request):
"type": "object",
}
def __init__(
self,
task,
metric,
key=None,
batch_size=10000,
count_total=False,
scroll_id=None,
**kwargs
):
def __init__(self, task, metric, key=None, batch_size=10000, count_total=False, scroll_id=None, **kwargs):
super(ScalarMetricsIterRawRequest, self).__init__(**kwargs)
self.task = task
self.metric = metric
@@ -5141,8 +5041,10 @@ class ScalarMetricsIterRawResponse(Response):
"definitions": {},
"properties": {
"returned": {
"description": "Number of data points returned in this call. If 0 results were "
"returned, no more results are avilable",
"description": (
"Number of data points returned in this call. If 0 results were "
"returned, no more results are avilable"
),
"type": ["integer", "null"],
},
"scroll_id": {
@@ -5162,9 +5064,7 @@ class ScalarMetricsIterRawResponse(Response):
"type": "object",
}
def __init__(
self, variants=None, total=None, returned=None, scroll_id=None, **kwargs
):
def __init__(self, variants=None, total=None, returned=None, scroll_id=None, **kwargs):
super(ScalarMetricsIterRawResponse, self).__init__(**kwargs)
self.variants = variants
self.total = total
@@ -5314,9 +5214,7 @@ class VectorMetricsIterHistogramResponse(Response):
_schema = {
"definitions": {},
"properties": {
"images": {"items": {"type": "object"}, "type": ["array", "null"]}
},
"properties": {"images": {"items": {"type": "object"}, "type": ["array", "null"]}},
"type": "object",
}

View File

@@ -207,17 +207,26 @@ class Model(NonStrictDataModel):
},
"design": {
"additionalProperties": True,
"description": "Json object representing the model design. Should be identical to the network design of the task which created the model",
"description": (
"Json object representing the model design. Should be identical to the network design of the task"
" which created the model"
),
"type": ["object", "null"],
},
"framework": {
"description": "Framework on which the model is based. Should be identical to the framework of the task which created the model",
"description": (
"Framework on which the model is based. Should be identical to the framework of the task which"
" created the model"
),
"type": ["string", "null"],
},
"id": {"description": "Model id", "type": ["string", "null"]},
"labels": {
"additionalProperties": {"type": "integer"},
"description": "Json object representing the ids of the labels in the model. The keys are the layers' names and the values are the ids.",
"description": (
"Json object representing the ids of the labels in the model. The keys are the layers' names and"
" the values are the ids."
),
"type": ["object", "null"],
},
"last_update": {
@@ -270,8 +279,7 @@ class Model(NonStrictDataModel):
"type": ["object", "null"],
},
"uri": {
"description": "URI for the model, pointing to the destination storage."
"destination storage.",
"description": "URI for the model, pointing to the destination storage.",
"type": ["string", "null"],
},
"user": {"description": "Associated user id", "type": ["string", "null"]},
@@ -620,7 +628,7 @@ class AddOrUpdateMetadataRequest(Request):
"type": ["string", "null"],
},
"type": {
"description": "The " "type " "of " "the " "metadata " "item",
"description": "The type of the metadata item",
"type": ["string", "null"],
},
"value": {
@@ -640,8 +648,10 @@ class AddOrUpdateMetadataRequest(Request):
"model": {"description": "ID of the model", "type": "string"},
"replace_metadata": {
"default": False,
"description": "If set then the all the metadata items will be replaced with the "
"provided ones. Otherwise only the provided metadata items will be updated or added",
"description": (
"If set then the all the metadata items will be replaced with the "
"provided ones. Otherwise only the provided metadata items will be updated or added"
),
"type": "boolean",
},
},
@@ -680,9 +690,7 @@ class AddOrUpdateMetadataRequest(Request):
self.assert_isinstance(value, "metadata", (list, tuple))
if any(isinstance(v, dict) for v in value):
value = [
MetadataItem.from_dict(v) if isinstance(v, dict) else v for v in value
]
value = [MetadataItem.from_dict(v) if isinstance(v, dict) else v for v in value]
else:
self.assert_isinstance(value, "metadata", MetadataItem, is_array=True)
self._property_metadata = value
@@ -929,18 +937,40 @@ class CreateRequest(Request):
_action = "create"
_version = "2.20"
_schema = {
"definitions": {},
"definitions": {
"metadata_item": {
"properties": {
"key": {
"description": "The key uniquely identifying the metadata item inside the given entity",
"type": "string",
},
"type": {
"description": "The type of the metadata item",
"type": "string",
},
"value": {
"description": "The value stored in the metadata item",
"type": "string",
},
},
"type": "object",
}
},
"properties": {
"comment": {"description": "Model comment", "type": "string"},
"design": {
"additionalProperties": True,
"description": "Json[d] object representing the model design. Should be identical "
"to the network design of the task which created the model",
"description": (
"Json[d] object representing the model design. Should be identical "
"to the network design of the task which created the model"
),
"type": "object",
},
"framework": {
"description": "Framework on which the model is based. Case insensitive. Should "
"be identical to the framework of the task which created the model.",
"description": (
"Framework on which the model is based. Case insensitive."
"Should be identical to the framework of the task which created the model."
),
"type": "string",
},
"labels": {
@@ -979,6 +1009,11 @@ class CreateRequest(Request):
},
"task": {"description": "Associated task ID", "type": "string"},
"uri": {"description": "URI for the model", "type": "string"},
"metadata": {
"type": "array",
"items": {"$ref": "#/definitions/metadata_item"},
"description": "Model metadata",
},
},
"required": ["uri", "name"],
"type": "object",
@@ -999,6 +1034,7 @@ class CreateRequest(Request):
project=None,
parent=None,
task=None,
metadata=None,
**kwargs
):
super(CreateRequest, self).__init__(**kwargs)
@@ -1015,6 +1051,7 @@ class CreateRequest(Request):
self.project = project
self.parent = parent
self.task = task
self.metadata = metadata
@schema_property("uri")
def uri(self):
@@ -1189,6 +1226,18 @@ class CreateRequest(Request):
self.assert_isinstance(value, "task", six.string_types)
self._property_task = value
@schema_property("metadata")
def metadata(self):
return self._property_metadata
@metadata.setter
def metadata(self, value):
if value is None:
self._property_metadata = None
return
self.assert_isinstance(value, "metadata", (dict,))
self._property_metadata = value
class CreateResponse(Response):
"""
@@ -1266,7 +1315,10 @@ class DeleteRequest(Request):
"definitions": {},
"properties": {
"force": {
"description": "Force. Required if there are tasks that use the model as an execution model, or if the model's creating task is published.",
"description": (
"Force. Required if there are tasks that use the model as an execution model, or if the model's"
" creating task is published."
),
"type": "boolean",
},
"model": {"description": "Model ID", "type": "string"},
@@ -1386,7 +1438,10 @@ class DeleteManyRequest(Request):
"definitions": {},
"properties": {
"force": {
"description": "Force. Required if there are tasks that use the model as an execution model, or if the model's creating task is published.",
"description": (
"Force. Required if there are tasks that use the model as an execution model, or if the model's"
" creating task is published."
),
"type": "boolean",
},
"ids": {
@@ -1708,11 +1763,17 @@ class EditRequest(Request):
"comment": {"description": "Model comment", "type": "string"},
"design": {
"additionalProperties": True,
"description": "Json[d] object representing the model design. Should be identical to the network design of the task which created the model",
"description": (
"Json[d] object representing the model design. Should be identical to the network design of the"
" task which created the model"
),
"type": "object",
},
"framework": {
"description": "Framework on which the model is based. Case insensitive. Should be identical to the framework of the task which created the model.",
"description": (
"Framework on which the model is based. Case insensitive. Should be identical to the framework of"
" the task which created the model."
),
"type": "string",
},
"iteration": {
@@ -1995,9 +2056,7 @@ class EditRequest(Request):
return
self.assert_isinstance(value, "metadata", (list, tuple))
if any(isinstance(v, dict) for v in value):
value = [
MetadataItem.from_dict(v) if isinstance(v, dict) else v for v in value
]
value = [MetadataItem.from_dict(v) if isinstance(v, dict) else v for v in value]
else:
self.assert_isinstance(value, "metadata", MetadataItem, is_array=True)
self._property_metadata = value
@@ -2118,10 +2177,10 @@ class GetAllRequest(Request):
:type _all_: MultiFieldPatternData
:param _any_: Multi-field pattern condition (any field matches pattern)
:type _any_: MultiFieldPatternData
:param scroll_id: Scroll ID returned from the previos calls to get_all
:param scroll_id: Scroll ID returned from the previous calls to get_all
:type scroll_id: str
:param refresh_scroll: If set then all the data received with this scroll will
be requeried
be required
:type refresh_scroll: bool
:param size: The number of models to retrieve
:type size: int
@@ -2183,12 +2242,19 @@ class GetAllRequest(Request):
"type": ["string", "null"],
},
"only_fields": {
"description": "List of model field names (if applicable, nesting is supported using '.'). If provided, this list defines the query's projection (only these fields will be returned for each result entry)",
"description": (
"List of model field names (if applicable, nesting is supported using '.'). If provided, this list"
" defines the query's projection (only these fields will be returned for each result entry)"
),
"items": {"type": "string"},
"type": ["array", "null"],
},
"order_by": {
"description": "List of field names to order by. When search_text is used, '@text_score' can be used as a field representing the text score of returned documents. Use '-' prefix to specify descending order. Optional, recommended when using page",
"description": (
"List of field names to order by. When search_text is used, '@text_score' can be used as a field"
" representing the text score of returned documents. Use '-' prefix to specify descending order."
" Optional, recommended when using page"
),
"items": {"type": "string"},
"type": ["array", "null"],
},
@@ -2198,7 +2264,10 @@ class GetAllRequest(Request):
"type": ["integer", "null"],
},
"page_size": {
"description": "Page size, specifies the number of results returned in each page (last page may contain fewer results)",
"description": (
"Page size, specifies the number of results returned in each page (last page may contain fewer"
" results)"
),
"minimum": 1,
"type": ["integer", "null"],
},
@@ -2208,18 +2277,18 @@ class GetAllRequest(Request):
"type": ["array", "null"],
},
"ready": {
"description": "Indication whether to retrieve only models that are marked ready If not supplied returns both ready and not-ready projects.",
"description": (
"Indication whether to retrieve only models that are marked ready If not supplied returns both"
" ready and not-ready projects."
),
"type": ["boolean", "null"],
},
"refresh_scroll": {
"description": "If set then all the data "
"received with this scroll "
"will be requeried",
"description": "If set then all the data received with this scroll will be required",
"type": ["boolean", "null"],
},
"scroll_id": {
"description": "Scroll ID returned from the "
"previos calls to get_all",
"description": "Scroll ID returned from the previous calls to get_all",
"type": ["string", "null"],
},
"search_text": {
@@ -2232,12 +2301,16 @@ class GetAllRequest(Request):
"type": ["integer", "null"],
},
"system_tags": {
"description": "System tags list used to filter results. Prepend '-' to system tag name to indicate exclusion",
"description": (
"System tags list used to filter results. Prepend '-' to system tag name to indicate exclusion"
),
"items": {"type": "string"},
"type": ["array", "null"],
},
"tags": {
"description": "User-defined tags list used to filter results. Prepend '-' to tag name to indicate exclusion",
"description": (
"User-defined tags list used to filter results. Prepend '-' to tag name to indicate exclusion"
),
"items": {"type": "string"},
"type": ["array", "null"],
},
@@ -2663,17 +2736,26 @@ class GetAllResponse(Response):
},
"design": {
"additionalProperties": True,
"description": "Json object representing the model design. Should be identical to the network design of the task which created the model",
"description": (
"Json object representing the model design. Should be identical to the network design of"
" the task which created the model"
),
"type": ["object", "null"],
},
"framework": {
"description": "Framework on which the model is based. Should be identical to the framework of the task which created the model",
"description": (
"Framework on which the model is based. Should be identical to the framework of the task"
" which created the model"
),
"type": ["string", "null"],
},
"id": {"description": "Model id", "type": ["string", "null"]},
"labels": {
"additionalProperties": {"type": "integer"},
"description": "Json object representing the ids of the labels in the model. The keys are the layers' names and the values are the ids.",
"description": (
"Json object representing the ids of the labels in the model. The keys are the layers'"
" names and the values are the ids."
),
"type": ["object", "null"],
},
"last_update": {
@@ -2874,17 +2956,26 @@ class GetByIdResponse(Response):
},
"design": {
"additionalProperties": True,
"description": "Json object representing the model design. Should be identical to the network design of the task which created the model",
"description": (
"Json object representing the model design. Should be identical to the network design of"
" the task which created the model"
),
"type": ["object", "null"],
},
"framework": {
"description": "Framework on which the model is based. Should be identical to the framework of the task which created the model",
"description": (
"Framework on which the model is based. Should be identical to the framework of the task"
" which created the model"
),
"type": ["string", "null"],
},
"id": {"description": "Model id", "type": ["string", "null"]},
"labels": {
"additionalProperties": {"type": "integer"},
"description": "Json object representing the ids of the labels in the model. The keys are the layers' names and the values are the ids.",
"description": (
"Json object representing the ids of the labels in the model. The keys are the layers'"
" names and the values are the ids."
),
"type": ["object", "null"],
},
"last_update": {
@@ -2911,7 +3002,7 @@ class GetByIdResponse(Response):
"type": ["boolean", "null"],
},
"stats": {
"description": "Model " "statistics",
"description": "Model statistics",
"properties": {
"labels_count": {
"description": "Number of the model labels",
@@ -3063,17 +3154,26 @@ class GetByTaskIdResponse(Response):
},
"design": {
"additionalProperties": True,
"description": "Json object representing the model design. Should be identical to the network design of the task which created the model",
"description": (
"Json object representing the model design. Should be identical to the network design of"
" the task which created the model"
),
"type": ["object", "null"],
},
"framework": {
"description": "Framework on which the model is based. Should be identical to the framework of the task which created the model",
"description": (
"Framework on which the model is based. Should be identical to the framework of the task"
" which created the model"
),
"type": ["string", "null"],
},
"id": {"description": "Model id", "type": ["string", "null"]},
"labels": {
"additionalProperties": {"type": "integer"},
"description": "Json object representing the ids of the labels in the model. The keys are the layers' names and the values are the ids.",
"description": (
"Json object representing the ids of the labels in the model. The keys are the layers'"
" names and the values are the ids."
),
"type": ["object", "null"],
},
"last_update": {
@@ -3100,7 +3200,7 @@ class GetByTaskIdResponse(Response):
"type": ["boolean", "null"],
},
"stats": {
"description": "Model " "statistics",
"description": "Model statistics",
"properties": {
"labels_count": {
"description": "Number of the model labels",
@@ -3185,7 +3285,9 @@ class MakePrivateRequest(Request):
"definitions": {},
"properties": {
"ids": {
"description": "Ids of the models to convert. Only the models originated by the company can be converted",
"description": (
"Ids of the models to convert. Only the models originated by the company can be converted"
),
"items": {"type": "string"},
"type": ["array", "null"],
}
@@ -3358,7 +3460,10 @@ class GetFrameworksRequest(Request):
"definitions": {},
"properties": {
"projects": {
"description": "The list of projects which models will be analyzed. If not passed or empty then all the company and public models will be analyzed",
"description": (
"The list of projects which models will be analyzed. If not passed or empty then all the company"
" and public models will be analyzed"
),
"items": {"type": "string"},
"type": ["array", "null"],
}
@@ -3457,11 +3562,14 @@ class MoveRequest(Request):
"type": "array",
},
"project": {
"description": "Target project ID. If notprovided, `project_name` must beprovided.",
"description": "Target project ID. If not provided, `project_name` must be provided.",
"type": "string",
},
"project_name": {
"description": "Target project name. Ifprovided and a project withthis name does not exist, anew project will be created.If not provided, `project`must be provided.",
"description": (
"Target project name. If provided and a project with this name does not exist, anew project will be"
" created.If not provided, `project`must be provided."
),
"type": "string",
},
},
@@ -3551,7 +3659,10 @@ class PublishManyRequest(Request):
"definitions": {},
"properties": {
"force_publish_task": {
"description": "Publish the associated tasks (if exist) even if they are not in the 'stopped' state. Optional, the default value is False.",
"description": (
"Publish the associated tasks (if exist) even if they are not in the 'stopped' state. Optional, the"
" default value is False."
),
"type": "boolean",
},
"ids": {
@@ -3560,7 +3671,10 @@ class PublishManyRequest(Request):
"type": "array",
},
"publish_tasks": {
"description": "Indicates that the associated tasks (if exist) should be published. Optional, the default value is True.",
"description": (
"Indicates that the associated tasks (if exist) should be published. Optional, the default value is"
" True."
),
"type": "boolean",
},
},
@@ -3668,8 +3782,10 @@ class PublishManyResponse(Response):
"type": "string",
},
"published_task": {
"description": "Result of publishing of the model's associated task (if exists). "
"Returned only if the task was published successfully as part of the model publishing.",
"description": (
"Result of publishing of the model's associated task (if exists). "
"Returned only if the task was published successfully as part of the model publishing."
),
"properties": {
"data": {
"description": "Data returned from the task publishing operation.",
@@ -3761,12 +3877,18 @@ class SetReadyRequest(Request):
"definitions": {},
"properties": {
"force_publish_task": {
"description": "Publish the associated task (if exists) even if it is not in the 'stopped' state. Optional, the default value is False.",
"description": (
"Publish the associated task (if exists) even if it is not in the 'stopped' state. Optional, the"
" default value is False."
),
"type": "boolean",
},
"model": {"description": "Model id", "type": "string"},
"publish_task": {
"description": "Indicates that the associated task (if exists) should be published. Optional, the default value is True.",
"description": (
"Indicates that the associated task (if exists) should be published. Optional, the default value is"
" True."
),
"type": "boolean",
},
},
@@ -3840,7 +3962,10 @@ class SetReadyResponse(Response):
"definitions": {},
"properties": {
"published_task": {
"description": "Result of publishing of the model's associated task (if exists). Returned only if the task was published successfully as part of the model publishing.",
"description": (
"Result of publishing of the model's associated task (if exists). Returned only if the task was"
" published successfully as part of the model publishing."
),
"properties": {
"data": {
"description": "Data returned from the task publishing operation.",
@@ -4417,7 +4542,10 @@ class UpdateForTaskRequest(Request):
"type": "string",
},
"override_model_id": {
"description": "Override model ID. If provided, this model is updated in the task. Exactly one of override_model_id or uri is required.",
"description": (
"Override model ID. If provided, this model is updated in the task. Exactly one of"
" override_model_id or uri is required."
),
"type": "string",
},
"system_tags": {

View File

@@ -29,12 +29,18 @@ class GetTagsRequest(Request):
"description": "Filter on entities to collect tags from",
"properties": {
"system_tags": {
"description": "The list of system tag values to filter by. Use 'null' value to specify empty system tags. Use '__Snot' value to specify that the following value should be excluded",
"description": (
"The list of system tag values to filter by. Use 'null' value to specify empty system tags."
" Use '__Snot' value to specify that the following value should be excluded"
),
"items": {"type": "string"},
"type": "array",
},
"tags": {
"description": "The list of tag values to filter by. Use 'null' value to specify empty tags. Use '__Snot' value to specify that the following value should be excluded",
"description": (
"The list of tag values to filter by. Use 'null' value to specify empty tags. Use '__Snot'"
" value to specify that the following value should be excluded"
),
"items": {"type": "string"},
"type": "array",
},
@@ -43,7 +49,9 @@ class GetTagsRequest(Request):
},
"include_system": {
"default": False,
"description": "If set to 'true' then the list of the system tags is also returned. The default value is 'false'",
"description": (
"If set to 'true' then the list of the system tags is also returned. The default value is 'false'"
),
"type": ["boolean", "null"],
},
},
@@ -101,7 +109,10 @@ class GetTagsResponse(Response):
"definitions": {},
"properties": {
"system_tags": {
"description": "The list of unique system tag values. Returned only if 'include_system' is set to 'true' in the request",
"description": (
"The list of unique system tag values. Returned only if 'include_system' is set to 'true' in the"
" request"
),
"items": {"type": "string"},
"type": ["array", "null"],
},

View File

@@ -109,7 +109,7 @@ class StartPipelineResponse(Response):
:param pipeline: ID of the new pipeline task
:type pipeline: str
:param enqueued: True if the task was successfuly enqueued
:param enqueued: True if the task was successfully enqueued
:type enqueued: bool
"""
@@ -121,7 +121,7 @@ class StartPipelineResponse(Response):
"definitions": {},
"properties": {
"enqueued": {
"description": "True if the task was successfuly enqueued",
"description": "True if the task was successfully enqueued",
"type": ["boolean", "null"],
},
"pipeline": {

View File

@@ -124,7 +124,10 @@ class Project(NonStrictDataModel):
},
"id": {"description": "Project id", "type": ["string", "null"]},
"last_update": {
"description": "Last project update time. Reflects the last time the project metadata was changed or a task in this project has changed status",
"description": (
"Last project update time. Reflects the last time the project metadata was changed or a task in"
" this project has changed status"
),
"format": "date-time",
"type": ["string", "null"],
},
@@ -356,12 +359,7 @@ class StatsStatusCount(NonStrictDataModel):
"type": "integer",
},
"completed": {
"description": "Number "
"of "
"'completed' "
"tasks "
"in "
"project",
"description": "Number of 'completed' tasks in project",
"type": "integer",
},
"created": {
@@ -581,21 +579,19 @@ class ProjectsGetAllResponseSingle(NonStrictDataModel):
:type last_update: datetime.datetime
:param tags: User-defined tags
:type tags: Sequence[str]
:param system_tags: System tags. This field is reserved for system use, please
don't use it.
:param system_tags: System tags. This field is reserved for system use, please don't use it.
:type system_tags: Sequence[str]
:param default_output_destination: The default output destination URL for new
tasks under this project
:param default_output_destination: The default output destination URL for new tasks under this project
:type default_output_destination: str
:param stats: Additional project stats
:type stats: Stats
:param sub_projects: The list of sub projects
:type sub_projects: Sequence[dict]
:param own_tasks: The amount of tasks under this project (without children
projects). Returned if 'check_own_contents' flag is set in the request
:param own_tasks: The amount of tasks under this project (without children projects).
Returned if 'check_own_contents' flag is set in the request
:type own_tasks: int
:param own_models: The amount of models under this project (without children
projects). Returned if 'check_own_contents' flag is set in the request
:param own_models: The amount of models under this project (without children projects).
Returned if 'check_own_contents' flag is set in the request
:type own_models: int
:param dataset_stats: Project dataset statistics
:type dataset_stats: dict
@@ -643,13 +639,17 @@ class ProjectsGetAllResponseSingle(NonStrictDataModel):
},
"name": {"description": "Project name", "type": ["string", "null"]},
"own_models": {
"description": "The amount of models under this project (without children projects). Returned if "
"'check_own_contents' flag is set in the request",
"description": (
"The amount of models under this project (without children projects). Returned if "
"'check_own_contents' flag is set in the request"
),
"type": ["integer", "null"],
},
"own_tasks": {
"description": "The amount of tasks under this project (without children projects). Returned if "
"'check_own_contents' flag is set in the request",
"description": (
"The amount of tasks under this project (without children projects). Returned if "
"'check_own_contents' flag is set in the request"
),
"type": ["integer", "null"],
},
"stats": {
@@ -963,23 +963,25 @@ class MetricVariantResult(NonStrictDataModel):
"properties": {
"metric": {"description": "Metric name", "type": ["string", "null"]},
"metric_hash": {
"description": "Metric name hash. Used instead of the metric name when categorizing "
" last metrics events in task objects.",
"description": (
"Metric name hash. Used instead of the metric name when categorizing "
" last metrics events in task objects."
),
"type": ["string", "null"],
},
"variant": {"description": "Variant name", "type": ["string", "null"]},
"variant_hash": {
"description": "Variant name hash. Used instead of the variant name when categorizing "
"last metrics events in task objects.",
"description": (
"Variant name hash. Used instead of the variant name when categorizing "
"last metrics events in task objects."
),
"type": ["string", "null"],
},
},
"type": "object",
}
def __init__(
self, metric=None, metric_hash=None, variant=None, variant_hash=None, **kwargs
):
def __init__(self, metric=None, metric_hash=None, variant=None, variant_hash=None, **kwargs):
super(MetricVariantResult, self).__init__(**kwargs)
self.metric = metric
self.metric_hash = metric_hash
@@ -1120,11 +1122,9 @@ class CreateRequest(Request):
:type description: str
:param tags: User-defined tags
:type tags: Sequence[str]
:param system_tags: System tags. This field is reserved for system use, please
don't use it.
:param system_tags: System tags. This field is reserved for system use, please don't use it.
:type system_tags: Sequence[str]
:param default_output_destination: The default output destination URL for new
tasks under this project
:param default_output_destination: The default output destination URL for new tasks under this project
:type default_output_destination: str
"""
@@ -1158,15 +1158,7 @@ class CreateRequest(Request):
"type": "object",
}
def __init__(
self,
name,
description=None,
tags=None,
system_tags=None,
default_output_destination=None,
**kwargs
):
def __init__(self, name, description=None, tags=None, system_tags=None, default_output_destination=None, **kwargs):
super(CreateRequest, self).__init__(**kwargs)
self.name = name
self.description = description
@@ -1286,12 +1278,10 @@ class DeleteRequest(Request):
:param project: Project ID
:type project: str
:param force: If not true, fails if project has tasks. If true, and project has
tasks, they will be unassigned
:param force: If not true, fails if project has tasks. If true, and project has tasks, they will be unassigned
:type force: bool
:param delete_contents: If set to 'true' then the project tasks and models will
be deleted. Otherwise their project property will be unassigned. Default value
is 'false'
:param delete_contents: If set to 'true' then the project tasks and models will be deleted.
Otherwise their project property will be unassigned. Default value is 'false'
:type delete_contents: bool
"""
@@ -1302,13 +1292,17 @@ class DeleteRequest(Request):
"definitions": {},
"properties": {
"delete_contents": {
"description": "If set to 'true' then the project tasks, models and dataviews will be deleted. Otherwise their project property will be unassigned. Default value is 'false'",
"description": (
"If set to 'true' then the project tasks, models and dataviews will be deleted. Otherwise their"
" project property will be unassigned. Default value is 'false'"
),
"type": "boolean",
},
"force": {
"default": False,
"description": "If not true, fails if project has tasks. If true, and project has tasks, they will be "
"unassigned",
"description": (
"If not true, fails if project has tasks. If true, and project has tasks, they will be unassigned"
),
"type": "boolean",
},
"project": {"description": "Project ID", "type": "string"},
@@ -1369,11 +1363,10 @@ class DeleteResponse(Response):
:param deleted: Number of projects deleted (0 or 1)
:type deleted: int
:param disassociated_tasks: Number of tasks disassociated from the deleted
project
:param disassociated_tasks: Number of tasks disassociated from the deleted project
:type disassociated_tasks: int
:param urls: The urls of the files that were uploaded by the project tasks and
models. Returned if the 'delete_contents' was set to 'true'
:param urls: The urls of the files that were uploaded by the project tasks and models.
Returned if the 'delete_contents' was set to 'true'
:type urls: Urls
:param deleted_models: Number of models deleted
:type deleted_models: int
@@ -1423,7 +1416,10 @@ class DeleteResponse(Response):
"type": ["integer", "null"],
},
"urls": {
"description": "The urls of the files that were uploaded by the project tasks and models. Returned if the 'delete_contents' was set to 'true'",
"description": (
"The urls of the files that were uploaded by the project tasks and models. Returned if the"
" 'delete_contents' was set to 'true'"
),
"oneOf": [{"$ref": "#/definitions/urls"}, {"type": "null"}],
},
},
@@ -1431,13 +1427,7 @@ class DeleteResponse(Response):
}
def __init__(
self,
deleted=None,
disassociated_tasks=None,
urls=None,
deleted_models=None,
deleted_tasks=None,
**kwargs
self, deleted=None, disassociated_tasks=None, urls=None, deleted_models=None, deleted_tasks=None, **kwargs
):
super(DeleteResponse, self).__init__(**kwargs)
self.deleted = deleted
@@ -1528,54 +1518,44 @@ class GetAllRequest(Request):
:param id: List of IDs to filter by
:type id: Sequence[str]
:param name: Get only projects whose name matches this pattern (python regular
expression syntax)
:param name: Get only projects whose name matches this pattern (python regular expression syntax)
:type name: str
:param basename: Project base name
:type basename: str
:param description: Get only projects whose description matches this pattern
(python regular expression syntax)
:param description: Get only projects whose description matches this pattern (python regular expression syntax)
:type description: str
:param tags: User-defined tags list used to filter results. Prepend '-' to tag
name to indicate exclusion
:param tags: User-defined tags list used to filter results. Prepend '-' to tag name to indicate exclusion
:type tags: Sequence[str]
:param system_tags: System tags list used to filter results. Prepend '-' to
system tag name to indicate exclusion
:param system_tags: System tags list used to filter results. Prepend '-' to system tag name to indicate exclusion
:type system_tags: Sequence[str]
:param order_by: List of field names to order by. When search_text is used,
'@text_score' can be used as a field representing the text score of returned
documents. Use '-' prefix to specify descending order. Optional, recommended
when using page
:param order_by: List of field names to order by. When search_text is used, '@text_score' can be used as a field
representing the text score of returned documents. Use '-' prefix to specify descending order.
Optional, recommended when using page
:type order_by: Sequence[str]
:param page: Page number, returns a specific page out of the resulting list of
projects
:param page: Page number, returns a specific page out of the resulting list of projects
:type page: int
:param page_size: Page size, specifies the number of results returned in each
page (last page may contain fewer results)
:param page_size: Page size, specifies the number of results returned in each page
(last page may contain fewer results)
:type page_size: int
:param search_text: Free text search query
:type search_text: str
:param only_fields: List of document's field names (nesting is supported using
'.', e.g. execution.model_labels). If provided, this list defines the query's
projection (only these fields will be returned for each result entry)
:param only_fields: List of document's field names (nesting is supported using '.', e.g. execution.model_labels).
If provided, this list defines the query's projection (only these fields will be returned for each result entry)
:type only_fields: Sequence[str]
:param _all_: Multi-field pattern condition (all fields match pattern)
:type _all_: MultiFieldPatternData
:param _any_: Multi-field pattern condition (any field matches pattern)
:type _any_: MultiFieldPatternData
:param shallow_search: If set to 'true' then the search with the specified
criteria is performed among top level projects only (or if parents specified,
among the direct children of the these parents). Otherwise the search is
:param shallow_search: If set to 'true' then the search with the specified criteria is performed among top level
projects only (or if parents specified, among the direct children of the these parents). Otherwise the search is
performed among all the company projects (or among all of the descendants of
the specified parents).
:type shallow_search: bool
:param search_hidden: If set to 'true' then hidden projects are included in the
search results
:param search_hidden: If set to 'true' then hidden projects are included in the search results
:type search_hidden: bool
:param scroll_id: Scroll ID returned from the previos calls to get_all_ex
:type scroll_id: str
:param refresh_scroll: If set then all the data received with this scroll will
be requeried
:param refresh_scroll: If set then all the data received with this scroll will be required
:type refresh_scroll: bool
:param size: The number of projects to retrieve
:type size: int
@@ -1621,7 +1601,9 @@ class GetAllRequest(Request):
"type": ["string", "null"],
},
"description": {
"description": "Get only projects whose description matches this pattern (python regular expression syntax)",
"description": (
"Get only projects whose description matches this pattern (python regular expression syntax)"
),
"type": ["string", "null"],
},
"id": {
@@ -1634,12 +1616,20 @@ class GetAllRequest(Request):
"type": ["string", "null"],
},
"only_fields": {
"description": "List of document's field names (nesting is supported using '.', e.g. execution.model_labels). If provided, this list defines the query's projection (only these fields will be returned for each result entry)",
"description": (
"List of document's field names (nesting is supported using '.', e.g. execution.model_labels). If"
" provided, this list defines the query's projection (only these fields will be returned for each"
" result entry)"
),
"items": {"type": "string"},
"type": ["array", "null"],
},
"order_by": {
"description": "List of field names to order by. When search_text is used, '@text_score' can be used as a field representing the text score of returned documents. Use '-' prefix to specify descending order. Optional, recommended when using page",
"description": (
"List of field names to order by. When search_text is used, '@text_score' can be used as a field"
" representing the text score of returned documents. Use '-' prefix to specify descending order."
" Optional, recommended when using page"
),
"items": {"type": "string"},
"type": ["array", "null"],
},
@@ -1649,7 +1639,10 @@ class GetAllRequest(Request):
"type": ["integer", "null"],
},
"page_size": {
"description": "Page size, specifies the number of results returned in each page (last page may contain fewer results)",
"description": (
"Page size, specifies the number of results returned in each page (last page may contain fewer"
" results)"
),
"minimum": 1,
"type": ["integer", "null"],
},
@@ -1672,7 +1665,12 @@ class GetAllRequest(Request):
},
"shallow_search": {
"default": False,
"description": "If set to 'true' then the search with the specified criteria is performed among top level projects only (or if parents specified, among the direct children of the these parents). Otherwise the search is performed among all the company projects (or among all of the descendants of the specified parents).",
"description": (
"If set to 'true' then the search with the specified criteria is performed among top level projects"
" only (or if parents specified, among the direct children of the these parents). Otherwise the"
" search is performed among all the company projects (or among all of the descendants of the"
" specified parents)."
),
"type": ["boolean", "null"],
},
"size": {
@@ -1681,12 +1679,16 @@ class GetAllRequest(Request):
"type": ["integer", "null"],
},
"system_tags": {
"description": "System tags list used to filter results. Prepend '-' to system tag name to indicate exclusion",
"description": (
"System tags list used to filter results. Prepend '-' to system tag name to indicate exclusion"
),
"items": {"type": "string"},
"type": ["array", "null"],
},
"tags": {
"description": "User-defined tags list used to filter results. Prepend '-' to tag name to indicate exclusion",
"description": (
"User-defined tags list used to filter results. Prepend '-' to tag name to indicate exclusion"
),
"items": {"type": "string"},
"type": ["array", "null"],
},
@@ -1997,8 +1999,7 @@ class GetAllResponse(Response):
:param projects: Projects list
:type projects: Sequence[ProjectsGetAllResponseSingle]
:param scroll_id: Scroll ID that can be used with the next calls to get_all_ex
to retrieve more data
:param scroll_id: Scroll ID that can be used with the next calls to get_all_ex to retrieve more data
:type scroll_id: str
"""
@@ -2056,13 +2057,17 @@ class GetAllResponse(Response):
"type": ["string", "null"],
},
"own_models": {
"description": "The amount of models under this project (without children projects). "
"Returned if 'check_own_contents' flag is set in the request",
"description": (
"The amount of models under this project (without children projects). "
"Returned if 'check_own_contents' flag is set in the request"
),
"type": ["integer", "null"],
},
"own_tasks": {
"description": "The amount of tasks under this project (without children projects). "
"Returned if 'check_own_contents' flag is set in the request",
"description": (
"The amount of tasks under this project (without children projects). "
"Returned if 'check_own_contents' flag is set in the request"
),
"type": ["integer", "null"],
},
"stats": {
@@ -2217,14 +2222,9 @@ class GetAllResponse(Response):
self.assert_isinstance(value, "projects", (list, tuple))
if any(isinstance(v, dict) for v in value):
value = [
ProjectsGetAllResponseSingle.from_dict(v) if isinstance(v, dict) else v
for v in value
]
value = [ProjectsGetAllResponseSingle.from_dict(v) if isinstance(v, dict) else v for v in value]
else:
self.assert_isinstance(
value, "projects", ProjectsGetAllResponseSingle, is_array=True
)
self.assert_isinstance(value, "projects", ProjectsGetAllResponseSingle, is_array=True)
self._property_projects = value
@schema_property("scroll_id")
@@ -2314,7 +2314,10 @@ class GetByIdResponse(Response):
},
"id": {"description": "Project id", "type": ["string", "null"]},
"last_update": {
"description": "Last project update time. Reflects the last time the project metadata was changed or a task in this project has changed status",
"description": (
"Last project update time. Reflects the last time the project metadata was changed or a"
" task in this project has changed status"
),
"format": "date-time",
"type": ["string", "null"],
},
@@ -2379,8 +2382,8 @@ class GetHyperParametersRequest(Request):
:type page: int
:param page_size: Page size
:type page_size: int
:param include_subprojects: If set to 'true' and the project field is set then
the result includes hyper parameters from the subproject tasks
:param include_subprojects: If set to 'true' and the project field is set then the result includes
hyper parameters from the subproject tasks
:type include_subprojects: bool
"""
@@ -2392,7 +2395,10 @@ class GetHyperParametersRequest(Request):
"properties": {
"include_subprojects": {
"default": True,
"description": "If set to 'true' and the project field is set then the result includes hyper parameters from the subproject tasks",
"description": (
"If set to 'true' and the project field is set then the result includes hyper parameters from the"
" subproject tasks"
),
"type": "boolean",
},
"page": {"default": 0, "description": "Page number", "type": "integer"},
@@ -2407,9 +2413,7 @@ class GetHyperParametersRequest(Request):
"type": "object",
}
def __init__(
self, project, page=0, page_size=500, include_subprojects=True, **kwargs
):
def __init__(self, project, page=0, page_size=500, include_subprojects=True, **kwargs):
super(GetHyperParametersRequest, self).__init__(**kwargs)
self.project = project
self.page = page
@@ -2571,11 +2575,11 @@ class GetHyperparamValuesRequest(Request):
:type section: str
:param name: Hyperparameter name
:type name: str
:param allow_public: If set to 'true' then collect values from both company and
public tasks otherwise company tasks only. The default is 'true'
:param allow_public: If set to 'true' then collect values from both company and public tasks otherwise company
tasks only. The default is 'true'
:type allow_public: bool
:param include_subprojects: If set to 'true' and the project field is set then
the result includes hyper parameters values from the subproject tasks
:param include_subprojects: If set to 'true' and the project field is set then the result includes
hyper parameters values from the subproject tasks
:type include_subprojects: bool
"""
@@ -2586,12 +2590,18 @@ class GetHyperparamValuesRequest(Request):
"definitions": {},
"properties": {
"allow_public": {
"description": "If set to 'true' then collect values from both company and public tasks otherwise company tasks only. The default is 'true'",
"description": (
"If set to 'true' then collect values from both company and public tasks otherwise company tasks"
" only. The default is 'true'"
),
"type": "boolean",
},
"include_subprojects": {
"default": True,
"description": "If set to 'true' and the project field is set then the result includes hyper parameters values from the subproject tasks",
"description": (
"If set to 'true' and the project field is set then the result includes hyper parameters values"
" from the subproject tasks"
),
"type": "boolean",
},
"name": {"description": "Hyperparameter name", "type": "string"},
@@ -2606,15 +2616,7 @@ class GetHyperparamValuesRequest(Request):
"type": "object",
}
def __init__(
self,
section,
name,
projects=None,
allow_public=None,
include_subprojects=True,
**kwargs
):
def __init__(self, section, name, projects=None, allow_public=None, include_subprojects=True, **kwargs):
super(GetHyperparamValuesRequest, self).__init__(**kwargs)
self.projects = projects
self.section = section
@@ -2762,8 +2764,8 @@ class GetModelMetadataKeysRequest(Request):
:param project: Project ID
:type project: str
:param include_subprojects: If set to 'true' and the project field is set then
the result includes metadate keys from the subproject models
:param include_subprojects: If set to 'true' and the project field is set then the result includes
metadata keys from the subproject models
:type include_subprojects: bool
:param page: Page number
:type page: int
@@ -2779,12 +2781,10 @@ class GetModelMetadataKeysRequest(Request):
"properties": {
"include_subprojects": {
"default": True,
"description": "If set to 'true' and "
"the project field is "
"set then the result "
"includes metadate keys "
"from the subproject "
"models",
"description": (
"If set to 'true' and the project field is set then the result includes metadate keys "
"from the subproject models"
),
"type": "boolean",
},
"page": {"default": 0, "description": "Page number", "type": "integer"},
@@ -2799,9 +2799,7 @@ class GetModelMetadataKeysRequest(Request):
"type": "object",
}
def __init__(
self, project, include_subprojects=True, page=0, page_size=500, **kwargs
):
def __init__(self, project, include_subprojects=True, page=0, page_size=500, **kwargs):
super(GetModelMetadataKeysRequest, self).__init__(**kwargs)
self.project = project
self.include_subprojects = include_subprojects
@@ -2961,11 +2959,11 @@ class GetModelMetadataValuesRequest(Request):
:type projects: Sequence[str]
:param key: Metadata key
:type key: str
:param allow_public: If set to 'true' then collect values from both company and
public models otherwise company modeels only. The default is 'true'
:param allow_public: If set to 'true' then collect values from both company and public models otherwise company
models only. The default is 'true'
:type allow_public: bool
:param include_subprojects: If set to 'true' and the project field is set then
the result includes metadata values from the subproject models
:param include_subprojects: If set to 'true' and the project field is set then the result includes metadata
values from the subproject models
:type include_subprojects: bool
"""
@@ -2976,18 +2974,18 @@ class GetModelMetadataValuesRequest(Request):
"definitions": {},
"properties": {
"allow_public": {
"description": "If set to 'true' then collect values from both company and "
"public models otherwise company modeels only. The default is 'true'",
"description": (
"If set to 'true' then collect values from both company and public models otherwise company "
"models only. The default is 'true'"
),
"type": "boolean",
},
"include_subprojects": {
"default": True,
"description": "If set to 'true' and "
"the project field is "
"set then the result "
"includes metadata "
"values from the "
"subproject models",
"description": (
"If set to 'true' and the project field is set then the result includes metadata values from the "
"subproject models"
),
"type": "boolean",
},
"key": {"description": "Metadata key", "type": "string"},
@@ -3001,9 +2999,7 @@ class GetModelMetadataValuesRequest(Request):
"type": "object",
}
def __init__(
self, key, projects=None, allow_public=None, include_subprojects=True, **kwargs
):
def __init__(self, key, projects=None, allow_public=None, include_subprojects=True, **kwargs):
super(GetModelMetadataValuesRequest, self).__init__(**kwargs)
self.projects = projects
self.key = key
@@ -3135,11 +3131,11 @@ class GetModelTagsRequest(Request):
"""
Get user and system tags used for the models under the specified projects
:param include_system: If set to 'true' then the list of the system tags is
also returned. The default value is 'false'
:param include_system: If set to 'true' then the list of the system tags is also returned.
The default value is 'false'
:type include_system: bool
:param projects: The list of projects under which the tags are searched. If not
passed or empty then all the projects are searched
:param projects: The list of projects under which the tags are searched. If not passed or empty then all the
projects are searched
:type projects: Sequence[str]
:param filter: Filter on entities to collect tags from
:type filter: dict
@@ -3155,12 +3151,18 @@ class GetModelTagsRequest(Request):
"description": "Filter on entities to collect tags from",
"properties": {
"system_tags": {
"description": "The list of system tag values to filter by. Use 'null' value to specify empty system tags. Use '__Snot' value to specify that the following value should be excluded",
"description": (
"The list of system tag values to filter by. Use 'null' value to specify empty system tags."
" Use '__Snot' value to specify that the following value should be excluded"
),
"items": {"type": "string"},
"type": "array",
},
"tags": {
"description": "The list of tag values to filter by. Use 'null' value to specify empty tags. Use '__Snot' value to specify that the following value should be excluded",
"description": (
"The list of tag values to filter by. Use 'null' value to specify empty tags. Use '__Snot'"
" value to specify that the following value should be excluded"
),
"items": {"type": "string"},
"type": "array",
},
@@ -3169,11 +3171,16 @@ class GetModelTagsRequest(Request):
},
"include_system": {
"default": False,
"description": "If set to 'true' then the list of the system tags is also returned. The default value is 'false'",
"description": (
"If set to 'true' then the list of the system tags is also returned. The default value is 'false'"
),
"type": ["boolean", "null"],
},
"projects": {
"description": "The list of projects under which the tags are searched. If not passed or empty then all the projects are searched",
"description": (
"The list of projects under which the tags are searched. If not passed or empty then all the"
" projects are searched"
),
"items": {"type": "string"},
"type": ["array", "null"],
},
@@ -3235,8 +3242,8 @@ class GetModelTagsResponse(Response):
:param tags: The list of unique tag values
:type tags: Sequence[str]
:param system_tags: The list of unique system tag values. Returned only if
'include_system' is set to 'true' in the request
:param system_tags: The list of unique system tag values. Returned only if 'include_system' is set to 'true'
in the request
:type system_tags: Sequence[str]
"""
@@ -3248,7 +3255,10 @@ class GetModelTagsResponse(Response):
"definitions": {},
"properties": {
"system_tags": {
"description": "The list of unique system tag values. Returned only if 'include_system' is set to 'true' in the request",
"description": (
"The list of unique system tag values. Returned only if 'include_system' is set to 'true' in the"
" request"
),
"items": {"type": "string"},
"type": ["array", "null"],
},
@@ -3301,11 +3311,11 @@ class GetProjectTagsRequest(Request):
"""
Get user and system tags used for the specified projects and their children
:param include_system: If set to 'true' then the list of the system tags is
also returned. The default value is 'false'
:param include_system: If set to 'true' then the list of the system tags is also returned.
The default value is 'false'
:type include_system: bool
:param projects: The list of projects under which the tags are searched. If not
passed or empty then all the projects are searched
:param projects: The list of projects under which the tags are searched. If not passed or empty then all the
projects are searched
:type projects: Sequence[str]
:param filter: Filter on entities to collect tags from
:type filter: dict
@@ -3321,14 +3331,18 @@ class GetProjectTagsRequest(Request):
"description": "Filter on entities to collect tags from",
"properties": {
"system_tags": {
"description": "The list of system tag values to filter by. Use 'null' value to specify empty "
"system tags. Use '__$not' value to specify that the following value should be excluded",
"description": (
"The list of system tag values to filter by. Use 'null' value to specify empty "
"system tags. Use '__$not' value to specify that the following value should be excluded"
),
"items": {"type": "string"},
"type": "array",
},
"tags": {
"description": "The list of tag values to filter by. Use 'null' value to specify empty tags. "
"Use '__$not' value to specify that the following value should be excluded",
"description": (
"The list of tag values to filter by. Use 'null' value to specify empty tags. "
"Use '__$not' value to specify that the following value should be excluded"
),
"items": {"type": "string"},
"type": "array",
},
@@ -3337,11 +3351,16 @@ class GetProjectTagsRequest(Request):
},
"include_system": {
"default": False,
"description": "If set to 'true' then the list of the system tags is also returned. The default value is 'false'",
"description": (
"If set to 'true' then the list of the system tags is also returned. The default value is 'false'"
),
"type": ["boolean", "null"],
},
"projects": {
"description": "The list of projects under which the tags are searched. If not passed or empty then all the projects are searched",
"description": (
"The list of projects under which the tags are searched. If not passed or empty then all the"
" projects are searched"
),
"items": {"type": "string"},
"type": ["array", "null"],
},
@@ -3403,8 +3422,8 @@ class GetProjectTagsResponse(Response):
:param tags: The list of unique tag values
:type tags: Sequence[str]
:param system_tags: The list of unique system tag values. Returned only if
'include_system' is set to 'true' in the request
:param system_tags: The list of unique system tag values. Returned only if 'include_system' is set to 'true'
in the request
:type system_tags: Sequence[str]
"""
@@ -3416,7 +3435,10 @@ class GetProjectTagsResponse(Response):
"definitions": {},
"properties": {
"system_tags": {
"description": "The list of unique system tag values. Returned only if 'include_system' is set to 'true' in the request",
"description": (
"The list of unique system tag values. Returned only if 'include_system' is set to 'true' in the"
" request"
),
"items": {"type": "string"},
"type": ["array", "null"],
},
@@ -3469,14 +3491,14 @@ class GetTaskParentsRequest(Request):
"""
Get unique parent tasks for the tasks in the specified projects
:param projects: The list of projects which task parents are retieved. If not
passed or empty then all the projects are searched
:param projects: The list of projects which task parents are retrieved. If not passed or empty then all the
projects are searched
:type projects: Sequence[str]
:param tasks_state: Return parents for tasks in the specified state. If Null is
provided, parents for all task states will be returned.
:param tasks_state: Return parents for tasks in the specified state. If Null is provided, parents for all task
states will be returned.
:type tasks_state: str
:param include_subprojects: If set to 'true' and the projects field is not
empty then the result includes tasks parents from the subproject tasks
:param include_subprojects: If set to 'true' and the projects field is not empty then the result includes tasks
parents from the subproject tasks
:type include_subprojects: bool
"""
@@ -3488,20 +3510,26 @@ class GetTaskParentsRequest(Request):
"properties": {
"include_subprojects": {
"default": True,
"description": "If set to 'true' and the projects field is not empty then the result includes tasks "
"parents from the subproject tasks",
"description": (
"If set to 'true' and the projects field is not empty then the result includes tasks "
"parents from the subproject tasks"
),
"type": ["boolean", "null"],
},
"projects": {
"description": "The list of projects which task parents are retieved. If not passed or empty then all the "
"projects are searched",
"description": (
"The list of projects which task parents are retieved. If not passed or empty then all the "
"projects are searched"
),
"items": {"type": "string"},
"type": ["array", "null"],
},
"tasks_state": {
"default": "active",
"description": "Return parents for tasks in the specified state. If Null is provided, parents for all "
"task states will be returned.",
"description": (
"Return parents for tasks in the specified state. If Null is provided, parents for all "
"task states will be returned."
),
"enum": ["active", "archived"],
"type": ["string", "null"],
},
@@ -3509,9 +3537,7 @@ class GetTaskParentsRequest(Request):
"type": "object",
}
def __init__(
self, projects=None, tasks_state="active", include_subprojects=True, **kwargs
):
def __init__(self, projects=None, tasks_state="active", include_subprojects=True, **kwargs):
super(GetTaskParentsRequest, self).__init__(**kwargs)
self.projects = projects
self.tasks_state = tasks_state
@@ -3630,11 +3656,11 @@ class GetTaskTagsRequest(Request):
"""
Get user and system tags used for the tasks under the specified projects
:param include_system: If set to 'true' then the list of the system tags is
also returned. The default value is 'false'
:param include_system: If set to 'true' then the list of the system tags is also returned.
The default value is 'false'
:type include_system: bool
:param projects: The list of projects under which the tags are searched. If not
passed or empty then all the projects are searched
:param projects: The list of projects under which the tags are searched. If not passed or empty then all the
projects are searched
:type projects: Sequence[str]
:param filter: Filter on entities to collect tags from
:type filter: dict
@@ -3650,12 +3676,18 @@ class GetTaskTagsRequest(Request):
"description": "Filter on entities to collect tags from",
"properties": {
"system_tags": {
"description": "The list of system tag values to filter by. Use 'null' value to specify empty system tags. Use '__Snot' value to specify that the following value should be excluded",
"description": (
"The list of system tag values to filter by. Use 'null' value to specify empty system tags."
" Use '__Snot' value to specify that the following value should be excluded"
),
"items": {"type": "string"},
"type": "array",
},
"tags": {
"description": "The list of tag values to filter by. Use 'null' value to specify empty tags. Use '__Snot' value to specify that the following value should be excluded",
"description": (
"The list of tag values to filter by. Use 'null' value to specify empty tags. Use '__Snot'"
" value to specify that the following value should be excluded"
),
"items": {"type": "string"},
"type": "array",
},
@@ -3664,11 +3696,16 @@ class GetTaskTagsRequest(Request):
},
"include_system": {
"default": False,
"description": "If set to 'true' then the list of the system tags is also returned. The default value is 'false'",
"description": (
"If set to 'true' then the list of the system tags is also returned. The default value is 'false'"
),
"type": ["boolean", "null"],
},
"projects": {
"description": "The list of projects under which the tags are searched. If not passed or empty then all the projects are searched",
"description": (
"The list of projects under which the tags are searched. If not passed or empty then all the"
" projects are searched"
),
"items": {"type": "string"},
"type": ["array", "null"],
},
@@ -3730,8 +3767,8 @@ class GetTaskTagsResponse(Response):
:param tags: The list of unique tag values
:type tags: Sequence[str]
:param system_tags: The list of unique system tag values. Returned only if
'include_system' is set to 'true' in the request
:param system_tags: The list of unique system tag values. Returned only if 'include_system' is set to 'true'
in the request
:type system_tags: Sequence[str]
"""
@@ -3743,7 +3780,10 @@ class GetTaskTagsResponse(Response):
"definitions": {},
"properties": {
"system_tags": {
"description": "The list of unique system tag values. Returned only if 'include_system' is set to 'true' in the request",
"description": (
"The list of unique system tag values. Returned only if 'include_system' is set to 'true' in the"
" request"
),
"items": {"type": "string"},
"type": ["array", "null"],
},
@@ -3795,13 +3835,13 @@ class GetTaskTagsResponse(Response):
class GetUniqueMetricVariantsRequest(Request):
"""
Get all metric/variant pairs reported for tasks in a specific project.
If no project is specified, metrics/variant paris reported for all tasks will be returned.
If the project does not exist, an empty list will be returned.
If no project is specified, metrics/variant paris reported for all tasks will be returned.
If the project does not exist, an empty list will be returned.
:param project: Project ID
:type project: str
:param include_subprojects: If set to 'true' and the project field is set then
the result includes metrics/variants from the subproject tasks
:param include_subprojects: If set to 'true' and the project field is set then the result includes metrics/variants
from the subproject tasks
:type include_subprojects: bool
"""
@@ -3813,7 +3853,10 @@ class GetUniqueMetricVariantsRequest(Request):
"properties": {
"include_subprojects": {
"default": True,
"description": "If set to 'true' and the project field is set then the result includes metrics/variants from the subproject tasks",
"description": (
"If set to 'true' and the project field is set then the result includes metrics/variants from the"
" subproject tasks"
),
"type": ["boolean", "null"],
},
"project": {"description": "Project ID", "type": ["string", "null"]},
@@ -3874,7 +3917,10 @@ class GetUniqueMetricVariantsResponse(Response):
"type": ["string", "null"],
},
"metric_hash": {
"description": "Metric name hash. Used instead of the metric name when categorizing last metrics events in task objects.",
"description": (
"Metric name hash. Used instead of the metric name when categorizing last metrics events in"
" task objects."
),
"type": ["string", "null"],
},
"variant": {
@@ -3882,7 +3928,10 @@ class GetUniqueMetricVariantsResponse(Response):
"type": ["string", "null"],
},
"variant_hash": {
"description": "Variant name hash. Used instead of the variant name when categorizing last metrics events in task objects.",
"description": (
"Variant name hash. Used instead of the variant name when categorizing last metrics events"
" in task objects."
),
"type": ["string", "null"],
},
},
@@ -3915,10 +3964,7 @@ class GetUniqueMetricVariantsResponse(Response):
self.assert_isinstance(value, "metrics", (list, tuple))
if any(isinstance(v, dict) for v in value):
value = [
MetricVariantResult.from_dict(v) if isinstance(v, dict) else v
for v in value
]
value = [MetricVariantResult.from_dict(v) if isinstance(v, dict) else v for v in value]
else:
self.assert_isinstance(value, "metrics", MetricVariantResult, is_array=True)
self._property_metrics = value
@@ -3940,7 +3986,9 @@ class MakePrivateRequest(Request):
"definitions": {},
"properties": {
"ids": {
"description": "Ids of the projects to convert. Only the projects originated by the company can be converted",
"description": (
"Ids of the projects to convert. Only the projects originated by the company can be converted"
),
"items": {"type": "string"},
"type": ["array", "null"],
},
@@ -4175,7 +4223,9 @@ class MergeResponse(Response):
"definitions": {},
"properties": {
"moved_entities": {
"description": "The number of tasks, models and dataviews moved from the merged project into the destination",
"description": (
"The number of tasks, models and dataviews moved from the merged project into the destination"
),
"type": ["integer", "null"],
},
"moved_projects": {
@@ -4335,11 +4385,9 @@ class UpdateRequest(Request):
:type description: str
:param tags: User-defined tags list
:type tags: Sequence[str]
:param system_tags: System tags list. This field is reserved for system use,
please don't use it.
:param system_tags: System tags list. This field is reserved for system use, please don't use it.
:type system_tags: Sequence[str]
:param default_output_destination: The default output destination URL for new
tasks under this project
:param default_output_destination: The default output destination URL for new tasks under this project
:type default_output_destination: str
"""
@@ -4582,14 +4630,11 @@ class ValidateDeleteResponse(Response):
:param tasks: The total number of tasks under the project and all its children
:type tasks: int
:param non_archived_tasks: The total number of non-archived tasks under the
project and all its children
:param non_archived_tasks: The total number of non-archived tasks under the project and all its children
:type non_archived_tasks: int
:param models: The total number of models under the project and all its
children
:param models: The total number of models under the project and all its children
:type models: int
:param non_archived_models: The total number of non-archived models under the
project and all its children
:param non_archived_models: The total number of non-archived models under the project and all its children
:type non_archived_models: int
"""
@@ -4620,14 +4665,7 @@ class ValidateDeleteResponse(Response):
"type": "object",
}
def __init__(
self,
tasks=None,
non_archived_tasks=None,
models=None,
non_archived_models=None,
**kwargs
):
def __init__(self, tasks=None, non_archived_tasks=None, models=None, non_archived_models=None, **kwargs):
super(ValidateDeleteResponse, self).__init__(**kwargs)
self.tasks = tasks
self.non_archived_tasks = non_archived_tasks

View File

@@ -20,36 +20,45 @@ class QueueMetrics(NonStrictDataModel):
"""
:param queue: ID of the queue
:type queue: str
:param dates: List of timestamps (in seconds from epoch) in the acceding order.
The timestamps are separated by the requested interval. Timestamps where no
queue status change was recorded are omitted.
:param dates: List of timestamps (in seconds from epoch) in the acceding order. The timestamps are separated by the
requested interval. Timestamps where no queue status change was recorded are omitted.
:type dates: Sequence[int]
:param avg_waiting_times: List of average waiting times for tasks in the queue.
The points correspond to the timestamps in the dates list. If more than one
value exists for the given interval then the maximum value is taken.
:param avg_waiting_times: List of average waiting times for tasks in the queue. The points correspond to the
timestamps in the dates list. If more than one value exists for the given interval then the maximum
value is taken.
:type avg_waiting_times: Sequence[float]
:param queue_lengths: List of tasks counts in the queue. The points correspond
to the timestamps in the dates list. If more than one value exists for the
given interval then the count that corresponds to the maximum average value is
taken.
:param queue_lengths: List of tasks counts in the queue. The points correspond to the timestamps in the dates list.
If more than one value exists for the given interval then the count that corresponds to the maximum average
value is taken.
:type queue_lengths: Sequence[int]
"""
_schema = {
"properties": {
"avg_waiting_times": {
"description": "List of average waiting times for tasks in the queue. The points correspond to the timestamps in the dates list. If more than one value exists for the given interval then the maximum value is taken.",
"description": (
"List of average waiting times for tasks in the queue. The points correspond to the timestamps in"
" the dates list. If more than one value exists for the given interval then the maximum value is"
" taken."
),
"items": {"type": "number"},
"type": ["array", "null"],
},
"dates": {
"description": "List of timestamps (in seconds from epoch) in the acceding order. The timestamps are separated by the requested interval. Timestamps where no queue status change was recorded are omitted.",
"description": (
"List of timestamps (in seconds from epoch) in the acceding order. The timestamps are separated by"
" the requested interval. Timestamps where no queue status change was recorded are omitted."
),
"items": {"type": "integer"},
"type": ["array", "null"],
},
"queue": {"description": "ID of the queue", "type": ["string", "null"]},
"queue_lengths": {
"description": "List of tasks counts in the queue. The points correspond to the timestamps in the dates list. If more than one value exists for the given interval then the count that corresponds to the maximum average value is taken.",
"description": (
"List of tasks counts in the queue. The points correspond to the timestamps in the dates list. If"
" more than one value exists for the given interval then the count that corresponds to the maximum"
" average value is taken."
),
"items": {"type": "integer"},
"type": ["array", "null"],
},
@@ -57,14 +66,7 @@ class QueueMetrics(NonStrictDataModel):
"type": "object",
}
def __init__(
self,
queue=None,
dates=None,
avg_waiting_times=None,
queue_lengths=None,
**kwargs
):
def __init__(self, queue=None, dates=None, avg_waiting_times=None, queue_lengths=None, **kwargs):
super(QueueMetrics, self).__init__(**kwargs)
self.queue = queue
self.dates = dates
@@ -95,9 +97,7 @@ class QueueMetrics(NonStrictDataModel):
return
self.assert_isinstance(value, "dates", (list, tuple))
value = [
int(v) if isinstance(v, float) and v.is_integer() else v for v in value
]
value = [int(v) if isinstance(v, float) and v.is_integer() else v for v in value]
self.assert_isinstance(value, "dates", six.integer_types, is_array=True)
self._property_dates = value
@@ -114,9 +114,7 @@ class QueueMetrics(NonStrictDataModel):
self.assert_isinstance(value, "avg_waiting_times", (list, tuple))
self.assert_isinstance(
value, "avg_waiting_times", six.integer_types + (float,), is_array=True
)
self.assert_isinstance(value, "avg_waiting_times", six.integer_types + (float,), is_array=True)
self._property_avg_waiting_times = value
@schema_property("queue_lengths")
@@ -130,9 +128,7 @@ class QueueMetrics(NonStrictDataModel):
return
self.assert_isinstance(value, "queue_lengths", (list, tuple))
value = [
int(v) if isinstance(v, float) and v.is_integer() else v for v in value
]
value = [int(v) if isinstance(v, float) and v.is_integer() else v for v in value]
self.assert_isinstance(value, "queue_lengths", six.integer_types, is_array=True)
self._property_queue_lengths = value
@@ -194,8 +190,7 @@ class Entry(NonStrictDataModel):
class MetadataItem(NonStrictDataModel):
"""
:param key: The key uniquely identifying the metadata item inside the given
entity
:param key: The key uniquely identifying the metadata item inside the given entity
:type key: str
:param type: The type of the metadata item
:type type: str
@@ -281,8 +276,7 @@ class Queue(NonStrictDataModel):
:type created: datetime.datetime
:param tags: User-defined tags
:type tags: Sequence[str]
:param system_tags: System tags. This field is reserved for system use, please
don't use it.
:param system_tags: System tags. This field is reserved for system use, please don't use it.
:type system_tags: Sequence[str]
:param entries: List of ordered queue entries
:type entries: Sequence[Entry]
@@ -504,9 +498,8 @@ class AddOrUpdateMetadataRequest(Request):
:type queue: str
:param metadata: Metadata items to add or update
:type metadata: Sequence[MetadataItem]
:param replace_metadata: If set then the all the metadata items will be
replaced with the provided ones. Otherwise only the provided metadata items
will be updated or added
:param replace_metadata: If set then the all the metadata items will be replaced with the provided ones.
Otherwise only the provided metadata items will be updated or added
:type replace_metadata: bool
"""
@@ -542,7 +535,10 @@ class AddOrUpdateMetadataRequest(Request):
"queue": {"description": "ID of the queue", "type": "string"},
"replace_metadata": {
"default": False,
"description": "If set then the all the metadata items will be replaced with the provided ones. Otherwise only the provided metadata items will be updated or added",
"description": (
"If set then the all the metadata items will be replaced with the provided ones. Otherwise only the"
" provided metadata items will be updated or added"
),
"type": "boolean",
},
},
@@ -747,8 +743,7 @@ class CreateRequest(Request):
:type name: str
:param tags: User-defined tags list
:type tags: Sequence[str]
:param system_tags: System tags list. This field is reserved for system use,
please don't use it.
:param system_tags: System tags list. This field is reserved for system use, please don't use it.
:type system_tags: Sequence[str]
"""
@@ -841,9 +836,7 @@ class CreateResponse(Response):
_schema = {
"definitions": {},
"properties": {
"id": {"description": "New queue ID", "type": ["string", "null"]}
},
"properties": {"id": {"description": "New queue ID", "type": ["string", "null"]}},
"type": "object",
}
@@ -1077,38 +1070,31 @@ class GetAllRequest(Request):
"""
Get all queues
:param name: Get only queues whose name matches this pattern (python regular
expression syntax)
:param name: Get only queues whose name matches this pattern (python regular expression syntax)
:type name: str
:param id: List of Queue IDs used to filter results
:type id: Sequence[str]
:param tags: User-defined tags list used to filter results. Prepend '-' to tag
name to indicate exclusion
:param tags: User-defined tags list used to filter results. Prepend '-' to tag name to indicate exclusion
:type tags: Sequence[str]
:param system_tags: System tags list used to filter results. Prepend '-' to
system tag name to indicate exclusion
:param system_tags: System tags list used to filter results. Prepend '-' to system tag name to indicate exclusion
:type system_tags: Sequence[str]
:param page: Page number, returns a specific page out of the result list of
results.
:param page: Page number, returns a specific page out of the result list of results.
:type page: int
:param page_size: Page size, specifies the number of results returned in each
page (last page may contain fewer results)
:param page_size: Page size, specifies the number of results returned in each page
(last page may contain fewer results)
:type page_size: int
:param order_by: List of field names to order by. When search_text is used,
'@text_score' can be used as a field representing the text score of returned
documents. Use '-' prefix to specify descending order. Optional, recommended
when using page
:param order_by: List of field names to order by. When search_text is used, '@text_score' can be used as a field
representing the text score of returned documents. Use '-' prefix to specify descending order.
Optional, recommended when using page
:type order_by: Sequence[str]
:param search_text: Free text search query
:type search_text: str
:param only_fields: List of document field names (nesting is supported using
'.', e.g. execution.model_labels). If provided, this list defines the query's
projection (only these fields will be returned for each result entry)
:param only_fields: List of document field names (nesting is supported using '.', e.g. execution.model_labels).
If provided, this list defines the query's projection (only these fields will be returned for each result entry)
:type only_fields: Sequence[str]
:param scroll_id: Scroll ID returned from the previos calls to get_all
:param scroll_id: Scroll ID returned from the previous calls to get_all
:type scroll_id: str
:param refresh_scroll: If set then all the data received with this scroll will
be requeried
:param refresh_scroll: If set then all the data received with this scroll will be required
:type refresh_scroll: bool
:param size: The number of queues to retrieve
:type size: int
@@ -1136,12 +1122,20 @@ class GetAllRequest(Request):
"type": ["string", "null"],
},
"only_fields": {
"description": "List of document field names (nesting is supported using '.', e.g. execution.model_labels). If provided, this list defines the query's projection (only these fields will be returned for each result entry)",
"description": (
"List of document field names (nesting is supported using '.', e.g. execution.model_labels). If"
" provided, this list defines the query's projection (only these fields will be returned for each"
" result entry)"
),
"items": {"type": "string"},
"type": ["array", "null"],
},
"order_by": {
"description": "List of field names to order by. When search_text is used, '@text_score' can be used as a field representing the text score of returned documents. Use '-' prefix to specify descending order. Optional, recommended when using page",
"description": (
"List of field names to order by. When search_text is used, '@text_score' can be used as a field"
" representing the text score of returned documents. Use '-' prefix to specify descending order."
" Optional, recommended when using page"
),
"items": {"type": "string"},
"type": ["array", "null"],
},
@@ -1151,16 +1145,19 @@ class GetAllRequest(Request):
"type": ["integer", "null"],
},
"page_size": {
"description": "Page size, specifies the number of results returned in each page (last page may contain fewer results)",
"description": (
"Page size, specifies the number of results returned in each page (last page may contain fewer"
" results)"
),
"minimum": 1,
"type": ["integer", "null"],
},
"refresh_scroll": {
"description": "If set then all the data received with this scroll will be requeried",
"description": "If set then all the data received with this scroll will be required",
"type": ["boolean", "null"],
},
"scroll_id": {
"description": "Scroll ID returned from the previos calls to get_all",
"description": "Scroll ID returned from the previous calls to get_all",
"type": ["string", "null"],
},
"search_text": {
@@ -1173,12 +1170,16 @@ class GetAllRequest(Request):
"type": ["integer", "null"],
},
"system_tags": {
"description": "System tags list used to filter results. Prepend '-' to system tag name to indicate exclusion",
"description": (
"System tags list used to filter results. Prepend '-' to system tag name to indicate exclusion"
),
"items": {"type": "string"},
"type": ["array", "null"],
},
"tags": {
"description": "User-defined tags list used to filter results. Prepend '-' to tag name to indicate exclusion",
"description": (
"User-defined tags list used to filter results. Prepend '-' to tag name to indicate exclusion"
),
"items": {"type": "string"},
"type": ["array", "null"],
},
@@ -1412,8 +1413,7 @@ class GetAllResponse(Response):
:param queues: Queues list
:type queues: Sequence[Queue]
:param scroll_id: Scroll ID that can be used with the next calls to get_all to
retrieve more data
:param scroll_id: Scroll ID that can be used with the next calls to get_all to retrieve more data
:type scroll_id: str
"""
@@ -1937,9 +1937,7 @@ class GetNumEntriesResponse(Response):
_schema = {
"definitions": {},
"properties": {
"num": {"description": "Number of entries", "type": ["integer", "null"]}
},
"properties": {"num": {"description": "Number of entries", "type": ["integer", "null"]}},
"type": "object",
}
@@ -1965,18 +1963,16 @@ class GetNumEntriesResponse(Response):
class GetQueueMetricsRequest(Request):
"""
Returns metrics of the company queues. The metrics are avaraged in the specified interval.
Returns metrics of the company queues. The metrics are averaged in the specified interval.
:param from_date: Starting time (in seconds from epoch) for collecting metrics
:type from_date: float
:param to_date: Ending time (in seconds from epoch) for collecting metrics
:type to_date: float
:param interval: Time interval in seconds for a single metrics point. The
minimal value is 1
:param interval: Time interval in seconds for a single metrics point. The minimal value is 1
:type interval: int
:param queue_ids: List of queue ids to collect metrics for. If not provided or
empty then all then average metrics across all the company queues will be
returned.
:param queue_ids: List of queue ids to collect metrics for. If not provided or empty then all then average metrics
across all the company queues will be returned.
:type queue_ids: Sequence[str]
:param refresh: If set then the new queue metrics is taken
:type refresh: bool
@@ -1997,7 +1993,10 @@ class GetQueueMetricsRequest(Request):
"type": "integer",
},
"queue_ids": {
"description": "List of queue ids to collect metrics for. If not provided or empty then all then average metrics across all the company queues will be returned.",
"description": (
"List of queue ids to collect metrics for. If not provided or empty then all then average metrics"
" across all the company queues will be returned."
),
"items": {"type": "string"},
"type": "array",
},
@@ -2015,9 +2014,7 @@ class GetQueueMetricsRequest(Request):
"type": "object",
}
def __init__(
self, from_date, to_date, interval, queue_ids=None, refresh=False, **kwargs
):
def __init__(self, from_date, to_date, interval, queue_ids=None, refresh=False, **kwargs):
super(GetQueueMetricsRequest, self).__init__(**kwargs)
self.from_date = from_date
self.to_date = to_date
@@ -2099,9 +2096,8 @@ class GetQueueMetricsResponse(Response):
"""
Response of queues.get_queue_metrics endpoint.
:param queues: List of the requested queues with their metrics. If no queue ids
were requested then 'all' queue is returned with the metrics averaged accross
all the company queues.
:param queues: List of the requested queues with their metrics. If no queue ids were requested then 'all' queue
is returned with the metrics averaged across all the company queues.
:type queues: Sequence[QueueMetrics]
"""
@@ -2114,12 +2110,20 @@ class GetQueueMetricsResponse(Response):
"queue_metrics": {
"properties": {
"avg_waiting_times": {
"description": "List of average waiting times for tasks in the queue. The points correspond to the timestamps in the dates list. If more than one value exists for the given interval then the maximum value is taken.",
"description": (
"List of average waiting times for tasks in the queue. The points correspond to the"
" timestamps in the dates list. If more than one value exists for the given interval then"
" the maximum value is taken."
),
"items": {"type": "number"},
"type": ["array", "null"],
},
"dates": {
"description": "List of timestamps (in seconds from epoch) in the acceding order. The timestamps are separated by the requested interval. Timestamps where no queue status change was recorded are omitted.",
"description": (
"List of timestamps (in seconds from epoch) in the acceding order. The timestamps are"
" separated by the requested interval. Timestamps where no queue status change was recorded"
" are omitted."
),
"items": {"type": "integer"},
"type": ["array", "null"],
},
@@ -2128,7 +2132,11 @@ class GetQueueMetricsResponse(Response):
"type": ["string", "null"],
},
"queue_lengths": {
"description": "List of tasks counts in the queue. The points correspond to the timestamps in the dates list. If more than one value exists for the given interval then the count that corresponds to the maximum average value is taken.",
"description": (
"List of tasks counts in the queue. The points correspond to the timestamps in the dates"
" list. If more than one value exists for the given interval then the count that"
" corresponds to the maximum average value is taken."
),
"items": {"type": "integer"},
"type": ["array", "null"],
},
@@ -2138,7 +2146,10 @@ class GetQueueMetricsResponse(Response):
},
"properties": {
"queues": {
"description": "List of the requested queues with their metrics. If no queue ids were requested then 'all' queue is returned with the metrics averaged accross all the company queues.",
"description": (
"List of the requested queues with their metrics. If no queue ids were requested then 'all' queue"
" is returned with the metrics averaged across all the company queues."
),
"items": {"$ref": "#/definitions/queue_metrics"},
"type": ["array", "null"],
}
@@ -2162,9 +2173,7 @@ class GetQueueMetricsResponse(Response):
self.assert_isinstance(value, "queues", (list, tuple))
if any(isinstance(v, dict) for v in value):
value = [
QueueMetrics.from_dict(v) if isinstance(v, dict) else v for v in value
]
value = [QueueMetrics.from_dict(v) if isinstance(v, dict) else v for v in value]
else:
self.assert_isinstance(value, "queues", QueueMetrics, is_array=True)
self._property_queues = value
@@ -2176,8 +2185,8 @@ class MoveTaskBackwardRequest(Request):
:type queue: str
:param task: Task id
:type task: str
:param count: Number of positions in the queue to move the task forward
relative to the current position. Optional, the default value is 1.
:param count: Number of positions in the queue to move the task forward relative to the current position.
Optional, the default value is 1.
:type count: int
"""
@@ -2188,7 +2197,10 @@ class MoveTaskBackwardRequest(Request):
"definitions": {},
"properties": {
"count": {
"description": "Number of positions in the queue to move the task forward relative to the current position. Optional, the default value is 1.",
"description": (
"Number of positions in the queue to move the task forward relative to the current position."
" Optional, the default value is 1."
),
"type": "integer",
},
"queue": {"description": "Queue id", "type": "string"},
@@ -2250,8 +2262,7 @@ class MoveTaskBackwardResponse(Response):
"""
Response of queues.move_task_backward endpoint.
:param position: The new position of the task entry in the queue (index, -1
represents bottom of queue)
:param position: The new position of the task entry in the queue (index, -1 represents bottom of queue)
:type position: int
"""
@@ -2298,8 +2309,8 @@ class MoveTaskForwardRequest(Request):
:type queue: str
:param task: Task id
:type task: str
:param count: Number of positions in the queue to move the task forward
relative to the current position. Optional, the default value is 1.
:param count: Number of positions in the queue to move the task forward relative to the current position.
Optional, the default value is 1.
:type count: int
"""
@@ -2310,7 +2321,10 @@ class MoveTaskForwardRequest(Request):
"definitions": {},
"properties": {
"count": {
"description": "Number of positions in the queue to move the task forward relative to the current position. Optional, the default value is 1.",
"description": (
"Number of positions in the queue to move the task forward relative to the current position."
"Optional, the default value is 1."
),
"type": "integer",
},
"queue": {"description": "Queue id", "type": "string"},
@@ -2372,8 +2386,7 @@ class MoveTaskForwardResponse(Response):
"""
Response of queues.move_task_forward endpoint.
:param position: The new position of the task entry in the queue (index, -1
represents bottom of queue)
:param position: The new position of the task entry in the queue (index, -1 represents bottom of queue)
:type position: int
"""
@@ -2469,8 +2482,7 @@ class MoveTaskToBackResponse(Response):
"""
Response of queues.move_task_to_back endpoint.
:param position: The new position of the task entry in the queue (index, -1
represents bottom of queue)
:param position: The new position of the task entry in the queue (index, -1 represents bottom of queue)
:type position: int
"""
@@ -2566,8 +2578,7 @@ class MoveTaskToFrontResponse(Response):
"""
Response of queues.move_task_to_front endpoint.
:param position: The new position of the task entry in the queue (index, -1
represents bottom of queue)
:param position: The new position of the task entry in the queue (index, -1 represents bottom of queue)
:type position: int
"""
@@ -2787,8 +2798,7 @@ class UpdateRequest(Request):
:type name: str
:param tags: User-defined tags list
:type tags: Sequence[str]
:param system_tags: System tags list. This field is reserved for system use,
please don't use it.
:param system_tags: System tags list. This field is reserved for system use, please don't use it.
:type system_tags: Sequence[str]
"""

File diff suppressed because it is too large Load Diff

View File

@@ -91,9 +91,7 @@ class StatItem(NonStrictDataModel):
_schema = {
"properties": {
"category": {
"oneOf": [{"$ref": "#/definitions/aggregation_type"}, {"type": "null"}]
},
"category": {"oneOf": [{"$ref": "#/definitions/aggregation_type"}, {"type": "null"}]},
"key": {"description": "Name of a metric", "type": ["string", "null"]},
},
"type": "object",
@@ -146,9 +144,7 @@ class AggregationStats(NonStrictDataModel):
_schema = {
"properties": {
"aggregation": {
"oneOf": [{"$ref": "#/definitions/aggregation_type"}, {"type": "null"}]
},
"aggregation": {"oneOf": [{"$ref": "#/definitions/aggregation_type"}, {"type": "null"}]},
"values": {
"description": "List of values corresponding to the dates in metric statistics",
"items": {"type": "number"},
@@ -193,9 +189,7 @@ class AggregationStats(NonStrictDataModel):
self.assert_isinstance(value, "values", (list, tuple))
self.assert_isinstance(
value, "values", six.integer_types + (float,), is_array=True
)
self.assert_isinstance(value, "values", six.integer_types + (float,), is_array=True)
self._property_values = value
@@ -217,7 +211,10 @@ class MetricStats(NonStrictDataModel):
_schema = {
"properties": {
"dates": {
"description": "List of timestamps (in seconds from epoch) in the acceding order. The timestamps are separated by the requested interval. Timestamps where no workers activity was recorded are omitted.",
"description": (
"List of timestamps (in seconds from epoch) in the acceding order. The timestamps are separated by"
" the requested interval. Timestamps where no workers activity was recorded are omitted."
),
"items": {"type": "integer"},
"type": ["array", "null"],
},
@@ -282,9 +279,7 @@ class MetricStats(NonStrictDataModel):
return
self.assert_isinstance(value, "dates", (list, tuple))
value = [
int(v) if isinstance(v, float) and v.is_integer() else v for v in value
]
value = [int(v) if isinstance(v, float) and v.is_integer() else v for v in value]
self.assert_isinstance(value, "dates", six.integer_types, is_array=True)
self._property_dates = value
@@ -301,10 +296,7 @@ class MetricStats(NonStrictDataModel):
self.assert_isinstance(value, "stats", (list, tuple))
if any(isinstance(v, dict) for v in value):
value = [
AggregationStats.from_dict(v) if isinstance(v, dict) else v
for v in value
]
value = [AggregationStats.from_dict(v) if isinstance(v, dict) else v for v in value]
else:
self.assert_isinstance(value, "stats", AggregationStats, is_array=True)
self._property_stats = value
@@ -360,9 +352,7 @@ class WorkerStats(NonStrictDataModel):
self.assert_isinstance(value, "metrics", (list, tuple))
if any(isinstance(v, dict) for v in value):
value = [
MetricStats.from_dict(v) if isinstance(v, dict) else v for v in value
]
value = [MetricStats.from_dict(v) if isinstance(v, dict) else v for v in value]
else:
self.assert_isinstance(value, "metrics", MetricStats, is_array=True)
self._property_metrics = value
@@ -381,12 +371,18 @@ class ActivitySeries(NonStrictDataModel):
_schema = {
"properties": {
"counts": {
"description": "List of worker counts corresponding to the timestamps in the dates list. None values are returned for the dates with no workers.",
"description": (
"List of worker counts corresponding to the timestamps in the dates list. None values are returned"
" for the dates with no workers."
),
"items": {"type": "integer"},
"type": ["array", "null"],
},
"dates": {
"description": "List of timestamps (in seconds from epoch) in the acceding order. The timestamps are separated by the requested interval.",
"description": (
"List of timestamps (in seconds from epoch) in the acceding order. The timestamps are separated by"
" the requested interval."
),
"items": {"type": "integer"},
"type": ["array", "null"],
},
@@ -410,9 +406,7 @@ class ActivitySeries(NonStrictDataModel):
return
self.assert_isinstance(value, "dates", (list, tuple))
value = [
int(v) if isinstance(v, float) and v.is_integer() else v for v in value
]
value = [int(v) if isinstance(v, float) and v.is_integer() else v for v in value]
self.assert_isinstance(value, "dates", six.integer_types, is_array=True)
self._property_dates = value
@@ -428,9 +422,7 @@ class ActivitySeries(NonStrictDataModel):
return
self.assert_isinstance(value, "counts", (list, tuple))
value = [
int(v) if isinstance(v, float) and v.is_integer() else v for v in value
]
value = [int(v) if isinstance(v, float) and v.is_integer() else v for v in value]
self.assert_isinstance(value, "counts", six.integer_types, is_array=True)
self._property_counts = value
@@ -440,8 +432,7 @@ class Worker(NonStrictDataModel):
"""
:param id: Worker ID
:type id: str
:param user: Associated user (under whose credentials are used by the worker
daemon)
:param user: Associated user (under whose credentials are used by the worker daemon)
:type user: IdNameEntry
:param company: Associated company
:type company: IdNameEntry
@@ -463,6 +454,8 @@ class Worker(NonStrictDataModel):
:type queues: Sequence[QueueEntry]
:param tags: User tags for the worker
:type tags: Sequence[str]
:param key: Worker entry key
:type key: str
"""
_schema = {
@@ -473,6 +466,7 @@ class Worker(NonStrictDataModel):
},
"id": {"description": "Worker ID", "type": ["string", "null"]},
"ip": {"description": "IP of the worker", "type": ["string", "null"]},
"key": {"description": "Worker entry key", "type": ["string", "null"]},
"last_activity_time": {
"description": "Last activity time (even if an error occurred)",
"format": "date-time",
@@ -535,6 +529,7 @@ class Worker(NonStrictDataModel):
queue=None,
queues=None,
tags=None,
key=None,
**kwargs
):
super(Worker, self).__init__(**kwargs)
@@ -550,6 +545,7 @@ class Worker(NonStrictDataModel):
self.queue = queue
self.queues = queues
self.tags = tags
self.key = key
@schema_property("id")
def id(self):
@@ -632,9 +628,7 @@ class Worker(NonStrictDataModel):
self._property_last_activity_time = None
return
self.assert_isinstance(
value, "last_activity_time", six.string_types + (datetime,)
)
self.assert_isinstance(value, "last_activity_time", six.string_types + (datetime,))
if not isinstance(value, datetime):
value = parse_datetime(value)
self._property_last_activity_time = value
@@ -649,9 +643,7 @@ class Worker(NonStrictDataModel):
self._property_last_report_time = None
return
self.assert_isinstance(
value, "last_report_time", six.string_types + (datetime,)
)
self.assert_isinstance(value, "last_report_time", six.string_types + (datetime,))
if not isinstance(value, datetime):
value = parse_datetime(value)
self._property_last_report_time = value
@@ -713,9 +705,7 @@ class Worker(NonStrictDataModel):
self.assert_isinstance(value, "queues", (list, tuple))
if any(isinstance(v, dict) for v in value):
value = [
QueueEntry.from_dict(v) if isinstance(v, dict) else v for v in value
]
value = [QueueEntry.from_dict(v) if isinstance(v, dict) else v for v in value]
else:
self.assert_isinstance(value, "queues", QueueEntry, is_array=True)
self._property_queues = value
@@ -735,6 +725,19 @@ class Worker(NonStrictDataModel):
self.assert_isinstance(value, "tags", six.string_types, is_array=True)
self._property_tags = value
@schema_property("key")
def key(self):
return self._property_key
@key.setter
def key(self, value):
if value is None:
self._property_key = None
return
self.assert_isinstance(value, "key", six.string_types)
self._property_key = value
class IdNameEntry(NonStrictDataModel):
"""
@@ -812,9 +815,7 @@ class CurrentTaskEntry(NonStrictDataModel):
"type": "object",
}
def __init__(
self, id=None, name=None, running_time=None, last_iteration=None, **kwargs
):
def __init__(self, id=None, name=None, running_time=None, last_iteration=None, **kwargs):
super(CurrentTaskEntry, self).__init__(**kwargs)
self.id = id
self.name = name
@@ -1116,9 +1117,7 @@ class MachineStats(NonStrictDataModel):
self.assert_isinstance(value, "cpu_usage", (list, tuple))
self.assert_isinstance(
value, "cpu_usage", six.integer_types + (float,), is_array=True
)
self.assert_isinstance(value, "cpu_usage", six.integer_types + (float,), is_array=True)
self._property_cpu_usage = value
@schema_property("gpu_usage")
@@ -1133,9 +1132,7 @@ class MachineStats(NonStrictDataModel):
self.assert_isinstance(value, "gpu_usage", (list, tuple))
self.assert_isinstance(
value, "gpu_usage", six.integer_types + (float,), is_array=True
)
self.assert_isinstance(value, "gpu_usage", six.integer_types + (float,), is_array=True)
self._property_gpu_usage = value
@schema_property("memory_used")
@@ -1179,13 +1176,9 @@ class MachineStats(NonStrictDataModel):
return
self.assert_isinstance(value, "gpu_memory_free", (list, tuple))
value = [
int(v) if isinstance(v, float) and v.is_integer() else v for v in value
]
value = [int(v) if isinstance(v, float) and v.is_integer() else v for v in value]
self.assert_isinstance(
value, "gpu_memory_free", six.integer_types, is_array=True
)
self.assert_isinstance(value, "gpu_memory_free", six.integer_types, is_array=True)
self._property_gpu_memory_free = value
@schema_property("gpu_memory_used")
@@ -1199,13 +1192,9 @@ class MachineStats(NonStrictDataModel):
return
self.assert_isinstance(value, "gpu_memory_used", (list, tuple))
value = [
int(v) if isinstance(v, float) and v.is_integer() else v for v in value
]
value = [int(v) if isinstance(v, float) and v.is_integer() else v for v in value]
self.assert_isinstance(
value, "gpu_memory_used", six.integer_types, is_array=True
)
self.assert_isinstance(value, "gpu_memory_used", six.integer_types, is_array=True)
self._property_gpu_memory_used = value
@schema_property("network_tx")
@@ -1310,9 +1299,7 @@ class MachineStats(NonStrictDataModel):
self.assert_isinstance(value, "cpu_temperature", (list, tuple))
self.assert_isinstance(
value, "cpu_temperature", six.integer_types + (float,), is_array=True
)
self.assert_isinstance(value, "cpu_temperature", six.integer_types + (float,), is_array=True)
self._property_cpu_temperature = value
@schema_property("gpu_temperature")
@@ -1327,9 +1314,7 @@ class MachineStats(NonStrictDataModel):
self.assert_isinstance(value, "gpu_temperature", (list, tuple))
self.assert_isinstance(
value, "gpu_temperature", six.integer_types + (float,), is_array=True
)
self.assert_isinstance(value, "gpu_temperature", six.integer_types + (float,), is_array=True)
self._property_gpu_temperature = value
@@ -1337,13 +1322,11 @@ class GetActivityReportRequest(Request):
"""
Returns count of active company workers in the selected time range.
:param from_date: Starting time (in seconds from epoch) for collecting
statistics
:param from_date: Starting time (in seconds from epoch) for collecting statistics
:type from_date: float
:param to_date: Ending time (in seconds from epoch) for collecting statistics
:type to_date: float
:param interval: Time interval in seconds for a single statistics point. The
minimal value is 1
:param interval: Time interval in seconds for a single statistics point. The minimal value is 1
:type interval: int
"""
@@ -1422,11 +1405,9 @@ class GetActivityReportResponse(Response):
"""
Response of workers.get_activity_report endpoint.
:param total: Activity series that include all the workers that sent reports in
the given time interval.
:param total: Activity series that include all the workers that sent reports in the given time interval.
:type total: ActivitySeries
:param active: Activity series that include only workers that worked on a task
in the given time interval.
:param active: Activity series that include only workers that worked on a task in the given time interval.
:type active: ActivitySeries
"""
@@ -1439,12 +1420,18 @@ class GetActivityReportResponse(Response):
"activity_series": {
"properties": {
"counts": {
"description": "List of worker counts corresponding to the timestamps in the dates list. None values are returned for the dates with no workers.",
"description": (
"List of worker counts corresponding to the timestamps in the dates list. None values are"
" returned for the dates with no workers."
),
"items": {"type": "integer"},
"type": ["array", "null"],
},
"dates": {
"description": "List of timestamps (in seconds from epoch) in the acceding order. The timestamps are separated by the requested interval.",
"description": (
"List of timestamps (in seconds from epoch) in the acceding order. The timestamps are"
" separated by the requested interval."
),
"items": {"type": "integer"},
"type": ["array", "null"],
},
@@ -1454,11 +1441,15 @@ class GetActivityReportResponse(Response):
},
"properties": {
"active": {
"description": "Activity series that include only workers that worked on a task in the given time interval.",
"description": (
"Activity series that include only workers that worked on a task in the given time interval."
),
"oneOf": [{"$ref": "#/definitions/activity_series"}, {"type": "null"}],
},
"total": {
"description": "Activity series that include all the workers that sent reports in the given time interval.",
"description": (
"Activity series that include all the workers that sent reports in the given time interval."
),
"oneOf": [{"$ref": "#/definitions/activity_series"}, {"type": "null"}],
},
},
@@ -1505,11 +1496,10 @@ class GetAllRequest(Request):
"""
Returns information on all registered workers.
:param last_seen: Filter out workers not active for more than last_seen
seconds. A value or 0 or 'none' will disable the filter.
:param last_seen: Filter out workers not active for more than last_seen seconds. A value or 0 or 'none'
will disable the filter.
:type last_seen: int
:param tags: The list of allowed worker tags. Prepend tag value with '-' in
order to exclude
:param tags: The list of allowed worker tags. Prepend tag value with '-' in order to exclude
:type tags: Sequence[str]
"""
@@ -1521,7 +1511,10 @@ class GetAllRequest(Request):
"properties": {
"last_seen": {
"default": 3600,
"description": "Filter out workers not active for more than last_seen seconds.\n A value or 0 or 'none' will disable the filter.",
"description": (
"Filter out workers not active for more than last_seen seconds. A value or 0 or 'none' will "
"disable the filter."
),
"type": ["integer", "null"],
},
"tags": {
@@ -1637,6 +1630,10 @@ class GetAllResponse(Response):
"description": "IP of the worker",
"type": ["string", "null"],
},
"key": {
"description": "Worker entry key",
"type": ["string", "null"],
},
"last_activity_time": {
"description": "Last activity time (even if an error occurred)",
"format": "date-time",
@@ -1741,7 +1738,10 @@ class GetMetricKeysRequest(Request):
"definitions": {},
"properties": {
"worker_ids": {
"description": "List of worker ids to collect metrics for. If not provided or empty then all the company workers metrics are analyzed.",
"description": (
"List of worker ids to collect metrics for. If not provided or empty then all the company workers"
" metrics are analyzed."
),
"items": {"type": "string"},
"type": ["array", "null"],
},
@@ -1773,8 +1773,7 @@ class GetMetricKeysResponse(Response):
"""
Response of workers.get_metric_keys endpoint.
:param categories: List of unique metric categories found in the statistics of
the requested workers.
:param categories: List of unique metric categories found in the statistics of the requested workers.
:type categories: Sequence[MetricsCategory]
"""
@@ -1825,10 +1824,7 @@ class GetMetricKeysResponse(Response):
self.assert_isinstance(value, "categories", (list, tuple))
if any(isinstance(v, dict) for v in value):
value = [
MetricsCategory.from_dict(v) if isinstance(v, dict) else v
for v in value
]
value = [MetricsCategory.from_dict(v) if isinstance(v, dict) else v for v in value]
else:
self.assert_isinstance(value, "categories", MetricsCategory, is_array=True)
self._property_categories = value
@@ -1841,13 +1837,11 @@ class GetStatsRequest(Request):
:param worker_ids: List of worker ids to collect metrics for. If not provided
or empty then all the company workers metrics are analyzed.
:type worker_ids: Sequence[str]
:param from_date: Starting time (in seconds from epoch) for collecting
statistics
:param from_date: Starting time (in seconds from epoch) for collecting statistics
:type from_date: float
:param to_date: Ending time (in seconds from epoch) for collecting statistics
:type to_date: float
:param interval: Time interval in seconds for a single statistics point. The
minimal value is 1
:param interval: Time interval in seconds for a single statistics point. The minimal value is 1
:type interval: int
:param items: List of metric keys and requested statistics
:type items: Sequence[StatItem]
@@ -1905,7 +1899,10 @@ class GetStatsRequest(Request):
"type": "number",
},
"worker_ids": {
"description": "List of worker ids to collect metrics for. If not provided or empty then all the company workers metrics are analyzed.",
"description": (
"List of worker ids to collect metrics for. If not provided or empty then all the company workers"
" metrics are analyzed."
),
"items": {"type": "string"},
"type": ["array", "null"],
},
@@ -1914,16 +1911,7 @@ class GetStatsRequest(Request):
"type": "object",
}
def __init__(
self,
from_date,
to_date,
interval,
items,
worker_ids=None,
split_by_variant=False,
**kwargs
):
def __init__(self, from_date, to_date, interval, items, worker_ids=None, split_by_variant=False, **kwargs):
super(GetStatsRequest, self).__init__(**kwargs)
self.worker_ids = worker_ids
self.from_date = from_date
@@ -2057,7 +2045,11 @@ class GetStatsResponse(Response):
"metric_stats": {
"properties": {
"dates": {
"description": "List of timestamps (in seconds from epoch) in the acceding order. The timestamps are separated by the requested interval. Timestamps where no workers activity was recorded are omitted.",
"description": (
"List of timestamps (in seconds from epoch) in the acceding order. The timestamps are"
" separated by the requested interval. Timestamps where no workers activity was recorded"
" are omitted."
),
"items": {"type": "integer"},
"type": ["array", "null"],
},
@@ -2071,7 +2063,9 @@ class GetStatsResponse(Response):
"type": ["array", "null"],
},
"variant": {
"description": "Name of the metric component. Set only if 'split_by_variant' was set in the request",
"description": (
"Name of the metric component. Set only if 'split_by_variant' was set in the request"
),
"type": ["string", "null"],
},
},
@@ -2118,9 +2112,7 @@ class GetStatsResponse(Response):
self.assert_isinstance(value, "workers", (list, tuple))
if any(isinstance(v, dict) for v in value):
value = [
WorkerStats.from_dict(v) if isinstance(v, dict) else v for v in value
]
value = [WorkerStats.from_dict(v) if isinstance(v, dict) else v for v in value]
else:
self.assert_isinstance(value, "workers", WorkerStats, is_array=True)
self._property_workers = value
@@ -2160,7 +2152,11 @@ class RegisterRequest(Request):
},
"timeout": {
"default": 600,
"description": "Registration timeout in seconds. If timeout seconds have passed since the worker's last call to register or status_report, the worker is automatically removed from the list of registered workers.",
"description": (
"Registration timeout in seconds. If timeout seconds have passed since the worker's last call to"
" register or status_report, the worker is automatically removed from the list of registered"
" workers."
),
"type": "integer",
},
"worker": {
@@ -2257,14 +2253,14 @@ class StatusReportRequest(Request):
:param worker: Worker id.
:type worker: str
:param task: ID of a task currently being run by the worker. If no task is
sent, the worker's task field will be cleared.
:param task: ID of a task currently being run by the worker. If no task is sent, the worker's task field
will be cleared.
:type task: str
:param queue: ID of the queue from which task was received. If no queue is
sent, the worker's queue field will be cleared.
:param queue: ID of the queue from which task was received. If no queue is sent, the worker's queue field
will be cleared.
:type queue: str
:param queues: List of queue IDs on which the worker is listening. If null, the
worker's queues list will not be updated.
:param queues: List of queue IDs on which the worker is listening. If null, the worker's queues list
will not be updated.
:type queues: Sequence[str]
:param timestamp: UNIX time in seconds since epoch.
:type timestamp: int
@@ -2353,11 +2349,17 @@ class StatusReportRequest(Request):
"description": "The machine statistics.",
},
"queue": {
"description": "ID of the queue from which task was received. If no queue is sent, the worker's queue field will be cleared.",
"description": (
"ID of the queue from which task was received. If no queue is sent, the worker's queue field will"
" be cleared."
),
"type": "string",
},
"queues": {
"description": "List of queue IDs on which the worker is listening. If null, the worker's queues list will not be updated.",
"description": (
"List of queue IDs on which the worker is listening. If null, the worker's queues list will not be"
" updated."
),
"items": {"type": "string"},
"type": "array",
},
@@ -2367,7 +2369,10 @@ class StatusReportRequest(Request):
"type": "array",
},
"task": {
"description": "ID of a task currently being run by the worker. If no task is sent, the worker's task field will be cleared.",
"description": (
"ID of a task currently being run by the worker. If no task is sent, the worker's task field will"
" be cleared."
),
"type": "string",
},
"timestamp": {
@@ -2380,17 +2385,7 @@ class StatusReportRequest(Request):
"type": "object",
}
def __init__(
self,
worker,
timestamp,
task=None,
queue=None,
queues=None,
machine_stats=None,
tags=None,
**kwargs
):
def __init__(self, worker, timestamp, task=None, queue=None, queues=None, machine_stats=None, tags=None, **kwargs):
super(StatusReportRequest, self).__init__(**kwargs)
self.worker = worker
self.task = task