Skip to content

Commit 7e8c103

Browse files
committed
Update to 0.6
1 parent 1d6785f commit 7e8c103

File tree

3 files changed

+39
-14
lines changed

3 files changed

+39
-14
lines changed

api/v1alpha1/openapi.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4212,15 +4212,15 @@ components:
42124212
type: object
42134213
description: Current status of the resources of the device.
42144214
required:
4215-
- CPU
4216-
- Memory
4217-
- Disk
4215+
- cpu
4216+
- memory
4217+
- disk
42184218
properties:
4219-
CPU:
4219+
cpu:
42204220
$ref: "#/components/schemas/DeviceResourceStatusType"
4221-
Memory:
4221+
memory:
42224222
$ref: "#/components/schemas/DeviceResourceStatusType"
4223-
Disk:
4223+
disk:
42244224
$ref: "#/components/schemas/DeviceResourceStatusType"
42254225
DeviceResourceStatusType:
42264226
type: string

flightctl/models/device_resource_status.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import re # noqa: F401
1919
import json
2020

21-
from pydantic import BaseModel, ConfigDict, Field
21+
from pydantic import BaseModel, ConfigDict
2222
from typing import Any, ClassVar, Dict, List
2323
from flightctl.models.device_resource_status_type import DeviceResourceStatusType
2424
from typing import Optional, Set
@@ -28,10 +28,10 @@ class DeviceResourceStatus(BaseModel):
2828
"""
2929
Current status of the resources of the device.
3030
""" # noqa: E501
31-
cpu: DeviceResourceStatusType = Field(alias="CPU")
32-
memory: DeviceResourceStatusType = Field(alias="Memory")
33-
disk: DeviceResourceStatusType = Field(alias="Disk")
34-
__properties: ClassVar[List[str]] = ["CPU", "Memory", "Disk"]
31+
cpu: DeviceResourceStatusType
32+
memory: DeviceResourceStatusType
33+
disk: DeviceResourceStatusType
34+
__properties: ClassVar[List[str]] = ["cpu", "memory", "disk"]
3535

3636
model_config = ConfigDict(
3737
populate_by_name=True,
@@ -84,9 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
8484
return cls.model_validate(obj)
8585

8686
_obj = cls.model_validate({
87-
"CPU": obj.get("CPU"),
88-
"Memory": obj.get("Memory"),
89-
"Disk": obj.get("Disk")
87+
"cpu": obj.get("cpu"),
88+
"memory": obj.get("memory"),
89+
"disk": obj.get("disk")
9090
})
9191
return _obj
9292

test.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import flightctl
2+
from flightctl.models.device import Device
3+
from flightctl.rest import ApiException
4+
from pprint import pprint
5+
6+
# Defining the host is optional and defaults to http://localhost
7+
# See configuration.py for a list of all supported configuration parameters.
8+
configuration = flightctl.Configuration(
9+
host = "https://api.10.0.7.163.nip.io:3443"
10+
)
11+
configuration.verify_ssl = False
12+
13+
14+
# Enter a context with an instance of the API client
15+
with flightctl.ApiClient(configuration) as api_client:
16+
# Create an instance of the API class
17+
api_instance = flightctl.DeviceApi(api_client)
18+
name = 'device-ansible-example' # str | The name of the Device resource to get.
19+
20+
try:
21+
api_response = api_instance.get_device(name)
22+
print("The response of DeviceApi->get_device:\n")
23+
pprint(api_response)
24+
except Exception as e:
25+
print("Exception when calling DeviceApi->get_device: %s\n" % e)

0 commit comments

Comments
 (0)