Skip to content

Commit cb724ae

Browse files
committed
http: api: allow overriding auth by service
1 parent c9eae42 commit cb724ae

25 files changed

Lines changed: 40 additions & 44 deletions

src/enapter/cli/http/api/blueprint_download_command.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def register(parent: cli.Subparsers) -> None:
2929
@staticmethod
3030
async def run(args: argparse.Namespace) -> None:
3131
async with http.api.Client(http.api.Config.from_env()) as client:
32-
content = await client.blueprints.download(
32+
content = await client.blueprints().download(
3333
args.id, view=http.api.blueprints.BlueprintView(args.view.upper())
3434
)
3535
with open(args.output, "wb") as f:

src/enapter/cli/http/api/blueprint_get_command.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ def register(parent: cli.Subparsers) -> None:
1919
@staticmethod
2020
async def run(args: argparse.Namespace) -> None:
2121
async with http.api.Client(http.api.Config.from_env()) as client:
22-
blueprint = await client.blueprints.get(blueprint_id=args.id)
22+
blueprint = await client.blueprints().get(blueprint_id=args.id)
2323
print(json.dumps(blueprint.to_dto()))

src/enapter/cli/http/api/blueprint_upload_command.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def register(parent: cli.Subparsers) -> None:
2323
async def run(args: argparse.Namespace) -> None:
2424
async with http.api.Client(http.api.Config.from_env()) as client:
2525
if args.path.is_dir():
26-
blueprint = await client.blueprints.upload_directory(args.path)
26+
blueprint = await client.blueprints().upload_directory(args.path)
2727
else:
28-
blueprint = await client.blueprints.upload_file(args.path)
28+
blueprint = await client.blueprints().upload_file(args.path)
2929
print(json.dumps(blueprint.to_dto()))

src/enapter/cli/http/api/blueprint_validate_command.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ def register(parent: cli.Subparsers) -> None:
2222
async def run(args: argparse.Namespace) -> None:
2323
async with http.api.Client(http.api.Config.from_env()) as client:
2424
if args.path.is_dir():
25-
await client.blueprints.validate_directory(args.path)
25+
await client.blueprints().validate_directory(args.path)
2626
else:
27-
await client.blueprints.validate_file(args.path)
27+
await client.blueprints().validate_file(args.path)

src/enapter/cli/http/api/command_create_execution_command.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def register(parent: cli.Subparsers) -> None:
3333
@staticmethod
3434
async def run(args: argparse.Namespace) -> None:
3535
async with http.api.Client(http.api.Config.from_env()) as client:
36-
execution = await client.commands.create_execution(
36+
execution = await client.commands().create_execution(
3737
device_id=args.device_id, name=args.name, arguments=args.arguments
3838
)
3939
print(json.dumps(execution.to_dto()))

src/enapter/cli/http/api/command_execute_command.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def register(parent: cli.Subparsers) -> None:
3939
@staticmethod
4040
async def run(args: argparse.Namespace) -> None:
4141
async with http.api.Client(http.api.Config.from_env()) as client:
42-
execution = await client.commands.execute(
42+
execution = await client.commands().execute(
4343
device_id=args.device_id,
4444
name=args.name,
4545
arguments=args.arguments,

src/enapter/cli/http/api/command_get_execution_command.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def register(parent: cli.Subparsers) -> None:
3333
@staticmethod
3434
async def run(args: argparse.Namespace) -> None:
3535
async with http.api.Client(http.api.Config.from_env()) as client:
36-
execution = await client.commands.get_execution(
36+
execution = await client.commands().get_execution(
3737
device_id=args.device_id,
3838
execution_id=args.execution_id,
3939
expand_log=args.log,

src/enapter/cli/http/api/command_list_executions_command.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ async def run(args: argparse.Namespace) -> None:
3737
if args.limit == 0:
3838
return
3939
async with http.api.Client(http.api.Config.from_env()) as client:
40-
async with client.commands.list_executions(
40+
async with client.commands().list_executions(
4141
device_id=args.device_id,
4242
order=http.api.commands.ListExecutionsOrder(args.order.upper()),
4343
) as stream:

src/enapter/cli/http/api/device_assign_blueprint_command.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def register(parent: cli.Subparsers) -> None:
2222
@staticmethod
2323
async def run(args: argparse.Namespace) -> None:
2424
async with http.api.Client(http.api.Config.from_env()) as client:
25-
device = await client.devices.assign_blueprint(
25+
device = await client.devices().assign_blueprint(
2626
device_id=args.id, blueprint_id=args.blueprint_id
2727
)
2828
print(json.dumps(device.to_dto()))

src/enapter/cli/http/api/device_create_lua_command.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def register(parent: cli.Subparsers) -> None:
2323
@staticmethod
2424
async def run(args: argparse.Namespace) -> None:
2525
async with http.api.Client(http.api.Config.from_env()) as client:
26-
device = await client.devices.create_lua(
26+
device = await client.devices().create_lua(
2727
runtime_id=args.runtime_id,
2828
blueprint_id=args.blueprint_id,
2929
name=args.name,

0 commit comments

Comments
 (0)