sap-ai-sdk-core 2.9.9__py3-none-any.whl → 3.0.3__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.
- ai_core_sdk/ai_core_v2_client.py +157 -0
- ai_core_sdk/cli.py +172 -0
- ai_core_sdk/credentials.py +196 -0
- ai_core_sdk/exception.py +11 -0
- ai_core_sdk/helpers/__init__.py +39 -0
- ai_core_sdk/helpers/constants.py +18 -0
- ai_core_sdk/helpers/logging.py +23 -0
- ai_core_sdk/models/__init__.py +33 -0
- ai_core_sdk/models/application.py +37 -0
- ai_core_sdk/models/application_query_response.py +30 -0
- ai_core_sdk/models/application_resource_sync_status.py +34 -0
- ai_core_sdk/models/application_source.py +34 -0
- ai_core_sdk/models/application_status.py +66 -0
- ai_core_sdk/models/base_models.py +62 -0
- ai_core_sdk/models/docker_registry_secret.py +23 -0
- ai_core_sdk/models/docker_registry_secret_query_response.py +30 -0
- ai_core_sdk/models/kpi.py +25 -0
- ai_core_sdk/models/object_store_secret.py +32 -0
- ai_core_sdk/models/object_store_secret_query_response.py +30 -0
- ai_core_sdk/models/repository.py +36 -0
- ai_core_sdk/models/repository_query_response.py +30 -0
- ai_core_sdk/models/repository_status.py +9 -0
- ai_core_sdk/models/resource_group.py +50 -0
- ai_core_sdk/models/resource_group_query_response.py +31 -0
- ai_core_sdk/models/resource_group_status.py +9 -0
- ai_core_sdk/models/secret.py +30 -0
- ai_core_sdk/models/secret_query_response.py +30 -0
- ai_core_sdk/resource_clients/__init__.py +13 -0
- ai_core_sdk/resource_clients/applications_client.py +173 -0
- ai_core_sdk/resource_clients/docker_registry_secrets_client.py +117 -0
- ai_core_sdk/resource_clients/internal_rest_client.py +52 -0
- ai_core_sdk/resource_clients/kpi_client.py +26 -0
- ai_core_sdk/resource_clients/metrics_client.py +131 -0
- ai_core_sdk/resource_clients/object_store_secrets_client.py +215 -0
- ai_core_sdk/resource_clients/repositories_client.py +116 -0
- ai_core_sdk/resource_clients/secrets_client.py +148 -0
- ai_core_sdk/tracking/__init__.py +2 -0
- ai_core_sdk/tracking/tracking.py +215 -0
- sap_ai_sdk_core-3.0.3.data/data/docs/ai_core_sdk.ai_core_v2_client.html +127 -0
- sap_ai_sdk_core-3.0.3.data/data/docs/ai_core_sdk.cli.html +59 -0
- sap_ai_sdk_core-3.0.3.data/data/docs/ai_core_sdk.credentials.html +209 -0
- sap_ai_sdk_core-3.0.3.data/data/docs/ai_core_sdk.exception.html +161 -0
- sap_ai_sdk_core-3.0.3.data/data/docs/ai_core_sdk.helpers.constants.html +90 -0
- sap_ai_sdk_core-3.0.3.data/data/docs/ai_core_sdk.helpers.html +52 -0
- sap_ai_sdk_core-3.0.3.data/data/docs/ai_core_sdk.helpers.logging.html +41 -0
- sap_ai_sdk_core-3.0.3.data/data/docs/ai_core_sdk.html +29 -0
- sap_ai_sdk_core-3.0.3.data/data/docs/ai_core_sdk.models.application.html +79 -0
- sap_ai_sdk_core-3.0.3.data/data/docs/ai_core_sdk.models.application_query_response.html +86 -0
- sap_ai_sdk_core-3.0.3.data/data/docs/ai_core_sdk.models.application_resource_sync_status.html +77 -0
- sap_ai_sdk_core-3.0.3.data/data/docs/ai_core_sdk.models.application_source.html +77 -0
- sap_ai_sdk_core-3.0.3.data/data/docs/ai_core_sdk.models.application_status.html +90 -0
- sap_ai_sdk_core-3.0.3.data/data/docs/ai_core_sdk.models.base_models.html +120 -0
- sap_ai_sdk_core-3.0.3.data/data/docs/ai_core_sdk.models.docker_registry_secret.html +85 -0
- sap_ai_sdk_core-3.0.3.data/data/docs/ai_core_sdk.models.docker_registry_secret_query_response.html +86 -0
- sap_ai_sdk_core-3.0.3.data/data/docs/ai_core_sdk.models.html +40 -0
- sap_ai_sdk_core-3.0.3.data/data/docs/ai_core_sdk.models.kpi.html +73 -0
- sap_ai_sdk_core-3.0.3.data/data/docs/ai_core_sdk.models.object_store_secret.html +71 -0
- sap_ai_sdk_core-3.0.3.data/data/docs/ai_core_sdk.models.object_store_secret_query_response.html +86 -0
- sap_ai_sdk_core-3.0.3.data/data/docs/ai_core_sdk.models.repository.html +77 -0
- sap_ai_sdk_core-3.0.3.data/data/docs/ai_core_sdk.models.repository_query_response.html +86 -0
- sap_ai_sdk_core-3.0.3.data/data/docs/ai_core_sdk.models.repository_status.html +69 -0
- sap_ai_sdk_core-3.0.3.data/data/docs/ai_core_sdk.models.resource_group.html +85 -0
- sap_ai_sdk_core-3.0.3.data/data/docs/ai_core_sdk.models.resource_group_query_response.html +86 -0
- sap_ai_sdk_core-3.0.3.data/data/docs/ai_core_sdk.models.resource_group_status.html +69 -0
- sap_ai_sdk_core-3.0.3.data/data/docs/ai_core_sdk.models.secret.html +76 -0
- sap_ai_sdk_core-3.0.3.data/data/docs/ai_core_sdk.models.secret_query_response.html +86 -0
- sap_ai_sdk_core-3.0.3.data/data/docs/ai_core_sdk.resource_clients.applications_client.html +186 -0
- sap_ai_sdk_core-3.0.3.data/data/docs/ai_core_sdk.resource_clients.docker_registry_secrets_client.html +147 -0
- sap_ai_sdk_core-3.0.3.data/data/docs/ai_core_sdk.resource_clients.html +29 -0
- sap_ai_sdk_core-3.0.3.data/data/docs/ai_core_sdk.resource_clients.internal_rest_client.html +181 -0
- sap_ai_sdk_core-3.0.3.data/data/docs/ai_core_sdk.resource_clients.kpi_client.html +87 -0
- sap_ai_sdk_core-3.0.3.data/data/docs/ai_core_sdk.resource_clients.metrics_client.html +189 -0
- sap_ai_sdk_core-3.0.3.data/data/docs/ai_core_sdk.resource_clients.object_store_secrets_client.html +205 -0
- sap_ai_sdk_core-3.0.3.data/data/docs/ai_core_sdk.resource_clients.repositories_client.html +148 -0
- sap_ai_sdk_core-3.0.3.data/data/docs/ai_core_sdk.resource_clients.resource_groups_client.html +156 -0
- sap_ai_sdk_core-3.0.3.data/data/docs/ai_core_sdk.resource_clients.secrets_client.html +165 -0
- sap_ai_sdk_core-3.0.3.data/data/docs/ai_core_sdk.tracking.html +22 -0
- sap_ai_sdk_core-3.0.3.data/data/docs/ai_core_sdk.tracking.tracking.html +224 -0
- sap_ai_sdk_core-3.0.3.dist-info/METADATA +253 -0
- sap_ai_sdk_core-3.0.3.dist-info/RECORD +84 -0
- {sap_ai_sdk_core-2.9.9.dist-info → sap_ai_sdk_core-3.0.3.dist-info}/WHEEL +1 -1
- sap_ai_sdk_core-3.0.3.dist-info/top_level.txt +1 -0
- sap_ai_sdk_core-2.9.9.dist-info/METADATA +0 -43
- sap_ai_sdk_core-2.9.9.dist-info/RECORD +0 -6
- sap_ai_sdk_core-2.9.9.dist-info/top_level.txt +0 -1
- {sap-ai-sdk-core → ai_core_sdk}/__init__.py +0 -0
- {sap_ai_sdk_core-2.9.9.dist-info/licenses → sap_ai_sdk_core-3.0.3.dist-info}/LICENSE +0 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
from typing import Dict
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class Application:
|
|
5
|
+
"""The Application object defines the application.
|
|
6
|
+
|
|
7
|
+
:param path: path within the repository
|
|
8
|
+
:type path: str
|
|
9
|
+
:param revision: revision
|
|
10
|
+
:type revision: str
|
|
11
|
+
:param repository_url: URL of the repository
|
|
12
|
+
:type repository_url: str
|
|
13
|
+
:param application_name: name of the application
|
|
14
|
+
:type application_name: str
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
# pylint:disable=W0613
|
|
18
|
+
def __init__(self, path: str, revision: str, repository_url: str, application_name: str, **kwargs):
|
|
19
|
+
self.path: str = path
|
|
20
|
+
self.revision: str = revision
|
|
21
|
+
self.repository_url: str = repository_url
|
|
22
|
+
self.application_name: str = application_name
|
|
23
|
+
|
|
24
|
+
def __str__(self):
|
|
25
|
+
return "Application name: " + str(self.application_name)
|
|
26
|
+
|
|
27
|
+
@staticmethod
|
|
28
|
+
def from_dict(application_dict: Dict[str, str]):
|
|
29
|
+
"""Returns a :class:`ai_core_sdk.models.application.Application` object, created from the values in
|
|
30
|
+
the dict provided as parameter
|
|
31
|
+
|
|
32
|
+
:param application_dict: Dict which includes the necessary values to create the object
|
|
33
|
+
:type application_dict: Dict[str, Any]
|
|
34
|
+
:return: An object, created from the values provided
|
|
35
|
+
:rtype: class:`ai_core_sdk.models.application.Application`
|
|
36
|
+
"""
|
|
37
|
+
return Application(**application_dict)
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
from typing import Any, Dict, List
|
|
2
|
+
|
|
3
|
+
from ai_core_sdk.models import QueryResponse
|
|
4
|
+
from ai_core_sdk.models.application import Application
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class ApplicationQueryResponse(QueryResponse):
|
|
8
|
+
"""The ApplicationQueryResponse object defines the response of the applications query request
|
|
9
|
+
:param resources: List of the applications returned from the server
|
|
10
|
+
:type resources: List[class:`ai_core_sdk.models.application.Application`]
|
|
11
|
+
:param count: Total number of the queried applications
|
|
12
|
+
:type count: int
|
|
13
|
+
:param `**kwargs`: The keyword arguments are there in case there are additional attributes returned from server
|
|
14
|
+
"""
|
|
15
|
+
def __init__(self, resources: List[Application], count: int, **kwargs):
|
|
16
|
+
super().__init__(resources=resources, count=count, **kwargs)
|
|
17
|
+
|
|
18
|
+
@staticmethod
|
|
19
|
+
def from_dict(response_dict: Dict[str, Any]):
|
|
20
|
+
"""Returns a
|
|
21
|
+
:class:`ai_core_sdk.models.application_query_response.ApplicationQueryResponse`
|
|
22
|
+
object, created from the values in the dict provided as parameter
|
|
23
|
+
|
|
24
|
+
:param response_dict: Dict which includes the necessary values to create the object
|
|
25
|
+
:type response_dict: Dict[str, Any]
|
|
26
|
+
:return: An object, created from the values provided
|
|
27
|
+
:rtype: class:`ai_core_sdk.models.application_query_response.ApplicationQueryResponse`
|
|
28
|
+
"""
|
|
29
|
+
response_dict['resources'] = [Application.from_dict(r) for r in response_dict['resources']]
|
|
30
|
+
return ApplicationQueryResponse(**response_dict)
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
from typing import Dict
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class ApplicationResourceSyncStatus:
|
|
5
|
+
"""The ApplicationSyncResourcesStatus object defines the status of sync of application resource.
|
|
6
|
+
|
|
7
|
+
:param name: Name of the application resource, defaults to None
|
|
8
|
+
:type name: str, optional
|
|
9
|
+
:param kind: kind of the application resource
|
|
10
|
+
:type kind: str, optional
|
|
11
|
+
:param status: status of the sync of the application resource
|
|
12
|
+
:type status: str, optional
|
|
13
|
+
:param message: application resource message
|
|
14
|
+
:type message: str, optional
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
def __init__(self, name: str = None, kind: str = None, status: str = None, message: str = None, **kwargs):
|
|
18
|
+
self.name: str = name
|
|
19
|
+
self.kind: str = kind
|
|
20
|
+
self.status: str = status
|
|
21
|
+
self.message: str = message
|
|
22
|
+
|
|
23
|
+
@staticmethod
|
|
24
|
+
def from_dict(app_res_sync_status_dict: Dict[str, str]):
|
|
25
|
+
"""Returns a :class:`ai_core_sdk.models.application_resource_sync_status.ApplicationResourceSyncStatus`
|
|
26
|
+
object, created from the values in the dict provided as parameter
|
|
27
|
+
|
|
28
|
+
:param app_res_sync_status_dict: Dict which includes the necessary values to create the object
|
|
29
|
+
:type app_res_sync_status_dict: Dict[str, str]
|
|
30
|
+
:return: An object, created from the values provided
|
|
31
|
+
:rtype: class:`ai_core_sdk.models.application_resource_sync_status.ApplicationResourceSyncStatus`
|
|
32
|
+
"""
|
|
33
|
+
return ApplicationResourceSyncStatus(**app_res_sync_status_dict)
|
|
34
|
+
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
from typing import Dict
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class ApplicationSource:
|
|
5
|
+
"""The ApplicationSource object defines the application source.
|
|
6
|
+
|
|
7
|
+
:param repo_url: URL of the repository, defaults to None
|
|
8
|
+
:type repo_url: str, optional
|
|
9
|
+
:param path: path within the repository, defaults to None
|
|
10
|
+
:type path: str, optional
|
|
11
|
+
:param revision: revision number of the application, defaults to None
|
|
12
|
+
:type revision: str, optional
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
# pylint:disable=W0613
|
|
16
|
+
def __init__(self, repo_url: str = None, path: str = None, revision: str = None, **kwargs):
|
|
17
|
+
self.repourl: str = repo_url
|
|
18
|
+
self.path: str = path
|
|
19
|
+
self.revision: str = revision
|
|
20
|
+
|
|
21
|
+
def __str__(self):
|
|
22
|
+
return "ApplicationSource repourl: " + str(self.repourl) + ", ApplicationSource revision: " + str(self.revision)
|
|
23
|
+
|
|
24
|
+
@staticmethod
|
|
25
|
+
def from_dict(application_source_dict: Dict[str, str]):
|
|
26
|
+
"""Returns a :class:`ai_core_sdk.models.application_source.ApplicationSource` object, created from the values in
|
|
27
|
+
the dict provided as parameter
|
|
28
|
+
|
|
29
|
+
:param application_source_dict: Dict which includes the necessary values to create the object
|
|
30
|
+
:type application_source_dict: Dict[str, Any]
|
|
31
|
+
:return: An object, created from the values provided
|
|
32
|
+
:rtype: class:`ai_core_sdk.models.application_source.ApplicationSource`
|
|
33
|
+
"""
|
|
34
|
+
return ApplicationSource(**application_source_dict)
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
from typing import Any, Dict, List
|
|
2
|
+
|
|
3
|
+
from ai_core_sdk.models.application_source import ApplicationSource
|
|
4
|
+
from ai_core_sdk.models.application_resource_sync_status import ApplicationResourceSyncStatus
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class ApplicationStatus:
|
|
8
|
+
"""The Application object defines the application.
|
|
9
|
+
|
|
10
|
+
:param health_status: Application health status, defaults to None
|
|
11
|
+
:type health_status: str, optional
|
|
12
|
+
:param sync_status: Application sync status, defaults to None
|
|
13
|
+
:type sync_status: str, optional
|
|
14
|
+
:param message: Application health status message, defaults to None
|
|
15
|
+
:type message: str, optional
|
|
16
|
+
:param source: Application source, defaults to None
|
|
17
|
+
:type source: class:`ai_core_sdk.models.application_status.ApplicationStatus`, optional
|
|
18
|
+
:param sync_finished_at: Application sync finish time, defaults to None
|
|
19
|
+
:type sync_finished_at: str, optional
|
|
20
|
+
:param sync_started_at: Application sync start time, defaults to None
|
|
21
|
+
:type sync_started_at: str, optional
|
|
22
|
+
:param reconciled_at: Application reconciliation time, defaults to None
|
|
23
|
+
:type reconciled_at: str, optional
|
|
24
|
+
:param sync_resources_status: Status of the synchronization of the application resources, defaults to None
|
|
25
|
+
:type sync_resources_status:
|
|
26
|
+
List[class:`ai_core_sdk.models.application_resource_sync_status.ApplicationResourceSyncStatus`], optional
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
def __init__(self, health_status: str = None, sync_status: str = None, message: str = None,
|
|
30
|
+
source: ApplicationSource = None, sync_finished_at: str = None, sync_started_at: str = None,
|
|
31
|
+
reconciled_at: str = None, sync_resources_status: List[ApplicationResourceSyncStatus] = None,
|
|
32
|
+
**kwargs):
|
|
33
|
+
self.health_status: str = health_status
|
|
34
|
+
self.sync_status: str = sync_status
|
|
35
|
+
self.message: str = message
|
|
36
|
+
self.source: ApplicationSource = source
|
|
37
|
+
self.sync_finished_at: str = sync_finished_at
|
|
38
|
+
self.sync_started_at: str = sync_started_at
|
|
39
|
+
self.reconciled_at: str = reconciled_at
|
|
40
|
+
self.sync_resources_status: List[ApplicationResourceSyncStatus] = sync_resources_status
|
|
41
|
+
# sync_ressources_status property is deprecated, please use sync_resources_status instead
|
|
42
|
+
self.sync_ressources_status: List[ApplicationResourceSyncStatus] = self.sync_resources_status
|
|
43
|
+
|
|
44
|
+
def __str__(self):
|
|
45
|
+
return "ApplicationStatus health status: " + str(self.health_status) + \
|
|
46
|
+
", ApplicationStatus sync status: " + str(self.sync_status) + \
|
|
47
|
+
", ApplicationStatus message: " + str(self.message) + ", " + str(self.source)
|
|
48
|
+
|
|
49
|
+
@staticmethod
|
|
50
|
+
def from_dict(application_status_dict: Dict[str, Any]):
|
|
51
|
+
"""Returns a :class:`ai_core_sdk.models.application_status.ApplicationStatus` object, created from the values in
|
|
52
|
+
the dict provided as parameter
|
|
53
|
+
|
|
54
|
+
:param application_status_dict: Dict which includes the necessary values to create the object
|
|
55
|
+
:type application_status_dict: Dict[str, Any]
|
|
56
|
+
:return: An object, created from the values provided
|
|
57
|
+
:rtype: class:`ai_core_sdk.models.application_status.ApplicationStatus`
|
|
58
|
+
"""
|
|
59
|
+
if 'source' in application_status_dict:
|
|
60
|
+
application_status_dict['source'] = ApplicationSource.from_dict(application_status_dict['source'])
|
|
61
|
+
if 'sync_resources_status' in application_status_dict:
|
|
62
|
+
application_status_dict['sync_resources_status'] = [
|
|
63
|
+
ApplicationResourceSyncStatus.from_dict(asd)
|
|
64
|
+
for asd in application_status_dict['sync_resources_status']
|
|
65
|
+
]
|
|
66
|
+
return ApplicationStatus(**application_status_dict)
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
from typing import Dict
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class BasicNameResponse:
|
|
5
|
+
"""The BasicNameResponse object defines the response with name from the server
|
|
6
|
+
|
|
7
|
+
:param name: Name of the relevant resource
|
|
8
|
+
:type id: str
|
|
9
|
+
:param message: Response message from the server
|
|
10
|
+
:type message: str
|
|
11
|
+
:param `**kwargs`: The keyword arguments are there in case there are additional attributes returned from server
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
def __init__(self, name: str, message: str, **kwargs):
|
|
15
|
+
self.name: str = name
|
|
16
|
+
self.message: str = message
|
|
17
|
+
|
|
18
|
+
def __str__(self):
|
|
19
|
+
return "Name: " + str(self.name) + ", Message: " + str(self.message)
|
|
20
|
+
|
|
21
|
+
@staticmethod
|
|
22
|
+
def from_dict(bnr_dict: Dict[str, str]):
|
|
23
|
+
"""Returns a :class:`ai_core_sdk.models.base_models.BasicNameResponse` object, created from the values in the
|
|
24
|
+
dict provided as parameter
|
|
25
|
+
|
|
26
|
+
:param bnr_dict: Dict which includes the necessary values to create the object
|
|
27
|
+
:type bnr_dict: Dict[str, str]
|
|
28
|
+
:return: An object, created from the values provided
|
|
29
|
+
:rtype: class:`ai_core_sdk.models.base_models.BasicNameResponse`
|
|
30
|
+
"""
|
|
31
|
+
return BasicNameResponse(**bnr_dict)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class Message:
|
|
35
|
+
"""Message object defines a message
|
|
36
|
+
|
|
37
|
+
:param message: message
|
|
38
|
+
:type message: str
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
def __init__(self, message: str, **kwargs):
|
|
42
|
+
self.message: str = message
|
|
43
|
+
|
|
44
|
+
def __eq__(self, other):
|
|
45
|
+
if not isinstance(other, Message):
|
|
46
|
+
return False
|
|
47
|
+
return self.message == other.message
|
|
48
|
+
|
|
49
|
+
def __str__(self):
|
|
50
|
+
return "Message: " + str(self.message)
|
|
51
|
+
|
|
52
|
+
@staticmethod
|
|
53
|
+
def from_dict(message_dict: Dict[str, str]):
|
|
54
|
+
"""Returns a :class:`ai_core_sdk.models.base_models.Message` object, created from the values in the
|
|
55
|
+
dict provided as parameter
|
|
56
|
+
|
|
57
|
+
:param message_dict: Dict which includes the necessary values to create the object
|
|
58
|
+
:type message_dict: Dict[str, str]
|
|
59
|
+
:return: An object, created from the values provided
|
|
60
|
+
:rtype: class:`ai_core_sdk.models.base_models.Message`
|
|
61
|
+
"""
|
|
62
|
+
return Message(**message_dict)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
from typing import Dict
|
|
2
|
+
|
|
3
|
+
from ai_core_sdk.models import Name
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class DockerRegistrySecret(Name):
|
|
7
|
+
"""The DockerRegistrySecret object defines the docker registry secret. Refer to
|
|
8
|
+
:class:`ai_api_client_sdk.models.base_models.Name`, for the object definition
|
|
9
|
+
"""
|
|
10
|
+
def __str__(self):
|
|
11
|
+
return "DockerRegistrySecret name: " + str(self.name)
|
|
12
|
+
|
|
13
|
+
@staticmethod
|
|
14
|
+
def from_dict(docker_registry_secret_dict: Dict[str, str]):
|
|
15
|
+
"""Returns a :class:`ai_core_sdk.models.docker_registry_secret.DockerRegistrySecret` object, created
|
|
16
|
+
from the values in the dict provided as parameter
|
|
17
|
+
|
|
18
|
+
:param docker_registry_secret_dict: Dict which includes the necessary values to create the object
|
|
19
|
+
:type docker_registry_secret_dict: Dict[str, str]
|
|
20
|
+
:return: An object, created from the values provided
|
|
21
|
+
:rtype: class:`ai_core_sdk.models.docker_registry_secret.DockerRegistrySecret`
|
|
22
|
+
"""
|
|
23
|
+
return DockerRegistrySecret(**docker_registry_secret_dict)
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
from typing import Any, Dict, List
|
|
2
|
+
|
|
3
|
+
from ai_core_sdk.models import QueryResponse
|
|
4
|
+
from ai_core_sdk.models.docker_registry_secret import DockerRegistrySecret
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class DockerRegistrySecretQueryResponse(QueryResponse):
|
|
8
|
+
"""The DockerRegistrySecretQueryResponse object defines the response of the dockerRegistrySecrets query request
|
|
9
|
+
:param resources: List of the docker registry secrets returned from the server
|
|
10
|
+
:type resources: List[class:`ai_core_sdk.models.docker_registry_secret.DockerRegistrySecret`]
|
|
11
|
+
:param count: Total number of the queried docker registry secrets
|
|
12
|
+
:type count: int
|
|
13
|
+
:param `**kwargs`: The keyword arguments are there in case there are additional attributes returned from server
|
|
14
|
+
"""
|
|
15
|
+
def __init__(self, resources: List[DockerRegistrySecret], count: int, **kwargs):
|
|
16
|
+
super().__init__(resources=resources, count=count, **kwargs)
|
|
17
|
+
|
|
18
|
+
@staticmethod
|
|
19
|
+
def from_dict(response_dict: Dict[str, Any]):
|
|
20
|
+
"""Returns a
|
|
21
|
+
:class:`ai_core_sdk.models.docker_registry_secret_query_response.DockerRegistrySecretQueryResponse`
|
|
22
|
+
object, created from the values in the dict provided as parameter
|
|
23
|
+
|
|
24
|
+
:param response_dict: Dict which includes the necessary values to create the object
|
|
25
|
+
:type response_dict: Dict[str, Any]
|
|
26
|
+
:return: An object, created from the values provided
|
|
27
|
+
:rtype: class:`ai_core_sdk.models.docker_registry_secret_query_response.DockerRegistrySecretQueryResponse`
|
|
28
|
+
"""
|
|
29
|
+
response_dict['resources'] = [DockerRegistrySecret.from_dict(r) for r in response_dict['resources']]
|
|
30
|
+
return DockerRegistrySecretQueryResponse(**response_dict)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
from typing import Any, Dict, List, Union
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class Kpi:
|
|
5
|
+
"""The Kpi object defines the Kpi data.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
def __init__(self, header: List[str], rows: List[Union[str, int]], **kwargs):
|
|
9
|
+
self.header: List[str] = header
|
|
10
|
+
self.rows: List[Union[str, int]] = rows
|
|
11
|
+
|
|
12
|
+
def __str__(self):
|
|
13
|
+
return "KPIs header(s): " + ', '.join(self.header)
|
|
14
|
+
|
|
15
|
+
@staticmethod
|
|
16
|
+
def from_dict(kpi_dict: Dict[str, Any]):
|
|
17
|
+
"""Returns a :class:`ai_core_sdk.models.kpi.Kpi` object, created
|
|
18
|
+
from the values in the dict provided as parameter
|
|
19
|
+
|
|
20
|
+
:param kpi_dict: Dict which includes the necessary values to create the object
|
|
21
|
+
:type kpi_dict: Dict[str, Any]
|
|
22
|
+
:return: An object, created from the values provided
|
|
23
|
+
:rtype: class:`ai_core_sdk.models.kpi.Kpi`
|
|
24
|
+
"""
|
|
25
|
+
return Kpi(**kpi_dict)
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
from typing import Any, Dict
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class ObjectStoreSecret:
|
|
5
|
+
"""The ObjectStoreSecret object defines the object store secret response.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
def __init__(self, name: str, metadata: Dict[str, str], **kwargs):
|
|
9
|
+
key_prefix = 'storage.ai.sap.com/'
|
|
10
|
+
path_prefix_key = f'{key_prefix}path_prefix'
|
|
11
|
+
self.name: str = name
|
|
12
|
+
self.metadata: Dict[str, str] = metadata
|
|
13
|
+
# pathPrefix key is getting converted into snake case during object mapping d
|
|
14
|
+
# The below code converts path prefix from snake case to camel case
|
|
15
|
+
if path_prefix_key in metadata:
|
|
16
|
+
self.metadata[f'{key_prefix}pathPrefix'] = metadata[path_prefix_key]
|
|
17
|
+
del metadata[path_prefix_key]
|
|
18
|
+
|
|
19
|
+
def __str__(self):
|
|
20
|
+
return "Object store secret name: " + str(self.name)
|
|
21
|
+
|
|
22
|
+
@staticmethod
|
|
23
|
+
def from_dict(object_store_secret_dict: Dict[str, Any]):
|
|
24
|
+
"""Returns a :class:`ai_core_sdk.models.object_store_secret.ObjectStoreSecret` object, created
|
|
25
|
+
from the values in the dict provided as parameter
|
|
26
|
+
|
|
27
|
+
:param object_store_secret_dict: Dict which includes the necessary values to create the object
|
|
28
|
+
:type object_store_secret_dict: Dict[str, Any]
|
|
29
|
+
:return: An object, created from the values provided
|
|
30
|
+
:rtype: class:`ai_core_sdk.models.object_store_secret.ObjectStoreSecret`
|
|
31
|
+
"""
|
|
32
|
+
return ObjectStoreSecret(**object_store_secret_dict)
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
from typing import Any, Dict, List
|
|
2
|
+
|
|
3
|
+
from ai_core_sdk.models import QueryResponse
|
|
4
|
+
from ai_core_sdk.models.object_store_secret import ObjectStoreSecret
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class ObjectStoreSecretQueryResponse(QueryResponse):
|
|
8
|
+
"""The ObjectStoreSecretQueryResponse object defines the response of the object store secret query request
|
|
9
|
+
:param resources: List of the object store secrets returned from the server
|
|
10
|
+
:type resources: List[class:`ai_core_sdk.models.object_store_secret.ObjectStoreSecret`]
|
|
11
|
+
:param count: Total number of the queried object store secrets
|
|
12
|
+
:type count: int
|
|
13
|
+
:param `**kwargs`: The keyword arguments are there in case there are additional attributes returned from server
|
|
14
|
+
"""
|
|
15
|
+
def __init__(self, resources: List[ObjectStoreSecret], count: int, **kwargs):
|
|
16
|
+
super().__init__(resources=resources, count=count, **kwargs)
|
|
17
|
+
|
|
18
|
+
@staticmethod
|
|
19
|
+
def from_dict(response_dict: Dict[str, Any]):
|
|
20
|
+
"""Returns a
|
|
21
|
+
:class:`ai_core_sdk.models.object_store_secret_query_response.ObjectStoreSecretQueryResponse`
|
|
22
|
+
object, created from the values in the dict provided as parameter
|
|
23
|
+
|
|
24
|
+
:param response_dict: Dict which includes the necessary values to create the object
|
|
25
|
+
:type response_dict: Dict[str, Any]
|
|
26
|
+
:return: An object, created from the values provided
|
|
27
|
+
:rtype: class:`ai_core_sdk.models.object_store_secret_query_response.ObjectStoreSecretQueryResponse`
|
|
28
|
+
"""
|
|
29
|
+
response_dict['resources'] = [ObjectStoreSecret.from_dict(r) for r in response_dict['resources']]
|
|
30
|
+
return ObjectStoreSecretQueryResponse(**response_dict)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
from typing import Dict
|
|
2
|
+
|
|
3
|
+
from ai_core_sdk.models.repository_status import RepositoryStatus
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Repository:
|
|
7
|
+
"""The Repository object defines the repository
|
|
8
|
+
|
|
9
|
+
:param name: name of the repository
|
|
10
|
+
:type name: str
|
|
11
|
+
:param url: URL of the repository
|
|
12
|
+
:type url: str
|
|
13
|
+
:param status: status of the repository, defaults to None
|
|
14
|
+
:type status: class:`ai_core_sdk.models.repository_status.RepositoryStatus`, optional
|
|
15
|
+
"""
|
|
16
|
+
def __init__(self, name: str, url: str, status: RepositoryStatus = None, **kwargs):
|
|
17
|
+
self.name: str = name
|
|
18
|
+
self.url: str = url
|
|
19
|
+
self.status: RepositoryStatus = status
|
|
20
|
+
|
|
21
|
+
def __str__(self):
|
|
22
|
+
return "Repository name: " + str(self.name) + ", Repository url: " + str(self.url)
|
|
23
|
+
|
|
24
|
+
@staticmethod
|
|
25
|
+
def from_dict(repository_dict: Dict[str, str]):
|
|
26
|
+
"""Returns a :class:`ai_core_sdk.models.repository.Repository` object, created
|
|
27
|
+
from the values in the dict provided as parameter
|
|
28
|
+
|
|
29
|
+
:param repository_dict: Dict which includes the necessary values to create the object
|
|
30
|
+
:type repository_dict: Dict[str, Any]
|
|
31
|
+
:return: An object, created from the values provided
|
|
32
|
+
:rtype: class:`ai_core_sdk.models.repository.Repository`
|
|
33
|
+
"""
|
|
34
|
+
if 'status' in repository_dict:
|
|
35
|
+
repository_dict['status'] = RepositoryStatus(repository_dict['status'])
|
|
36
|
+
return Repository(**repository_dict)
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
from typing import Any, Dict, List
|
|
2
|
+
|
|
3
|
+
from ai_core_sdk.models import QueryResponse
|
|
4
|
+
from ai_core_sdk.models.repository import Repository
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class RepositoryQueryResponse(QueryResponse):
|
|
8
|
+
"""The RepositoryQueryResponse object defines the response of the repository query request
|
|
9
|
+
:param resources: List of the repositories returned from the server
|
|
10
|
+
:type resources: List[class:`ai_core_sdk.models.repository.Repository`]
|
|
11
|
+
:param count: Total number of the queried repositories
|
|
12
|
+
:type count: int
|
|
13
|
+
:param `**kwargs`: The keyword arguments are there in case there are additional attributes returned from server
|
|
14
|
+
"""
|
|
15
|
+
def __init__(self, resources: List[Repository], count: int, **kwargs):
|
|
16
|
+
super().__init__(resources=resources, count=count, **kwargs)
|
|
17
|
+
|
|
18
|
+
@staticmethod
|
|
19
|
+
def from_dict(response_dict: Dict[str, Any]):
|
|
20
|
+
"""Returns a
|
|
21
|
+
:class:`ai_core_client_sdk.models.repository_query_response.RepositoryQueryResponse`
|
|
22
|
+
object, created from the values in the dict provided as parameter
|
|
23
|
+
|
|
24
|
+
:param response_dict: Dict which includes the necessary values to create the object
|
|
25
|
+
:type response_dict: Dict[str, Any]
|
|
26
|
+
:return: An object, created from the values provided
|
|
27
|
+
:rtype: class:`ai_core_sdk.models.repository_query_response.RepositoryQueryResponse`
|
|
28
|
+
"""
|
|
29
|
+
response_dict['resources'] = [Repository.from_dict(r) for r in response_dict['resources']]
|
|
30
|
+
return RepositoryQueryResponse(**response_dict)
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
from typing import Any, Dict, List
|
|
2
|
+
|
|
3
|
+
from ai_core_sdk.models import Label
|
|
4
|
+
from ai_core_sdk.models.resource_group_status import ResourceGroupStatus
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class ResourceGroup:
|
|
8
|
+
"""ResourceGroup represents the resource group.
|
|
9
|
+
|
|
10
|
+
:param resource_group_id: The resource_group_id of this ResourceGroup.
|
|
11
|
+
:type resource_group_id: str
|
|
12
|
+
:param tenant_id: The tenant_id of this ResourceGroup.
|
|
13
|
+
:type tenant_id: str
|
|
14
|
+
:param zone_id: The zone_id of this ResourceGroup.
|
|
15
|
+
:type zone_id: str
|
|
16
|
+
:param labels: The labels of this ResourceGroup.
|
|
17
|
+
:type labels: ResourceGroupLabels
|
|
18
|
+
:param status: The status of this ResourceGroup.
|
|
19
|
+
:type status: str
|
|
20
|
+
:param status_message: The status_message of this ResourceGroup.
|
|
21
|
+
:type status_message: str
|
|
22
|
+
"""
|
|
23
|
+
def __init__(self, resource_group_id: str = None, tenant_id: str = None, zone_id: str = None,
|
|
24
|
+
labels: List[Label] = None, status: ResourceGroupStatus = None, status_message: str = None, **kwargs):
|
|
25
|
+
self.resource_group_id: str = resource_group_id
|
|
26
|
+
self.tenant_id: str = tenant_id
|
|
27
|
+
self.zone_id: str = zone_id
|
|
28
|
+
self.labels: List[Label] = labels
|
|
29
|
+
self.status: ResourceGroupStatus = status
|
|
30
|
+
self.status_message: str = status_message
|
|
31
|
+
|
|
32
|
+
def __str__(self):
|
|
33
|
+
return "Resource group id: " + str(self.resource_group_id)
|
|
34
|
+
|
|
35
|
+
@staticmethod
|
|
36
|
+
def from_dict(resource_group_dict: Dict[str, Any]):
|
|
37
|
+
"""Returns a :class:`ai_core_sdk.models.resource_group.ResourceGroup` object, created
|
|
38
|
+
from the values in the dict provided as parameter
|
|
39
|
+
|
|
40
|
+
:param resource_group_dict: Dict which includes the necessary values to create the object
|
|
41
|
+
:type resource_group_dict: Dict[str, Any]
|
|
42
|
+
:return: An object, created from the values provided
|
|
43
|
+
:rtype: class:`ai_core_sdk.models.resource_group.ResourceGroup`
|
|
44
|
+
"""
|
|
45
|
+
if 'resource_group_status' in resource_group_dict:
|
|
46
|
+
resource_group_dict['resource_group_status'] = \
|
|
47
|
+
ResourceGroupStatus(resource_group_dict['resource_group_status'])
|
|
48
|
+
if 'labels' in resource_group_dict:
|
|
49
|
+
resource_group_dict['labels'] = [Label.from_dict(l) for l in resource_group_dict['labels']]
|
|
50
|
+
return ResourceGroup(**resource_group_dict)
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
from typing import Any, Dict, List
|
|
2
|
+
|
|
3
|
+
from ai_core_sdk.models import QueryResponse
|
|
4
|
+
from ai_core_sdk.models.resource_group import ResourceGroup
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class ResourceGroupQueryResponse(QueryResponse):
|
|
8
|
+
"""The ResourceGroupQueryResponse object defines the response of the resourceGroups query request
|
|
9
|
+
:param resources: List of the resource groups returned from the server
|
|
10
|
+
:type resources: List[class:`ai_core_sdk.models.resource_group.ResourceGroup`]
|
|
11
|
+
:param count: Total number of the queried docker registry secrets
|
|
12
|
+
:type count: int
|
|
13
|
+
:param `**kwargs`: The keyword arguments are there in case there are additional attributes returned from server
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
def __init__(self, resources: List[ResourceGroup], count: int, **kwargs):
|
|
17
|
+
super().__init__(resources=resources, count=count, **kwargs)
|
|
18
|
+
|
|
19
|
+
@staticmethod
|
|
20
|
+
def from_dict(response_dict: Dict[str, Any]):
|
|
21
|
+
"""Returns a
|
|
22
|
+
:class:`ai_core_sdk.models.docker_registry_secret_query_response.DockerRegistrySecretQueryResponse`
|
|
23
|
+
object, created from the values in the dict provided as parameter
|
|
24
|
+
|
|
25
|
+
:param response_dict: Dict which includes the necessary values to create the object
|
|
26
|
+
:type response_dict: Dict[str, Any]
|
|
27
|
+
:return: An object, created from the values provided
|
|
28
|
+
:rtype: class:`ai_core_sdk.models.docker_registry_secret_query_response.DockerRegistrySecretQueryResponse`
|
|
29
|
+
"""
|
|
30
|
+
response_dict['resources'] = [ResourceGroup.from_dict(r) for r in response_dict['resources']]
|
|
31
|
+
return ResourceGroupQueryResponse(**response_dict)
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
from typing import Any, Dict
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class Secret:
|
|
5
|
+
"""The Secret object defines the secret response.
|
|
6
|
+
|
|
7
|
+
:param name: Secret name
|
|
8
|
+
:type name: str
|
|
9
|
+
:param data: Secret data dictionary, defaults to None
|
|
10
|
+
:type data: dict, optional
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
def __init__(self, name: str, data: Dict[str, str] = None, **kwargs):
|
|
14
|
+
self.name: str = name
|
|
15
|
+
self.data: Dict[str, str] = data
|
|
16
|
+
|
|
17
|
+
def __str__(self):
|
|
18
|
+
return "Secret name: " + str(self.name)
|
|
19
|
+
|
|
20
|
+
@staticmethod
|
|
21
|
+
def from_dict(secret_dict: Dict[str, Any]):
|
|
22
|
+
"""Returns a :class:`ai_core_sdk.models.secret.Secret` object, created
|
|
23
|
+
from the values in the dict provided as parameter
|
|
24
|
+
|
|
25
|
+
:param secret_dict: Dict which includes the necessary values to create the object
|
|
26
|
+
:type secret_dict: Dict[str, Any]
|
|
27
|
+
:return: An object, created from the values provided
|
|
28
|
+
:rtype: class:`ai_core_sdk.models.secret.Secret`
|
|
29
|
+
"""
|
|
30
|
+
return Secret(**secret_dict)
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
from typing import Any, Dict, List
|
|
2
|
+
|
|
3
|
+
from ai_core_sdk.models import QueryResponse
|
|
4
|
+
from ai_core_sdk.models.secret import Secret
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class SecretQueryResponse(QueryResponse):
|
|
8
|
+
"""The SecretQueryResponse object defines the response of the secret query request
|
|
9
|
+
:param resources: List of the secrets returned from the server
|
|
10
|
+
:type resources: List[class:`ai_core_sdk.models.secret.Secret`]
|
|
11
|
+
:param count: Total number of the queried secrets
|
|
12
|
+
:type count: int
|
|
13
|
+
:param `**kwargs`: The keyword arguments are there in case there are additional attributes returned from server
|
|
14
|
+
"""
|
|
15
|
+
def __init__(self, resources: List[Secret], count: int, **kwargs):
|
|
16
|
+
super().__init__(resources=resources, count=count, **kwargs)
|
|
17
|
+
|
|
18
|
+
@staticmethod
|
|
19
|
+
def from_dict(response_dict: Dict[str, Any]):
|
|
20
|
+
"""Returns a
|
|
21
|
+
:class:`ai_core_sdk.models.secret_query_response.SecretQueryResponse`
|
|
22
|
+
object, created from the values in the dict provided as parameter
|
|
23
|
+
|
|
24
|
+
:param response_dict: Dict which includes the necessary values to create the object
|
|
25
|
+
:type response_dict: Dict[str, Any]
|
|
26
|
+
:return: An object, created from the values provided
|
|
27
|
+
:rtype: class:`ai_core_sdk.models.secret_query_response.SecretQueryResponse`
|
|
28
|
+
"""
|
|
29
|
+
response_dict['resources'] = [Secret.from_dict(r) for r in response_dict['resources']]
|
|
30
|
+
return SecretQueryResponse(**response_dict)
|