stackit-telemetrylink 0.1.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.
- src/stackit/telemetrylink/__init__.py +81 -0
- src/stackit/telemetrylink/api/__init__.py +4 -0
- src/stackit/telemetrylink/api/default_api.py +3296 -0
- src/stackit/telemetrylink/api_client.py +650 -0
- src/stackit/telemetrylink/api_response.py +23 -0
- src/stackit/telemetrylink/configuration.py +163 -0
- src/stackit/telemetrylink/exceptions.py +217 -0
- src/stackit/telemetrylink/models/__init__.py +36 -0
- src/stackit/telemetrylink/models/create_or_update_folder_telemetry_link_payload.py +126 -0
- src/stackit/telemetrylink/models/create_or_update_organization_telemetry_link_payload.py +126 -0
- src/stackit/telemetrylink/models/create_or_update_project_telemetry_link_payload.py +126 -0
- src/stackit/telemetrylink/models/partial_update_folder_telemetry_link_payload.py +138 -0
- src/stackit/telemetrylink/models/partial_update_organization_telemetry_link_payload.py +138 -0
- src/stackit/telemetrylink/models/partial_update_project_telemetry_link_payload.py +138 -0
- src/stackit/telemetrylink/models/response4xx.py +82 -0
- src/stackit/telemetrylink/models/telemetry_link_request.py +138 -0
- src/stackit/telemetrylink/models/telemetry_link_response.py +158 -0
- src/stackit/telemetrylink/py.typed +0 -0
- src/stackit/telemetrylink/rest.py +164 -0
- stackit_telemetrylink-0.1.0.dist-info/METADATA +48 -0
- stackit_telemetrylink-0.1.0.dist-info/RECORD +24 -0
- stackit_telemetrylink-0.1.0.dist-info/WHEEL +4 -0
- stackit_telemetrylink-0.1.0.dist-info/licenses/LICENSE.md +201 -0
- stackit_telemetrylink-0.1.0.dist-info/licenses/NOTICE.txt +2 -0
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
STACKIT Telemetry Link API
|
|
5
|
+
|
|
6
|
+
This API provides endpoints for managing Telemetry Links. The Telemetry Link enables Log Routing towards a defined Telemetry Router.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1beta.0.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
|
|
16
|
+
import json
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
from typing import Any, ClassVar, Dict, List, Optional, Set
|
|
20
|
+
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, field_validator
|
|
22
|
+
from pydantic_core import to_jsonable_python
|
|
23
|
+
from typing_extensions import Annotated, Self
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class TelemetryLinkRequest(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
TelemetryLinkRequest
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
|
|
31
|
+
access_token: Optional[Annotated[str, Field(strict=True)]] = Field(
|
|
32
|
+
default=None, description="The access token.", alias="accessToken"
|
|
33
|
+
)
|
|
34
|
+
description: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = Field(
|
|
35
|
+
default=None,
|
|
36
|
+
description="The description is a longer text chosen by the user to provide more context for the resource.",
|
|
37
|
+
)
|
|
38
|
+
display_name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=32)]] = Field(
|
|
39
|
+
default=None,
|
|
40
|
+
description="The display name is a short name chosen by the user to identify the resource.",
|
|
41
|
+
alias="displayName",
|
|
42
|
+
)
|
|
43
|
+
enabled: Optional[StrictBool] = Field(
|
|
44
|
+
default=True, description="Indicates whether routing through the link to a telemetry-router is active."
|
|
45
|
+
)
|
|
46
|
+
telemetry_router_id: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = Field(
|
|
47
|
+
default=None,
|
|
48
|
+
description="The ID of the telemetry-router to route the telemetry data.",
|
|
49
|
+
alias="telemetryRouterId",
|
|
50
|
+
)
|
|
51
|
+
__properties: ClassVar[List[str]] = ["accessToken", "description", "displayName", "enabled", "telemetryRouterId"]
|
|
52
|
+
|
|
53
|
+
@field_validator("access_token")
|
|
54
|
+
def access_token_validate_regular_expression(cls, value):
|
|
55
|
+
"""Validates the regular expression"""
|
|
56
|
+
if value is None:
|
|
57
|
+
return value
|
|
58
|
+
|
|
59
|
+
if not isinstance(value, str):
|
|
60
|
+
value = str(value)
|
|
61
|
+
|
|
62
|
+
if not re.match(r"^[A-Za-z0-9-_=]+\.[A-Za-z0-9-_=]+\.?[A-Za-z0-9-_.+\/=]*$", value):
|
|
63
|
+
raise ValueError(
|
|
64
|
+
r"must validate the regular expression /^[A-Za-z0-9-_=]+\.[A-Za-z0-9-_=]+\.?[A-Za-z0-9-_.+\/=]*$/"
|
|
65
|
+
)
|
|
66
|
+
return value
|
|
67
|
+
|
|
68
|
+
@field_validator("display_name")
|
|
69
|
+
def display_name_validate_regular_expression(cls, value):
|
|
70
|
+
"""Validates the regular expression"""
|
|
71
|
+
if value is None:
|
|
72
|
+
return value
|
|
73
|
+
|
|
74
|
+
if not isinstance(value, str):
|
|
75
|
+
value = str(value)
|
|
76
|
+
|
|
77
|
+
if not re.match(r"^[a-zA-Z0-9][a-zA-Z0-9 \-]*$", value):
|
|
78
|
+
raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9][a-zA-Z0-9 \-]*$/")
|
|
79
|
+
return value
|
|
80
|
+
|
|
81
|
+
model_config = ConfigDict(
|
|
82
|
+
validate_by_name=True,
|
|
83
|
+
validate_by_alias=True,
|
|
84
|
+
validate_assignment=True,
|
|
85
|
+
protected_namespaces=(),
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
def to_str(self) -> str:
|
|
89
|
+
"""Returns the string representation of the model using alias"""
|
|
90
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
91
|
+
|
|
92
|
+
def to_json(self) -> str:
|
|
93
|
+
"""Returns the JSON representation of the model using alias"""
|
|
94
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
95
|
+
|
|
96
|
+
@classmethod
|
|
97
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
98
|
+
"""Create an instance of TelemetryLinkRequest from a JSON string"""
|
|
99
|
+
return cls.from_dict(json.loads(json_str))
|
|
100
|
+
|
|
101
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
102
|
+
"""Return the dictionary representation of the model using alias.
|
|
103
|
+
|
|
104
|
+
This has the following differences from calling pydantic's
|
|
105
|
+
`self.model_dump(by_alias=True)`:
|
|
106
|
+
|
|
107
|
+
* `None` is only added to the output dict for nullable fields that
|
|
108
|
+
were set at model initialization. Other fields with value `None`
|
|
109
|
+
are ignored.
|
|
110
|
+
"""
|
|
111
|
+
excluded_fields: Set[str] = set([])
|
|
112
|
+
|
|
113
|
+
_dict = self.model_dump(
|
|
114
|
+
by_alias=True,
|
|
115
|
+
exclude=excluded_fields,
|
|
116
|
+
exclude_none=True,
|
|
117
|
+
)
|
|
118
|
+
return _dict
|
|
119
|
+
|
|
120
|
+
@classmethod
|
|
121
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
122
|
+
"""Create an instance of TelemetryLinkRequest from a dict"""
|
|
123
|
+
if obj is None:
|
|
124
|
+
return None
|
|
125
|
+
|
|
126
|
+
if not isinstance(obj, dict):
|
|
127
|
+
return cls.model_validate(obj)
|
|
128
|
+
|
|
129
|
+
_obj = cls.model_validate(
|
|
130
|
+
{
|
|
131
|
+
"accessToken": obj.get("accessToken"),
|
|
132
|
+
"description": obj.get("description"),
|
|
133
|
+
"displayName": obj.get("displayName"),
|
|
134
|
+
"enabled": obj.get("enabled") if obj.get("enabled") is not None else True,
|
|
135
|
+
"telemetryRouterId": obj.get("telemetryRouterId"),
|
|
136
|
+
}
|
|
137
|
+
)
|
|
138
|
+
return _obj
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
STACKIT Telemetry Link API
|
|
5
|
+
|
|
6
|
+
This API provides endpoints for managing Telemetry Links. The Telemetry Link enables Log Routing towards a defined Telemetry Router.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1beta.0.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
|
|
16
|
+
import json
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
from datetime import datetime
|
|
20
|
+
from typing import Any, ClassVar, Dict, List, Optional, Set
|
|
21
|
+
from uuid import UUID
|
|
22
|
+
|
|
23
|
+
from pydantic import (
|
|
24
|
+
BaseModel,
|
|
25
|
+
ConfigDict,
|
|
26
|
+
Field,
|
|
27
|
+
StrictBool,
|
|
28
|
+
StrictStr,
|
|
29
|
+
field_validator,
|
|
30
|
+
)
|
|
31
|
+
from pydantic_core import to_jsonable_python
|
|
32
|
+
from typing_extensions import Annotated, Self
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class TelemetryLinkResponse(BaseModel):
|
|
36
|
+
"""
|
|
37
|
+
TelemetryLinkResponse
|
|
38
|
+
""" # noqa: E501
|
|
39
|
+
|
|
40
|
+
access_token: Optional[StrictStr] = Field(default=None, description="The access token.", alias="accessToken")
|
|
41
|
+
create_time: datetime = Field(description="The point in time the resource was created.", alias="createTime")
|
|
42
|
+
description: Optional[StrictStr] = Field(
|
|
43
|
+
default=None,
|
|
44
|
+
description="The description is a longer text chosen by the user to provide more context for the resource.",
|
|
45
|
+
)
|
|
46
|
+
display_name: Annotated[str, Field(min_length=1, strict=True, max_length=32)] = Field(
|
|
47
|
+
description="The display name is a short name chosen by the user to identify the resource.", alias="displayName"
|
|
48
|
+
)
|
|
49
|
+
enabled: StrictBool = Field(
|
|
50
|
+
description="Indicates whether routing through the link to a telemetry-router is active."
|
|
51
|
+
)
|
|
52
|
+
id: UUID = Field(description="A auto generated unique id which identifies the resource.")
|
|
53
|
+
region_id: StrictStr = Field(description="The STACKIT region name the resource is located in.", alias="regionId")
|
|
54
|
+
status: StrictStr = Field(description="The current state of the link.")
|
|
55
|
+
telemetry_router_id: Annotated[str, Field(strict=True, max_length=1024)] = Field(
|
|
56
|
+
description="The ID of the telemetry-router to route the telemetry data.", alias="telemetryRouterId"
|
|
57
|
+
)
|
|
58
|
+
__properties: ClassVar[List[str]] = [
|
|
59
|
+
"accessToken",
|
|
60
|
+
"createTime",
|
|
61
|
+
"description",
|
|
62
|
+
"displayName",
|
|
63
|
+
"enabled",
|
|
64
|
+
"id",
|
|
65
|
+
"regionId",
|
|
66
|
+
"status",
|
|
67
|
+
"telemetryRouterId",
|
|
68
|
+
]
|
|
69
|
+
|
|
70
|
+
@field_validator("create_time", mode="before")
|
|
71
|
+
def create_time_change_year_zero_to_one(cls, value):
|
|
72
|
+
"""Workaround which prevents year 0 issue"""
|
|
73
|
+
if isinstance(value, str):
|
|
74
|
+
# Check for year "0000" at the beginning of the string
|
|
75
|
+
# This assumes common date formats like YYYY-MM-DDTHH:MM:SS+00:00 or YYYY-MM-DDTHH:MM:SSZ
|
|
76
|
+
if value.startswith("0000-01-01T") and re.match(
|
|
77
|
+
r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\+\d{2}:\d{2}|Z)$", value
|
|
78
|
+
):
|
|
79
|
+
# Workaround: Replace "0000" with "0001"
|
|
80
|
+
return "0001" + value[4:] # Take "0001" and append the rest of the string
|
|
81
|
+
return value
|
|
82
|
+
|
|
83
|
+
@field_validator("region_id")
|
|
84
|
+
def region_id_validate_enum(cls, value):
|
|
85
|
+
"""Validates the enum"""
|
|
86
|
+
if value not in set(["eu01", "eu02"]):
|
|
87
|
+
raise ValueError("must be one of enum values ('eu01', 'eu02')")
|
|
88
|
+
return value
|
|
89
|
+
|
|
90
|
+
@field_validator("status")
|
|
91
|
+
def status_validate_enum(cls, value):
|
|
92
|
+
"""Validates the enum"""
|
|
93
|
+
if value not in set(["active", "inactive", "failed", "reconciling", "deleting"]):
|
|
94
|
+
raise ValueError("must be one of enum values ('active', 'inactive', 'failed', 'reconciling', 'deleting')")
|
|
95
|
+
return value
|
|
96
|
+
|
|
97
|
+
model_config = ConfigDict(
|
|
98
|
+
validate_by_name=True,
|
|
99
|
+
validate_by_alias=True,
|
|
100
|
+
validate_assignment=True,
|
|
101
|
+
protected_namespaces=(),
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
def to_str(self) -> str:
|
|
105
|
+
"""Returns the string representation of the model using alias"""
|
|
106
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
107
|
+
|
|
108
|
+
def to_json(self) -> str:
|
|
109
|
+
"""Returns the JSON representation of the model using alias"""
|
|
110
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
111
|
+
|
|
112
|
+
@classmethod
|
|
113
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
114
|
+
"""Create an instance of TelemetryLinkResponse from a JSON string"""
|
|
115
|
+
return cls.from_dict(json.loads(json_str))
|
|
116
|
+
|
|
117
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
118
|
+
"""Return the dictionary representation of the model using alias.
|
|
119
|
+
|
|
120
|
+
This has the following differences from calling pydantic's
|
|
121
|
+
`self.model_dump(by_alias=True)`:
|
|
122
|
+
|
|
123
|
+
* `None` is only added to the output dict for nullable fields that
|
|
124
|
+
were set at model initialization. Other fields with value `None`
|
|
125
|
+
are ignored.
|
|
126
|
+
"""
|
|
127
|
+
excluded_fields: Set[str] = set([])
|
|
128
|
+
|
|
129
|
+
_dict = self.model_dump(
|
|
130
|
+
by_alias=True,
|
|
131
|
+
exclude=excluded_fields,
|
|
132
|
+
exclude_none=True,
|
|
133
|
+
)
|
|
134
|
+
return _dict
|
|
135
|
+
|
|
136
|
+
@classmethod
|
|
137
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
138
|
+
"""Create an instance of TelemetryLinkResponse from a dict"""
|
|
139
|
+
if obj is None:
|
|
140
|
+
return None
|
|
141
|
+
|
|
142
|
+
if not isinstance(obj, dict):
|
|
143
|
+
return cls.model_validate(obj)
|
|
144
|
+
|
|
145
|
+
_obj = cls.model_validate(
|
|
146
|
+
{
|
|
147
|
+
"accessToken": obj.get("accessToken"),
|
|
148
|
+
"createTime": obj.get("createTime"),
|
|
149
|
+
"description": obj.get("description"),
|
|
150
|
+
"displayName": obj.get("displayName"),
|
|
151
|
+
"enabled": obj.get("enabled"),
|
|
152
|
+
"id": obj.get("id"),
|
|
153
|
+
"regionId": obj.get("regionId"),
|
|
154
|
+
"status": obj.get("status"),
|
|
155
|
+
"telemetryRouterId": obj.get("telemetryRouterId"),
|
|
156
|
+
}
|
|
157
|
+
)
|
|
158
|
+
return _obj
|
|
File without changes
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
STACKIT Telemetry Link API
|
|
5
|
+
|
|
6
|
+
This API provides endpoints for managing Telemetry Links. The Telemetry Link enables Log Routing towards a defined Telemetry Router.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1beta.0.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
import io
|
|
15
|
+
import json
|
|
16
|
+
import re
|
|
17
|
+
|
|
18
|
+
import requests
|
|
19
|
+
from stackit.core.authorization import Authorization
|
|
20
|
+
from stackit.core.configuration import Configuration
|
|
21
|
+
|
|
22
|
+
from stackit.telemetrylink.exceptions import ApiException, ApiValueError
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
RESTResponseType = requests.Response
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class RESTResponse(io.IOBase):
|
|
29
|
+
|
|
30
|
+
def __init__(self, resp) -> None:
|
|
31
|
+
self.response = resp
|
|
32
|
+
self.status = resp.status_code
|
|
33
|
+
self.reason = resp.reason
|
|
34
|
+
self.data = None
|
|
35
|
+
|
|
36
|
+
def read(self):
|
|
37
|
+
if self.data is None:
|
|
38
|
+
self.data = self.response.content
|
|
39
|
+
return self.data
|
|
40
|
+
|
|
41
|
+
@property
|
|
42
|
+
def headers(self):
|
|
43
|
+
"""Returns a dictionary of response headers."""
|
|
44
|
+
return self.response.headers
|
|
45
|
+
|
|
46
|
+
def getheaders(self):
|
|
47
|
+
"""Returns a dictionary of the response headers; use ``headers`` instead."""
|
|
48
|
+
return self.response.headers
|
|
49
|
+
|
|
50
|
+
def getheader(self, name, default=None):
|
|
51
|
+
"""Returns a given response header; use ``headers.get()`` instead."""
|
|
52
|
+
return self.response.headers.get(name, default)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
class RESTClientObject:
|
|
56
|
+
def __init__(self, config: Configuration) -> None:
|
|
57
|
+
self.session = config.custom_http_session if config.custom_http_session else requests.Session()
|
|
58
|
+
authorization = Authorization(config)
|
|
59
|
+
self.session.auth = authorization.auth_method
|
|
60
|
+
|
|
61
|
+
def request(self, method, url, headers=None, body=None, post_params=None, _request_timeout=None):
|
|
62
|
+
"""Perform requests.
|
|
63
|
+
|
|
64
|
+
:param method: http request method
|
|
65
|
+
:param url: http request url
|
|
66
|
+
:param headers: http request headers
|
|
67
|
+
:param body: request json body, for `application/json`
|
|
68
|
+
:param post_params: request post parameters,
|
|
69
|
+
`application/x-www-form-urlencoded`
|
|
70
|
+
and `multipart/form-data`
|
|
71
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
72
|
+
number provided, it will be total request
|
|
73
|
+
timeout. It can also be a pair (tuple) of
|
|
74
|
+
(connection, read) timeouts.
|
|
75
|
+
"""
|
|
76
|
+
method = method.upper()
|
|
77
|
+
if method not in ["GET", "HEAD", "DELETE", "POST", "PUT", "PATCH", "OPTIONS"]:
|
|
78
|
+
raise ValueError("Method %s not allowed", method)
|
|
79
|
+
|
|
80
|
+
if post_params and body:
|
|
81
|
+
raise ApiValueError("body parameter cannot be used with post_params parameter.")
|
|
82
|
+
|
|
83
|
+
post_params = post_params or {}
|
|
84
|
+
headers = headers or {}
|
|
85
|
+
|
|
86
|
+
try:
|
|
87
|
+
# For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE`
|
|
88
|
+
if method in ["POST", "PUT", "PATCH", "OPTIONS", "DELETE"]:
|
|
89
|
+
|
|
90
|
+
# no content type provided or payload is json
|
|
91
|
+
content_type = headers.get("Content-Type")
|
|
92
|
+
if not content_type or re.search("json", content_type, re.IGNORECASE):
|
|
93
|
+
request_body = None
|
|
94
|
+
if body is not None:
|
|
95
|
+
request_body = json.dumps(body)
|
|
96
|
+
r = self.session.request(
|
|
97
|
+
method,
|
|
98
|
+
url,
|
|
99
|
+
data=request_body,
|
|
100
|
+
headers=headers,
|
|
101
|
+
timeout=_request_timeout,
|
|
102
|
+
)
|
|
103
|
+
elif content_type == "application/x-www-form-urlencoded":
|
|
104
|
+
r = self.session.request(
|
|
105
|
+
method,
|
|
106
|
+
url,
|
|
107
|
+
params=post_params,
|
|
108
|
+
headers=headers,
|
|
109
|
+
timeout=_request_timeout,
|
|
110
|
+
)
|
|
111
|
+
elif content_type == "multipart/form-data":
|
|
112
|
+
# must del headers['Content-Type'], or the correct
|
|
113
|
+
# Content-Type which generated by urllib3 will be
|
|
114
|
+
# overwritten.
|
|
115
|
+
del headers["Content-Type"]
|
|
116
|
+
# Ensures that dict objects are serialized
|
|
117
|
+
post_params = [(a, json.dumps(b)) if isinstance(b, dict) else (a, b) for a, b in post_params]
|
|
118
|
+
r = self.session.request(
|
|
119
|
+
method,
|
|
120
|
+
url,
|
|
121
|
+
files=post_params,
|
|
122
|
+
headers=headers,
|
|
123
|
+
timeout=_request_timeout,
|
|
124
|
+
)
|
|
125
|
+
# Pass a `string` parameter directly in the body to support
|
|
126
|
+
# other content types than JSON when `body` argument is
|
|
127
|
+
# provided in serialized form.
|
|
128
|
+
elif isinstance(body, str) or isinstance(body, bytes):
|
|
129
|
+
r = self.session.request(
|
|
130
|
+
method,
|
|
131
|
+
url,
|
|
132
|
+
data=body,
|
|
133
|
+
headers=headers,
|
|
134
|
+
timeout=_request_timeout,
|
|
135
|
+
)
|
|
136
|
+
elif headers["Content-Type"].startswith("text/") and isinstance(body, bool):
|
|
137
|
+
request_body = "true" if body else "false"
|
|
138
|
+
r = self.session.request(
|
|
139
|
+
method,
|
|
140
|
+
url,
|
|
141
|
+
data=request_body,
|
|
142
|
+
headers=headers,
|
|
143
|
+
timeout=_request_timeout,
|
|
144
|
+
)
|
|
145
|
+
else:
|
|
146
|
+
# Cannot generate the request from given parameters
|
|
147
|
+
msg = """Cannot prepare a request message for provided
|
|
148
|
+
arguments. Please check that your arguments match
|
|
149
|
+
declared content type."""
|
|
150
|
+
raise ApiException(status=0, reason=msg)
|
|
151
|
+
# For `GET`, `HEAD`
|
|
152
|
+
else:
|
|
153
|
+
r = self.session.request(
|
|
154
|
+
method,
|
|
155
|
+
url,
|
|
156
|
+
params={},
|
|
157
|
+
headers=headers,
|
|
158
|
+
timeout=_request_timeout,
|
|
159
|
+
)
|
|
160
|
+
except requests.exceptions.SSLError as e:
|
|
161
|
+
msg = "\n".join([type(e).__name__, str(e)])
|
|
162
|
+
raise ApiException(status=0, reason=msg)
|
|
163
|
+
|
|
164
|
+
return RESTResponse(r)
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: stackit-telemetrylink
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: STACKIT Telemetry Link API
|
|
5
|
+
Project-URL: Homepage, https://github.com/stackitcloud/stackit-sdk-python
|
|
6
|
+
Project-URL: Issues, https://github.com/stackitcloud/stackit-sdk-python/issues
|
|
7
|
+
Author-email: STACKIT Developer Tools <developer-tools@stackit.cloud>
|
|
8
|
+
License-File: LICENSE.md
|
|
9
|
+
License-File: NOTICE.txt
|
|
10
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
19
|
+
Requires-Python: <4.0,>=3.9
|
|
20
|
+
Requires-Dist: pydantic>=2.9.2
|
|
21
|
+
Requires-Dist: python-dateutil>=2.9.0.post0
|
|
22
|
+
Requires-Dist: requests>=2.32.3
|
|
23
|
+
Requires-Dist: stackit-core>=0.0.1a
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
|
|
26
|
+
# stackit.telemetrylink
|
|
27
|
+
This API provides endpoints for managing Telemetry Links. The Telemetry Link enables Log Routing towards a defined Telemetry Router.
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
This package is part of the STACKIT Python SDK. For additional information, please visit the [GitHub repository](https://github.com/stackitcloud/stackit-sdk-python) of the SDK.
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
## Installation & Usage
|
|
35
|
+
### pip install
|
|
36
|
+
|
|
37
|
+
```sh
|
|
38
|
+
pip install stackit-telemetrylink
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Then import the package:
|
|
42
|
+
```python
|
|
43
|
+
import stackit.telemetrylink
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Getting Started
|
|
47
|
+
|
|
48
|
+
[Examples](https://github.com/stackitcloud/stackit-sdk-python/tree/main/examples) for the usage of the package can be found in the [GitHub repository](https://github.com/stackitcloud/stackit-sdk-python) of the SDK.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
src/stackit/telemetrylink/__init__.py,sha256=4S5gMnVkGHm6QD68mCRM3f8EBfldRuHa93gEMKsXYc0,3322
|
|
2
|
+
src/stackit/telemetrylink/api_client.py,sha256=gryzuz2fhP3RA0mdtANKgs74HXBu2V7x2Z7lAFJAgM8,23825
|
|
3
|
+
src/stackit/telemetrylink/api_response.py,sha256=HRYkVqMNIlfODacTQPTbiVj2YdcnutpQrKJdeAoCSpM,642
|
|
4
|
+
src/stackit/telemetrylink/configuration.py,sha256=FR7_KwY6tM78d4bXZ3a03MLVmJfDOBqYF9tEuEc5Kbs,5756
|
|
5
|
+
src/stackit/telemetrylink/exceptions.py,sha256=7vsIs3IHzqXFin4CsT4Jq2buSEPJAVcElxSZcxpzIWo,6467
|
|
6
|
+
src/stackit/telemetrylink/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
+
src/stackit/telemetrylink/rest.py,sha256=3GxrDGT-VO6ZlvVOigxFNylITumNKb4t0buv27abuTo,6463
|
|
8
|
+
src/stackit/telemetrylink/api/__init__.py,sha256=lcU6Aa86261uPDt9pnMoulKv3w43HOfULSWtj2BY-GY,108
|
|
9
|
+
src/stackit/telemetrylink/api/default_api.py,sha256=f307jbX9Tk4kNnJlAhVV7X3feqnwfnKGGUb-IyLQL_8,151998
|
|
10
|
+
src/stackit/telemetrylink/models/__init__.py,sha256=yKyJurrm7XJVgfEdzh8cSg-lblH17T7nQyWTh4sKln4,1501
|
|
11
|
+
src/stackit/telemetrylink/models/create_or_update_folder_telemetry_link_payload.py,sha256=75ZjRsRC35egAKz5RgIfwSMkYlQxedRqNVNjhJxCFqM,4801
|
|
12
|
+
src/stackit/telemetrylink/models/create_or_update_organization_telemetry_link_payload.py,sha256=u8GKnfw8U2Bu4OwL07ArNXsyIyFFdjBF3bqku5AG6KQ,4825
|
|
13
|
+
src/stackit/telemetrylink/models/create_or_update_project_telemetry_link_payload.py,sha256=_qd5GNYc42FOlaffQ4ZisCEnu4gxdnd9uRgp9JSRiNs,4805
|
|
14
|
+
src/stackit/telemetrylink/models/partial_update_folder_telemetry_link_payload.py,sha256=dy9W0gZxBJtVLj5YnZ77dAe8ZZWRZDY9FUphuhajY6o,5045
|
|
15
|
+
src/stackit/telemetrylink/models/partial_update_organization_telemetry_link_payload.py,sha256=KrgWEf-9U8g42UcTyutA7ZFDlRbf1789bd8N2MLft58,5069
|
|
16
|
+
src/stackit/telemetrylink/models/partial_update_project_telemetry_link_payload.py,sha256=92vaBKtsQm8TsjArDmDojWTdaFixFY0fXRXFmldHFO0,5049
|
|
17
|
+
src/stackit/telemetrylink/models/response4xx.py,sha256=JauyrnJ6O-vghglJGL4Gr92SM6O__xQE9rjblblAJWo,2527
|
|
18
|
+
src/stackit/telemetrylink/models/telemetry_link_request.py,sha256=Y8zct6S26XHT_54BJGwZamUA8i54X3thQUj-luDqzXM,4969
|
|
19
|
+
src/stackit/telemetrylink/models/telemetry_link_response.py,sha256=NaywliFc173OIfMRPQ-yGcnDHa_7teKqRMvKau6VKlc,5826
|
|
20
|
+
stackit_telemetrylink-0.1.0.dist-info/METADATA,sha256=cLnF6r41PhOfV39WGMQQRWnrKWbv8ng66hhJdsAisMk,1777
|
|
21
|
+
stackit_telemetrylink-0.1.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
22
|
+
stackit_telemetrylink-0.1.0.dist-info/licenses/LICENSE.md,sha256=bxVEBCY6jGvAUq3_nmX12ZB8QzOWIggH_0dVHa9_dyc,10933
|
|
23
|
+
stackit_telemetrylink-0.1.0.dist-info/licenses/NOTICE.txt,sha256=NESBPFtqggnWcQq_yq03rT2nMyTAoZ4cCqvMSlUE0yk,67
|
|
24
|
+
stackit_telemetrylink-0.1.0.dist-info/RECORD,,
|