h2o-workflows 0.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. h2o_workflows/__init__.py +3 -0
  2. h2o_workflows/_version.py +3 -0
  3. h2o_workflows/auth/__init__.py +0 -0
  4. h2o_workflows/auth/token_api_client.py +25 -0
  5. h2o_workflows/connection_config.py +116 -0
  6. h2o_workflows/exception.py +28 -0
  7. h2o_workflows/gen/__init__.py +27 -0
  8. h2o_workflows/gen/api/__init__.py +3 -0
  9. h2o_workflows/gen/api/job_service_api.py +342 -0
  10. h2o_workflows/gen/api/run_attempt_service_api.py +330 -0
  11. h2o_workflows/gen/api/run_service_api.py +772 -0
  12. h2o_workflows/gen/api/runner_service_api.py +789 -0
  13. h2o_workflows/gen/api/step_service_api.py +616 -0
  14. h2o_workflows/gen/api/workflow_revision_service_api.py +482 -0
  15. h2o_workflows/gen/api/workflow_service_api.py +1233 -0
  16. h2o_workflows/gen/api_client.py +896 -0
  17. h2o_workflows/gen/apis/__init__.py +23 -0
  18. h2o_workflows/gen/configuration.py +446 -0
  19. h2o_workflows/gen/exceptions.py +158 -0
  20. h2o_workflows/gen/model/__init__.py +5 -0
  21. h2o_workflows/gen/model/job_job_failure_reason.py +285 -0
  22. h2o_workflows/gen/model/protobuf_any.py +263 -0
  23. h2o_workflows/gen/model/required_the_runner_to_update.py +303 -0
  24. h2o_workflows/gen/model/required_the_workflow_to_update.py +325 -0
  25. h2o_workflows/gen/model/retry_run_request_retry_mode.py +283 -0
  26. h2o_workflows/gen/model/rpc_status.py +277 -0
  27. h2o_workflows/gen/model/run_attempt_run_attempt_failure_reason.py +285 -0
  28. h2o_workflows/gen/model/run_run_failure_reason.py +285 -0
  29. h2o_workflows/gen/model/run_service_retry_run_request.py +269 -0
  30. h2o_workflows/gen/model/run_trigger.py +284 -0
  31. h2o_workflows/gen/model/step_step_failure_reason.py +285 -0
  32. h2o_workflows/gen/model/stream_result_of_v1_stream_step_logs_response.py +275 -0
  33. h2o_workflows/gen/model/v1_activate_workflow_response.py +269 -0
  34. h2o_workflows/gen/model/v1_bool_input_definition.py +281 -0
  35. h2o_workflows/gen/model/v1_bool_input_value.py +275 -0
  36. h2o_workflows/gen/model/v1_cancel_run_response.py +269 -0
  37. h2o_workflows/gen/model/v1_create_runner_response.py +269 -0
  38. h2o_workflows/gen/model/v1_create_workflow_response.py +269 -0
  39. h2o_workflows/gen/model/v1_deactivate_workflow_response.py +269 -0
  40. h2o_workflows/gen/model/v1_get_job_response.py +269 -0
  41. h2o_workflows/gen/model/v1_get_run_attempt_response.py +269 -0
  42. h2o_workflows/gen/model/v1_get_run_response.py +269 -0
  43. h2o_workflows/gen/model/v1_get_runner_response.py +269 -0
  44. h2o_workflows/gen/model/v1_get_step_logs_response.py +268 -0
  45. h2o_workflows/gen/model/v1_get_step_response.py +269 -0
  46. h2o_workflows/gen/model/v1_get_workflow_response.py +269 -0
  47. h2o_workflows/gen/model/v1_get_workflow_revision_response.py +269 -0
  48. h2o_workflows/gen/model/v1_input_definitions.py +281 -0
  49. h2o_workflows/gen/model/v1_input_values.py +281 -0
  50. h2o_workflows/gen/model/v1_int_input_definition.py +281 -0
  51. h2o_workflows/gen/model/v1_int_input_value.py +275 -0
  52. h2o_workflows/gen/model/v1_job.py +335 -0
  53. h2o_workflows/gen/model/v1_job_state.py +286 -0
  54. h2o_workflows/gen/model/v1_job_type.py +283 -0
  55. h2o_workflows/gen/model/v1_list_jobs_response.py +273 -0
  56. h2o_workflows/gen/model/v1_list_run_attempts_response.py +273 -0
  57. h2o_workflows/gen/model/v1_list_runners_response.py +273 -0
  58. h2o_workflows/gen/model/v1_list_runs_response.py +273 -0
  59. h2o_workflows/gen/model/v1_list_steps_response.py +273 -0
  60. h2o_workflows/gen/model/v1_list_workflow_revisions_response.py +273 -0
  61. h2o_workflows/gen/model/v1_list_workflows_response.py +273 -0
  62. h2o_workflows/gen/model/v1_retry_run_response.py +269 -0
  63. h2o_workflows/gen/model/v1_run.py +326 -0
  64. h2o_workflows/gen/model/v1_run_attempt.py +304 -0
  65. h2o_workflows/gen/model/v1_run_attempt_state.py +285 -0
  66. h2o_workflows/gen/model/v1_run_state.py +286 -0
  67. h2o_workflows/gen/model/v1_run_workflow_revision_response.py +269 -0
  68. h2o_workflows/gen/model/v1_runner.py +307 -0
  69. h2o_workflows/gen/model/v1_step.py +315 -0
  70. h2o_workflows/gen/model/v1_step_state.py +286 -0
  71. h2o_workflows/gen/model/v1_step_type.py +284 -0
  72. h2o_workflows/gen/model/v1_stream_step_logs_response.py +274 -0
  73. h2o_workflows/gen/model/v1_string_input_definition.py +285 -0
  74. h2o_workflows/gen/model/v1_string_input_value.py +275 -0
  75. h2o_workflows/gen/model/v1_update_runner_response.py +269 -0
  76. h2o_workflows/gen/model/v1_update_workflow_response.py +269 -0
  77. h2o_workflows/gen/model/v1_validate_workflow_response.py +273 -0
  78. h2o_workflows/gen/model/v1_validation_error.py +285 -0
  79. h2o_workflows/gen/model/v1_workflow.py +329 -0
  80. h2o_workflows/gen/model/v1_workflow_revision.py +304 -0
  81. h2o_workflows/gen/model/v1_workflow_revision_state.py +283 -0
  82. h2o_workflows/gen/model/v1_workflow_state.py +283 -0
  83. h2o_workflows/gen/model/validation_error_severity.py +284 -0
  84. h2o_workflows/gen/model/workflow_revision_service_run_workflow_revision_request.py +269 -0
  85. h2o_workflows/gen/model/workflow_service_validate_workflow_request.py +269 -0
  86. h2o_workflows/gen/model_utils.py +2056 -0
  87. h2o_workflows/gen/models/__init__.py +76 -0
  88. h2o_workflows/gen/rest.py +352 -0
  89. h2o_workflows/inputs.py +195 -0
  90. h2o_workflows/job/__init__.py +0 -0
  91. h2o_workflows/job/client.py +92 -0
  92. h2o_workflows/job/job.py +142 -0
  93. h2o_workflows/job/page.py +33 -0
  94. h2o_workflows/login.py +182 -0
  95. h2o_workflows/run/__init__.py +0 -0
  96. h2o_workflows/run/client.py +136 -0
  97. h2o_workflows/run/page.py +33 -0
  98. h2o_workflows/run/run.py +141 -0
  99. h2o_workflows/run_attempt/__init__.py +0 -0
  100. h2o_workflows/run_attempt/client.py +80 -0
  101. h2o_workflows/run_attempt/page.py +37 -0
  102. h2o_workflows/run_attempt/run_attempt.py +95 -0
  103. h2o_workflows/runner/__init__.py +0 -0
  104. h2o_workflows/runner/client.py +196 -0
  105. h2o_workflows/runner/page.py +33 -0
  106. h2o_workflows/runner/runner.py +76 -0
  107. h2o_workflows/runner/runner_config.py +24 -0
  108. h2o_workflows/step/__init__.py +0 -0
  109. h2o_workflows/step/client.py +129 -0
  110. h2o_workflows/step/page.py +33 -0
  111. h2o_workflows/step/step.py +122 -0
  112. h2o_workflows/workflow/__init__.py +0 -0
  113. h2o_workflows/workflow/client.py +205 -0
  114. h2o_workflows/workflow/page.py +33 -0
  115. h2o_workflows/workflow/validate_response.py +79 -0
  116. h2o_workflows/workflow/workflow.py +98 -0
  117. h2o_workflows/workflow_revision/__init__.py +0 -0
  118. h2o_workflows/workflow_revision/client.py +116 -0
  119. h2o_workflows/workflow_revision/page.py +40 -0
  120. h2o_workflows/workflow_revision/workflow_revision.py +67 -0
  121. h2o_workflows-0.2.0.dist-info/METADATA +10 -0
  122. h2o_workflows-0.2.0.dist-info/RECORD +123 -0
  123. h2o_workflows-0.2.0.dist-info/WHEEL +4 -0
