Skip to content

Commit

Permalink
liblab SDK update for version v0.9.0-alpha.4
Browse files Browse the repository at this point in the history
  • Loading branch information
seniorquico committed Oct 5, 2024
1 parent 2e13c20 commit 2b3c6b1
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 25 deletions.
25 changes: 13 additions & 12 deletions .manifest.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"liblabVersion": "2.4.0",
"date": "2024-09-17T04:36:05.362Z",
"liblabVersion": "2.5.1",
"date": "2024-10-05T04:00:40.746Z",
"config": {
"apiId": 1126,
"sdkName": "salad-cloud-imds-sdk",
"sdkVersion": "0.9.0-alpha.3",
"sdkVersion": "0.9.0-alpha.4",
"liblabVersion": "2",
"deliveryMethods": ["zip"],
"languages": ["python"],
Expand Down Expand Up @@ -33,7 +33,7 @@
"githubRepoName": "salad-cloud-imds-sdk-go",
"ignoreFiles": [".gitignore", "./LICENSE"],
"liblabVersion": "2",
"sdkVersion": "0.9.0-alpha.3",
"sdkVersion": "0.9.0-alpha.4",
"targetBranch": "main"
},
"java": {
Expand All @@ -57,11 +57,11 @@
"homepage": "https://github.com/saladtechnologies/salad-cloud-imds-sdk-java",
"ignoreFiles": [".gitignore", "./LICENSE"],
"liblabVersion": "2",
"sdkVersion": "0.9.0-alpha.3",
"sdkVersion": "0.9.0-alpha.4",
"targetBranch": "main"
},
"python": {
"alwaysInitializeOptionals": true,
"alwaysInitializeOptionals": false,
"classifiers": [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
Expand Down Expand Up @@ -100,7 +100,7 @@
"githubRepoName": "salad-cloud-imds-sdk-python",
"ignoreFiles": [".gitignore", "./LICENSE"],
"liblabVersion": "2",
"sdkVersion": "0.9.0-alpha.3",
"sdkVersion": "0.9.0-alpha.4",
"targetBranch": "main"
},
"typescript": {
Expand All @@ -123,8 +123,9 @@
"homepage": "https://github.com/saladtechnologies/salad-cloud-imds-sdk-javascript",
"ignoreFiles": [".gitignore", "./LICENSE"],
"liblabVersion": "2",
"sdkVersion": "0.9.0-alpha.3",
"targetBranch": "main"
"sdkVersion": "0.9.0-alpha.4",
"targetBranch": "main",
"generateEnumAs": "enum"
}
},
"publishing": {
Expand Down Expand Up @@ -155,11 +156,11 @@
},
"multiTenant": true,
"hooksLocation": {
"bucketKey": "7207/hooks.zip",
"bucketKey": "7538/hooks.zip",
"bucketName": "prod-liblab-api-stack-hooks"
},
"includeWatermark": false,
"alwaysInitializeOptionals": true,
"alwaysInitializeOptionals": false,
"classifiers": [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
Expand Down Expand Up @@ -211,7 +212,7 @@
"httpLibrary": {
"name": "axios",
"packages": {
"axios": "^1.7.4"
"axios": "^1.7.7"
},
"languages": ["typescript"]
},
Expand Down
4 changes: 2 additions & 2 deletions PyPI_README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# SaladCloudImdsSdk Python SDK 0.9.0-alpha.3<a id="saladcloudimdssdk-python-sdk-090-alpha3"></a>
# SaladCloudImdsSdk Python SDK 0.9.0-alpha.4<a id="saladcloudimdssdk-python-sdk-090-alpha4"></a>

Welcome to the SaladCloudImdsSdk SDK documentation. This guide will help you get started with integrating and using the SaladCloudImdsSdk SDK in your project.

## Versions<a id="versions"></a>

- API version: `0.9.0-alpha.1`
- SDK version: `0.9.0-alpha.3`
- SDK version: `0.9.0-alpha.4`

## About the API<a id="about-the-api"></a>

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# SaladCloudImdsSdk Python SDK 0.9.0-alpha.3
# SaladCloudImdsSdk Python SDK 0.9.0-alpha.4

Welcome to the SaladCloudImdsSdk SDK documentation. This guide will help you get started with integrating and using the SaladCloudImdsSdk SDK in your project.

## Versions

- API version: `0.9.0-alpha.1`
- SDK version: `0.9.0-alpha.3`
- SDK version: `0.9.0-alpha.4`

## About the API

Expand Down
2 changes: 1 addition & 1 deletion examples/install.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ python -m venv .venv
call .venv\Scripts\activate
pip install build
python -m build --outdir dist ..\
pip install dist\salad_cloud_imds_sdk-0.9.0-alpha.3-py3-none-any.whl --force-reinstall
pip install dist\salad_cloud_imds_sdk-0.9.0-alpha.4-py3-none-any.whl --force-reinstall
2 changes: 1 addition & 1 deletion examples/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ python -m venv .venv
. .venv/bin/activate
pip install build
python -m build --outdir dist ../
pip install dist/salad_cloud_imds_sdk-0.9.0-alpha.3-py3-none-any.whl --force-reinstall
pip install dist/salad_cloud_imds_sdk-0.9.0-alpha.4-py3-none-any.whl --force-reinstall
2 changes: 1 addition & 1 deletion install.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ if "%USE_VENV%"=="1" (

pip install build
python -m build --outdir dist .
pip install dist\salad_cloud_imds_sdk-0.9.0-alpha.3-py3-none-any.whl --force-reinstall
pip install dist\salad_cloud_imds_sdk-0.9.0-alpha.4-py3-none-any.whl --force-reinstall

if "%USE_VENV%"=="1" (
deactivate
Expand Down
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ fi

pip install build
python -m build --outdir dist .
pip install dist/salad_cloud_imds_sdk-0.9.0-alpha.3-py3-none-any.whl --force-reinstall
pip install dist/salad_cloud_imds_sdk-0.9.0-alpha.4-py3-none-any.whl --force-reinstall

if [ "$USE_VENV" -eq 1 ]; then
deactivate
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "salad-cloud-imds-sdk"
version = "0.9.0-alpha.3"
version = "0.9.0-alpha.4"
license = { text = "MIT" }
description = """The SaladCloud Instance Metadata Service (IMDS). Please refer to the [SaladCloud API Documentation](https://docs.salad.com/api-reference) for more details."""
readme = "PyPI_README.md"
Expand Down
23 changes: 19 additions & 4 deletions src/salad_cloud_imds_sdk/sdk.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,36 @@
from typing import Union
from .services.metadata import MetadataService
from .net.environment import Environment


class SaladCloudImdsSdk:
def __init__(self, base_url: str = Environment.DEFAULT.value, timeout: int = 60000):
def __init__(
self,
base_url: Union[Environment, str] = Environment.DEFAULT,
timeout: int = 60000,
):
"""
Initializes SaladCloudImdsSdk the SDK class.
"""

self.metadata = MetadataService(base_url=base_url)
self._base_url = (
base_url.value if isinstance(base_url, Environment) else base_url
)
self.metadata = MetadataService(base_url=self._base_url)
self.set_timeout(timeout)

def set_base_url(self, base_url):
def set_base_url(self, base_url: Union[Environment, str]):
"""
Sets the base URL for the entire SDK.
:param Union[Environment, str] base_url: The base URL to be set.
:return: The SDK instance.
"""
self.metadata.set_base_url(base_url)
self._base_url = (
base_url.value if isinstance(base_url, Environment) else base_url
)

self.metadata.set_base_url(self._base_url)

return self

Expand Down

0 comments on commit 2b3c6b1

Please sign in to comment.