Skip to content

Latest commit

 

History

History
896 lines (616 loc) · 27.2 KB

File metadata and controls

896 lines (616 loc) · 27.2 KB

flightctl.DeviceApi

All URIs are relative to http://localhost

Method HTTP request Description
create_device POST /api/v1/devices
decommission_device PUT /api/v1/devices/{name}/decommission
delete_device DELETE /api/v1/devices/{name}
get_device GET /api/v1/devices/{name}
get_device_last_seen GET /api/v1/devices/{name}/lastseen
get_device_status GET /api/v1/devices/{name}/status
get_rendered_device GET /api/v1/devices/{name}/rendered
list_devices GET /api/v1/devices
patch_device PATCH /api/v1/devices/{name}
patch_device_status PATCH /api/v1/devices/{name}/status
replace_device PUT /api/v1/devices/{name}
replace_device_status PUT /api/v1/devices/{name}/status

create_device

Device create_device(device)

Create a Device resource.

Example

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 = "http://localhost"
)


# 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)
    device = flightctl.Device() # Device | 

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

Parameters

Name Type Description Notes
device Device

Return type

Device

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
201 Created -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
409 Conflict -
429 Too Many Requests -
503 Service Unavailable -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

decommission_device

Device decommission_device(name, device_decommission)

schedule the device to decommission

Example

import flightctl
from flightctl.models.device import Device
from flightctl.models.device_decommission import DeviceDecommission
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 = "http://localhost"
)


# 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 = 'name_example' # str | The name of the Device resource to decommission.
    device_decommission = flightctl.DeviceDecommission() # DeviceDecommission | 

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

Parameters

Name Type Description Notes
name str The name of the Device resource to decommission.
device_decommission DeviceDecommission

Return type

Device

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too Many Requests -
503 Service Unavailable -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

delete_device

Status delete_device(name)

Delete a Device resource.

Example

import flightctl
from flightctl.models.status import Status
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 = "http://localhost"
)


# 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 = 'name_example' # str | The name of the Device resource to delete.

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

Parameters

Name Type Description Notes
name str The name of the Device resource to delete.

Return type

Status

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too Many Requests -
503 Service Unavailable -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_device

Device get_device(name)

Get a Device resource.

Example

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 = "http://localhost"
)


# 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 = 'name_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)

Parameters

Name Type Description Notes
name str The name of the Device resource to get.

Return type

Device

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too Many Requests -
503 Service Unavailable -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_device_last_seen

DeviceLastSeen get_device_last_seen(name)

Get the last seen timestamp of the Device resource.

Example

import flightctl
from flightctl.models.device_last_seen import DeviceLastSeen
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 = "http://localhost"
)


# 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 = 'name_example' # str | The name of the Device resource to get the last seen timestamp for.

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

Parameters

Name Type Description Notes
name str The name of the Device resource to get the last seen timestamp for.

Return type

DeviceLastSeen

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
204 No Content -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too Many Requests -
503 Service Unavailable -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_device_status

Device get_device_status(name)

Get the status of a Device resource.

Example

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 = "http://localhost"
)


# 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 = 'name_example' # str | The name of the Device resource to get.

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

Parameters

Name Type Description Notes
name str The name of the Device resource to get.

Return type

Device

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too Many Requests -
503 Service Unavailable -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_rendered_device

Device get_rendered_device(name, known_rendered_version=known_rendered_version)

Get the rendered device.

Example

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 = "http://localhost"
)


# 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 = 'name_example' # str | The name of the Device resource to get the rendered device specification for.
    known_rendered_version = 'known_rendered_version_example' # str | The last known renderedVersion. (optional)

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

Parameters

Name Type Description Notes
name str The name of the Device resource to get the rendered device specification for.
known_rendered_version str The last known renderedVersion. [optional]

Return type

Device

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
204 No Content -
401 Unauthorized -
403 Forbidden -
404 Not Found -
409 Conflict -
429 Too Many Requests -
503 Service Unavailable -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

list_devices

DeviceList list_devices(var_continue=var_continue, label_selector=label_selector, field_selector=field_selector, limit=limit, summary_only=summary_only)

List Device resources.

Example

import flightctl
from flightctl.models.device_list import DeviceList
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 = "http://localhost"
)


