Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/Pyinstaller-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
zip -r osc-cli-x86_64.zip pkg/osc-cli
./pkg/osc-cli/osc-cli.exe api ReadRegions | grep api.eu-west-2.outscale.com
- name: Upload artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v5
if: ${{ github.event_name != 'push' }}
with:
name: osc-cli-win
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/pull-local-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v5
- uses: pre-commit/action@v3.0.0
- uses: pre-commit/action@v3.0.1
- name: setup fuse
run: |
sudo apt-get update --fix-missing
sudo apt-get install -y -f -o Acquire::Retries=3 libfuse2
sudo apt-get install -y -f -o Acquire::Retries=3 libfuse2 desktop-file-utils
- name: Package bdist
run: make build
- name: Package AppImage
run: |
cd pkg && make osc-cli-x86_64.AppImage
./osc-cli-x86_64.AppImage 2>&1 | grep Usage
- name: Upload artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v5
with:
name: osc-cli
path: |
Expand All @@ -40,7 +40,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: pre-commit/action@v2.0.3
- uses: pre-commit/action@v3.0.1
- name: Set up Python
uses: actions/setup-python@v2
with:
Expand Down
23 changes: 4 additions & 19 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v5
- uses: pre-commit/action@v3.0.0
- uses: pre-commit/action@v3.0.1
- name: setup fuse
run: |
sudo apt-get update --fix-missing
sudo apt-get install -y -f -o Acquire::Retries=3 libfuse2
sudo apt-get install -y -f -o Acquire::Retries=5 libfuse2 desktop-file-utils
- name: Package bdist
run: make build
- name: Package AppImage
Expand All @@ -28,7 +28,7 @@ jobs:
cd pkg && make ./configure --py3_ver=11 --arch_old=2014 && make osc-cli-x86_64.AppImage
./osc-cli-x86_64.AppImage 2>&1 | grep Usage
- name: Upload artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v5
with:
name: osc-cli
path: |
Expand All @@ -43,7 +43,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: pre-commit/action@v2.0.3
- uses: pre-commit/action@v3.0.1
- name: Set up Python
uses: actions/setup-python@v2
with:
Expand Down Expand Up @@ -75,18 +75,3 @@ jobs:
OSC_TEST_REGION: ${{ secrets.OSC_TEST_REGION }}
- name: Test python package building
run: make build
dependabot-auto-merge:
needs: [tests-packaging, tests-app]
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1.1.1
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Auto-merge
run: gh pr merge --auto --rebase "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v6.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

Official command-line interface for the OUTSCALE API.