@@ -0,0 +1,3 @@
1
+ from h2o_workflows._version import __version__ # noqa: F401
2
+ from h2o_workflows.login import login # noqa: F401
3
+ from h2o_workflows.login import login_custom # noqa: F401
@@ -0,0 +1,3 @@
1
+ from importlib.metadata import version
2
+
3
+ __version__ = version("h2o_workflows")
File without changes
@@ -0,0 +1,25 @@
1
+ from typing import Callable
2
+
3
+ from h2o_workflows.gen.api_client import ApiClient
4
+ from h2o_workflows.gen.api_client import Configuration
5
+
6
+
7
+ class TokenApiClient(ApiClient):
8
+ """Overrides update_params_for_auth method of the generated ApiClient classes"""
9
+
10
+ def __init__(self, configuration: Configuration, token_provider: Callable[[], str]):
11
+ self._token_provider = token_provider
12
+ super().__init__(configuration=configuration)
13
+
14
+ def update_params_for_auth(
15
+ self,
16
+ headers,
17
+ queries,
18
+ auth_settings,
19
+ resource_path,
20
+ method,
21
+ body,
22
+ request_auths=None,
23
+ ):
24
+ token = self._token_provider()
25
+ headers["Authorization"] = f"Bearer {token}"
@@ -0,0 +1,116 @@
1
+ import ssl
2
+ from typing import NamedTuple
3
+ from typing import Optional
4
+
5
+ import h2o_authn
6
+ import h2o_discovery
7
+ from h2o_authn import TokenProvider
8
+
9
+ # Name of the platform client in the discovery response.
10
+ PLATFORM_CLIENT_NAME = "platform"
11
+ # Name of the Workflows service in the discovery response.
12
+ WORKFLOWS_SERVICE_NAME = "workflows"
13
+
14
+
15
+ class ConnectionConfig(NamedTuple):
16
+ """Object holding connection configuration for the Workflows server."""
17
+
18
+ workflows_url: str
19
+ token_provider: TokenProvider
20
+
21
+
22
+ def get_connection(
23
+ workflows_url: str,
24
+ refresh_token: str,
25
+ issuer_url: str,
26
+ client_id: str,
27
+ client_secret: Optional[str],
28
+ verify_ssl: bool,
29
+ ssl_ca_cert: Optional[str],
30
+ ) -> ConnectionConfig:
31
+ """Creates ConnectionConfig object. Initializes and tests token provider."""
32
+ ssl_context = ssl.create_default_context(cafile=ssl_ca_cert) # Will use system store if None
33
+ if not verify_ssl:
34
+ ssl_context.check_hostname = False
35
+ ssl_context.verify_mode = ssl.CERT_NONE
36
+
37
+ # init token provider
38
+ tp = h2o_authn.TokenProvider(
39
+ issuer_url=issuer_url,
40
+ refresh_token=refresh_token,
41
+ client_id=client_id,
42
+ client_secret=client_secret,
43
+ http_ssl_context=ssl_context,
44
+ )
45
+ # test token refresh
46
+ tp()
47
+
48
+ return ConnectionConfig(workflows_url=workflows_url, token_provider=tp)
49
+
50
+
51
+ def discover_platform_connection(
52
+ environment_url: Optional[str] = None,
53
+ config_path: Optional[str] = None,
54
+ platform_token: Optional[str] = None,
55
+ token_provider: Optional[TokenProvider] = None,
56
+ ssl_context: Optional[ssl.SSLContext] = None,
57
+ ) -> ConnectionConfig:
58
+ """Creates ConnectionConfig object by discovering platform connection configuration using h2o_discovery.
59
+
60
+ :param environment_url: Override for the URL of the environment passed to the discovery service.
61
+ :param config_path: Override path to the h2o cli config file passed to the discovery service.
62
+ :param platform_token: Platform token. If not provided, the token will be discovered.
63
+ :param token_provider: Token provider. If not provided, the provider will be constructed from the discovered config.
64
+ :param ssl_context: SSL context to use for the discovery client.
65
+ """
66
+ # Discover the Workflows server URL
67
+ d = h2o_discovery.discover(environment=environment_url, config_path=config_path, ssl_context=ssl_context)
68
+
69
+ workflows_service = d.services.get(WORKFLOWS_SERVICE_NAME)
70
+ if workflows_service is None:
71
+ raise Exception("Workflows service is not registered in discovery service")
72
+
73
+ workflows_url = workflows_service.uri
74
+ if not workflows_url:
75
+ raise ConnectionError("Unable to discover Workflows server URL connection value.")
76
+
77
+ # If the token provider is provided, use it to construct the connection config.
78
+ if token_provider is not None:
79
+ # Test token refresh
80
+ token_provider()
81
+ return ConnectionConfig(workflows_url=workflows_url, token_provider=token_provider)
82
+
83
+ # If the token provider is not provided, construct it from the discovered config.
84
+ if not platform_token:
85
+ platform_client_credentials = d.credentials[PLATFORM_CLIENT_NAME]
86
+ if platform_client_credentials is None:
87
+ raise Exception("Platform client credentials are not available in discovery service")
88
+
89
+ platform_token = platform_client_credentials.refresh_token
90
+
91
+ if not platform_token:
92
+ raise ValueError(
93
+ "Please set the 'platform_token' argument or configure the H2O CLI."
94
+ )
95
+
96
+ # Discover client id
97
+ platform_client = d.clients.get(PLATFORM_CLIENT_NAME)
98
+ if platform_client is None:
99
+ raise Exception("platform client is not registered in discovery service")
100
+
101
+ client_id = platform_client.oauth2_client_id
102
+ if not client_id:
103
+ raise ConnectionError(
104
+ "Unable to discover platform oauth2_client_id connection value."
105
+ )
106
+
107
+ tp = h2o_authn.TokenProvider(
108
+ issuer_url=d.environment.issuer_url,
109
+ client_id=client_id,
110
+ refresh_token=platform_token,
111
+ http_ssl_context=ssl_context,
112
+ )
113
+ # Test token refresh
114
+ tp()
115
+
116
+ return ConnectionConfig(workflows_url=workflows_url, token_provider=tp)
@@ -0,0 +1,28 @@
1
+ import json
2
+
3
+ from h2o_workflows.gen import ApiException
4
+
5
+
6
+ class CustomApiException(ApiException):
7
+ """ApiException with simplified error message."""
8
+
9
+ def __init__(self, e: ApiException):
10
+ self.status = e.status
11
+ self.reason = e.reason
12
+ self.body = e.body
13
+ self.headers = e.headers
14
+
15
+ def __str__(self):
16
+ status_reason = f"{self.status} ({self.reason})"
17
+ message = self.body
18
+
19
+ if message is None:
20
+ return status_reason
21
+
22
+ try:
23
+ body_json = json.loads(self.body)
24
+ message = body_json["message"]
25
+ except (ValueError, KeyError):
26
+ pass
27
+
28
+ return f"{status_reason}: {message}"
@@ -0,0 +1,27 @@
1
+ # flake8: noqa
2
+
3
+ """
4
+ ai/h2o/workflows/v1/input.proto
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
7
+
8
+ The version of the OpenAPI document: version not set
9
+ Generated by: https://openapi-generator.tech
10
+ """
11
+
12
+
13
+ __version__ = "0.2.0"
14
+
15
+ # import ApiClient
16
+ from h2o_workflows.gen.api_client import ApiClient
17
+
18
+ # import Configuration
19
+ from h2o_workflows.gen.configuration import Configuration
20
+
21
+ # import exceptions
22
+ from h2o_workflows.gen.exceptions import OpenApiException
23
+ from h2o_workflows.gen.exceptions import ApiAttributeError
24
+ from h2o_workflows.gen.exceptions import ApiTypeError
25
+ from h2o_workflows.gen.exceptions import ApiValueError
26
+ from h2o_workflows.gen.exceptions import ApiKeyError
27
+ from h2o_workflows.gen.exceptions import ApiException
@@ -0,0 +1,3 @@
1
+ # do not import all apis into this module because that uses a lot of memory and stack frames
2
+ # if you need the ability to import all apis from one package, import them with
3
+ # from h2o_workflows.gen.apis import JobServiceApi
@@ -0,0 +1,342 @@
1
+ """
2
+ ai/h2o/workflows/v1/input.proto
3
+
4
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
5
+
6
+ The version of the OpenAPI document: version not set
7
+ Generated by: https://openapi-generator.tech
8
+ """
9
+
10
+
11
+ import re # noqa: F401
12
+ import sys # noqa: F401
13
+
14
+ from h2o_workflows.gen.api_client import ApiClient, Endpoint as _Endpoint
15
+ from h2o_workflows.gen.model_utils import ( # noqa: F401
16
+ check_allowed_values,
17
+ check_validations,
18
+ date,
19
+ datetime,
20
+ file_type,
21
+ none_type,
22
+ validate_and_convert_types
23
+ )
24
+ from h2o_workflows.gen.model.rpc_status import RpcStatus
25
+ from h2o_workflows.gen.model.v1_get_job_response import V1GetJobResponse
26
+ from h2o_workflows.gen.model.v1_list_jobs_response import V1ListJobsResponse
27
+
28
+
29
+ class JobServiceApi(object):
30
+ """NOTE: This class is auto generated by OpenAPI Generator
31
+ Ref: https://openapi-generator.tech
32
+
33
+ Do not edit the class manually.
34
+ """
35
+
36
+ def __init__(self, api_client=None):
37
+ if api_client is None:
38
+ api_client = ApiClient()
39
+ self.api_client = api_client
40
+ self.job_service_get_job_endpoint = _Endpoint(
41
+ settings={
42
+ 'response_type': (V1GetJobResponse,),
43
+ 'auth': [],
44
+ 'endpoint_path': '/v1/{name}',
45
+ 'operation_id': 'job_service_get_job',
46
+ 'http_method': 'GET',
47
+ 'servers': None,
48
+ },
49
+ params_map={
50
+ 'all': [
51
+ 'name',
52
+ ],
53
+ 'required': [
54
+ 'name',
55
+ ],
56
+ 'nullable': [
57
+ ],
58
+ 'enum': [
59
+ ],
60
+ 'validation': [
61
+ 'name',
62
+ ]
63
+ },
64
+ root_map={
65
+ 'validations': {
66
+ ('name',): {
67
+
68
+ 'regex': {
69
+ 'pattern': r'workspaces\/[^\/]+\/workflows\/[^\/]+\/revisions\/[^\/]+\/runs\/[^\/]+\/attempts\/[^\/]+\/jobs\/[^\/]+', # noqa: E501
70
+ },
71
+ },
72
+ },
73
+ 'allowed_values': {
74
+ },
75
+ 'openapi_types': {
76
+ 'name':
77
+ (str,),
78
+ },
79
+ 'attribute_map': {
80
+ 'name': 'name',
81
+ },
82
+ 'location_map': {
83
+ 'name': 'path',
84
+ },
85
+ 'collection_format_map': {
86
+ }
87
+ },
88
+ headers_map={
89
+ 'accept': [
90
+ 'application/json'
91
+ ],
92
+ 'content_type': [],
93
+ },
94
+ api_client=api_client
95
+ )
96
+ self.job_service_list_jobs_endpoint = _Endpoint(
97
+ settings={
98
+ 'response_type': (V1ListJobsResponse,),
99
+ 'auth': [],
100
+ 'endpoint_path': '/v1/{parent}/jobs',
101
+ 'operation_id': 'job_service_list_jobs',
102
+ 'http_method': 'GET',
103
+ 'servers': None,
104
+ },
105
+ params_map={
106
+ 'all': [
107
+ 'parent',
108
+ 'page_size',
109
+ 'page_token',
110
+ 'filter',
111
+ 'order_by',
112
+ ],
113
+ 'required': [
114
+ 'parent',
115
+ ],
116
+ 'nullable': [
117
+ ],
118
+ 'enum': [
119
+ ],
120
+ 'validation': [
121
+ 'parent',
122
+ ]
123
+ },
124
+ root_map={
125
+ 'validations': {
126
+ ('parent',): {
127
+
128
+ 'regex': {
129
+ 'pattern': r'workspaces\/[^\/]+\/workflows\/[^\/]+\/revisions\/[^\/]+\/runs\/[^\/]+\/attempts\/[^\/]+', # noqa: E501
130
+ },
131
+ },
132
+ },
133
+ 'allowed_values': {
134
+ },
135
+ 'openapi_types': {
136
+ 'parent':
137
+ (str,),
138
+ 'page_size':
139
+ (int,),
140
+ 'page_token':
141
+ (str,),
142
+ 'filter':
143
+ (str,),
144
+ 'order_by':
145
+ (str,),
146
+ },
147
+ 'attribute_map': {
148
+ 'parent': 'parent',
149
+ 'page_size': 'pageSize',
150
+ 'page_token': 'pageToken',
151
+ 'filter': 'filter',
152
+ 'order_by': 'orderBy',
153
+ },
154
+ 'location_map': {
155
+ 'parent': 'path',
156
+ 'page_size': 'query',
157
+ 'page_token': 'query',
158
+ 'filter': 'query',
159
+ 'order_by': 'query',
160
+ },
161
+ 'collection_format_map': {
162
+ }
163
+ },
164
+ headers_map={
165
+ 'accept': [
166
+ 'application/json'
167
+ ],
168
+ 'content_type': [],
169
+ },
170
+ api_client=api_client
171
+ )
172
+
173
+ def job_service_get_job(
174
+ self,
175
+ name,
176
+ **kwargs
177
+ ):
178
+ """Gets a job. # noqa: E501
179
+
180
+ Requires `actions/workflows/jobs/GET` on parent workspace. # noqa: E501
181
+ This method makes a synchronous HTTP request by default. To make an
182
+ asynchronous HTTP request, please pass async_req=True
183
+
184
+ >>> thread = api.job_service_get_job(name, async_req=True)
185
+ >>> result = thread.get()
186
+
187
+ Args:
188
+ name (str): Required. The resource name of the job to retrieve. Format: `workspaces/{workspace}/workflows/{workflow}/revisions/{revision}/runs/{run}/attempts/{attempt}/jobs/{job}`
189
+
190
+ Keyword Args:
191
+ _return_http_data_only (bool): response data without head status
192
+ code and headers. Default is True.
193
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
194
+ will be returned without reading/decoding response data.
195
+ Default is True.
196
+ _request_timeout (int/float/tuple): timeout setting for this request. If
197
+ one number provided, it will be total request timeout. It can also
198
+ be a pair (tuple) of (connection, read) timeouts.
199
+ Default is None.
200
+ _check_input_type (bool): specifies if type checking
201
+ should be done one the data sent to the server.
202
+ Default is True.
203
+ _check_return_type (bool): specifies if type checking
204
+ should be done one the data received from the server.
205
+ Default is True.
206
+ _spec_property_naming (bool): True if the variable names in the input data
207
+ are serialized names, as specified in the OpenAPI document.
208
+ False if the variable names in the input data
209
+ are pythonic names, e.g. snake case (default)
210
+ _content_type (str/None): force body content-type.
211
+ Default is None and content-type will be predicted by allowed
212
+ content-types and body.
213
+ _host_index (int/None): specifies the index of the server
214
+ that we want to use.
215
+ Default is read from the configuration.
216
+ _request_auths (list): set to override the auth_settings for an a single
217
+ request; this effectively ignores the authentication
218
+ in the spec for a single request.
219
+ Default is None
220
+ async_req (bool): execute request asynchronously
221
+
222
+ Returns:
223
+ V1GetJobResponse
224
+ If the method is called asynchronously, returns the request
225
+ thread.
226
+ """
227
+ kwargs['async_req'] = kwargs.get(
228
+ 'async_req', False
229
+ )
230
+ kwargs['_return_http_data_only'] = kwargs.get(
231
+ '_return_http_data_only', True
232
+ )
233
+ kwargs['_preload_content'] = kwargs.get(
234
+ '_preload_content', True
235
+ )
236
+ kwargs['_request_timeout'] = kwargs.get(
237
+ '_request_timeout', None
238
+ )
239
+ kwargs['_check_input_type'] = kwargs.get(
240
+ '_check_input_type', True
241
+ )
242
+ kwargs['_check_return_type'] = kwargs.get(
243
+ '_check_return_type', True
244
+ )
245
+ kwargs['_spec_property_naming'] = kwargs.get(
246
+ '_spec_property_naming', False
247
+ )
248
+ kwargs['_content_type'] = kwargs.get(
249
+ '_content_type')
250
+ kwargs['_host_index'] = kwargs.get('_host_index')
251
+ kwargs['_request_auths'] = kwargs.get('_request_auths', None)
252
+ kwargs['name'] = \
253
+ name
254
+ return self.job_service_get_job_endpoint.call_with_http_info(**kwargs)
255
+
256
+ def job_service_list_jobs(
257
+ self,
258
+ parent,
259
+ **kwargs
260
+ ):
261
+ """Lists jobs within a run attempt. # noqa: E501
262
+
263
+ Requires `actions/workflows/jobs/LIST` on parent workspace. # noqa: E501
264
+ This method makes a synchronous HTTP request by default. To make an
265
+ asynchronous HTTP request, please pass async_req=True
266
+
267
+ >>> thread = api.job_service_list_jobs(parent, async_req=True)
268
+ >>> result = thread.get()
269
+
270
+ Args:
271
+ parent (str): Required. The run attempt whose jobs to list. Format: `workspaces/{workspace}/workflows/{workflow}/revisions/{revision}/runs/{run}/attempts/{attempt}`
272
+
273
+ Keyword Args:
274
+ page_size (int): The maximum number of jobs to return. The service may return fewer. If unspecified, at most 50 jobs will be returned. The maximum value is 500; values above 500 will be coerced to 500.. [optional]
275
+ page_token (str): A page token, received from a previous `ListJobs` call. Provide this to retrieve the next page.. [optional]
276
+ filter (str): Filter expression to filter jobs. Supported fields: `state`, `job_id`, `type`. [optional]
277
+ order_by (str): Sort order for jobs. Defaults to `create_time desc`. Supported fields: `create_time`, `job_id`. [optional]
278
+ _return_http_data_only (bool): response data without head status
279
+ code and headers. Default is True.
280
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
281
+ will be returned without reading/decoding response data.
282
+ Default is True.
283
+ _request_timeout (int/float/tuple): timeout setting for this request. If
284
+ one number provided, it will be total request timeout. It can also
285
+ be a pair (tuple) of (connection, read) timeouts.
286
+ Default is None.
287
+ _check_input_type (bool): specifies if type checking
288
+ should be done one the data sent to the server.
289
+ Default is True.
290
+ _check_return_type (bool): specifies if type checking
291
+ should be done one the data received from the server.
292
+ Default is True.
293
+ _spec_property_naming (bool): True if the variable names in the input data
294
+ are serialized names, as specified in the OpenAPI document.
295
+ False if the variable names in the input data
296
+ are pythonic names, e.g. snake case (default)
297
+ _content_type (str/None): force body content-type.
298
+ Default is None and content-type will be predicted by allowed
299
+ content-types and body.
300
+ _host_index (int/None): specifies the index of the server
301
+ that we want to use.
302
+ Default is read from the configuration.
303
+ _request_auths (list): set to override the auth_settings for an a single
304
+ request; this effectively ignores the authentication
305
+ in the spec for a single request.
306
+ Default is None
307
+ async_req (bool): execute request asynchronously
308
+
309
+ Returns:
310
+ V1ListJobsResponse
311
+ If the method is called asynchronously, returns the request
312
+ thread.
313
+ """
314
+ kwargs['async_req'] = kwargs.get(
315
+ 'async_req', False
316
+ )
317
+ kwargs['_return_http_data_only'] = kwargs.get(
318
+ '_return_http_data_only', True
319
+ )
320
+ kwargs['_preload_content'] = kwargs.get(
321
+ '_preload_content', True
322
+ )
323
+ kwargs['_request_timeout'] = kwargs.get(
324
+ '_request_timeout', None
325
+ )
326
+ kwargs['_check_input_type'] = kwargs.get(
327
+ '_check_input_type', True
328
+ )
329
+ kwargs['_check_return_type'] = kwargs.get(
330
+ '_check_return_type', True
331
+ )
332
+ kwargs['_spec_property_naming'] = kwargs.get(
333
+ '_spec_property_naming', False
334
+ )
335
+ kwargs['_content_type'] = kwargs.get(
336
+ '_content_type')
337
+ kwargs['_host_index'] = kwargs.get('_host_index')
338
+ kwargs['_request_auths'] = kwargs.get('_request_auths', None)
339
+ kwargs['parent'] = \
340
+ parent
341
+ return self.job_service_list_jobs_endpoint.call_with_http_info(**kwargs)
342
+