|
17 | 17 | ListJobRunsRequestOrderBy,
|
18 | 18 | CreateJobDefinitionRequest,
|
19 | 19 | CreateJobDefinitionRequestCronScheduleConfig,
|
| 20 | + CreateJobDefinitionSecretsRequest, |
| 21 | + CreateJobDefinitionSecretsRequestSecretConfig, |
| 22 | + CreateJobDefinitionSecretsResponse, |
20 | 23 | JobDefinition,
|
21 | 24 | JobRun,
|
| 25 | + ListJobDefinitionSecretsResponse, |
22 | 26 | ListJobDefinitionsResponse,
|
23 | 27 | ListJobRunsResponse,
|
24 | 28 | ListJobsResourcesResponse,
|
| 29 | + Secret, |
25 | 30 | StartJobDefinitionRequest,
|
26 | 31 | StartJobDefinitionResponse,
|
27 | 32 | UpdateJobDefinitionRequest,
|
28 | 33 | UpdateJobDefinitionRequestCronScheduleConfig,
|
| 34 | + UpdateJobDefinitionSecretRequest, |
29 | 35 | )
|
30 | 36 | from .marshalling import (
|
| 37 | + unmarshal_Secret, |
31 | 38 | unmarshal_JobDefinition,
|
32 | 39 | unmarshal_JobRun,
|
| 40 | + unmarshal_CreateJobDefinitionSecretsResponse, |
| 41 | + unmarshal_ListJobDefinitionSecretsResponse, |
33 | 42 | unmarshal_ListJobDefinitionsResponse,
|
34 | 43 | unmarshal_ListJobRunsResponse,
|
35 | 44 | unmarshal_ListJobsResourcesResponse,
|
36 | 45 | unmarshal_StartJobDefinitionResponse,
|
37 | 46 | marshal_CreateJobDefinitionRequest,
|
| 47 | + marshal_CreateJobDefinitionSecretsRequest, |
38 | 48 | marshal_StartJobDefinitionRequest,
|
39 | 49 | marshal_UpdateJobDefinitionRequest,
|
| 50 | + marshal_UpdateJobDefinitionSecretRequest, |
40 | 51 | )
|
41 | 52 |
|
42 | 53 |
|
@@ -395,6 +406,216 @@ async def start_job_definition(
|
395 | 406 | self._throw_on_error(res)
|
396 | 407 | return unmarshal_StartJobDefinitionResponse(res.json())
|
397 | 408 |
|
| 409 | + async def create_job_definition_secrets( |
| 410 | + self, |
| 411 | + *, |
| 412 | + job_definition_id: str, |
| 413 | + secrets: List[CreateJobDefinitionSecretsRequestSecretConfig], |
| 414 | + region: Optional[Region] = None, |
| 415 | + ) -> CreateJobDefinitionSecretsResponse: |
| 416 | + """ |
| 417 | + :param job_definition_id: UUID of the job definition to get. |
| 418 | + :param secrets: Secrets to inject into the job. |
| 419 | + :param region: Region to target. If none is passed will use default region from the config. |
| 420 | + :return: :class:`CreateJobDefinitionSecretsResponse <CreateJobDefinitionSecretsResponse>` |
| 421 | +
|
| 422 | + Usage: |
| 423 | + :: |
| 424 | +
|
| 425 | + result = await api.create_job_definition_secrets( |
| 426 | + job_definition_id="example", |
| 427 | + secrets=[], |
| 428 | + ) |
| 429 | + """ |
| 430 | + |
| 431 | + param_region = validate_path_param( |
| 432 | + "region", region or self.client.default_region |
| 433 | + ) |
| 434 | + param_job_definition_id = validate_path_param( |
| 435 | + "job_definition_id", job_definition_id |
| 436 | + ) |
| 437 | + |
| 438 | + res = self._request( |
| 439 | + "POST", |
| 440 | + f"/serverless-jobs/v1alpha1/regions/{param_region}/job-definitions/{param_job_definition_id}/secrets", |
| 441 | + body=marshal_CreateJobDefinitionSecretsRequest( |
| 442 | + CreateJobDefinitionSecretsRequest( |
| 443 | + job_definition_id=job_definition_id, |
| 444 | + secrets=secrets, |
| 445 | + region=region, |
| 446 | + ), |
| 447 | + self.client, |
| 448 | + ), |
| 449 | + ) |
| 450 | + |
| 451 | + self._throw_on_error(res) |
| 452 | + return unmarshal_CreateJobDefinitionSecretsResponse(res.json()) |
| 453 | + |
| 454 | + async def get_job_definition_secret( |
| 455 | + self, |
| 456 | + *, |
| 457 | + job_definition_id: str, |
| 458 | + secret_id: str, |
| 459 | + region: Optional[Region] = None, |
| 460 | + ) -> Secret: |
| 461 | + """ |
| 462 | + :param job_definition_id: |
| 463 | + :param secret_id: |
| 464 | + :param region: Region to target. If none is passed will use default region from the config. |
| 465 | + :return: :class:`Secret <Secret>` |
| 466 | +
|
| 467 | + Usage: |
| 468 | + :: |
| 469 | +
|
| 470 | + result = await api.get_job_definition_secret( |
| 471 | + job_definition_id="example", |
| 472 | + secret_id="example", |
| 473 | + ) |
| 474 | + """ |
| 475 | + |
| 476 | + param_region = validate_path_param( |
| 477 | + "region", region or self.client.default_region |
| 478 | + ) |
| 479 | + param_job_definition_id = validate_path_param( |
| 480 | + "job_definition_id", job_definition_id |
| 481 | + ) |
| 482 | + param_secret_id = validate_path_param("secret_id", secret_id) |
| 483 | + |
| 484 | + res = self._request( |
| 485 | + "GET", |
| 486 | + f"/serverless-jobs/v1alpha1/regions/{param_region}/job-definitions/{param_job_definition_id}/secrets/{param_secret_id}", |
| 487 | + ) |
| 488 | + |
| 489 | + self._throw_on_error(res) |
| 490 | + return unmarshal_Secret(res.json()) |
| 491 | + |
| 492 | + async def list_job_definition_secrets( |
| 493 | + self, |
| 494 | + *, |
| 495 | + job_definition_id: str, |
| 496 | + region: Optional[Region] = None, |
| 497 | + ) -> ListJobDefinitionSecretsResponse: |
| 498 | + """ |
| 499 | + :param job_definition_id: |
| 500 | + :param region: Region to target. If none is passed will use default region from the config. |
| 501 | + :return: :class:`ListJobDefinitionSecretsResponse <ListJobDefinitionSecretsResponse>` |
| 502 | +
|
| 503 | + Usage: |
| 504 | + :: |
| 505 | +
|
| 506 | + result = await api.list_job_definition_secrets( |
| 507 | + job_definition_id="example", |
| 508 | + ) |
| 509 | + """ |
| 510 | + |
| 511 | + param_region = validate_path_param( |
| 512 | + "region", region or self.client.default_region |
| 513 | + ) |
| 514 | + param_job_definition_id = validate_path_param( |
| 515 | + "job_definition_id", job_definition_id |
| 516 | + ) |
| 517 | + |
| 518 | + res = self._request( |
| 519 | + "GET", |
| 520 | + f"/serverless-jobs/v1alpha1/regions/{param_region}/job-definitions/{param_job_definition_id}/secrets", |
| 521 | + ) |
| 522 | + |
| 523 | + self._throw_on_error(res) |
| 524 | + return unmarshal_ListJobDefinitionSecretsResponse(res.json()) |
| 525 | + |
| 526 | + async def update_job_definition_secret( |
| 527 | + self, |
| 528 | + *, |
| 529 | + job_definition_id: str, |
| 530 | + secret_id: str, |
| 531 | + region: Optional[Region] = None, |
| 532 | + secret_manager_version: Optional[str] = None, |
| 533 | + path: Optional[str] = None, |
| 534 | + env_var_name: Optional[str] = None, |
| 535 | + ) -> Secret: |
| 536 | + """ |
| 537 | + :param job_definition_id: |
| 538 | + :param secret_id: |
| 539 | + :param region: Region to target. If none is passed will use default region from the config. |
| 540 | + :param secret_manager_version: |
| 541 | + :param path: |
| 542 | + One-Of ('secret_config'): at most one of 'path', 'env_var_name' could be set. |
| 543 | + :param env_var_name: |
| 544 | + One-Of ('secret_config'): at most one of 'path', 'env_var_name' could be set. |
| 545 | + :return: :class:`Secret <Secret>` |
| 546 | +
|
| 547 | + Usage: |
| 548 | + :: |
| 549 | +
|
| 550 | + result = await api.update_job_definition_secret( |
| 551 | + job_definition_id="example", |
| 552 | + secret_id="example", |
| 553 | + ) |
| 554 | + """ |
| 555 | + |
| 556 | + param_region = validate_path_param( |
| 557 | + "region", region or self.client.default_region |
| 558 | + ) |
| 559 | + param_job_definition_id = validate_path_param( |
| 560 | + "job_definition_id", job_definition_id |
| 561 | + ) |
| 562 | + param_secret_id = validate_path_param("secret_id", secret_id) |
| 563 | + |
| 564 | + res = self._request( |
| 565 | + "PATCH", |
| 566 | + f"/serverless-jobs/v1alpha1/regions/{param_region}/job-definitions/{param_job_definition_id}/secrets/{param_secret_id}", |
| 567 | + body=marshal_UpdateJobDefinitionSecretRequest( |
| 568 | + UpdateJobDefinitionSecretRequest( |
| 569 | + job_definition_id=job_definition_id, |
| 570 | + secret_id=secret_id, |
| 571 | + region=region, |
| 572 | + secret_manager_version=secret_manager_version, |
| 573 | + path=path, |
| 574 | + env_var_name=env_var_name, |
| 575 | + ), |
| 576 | + self.client, |
| 577 | + ), |
| 578 | + ) |
| 579 | + |
| 580 | + self._throw_on_error(res) |
| 581 | + return unmarshal_Secret(res.json()) |
| 582 | + |
| 583 | + async def delete_job_definition_secret( |
| 584 | + self, |
| 585 | + *, |
| 586 | + job_definition_id: str, |
| 587 | + secret_id: str, |
| 588 | + region: Optional[Region] = None, |
| 589 | + ) -> None: |
| 590 | + """ |
| 591 | + :param job_definition_id: |
| 592 | + :param secret_id: |
| 593 | + :param region: Region to target. If none is passed will use default region from the config. |
| 594 | +
|
| 595 | + Usage: |
| 596 | + :: |
| 597 | +
|
| 598 | + result = await api.delete_job_definition_secret( |
| 599 | + job_definition_id="example", |
| 600 | + secret_id="example", |
| 601 | + ) |
| 602 | + """ |
| 603 | + |
| 604 | + param_region = validate_path_param( |
| 605 | + "region", region or self.client.default_region |
| 606 | + ) |
| 607 | + param_job_definition_id = validate_path_param( |
| 608 | + "job_definition_id", job_definition_id |
| 609 | + ) |
| 610 | + param_secret_id = validate_path_param("secret_id", secret_id) |
| 611 | + |
| 612 | + res = self._request( |
| 613 | + "DELETE", |
| 614 | + f"/serverless-jobs/v1alpha1/regions/{param_region}/job-definitions/{param_job_definition_id}/secrets/{param_secret_id}", |
| 615 | + ) |
| 616 | + |
| 617 | + self._throw_on_error(res) |
| 618 | + |
398 | 619 | async def get_job_run(
|
399 | 620 | self,
|
400 | 621 | *,
|
|
0 commit comments