pulp_glue.common.openapi¶
OpenAPIError
¶
Bases: Exception
Base Exception for errors related to using the openapi spec.
OpenAPIValidationError
¶
Bases: OpenAPIError
Exception raised for failed client side validation of parameters or request bodies.
UnsafeCallError
¶
Bases: OpenAPIError
Exception raised for POST, PUT, PATCH or DELETE calls with safe_calls_only=True
.
AuthProviderBase
¶
Base class for auth providers.
This abstract base class will analyze the authentication proposals of the openapi specs.
Different authentication schemes should be implemented by subclasses.
Returned auth objects need to be compatible with requests.auth.AuthBase
.
basic_auth
¶
basic_auth() -> (
t.Optional[
t.Union[t.Tuple[str, str], requests.auth.AuthBase]
]
)
Implement this to provide means of http basic auth.
Source code in pulp-glue/pulp_glue/common/openapi.py
56 57 58 |
|
BasicAuthProvider
¶
BasicAuthProvider(username: str, password: str)
Bases: AuthProviderBase
Reference Implementation for AuthProviderBase providing basic auth with username
, password
.
Source code in pulp-glue/pulp_glue/common/openapi.py
80 81 82 |
|
OpenAPI
¶
OpenAPI(
base_url: str,
doc_path: str,
headers: t.Optional[t.Dict[str, str]] = None,
auth_provider: t.Optional[AuthProviderBase] = None,
cert: t.Optional[str] = None,
key: t.Optional[str] = None,
validate_certs: bool = True,
refresh_cache: bool = False,
safe_calls_only: bool = False,
debug_callback: t.Optional[
t.Callable[[int, str], t.Any]
] = None,
user_agent: t.Optional[str] = None,
cid: t.Optional[str] = None,
)
The abstraction Layer to interact with a server providing an openapi v3 specification.
Parameters: |
|
---|
Source code in pulp-glue/pulp_glue/common/openapi.py
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 |
|
call
¶
call(
operation_id: str,
parameters: t.Optional[t.Dict[str, t.Any]] = None,
body: t.Optional[t.Dict[str, t.Any]] = None,
validate_body: bool = True,
) -> t.Any
Make a call to the server.
Parameters: |
|
---|
Returns: |
|
---|
Raises: |
|
---|
Source code in pulp-glue/pulp_glue/common/openapi.py
637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 |
|