Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
12 changes: 6 additions & 6 deletions api/v1alpha1/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4212,15 +4212,15 @@ components:
type: object
description: Current status of the resources of the device.
required:
- CPU
- Memory
- Disk
- cpu
- memory
- disk
properties:
CPU:
cpu:
$ref: "#/components/schemas/DeviceResourceStatusType"
Memory:
memory:
$ref: "#/components/schemas/DeviceResourceStatusType"
Disk:
disk:
$ref: "#/components/schemas/DeviceResourceStatusType"
DeviceResourceStatusType:
type: string
Expand Down
16 changes: 8 additions & 8 deletions flightctl/models/device_resource_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import re # noqa: F401
import json

from pydantic import BaseModel, ConfigDict, Field
from pydantic import BaseModel, ConfigDict
from typing import Any, ClassVar, Dict, List
from flightctl.models.device_resource_status_type import DeviceResourceStatusType
from typing import Optional, Set
Expand All @@ -28,10 +28,10 @@ class DeviceResourceStatus(BaseModel):
"""
Current status of the resources of the device.
""" # noqa: E501
cpu: DeviceResourceStatusType = Field(alias="CPU")
memory: DeviceResourceStatusType = Field(alias="Memory")
disk: DeviceResourceStatusType = Field(alias="Disk")
__properties: ClassVar[List[str]] = ["CPU", "Memory", "Disk"]
cpu: DeviceResourceStatusType
memory: DeviceResourceStatusType
disk: DeviceResourceStatusType
__properties: ClassVar[List[str]] = ["cpu", "memory", "disk"]

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

_obj = cls.model_validate({
"CPU": obj.get("CPU"),
"Memory": obj.get("Memory"),
"Disk": obj.get("Disk")
"cpu": obj.get("cpu"),
"memory": obj.get("memory"),
"disk": obj.get("disk")
})
return _obj

Expand Down
25 changes: 25 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import flightctl
from flightctl.models.device import Device
from flightctl.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = flightctl.Configuration(
host = "https://api.10.0.7.163.nip.io:3443"
)
configuration.verify_ssl = False


# Enter a context with an instance of the API client
with flightctl.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = flightctl.DeviceApi(api_client)
name = 'device-ansible-example' # str | The name of the Device resource to get.

try:
api_response = api_instance.get_device(name)
print("The response of DeviceApi->get_device:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DeviceApi->get_device: %s\n" % e)