> **Maintenance mode**: bug fixes only; no new features.
> **Maintenance mode**: bug fixes only; no new features.
> Looking for new features and an improved UX? See **[oapi-cli](https://github.com/outscale/oapi-cli)**.

## Quick start
Expand Down Expand Up @@ -74,4 +74,4 @@ See [CONTRIBUTING.md](CONTRIBUTING.md).

## License

BSD-3-Clause. See [LICENSE](LICENSE).
BSD-3-Clause. See [LICENSE](LICENSE).
6 changes: 3 additions & 3 deletions docs/faq.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# FAQ

**Is osc-cli still maintained?**
**Is osc-cli still maintained?**
Yes, in maintenance mode (bug fixes only). Prefer `oapi-cli` for new features.

**Where is the configuration file?**
**Where is the configuration file?**
`~/.osc/config.json`

**How do I list available services/actions?**
**How do I list available services/actions?**
Consult the OUTSCALE API documentation and service references at https://docs.outscale.com/en/
2 changes: 1 addition & 1 deletion docs/install/windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,4 @@ This guide explains how to install and configure `osc-cli` on a Windows system.
osc-cli api ReadVolumes
```

If everything is correctly configured, you should see a JSON response from the Outscale API.
If everything is correctly configured, you should see a JSON response from the Outscale API.
27 changes: 12 additions & 15 deletions osc_sdk/sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import fire
import requests
import xmltodict
from requests.models import Request, Response
from requests.models import Response
from typing_extensions import TypedDict

CANONICAL_URI = "/"
Expand Down Expand Up @@ -141,8 +141,8 @@ def __str__(self) -> str:
return (
f"Error --> status = {self.status_code}, "
f"code = {self.error_code}, "
f'{"code_type = " if self.code_type is not None else ""}'
f'{self.code_type + ", " if self.code_type is not None else ""}'
f"{'code_type = ' if self.code_type is not None else ''}"
f"{self.code_type + ', ' if self.code_type is not None else ''}"
f"Reason = {self.message}, "
f"request_id = {self.request_id}"
)
Expand Down Expand Up @@ -389,7 +389,7 @@ def make_request(self, call: str, **kwargs: CallParameters):
"content-type": self.CONTENT_TYPE,
"host": self.host,
"x-amz-date": self.date,
"x-amz-target": f'{self.API_NAME}_{datetime.date.today().strftime("%Y%m%d")}.{call}',
"x-amz-target": f"{self.API_NAME}_{datetime.date.today().strftime('%Y%m%d')}.{call}",
}

payload_hash = hashlib.sha256(
Expand Down Expand Up @@ -521,7 +521,7 @@ def build_headers(self, target: str, json_parameters: str) -> Headers:

signed_headers = "host;x-amz-date;x-amz-target"
canonical_headers = (
f"host:{self.host}\n" f"x-amz-date:{self.date}\n" f"x-amz-target:{target}\n"
f"host:{self.host}\nx-amz-date:{self.date}\nx-amz-target:{target}\n"
)
headers = {
"content-type": self.CONTENT_TYPE,
Expand Down Expand Up @@ -607,7 +607,7 @@ def get_parameters(
# Specific to ICU
if (
self.authentication_method == "accesskey"
or self.authentication_method == None
or self.authentication_method is None
):
data.update({"AuthenticationMethod": "accesskey"})

Expand Down Expand Up @@ -702,7 +702,7 @@ def build_headers(self, target: str, _) -> Headers:

signed_headers = "host;x-osc-date;x-osc-target"
canonical_headers = (
f"host:{self.host}\n" f"x-osc-date:{self.date}\n" f"x-osc-target:{target}\n"
f"host:{self.host}\nx-osc-date:{self.date}\nx-osc-target:{target}\n"
)
headers = {
"Content-Type": self.CONTENT_TYPE,
Expand Down Expand Up @@ -733,15 +733,14 @@ def get_conf(profile: str) -> Configuration:
for v in json_profiles:
json_profile = json_profiles[v]
if "region" in json_profile:

# use default stuffs only when "region" is use
# to keep region_name format retrocompatible
if not "host" in json_profile and not "endpoint" in json_profile:
if "host" not in json_profile and "endpoint" not in json_profile:
json_profile["host"] = DEFAULT_HOST
if not "https" in json_profile:
if "https" not in json_profile:
json_profile["https"] = True

if not "region_name" in json_profile:
if "region_name" not in json_profile:
json_profile["region_name"] = json_profile["region"]
del json_profile["region"]
conf = cast(Mapping[str, Configuration], json_profiles)
Expand All @@ -768,7 +767,6 @@ def api_connect(
config_path: Optional[str] = None,
**kwargs: CallParameters,
):

calls = {
"api": OSCCall,
"directlink": DirectLinkCall,
Expand Down Expand Up @@ -811,10 +809,9 @@ def main():
global PASSWORD_ARG
PASSWORD_ARG = argv[i + 1]
elif a == "--bash_completion":
f = open(BASH_COMPLETION_PATH, "r")
print(f.read())
with open(BASH_COMPLETION_PATH, "r") as f:
print(f.read())
sys.exit()
return 0
elif a == "--version":
print(SDK_VERSION)
return 0
Expand Down
2 changes: 1 addition & 1 deletion pkg/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ osc-cli.AppDir/done: $(PY_TARGET)


appimagetool-x86_64.AppImage:
wget https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-x86_64.AppImage
wget https://github.com/AppImage/appimagetool/releases/download/1.9.0/appimagetool-x86_64.AppImage
chmod +x appimagetool-x86_64.AppImage

osc-cli-x86_64.AppImage: osc-cli.AppDir/done appimagetool-x86_64.AppImage
Expand Down
44 changes: 32 additions & 12 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,33 @@
bandit==1.7.1
dataclasses==0.8; python_version < "3.7"
astroid==4.0.2
bandit==1.9.2
certifi==2025.11.12
charset-normalizer==3.4.4
defusedxml==0.7.1
fire==0.4.0
mypy==0.942
mypy-extensions==0.4.3
pylint==2.13.0
pytest==7.0.1
requests==2.31.0
types-dataclasses==0.6.4
types-requests==2.27.14
typing_extensions==4.1.1
xmltodict==0.12.0
dill==0.4.0
fire==0.7.1
idna==3.11
iniconfig==2.3.0
isort==7.0.0
markdown-it-py==4.0.0
mccabe==0.7.0
mdurl==0.1.2
mypy==1.18.2
mypy-extensions==1.1.0
packaging==25.0
pathspec==0.12.1
platformdirs==4.5.0
pluggy==1.6.0
pygments==2.19.2
pylint==4.0.3
pytest==9.0.1
pyyaml==6.0.3
requests==2.32.5
rich==14.2.0
setuptools==80.9.0
stevedore==5.6.0
termcolor==3.2.0
tomlkit==0.13.3
types-requests==2.32.4.20250913
typing-extensions==4.15.0
urllib3==2.5.0
xmltodict==1.0.2
13 changes: 12 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
import os

from setuptools import find_packages, setup


def get_long_description():
root_path = os.path.dirname(os.path.abspath(__file__))
with open(os.path.join(root_path, "README.md"), "r", encoding="utf-8") as fd:
return fd.read()


setup(
name="osc-sdk",
version="1.11.0",
packages=find_packages(),
author="Outscale SAS",
author_email="contact@outscale.com",
description="Outscale API SDK and CLI",
long_description=open("README.md").read(),
long_description=get_long_description(),
long_description_content_type="text/markdown",
include_package_data=True,
license="BSD",
Expand All @@ -20,6 +29,8 @@
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Operating System :: OS Independent",
],
url="https://github.com/outscale/osc-cli",
Expand Down
Loading