stackit-git 0.6.0__tar.gz → 0.7.0__tar.gz
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.
- {stackit_git-0.6.0 → stackit_git-0.7.0}/PKG-INFO +1 -1
- {stackit_git-0.6.0 → stackit_git-0.7.0}/pyproject.toml +1 -1
- {stackit_git-0.6.0 → stackit_git-0.7.0}/src/stackit/git/__init__.py +6 -0
- {stackit_git-0.6.0 → stackit_git-0.7.0}/src/stackit/git/api/default_api.py +20 -20
- {stackit_git-0.6.0 → stackit_git-0.7.0}/src/stackit/git/models/__init__.py +2 -0
- {stackit_git-0.6.0 → stackit_git-0.7.0}/src/stackit/git/models/create_instance_payload.py +3 -13
- stackit_git-0.7.0/src/stackit/git/models/instance_flavor.py +37 -0
- stackit_git-0.7.0/src/stackit/git/models/patch_instance_payload.py +89 -0
- {stackit_git-0.6.0 → stackit_git-0.7.0}/LICENSE.md +0 -0
- {stackit_git-0.6.0 → stackit_git-0.7.0}/NOTICE.txt +0 -0
- {stackit_git-0.6.0 → stackit_git-0.7.0}/README.md +0 -0
- {stackit_git-0.6.0 → stackit_git-0.7.0}/src/stackit/git/api/__init__.py +0 -0
- {stackit_git-0.6.0 → stackit_git-0.7.0}/src/stackit/git/api_client.py +0 -0
- {stackit_git-0.6.0 → stackit_git-0.7.0}/src/stackit/git/api_response.py +0 -0
- {stackit_git-0.6.0 → stackit_git-0.7.0}/src/stackit/git/configuration.py +0 -0
- {stackit_git-0.6.0 → stackit_git-0.7.0}/src/stackit/git/exceptions.py +0 -0
- {stackit_git-0.6.0 → stackit_git-0.7.0}/src/stackit/git/models/flavor.py +0 -0
- {stackit_git-0.6.0 → stackit_git-0.7.0}/src/stackit/git/models/generic_error_response.py +0 -0
- {stackit_git-0.6.0 → stackit_git-0.7.0}/src/stackit/git/models/instance.py +0 -0
- {stackit_git-0.6.0 → stackit_git-0.7.0}/src/stackit/git/models/internal_server_error_response.py +0 -0
- {stackit_git-0.6.0 → stackit_git-0.7.0}/src/stackit/git/models/list_flavors.py +0 -0
- {stackit_git-0.6.0 → stackit_git-0.7.0}/src/stackit/git/models/list_instances.py +0 -0
- {stackit_git-0.6.0 → stackit_git-0.7.0}/src/stackit/git/models/list_runner_labels.py +0 -0
- {stackit_git-0.6.0 → stackit_git-0.7.0}/src/stackit/git/models/patch_operation.py +0 -0
- {stackit_git-0.6.0 → stackit_git-0.7.0}/src/stackit/git/models/runner_label.py +0 -0
- {stackit_git-0.6.0 → stackit_git-0.7.0}/src/stackit/git/models/unauthorized_response.py +0 -0
- {stackit_git-0.6.0 → stackit_git-0.7.0}/src/stackit/git/py.typed +0 -0
- {stackit_git-0.6.0 → stackit_git-0.7.0}/src/stackit/git/rest.py +0 -0
|
@@ -33,10 +33,12 @@ __all__ = [
|
|
|
33
33
|
"Flavor",
|
|
34
34
|
"GenericErrorResponse",
|
|
35
35
|
"Instance",
|
|
36
|
+
"InstanceFlavor",
|
|
36
37
|
"InternalServerErrorResponse",
|
|
37
38
|
"ListFlavors",
|
|
38
39
|
"ListInstances",
|
|
39
40
|
"ListRunnerLabels",
|
|
41
|
+
"PatchInstancePayload",
|
|
40
42
|
"PatchOperation",
|
|
41
43
|
"RunnerLabel",
|
|
42
44
|
"UnauthorizedResponse",
|
|
@@ -65,12 +67,16 @@ from stackit.git.models.generic_error_response import (
|
|
|
65
67
|
GenericErrorResponse as GenericErrorResponse,
|
|
66
68
|
)
|
|
67
69
|
from stackit.git.models.instance import Instance as Instance
|
|
70
|
+
from stackit.git.models.instance_flavor import InstanceFlavor as InstanceFlavor
|
|
68
71
|
from stackit.git.models.internal_server_error_response import (
|
|
69
72
|
InternalServerErrorResponse as InternalServerErrorResponse,
|
|
70
73
|
)
|
|
71
74
|
from stackit.git.models.list_flavors import ListFlavors as ListFlavors
|
|
72
75
|
from stackit.git.models.list_instances import ListInstances as ListInstances
|
|
73
76
|
from stackit.git.models.list_runner_labels import ListRunnerLabels as ListRunnerLabels
|
|
77
|
+
from stackit.git.models.patch_instance_payload import (
|
|
78
|
+
PatchInstancePayload as PatchInstancePayload,
|
|
79
|
+
)
|
|
74
80
|
from stackit.git.models.patch_operation import PatchOperation as PatchOperation
|
|
75
81
|
from stackit.git.models.runner_label import RunnerLabel as RunnerLabel
|
|
76
82
|
from stackit.git.models.unauthorized_response import (
|
|
@@ -31,7 +31,7 @@ from stackit.git.models.instance import Instance
|
|
|
31
31
|
from stackit.git.models.list_flavors import ListFlavors
|
|
32
32
|
from stackit.git.models.list_instances import ListInstances
|
|
33
33
|
from stackit.git.models.list_runner_labels import ListRunnerLabels
|
|
34
|
-
from stackit.git.models.
|
|
34
|
+
from stackit.git.models.patch_instance_payload import PatchInstancePayload
|
|
35
35
|
from stackit.git.rest import RESTResponseType
|
|
36
36
|
|
|
37
37
|
|
|
@@ -1548,7 +1548,7 @@ class DefaultApi:
|
|
|
1548
1548
|
instance_id: Annotated[
|
|
1549
1549
|
str, Field(min_length=36, strict=True, max_length=36, description="Instance identifier.")
|
|
1550
1550
|
],
|
|
1551
|
-
|
|
1551
|
+
patch_instance_payload: PatchInstancePayload,
|
|
1552
1552
|
_request_timeout: Union[
|
|
1553
1553
|
None,
|
|
1554
1554
|
Annotated[StrictFloat, Field(gt=0)],
|
|
@@ -1567,8 +1567,8 @@ class DefaultApi:
|
|
|
1567
1567
|
:type project_id: str
|
|
1568
1568
|
:param instance_id: Instance identifier. (required)
|
|
1569
1569
|
:type instance_id: str
|
|
1570
|
-
:param
|
|
1571
|
-
:type
|
|
1570
|
+
:param patch_instance_payload: (required)
|
|
1571
|
+
:type patch_instance_payload: PatchInstancePayload
|
|
1572
1572
|
:param _request_timeout: timeout setting for this request. If one
|
|
1573
1573
|
number provided, it will be total request
|
|
1574
1574
|
timeout. It can also be a pair (tuple) of
|
|
@@ -1594,7 +1594,7 @@ class DefaultApi:
|
|
|
1594
1594
|
_param = self._patch_instance_serialize(
|
|
1595
1595
|
project_id=project_id,
|
|
1596
1596
|
instance_id=instance_id,
|
|
1597
|
-
|
|
1597
|
+
patch_instance_payload=patch_instance_payload,
|
|
1598
1598
|
_request_auth=_request_auth,
|
|
1599
1599
|
_content_type=_content_type,
|
|
1600
1600
|
_headers=_headers,
|
|
@@ -1624,7 +1624,7 @@ class DefaultApi:
|
|
|
1624
1624
|
instance_id: Annotated[
|
|
1625
1625
|
str, Field(min_length=36, strict=True, max_length=36, description="Instance identifier.")
|
|
1626
1626
|
],
|
|
1627
|
-
|
|
1627
|
+
patch_instance_payload: PatchInstancePayload,
|
|
1628
1628
|
_request_timeout: Union[
|
|
1629
1629
|
None,
|
|
1630
1630
|
Annotated[StrictFloat, Field(gt=0)],
|
|
@@ -1643,8 +1643,8 @@ class DefaultApi:
|
|
|
1643
1643
|
:type project_id: str
|
|
1644
1644
|
:param instance_id: Instance identifier. (required)
|
|
1645
1645
|
:type instance_id: str
|
|
1646
|
-
:param
|
|
1647
|
-
:type
|
|
1646
|
+
:param patch_instance_payload: (required)
|
|
1647
|
+
:type patch_instance_payload: PatchInstancePayload
|
|
1648
1648
|
:param _request_timeout: timeout setting for this request. If one
|
|
1649
1649
|
number provided, it will be total request
|
|
1650
1650
|
timeout. It can also be a pair (tuple) of
|
|
@@ -1670,7 +1670,7 @@ class DefaultApi:
|
|
|
1670
1670
|
_param = self._patch_instance_serialize(
|
|
1671
1671
|
project_id=project_id,
|
|
1672
1672
|
instance_id=instance_id,
|
|
1673
|
-
|
|
1673
|
+
patch_instance_payload=patch_instance_payload,
|
|
1674
1674
|
_request_auth=_request_auth,
|
|
1675
1675
|
_content_type=_content_type,
|
|
1676
1676
|
_headers=_headers,
|
|
@@ -1700,7 +1700,7 @@ class DefaultApi:
|
|
|
1700
1700
|
instance_id: Annotated[
|
|
1701
1701
|
str, Field(min_length=36, strict=True, max_length=36, description="Instance identifier.")
|
|
1702
1702
|
],
|
|
1703
|
-
|
|
1703
|
+
patch_instance_payload: PatchInstancePayload,
|
|
1704
1704
|
_request_timeout: Union[
|
|
1705
1705
|
None,
|
|
1706
1706
|
Annotated[StrictFloat, Field(gt=0)],
|
|
@@ -1719,8 +1719,8 @@ class DefaultApi:
|
|
|
1719
1719
|
:type project_id: str
|
|
1720
1720
|
:param instance_id: Instance identifier. (required)
|
|
1721
1721
|
:type instance_id: str
|
|
1722
|
-
:param
|
|
1723
|
-
:type
|
|
1722
|
+
:param patch_instance_payload: (required)
|
|
1723
|
+
:type patch_instance_payload: PatchInstancePayload
|
|
1724
1724
|
:param _request_timeout: timeout setting for this request. If one
|
|
1725
1725
|
number provided, it will be total request
|
|
1726
1726
|
timeout. It can also be a pair (tuple) of
|
|
@@ -1746,7 +1746,7 @@ class DefaultApi:
|
|
|
1746
1746
|
_param = self._patch_instance_serialize(
|
|
1747
1747
|
project_id=project_id,
|
|
1748
1748
|
instance_id=instance_id,
|
|
1749
|
-
|
|
1749
|
+
patch_instance_payload=patch_instance_payload,
|
|
1750
1750
|
_request_auth=_request_auth,
|
|
1751
1751
|
_content_type=_content_type,
|
|
1752
1752
|
_headers=_headers,
|
|
@@ -1769,7 +1769,7 @@ class DefaultApi:
|
|
|
1769
1769
|
self,
|
|
1770
1770
|
project_id,
|
|
1771
1771
|
instance_id,
|
|
1772
|
-
|
|
1772
|
+
patch_instance_payload,
|
|
1773
1773
|
_request_auth,
|
|
1774
1774
|
_content_type,
|
|
1775
1775
|
_headers,
|
|
@@ -1778,9 +1778,7 @@ class DefaultApi:
|
|
|
1778
1778
|
|
|
1779
1779
|
_host = None
|
|
1780
1780
|
|
|
1781
|
-
_collection_formats: Dict[str, str] = {
|
|
1782
|
-
"PatchOperation": "",
|
|
1783
|
-
}
|
|
1781
|
+
_collection_formats: Dict[str, str] = {}
|
|
1784
1782
|
|
|
1785
1783
|
_path_params: Dict[str, str] = {}
|
|
1786
1784
|
_query_params: List[Tuple[str, str]] = []
|
|
@@ -1798,8 +1796,8 @@ class DefaultApi:
|
|
|
1798
1796
|
# process the header parameters
|
|
1799
1797
|
# process the form parameters
|
|
1800
1798
|
# process the body parameter
|
|
1801
|
-
if
|
|
1802
|
-
_body_params =
|
|
1799
|
+
if patch_instance_payload is not None:
|
|
1800
|
+
_body_params = patch_instance_payload
|
|
1803
1801
|
|
|
1804
1802
|
# set the HTTP header `Accept`
|
|
1805
1803
|
if "Accept" not in _header_params:
|
|
@@ -1809,7 +1807,9 @@ class DefaultApi:
|
|
|
1809
1807
|
if _content_type:
|
|
1810
1808
|
_header_params["Content-Type"] = _content_type
|
|
1811
1809
|
else:
|
|
1812
|
-
_default_content_type = self.api_client.select_header_content_type(
|
|
1810
|
+
_default_content_type = self.api_client.select_header_content_type(
|
|
1811
|
+
["application/json", "application/json-patch+json"]
|
|
1812
|
+
)
|
|
1813
1813
|
if _default_content_type is not None:
|
|
1814
1814
|
_header_params["Content-Type"] = _default_content_type
|
|
1815
1815
|
|
|
@@ -19,12 +19,14 @@ from stackit.git.models.create_instance_payload import CreateInstancePayload
|
|
|
19
19
|
from stackit.git.models.flavor import Flavor
|
|
20
20
|
from stackit.git.models.generic_error_response import GenericErrorResponse
|
|
21
21
|
from stackit.git.models.instance import Instance
|
|
22
|
+
from stackit.git.models.instance_flavor import InstanceFlavor
|
|
22
23
|
from stackit.git.models.internal_server_error_response import (
|
|
23
24
|
InternalServerErrorResponse,
|
|
24
25
|
)
|
|
25
26
|
from stackit.git.models.list_flavors import ListFlavors
|
|
26
27
|
from stackit.git.models.list_instances import ListInstances
|
|
27
28
|
from stackit.git.models.list_runner_labels import ListRunnerLabels
|
|
29
|
+
from stackit.git.models.patch_instance_payload import PatchInstancePayload
|
|
28
30
|
from stackit.git.models.patch_operation import PatchOperation
|
|
29
31
|
from stackit.git.models.runner_label import RunnerLabel
|
|
30
32
|
from stackit.git.models.unauthorized_response import UnauthorizedResponse
|
|
@@ -22,6 +22,8 @@ from typing import Any, ClassVar, Dict, List, Optional, Set
|
|
|
22
22
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
23
23
|
from typing_extensions import Annotated, Self
|
|
24
24
|
|
|
25
|
+
from stackit.git.models.instance_flavor import InstanceFlavor
|
|
26
|
+
|
|
25
27
|
|
|
26
28
|
class CreateInstancePayload(BaseModel):
|
|
27
29
|
"""
|
|
@@ -31,24 +33,12 @@ class CreateInstancePayload(BaseModel):
|
|
|
31
33
|
acl: Optional[Annotated[List[StrictStr], Field(max_length=50)]] = Field(
|
|
32
34
|
default=None, description="A list of CIDR network addresses that are allowed to access the instance."
|
|
33
35
|
)
|
|
34
|
-
flavor: Optional[
|
|
35
|
-
default=None, description="Desired instance flavor. Must be one of the defined enum values"
|
|
36
|
-
)
|
|
36
|
+
flavor: Optional[InstanceFlavor] = None
|
|
37
37
|
name: Annotated[str, Field(min_length=5, strict=True, max_length=32)] = Field(
|
|
38
38
|
description="A user chosen name to distinguish multiple STACKIT Git instances."
|
|
39
39
|
)
|
|
40
40
|
__properties: ClassVar[List[str]] = ["acl", "flavor", "name"]
|
|
41
41
|
|
|
42
|
-
@field_validator("flavor")
|
|
43
|
-
def flavor_validate_enum(cls, value):
|
|
44
|
-
"""Validates the enum"""
|
|
45
|
-
if value is None:
|
|
46
|
-
return value
|
|
47
|
-
|
|
48
|
-
if value not in set(["git-10", "git-100"]):
|
|
49
|
-
raise ValueError("must be one of enum values ('git-10', 'git-100')")
|
|
50
|
-
return value
|
|
51
|
-
|
|
52
42
|
@field_validator("name")
|
|
53
43
|
def name_validate_regular_expression(cls, value):
|
|
54
44
|
"""Validates the regular expression"""
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
STACKIT Git API
|
|
5
|
+
|
|
6
|
+
STACKIT Git management API.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1beta.0.4
|
|
9
|
+
Contact: git@stackit.cloud
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
|
|
17
|
+
import json
|
|
18
|
+
from enum import Enum
|
|
19
|
+
|
|
20
|
+
from typing_extensions import Self
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class InstanceFlavor(str, Enum):
|
|
24
|
+
"""
|
|
25
|
+
Desired instance flavor. Must be one of the defined enum values.
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
"""
|
|
29
|
+
allowed enum values
|
|
30
|
+
"""
|
|
31
|
+
GIT_MINUS_10 = "git-10"
|
|
32
|
+
GIT_MINUS_100 = "git-100"
|
|
33
|
+
|
|
34
|
+
@classmethod
|
|
35
|
+
def from_json(cls, json_str: str) -> Self:
|
|
36
|
+
"""Create an instance of InstanceFlavor from a JSON string"""
|
|
37
|
+
return cls(json.loads(json_str))
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
STACKIT Git API
|
|
5
|
+
|
|
6
|
+
STACKIT Git management API.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1beta.0.4
|
|
9
|
+
Contact: git@stackit.cloud
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
|
|
17
|
+
import json
|
|
18
|
+
import pprint
|
|
19
|
+
from typing import Any, ClassVar, Dict, List, Optional, Set
|
|
20
|
+
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
22
|
+
from typing_extensions import Annotated, Self
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class PatchInstancePayload(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
Properties to patch on an instance. All fields are optional.
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
|
|
30
|
+
acl: Optional[Annotated[List[StrictStr], Field(max_length=50)]] = Field(
|
|
31
|
+
default=None, description="A list of CIDR network addresses that are allowed to access the instance."
|
|
32
|
+
)
|
|
33
|
+
__properties: ClassVar[List[str]] = ["acl"]
|
|
34
|
+
|
|
35
|
+
model_config = ConfigDict(
|
|
36
|
+
populate_by_name=True,
|
|
37
|
+
validate_assignment=True,
|
|
38
|
+
protected_namespaces=(),
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
def to_str(self) -> str:
|
|
42
|
+
"""Returns the string representation of the model using alias"""
|
|
43
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
44
|
+
|
|
45
|
+
def to_json(self) -> str:
|
|
46
|
+
"""Returns the JSON representation of the model using alias"""
|
|
47
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
48
|
+
return json.dumps(self.to_dict())
|
|
49
|
+
|
|
50
|
+
@classmethod
|
|
51
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
52
|
+
"""Create an instance of PatchInstancePayload from a JSON string"""
|
|
53
|
+
return cls.from_dict(json.loads(json_str))
|
|
54
|
+
|
|
55
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
56
|
+
"""Return the dictionary representation of the model using alias.
|
|
57
|
+
|
|
58
|
+
This has the following differences from calling pydantic's
|
|
59
|
+
`self.model_dump(by_alias=True)`:
|
|
60
|
+
|
|
61
|
+
* `None` is only added to the output dict for nullable fields that
|
|
62
|
+
were set at model initialization. Other fields with value `None`
|
|
63
|
+
are ignored.
|
|
64
|
+
"""
|
|
65
|
+
excluded_fields: Set[str] = set([])
|
|
66
|
+
|
|
67
|
+
_dict = self.model_dump(
|
|
68
|
+
by_alias=True,
|
|
69
|
+
exclude=excluded_fields,
|
|
70
|
+
exclude_none=True,
|
|
71
|
+
)
|
|
72
|
+
# set to None if acl (nullable) is None
|
|
73
|
+
# and model_fields_set contains the field
|
|
74
|
+
if self.acl is None and "acl" in self.model_fields_set:
|
|
75
|
+
_dict["acl"] = None
|
|
76
|
+
|
|
77
|
+
return _dict
|
|
78
|
+
|
|
79
|
+
@classmethod
|
|
80
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
81
|
+
"""Create an instance of PatchInstancePayload from a dict"""
|
|
82
|
+
if obj is None:
|
|
83
|
+
return None
|
|
84
|
+
|
|
85
|
+
if not isinstance(obj, dict):
|
|
86
|
+
return cls.model_validate(obj)
|
|
87
|
+
|
|
88
|
+
_obj = cls.model_validate({"acl": obj.get("acl")})
|
|
89
|
+
return _obj
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{stackit_git-0.6.0 → stackit_git-0.7.0}/src/stackit/git/models/internal_server_error_response.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|