# 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)
    var_continue = 'var_continue_example' # str | An optional parameter to query more results from the server. The value of the paramter must match the value of the 'continue' field in the previous list response. (optional)
    label_selector = 'label_selector_example' # str | A selector to restrict the list of returned objects by their labels. Defaults to everything. (optional)
    field_selector = 'field_selector_example' # str | A selector to restrict the list of returned objects by their fields, supporting operators like '=', '==', and '!=' (e.g., \"key1=value1,key2!=value2\"). (optional)
    limit = 56 # int | The maximum number of results returned in the list response. The server will set the 'continue' field in the list response if more results exist. The continue value may then be specified as parameter in a subsequent query. (optional)
    summary_only = True # bool | A boolean flag to include only a summary of the devices. When set to true, the response will contain only the summary information. Only the 'owner' and 'labelSelector' parameters are supported when 'summaryOnly' is true. (optional)

    try:
        api_response = api_instance.list_devices(var_continue=var_continue, label_selector=label_selector, field_selector=field_selector, limit=limit, summary_only=summary_only)
        print("The response of DeviceApi->list_devices:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling DeviceApi->list_devices: %s\n" % e)

Parameters

Name Type Description Notes
var_continue str An optional parameter to query more results from the server. The value of the paramter must match the value of the 'continue' field in the previous list response. [optional]
label_selector str A selector to restrict the list of returned objects by their labels. Defaults to everything. [optional]
field_selector str A selector to restrict the list of returned objects by their fields, supporting operators like '=', '==', and '!=' (e.g., "key1=value1,key2!=value2"). [optional]
limit int The maximum number of results returned in the list response. The server will set the 'continue' field in the list response if more results exist. The continue value may then be specified as parameter in a subsequent query. [optional]
summary_only bool A boolean flag to include only a summary of the devices. When set to true, the response will contain only the summary information. Only the 'owner' and 'labelSelector' parameters are supported when 'summaryOnly' is true. [optional]

Return type

DeviceList

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
429 Too Many Requests -
503 Service Unavailable -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

patch_device

Device patch_device(name, patch_request_inner)

Patch a Device resource.

Example

import flightctl
from flightctl.models.device import Device
from flightctl.models.patch_request_inner import PatchRequestInner
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 = "http://localhost"
)


# 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 = 'name_example' # str | The name of the Device resource to patch.
    patch_request_inner = [flightctl.PatchRequestInner()] # List[PatchRequestInner] | 

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

Parameters

Name Type Description Notes
name str The name of the Device resource to patch.
patch_request_inner List[PatchRequestInner]

Return type

Device

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json-patch+json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
409 Conflict -
429 Too Many Requests -
503 Service Unavailable -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

patch_device_status

Device patch_device_status(name, patch_request_inner)

Patch the status of a Device resource.

Example

import flightctl
from flightctl.models.device import Device
from flightctl.models.patch_request_inner import PatchRequestInner
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 = "http://localhost"
)


# 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 = 'name_example' # str | The name of the Device resource to patch.
    patch_request_inner = [flightctl.PatchRequestInner()] # List[PatchRequestInner] | 

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

Parameters

Name Type Description Notes
name str The name of the Device resource to patch.
patch_request_inner List[PatchRequestInner]

Return type

Device

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json-patch+json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too Many Requests -
503 Service Unavailable -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

replace_device

Device replace_device(name, device)

Update a Device resource.

Example

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 = "http://localhost"
)


# 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 = 'name_example' # str | The name of the Device resource to update.
    device = flightctl.Device() # Device | 

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

Parameters

Name Type Description Notes
name str The name of the Device resource to update.
device Device

Return type

Device

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
201 Created -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
409 Conflict -
429 Too Many Requests -
503 Service Unavailable -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

replace_device_status

Device replace_device_status(name, device)

Update the status of a Device resource.

Example

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 = "http://localhost"
)


# 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 = 'name_example' # str | The name of the Device resource to update.
    device = flightctl.Device() # Device | 

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

Parameters

Name Type Description Notes
name str The name of the Device resource to update.
device Device

Return type

Device

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
409 Conflict -
429 Too Many Requests -
503 Service Unavailable -

[Back to top] [Back to API list] [Back to Model list] [Back to README]