diff --git a/.gitignore b/.gitignore index 9e274a9..65b06b9 100644 --- a/.gitignore +++ b/.gitignore @@ -64,6 +64,3 @@ target/ # Ipython Notebook .ipynb_checkpoints - -# Build artifacts -api/bundled/ diff --git a/Makefile b/Makefile index 13b6269..7de0280 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -VERSION = 1.2.1 +VERSION = 1.3.0 GENERATOR_VERSION = 7.17.0 COMMON_PROPS = packageName=flightctl,useOneOfDiscriminatorLookup=true,packageVersion=$(VERSION) GIT_USER = flightctl diff --git a/README.md b/README.md index 771cc9a..0afdf62 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: v1beta1 -- Package version: 1.2.1 +- Package version: 1.3.0 - Generator version: 7.17.0 - Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit [https://flightctl.io](https://flightctl.io) @@ -107,6 +107,8 @@ Class | Method | HTTP request | Description *DeviceApi* | [**decommission_device**](docs/DeviceApi.md#decommission_device) | **PUT** /devices/{name}/decommission | *DeviceApi* | [**delete_device**](docs/DeviceApi.md#delete_device) | **DELETE** /devices/{name} | *DeviceApi* | [**get_device**](docs/DeviceApi.md#get_device) | **GET** /devices/{name} | +*DeviceApi* | [**get_device_application_console**](docs/DeviceApi.md#get_device_application_console) | **GET** /ws/v1/devices/{name}/applications/{appname}/console | +*DeviceApi* | [**get_device_console**](docs/DeviceApi.md#get_device_console) | **GET** /ws/v1/devices/{name}/console | *DeviceApi* | [**get_device_last_seen**](docs/DeviceApi.md#get_device_last_seen) | **GET** /devices/{name}/lastseen | *DeviceApi* | [**get_device_status**](docs/DeviceApi.md#get_device_status) | **GET** /devices/{name}/status | *DeviceApi* | [**get_rendered_device**](docs/DeviceApi.md#get_rendered_device) | **GET** /devices/{name}/rendered | @@ -115,6 +117,9 @@ Class | Method | HTTP request | Description *DeviceApi* | [**patch_device_status**](docs/DeviceApi.md#patch_device_status) | **PATCH** /devices/{name}/status | *DeviceApi* | [**replace_device**](docs/DeviceApi.md#replace_device) | **PUT** /devices/{name} | *DeviceApi* | [**replace_device_status**](docs/DeviceApi.md#replace_device_status) | **PUT** /devices/{name}/status | +*DeviceApi* | [**restart_device_application**](docs/DeviceApi.md#restart_device_application) | **POST** /devices/{name}/applications/{appname}/actions/restart | +*DeviceApi* | [**start_device_application**](docs/DeviceApi.md#start_device_application) | **POST** /devices/{name}/applications/{appname}/actions/start | +*DeviceApi* | [**stop_device_application**](docs/DeviceApi.md#stop_device_application) | **POST** /devices/{name}/applications/{appname}/actions/stop | *DeviceactionsApi* | [**resume_devices**](docs/DeviceactionsApi.md#resume_devices) | **POST** /deviceactions/resume | *EnrollmentrequestApi* | [**approve_enrollment_request**](docs/EnrollmentrequestApi.md#approve_enrollment_request) | **PUT** /enrollmentrequests/{name}/approval | *EnrollmentrequestApi* | [**create_enrollment_request**](docs/EnrollmentrequestApi.md#create_enrollment_request) | **POST** /enrollmentrequests | @@ -140,6 +145,8 @@ Class | Method | HTTP request | Description *FleetApi* | [**patch_fleet_status**](docs/FleetApi.md#patch_fleet_status) | **PATCH** /fleets/{name}/status | *FleetApi* | [**replace_fleet**](docs/FleetApi.md#replace_fleet) | **PUT** /fleets/{name} | *FleetApi* | [**replace_fleet_status**](docs/FleetApi.md#replace_fleet_status) | **PUT** /fleets/{name}/status | +*FleetApi* | [**start_fleet_application**](docs/FleetApi.md#start_fleet_application) | **POST** /fleets/{name}/applications/{appname}/actions/start | +*FleetApi* | [**stop_fleet_application**](docs/FleetApi.md#stop_fleet_application) | **POST** /fleets/{name}/applications/{appname}/actions/stop | *LabelApi* | [**list_labels**](docs/LabelApi.md#list_labels) | **GET** /labels | *OrganizationApi* | [**list_organizations**](docs/OrganizationApi.md#list_organizations) | **GET** /organizations | List organizations *RepositoryApi* | [**check_repository_oci_image**](docs/RepositoryApi.md#check_repository_oci_image) | **POST** /repositories/{name}/check-oci-image | @@ -166,7 +173,9 @@ Class | Method | HTTP request | Description - [ApiVersion](docs/ApiVersion.md) - [AppType](docs/AppType.md) - [ApplicationContent](docs/ApplicationContent.md) + - [ApplicationDesiredState](docs/ApplicationDesiredState.md) - [ApplicationEnvVars](docs/ApplicationEnvVars.md) + - [ApplicationLifecycleChangedDetails](docs/ApplicationLifecycleChangedDetails.md) - [ApplicationProviderBase](docs/ApplicationProviderBase.md) - [ApplicationProviderSpec](docs/ApplicationProviderSpec.md) - [ApplicationResourceLimits](docs/ApplicationResourceLimits.md) @@ -193,6 +202,8 @@ Class | Method | HTTP request | Description - [Batch](docs/Batch.md) - [BatchLimit](docs/BatchLimit.md) - [BatchSequence](docs/BatchSequence.md) + - [CatalogItemRefApplicationProviderSpec](docs/CatalogItemRefApplicationProviderSpec.md) + - [CatalogItemRefSpec](docs/CatalogItemRefSpec.md) - [CertificateSigningRequest](docs/CertificateSigningRequest.md) - [CertificateSigningRequestList](docs/CertificateSigningRequestList.md) - [CertificateSigningRequestSpec](docs/CertificateSigningRequestSpec.md) @@ -216,6 +227,7 @@ Class | Method | HTTP request | Description - [Device](docs/Device.md) - [DeviceApplicationStatus](docs/DeviceApplicationStatus.md) - [DeviceApplicationsSummaryStatus](docs/DeviceApplicationsSummaryStatus.md) + - [DeviceCapabilities](docs/DeviceCapabilities.md) - [DeviceConfigStatus](docs/DeviceConfigStatus.md) - [DeviceConsole](docs/DeviceConsole.md) - [DeviceDecommission](docs/DeviceDecommission.md) @@ -231,7 +243,6 @@ Class | Method | HTTP request | Description - [DeviceList](docs/DeviceList.md) - [DeviceMultipleOwnersDetectedDetails](docs/DeviceMultipleOwnersDetectedDetails.md) - [DeviceMultipleOwnersResolvedDetails](docs/DeviceMultipleOwnersResolvedDetails.md) - - [DeviceOsSpec](docs/DeviceOsSpec.md) - [DeviceOsStatus](docs/DeviceOsStatus.md) - [DeviceOwnershipChangedDetails](docs/DeviceOwnershipChangedDetails.md) - [DeviceResourceStatus](docs/DeviceResourceStatus.md) @@ -249,6 +260,7 @@ Class | Method | HTTP request | Description - [DeviceUpdatedStatusType](docs/DeviceUpdatedStatusType.md) - [DeviceVulnerabilityCveDetails](docs/DeviceVulnerabilityCveDetails.md) - [DevicesSummary](docs/DevicesSummary.md) + - [DevicesSummaryCapabilities](docs/DevicesSummaryCapabilities.md) - [DiskResourceMonitorSpec](docs/DiskResourceMonitorSpec.md) - [DisruptionBudget](docs/DisruptionBudget.md) - [DockerAuth](docs/DockerAuth.md) @@ -296,9 +308,10 @@ Class | Method | HTTP request | Description - [HttpConfigProviderSpec](docs/HttpConfigProviderSpec.md) - [HttpConfigProviderSpecHttpRef](docs/HttpConfigProviderSpecHttpRef.md) - [HttpRepoSpec](docs/HttpRepoSpec.md) - - [ImageApplicationProviderSpec](docs/ImageApplicationProviderSpec.md) - [ImageMountVolumeProviderSpec](docs/ImageMountVolumeProviderSpec.md) + - [ImageOrCatalogItemRefSpec](docs/ImageOrCatalogItemRefSpec.md) - [ImagePullPolicy](docs/ImagePullPolicy.md) + - [ImageSpec](docs/ImageSpec.md) - [ImageVolumeProviderSpec](docs/ImageVolumeProviderSpec.md) - [ImageVolumeSource](docs/ImageVolumeSource.md) - [InlineApplicationProviderSpec](docs/InlineApplicationProviderSpec.md) @@ -325,6 +338,7 @@ Class | Method | HTTP request | Description - [Organization](docs/Organization.md) - [OrganizationList](docs/OrganizationList.md) - [OrganizationSpec](docs/OrganizationSpec.md) + - [OsModeType](docs/OsModeType.md) - [PatchRequestInner](docs/PatchRequestInner.md) - [Permission](docs/Permission.md) - [PermissionList](docs/PermissionList.md) @@ -366,6 +380,7 @@ Class | Method | HTTP request | Description - [UpdateSchedule](docs/UpdateSchedule.md) - [UserInfoResponse](docs/UserInfoResponse.md) - [Version](docs/Version.md) + - [VmApplication](docs/VmApplication.md) - [VolumeMount](docs/VolumeMount.md) diff --git a/api/bundled/core-v1alpha1.yaml b/api/bundled/core-v1alpha1.yaml new file mode 100644 index 0000000..293dc32 --- /dev/null +++ b/api/bundled/core-v1alpha1.yaml @@ -0,0 +1,2859 @@ +openapi: 3.0.1 +info: + title: Flight Control API + version: v1alpha1 + description: | + [Flight Control](https://flightctl.io) is a service for declarative management of fleets of edge devices and their workloads. + + This API version (v1alpha1) contains alpha-stage resources that are subject to change. + contact: + name: The Flight Control Team + url: https://flightctl.io + email: team@flightctl.io + license: + name: Apache 2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html +servers: + - url: /api/v1 +tags: + - name: catalog + description: Operations on Catalog resources. + - name: vulnerability + description: Operations for vulnerability reports and organization-wide summaries. +paths: + /catalogitems: + x-resource: catalogitems + get: + tags: + - catalog + description: List CatalogItems across all Catalogs. + operationId: listAllCatalogItems + parameters: + - name: continue + in: query + description: An optional parameter to query more results from the server. The value of the parameter must match the value of the 'continue' field in the previous list response. + required: false + schema: + type: string + - name: labelSelector + in: query + description: A selector to restrict the list of returned objects by their labels. Defaults to everything. + schema: + type: string + - name: fieldSelector + in: query + description: A selector to restrict the list of returned objects by their fields, supporting operators like '=', '==', and '!=' (e.g., "key1=value1,key2!=value2"). + schema: + type: string + - name: limit + in: query + description: 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. + required: false + schema: + type: integer + format: int32 + minimum: 0 + maximum: 1000 + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/CatalogItemList' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /catalogs: + x-resource: catalogs + get: + tags: + - catalog + description: List Catalog resources. + operationId: listCatalogs + parameters: + - name: continue + in: query + description: 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. + required: false + schema: + type: string + - name: labelSelector + in: query + description: A selector to restrict the list of returned objects by their labels. Defaults to everything. + schema: + type: string + - name: fieldSelector + in: query + description: A selector to restrict the list of returned objects by their fields, supporting operators like '=', '==', and '!=' (e.g., "key1=value1,key2!=value2"). + schema: + type: string + - name: limit + in: query + description: 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. + required: false + schema: + type: integer + format: int32 + minimum: 0 + maximum: 1000 + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/CatalogList' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + post: + tags: + - catalog + description: Create a Catalog resource. + operationId: createCatalog + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Catalog' + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/Catalog' + links: + GetCatalog: + operationId: getCatalog + parameters: + name: $response.body#/metadata/name + DeleteCatalog: + operationId: deleteCatalog + parameters: + name: $response.body#/metadata/name + ListCatalogItems: + operationId: listCatalogItems + parameters: + catalog: $response.body#/metadata/name + CreateCatalogItem: + operationId: createCatalogItem + parameters: + catalog: $response.body#/metadata/name + ReplaceCatalog: + operationId: replaceCatalog + parameters: + name: $response.body#/metadata/name + GetCatalogStatus: + operationId: getCatalogStatus + parameters: + name: $response.body#/metadata/name + ReplaceCatalogStatus: + operationId: replaceCatalogStatus + parameters: + name: $response.body#/metadata/name + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '409': + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /catalogs/{name}: + x-resource: catalogs + get: + tags: + - catalog + description: Get a Catalog resource. + operationId: getCatalog + parameters: + - name: name + in: path + description: The name of the Catalog resource to get. + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Catalog' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + put: + tags: + - catalog + description: Update a Catalog resource. + operationId: replaceCatalog + parameters: + - name: name + in: path + description: The name of the Catalog resource to update. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Catalog' + required: true + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Catalog' + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/Catalog' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '409': + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + delete: + tags: + - catalog + description: Delete a Catalog resource. + operationId: deleteCatalog + parameters: + - name: name + in: path + description: The name of the Catalog resource to delete. + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '409': + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + patch: + tags: + - catalog + description: Patch a Catalog resource. + operationId: patchCatalog + parameters: + - name: name + in: path + description: The name of the Catalog resource to patch. + required: true + schema: + type: string + requestBody: + content: + application/json-patch+json: + schema: + $ref: '#/components/schemas/PatchRequest' + required: true + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Catalog' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '409': + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /catalogs/{name}/status: + x-resource: catalogs + get: + tags: + - catalog + description: Get status of a Catalog resource. + operationId: getCatalogStatus + parameters: + - name: name + in: path + description: The name of the Catalog resource. + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Catalog' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + put: + tags: + - catalog + description: Update status of a Catalog resource. + operationId: replaceCatalogStatus + parameters: + - name: name + in: path + description: The name of the Catalog resource. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Catalog' + required: true + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Catalog' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '409': + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + patch: + tags: + - catalog + description: Patch status of a Catalog resource. + operationId: patchCatalogStatus + parameters: + - name: name + in: path + description: The name of the Catalog resource. + required: true + schema: + type: string + requestBody: + content: + application/json-patch+json: + schema: + $ref: '#/components/schemas/PatchRequest' + required: true + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Catalog' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /catalogs/{catalog}/items: + x-resource: catalogs/items + get: + tags: + - catalog + description: List CatalogItems from a Catalog. + operationId: listCatalogItems + parameters: + - name: catalog + in: path + description: The name of the Catalog resource. + required: true + schema: + type: string + example: edge-apps + - name: continue + in: query + description: An optional parameter to query more results from the server. + required: false + schema: + type: string + - name: labelSelector + in: query + description: A selector to restrict the list of returned objects by their labels. + schema: + type: string + - name: limit + in: query + description: The maximum number of results returned in the list response. + required: false + schema: + type: integer + format: int32 + minimum: 0 + maximum: 1000 + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/CatalogItemList' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + post: + tags: + - catalog + description: Create a CatalogItem in a Catalog. + operationId: createCatalogItem + parameters: + - name: catalog + in: path + description: The name of the Catalog resource. + required: true + schema: + type: string + example: edge-apps + requestBody: + description: The CatalogItem resource to create. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CatalogItem' + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/CatalogItem' + links: + GetCatalogItem: + operationId: getCatalogItem + parameters: + catalog: $request.path.catalog + name: $response.body#/metadata/name + DeleteCatalogItem: + operationId: deleteCatalogItem + parameters: + catalog: $request.path.catalog + name: $response.body#/metadata/name + ReplaceCatalogItem: + operationId: replaceCatalogItem + parameters: + catalog: $request.path.catalog + name: $response.body#/metadata/name + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '409': + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /catalogs/{catalog}/items/{name}: + x-resource: catalogs/items + get: + tags: + - catalog + description: Get a CatalogItem from a Catalog. + operationId: getCatalogItem + parameters: + - name: catalog + in: path + description: The name of the Catalog resource. + required: true + schema: + type: string + example: edge-apps + - name: name + in: path + description: The name of the CatalogItem resource. + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/CatalogItem' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + put: + tags: + - catalog + description: Replace a CatalogItem in a Catalog. + operationId: replaceCatalogItem + parameters: + - name: catalog + in: path + description: The name of the Catalog resource. + required: true + schema: + type: string + example: edge-apps + - name: name + in: path + description: The name of the CatalogItem resource. + required: true + schema: + type: string + requestBody: + description: The CatalogItem resource to replace. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CatalogItem' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/CatalogItem' + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/CatalogItem' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '409': + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + delete: + tags: + - catalog + description: Delete a CatalogItem from a Catalog. + operationId: deleteCatalogItem + parameters: + - name: catalog + in: path + description: The name of the Catalog resource. + required: true + schema: + type: string + example: edge-apps + - name: name + in: path + description: The name of the CatalogItem resource. + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + patch: + tags: + - catalog + description: Patch a CatalogItem in a Catalog. + operationId: patchCatalogItem + parameters: + - name: catalog + in: path + description: The name of the Catalog resource. + required: true + schema: + type: string + example: edge-apps + - name: name + in: path + description: The name of the CatalogItem resource to patch. + required: true + schema: + type: string + requestBody: + content: + application/json-patch+json: + schema: + $ref: '#/components/schemas/PatchRequest' + required: true + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/CatalogItem' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '409': + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /catalogs/{catalog}/items/{name}/deployments: + x-resource: catalogs/deployments + get: + tags: + - catalog + description: Get the CatalogItemDeployments for a particular Catalog Item + operationId: getCatalogItemDeployments + parameters: + - name: catalog + in: path + description: The name of the Catalog resource. + required: true + schema: + type: string + example: edge-apps + - name: name + in: path + description: The name of the CatalogItem resource. + required: true + schema: + type: string + - name: continue + in: query + description: An optional parameter to query more results from the server. The value of the parameter must match the value of the 'continue' field in the previous list response. + required: false + schema: + type: string + - name: limit + in: query + description: 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. + required: false + schema: + type: integer + format: int32 + minimum: 0 + maximum: 1000 + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/CatalogItemDeploymentList' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /vulnerabilities/summary: + x-resource: vulnerabilities + get: + tags: + - vulnerability + description: Return organization-wide CVE counts by severity. + operationId: getVulnerabilitySummary + responses: + '200': + description: OK. + content: + application/json: + schema: + $ref: '#/components/schemas/VulnerabilitySummaryResponse' + '400': + description: Bad Request. + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden. + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests. + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '501': + description: Not Implemented (vulnerability feature is not enabled on this server). + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /vulnerabilities: + x-resource: vulnerabilities + get: + tags: + - vulnerability + description: List distinct vulnerabilities across the organization with affected device counts. + operationId: listVulnerabilities + parameters: + - name: continue + in: query + description: An optional parameter to query more results from the server. The value of the parameter must match the value of the 'continue' field in the previous list response. + required: false + schema: + type: string + - name: fieldSelector + in: query + description: A selector to restrict the list of returned objects by their fields, supporting operators like '=', '==', and '!=' (e.g., "key1=value1,key2!=value2"). + schema: + type: string + - name: sortBy + in: query + description: Field to sort vulnerability list results by. + schema: + type: string + enum: + - severity + - cvssScore + - publishedAt + - cveId + default: severity + - name: order + in: query + description: Sort order for the results. + schema: + type: string + enum: + - asc + - desc + default: desc + - name: limit + in: query + description: 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. + required: false + schema: + type: integer + format: int32 + minimum: 0 + maximum: 1000 + responses: + '200': + description: OK. + content: + application/json: + schema: + $ref: '#/components/schemas/VulnerabilityGroupList' + '400': + description: Bad Request. + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden. + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests. + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '501': + description: Not Implemented (vulnerability feature is not enabled on this server). + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable. + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /vulnerabilities/devices/{name}: + x-resource: vulnerabilities + get: + tags: + - vulnerability + description: List vulnerabilities affecting a single device by device metadata name. + operationId: getDeviceVulnerabilities + parameters: + - name: name + in: path + description: The metadata.name of the Device resource. + required: true + schema: + type: string + - name: continue + in: query + description: An optional parameter to query more results from the server. The value of the parameter must match the value of the 'continue' field in the previous list response. + required: false + schema: + type: string + - name: fieldSelector + in: query + description: A selector to restrict the list of returned objects by their fields, supporting operators like '=', '==', and '!=' (e.g., "key1=value1,key2!=value2"). + schema: + type: string + - name: sortBy + in: query + description: Field to sort vulnerability list results by. + schema: + type: string + enum: + - severity + - cvssScore + - publishedAt + - cveId + default: severity + - name: order + in: query + description: Sort order for the results. + schema: + type: string + enum: + - asc + - desc + default: desc + - name: limit + in: query + description: 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. + required: false + schema: + type: integer + format: int32 + minimum: 0 + maximum: 1000 + responses: + '200': + description: OK. + content: + application/json: + schema: + $ref: '#/components/schemas/VulnerabilityList' + '400': + description: Bad Request. + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden. + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found. + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests. + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '501': + description: Not Implemented (vulnerability feature is not enabled on this server). + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /vulnerabilities/fleets/{name}: + x-resource: vulnerabilities + get: + tags: + - vulnerability + description: List vulnerabilities aggregated for a fleet by fleet metadata name. + operationId: getFleetVulnerabilities + parameters: + - name: name + in: path + description: The metadata.name of the Fleet resource. + required: true + schema: + type: string + - name: continue + in: query + description: An optional parameter to query more results from the server. The value of the parameter must match the value of the 'continue' field in the previous list response. + required: false + schema: + type: string + - name: fieldSelector + in: query + description: A selector to restrict the list of returned objects by their fields, supporting operators like '=', '==', and '!=' (e.g., "key1=value1,key2!=value2"). + schema: + type: string + - name: sortBy + in: query + description: Field to sort vulnerability list results by. + schema: + type: string + enum: + - severity + - cvssScore + - publishedAt + - cveId + default: severity + - name: order + in: query + description: Sort order for the results. + schema: + type: string + enum: + - asc + - desc + default: desc + - name: limit + in: query + description: 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. + required: false + schema: + type: integer + format: int32 + minimum: 0 + maximum: 1000 + responses: + '200': + description: OK. + content: + application/json: + schema: + $ref: '#/components/schemas/VulnerabilityGroupList' + '400': + description: Bad Request. + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden. + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found. + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests. + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '501': + description: Not Implemented (vulnerability feature is not enabled on this server). + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /vulnerabilities/devices/{name}/summary: + x-resource: vulnerabilities + get: + tags: + - vulnerability + description: Return the severity summary for a single device without fetching the full CVE list. + operationId: getDeviceVulnerabilitySummary + parameters: + - name: name + in: path + description: The metadata.name of the Device resource. + required: true + schema: + type: string + - name: fieldSelector + in: query + description: A selector to restrict the list of returned objects by their fields, supporting operators like '=', '==', and '!=' (e.g., "key1=value1,key2!=value2"). + schema: + type: string + responses: + '200': + description: OK. + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceVulnerabilitySummaryResponse' + '400': + description: Bad Request. + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden. + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found. + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests. + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '501': + description: Not Implemented (vulnerability feature is not enabled on this server). + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /vulnerabilities/fleets/{name}/summary: + x-resource: vulnerabilities + get: + tags: + - vulnerability + description: Return the severity summary for a single fleet without fetching the full CVE list. + operationId: getFleetVulnerabilitySummary + parameters: + - name: name + in: path + description: The metadata.name of the Fleet resource. + required: true + schema: + type: string + - name: fieldSelector + in: query + description: A selector to restrict the list of returned objects by their fields, supporting operators like '=', '==', and '!=' (e.g., "key1=value1,key2!=value2"). + schema: + type: string + responses: + '200': + description: OK. + content: + application/json: + schema: + $ref: '#/components/schemas/FleetVulnerabilitySummaryResponse' + '400': + description: Bad Request. + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden. + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found. + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests. + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '501': + description: Not Implemented (vulnerability feature is not enabled on this server). + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /vulnerabilities/cves/{cveId}/impact: + x-resource: vulnerabilities + get: + tags: + - vulnerability + description: Return per-fleet and fleetless blast radius for a CVE identifier. + operationId: getVulnerabilityImpact + parameters: + - name: cveId + in: path + description: The CVE identifier (for example, CVE-2024-1234). Unknown identifiers still return 200 with an empty list of affected resources (blast radius) when no matching data is found. + required: true + schema: + type: string + - name: continue + in: query + description: An optional parameter to query more results from the server. The value of the parameter must match the value of the 'continue' field in the previous list response. + required: false + schema: + type: string + - name: fieldSelector + in: query + description: Restricts blast-radius rows by device owner before aggregation. Supported key is `owner` (device owner string, for example `owner=Fleet/my-fleet`). Operators include `=`, `==`, `!=`, and set-style `in` / `notin` where applicable. + schema: + type: string + - name: sortBy + in: query + description: Field to sort blast radius rows by. + schema: + type: string + enum: + - affectedDevices + - fleetName + default: affectedDevices + - name: order + in: query + description: Sort order for the results. + schema: + type: string + enum: + - asc + - desc + default: desc + - name: limit + in: query + description: 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. + required: false + schema: + type: integer + format: int32 + minimum: 0 + maximum: 1000 + responses: + '200': + description: OK. + content: + application/json: + schema: + $ref: '#/components/schemas/VulnerabilityImpact' + '400': + description: Bad Request. + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden. + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests. + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '501': + description: Not Implemented (vulnerability feature is not enabled on this server). + content: + application/json: + schema: + $ref: '#/components/schemas/Status' +components: + securitySchemes: + bearerAuth: + type: http + scheme: bearer + bearerFormat: JWT + orgId: + type: apiKey + in: query + name: org_id + description: The UUID of the organization that owns the resource. Maps to an organizations metadata.name. + schemas: + ApiVersion: + type: string + x-go-type: string + description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources.' + enum: + - v1alpha1 + - flightctl.io/v1alpha1 + x-enum-varnames: + - ApiVersionV1alpha1 + - ApiVersionFlightctlIoV1alpha1 + SemVer: + type: string + x-go-type: string + description: Semantic version identifier (e.g., 1.2.3, 2.0.0-rc1) + pattern: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$ + example: 1.2.3 + SemVerRange: + type: string + x-go-type: string + description: Semver range constraint (e.g., >=1.0.0 <2.0.0). Space-separated terms, each with optional operator (>=, <=, >, <, =, ~, ^) followed by a version. + pattern: ^[>=<~^]*[0-9]+\.[0-9]+(\.[0-9]+)?(-[0-9a-zA-Z.-]+)?(\+[0-9a-zA-Z.-]+)?( [>=<~^]*[0-9]+\.[0-9]+(\.[0-9]+)?(-[0-9a-zA-Z.-]+)?(\+[0-9a-zA-Z.-]+)?)*$ + example: '>=1.0.0 <2.0.0' + Catalog: + type: object + properties: + apiVersion: + $ref: '#/components/schemas/ApiVersion' + kind: + type: string + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds.' + metadata: + $ref: '#/components/schemas/ObjectMeta' + spec: + $ref: '#/components/schemas/CatalogSpec' + status: + $ref: '#/components/schemas/CatalogStatus' + required: + - apiVersion + - kind + - metadata + - spec + additionalProperties: false + example: + apiVersion: flightctl.io/v1alpha1 + kind: Catalog + metadata: + name: edge-apps + spec: + displayName: Edge Applications + CatalogSpec: + type: object + description: CatalogSpec describes the configuration of a catalog. Catalogs are containers for locally-managed CatalogItems. + properties: + displayName: + type: string + description: Human-readable display name shown in catalog listings. + shortDescription: + type: string + description: A brief one-line description of the catalog. + icon: + type: string + description: URL or data URI of the catalog icon for display in UI. + provider: + type: string + description: Provider or publisher of the catalog (company or team name). + support: + type: string + description: Link to support resources or documentation for getting help. + additionalProperties: false + CatalogStatus: + type: object + description: CatalogStatus represents the current status of a catalog source. + properties: + conditions: + type: array + description: Current state of the catalog source. + items: + $ref: '#/components/schemas/Condition' + required: + - conditions + additionalProperties: false + CatalogList: + type: object + description: CatalogList is a list of Catalogs. + properties: + apiVersion: + $ref: '#/components/schemas/ApiVersion' + kind: + type: string + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds.' + metadata: + $ref: '#/components/schemas/ListMeta' + items: + type: array + description: List of Catalogs. + items: + $ref: '#/components/schemas/Catalog' + required: + - apiVersion + - kind + - metadata + - items + additionalProperties: false + CatalogItemMeta: + type: object + description: Metadata for CatalogItem resources. Extends ObjectMeta with catalog scoping. + allOf: + - $ref: '#/components/schemas/ObjectMeta' + - type: object + properties: + catalog: + type: string + description: The catalog this item belongs to. Similar to namespace in Kubernetes. + example: edge-apps + required: + - catalog + CatalogItem: + type: object + description: CatalogItem represents an application template from a catalog. It provides default configuration values that can be customized when adding the application to a fleet. + properties: + apiVersion: + $ref: '#/components/schemas/ApiVersion' + kind: + type: string + description: Kind is a string value representing the REST resource this object represents. + metadata: + $ref: '#/components/schemas/CatalogItemMeta' + spec: + $ref: '#/components/schemas/CatalogItemSpec' + required: + - apiVersion + - kind + - metadata + - spec + additionalProperties: false + CatalogItemArtifact: + type: object + description: An artifact reference. The type field is the discriminator and must be unique within the artifacts list. + properties: + type: + $ref: '#/components/schemas/CatalogItemArtifactType' + name: + type: string + description: Optional human-readable display name for this artifact. + example: QCOW2 Disk Image + uri: + type: string + minLength: 1 + description: Artifact URI without version qualifier. The version reference (tag or digest) is applied at resolution time. + example: quay.io/redhat/rhel-bootc-qcow2 + required: + - type + - uri + additionalProperties: false + CatalogItemArtifactType: + type: string + description: Artifact format discriminator. Must be unique within the artifacts list. Includes bootc-image-builder output formats. + example: container + enum: + - container + - qcow2 + - ami + - iso + - anaconda-iso + - vmdk + - vhd + - raw + - gce + - qcow2-disk-container + x-enum-varnames: + - CatalogItemArtifactTypeContainer + - CatalogItemArtifactTypeQcow2 + - CatalogItemArtifactTypeAmi + - CatalogItemArtifactTypeIso + - CatalogItemArtifactTypeAnacondaIso + - CatalogItemArtifactTypeVmdk + - CatalogItemArtifactTypeVhd + - CatalogItemArtifactTypeRaw + - CatalogItemArtifactTypeGce + - CatalogItemArtifactTypeQcow2DiskContainer + CatalogItemConfigurable: + type: object + description: Configuration fields that can be specified at item level (as defaults) and overridden at version level. Version-level values fully replace item-level values (not merged). + properties: + config: + type: object + additionalProperties: true + description: Configuration values (envVars, ports, volumes, resources, etc.). + example: + envVars: + LOG_LEVEL: info + ports: + - 9090:9090 + configSchema: + type: object + additionalProperties: true + description: JSON Schema defining configurable parameters and their validation. + readme: + type: string + description: Detailed documentation, preferably in markdown format. + CatalogItemSpec: + type: object + description: CatalogItemSpec defines the configuration for a catalog item. + properties: + category: + $ref: '#/components/schemas/CatalogItemCategory' + type: + $ref: '#/components/schemas/CatalogItemType' + artifacts: + type: array + items: + $ref: '#/components/schemas/CatalogItemArtifact' + minItems: 1 + description: Artifact definitions for this catalog item. Defined once; version references resolve each artifact independently. Type must be unique within the list. + example: + - type: container + uri: quay.io/prometheus/prometheus + versions: + type: array + items: + $ref: '#/components/schemas/CatalogItemVersion' + description: Available versions using Cincinnati model. Use replaces for primary edge, skips when stable channel skips intermediate versions. + example: + - version: 2.45.0 + references: + container: sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4 + channels: + - stable + - fast + replaces: 2.44.0 + skips: + - 2.43.0 + - version: 2.44.0 + references: + container: v2.44.0 + channels: + - fast + replaces: 2.43.0 + defaults: + $ref: '#/components/schemas/CatalogItemConfigurable' + displayName: + type: string + description: Human-readable display name shown in catalog listings. + shortDescription: + type: string + description: A brief one-line description of the catalog item. + icon: + type: string + description: URL or data URI of the catalog item icon for display in UI. + deprecation: + $ref: '#/components/schemas/CatalogItemDeprecation' + provider: + type: string + description: Provider or publisher of the catalog item (company or team name). + support: + type: string + description: Link to support resources or documentation for getting help. + homepage: + type: string + description: The homepage URL for the catalog item project. + documentationUrl: + type: string + description: Link to external documentation. + required: + - type + - artifacts + - versions + additionalProperties: false + CatalogItemVersion: + type: object + description: | + A version of a catalog item following the Cincinnati model where versions + are nodes in an upgrade graph and channels are labels on those nodes. + Upgrade edges are defined by replaces (single), skips (multiple), or + skipRange (semver range). Includes CatalogItemConfigurable fields that + override item-level defaults. + allOf: + - $ref: '#/components/schemas/CatalogItemConfigurable' + - type: object + properties: + version: + allOf: + - $ref: '#/components/schemas/SemVer' + description: Semantic version identifier (e.g., 1.2.3, 2.0.0-rc1). Required for version ordering and upgrade graph. + example: 2.45.0 + references: + type: object + x-go-type: map[CatalogItemArtifactType]string + minProperties: 1 + additionalProperties: + type: string + minLength: 1 + description: Map of artifact type to image tag or digest. Keys must match a type in spec.artifacts. Only keyed artifacts are available for this version. + example: + container: sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4 + qcow2: v2.45.0 + channels: + type: array + minItems: 1 + items: + type: string + description: Channels this version belongs to. + replaces: + allOf: + - $ref: '#/components/schemas/SemVer' + description: The single version this one replaces, defining the primary upgrade edge. + skips: + type: array + items: + $ref: '#/components/schemas/SemVer' + description: Additional versions that can upgrade directly to this one. Use when stable channel skips intermediate fast-only versions. + example: + - 1.0.0 + - 1.1.0 + skipRange: + allOf: + - $ref: '#/components/schemas/SemVerRange' + description: Semver range of versions that can upgrade directly to this one. Use for z-stream updates or hotfixes. + example: '>=1.0.0 <1.3.0' + deprecation: + $ref: '#/components/schemas/CatalogItemDeprecation' + required: + - version + - channels + - references + CatalogItemList: + type: object + description: CatalogItemList is a list of CatalogItems. + properties: + apiVersion: + $ref: '#/components/schemas/ApiVersion' + kind: + type: string + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds.' + metadata: + $ref: '#/components/schemas/ListMeta' + items: + type: array + description: List of CatalogItems. + items: + $ref: '#/components/schemas/CatalogItem' + required: + - apiVersion + - kind + - metadata + - items + additionalProperties: false + CatalogItemDeployment: + type: object + description: CatalogItemDeployment represents a specific deployment of a catalog item to a fleet or device. A catalog item associated to a fleet that has no devices is still considered a deployment. A deployment is only associated with the fleet and not the individual devices in cases where a device is using a catalog item deployment that came from a device spec template on a fleet. + properties: + apiVersion: + $ref: '#/components/schemas/ApiVersion' + kind: + type: string + description: Kind is a string value representing the REST resource this object represents. + deployedTo: + type: object + description: The device or fleet that this deployment pertains to. + properties: + resourceKind: + type: string + description: Either a Device or Fleet. + resourceName: + type: string + description: The name of the device or fleet. + catalog: + type: string + description: The catalog of the catalogItem. + example: edge-apps + catalogItem: + type: string + description: The catalogItem that this deployment corresponds to. + example: nginx + version: + type: string + description: The version of the catalog item that is deployed. + channel: + type: string + description: The channel, if any, that is intended to be tracked for the catalog item. + applicationName: + type: string + description: For catalog items in the 'application' category, the name of the application on the device that the deployment is associated with. Required for application catalog items. + required: + - apiVersion + - kind + - catalog + - catalogItem + - version + additionalProperties: false + CatalogItemDeploymentList: + type: object + description: CatalogItemDeploymentList is a list of CatalogItemDeployments. + properties: + apiVersion: + $ref: '#/components/schemas/ApiVersion' + kind: + type: string + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds.' + metadata: + $ref: '#/components/schemas/ListMeta' + items: + type: array + description: List of CatalogItemDeployments. + items: + $ref: '#/components/schemas/CatalogItemDeployment' + required: + - apiVersion + - kind + - metadata + - items + additionalProperties: false + CatalogItemCategory: + type: string + description: Category of a catalog item. + enum: + - system + - application + default: application + x-enum-varnames: + - CatalogItemCategorySystem + - CatalogItemCategoryApplication + CatalogItemType: + type: string + description: Type of catalog item within its category. + enum: + - os + - firmware + - driver + - container + - helm + - quadlet + - compose + - data + x-enum-varnames: + - CatalogItemTypeOS + - CatalogItemTypeFirmware + - CatalogItemTypeDriver + - CatalogItemTypeContainer + - CatalogItemTypeHelm + - CatalogItemTypeQuadlet + - CatalogItemTypeCompose + - CatalogItemTypeData + CatalogItemDeprecation: + type: object + description: Deprecation information for a catalog item or version. Presence indicates deprecated status. + properties: + message: + type: string + description: Required message explaining why this is deprecated and what to do instead. + example: This item is deprecated. Use nginx-plus instead. + replacement: + type: string + description: Optional name of the replacement catalog item (item-level only). + example: nginx-plus + required: + - message + additionalProperties: false + Status: + type: object + properties: + apiVersion: + $ref: '#/components/schemas/ApiVersion' + kind: + type: string + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds.' + code: + type: integer + format: int32 + description: Suggested HTTP return code for this status, 0 if not set. + message: + type: string + description: A human-readable description of the status of this operation. + reason: + type: string + description: A machine-readable description of why this operation is in the "Failure" status. If this value is empty there is no information available. A Reason clarifies an HTTP status code but does not override it. + status: + type: string + description: 'Status of the operation. One of: "Success" or "Failure". More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status.' + description: Status is a return value for calls that don't return other objects. + required: + - apiVersion + - kind + - status + - code + - reason + - message + additionalProperties: false + VulnerabilitySummaryResponse: + type: object + description: Estate-wide vulnerability summary counts. + additionalProperties: false + required: + - apiVersion + - kind + - cvesBySeverity + properties: + apiVersion: + $ref: '#/components/schemas/ApiVersion' + kind: + type: string + description: Resource kind; always VulnerabilitySummary. + cvesBySeverity: + $ref: '#/components/schemas/CveCountsBySeverity' + DeviceCountsBySeverity: + type: object + description: Counts of distinct devices affected in the organization, grouped by vulnerability severity. + additionalProperties: false + required: + - total + - critical + - high + - medium + - low + - none + - unknown + properties: + total: + type: integer + format: int64 + description: Number of distinct devices with at least one vulnerability finding in the organization. + critical: + type: integer + format: int64 + description: Number of devices whose highest severity finding is critical. + high: + type: integer + format: int64 + description: Number of devices whose highest severity finding is high. + medium: + type: integer + format: int64 + description: Number of devices whose highest severity finding is medium. + low: + type: integer + format: int64 + description: Number of devices whose highest severity finding is low. + none: + type: integer + format: int64 + description: Number of devices whose highest severity finding is none. + unknown: + type: integer + format: int64 + description: Number of devices whose highest severity finding is unknown. + CveCountsBySeverity: + type: object + description: Counts of distinct CVEs in the organization by highest severity. + additionalProperties: false + required: + - total + - critical + - high + - medium + - low + - none + - unknown + properties: + total: + type: integer + format: int64 + description: Total distinct CVEs across the organization. + critical: + type: integer + format: int64 + description: Count of distinct Critical CVEs. + high: + type: integer + format: int64 + description: Count of distinct High CVEs. + medium: + type: integer + format: int64 + description: Count of distinct Medium CVEs. + low: + type: integer + format: int64 + description: Count of distinct Low CVEs. + none: + type: integer + format: int64 + description: Count of distinct CVEs with no exploitable impact (CVSS score 0). + unknown: + type: integer + format: int64 + description: Count of distinct CVEs with unknown or unscored severity. + Vulnerability: + type: object + description: A single vulnerability (CVE) finding. Vulnerabilities are global CVE records from Trustify; they are not tenant-owned resources. Tenancy is determined by the device or fleet context through which they are queried. + additionalProperties: false + required: + - apiVersion + - kind + - cveId + - severity + properties: + apiVersion: + $ref: '#/components/schemas/ApiVersion' + kind: + type: string + description: Kind is a string value representing the REST resource this object represents. Always Vulnerability. + cveId: + type: string + description: CVE identifier (e.g. CVE-2024-1234). + advisoryId: + type: string + description: Vendor advisory identifier when available. + issuer: + type: string + description: Name of the advisory issuer (e.g. Red Hat, NVD) when known. + link: + type: string + description: URL to the CVE details page. Points to Red Hat Security portal for Red Hat advisories, otherwise to NVD. + severity: + type: string + description: Normalized severity label. + enum: + - Critical + - High + - Medium + - Low + - None + - Unknown + cvssScore: + type: number + format: float + description: CVSS base score when available. + description: + type: string + description: Short summary of the vulnerability. + publishedAt: + type: string + format: date-time + description: Advisory publish time when known. + image: + type: string + description: Image reference (name or URL) from the device context. + imageDigest: + type: string + description: Immutable image digest from the device context. + affectedDevices: + type: integer + format: int64 + description: Distinct devices affected by this CVE. For device context this is always 1; for fleet context it is the number of devices in the fleet running an image with this CVE; for organization-wide context it is the count across the whole organization. + VulnerabilityList: + type: object + description: Paginated list of Vulnerability resources. + additionalProperties: false + required: + - apiVersion + - kind + - metadata + - items + properties: + apiVersion: + $ref: '#/components/schemas/ApiVersion' + kind: + type: string + description: Kind is a string value representing the REST resource this object represents. Always VulnerabilityList. + metadata: + $ref: '#/components/schemas/ListMeta' + items: + type: array + description: Paginated Vulnerability resources for this page. + items: + $ref: '#/components/schemas/Vulnerability' + VulnerabilityImageRef: + type: object + description: Reference to an OS or workload image by name and digest. + additionalProperties: false + required: + - image + - imageDigest + properties: + image: + type: string + description: Image reference (name or URL). + imageDigest: + type: string + description: Immutable image digest. + affectedDevices: + type: integer + format: int64 + description: Devices running this exact image digest within the parent scope (fleet or blast radius row). + VulnerabilityGroupItem: + type: object + description: A single CVE finding for a specific image digest, including all image refs that resolve to that digest. + additionalProperties: false + required: + - imageDigest + - severity + - imageRefs + properties: + imageDigest: + type: string + description: Immutable image digest. + imageRefs: + type: array + description: Image references observed for this digest within the query scope. + items: + type: string + severity: + type: string + description: Severity of this CVE for this digest. + enum: + - Critical + - High + - Medium + - Low + - None + - Unknown + cvssScore: + type: number + format: float + description: CVSS base score when available. + advisoryId: + type: string + description: Vendor advisory identifier when available. + issuer: + type: string + description: Name of the advisory issuer (e.g. Red Hat, NVD) when known. + link: + type: string + description: URL to the CVE details page. Points to Red Hat Security portal for Red Hat advisories, otherwise to NVD. + description: + type: string + description: Short summary of the vulnerability. + publishedAt: + type: string + format: date-time + description: Advisory publish time when known. + affectedDevices: + type: integer + format: int64 + description: Number of devices in scope running this digest. + firstSeenAt: + type: string + format: date-time + description: When this CVE was first observed in this digest. + VulnerabilityGroup: + type: object + description: | + A CVE grouped across one or more images, as returned by fleet-scoped and organization-wide vulnerability list endpoints. Each finding represents one image in which the CVE was detected. + additionalProperties: false + required: + - apiVersion + - kind + - cveId + - severity + - findings + properties: + apiVersion: + $ref: '#/components/schemas/ApiVersion' + kind: + type: string + description: Kind is a string value representing the REST resource. Always VulnerabilityGroup. + cveId: + type: string + description: CVE identifier (e.g. CVE-2024-1234). + severity: + type: string + description: Worst severity across all findings in this group. + enum: + - Critical + - High + - Medium + - Low + - None + - Unknown + maxCvssScore: + type: number + format: float + description: Highest CVSS base score across all findings. + maxPublishedAt: + type: string + format: date-time + description: Latest advisory publish time across all findings. + affectedDevices: + type: integer + format: int64 + description: Total distinct devices affected by this CVE within scope. + findings: + type: array + description: Per-digest findings for this CVE within the query scope. + items: + $ref: '#/components/schemas/VulnerabilityGroupItem' + VulnerabilityGroupList: + type: object + description: Paginated list of VulnerabilityGroup resources (fleet-scoped or organization-wide). + additionalProperties: false + required: + - apiVersion + - kind + - metadata + - items + properties: + apiVersion: + $ref: '#/components/schemas/ApiVersion' + kind: + type: string + description: Kind is a string value representing the REST resource. Always VulnerabilityGroupList. + metadata: + $ref: '#/components/schemas/ListMeta' + items: + type: array + description: Paginated VulnerabilityGroup resources for this page. + items: + $ref: '#/components/schemas/VulnerabilityGroup' + DeviceVulnerabilitySummaryResponse: + type: object + description: Severity summary for a single device. + additionalProperties: false + required: + - apiVersion + - kind + - summary + properties: + apiVersion: + $ref: '#/components/schemas/ApiVersion' + kind: + type: string + description: Resource kind; always DeviceVulnerabilitySummary. + image: + type: string + description: Image reference from device status. Absent when the device has no rendered OS image. + imageDigest: + type: string + description: Image digest from device status. Absent when the device has no rendered OS image. + summary: + $ref: '#/components/schemas/VulnerabilitySeveritySummary' + FleetVulnerabilitySummaryResponse: + type: object + description: Severity summary for a single fleet. + additionalProperties: false + required: + - apiVersion + - kind + - summary + properties: + apiVersion: + $ref: '#/components/schemas/ApiVersion' + kind: + type: string + description: Resource kind; always FleetVulnerabilitySummary. + summary: + $ref: '#/components/schemas/FleetVulnerabilitySummary' + VulnerabilitySeveritySummary: + type: object + description: Total vulnerability counts by severity for the full result set (not only the current page). + additionalProperties: false + required: + - total + - critical + - high + - medium + - low + - none + - unknown + properties: + total: + type: integer + format: int64 + description: Total vulnerabilities across all severities for the full result set. + critical: + type: integer + format: int64 + description: Count of Critical severity findings in the full result set. + high: + type: integer + format: int64 + description: Count of High severity findings in the full result set. + medium: + type: integer + format: int64 + description: Count of Medium severity findings in the full result set. + low: + type: integer + format: int64 + description: Count of Low severity findings in the full result set. + none: + type: integer + format: int64 + description: Count of findings with no exploitable impact (CVSS score 0). + unknown: + type: integer + format: int64 + description: Count of findings with unknown or unscored severity. + FleetVulnerabilitySummary: + description: Fleet vulnerability totals including unique digest count. + allOf: + - $ref: '#/components/schemas/VulnerabilitySeveritySummary' + - type: object + additionalProperties: false + required: + - uniqueDigests + properties: + uniqueDigests: + type: integer + format: int64 + description: Distinct image digests observed in the fleet. + VulnerabilityImpact: + type: object + description: Blast radius for a single CVE across fleets and fleetless devices. + additionalProperties: false + required: + - apiVersion + - kind + - metadata + - cveId + - severity + - items + properties: + apiVersion: + $ref: '#/components/schemas/ApiVersion' + kind: + type: string + description: Resource kind; always VulnerabilityImpact. + metadata: + $ref: '#/components/schemas/ListMeta' + cveId: + type: string + description: CVE identifier for this blast radius response. + issuer: + type: string + description: Name of the advisory issuer (e.g. Red Hat, NVD) when known. + link: + type: string + description: URL to the CVE details page. Points to Red Hat Security portal for Red Hat advisories, otherwise to NVD. + severity: + type: string + description: Worst severity for this CVE in the fleet or fleetless group. + enum: + - Critical + - High + - Medium + - Low + - None + - Unknown + maxCvssScore: + type: number + format: float + description: Highest CVSS base score for this CVE in the fleet or fleetless group. + maxPublishedAt: + type: string + format: date-time + description: When this CVE was first observed in the fleet or fleetless group. + items: + type: array + description: Per-fleet or fleetless rows with device and image counts. + items: + $ref: '#/components/schemas/AffectedFleet' + AffectedFleet: + type: object + description: One fleet or the fleetless aggregate with device and image counts for a CVE. + additionalProperties: false + required: + - fleetName + - fleetless + - affectedDevices + - findings + properties: + fleetName: + type: string + description: Fleet metadata.name, empty for the fleetless aggregate. + fleetless: + type: boolean + description: True when this row represents devices not owned by a fleet. + affectedDevices: + type: integer + format: int64 + description: Devices in this fleet or fleetless group affected by the CVE. + findings: + type: array + description: Per-digest findings within this fleet or fleetless group. + items: + $ref: '#/components/schemas/VulnerabilityGroupItem' + ListMeta: + type: object + properties: + continue: + type: string + description: May be set if the user set a limit on the number of items returned, and indicates that the server has more data available. The value is opaque and may be used to issue another request to the endpoint that served this list to retrieve the next set of available objects. Continuing a consistent list may not be possible if the server configuration has changed or more than a few minutes have passed. The resourceVersion field returned when using this continue value will be identical to the value in the first response, unless you have received this token from an error message. + remainingItemCount: + type: integer + description: The number of subsequent items in the list which are not included in this list response. If the list request contained label or field selectors, then the number of remaining items is unknown and the field will be left unset and omitted during serialization. If the list is complete (either because it is not chunking or because this is the last chunk), then there are no more remaining items and this field will be left unset and omitted during serialization. Servers older than v1.15 do not set this field. The intended use of the remainingItemCount is *estimating* the size of a collection. Clients should not rely on the remainingItemCount to be set or to be exact. + format: int64 + description: ListMeta describes metadata that synthetic resources must have, including lists and various status objects. A resource may have only one of {ObjectMeta, ListMeta}. + ObjectMeta: + type: object + properties: + creationTimestamp: + type: string + description: The time the object was created. + format: date-time + deletionTimestamp: + type: string + description: The time the object will be deleted. + format: date-time + name: + type: string + maxLength: 253 + description: The name of the object. + labels: + type: object + description: Map of string keys and values that can be used to organize and categorize (scope and select) objects. + additionalProperties: + type: string + maxLength: 63 + generation: + type: integer + description: A sequence number representing a specific generation of the desired state. Populated by the system. Read-only. + format: int64 + owner: + type: string + description: A resource that owns this resource, in "kind/name" format. + annotations: + type: object + additionalProperties: + type: string + description: Properties set by the service. + resourceVersion: + type: string + description: An opaque string that identifies the server's internal version of an object. + description: ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create. + ConditionStatus: + type: string + description: Status of the condition, one of True, False, Unknown. + enum: + - 'True' + - 'False' + - Unknown + x-enum-varnames: + - ConditionStatusTrue + - ConditionStatusFalse + - ConditionStatusUnknown + ConditionBase: + type: object + description: Base condition structure following Kubernetes API conventions. Use with allOf to add a specific type enum. + required: + - status + - lastTransitionTime + - reason + - message + properties: + status: + $ref: '#/components/schemas/ConditionStatus' + observedGeneration: + type: integer + format: int64 + description: The .metadata.generation that the condition was set based upon. + lastTransitionTime: + type: string + format: date-time + description: The last time the condition transitioned from one status to another. + message: + type: string + description: Human readable message indicating details about last transition. + reason: + type: string + description: A (brief) reason for the condition's last transition. + ConditionType: + type: string + description: Type of condition in CamelCase. + enum: + - Approved + - TPMVerified + - Approved + - Denied + - Failed + - TPMVerified + - Accessible + - Accessible + - ResourceParsed + - Synced + - Valid + - RolloutInProgress + - Updating + - SpecValid + - MultipleOwners + - DeviceDecommissioning + x-enum-varnames: + - EnrollmentRequestApproved + - EnrollmentRequestTPMVerified + - CertificateSigningRequestApproved + - CertificateSigningRequestDenied + - CertificateSigningRequestFailed + - CertificateSigningRequestTPMVerified + - RepositoryAccessible + - ResourceSyncAccessible + - ResourceSyncResourceParsed + - ResourceSyncSynced + - FleetValid + - FleetRolloutInProgress + - DeviceUpdating + - DeviceSpecValid + - DeviceMultipleOwners + - DeviceDecommissioning + Condition: + description: Condition contains details for one aspect of the current state of this API Resource. + allOf: + - $ref: '#/components/schemas/ConditionBase' + - type: object + required: + - type + properties: + type: + $ref: '#/components/schemas/ConditionType' + PatchRequest: + type: array + items: + type: object + additionalProperties: false + required: + - op + - path + properties: + path: + description: A JSON Pointer path. + type: string + value: + description: The value to add or replace. + op: + description: The operation to perform. + type: string + enum: + - add + - replace + - remove + - test diff --git a/api/bundled/core-v1beta1.yaml b/api/bundled/core-v1beta1.yaml new file mode 100644 index 0000000..9d21ae0 --- /dev/null +++ b/api/bundled/core-v1beta1.yaml @@ -0,0 +1,9028 @@ +openapi: 3.0.1 +info: + title: Flight Control API + version: v1beta1 + description: | + [Flight Control](https://flightctl.io) is a service for declarative management of fleets of edge devices and their workloads. + contact: + name: The Flight Control Team + url: https://flightctl.io + email: team@flightctl.io + license: + name: Apache 2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html +servers: + - url: /api/v1 +tags: + - name: authentication + description: Operations for authentication. + - name: authprovider + description: Operations on AuthProvider resources. + - name: certificatesigningrequest + description: Operations on CertificateSigningRequest resources. + - name: device + description: Operations on Device resources. + - name: deviceactions + description: Operations for device actions. + - name: enrollmentrequest + description: Operations on EnrollmentRequest resources. + - name: event + description: Operations for retrieving events. + - name: fleet + description: Operations on Fleet resources. + - name: label + description: Operations for retrieving labels across different resources. + - name: organization + description: Operations for retrieving Organization resources. + - name: repository + description: Operations on Repository resources. + - name: resourcesync + description: Operations on ResourceSync resources. + - name: version + description: Operations for receiving service version. +paths: + /version: + x-resource: version + get: + tags: + - version + description: Get service version. + operationId: getVersion + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Version' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /auth/config: + get: + tags: + - authentication + description: Get authentication configuration. + operationId: authConfig + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AuthConfig' + '418': + description: Auth not configured + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /auth/validate: + get: + tags: + - authentication + description: Validate an authentication token. + operationId: authValidate + parameters: + - name: Authorization + in: header + description: The authentication token to validate. + schema: + type: string + responses: + '200': + description: Token valid + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Token invalid + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '418': + description: Auth not configured + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /auth/permissions: + get: + tags: + - authentication + description: Get the list of available permissions for the authenticated user. + operationId: authGetPermissions + responses: + '200': + description: List of available permissions + content: + application/json: + schema: + $ref: '#/components/schemas/PermissionList' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '418': + description: Auth not configured + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /auth/{providername}/token: + post: + tags: + - authentication + description: OAuth2 token exchange endpoint. Proxies token requests to the configured authentication provider (PAM issuer) for authorization code flow with PKCE support. + operationId: authToken + parameters: + - name: providername + in: path + required: true + schema: + type: string + description: Name of the authentication provider to use. + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TokenRequest' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/TokenRequest' + responses: + '200': + description: Token response + content: + application/json: + schema: + $ref: '#/components/schemas/TokenResponse' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/TokenResponse' + /auth/userinfo: + get: + tags: + - authentication + description: OIDC UserInfo endpoint. Proxies the request to the configured authentication provider to retrieve user information. + operationId: authUserInfo + responses: + '200': + description: User information + content: + application/json: + schema: + $ref: '#/components/schemas/UserInfoResponse' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '418': + description: Auth not configured + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /resourcesyncs: + x-resource: resourcesyncs + get: + tags: + - resourcesync + description: List ResourceSync resources. + operationId: listResourceSyncs + parameters: + - name: continue + in: query + description: 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. + required: false + schema: + type: string + - name: labelSelector + in: query + description: A selector to restrict the list of returned objects by their labels. Defaults to everything. + schema: + type: string + - name: fieldSelector + in: query + description: A selector to restrict the list of returned objects by their fields, supporting operators like '=', '==', and '!=' (e.g., "key1=value1,key2!=value2"). + schema: + type: string + - name: limit + in: query + description: 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. + required: false + schema: + type: integer + format: int32 + minimum: 0 + maximum: 1000 + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceSyncList' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + post: + tags: + - resourcesync + description: Create a ResourceSync resource. + operationId: createResourceSync + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceSync' + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceSync' + links: + GetResourceSync: + operationId: getResourceSync + parameters: + name: $response.body#/metadata/name + DeleteResourceSync: + operationId: deleteResourceSync + parameters: + name: $response.body#/metadata/name + ReplaceResourceSync: + operationId: replaceResourceSync + parameters: + name: $response.body#/metadata/name + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '409': + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /resourcesyncs/{name}: + x-resource: resourcesyncs + get: + tags: + - resourcesync + description: Get a ResourceSync resource. + operationId: getResourceSync + parameters: + - name: name + in: path + description: The name of the ResourceSync resource to get. + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceSync' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + put: + tags: + - resourcesync + description: Update a ResourceSync resource. + operationId: replaceResourceSync + parameters: + - name: name + in: path + description: The name of the ResourceSync resource to update. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceSync' + required: true + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceSync' + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceSync' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '409': + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + patch: + tags: + - resourcesync + description: Patch a ResourceSync resource. + operationId: patchResourceSync + parameters: + - name: name + in: path + description: The name of the ResourceSync resource to patch. + required: true + schema: + type: string + requestBody: + content: + application/json-patch+json: + schema: + $ref: '#/components/schemas/PatchRequest' + required: true + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceSync' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '409': + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + delete: + tags: + - resourcesync + description: Delete a ResourceSync resource. + operationId: deleteResourceSync + parameters: + - name: name + in: path + description: The name of the ResourceSync resource to delete. + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /repositories: + x-resource: repositories + get: + tags: + - repository + description: List Repository resources. + operationId: listRepositories + parameters: + - name: continue + in: query + description: 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. + required: false + schema: + type: string + - name: labelSelector + in: query + description: A selector to restrict the list of returned objects by their labels. Defaults to everything. + schema: + type: string + - name: fieldSelector + in: query + description: A selector to restrict the list of returned objects by their fields, supporting operators like '=', '==', and '!=' (e.g., "key1=value1,key2!=value2"). + schema: + type: string + - name: limit + in: query + description: 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. + required: false + schema: + type: integer + format: int32 + minimum: 0 + maximum: 1000 + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/RepositoryList' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + post: + tags: + - repository + description: Create a Repository resource. + operationId: createRepository + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Repository' + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/Repository' + links: + GetRepository: + operationId: getRepository + parameters: + name: $response.body#/metadata/name + DeleteRepository: + operationId: deleteRepository + parameters: + name: $response.body#/metadata/name + ReplaceRepository: + operationId: replaceRepository + parameters: + name: $response.body#/metadata/name + CreateResourceSync: + operationId: createResourceSync + requestBody: + spec: + repository: $response.body#/metadata/name + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '409': + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /repositories/{name}: + x-resource: repositories + get: + tags: + - repository + description: Get a Repository resource. + operationId: getRepository + parameters: + - name: name + in: path + description: The name of the Repository resource to get. + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Repository' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + put: + tags: + - repository + description: Update a Repository resource. + operationId: replaceRepository + parameters: + - name: name + in: path + description: The name of the Repository resource to update. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Repository' + required: true + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Repository' + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/Repository' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '409': + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + delete: + tags: + - repository + description: Delete a Repository resource. + operationId: deleteRepository + parameters: + - name: name + in: path + description: The name of the Repository resource to delete. + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + patch: + tags: + - repository + description: Patch a Repository resource. + operationId: patchRepository + parameters: + - name: name + in: path + description: The name of the Repository resource to patch. + required: true + schema: + type: string + requestBody: + content: + application/json-patch+json: + schema: + $ref: '#/components/schemas/PatchRequest' + required: true + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Repository' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '409': + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /repositories/{name}/check-oci-tag: + x-resource: repositories/check-oci-tag + post: + tags: + - repository + description: | + Check if a specific image tag exists in an OCI registry configured as a Repository resource. The registry credentials and connection settings are read from the named Repository resource. + operationId: checkRepositoryOciTag + parameters: + - name: name + in: path + description: The name of the Repository resource to use for registry connection. + required: true + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CheckRepositoryOciTagRequest' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/CheckRepositoryOciResult' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found - Repository resource does not exist + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /repositories/{name}/check-oci-image: + x-resource: repositories/check-oci-image + post: + tags: + - repository + description: | + Check if a specific OCI image is accessible in a registry configured as a Repository resource. The registry credentials and connection settings are read from the named Repository resource. + operationId: checkRepositoryOciImage + parameters: + - name: name + in: path + description: The name of the Repository resource to use for registry connection. + required: true + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CheckRepositoryOciImageRequest' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/CheckRepositoryOciResult' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found - Repository resource does not exist + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /devices: + x-resource: devices + get: + tags: + - device + description: List Device resources. + operationId: listDevices + parameters: + - name: continue + in: query + description: 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. + required: false + schema: + type: string + - name: labelSelector + in: query + description: A selector to restrict the list of returned objects by their labels. Defaults to everything. + schema: + type: string + - name: fieldSelector + in: query + description: A selector to restrict the list of returned objects by their fields, supporting operators like '=', '==', and '!=' (e.g., "key1=value1,key2!=value2"). + schema: + type: string + - name: limit + in: query + description: 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. + required: false + schema: + type: integer + format: int32 + minimum: 0 + maximum: 1000 + - name: summaryOnly + in: query + description: 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. + required: false + schema: + type: boolean + - name: cveId + in: query + description: Filter devices by CVE ID. Only returns devices whose OS image digest has the specified vulnerability. Must be a MITRE-style identifier (CVE-YYYY-sequence, e.g. CVE-2024-12345). + required: false + schema: + type: string + pattern: ^CVE-[0-9]{4}-[0-9]{4,}$ + maxLength: 64 + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceList' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + post: + tags: + - device + description: Create a Device resource. + operationId: createDevice + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Device' + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/Device' + links: + GetDevice: + operationId: getDevice + parameters: + name: $response.body#/metadata/name + DeleteDevice: + operationId: deleteDevice + parameters: + name: $response.body#/metadata/name + ReplaceDevice: + operationId: replaceDevice + parameters: + name: $response.body#/metadata/name + GetDeviceStatus: + operationId: getDeviceStatus + parameters: + name: $response.body#/metadata/name + ReplaceDeviceStatus: + operationId: replaceDeviceStatus + parameters: + name: $response.body#/metadata/name + GetRenderedDevice: + operationId: getRenderedDevice + parameters: + name: $response.body#/metadata/name + GetDeviceLastSeen: + operationId: getDeviceLastSeen + parameters: + name: $response.body#/metadata/name + DecommissionDevice: + operationId: decommissionDevice + parameters: + name: $response.body#/metadata/name + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '409': + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /devices/{name}: + x-resource: devices + get: + tags: + - device + description: Get a Device resource. + operationId: getDevice + parameters: + - name: name + in: path + description: The name of the Device resource to get. + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Device' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + put: + tags: + - device + description: Update a Device resource. + operationId: replaceDevice + parameters: + - name: name + in: path + description: The name of the Device resource to update. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Device' + required: true + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Device' + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/Device' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '409': + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + delete: + tags: + - device + description: Delete a Device resource. + operationId: deleteDevice + parameters: + - name: name + in: path + description: The name of the Device resource to delete. + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + patch: + tags: + - device + description: Patch a Device resource. + operationId: patchDevice + parameters: + - name: name + in: path + description: The name of the Device resource to patch. + required: true + schema: + type: string + requestBody: + content: + application/json-patch+json: + schema: + $ref: '#/components/schemas/PatchRequest' + required: true + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Device' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '409': + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /devices/{name}/status: + x-resource: devices/status + get: + tags: + - device + description: Get the status of a Device resource. + operationId: getDeviceStatus + parameters: + - name: name + in: path + description: The name of the Device resource to get. + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Device' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + patch: + tags: + - device + description: Patch the status of a Device resource. + operationId: patchDeviceStatus + parameters: + - name: name + in: path + description: The name of the Device resource to patch. + required: true + schema: + type: string + requestBody: + content: + application/json-patch+json: + schema: + $ref: '#/components/schemas/PatchRequest' + required: true + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Device' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + put: + tags: + - device + description: Update the status of a Device resource. + operationId: replaceDeviceStatus + parameters: + - name: name + in: path + description: The name of the Device resource to update. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Device' + required: true + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Device' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '409': + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /devices/{name}/decommission: + x-resource: devices/decommission + put: + tags: + - device + description: schedule the device to decommission + operationId: decommissionDevice + parameters: + - name: name + in: path + description: The name of the Device resource to decommission. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceDecommission' + required: true + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Device' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '409': + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /devices/{name}/applications/{appname}/actions/stop: + x-resource: devices/applications/lifecycle + post: + tags: + - device + description: | + Stop an application on this device. Sets a device-level lifecycle override (independent of the application's declarative spec, fleet template or standalone device) that is applied on top of the rendered application spec at render time and survives fleet template rollouts, since it is never stored as part of the device's spec. + operationId: stopDeviceApplication + x-rbac: + resource: devices/applications/lifecycle + action: update + parameters: + - name: name + in: path + description: The name of the Device resource. + required: true + schema: + type: string + - name: appname + in: path + description: The name of the application, as defined in the device's rendered application spec. + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Device' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '409': + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /devices/{name}/applications/{appname}/actions/start: + x-resource: devices/applications/lifecycle + post: + tags: + - device + description: | + Start an application on this device. Sets a device-level lifecycle override (independent of the application's declarative spec, fleet template or standalone device) that is applied on top of the rendered application spec at render time and survives fleet template rollouts, since it is never stored as part of the device's spec. If the application is also owned by a fleet with its own stop/start default for this application, whichever of the two actions was issued most recently takes effect. + operationId: startDeviceApplication + x-rbac: + resource: devices/applications/lifecycle + action: update + parameters: + - name: name + in: path + description: The name of the Device resource. + required: true + schema: + type: string + - name: appname + in: path + description: The name of the application, as defined in the device's rendered application spec. + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Device' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '409': + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /devices/{name}/applications/{appname}/actions/restart: + x-resource: devices/applications/lifecycle + post: + tags: + - device + description: | + Restart an application on this device. Sets a device-level restartGeneration override (independent of the application's declarative spec, fleet template or standalone device); the control plane computes the next generation, and the agent restarts the application using the type-appropriate restart operation when it observes the change. The override is applied on top of the rendered application spec at render time and survives fleet template rollouts, since it is never stored as part of the device's spec. Only meaningful while the application's desired state is "running". + operationId: restartDeviceApplication + x-rbac: + resource: devices/applications/lifecycle + action: update + parameters: + - name: name + in: path + description: The name of the Device resource. + required: true + schema: + type: string + - name: appname + in: path + description: The name of the application, as defined in the device's rendered application spec. + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Device' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '409': + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /devices/{name}/rendered: + x-resource: devices/rendered + get: + tags: + - device + description: Get the rendered device. + operationId: getRenderedDevice + parameters: + - name: name + in: path + description: The name of the Device resource to get the rendered device specification for. + required: true + schema: + type: string + - name: knownRenderedVersion + in: query + description: The last known renderedVersion. + required: false + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Device' + '204': + description: No Content + content: {} + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '409': + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /devices/{name}/lastseen: + x-resource: devices/lastseen + get: + tags: + - device + description: Get the last seen timestamp of the Device resource. + operationId: getDeviceLastSeen + parameters: + - name: name + in: path + description: The name of the Device resource to get the last seen timestamp for. + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceLastSeen' + '204': + description: No Content + content: {} + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /ws/v1/devices/{name}/console: + x-resource: devices/console + get: + tags: + - device + description: Open a WebSocket console session to the Device. + operationId: getDeviceConsole + x-rbac: + resource: devices/console + action: get + parameters: + - name: name + in: path + description: The name of the Device resource. + required: true + schema: + type: string + responses: + '101': + description: Switching Protocols + '400': + description: Bad Request + '401': + description: Unauthorized + '403': + description: Forbidden + '404': + description: Not Found + '429': + description: Too Many Requests + '500': + description: Internal Server Error + '504': + description: Gateway Timeout + /ws/v1/devices/{name}/applications/{appname}/console: + x-resource: devices/applications/console + get: + tags: + - device + description: Open a WebSocket console session to an application running on the Device. + operationId: getDeviceApplicationConsole + x-rbac: + resource: devices/applications/console + action: get + parameters: + - name: name + in: path + description: The name of the Device resource. + required: true + schema: + type: string + - name: appname + in: path + description: The name of the application to connect to. + required: true + schema: + type: string + - name: consoleType + in: query + required: true + description: The type of console session to open. "serial" opens a text terminal; "vnc" opens a VNC proxy tunnel. + schema: + type: string + enum: + - serial + - vnc + x-enum-varnames: + - ConsoleTypeSerial + - ConsoleTypeVnc + - name: force + in: query + required: false + description: If true, take over an already-active console session of the same type for this application instead of failing with a 409 Conflict. The replaced session is disconnected and told why. + schema: + type: boolean + default: false + responses: + '101': + description: Switching Protocols + '400': + description: Bad Request + '401': + description: Unauthorized + '403': + description: Forbidden + '404': + description: Not Found + '409': + description: Conflict + '429': + description: Too Many Requests + '500': + description: Internal Server Error + '504': + description: Gateway Timeout + /deviceactions/resume: + x-resource: devices/resume + post: + tags: + - deviceactions + description: Resume devices based on label selector and/or field selector. + operationId: resumeDevices + x-rbac: + resource: devices/resume + action: update + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceResumeRequest' + required: true + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceResumeResponse' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /enrollmentconfig: + x-resource: enrollmentconfig + get: + tags: + - enrollmentrequest + description: Get enrollment information. + operationId: getEnrollmentConfig + parameters: + - name: csr + in: query + description: The name of a CertificateSigningRequest resource to query for an issued certificate. If provided, the service will check if the CertificateSigningRequest contains an issued certificate and in this case include it the returned EnrollmentConfig. In all other case, the enrollment certificate field will be empty. + required: false + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/EnrollmentConfig' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /enrollmentrequests: + x-resource: enrollmentrequests + get: + tags: + - enrollmentrequest + description: List EnrollmentRequest resources. + operationId: listEnrollmentRequests + parameters: + - name: continue + in: query + description: 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. + required: false + schema: + type: string + - name: labelSelector + in: query + description: A selector to restrict the list of returned objects by their labels. Defaults to everything. + schema: + type: string + - name: fieldSelector + in: query + description: A selector to restrict the list of returned objects by their fields, supporting operators like '=', '==', and '!=' (e.g., "key1=value1,key2!=value2"). + schema: + type: string + - name: limit + in: query + description: 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. + required: false + schema: + type: integer + format: int32 + minimum: 0 + maximum: 1000 + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/EnrollmentRequestList' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + post: + tags: + - enrollmentrequest + description: Create an EnrollmentRequest resource. + operationId: createEnrollmentRequest + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EnrollmentRequest' + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/EnrollmentRequest' + links: + GetEnrollmentRequest: + operationId: getEnrollmentRequest + parameters: + name: $response.body#/metadata/name + DeleteEnrollmentRequest: + operationId: deleteEnrollmentRequest + parameters: + name: $response.body#/metadata/name + GetEnrollmentRequestStatus: + operationId: getEnrollmentRequestStatus + parameters: + name: $response.body#/metadata/name + ApproveEnrollmentRequest: + operationId: approveEnrollmentRequest + parameters: + name: $response.body#/metadata/name + ReplaceEnrollmentRequest: + operationId: replaceEnrollmentRequest + parameters: + name: $response.body#/metadata/name + ReplaceEnrollmentRequestStatus: + operationId: replaceEnrollmentRequestStatus + parameters: + name: $response.body#/metadata/name + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '409': + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /enrollmentrequests/{name}: + x-resource: enrollmentrequests + get: + tags: + - enrollmentrequest + description: Get an EnrollmentRequest resource. + operationId: getEnrollmentRequest + parameters: + - name: name + in: path + description: The name of the EnrollmentRequest resource to get. + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/EnrollmentRequest' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + put: + tags: + - enrollmentrequest + description: Update an EnrollmentRequest resource. + operationId: replaceEnrollmentRequest + parameters: + - name: name + in: path + description: The name of the EnrollmentRequest resource to update. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EnrollmentRequest' + required: true + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/EnrollmentRequest' + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/EnrollmentRequest' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '409': + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + patch: + tags: + - enrollmentrequest + description: Patch an EnrollmentRequest resource. + operationId: patchEnrollmentRequest + parameters: + - name: name + in: path + description: The name of the EnrollmentRequest resource to patch. + required: true + schema: + type: string + requestBody: + content: + application/json-patch+json: + schema: + $ref: '#/components/schemas/PatchRequest' + required: true + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/EnrollmentRequest' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '409': + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + delete: + tags: + - enrollmentrequest + description: Delete an EnrollmentRequest resource. + operationId: deleteEnrollmentRequest + parameters: + - name: name + in: path + description: The name of the EnrollmentRequest resource to delete. + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '409': + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /enrollmentrequests/{name}/status: + x-resource: enrollmentrequests/status + get: + tags: + - enrollmentrequest + description: Get the status of an EnrollmentRequest resource. + operationId: getEnrollmentRequestStatus + parameters: + - name: name + in: path + description: The name of the EnrollmentRequest resource to get. + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/EnrollmentRequest' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + put: + tags: + - enrollmentrequest + description: Update the status of an EnrollmentRequest resource. + operationId: replaceEnrollmentRequestStatus + parameters: + - name: name + in: path + description: The name of the EnrollmentRequest resource to update. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EnrollmentRequest' + required: true + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/EnrollmentRequest' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + patch: + tags: + - enrollmentrequest + description: Patch the status of an EnrollmentRequest resource. + operationId: patchEnrollmentRequestStatus + parameters: + - name: name + in: path + description: The name of the EnrollmentRequest resource to patch. + required: true + schema: + type: string + requestBody: + content: + application/json-patch+json: + schema: + $ref: '#/components/schemas/PatchRequest' + required: true + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/EnrollmentRequest' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '409': + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /enrollmentrequests/{name}/approval: + x-resource: enrollmentrequests/approval + put: + tags: + - enrollmentrequest + description: Approve or deny an EnrollmentRequest. + operationId: approveEnrollmentRequest + parameters: + - name: name + in: path + description: The name of the EnrollmentRequest to approve or deny. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EnrollmentRequestApproval' + required: true + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/EnrollmentRequestApprovalStatus' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /certificatesigningrequests: + x-resource: certificatesigningrequests + get: + tags: + - certificatesigningrequest + description: List CertificateSigningRequest resources. + operationId: listCertificateSigningRequests + parameters: + - name: continue + in: query + description: 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. + required: false + schema: + type: string + - name: labelSelector + in: query + description: A selector to restrict the list of returned objects by their labels. Defaults to everything. + schema: + type: string + - name: fieldSelector + in: query + description: A selector to restrict the list of returned objects by their fields, supporting operators like '=', '==', and '!=' (e.g., "key1=value1,key2!=value2"). + schema: + type: string + - name: limit + in: query + description: 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. + required: false + schema: + type: integer + format: int32 + minimum: 0 + maximum: 1000 + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/CertificateSigningRequestList' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + post: + tags: + - certificatesigningrequest + description: Create a CertificateSigningRequest resource. + operationId: createCertificateSigningRequest + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CertificateSigningRequest' + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/CertificateSigningRequest' + links: + GetCertificateSigningRequest: + operationId: getCertificateSigningRequest + parameters: + name: $response.body#/metadata/name + DeleteCertificateSigningRequest: + operationId: deleteCertificateSigningRequest + parameters: + name: $response.body#/metadata/name + UpdateCertificateSigningRequestApproval: + operationId: updateCertificateSigningRequestApproval + parameters: + name: $response.body#/metadata/name + ReplaceCertificateSigningRequest: + operationId: replaceCertificateSigningRequest + parameters: + name: $response.body#/metadata/name + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '409': + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /certificatesigningrequests/{name}: + x-resource: certificatesigningrequests + patch: + tags: + - certificatesigningrequest + description: Patch a CertificateSigningRequest resource. + operationId: patchCertificateSigningRequest + parameters: + - name: name + in: path + description: The name of the CertificateSigningRequest resource to patch. + required: true + schema: + type: string + requestBody: + content: + application/json-patch+json: + schema: + $ref: '#/components/schemas/PatchRequest' + required: true + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/CertificateSigningRequest' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '409': + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + get: + tags: + - certificatesigningrequest + description: read the specified certificateSigningRequest + operationId: getCertificateSigningRequest + parameters: + - name: name + in: path + description: The name of the CertificateSigningRequest resource to get. + required: true + schema: + type: string + uniqueItems: true + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/CertificateSigningRequest' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + put: + tags: + - certificatesigningrequest + description: replace the specified CertificateSigningRequest + operationId: replaceCertificateSigningRequest + parameters: + - name: name + in: path + description: The name of the CertificateSigningRequest resource to update. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CertificateSigningRequest' + required: true + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/CertificateSigningRequest' + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/CertificateSigningRequest' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '409': + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + delete: + tags: + - certificatesigningrequest + description: delete a Certificate Signing Request + operationId: deleteCertificateSigningRequest + parameters: + - name: name + in: path + description: The name of the CertificateSigningRequest resource to delete. + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /certificatesigningrequests/{name}/approval: + x-resource: certificatesigningrequests/approval + put: + tags: + - certificatesigningrequest + description: Approve or deny a CertificateSigningRequest. + operationId: updateCertificateSigningRequestApproval + parameters: + - name: name + in: path + description: The name of the CertificateSigningRequest to approve or deny. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CertificateSigningRequest' + required: true + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/CertificateSigningRequest' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '409': + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /fleets: + x-resource: fleets + get: + tags: + - fleet + description: List Fleet resources. + operationId: listFleets + parameters: + - name: continue + in: query + description: 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. + required: false + schema: + type: string + - name: labelSelector + in: query + description: A selector to restrict the list of returned objects by their labels. Defaults to everything. + schema: + type: string + - name: fieldSelector + in: query + description: A selector to restrict the list of returned objects by their fields, supporting operators like '=', '==', and '!=' (e.g., "key1=value1,key2!=value2"). + schema: + type: string + - name: limit + in: query + description: 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. + required: false + schema: + type: integer + format: int32 + minimum: 0 + maximum: 1000 + - name: addDevicesSummary + in: query + description: Include a summary of the devices in the fleet. + required: false + schema: + type: boolean + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/FleetList' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + post: + tags: + - fleet + description: Create a Fleet resource. + operationId: createFleet + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Fleet' + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/Fleet' + links: + GetFleet: + operationId: getFleet + parameters: + name: $response.body#/metadata/name + DeleteFleet: + operationId: deleteFleet + parameters: + name: $response.body#/metadata/name + ListTemplateVersions: + operationId: listTemplateVersions + parameters: + fleet: $response.body#/metadata/name + ReplaceFleet: + operationId: replaceFleet + parameters: + name: $response.body#/metadata/name + GetFleetStatus: + operationId: getFleetStatus + parameters: + name: $response.body#/metadata/name + ReplaceFleetStatus: + operationId: replaceFleetStatus + parameters: + name: $response.body#/metadata/name + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '409': + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /fleets/{name}: + x-resource: fleets + get: + tags: + - fleet + description: Get a Fleet resource. + operationId: getFleet + parameters: + - name: name + in: path + description: The name of the Fleet resource to get. + required: true + schema: + type: string + - name: addDevicesSummary + in: query + description: Include a summary of the devices in the fleet. + required: false + schema: + type: boolean + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Fleet' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + put: + tags: + - fleet + description: Update a Fleet resource. + operationId: replaceFleet + parameters: + - name: name + in: path + description: The name of the Fleet resource to update. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Fleet' + required: true + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Fleet' + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/Fleet' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '409': + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + patch: + tags: + - fleet + description: Patch a Fleet resource. + operationId: patchFleet + parameters: + - name: name + in: path + description: The name of the Fleet resource to patch. + required: true + schema: + type: string + requestBody: + content: + application/json-patch+json: + schema: + $ref: '#/components/schemas/PatchRequest' + required: true + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Fleet' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '409': + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + delete: + tags: + - fleet + description: Delete a Fleet resource. + operationId: deleteFleet + parameters: + - name: name + in: path + description: The name of the Fleet resource to delete. + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /fleets/{name}/status: + x-resource: fleets/status + get: + tags: + - fleet + description: read status of the specified Fleet + operationId: getFleetStatus + parameters: + - name: name + in: path + description: The name of the Fleet resource to get. + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Fleet' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + patch: + tags: + - fleet + description: Patch the status of a Fleet resource. + operationId: patchFleetStatus + parameters: + - name: name + in: path + description: The name of the Fleet resource to patch. + required: true + schema: + type: string + requestBody: + content: + application/json-patch+json: + schema: + $ref: '#/components/schemas/PatchRequest' + required: true + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Fleet' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + put: + tags: + - fleet + description: replace status of the specified Fleet + operationId: replaceFleetStatus + parameters: + - name: name + in: path + description: The name of the Fleet resource to update. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Fleet' + required: true + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Fleet' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /fleets/{name}/applications/{appname}/actions/stop: + x-resource: fleets/applications/lifecycle + post: + tags: + - fleet + description: | + Stop an application across every device currently owned by this fleet. Sets a fleet-level lifecycle default (independent of the application's declarative spec) that is applied on top of the rendered application spec of each member device at render time, and is automatically inherited by devices that join the fleet later. If a specific device also has its own override for this application (see /devices/{name}/applications/{appname}/actions/stop or .../start), whichever of the two actions was issued most recently takes effect for that device. + operationId: stopFleetApplication + x-rbac: + resource: fleets/applications/lifecycle + action: update + parameters: + - name: name + in: path + description: The name of the Fleet resource. + required: true + schema: + type: string + - name: appname + in: path + description: The name of the application, as defined in the fleet's device template. + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Fleet' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '409': + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /fleets/{name}/applications/{appname}/actions/start: + x-resource: fleets/applications/lifecycle + post: + tags: + - fleet + description: | + Start an application across every device currently owned by this fleet. Sets a fleet-level lifecycle default (independent of the application's declarative spec) that is applied on top of the rendered application spec of each member device at render time, and is automatically inherited by devices that join the fleet later. If a specific device also has its own override for this application (see /devices/{name}/applications/{appname}/actions/stop or .../start), whichever of the two actions was issued most recently takes effect for that device. + operationId: startFleetApplication + x-rbac: + resource: fleets/applications/lifecycle + action: update + parameters: + - name: name + in: path + description: The name of the Fleet resource. + required: true + schema: + type: string + - name: appname + in: path + description: The name of the application, as defined in the fleet's device template. + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Fleet' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '409': + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /fleets/{fleet}/templateversions: + x-resource: fleets/templateversions + get: + tags: + - fleet + description: list template versions + operationId: listTemplateVersions + parameters: + - name: fleet + in: path + description: The owner of the template versions. + required: true + schema: + type: string + - name: continue + in: query + description: 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. + required: false + schema: + type: string + - name: labelSelector + in: query + description: A selector to restrict the list of returned objects by their labels. Defaults to everything. + schema: + type: string + - name: fieldSelector + in: query + description: A selector to restrict the list of returned objects by their fields, supporting operators like '=', '==', and '!=' (e.g., "key1=value1,key2!=value2"). + schema: + type: string + - name: limit + in: query + description: 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. + required: false + schema: + type: integer + format: int32 + minimum: 0 + maximum: 1000 + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/TemplateVersionList' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /fleets/{fleet}/templateversions/{name}: + x-resource: fleets/templateversions + get: + tags: + - fleet + description: read the specified template version + operationId: getTemplateVersion + parameters: + - name: fleet + in: path + description: The owner of the template version. + required: true + schema: + type: string + - name: name + in: path + description: The name of the template version. + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/TemplateVersion' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + delete: + tags: + - fleet + description: delete a template version + operationId: deleteTemplateVersion + parameters: + - name: fleet + in: path + description: The owner of the template version. + required: true + schema: + type: string + - name: name + in: path + description: The name of the template version. + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /labels: + x-resource: labels + get: + tags: + - label + description: | + Retrieves a distinct list of labels for the specified resource type. + operationId: listLabels + parameters: + - name: kind + in: query + description: The type of resource to retrieve labels from. + required: true + schema: + type: string + enum: + - Device + - name: labelSelector + in: query + description: A filter to retrieve labels only from resources that match the given label selector. + schema: + type: string + - name: fieldSelector + in: query + description: A filter to retrieve labels only from resources that match the given field selector. + schema: + type: string + - name: limit + in: query + description: The maximum number of distinct labels to return in the response. + required: false + schema: + type: integer + format: int32 + minimum: 0 + maximum: 1000 + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/LabelList' + examples: + labelsExample: + summary: Example response for labels + value: + - environment=production + - region=us-east-1 + - tier=backend + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /events: + x-resource: events + get: + tags: + - event + description: | + Retrieves a list of events. + operationId: listEvents + parameters: + - name: fieldSelector + in: query + description: A selector to restrict the list of returned objects by their fields, supporting operators like '=', '==', and '!=' (e.g., "key1=value1,key2!=value2"). + schema: + type: string + - name: order + in: query + description: Sort order for the results by timestamp. Defaults to 'desc' (newest first). + schema: + type: string + enum: + - asc + - desc + default: desc + - name: limit + in: query + description: The maximum number of events to return in the response. + schema: + type: integer + format: int32 + minimum: 0 + maximum: 1000 + - name: continue + in: query + description: 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. + required: false + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/EventList' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /organizations: + x-resource: organizations + get: + tags: + - organization + summary: List organizations + description: Retrieves a list of organizations. Only returns organizations that the user has access to. + operationId: listOrganizations + parameters: + - name: fieldSelector + in: query + description: A selector to restrict the list of returned objects by their fields, supporting operators like '=', '==', and '!=' (e.g., "key1=value1,key2!=value2"). + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/OrganizationList' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /authproviders: + x-resource: authproviders + get: + tags: + - authprovider + description: List AuthProvider resources. + operationId: listAuthProviders + parameters: + - name: continue + in: query + description: 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. + required: false + schema: + type: string + - name: labelSelector + in: query + description: A selector to restrict the list of returned objects by their labels. Defaults to everything. + schema: + type: string + - name: fieldSelector + in: query + description: A selector to restrict the list of returned objects by their fields, supporting operators like '=', '==', and '!=' (e.g., "key1=value1,key2!=value2"). + schema: + type: string + - name: limit + in: query + description: 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. + required: false + schema: + type: integer + format: int32 + minimum: 0 + maximum: 1000 + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AuthProviderList' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + post: + tags: + - authprovider + description: Create an AuthProvider resource. + operationId: createAuthProvider + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AuthProvider' + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/AuthProvider' + links: + GetAuthProvider: + operationId: getAuthProvider + parameters: + name: $response.body#/metadata/name + DeleteAuthProvider: + operationId: deleteAuthProvider + parameters: + name: $response.body#/metadata/name + ReplaceAuthProvider: + operationId: replaceAuthProvider + parameters: + name: $response.body#/metadata/name + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '409': + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /authproviders/{name}: + x-resource: authproviders + get: + tags: + - authprovider + description: Get an AuthProvider resource. + operationId: getAuthProvider + parameters: + - name: name + in: path + description: The name of the AuthProvider resource to get. + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AuthProvider' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + put: + tags: + - authprovider + description: Update an AuthProvider resource. + operationId: replaceAuthProvider + parameters: + - name: name + in: path + description: The name of the AuthProvider resource to update. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AuthProvider' + required: true + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AuthProvider' + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/AuthProvider' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '409': + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + patch: + tags: + - authprovider + description: Patch an AuthProvider resource. + operationId: patchAuthProvider + parameters: + - name: name + in: path + description: The name of the AuthProvider resource to patch. + required: true + schema: + type: string + requestBody: + content: + application/json-patch+json: + schema: + $ref: '#/components/schemas/PatchRequest' + required: true + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AuthProvider' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '409': + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + delete: + tags: + - authprovider + description: Delete an AuthProvider resource. + operationId: deleteAuthProvider + parameters: + - name: name + in: path + description: The name of the AuthProvider resource to delete. + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' +components: + securitySchemes: + bearerAuth: + type: http + scheme: bearer + bearerFormat: JWT + orgId: + type: apiKey + in: query + name: org_id + description: The UUID of the organization that owns the resource. Maps to an organizations metadata.name. + schemas: + ApiVersion: + type: string + x-go-type: string + description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources.' + enum: + - v1beta1 + - flightctl.io/v1beta1 + - '' + x-enum-varnames: + - ApiVersionV1beta1 + - ApiVersionFlightctlIoV1beta1 + - ApiVersionEmpty + ResourceKind: + type: string + enum: + - CertificateSigningRequest + - EnrollmentRequest + - Device + - Fleet + - Repository + - ResourceSync + - TemplateVersion + - AuthProvider + description: Resource types exposed via the API. + DeviceDecommissionTargetType: + type: string + enum: + - Unenroll + - FactoryReset + x-enum-varnames: + - DeviceDecommissionTargetTypeUnenroll + - DeviceDecommissionTargetTypeFactoryReset + description: Specifies the desired decommissioning method of the device. + DeviceDecommission: + type: object + properties: + target: + $ref: '#/components/schemas/DeviceDecommissionTargetType' + required: + - target + description: Metadata about a device decommissioning request. + DeviceResumeRequest: + type: object + additionalProperties: false + properties: + labelSelector: + type: string + description: A selector to restrict the list of devices to resume by their labels. Uses the same format as Kubernetes label selectors (e.g., "key1=value1,key2!=value2"). + fieldSelector: + type: string + description: A selector to restrict the list of devices to resume by their fields. Uses the same format as Kubernetes field selectors (e.g., "metadata.name=device1,status.phase!=Pending"). + anyOf: + - required: + - labelSelector + - required: + - fieldSelector + description: Request to resume devices based on label selector and/or field selector. At least one selector must be provided. + example: + labelSelector: environment=production,tier=frontend + DeviceResumeResponse: + type: object + additionalProperties: false + required: + - resumedDevices + properties: + resumedDevices: + type: integer + description: Number of devices that were successfully resumed. + description: Response from resuming devices. + example: + resumedDevices: 3 + PatchRequest: + type: array + items: + type: object + additionalProperties: false + required: + - op + - path + properties: + path: + description: A JSON Pointer path. + type: string + value: + description: The value to add or replace. + op: + description: The operation to perform. + type: string + enum: + - add + - replace + - remove + - test + Repository: + type: object + properties: + apiVersion: + $ref: '#/components/schemas/ApiVersion' + kind: + type: string + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds.' + metadata: + $ref: '#/components/schemas/ObjectMeta' + spec: + $ref: '#/components/schemas/RepositorySpec' + status: + $ref: '#/components/schemas/RepositoryStatus' + required: + - apiVersion + - kind + - metadata + - spec + description: Repository represents a Git repository or an HTTP endpoint. + example: + apiVersion: flightctl.io/v1beta1 + kind: Repository + metadata: + name: example-repo + spec: + type: oci + registry: quay.io + accessMode: ReadWrite + status: + conditions: [] + HttpConfig: + type: object + description: Configuration for HTTP transport. + additionalProperties: false + properties: + username: + type: string + description: The username for auth with HTTP transport. + password: + type: string + description: The password for auth with HTTP transport. + format: password + tls.crt: + type: string + description: Base64 encoded TLS cert data. + format: password + tls.key: + type: string + description: Base64 encoded TLS cert key. + format: password + ca.crt: + type: string + description: Base64 encoded root CA. + skipServerVerification: + type: boolean + description: Skip remote server verification. + token: + type: string + description: The token for auth with HTTP transport. + format: password + HttpRepoSpec: + type: object + description: HTTP endpoint specification for fetching configuration. + additionalProperties: false + properties: + url: + type: string + minLength: 1 + example: https://example.com/config + description: The HTTP URL to call. + type: + type: string + description: The repository type discriminator. + enum: + - http + x-enum-varnames: + - HttpRepoSpecTypeHttp + httpConfig: + $ref: '#/components/schemas/HttpConfig' + validationSuffix: + type: string + description: URL suffix used only for validating access to the repository. Users might use the URL field as a root URL to be used by config sources adding suffixes. This will help with the validation of the http endpoint. + required: + - url + - type + SshConfig: + type: object + description: Configuration for SSH transport. + additionalProperties: false + properties: + sshPrivateKey: + type: string + description: Base64 encoded private SSH key. + format: password + privateKeyPassphrase: + type: string + description: The passphrase for sshPrivateKey. + format: password + skipServerVerification: + type: boolean + description: Skip remote server verification. + GitRepoSpec: + type: object + description: Git repository specification. Supports no auth (public repos), HTTP/HTTPS auth, or SSH auth. + additionalProperties: false + properties: + url: + type: string + minLength: 1 + example: https://github.com/example/repo.git + description: The Git repository URL to clone from. + type: + type: string + description: The repository type discriminator. + enum: + - git + x-enum-varnames: + - GitRepoSpecTypeGit + httpConfig: + $ref: '#/components/schemas/HttpConfig' + sshConfig: + $ref: '#/components/schemas/SshConfig' + required: + - url + - type + not: + required: + - httpConfig + - sshConfig + OciAuthType: + type: string + description: The type of authentication for OCI registries. + enum: + - docker + DockerAuth: + type: object + description: Docker-style authentication for OCI registries. + additionalProperties: false + properties: + authType: + $ref: '#/components/schemas/OciAuthType' + username: + type: string + description: The username for registry authentication. + password: + type: string + description: The password or token for registry authentication. + format: password + required: + - authType + - username + - password + OciAuth: + type: object + description: Authentication for OCI registries. + discriminator: + propertyName: authType + mapping: + docker: '#/components/schemas/DockerAuth' + oneOf: + - $ref: '#/components/schemas/DockerAuth' + BaseImageEntry: + type: object + description: A curated base image entry available in an OCI registry. + properties: + displayName: + type: string + description: Human-readable label shown in the UI (e.g., "CentOS"). + imageName: + type: string + minLength: 1 + maxLength: 255 + description: Image path within the registry (e.g., "centos-bootc/centos-bootc"). + tags: + type: array + minItems: 1 + items: + type: string + minLength: 1 + maxLength: 128 + pattern: ^[\w][\w.-]{0,127}$ + description: Selectable tags for this image (e.g., ["stream9", "stream10"]). + required: + - imageName + - tags + additionalProperties: false + OciRepoSpec: + type: object + description: OCI container registry specification. + additionalProperties: false + properties: + registry: + type: string + description: The OCI registry hostname, FQDN, or IP address with optional port (e.g., quay.io, registry.redhat.io, myregistry.com:5000, 192.168.1.1:5000, [::1]:5000). + scheme: + type: string + description: URL scheme for connecting to the registry. + enum: + - http + - https + default: https + type: + type: string + description: The repository type discriminator. + enum: + - oci + x-enum-varnames: + - OciRepoSpecTypeOci + accessMode: + type: string + description: 'Access mode for the registry: "Read" for read-only (pull), "ReadWrite" for read-write (pull and push).' + enum: + - Read + - ReadWrite + default: Read + ociAuth: + $ref: '#/components/schemas/OciAuth' + ca.crt: + type: string + description: Base64 encoded root CA. + skipServerVerification: + type: boolean + description: Skip remote server verification. + baseImages: + type: array + description: Curated list of trusted base images available in this registry. When present, the Image Builder source picker surfaces these entries as selectable options. + items: + $ref: '#/components/schemas/BaseImageEntry' + required: + - registry + - type + RepositorySpec: + type: object + description: RepositorySpec describes a configuration repository. + oneOf: + - $ref: '#/components/schemas/GitRepoSpec' + - $ref: '#/components/schemas/HttpRepoSpec' + - $ref: '#/components/schemas/OciRepoSpec' + discriminator: + propertyName: type + mapping: + git: '#/components/schemas/GitRepoSpec' + http: '#/components/schemas/HttpRepoSpec' + oci: '#/components/schemas/OciRepoSpec' + RepositoryStatus: + type: object + description: RepositoryStatus represents information about the status of a repository. + properties: + conditions: + type: array + description: Current state of the repository. + items: + $ref: '#/components/schemas/Condition' + required: + - conditions + RepositoryList: + type: object + properties: + apiVersion: + $ref: '#/components/schemas/ApiVersion' + kind: + type: string + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds.' + metadata: + $ref: '#/components/schemas/ListMeta' + items: + type: array + description: List of repositories. + items: + $ref: '#/components/schemas/Repository' + description: RepositoryList is a list of Repositories. + required: + - apiVersion + - kind + - metadata + - items + RepoSpecType: + type: string + description: RepoSpecType is the type of the repository. + enum: + - git + - http + - oci + x-enum-varnames: + - RepoSpecTypeGit + - RepoSpecTypeHttp + - RepoSpecTypeOci + Device: + type: object + properties: + apiVersion: + $ref: '#/components/schemas/ApiVersion' + kind: + type: string + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds.' + metadata: + $ref: '#/components/schemas/ObjectMeta' + spec: + $ref: '#/components/schemas/DeviceSpec' + status: + $ref: '#/components/schemas/DeviceStatus' + required: + - apiVersion + - kind + - metadata + additionalProperties: false + description: Device represents a physical device. + example: + apiVersion: flightctl.io/v1beta1 + kind: Device + metadata: + name: f62dfb4f5d2cdbb9339362b5f18f2ce268d75649bdc80003f0e04292a7ef8c3 + labels: + fleet: default + DeviceConsole: + type: object + description: DeviceConsole represents the console connection information. + properties: + sessionMetadata: + type: string + description: Additional session metadata in the form of key=value pairs, can be used to initialize the type of terminal, console to be used, etc. + sessionID: + type: string + description: The session ID for the console connection. + required: + - sessionMetadata + - sessionID + readOnly: true + ConfigProviderSpec: + oneOf: + - $ref: '#/components/schemas/GitConfigProviderSpec' + - $ref: '#/components/schemas/KubernetesSecretProviderSpec' + - $ref: '#/components/schemas/InlineConfigProviderSpec' + - $ref: '#/components/schemas/HttpConfigProviderSpec' + GitConfigProviderSpec: + type: object + properties: + name: + type: string + description: The name of the config provider. + gitRef: + type: object + description: The reference to a Git configuration server. + properties: + repository: + type: string + description: The name of the Repository resource. + targetRevision: + type: string + description: The revision to use from the Repository. + path: + type: string + description: The path to the config in the Repository. + required: + - repository + - targetRevision + - path + required: + - name + - gitRef + KubernetesSecretProviderSpec: + type: object + properties: + name: + type: string + description: The name of the config provider. + secretRef: + type: object + description: The reference to a Kubernetes secret. + properties: + name: + type: string + description: The name of the secret. + namespace: + type: string + description: The namespace of the secret. + mountPath: + type: string + description: Path in the device's file system at which the secret should be mounted. + user: + type: string + description: The file's owner, specified either as a name or numeric ID. Defaults to "root". + x-go-type: Username + x-go-type-skip-optional-pointer: true + group: + type: string + description: The file's group, specified either as a name or numeric ID. Defaults to "root". + x-go-type-skip-optional-pointer: true + required: + - name + - namespace + - mountPath + required: + - name + - secretRef + InlineConfigProviderSpec: + type: object + properties: + name: + type: string + description: The name of the config provider. + inline: + type: array + description: A list of files to create on the device. + items: + $ref: '#/components/schemas/FileSpec' + required: + - name + - inline + FileSpec: + allOf: + - $ref: '#/components/schemas/FileContent' + - $ref: '#/components/schemas/FileMetadata' + - $ref: '#/components/schemas/AbsolutePath' + - type: object + required: + - path + - content + FileContent: + description: The content of a file. + type: object + properties: + content: + type: string + description: The plain text (UTF-8) or base64-encoded content of the file. + contentEncoding: + $ref: '#/components/schemas/EncodingType' + AbsolutePath: + type: object + description: Represents an absolute file path. + properties: + path: + type: string + description: The absolute path to a file on the system. Note that any existing file will be overwritten. + example: /var/log/app.log + RelativePath: + type: object + description: Represents a relative file path. + properties: + path: + type: string + description: A relative file path on the system. Note that any existing file will be overwritten. + example: src/index.js + EncodingType: + type: string + description: Specifies the encoding type used for data representation. + enum: + - plain + - base64 + x-enum-varnames: + - EncodingPlain + - EncodingBase64 + FileMetadata: + description: File metadata. + type: object + properties: + mode: + type: integer + description: The file's permission mode. You may specify the more familiar octal with a leading zero (e.g., 0644) or as a decimal without a leading zero (e.g., 420). Setuid/setgid/sticky bits are supported. If not specified, the permission mode for files defaults to 0644. + user: + type: string + description: The file's owner, specified either as a name or numeric ID. Defaults to "root". + x-go-type: Username + x-go-type-skip-optional-pointer: true + group: + type: string + description: The file's group, specified either as a name or numeric ID. Defaults to "root". + x-go-type-skip-optional-pointer: true + HttpConfigProviderSpec: + type: object + properties: + name: + type: string + description: The name of the config provider. + httpRef: + type: object + description: The reference to an HTTP configuration server. + properties: + repository: + type: string + description: The name of the repository resource to use as the sync source. + suffix: + type: string + description: 'Part of the URL that comes after the base URL. It can include query parameters such as: "/path/to/endpoint?query=param".' + filePath: + type: string + description: Path in the device's file system to which the content returned by the HTTP sever should be written. + required: + - repository + - filePath + required: + - name + - httpRef + ApplicationProviderSpec: + oneOf: + - $ref: '#/components/schemas/ComposeApplication' + - $ref: '#/components/schemas/QuadletApplication' + - $ref: '#/components/schemas/ContainerApplication' + - $ref: '#/components/schemas/HelmApplication' + - $ref: '#/components/schemas/VmApplication' + discriminator: + propertyName: appType + mapping: + compose: '#/components/schemas/ComposeApplication' + quadlet: '#/components/schemas/QuadletApplication' + container: '#/components/schemas/ContainerApplication' + helm: '#/components/schemas/HelmApplication' + vm: '#/components/schemas/VmApplication' + ApplicationDesiredState: + type: string + description: Desired lifecycle state for an application. + enum: + - running + - stopped + x-enum-varnames: + - ApplicationDesiredStateRunning + - ApplicationDesiredStateStopped + ApplicationProviderBase: + type: object + description: Common properties for all application types. + properties: + name: + type: string + description: The application name must be 1–253 characters long, start with a letter or number, and contain no whitespace. + appType: + $ref: '#/components/schemas/AppType' + annotations: + type: object + additionalProperties: + type: string + readOnly: true + description: Arbitrary metadata annotations. Used internally by the control plane (e.g., flightctl.io/workload-type) when transforming application types at render time. + desiredState: + allOf: + - $ref: '#/components/schemas/ApplicationDesiredState' + readOnly: true + description: 'Desired lifecycle state for this application, as most recently set by the stop/start device APIs. Read-only: cannot be set directly by apply; only present in the rendered application spec delivered to the agent.' + restartGeneration: + type: integer + readOnly: true + description: 'Counter incremented by the restart device API each time the application is restarted. Read-only: cannot be set directly by apply; only present in the rendered application spec delivered to the agent.' + required: + - appType + CatalogItemRefApplicationProviderSpec: + type: object + properties: + catalogItemRef: + $ref: '#/components/schemas/CatalogItemRefSpec' + required: + - catalogItemRef + ComposeApplication: + type: object + allOf: + - $ref: '#/components/schemas/ApplicationProviderBase' + - $ref: '#/components/schemas/ApplicationEnvVars' + - $ref: '#/components/schemas/ApplicationVolumeProviderSpec' + - oneOf: + - $ref: '#/components/schemas/ImageApplicationProviderSpec' + - $ref: '#/components/schemas/CatalogItemRefApplicationProviderSpec' + - $ref: '#/components/schemas/InlineApplicationProviderSpec' + QuadletApplication: + type: object + allOf: + - $ref: '#/components/schemas/ApplicationProviderBase' + - $ref: '#/components/schemas/ApplicationEnvVars' + - $ref: '#/components/schemas/ApplicationUser' + - $ref: '#/components/schemas/ApplicationVolumeProviderSpec' + - oneOf: + - $ref: '#/components/schemas/ImageApplicationProviderSpec' + - $ref: '#/components/schemas/CatalogItemRefApplicationProviderSpec' + - $ref: '#/components/schemas/InlineApplicationProviderSpec' + ContainerApplication: + type: object + allOf: + - $ref: '#/components/schemas/ApplicationProviderBase' + - $ref: '#/components/schemas/ApplicationEnvVars' + - $ref: '#/components/schemas/ApplicationUser' + - $ref: '#/components/schemas/ApplicationVolumeProviderSpec' + - oneOf: + - $ref: '#/components/schemas/ImageApplicationProviderSpec' + - $ref: '#/components/schemas/CatalogItemRefApplicationProviderSpec' + - type: object + properties: + ports: + type: array + description: Port mappings. + items: + $ref: '#/components/schemas/ApplicationPort' + resources: + $ref: '#/components/schemas/ApplicationResources' + HelmApplication: + type: object + allOf: + - $ref: '#/components/schemas/ApplicationProviderBase' + - oneOf: + - $ref: '#/components/schemas/ImageApplicationProviderSpec' + - $ref: '#/components/schemas/CatalogItemRefApplicationProviderSpec' + - type: object + properties: + namespace: + type: string + description: The target namespace for the application deployment. + example: my-app-namespace + values: + type: object + additionalProperties: true + description: Configuration values for the application. Supports arbitrarily nested structures. + example: + replicaCount: 3 + image: + repository: nginx + tag: '1.21' + service: + type: ClusterIP + port: 80 + ingress: + enabled: true + hosts: + - host: example.com + paths: + - path: / + pathType: Prefix + valuesFiles: + type: array + description: List of values files to apply during deployment. Files are relative paths and applied in array order before user-provided values. + items: + type: string + example: + - values-production.yaml + - values-overrides.yml + required: + - image + VmApplication: + type: object + description: A VM workload managed by the FlightCtl agent. The VM definition may be delivered either as an OCI image/artifact or as inline application content. For inline providers, the package must contain a KubeVirt VirtualMachine YAML file named vm.yaml. + allOf: + - $ref: '#/components/schemas/ApplicationProviderBase' + - type: object + properties: + publishPorts: + type: array + description: List of host-to-guest port mappings for the VM. Each entry must follow the format "hostPort:guestPort" or "hostPort:guestPort/protocol" (e.g. "8080:80" or "8080:80/tcp"). + items: + type: string + pattern: ^[0-9]+:[0-9]+(/(tcp|udp|sctp))?$ + - oneOf: + - $ref: '#/components/schemas/ImageApplicationProviderSpec' + - $ref: '#/components/schemas/InlineApplicationProviderSpec' + ApplicationUser: + type: object + properties: + runAs: + type: string + description: The username of the system user this application should be run under. This is not the same as the user within any containers of the application (if applicable). Defaults to the user that the agent runs as (generally root) if not specified. + x-go-type: Username + x-go-type-skip-optional-pointer: true + ContainerApplicationProperties: + type: object + description: Properties for container application deployments. + properties: + ports: + type: array + description: Port mappings. + items: + $ref: '#/components/schemas/ApplicationPort' + resources: + $ref: '#/components/schemas/ApplicationResources' + ImageOrCatalogItemRefSpec: + description: Either a specific OCI image reference, or a reference to a catalog item version that can be resolved to an OCI image ref. + allOf: + - type: object + description: Reference to an OCI image or artifact with tag. + properties: + image: + type: string + description: Reference to an OCI image or artifact with tag. + x-go-type-skip-optional-pointer: true + - type: object + description: Reference to a catalog item version. + properties: + catalogItemRef: + $ref: '#/components/schemas/CatalogItemRefSpec' + ImageApplicationProviderSpec: + $ref: '#/components/schemas/ImageSpec' + InlineApplicationProviderSpec: + type: object + allOf: + - type: object + properties: + inline: + type: array + description: A list of application content. + items: + $ref: '#/components/schemas/ApplicationContent' + required: + - inline + ApplicationVolumeProviderSpec: + type: object + properties: + volumes: + type: array + description: List of application volumes. + items: + $ref: '#/components/schemas/ApplicationVolume' + ApplicationVolume: + allOf: + - type: object + description: Defines a named volume used by an application. + properties: + name: + type: string + description: Unique name of the volume used within the application. + reclaimPolicy: + $ref: '#/components/schemas/ApplicationVolumeReclaimPolicy' + required: + - name + - oneOf: + - $ref: '#/components/schemas/ImageVolumeProviderSpec' + - $ref: '#/components/schemas/MountVolumeProviderSpec' + - $ref: '#/components/schemas/ImageMountVolumeProviderSpec' + ApplicationVolumeReclaimPolicy: + type: string + description: Defines how the agent handles a volume when the owning application is removed. + default: Retain + enum: + - Retain + VolumeMount: + type: object + description: Mount configuration for a volume. + properties: + path: + type: string + description: Mount path in the container with support for options. + example: /etc/nginx/conf.d:ro + required: + - path + ImageVolumeProviderSpec: + type: object + properties: + image: + $ref: '#/components/schemas/ImageVolumeSource' + required: + - image + not: + required: + - mount + ImageVolumeSource: + type: object + description: Describes the source of an OCI-compliant image or artifact. Exactly one of 'reference' or 'catalogItemRef' must be specified. + properties: + reference: + type: string + description: Reference to an OCI-compliant image or artifact in a registry. This may be a container image or another type of OCI artifact, as long as it conforms to the OCI image specification. + x-go-type-skip-optional-pointer: true + catalogItemRef: + $ref: '#/components/schemas/CatalogItemRefSpec' + pullPolicy: + $ref: '#/components/schemas/ImagePullPolicy' + MountVolumeProviderSpec: + type: object + description: Named volume mount configuration. + properties: + mount: + $ref: '#/components/schemas/VolumeMount' + required: + - mount + not: + required: + - image + ImageMountVolumeProviderSpec: + type: object + description: Volume from OCI image mounted at specified path. + properties: + image: + $ref: '#/components/schemas/ImageVolumeSource' + mount: + $ref: '#/components/schemas/VolumeMount' + required: + - image + - mount + ApplicationContent: + allOf: + - $ref: '#/components/schemas/FileContent' + - $ref: '#/components/schemas/RelativePath' + - type: object + required: + - path + ApplicationEnvVars: + type: object + properties: + envVars: + type: object + description: Environment variable key-value pairs, injected during runtime. The key and value each must be between 1 and 253 characters. + additionalProperties: + type: string + ApplicationPort: + type: string + description: Port mapping in format "hostPort:containerPort" (e.g., "8080:80"). + pattern: ^\d+:\d+$ + example: 8080:80 + ApplicationResourceLimits: + type: object + description: Resource limits for the application. + properties: + cpu: + type: string + description: CPU limit in cores. Format restricted based on application type. + example: '0.75' + memory: + type: string + description: Memory limit with optional unit. Format restricted based on application type. + example: 256m + ApplicationResources: + type: object + description: Resource constraints for the application. + properties: + limits: + $ref: '#/components/schemas/ApplicationResourceLimits' + AppType: + type: string + description: The type of the application. + enum: + - compose + - quadlet + - container + - helm + - vm + x-enum-varnames: + - AppTypeCompose + - AppTypeQuadlet + - AppTypeContainer + - AppTypeHelm + - AppTypeVm + ResourceMonitor: + oneOf: + - $ref: '#/components/schemas/CpuResourceMonitorSpec' + - $ref: '#/components/schemas/MemoryResourceMonitorSpec' + - $ref: '#/components/schemas/DiskResourceMonitorSpec' + discriminator: + propertyName: monitorType + mapping: + CPU: '#/components/schemas/CpuResourceMonitorSpec' + Memory: '#/components/schemas/MemoryResourceMonitorSpec' + Disk: '#/components/schemas/DiskResourceMonitorSpec' + required: + - monitorType + ResourceMonitorSpec: + type: object + description: Specification for monitoring a resource. + properties: + alertRules: + type: array + items: + $ref: '#/components/schemas/ResourceAlertRule' + description: Array of alert rules. Only one alert per severity is allowed. + samplingInterval: + type: string + pattern: ^[1-9]\d*[smh]$ + description: 'Duration between monitor samples. Format: positive integer followed by ''s'' for seconds, ''m'' for minutes, ''h'' for hours.' + required: + - monitorType + - alertRules + - samplingInterval + CpuResourceMonitorSpec: + allOf: + - type: object + required: + - monitorType + properties: + monitorType: + type: string + description: The type of resource to monitor. + - $ref: '#/components/schemas/ResourceMonitorSpec' + MemoryResourceMonitorSpec: + allOf: + - type: object + required: + - monitorType + properties: + monitorType: + type: string + description: The type of resource to monitor. + - $ref: '#/components/schemas/ResourceMonitorSpec' + DiskResourceMonitorSpec: + allOf: + - $ref: '#/components/schemas/ResourceMonitorSpec' + - type: object + required: + - monitorType + properties: + monitorType: + type: string + description: The type of resource to monitor. + - type: object + description: Specification for monitoring disk usage. + required: + - path + properties: + path: + type: string + description: The directory path to monitor for disk usage. + ResourceAlertRule: + type: object + properties: + severity: + $ref: '#/components/schemas/ResourceAlertSeverityType' + duration: + type: string + pattern: ^\d+[smh]$ + description: 'Duration is the time over which the average usage is observed before alerting. Format: positive integer followed by ''s'' for seconds, ''m'' for minutes, ''h'' for hours.' + percentage: + type: number + description: The percentage of usage that triggers the alert. + description: + type: string + description: A human-readable description of the alert. + required: + - severity + - duration + - percentage + - description + ResourceAlertSeverityType: + type: string + description: Severity of the alert. + enum: + - Warning + - Critical + - Info + x-enum-varnames: + - ResourceAlertSeverityTypeWarning + - ResourceAlertSeverityTypeCritical + - ResourceAlertSeverityTypeInfo + DeviceLifecycleHookType: + type: string + enum: + - BeforeUpdating + - AfterUpdating + - BeforeRebooting + - AfterRebooting + x-enum-varnames: + - DeviceLifecycleHookBeforeUpdating + - DeviceLifecycleHookAfterUpdating + - DeviceLifecycleHookBeforeRebooting + - DeviceLifecycleHookAfterRebooting + HookAction: + allOf: + - type: object + properties: + if: + type: array + description: Conditions that must be met for the action to be executed. + items: + $ref: '#/components/schemas/HookCondition' + timeout: + type: string + pattern: ^(?:[1-9]\d*)?\d[smh]$ + description: The maximum duration allowed for the action to complete. The duration should be specified as a positive integer followed by a time unit. Supported time units are 's' for seconds, 'm' for minutes, and 'h' for hours. + - oneOf: + - $ref: '#/components/schemas/HookActionRun' + HookCondition: + type: object + oneOf: + - $ref: '#/components/schemas/HookConditionPathOp' + - $ref: '#/components/schemas/HookConditionExpression' + HookConditionPathOp: + type: object + properties: + path: + type: string + description: The absolute path to a file or directory that must have changed as condition for the action to be performed. + op: + type: array + description: The operation(s) on files at or below the path that satisfy the path condition. + items: + $ref: '#/components/schemas/FileOperation' + required: + - path + - op + FileOperation: + type: string + enum: + - created + - removed + - updated + x-enum-varnames: + - FileOperationCreated + - FileOperationRemoved + - FileOperationUpdated + HookConditionExpression: + type: string + description: An expression that must evaluate to true as condition for the action to be performed. + HookActionRun: + type: object + properties: + run: + type: string + description: The command to be executed, including any arguments using standard shell syntax. This field supports multiple commands piped together, as if they were executed under a bash -c context. + envVars: + type: object + description: Environment variable key-value pairs, injected during runtime. + additionalProperties: + type: string + workDir: + type: string + description: The working directory to be used when running the command. + required: + - run + DeviceUpdatePolicySpec: + type: object + description: Specifies the policy for managing device updates, including when updates should be downloaded and applied. + properties: + downloadSchedule: + $ref: '#/components/schemas/UpdateSchedule' + updateSchedule: + $ref: '#/components/schemas/UpdateSchedule' + UpdateSchedule: + type: object + description: Defines the schedule for automatic downloading and updates, including timing and optional timeout. + properties: + timeZone: + $ref: '#/components/schemas/TimeZone' + at: + $ref: '#/components/schemas/CronExpression' + startGraceDuration: + $ref: '#/components/schemas/Duration' + required: + - at + - startGraceDuration + TimeZone: + type: string + description: Time zone identifiers follow the IANA format AREA/LOCATION, where AREA represents a continent or ocean, and LOCATION specifies a particular site within that area, for example America/New_York, Europe/Paris. Only unambiguous 3-character time zones are supported ("GMT", "UTC"). + default: Local + CronExpression: + type: string + description: |- + Cron expression format for scheduling times. + The format is `* * * * *`: - Minutes: `*` matches 0-59. - Hours: `*` matches 0-23. - Day of Month: `*` matches 1-31. - Month: `*` matches 1-12. - Day of Week: `*` matches 0-6. + Supported operators: - `*`: Matches any value (e.g., `*` in hours matches every hour). - `-`: Range (e.g., `0-8` for 12 AM to 8 AM). - `,`: List (e.g., `1,12` for 1st and 12th minute). - `/`: Step (e.g., `*/12` for every 12th minute). - Single value (e.g., `8` matches the 8th minute). + Example: `* 0-8,16-23 * * *`. + ImagePullPolicy: + type: string + description: Optional. Defaults to 'IfNotPresent'. When set to 'Always', the image is pulled every time. When set to 'Never', the image must already exist on the device. + enum: + - Always + - IfNotPresent + - Never + x-enum-varnames: + - PullAlways + - PullIfNotPresent + - PullNever + default: IfNotPresent + DeviceList: + type: object + properties: + apiVersion: + $ref: '#/components/schemas/ApiVersion' + kind: + type: string + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds.' + metadata: + $ref: '#/components/schemas/ListMeta' + items: + type: array + description: List of Devices. + items: + $ref: '#/components/schemas/Device' + summary: + $ref: '#/components/schemas/DevicesSummary' + description: DeviceList is a list of Devices. + required: + - apiVersion + - kind + - metadata + - items + DeviceOsSpec: + $ref: '#/components/schemas/ImageOrCatalogItemRefSpec' + DeviceStatus: + type: object + description: DeviceStatus represents information about the status of a device. Status may trail the actual state of a device. + required: + - conditions + - systemInfo + - applications + - applicationsSummary + - resources + - integrity + - config + - os + - updated + - summary + - lifecycle + properties: + conditions: + type: array + description: Conditions represent the observations of a the current state of a device. + items: + $ref: '#/components/schemas/Condition' + systemInfo: + $ref: '#/components/schemas/DeviceSystemInfo' + systemd: + type: array + description: List of systemd unit statuses. + items: + $ref: '#/components/schemas/SystemdUnitStatus' + applications: + type: array + description: List of device application statuses. + items: + $ref: '#/components/schemas/DeviceApplicationStatus' + applicationsSummary: + $ref: '#/components/schemas/DeviceApplicationsSummaryStatus' + resources: + $ref: '#/components/schemas/DeviceResourceStatus' + integrity: + $ref: '#/components/schemas/DeviceIntegrityStatus' + config: + $ref: '#/components/schemas/DeviceConfigStatus' + os: + $ref: '#/components/schemas/DeviceOsStatus' + updated: + $ref: '#/components/schemas/DeviceUpdatedStatus' + summary: + $ref: '#/components/schemas/DeviceSummaryStatus' + lastSeen: + type: string + description: 'The last time the device was seen by the service (NOTE: this property is not returned by the API).' + format: date-time + x-go-json-ignore: true + lifecycle: + $ref: '#/components/schemas/DeviceLifecycleStatus' + dependencySync: + $ref: '#/components/schemas/DependencySyncStatus' + capabilities: + $ref: '#/components/schemas/DeviceCapabilities' + additionalProperties: false + DeviceLastSeen: + type: object + description: DeviceLastSeen represents the last seen timestamp of a device. + required: + - lastSeen + properties: + lastSeen: + type: string + description: The last time the device was seen by the service. + format: date-time + DeviceSystemInfo: + required: + - architecture + - bootID + - operatingSystem + - agentVersion + type: object + description: System information collected from the device. + properties: + architecture: + type: string + description: The Architecture reported by the device. + bootID: + type: string + description: Boot ID reported by the device. + operatingSystem: + type: string + description: The Operating System reported by the device. + agentVersion: + type: string + description: The Agent version. + customInfo: + $ref: '#/components/schemas/CustomDeviceInfo' + additionalProperties: + type: string + description: | + Optional system attributes exposed by the agent. + Each key corresponds to a configurable internal capability. + CustomDeviceInfo: + type: object + description: User-defined information about the device. + additionalProperties: + type: string + description: A user-defined custom property value. + SystemdUnitStatus: + type: object + required: + - unit + - description + - enableState + - loadState + - activeState + - subState + properties: + unit: + type: string + description: The unit name (e.g., "sshd.service"). + example: sshd.service + description: + type: string + description: The human-readable description for the unit. + maxLength: 2048 + example: OpenSSH server daemon + enableState: + $ref: '#/components/schemas/SystemdEnableStateType' + loadState: + $ref: '#/components/schemas/SystemdLoadStateType' + activeState: + $ref: '#/components/schemas/SystemdActiveStateType' + subState: + type: string + description: The low-level, unit-type-specific state. + maxLength: 64 + pattern: ^[a-z0-9-]+$ + example: running + SystemdEnableStateType: + type: string + description: The enable state of the unit file. + enum: + - enabled + - enabled-runtime + - linked + - linked-runtime + - alias + - masked + - masked-runtime + - static + - disabled + - indirect + - generated + - transient + - bad + - unknown + - '' + x-enum-varnames: + - SystemdEnableStateEnabled + - SystemdEnableStateEnabledRuntime + - SystemdEnableStateLinked + - SystemdEnableStateLinkedRuntime + - SystemdEnableStateAlias + - SystemdEnableStateMasked + - SystemdEnableStateMaskedRuntime + - SystemdEnableStateStatic + - SystemdEnableStateDisabled + - SystemdEnableStateIndirect + - SystemdEnableStateGenerated + - SystemdEnableStateTransient + - SystemdEnableStateBad + - SystemdEnableStateUnknown + - SystemdEnableStateEmpty + SystemdLoadStateType: + type: string + description: The load state of the unit file. + enum: + - stub + - loaded + - not-found + - bad-setting + - error + - merged + - masked + - unknown + x-enum-varnames: + - SystemdLoadStateStub + - SystemdLoadStateLoaded + - SystemdLoadStateNotFound + - SystemdLoadStateBadSetting + - SystemdLoadStateError + - SystemdLoadStateMerged + - SystemdLoadStateMasked + - SystemdLoadStateUnknown + SystemdActiveStateType: + type: string + description: The high-level unit activation state. + enum: + - active + - reloading + - inactive + - failed + - activating + - deactivating + - maintenance + - refreshing + - unknown + x-enum-varnames: + - SystemdActiveStateActive + - SystemdActiveStateReloading + - SystemdActiveStateInactive + - SystemdActiveStateFailed + - SystemdActiveStateActivating + - SystemdActiveStateDeactivating + - SystemdActiveStateMaintenance + - SystemdActiveStateRefreshing + - SystemdActiveStateUnknown + DeviceApplicationStatus: + type: object + required: + - name + - ready + - restarts + - status + - embedded + - appType + properties: + name: + type: string + description: Human readable name of the application. + ready: + type: string + description: The number of containers which are ready in the application. + restarts: + type: integer + description: Number of restarts observed for the application. + status: + $ref: '#/components/schemas/ApplicationStatusType' + embedded: + type: boolean + description: Whether the application is embedded in the bootc image. + appType: + $ref: '#/components/schemas/AppType' + runAs: + type: string + description: The username of the system user this application is runing under. If blank, the application is run as the same user as the agent (generally root). + x-go-type: Username + x-go-type-skip-optional-pointer: true + volumes: + type: array + description: Status of volumes used by this application. + items: + $ref: '#/components/schemas/ApplicationVolumeStatus' + ApplicationVolumeStatus: + type: object + description: Status of a volume used by an application. + required: + - name + - reference + properties: + name: + type: string + description: Name of the volume. + reference: + type: string + description: Reference to the deployed OCI-compliant image or artifact backing the volume. + DeviceApplicationsSummaryStatus: + type: object + description: A summary of the health of applications on the device. + required: + - status + properties: + status: + $ref: '#/components/schemas/ApplicationsSummaryStatusType' + info: + type: string + description: Human readable information detailing the last application transition. + ApplicationsSummaryStatusType: + type: string + description: Status of all applications on the device. + enum: + - Healthy + - Degraded + - Error + - Unknown + - NoApplications + x-enum-varnames: + - ApplicationsSummaryStatusHealthy + - ApplicationsSummaryStatusDegraded + - ApplicationsSummaryStatusError + - ApplicationsSummaryStatusUnknown + - ApplicationsSummaryStatusNoApplications + ApplicationStatusType: + type: string + description: Status of a single application on the device. + enum: + - Preparing + - Starting + - Running + - Error + - Unknown + - Completed + - Stopped + - Stopping + x-enum-varnames: + - ApplicationStatusPreparing + - ApplicationStatusStarting + - ApplicationStatusRunning + - ApplicationStatusError + - ApplicationStatusUnknown + - ApplicationStatusCompleted + - ApplicationStatusStopped + - ApplicationStatusStopping + OsModeType: + type: string + description: OS management mode. "image" indicates the OS is managed via bootc or rpm-ostree image updates. "package" indicates no image-based OS management is available. + enum: + - image + - package + x-enum-varnames: + - OsModeImage + - OsModePackage + DeviceCapabilities: + type: object + description: Capabilities reported by the device agent. + properties: + osMode: + $ref: '#/components/schemas/OsModeType' + additionalProperties: false + DeviceOsStatus: + type: object + description: Current status of the device OS. + required: + - image + - imageDigest + properties: + image: + type: string + description: Version of the OS image. + imageDigest: + type: string + description: The digest of the OS image (e.g. sha256:a0...). + DeviceConfigStatus: + type: object + description: Current status of the device config. + required: + - renderedVersion + properties: + renderedVersion: + type: string + description: Rendered version of the device config. + DeviceSummaryStatus: + type: object + description: A summary of the health of the device hardware and operating system resources. + required: + - status + properties: + status: + $ref: '#/components/schemas/DeviceSummaryStatusType' + info: + type: string + description: Human readable information detailing the last device status transition. + DeviceSummaryStatusType: + type: string + description: Status of the device. + enum: + - Online + - Degraded + - Error + - Rebooting + - PoweredOff + - Unknown + - AwaitingReconnect + - ConflictPaused + x-enum-varnames: + - DeviceSummaryStatusOnline + - DeviceSummaryStatusDegraded + - DeviceSummaryStatusError + - DeviceSummaryStatusRebooting + - DeviceSummaryStatusPoweredOff + - DeviceSummaryStatusUnknown + - DeviceSummaryStatusAwaitingReconnect + - DeviceSummaryStatusConflictPaused + DeviceUpdatedStatus: + type: object + description: Current status of the device update. + required: + - status + properties: + status: + $ref: '#/components/schemas/DeviceUpdatedStatusType' + info: + type: string + description: Human readable information about the last device update transition. + DeviceUpdatedStatusType: + type: string + description: Status type of the device update. + enum: + - UpToDate + - OutOfDate + - Updating + - Unknown + x-enum-varnames: + - DeviceUpdatedStatusUpToDate + - DeviceUpdatedStatusOutOfDate + - DeviceUpdatedStatusUpdating + - DeviceUpdatedStatusUnknown + DeviceLifecycleStatus: + type: object + required: + - status + properties: + status: + $ref: '#/components/schemas/DeviceLifecycleStatusType' + info: + type: string + description: Human readable information about the device lifecycle status. + description: Current status of the device lifecycle. + DeviceIntegrityCheckStatus: + type: object + description: DeviceIntegrityCheckStatus represents the status of the integrity check performed on the device. + required: + - status + properties: + status: + $ref: '#/components/schemas/DeviceIntegrityCheckStatusType' + info: + type: string + description: Human-readable information about the integrity check status. + DeviceIntegrityCheckStatusType: + type: string + description: Status of the integrity check performed on the device. + enum: + - Unknown + - Unsupported + - Failed + - Verified + x-enum-varnames: + - DeviceIntegrityCheckStatusUnknown + - DeviceIntegrityCheckStatusUnsupported + - DeviceIntegrityCheckStatusFailed + - DeviceIntegrityCheckStatusVerified + DeviceLifecycleStatusType: + type: string + enum: + - Unknown + - Enrolled + - Decommissioning + - Decommissioned + x-enum-varnames: + - DeviceLifecycleStatusUnknown + - DeviceLifecycleStatusEnrolled + - DeviceLifecycleStatusDecommissioning + - DeviceLifecycleStatusDecommissioned + description: Status type of the device lifecycle. + DeviceIntegrityStatus: + type: object + description: Summary status of the integrity of the device. + required: + - status + properties: + deviceIdentity: + $ref: '#/components/schemas/DeviceIntegrityCheckStatus' + tpm: + $ref: '#/components/schemas/DeviceIntegrityCheckStatus' + status: + $ref: '#/components/schemas/DeviceIntegrityStatusSummaryType' + info: + type: string + description: Human readable information about the last integrity transition. + lastVerified: + type: string + format: date-time + description: Timestamp of the last integrity verification. + DeviceIntegrityStatusSummaryType: + type: string + description: Status of the integrity of the device. + enum: + - Verified + - Failed + - Unknown + - Unsupported + x-enum-varnames: + - DeviceIntegrityStatusVerified + - DeviceIntegrityStatusFailed + - DeviceIntegrityStatusUnknown + - DeviceIntegrityStatusUnsupported + DeviceResourceStatus: + type: object + description: Current status of the resources of the device. + required: + - cpu + - memory + - disk + properties: + cpu: + $ref: '#/components/schemas/DeviceResourceStatusType' + memory: + $ref: '#/components/schemas/DeviceResourceStatusType' + disk: + $ref: '#/components/schemas/DeviceResourceStatusType' + DeviceResourceStatusType: + type: string + description: The types of resource statuses. + enum: + - Healthy + - Warning + - Critical + - Error + - Unknown + x-enum-varnames: + - DeviceResourceStatusHealthy + - DeviceResourceStatusWarning + - DeviceResourceStatusCritical + - DeviceResourceStatusError + - DeviceResourceStatusUnknown + EnrollmentRequestApproval: + type: object + description: EnrollmentRequestApproval contains information about the approval of a device enrollment request. + properties: + labels: + type: object + additionalProperties: + type: string + description: Labels to set on the device. If replaceLabels is false (default), labels are merged with agent-provided labels from the enrollment request. If replaceLabels is true, labels are used as the complete final set ignoring agent-provided labels. + replaceLabels: + type: boolean + default: false + description: Controls whether labels are merged or replaced during approval. If false (default), labels are merged with agent-provided labels from the enrollment request. If true, labels are used as the complete final set and agent-provided labels are ignored. + approved: + type: boolean + description: Indicates whether the request has been approved. + required: + - approved + EnrollmentRequestApprovalStatus: + description: EnrollmentRequestApprovalStatus represents information about the status of a device enrollment request approval. + allOf: + - $ref: '#/components/schemas/EnrollmentRequestApproval' + - type: object + description: EnrollmentRequestApprovalStatus contains information about the status of approval of a device enrollment request. + properties: + approvedBy: + type: string + description: The name of the approver. + approvedAt: + type: string + format: date-time + description: The time at which the request was approved. + required: + - approvedBy + - approvedAt + EnrollmentServiceAuth: + type: object + description: EnrollmentServiceAuth contains the client authentication information for a Flight Control enrollment service. + properties: + client-certificate-data: + type: string + description: ClientCertificateData contains PEM-encoded data from a client cert file for TLS. + client-key-data: + type: string + description: ClientKeyData contains PEM-encoded data from a client key file for TLS. + required: + - client-certificate-data + - client-key-data + EnrollmentServiceService: + type: object + description: EnrollmentServiceService contains information about connecting to a Flight Control enrollment service. + properties: + certificate-authority-data: + type: string + description: CertificateAuthorityData contains PEM-encoded certificate authority certificates. + server: + type: string + description: Server is the address of the Flight Control enrollment service (https://hostname:port). + required: + - certificate-authority-data + - server + EnrollmentService: + type: object + description: EnrollmentService contains information about how to communicate with a Flight Control enrollment service. + properties: + authentication: + $ref: '#/components/schemas/EnrollmentServiceAuth' + service: + $ref: '#/components/schemas/EnrollmentServiceService' + enrollment-ui-endpoint: + type: string + description: The URL of the UI that the agent uses to print the QR code and link for enrolling the device. + required: + - authentication + - service + - enrollment-ui-endpoint + EnrollmentConfig: + type: object + properties: + enrollment-service: + $ref: '#/components/schemas/EnrollmentService' + required: + - enrollment-service + EnrollmentRequest: + type: object + properties: + apiVersion: + $ref: '#/components/schemas/ApiVersion' + kind: + type: string + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds.' + metadata: + $ref: '#/components/schemas/ObjectMeta' + spec: + $ref: '#/components/schemas/EnrollmentRequestSpec' + status: + $ref: '#/components/schemas/EnrollmentRequestStatus' + required: + - apiVersion + - kind + - metadata + - spec + description: EnrollmentRequest represents a request for approval to enroll a device. + example: + apiVersion: flightctl.io/v1beta1 + kind: EnrollmentRequest + metadata: + name: 13d632d86373caaeda64da4052f957faa742fc7050026748bc79065c8819d1b0 + spec: + csr: | + -----BEGIN CERTIFICATE REQUEST----- + MIIBBjCBrQIBADBLMUkwRwYDVQQDE0AxM2Q2MzJkODYzNzNjYWFlZGE2NGRhNDA1 + MmY5NTdmYWE3NDJmYzcwNTAwMjY3NDhiYzc5MDY1Yzg4MTlkMWIwMFkwEwYHKoZI + zj0CAQYIKoZIzj0DAQcDQgAEHBMC30NRJTJ3NWOlei9YWkBM/MzoNDGyMRKuzE0/ + cKkyXVJexHq0xIn22YCNN3ZDNxxwW6LlQg3ijGnvStQOb6AAMAoGCCqGSM49BAMC + A0gAMEUCIQDSrxi6krdCKcLChdMB3w7IqmDlZhREGbHMCESVn6ssPAIgZL+QrJtw + 8R+r4piaYvZktrsk3yCIuz3hI7loYmXP3d8= + -----END CERTIFICATE REQUEST----- + EnrollmentRequestList: + type: object + properties: + apiVersion: + $ref: '#/components/schemas/ApiVersion' + kind: + type: string + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds.' + metadata: + $ref: '#/components/schemas/ListMeta' + items: + type: array + description: List of EnrollmentRequest. + items: + $ref: '#/components/schemas/EnrollmentRequest' + required: + - apiVersion + - kind + - metadata + - items + description: EnrollmentRequestList is a list of EnrollmentRequest. + EnrollmentRequestSpec: + required: + - csr + type: object + properties: + csr: + type: string + description: The PEM-encoded PKCS#10 certificate signing request. + deviceStatus: + $ref: '#/components/schemas/DeviceStatus' + labels: + type: object + additionalProperties: + type: string + description: A set of labels that the service will apply to this device when its enrollment is approved. + knownRenderedVersion: + type: string + description: The rendered version of the device from desired.json (optional). + osMode: + $ref: '#/components/schemas/OsModeType' + description: EnrollmentRequestSpec is a description of a EnrollmentRequest's target state. + EnrollmentRequestStatus: + type: object + properties: + certificate: + type: string + description: The PEM-encoded signed certificate. + conditions: + type: array + description: Current state of the EnrollmentRequest. + items: + $ref: '#/components/schemas/Condition' + approval: + $ref: '#/components/schemas/EnrollmentRequestApprovalStatus' + required: + - conditions + description: EnrollmentRequestStatus represents information about the status of a EnrollmentRequest. + ResourceSync: + type: object + description: ResourceSync represents a reference to one or more files in a repository to sync to resource definitions. + properties: + apiVersion: + $ref: '#/components/schemas/ApiVersion' + kind: + type: string + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds.' + metadata: + $ref: '#/components/schemas/ObjectMeta' + spec: + $ref: '#/components/schemas/ResourceSyncSpec' + status: + $ref: '#/components/schemas/ResourceSyncStatus' + required: + - apiVersion + - kind + - metadata + - spec + example: + apiVersion: flightctl.io/v1beta1 + kind: ResourceSync + metadata: + name: example-sync + spec: + repository: example-repo + targetRevision: main + path: /resources + status: + conditions: [] + ResourceSyncSpec: + type: object + description: ResourceSyncSpec describes the file(s) to sync from a repository. + properties: + type: + $ref: '#/components/schemas/ResourceSyncType' + repository: + type: string + minLength: 1 + description: The name of the repository resource to use as the sync source. + targetRevision: + type: string + minLength: 1 + maxLength: 244 + example: main + description: The desired revision in the repository. + path: + type: string + minLength: 0 + maxLength: 2048 + example: /resources + description: The path of a file or directory in the repository. If a directory, the directory should contain only resource definitions with no subdirectories. Each file should contain the definition of one or more resources. + required: + - repository + - targetRevision + - path + ResourceSyncType: + type: string + description: The type of resources this ResourceSync manages. Defaults to fleet if not specified. + default: fleet + enum: + - fleet + - catalog + x-enum-varnames: + - ResourceSyncTypeFleet + - ResourceSyncTypeCatalog + ResourceSyncStatus: + type: object + properties: + observedCommit: + type: string + description: The last commit hash that was synced. + observedGeneration: + type: integer + format: int64 + description: The last generation that was synced. + conditions: + type: array + description: Current state of a resourcesync. + items: + $ref: '#/components/schemas/Condition' + required: + - conditions + description: ResourceSyncStatus represents information about the status of a ResourceSync. + ResourceSyncList: + type: object + properties: + apiVersion: + $ref: '#/components/schemas/ApiVersion' + kind: + type: string + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds.' + metadata: + $ref: '#/components/schemas/ListMeta' + items: + type: array + description: List of resourcesync. + items: + $ref: '#/components/schemas/ResourceSync' + required: + - apiVersion + - kind + - metadata + - items + Fleet: + type: object + properties: + apiVersion: + $ref: '#/components/schemas/ApiVersion' + kind: + type: string + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds.' + metadata: + $ref: '#/components/schemas/ObjectMeta' + spec: + $ref: '#/components/schemas/FleetSpec' + status: + $ref: '#/components/schemas/FleetStatus' + required: + - apiVersion + - kind + - metadata + - spec + additionalProperties: false + description: Fleet represents a set of devices. + FleetList: + type: object + properties: + apiVersion: + $ref: '#/components/schemas/ApiVersion' + kind: + type: string + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds.' + metadata: + $ref: '#/components/schemas/ListMeta' + items: + type: array + description: List of Fleets. + items: + $ref: '#/components/schemas/Fleet' + required: + - apiVersion + - kind + - metadata + - items + description: FleetList is a list of Fleets. + DisruptionBudget: + type: object + properties: + groupBy: + type: array + items: + type: string + pattern: ^([A-Za-z0-9][-A-Za-z0-9_/.]*)?[A-Za-z0-9]$ + description: List of label keys to perform grouping for the disruption budget. + minAvailable: + type: integer + minimum: 1 + description: The maximum number of unavailable devices allowed during rollout. + maxUnavailable: + minimum: 1 + type: integer + description: The minimum number of required available devices during rollout. + description: DisruptionBudget defines the level of allowed disruption when rollout is in progress. + Percentage: + type: string + description: Percentage is the string format representing percentage string. + Batch: + type: object + properties: + selector: + $ref: '#/components/schemas/LabelSelector' + successThreshold: + $ref: '#/components/schemas/Percentage' + limit: + description: The maximum number or percentage of devices to update in the batch. + oneOf: + - $ref: '#/components/schemas/Percentage' + - type: integer + minimum: 1 + description: Batch is an element in batch sequence. + Duration: + type: string + pattern: ^(?:[1-9]\d*)?\d[smh]$ + description: 'The maximum duration allowed for the action to complete. The duration should be specified as a positive integer followed by a time unit. Supported time units are: `s` for seconds, `m` for minutes, `h` for hours.' + RolloutStrategy: + type: string + description: The strategy of choice for device selection in rollout policy. + enum: + - BatchSequence + BatchSequence: + type: object + description: BatchSequence defines the list of batches to be executed in sequence. + required: + - strategy + properties: + strategy: + $ref: '#/components/schemas/RolloutStrategy' + sequence: + type: array + description: A list of batch definitions. + minItems: 1 + items: + $ref: '#/components/schemas/Batch' + RolloutDeviceSelection: + type: object + description: Describes how to select devices for rollout. + oneOf: + - $ref: '#/components/schemas/BatchSequence' + discriminator: + propertyName: strategy + mapping: + BatchSequence: '#/components/schemas/BatchSequence' + RolloutPolicy: + type: object + properties: + disruptionBudget: + $ref: '#/components/schemas/DisruptionBudget' + deviceSelection: + $ref: '#/components/schemas/RolloutDeviceSelection' + successThreshold: + $ref: '#/components/schemas/Percentage' + defaultUpdateTimeout: + $ref: '#/components/schemas/Duration' + description: RolloutPolicy is the rollout policy of the fleet. + FleetSpec: + type: object + description: FleetSpec is a description of a fleet's target state. + properties: + selector: + $ref: '#/components/schemas/LabelSelector' + rolloutPolicy: + $ref: '#/components/schemas/RolloutPolicy' + template: + type: object + description: The template for the devices in the fleet. + properties: + metadata: + $ref: '#/components/schemas/ObjectMeta' + spec: + $ref: '#/components/schemas/DeviceSpec' + required: + - spec + additionalProperties: false + required: + - template + additionalProperties: false + DeviceSpec: + type: object + description: DeviceSpec describes a device. + properties: + updatePolicy: + $ref: '#/components/schemas/DeviceUpdatePolicySpec' + os: + $ref: '#/components/schemas/DeviceOsSpec' + config: + type: array + description: List of config providers. + items: + $ref: '#/components/schemas/ConfigProviderSpec' + applications: + type: array + description: List of application providers. + items: + $ref: '#/components/schemas/ApplicationProviderSpec' + systemd: + type: object + description: The systemd services to monitor. + properties: + matchPatterns: + type: array + description: A list of match patterns. + items: + type: string + description: A single systemd unit name, with or without suffix, or a shell-style glob pattern to match against currently loaded units. + pattern: ^[0-9a-zA-Z:\-_.\\\[\]!\-\*\?]+(@[0-9a-zA-Z:\-_.\\\[\]!\-\*\?]+)?(\.[a-zA-Z\[\]!\-\*\?]+)?$ + maxLength: 256 + additionalProperties: false + resources: + type: array + description: Array of resource monitor configurations. + items: + $ref: '#/components/schemas/ResourceMonitor' + consoles: + type: array + description: The list of active console sessions. + items: + $ref: '#/components/schemas/DeviceConsole' + decommissioning: + $ref: '#/components/schemas/DeviceDecommission' + FleetRolloutStatus: + type: object + description: FleetRolloutStatus represents information about the status of a fleet rollout. + properties: + currentBatch: + type: integer + description: The batch number currently being rolled out. + DependencySyncStatus: + type: object + description: DependencySyncStatus represents the synchronization fingerprints for external dependencies of a device, captured at render time. + properties: + configRefs: + type: array + description: Per-config-provider fingerprint and last update time, set when the device renders. + items: + $ref: '#/components/schemas/DependencySyncConfigRefStatus' + additionalProperties: false + DependencySyncConfigRefStatus: + type: object + description: DependencySyncConfigRefStatus represents the rendered fingerprint for a single config provider's external dependency. + required: + - configProviderName + properties: + configProviderName: + type: string + description: The name of the config provider (e.g. the git or HTTP config source name). + fingerprint: + type: string + description: The fingerprint of the rendered content (e.g. git commit SHA, sha256 of HTTP body, K8s secret ResourceVersion). + lastUpdatedAt: + type: string + format: date-time + description: The last time the fingerprint changed (i.e. the dependency content was updated). + additionalProperties: false + FleetStatus: + type: object + description: FleetStatus represents information about the status of a fleet. Status may trail the actual state of a fleet, especially if devices of a fleet have not contacted the management service in a while. + properties: + rollout: + $ref: '#/components/schemas/FleetRolloutStatus' + conditions: + type: array + description: Current state of the fleet. + items: + $ref: '#/components/schemas/Condition' + devicesSummary: + $ref: '#/components/schemas/DevicesSummary' + required: + - conditions + additionalProperties: false + DevicesSummary: + type: object + description: A summary of the devices in the fleet returned when fetching a single Fleet. + required: + - total + - applicationStatus + - summaryStatus + - updateStatus + properties: + total: + type: integer + format: int64 + description: The total number of devices in the fleet. + applicationStatus: + type: object + default: {} + additionalProperties: + type: integer + format: int64 + description: A breakdown of the devices in the fleet by "application" status. + summaryStatus: + type: object + default: {} + additionalProperties: + type: integer + format: int64 + description: A breakdown of the devices in the fleet by "summary" status. + updateStatus: + type: object + default: {} + additionalProperties: + type: integer + format: int64 + description: A breakdown of the devices in the fleet by "updated" status. + capabilities: + $ref: '#/components/schemas/DevicesSummaryCapabilities' + DevicesSummaryCapabilities: + type: object + description: Breakdowns of devices by status.capabilities fields. + properties: + osMode: + type: object + default: {} + additionalProperties: + type: integer + format: int64 + description: Counts by status.capabilities.osMode (e.g. image, package). The key "unknown" counts devices that have not reported the capability. + additionalProperties: false + TemplateVersion: + type: object + properties: + apiVersion: + $ref: '#/components/schemas/ApiVersion' + kind: + type: string + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds.' + metadata: + $ref: '#/components/schemas/ObjectMeta' + spec: + $ref: '#/components/schemas/TemplateVersionSpec' + status: + $ref: '#/components/schemas/TemplateVersionStatus' + required: + - apiVersion + - kind + - metadata + - spec + description: TemplateVersion represents a version of a template. + TemplateVersionSpec: + type: object + description: TemplateVersionSpec describes a version of a device template. + properties: + fleet: + type: string + description: The fleet whose template this refers to. + required: + - fleet + TemplateVersionStatus: + description: TemplateVersionStatus represents information about the status of a template version. + allOf: + - $ref: '#/components/schemas/DeviceSpec' + - type: object + properties: + updatedAt: + type: string + description: The time at which the template was last updated. + format: date-time + conditions: + type: array + description: Current state of the device. + items: + $ref: '#/components/schemas/Condition' + required: + - conditions + TemplateVersionList: + type: object + properties: + apiVersion: + $ref: '#/components/schemas/ApiVersion' + kind: + type: string + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds.' + metadata: + $ref: '#/components/schemas/ListMeta' + items: + type: array + description: List of TemplateVersions. + items: + $ref: '#/components/schemas/TemplateVersion' + required: + - apiVersion + - kind + - metadata + - items + description: TemplateVersionList is a list of TemplateVersions. + AuthConfig: + type: object + properties: + apiVersion: + $ref: '#/components/schemas/ApiVersion' + providers: + type: array + description: List of all available authentication providers. + items: + $ref: '#/components/schemas/AuthProvider' + defaultProvider: + type: string + description: Name of the default authentication provider. + organizationsEnabled: + type: boolean + description: Whether organizations are enabled for authentication. + required: + - apiVersion + TokenRequest: + type: object + required: + - grant_type + - client_id + properties: + grant_type: + type: string + enum: + - refresh_token + - authorization_code + description: OAuth2 grant type. + x-oapi-codegen-extra-tags: + form: grant_type + client_id: + type: string + minLength: 1 + description: OAuth2 client identifier. + x-oapi-codegen-extra-tags: + form: client_id + refresh_token: + type: string + nullable: true + description: Refresh token for refresh_token grant. + x-oapi-codegen-extra-tags: + form: refresh_token,omitempty + code: + type: string + nullable: true + description: Authorization code for authorization_code grant. + x-oapi-codegen-extra-tags: + form: code,omitempty + scope: + type: string + nullable: true + description: OAuth2 scope. + x-oapi-codegen-extra-tags: + form: scope,omitempty + code_verifier: + type: string + nullable: true + description: PKCE code verifier. + x-oapi-codegen-extra-tags: + form: code_verifier,omitempty + redirect_uri: + type: string + nullable: true + description: OAuth2 redirect URI (required for authorization_code grant if included in authorization request). + x-oapi-codegen-extra-tags: + form: redirect_uri,omitempty + description: OAuth2 token request + additionalProperties: false + TokenResponse: + type: object + properties: + access_token: + type: string + description: OAuth2 access token. + token_type: + type: string + enum: + - Bearer + description: Token type. + id_token: + type: string + description: OIDC ID token (JWT). Present when using OIDC with openid scope. + refresh_token: + type: string + description: OAuth2 refresh token. + expires_in: + type: integer + description: Token expiration time in seconds. + error: + type: string + description: OAuth2 error code. + error_description: + type: string + description: OAuth2 error description. + description: OAuth2 token response + additionalProperties: false + UserInfoResponse: + type: object + properties: + sub: + type: string + description: Subject identifier. + preferred_username: + type: string + description: Preferred username. + name: + type: string + description: Full name. + organizations: + type: array + items: + $ref: '#/components/schemas/Organization' + description: User organizations. + error: + type: string + description: Error code. + description: OIDC UserInfo response + additionalProperties: false + ListMeta: + type: object + properties: + continue: + type: string + description: May be set if the user set a limit on the number of items returned, and indicates that the server has more data available. The value is opaque and may be used to issue another request to the endpoint that served this list to retrieve the next set of available objects. Continuing a consistent list may not be possible if the server configuration has changed or more than a few minutes have passed. The resourceVersion field returned when using this continue value will be identical to the value in the first response, unless you have received this token from an error message. + remainingItemCount: + type: integer + description: The number of subsequent items in the list which are not included in this list response. If the list request contained label or field selectors, then the number of remaining items is unknown and the field will be left unset and omitted during serialization. If the list is complete (either because it is not chunking or because this is the last chunk), then there are no more remaining items and this field will be left unset and omitted during serialization. Servers older than v1.15 do not set this field. The intended use of the remainingItemCount is *estimating* the size of a collection. Clients should not rely on the remainingItemCount to be set or to be exact. + format: int64 + description: ListMeta describes metadata that synthetic resources must have, including lists and various status objects. A resource may have only one of {ObjectMeta, ListMeta}. + ObjectMeta: + type: object + properties: + creationTimestamp: + type: string + description: The time the object was created. + format: date-time + deletionTimestamp: + type: string + description: The time the object will be deleted. + format: date-time + name: + type: string + maxLength: 253 + description: The name of the object. + labels: + type: object + description: Map of string keys and values that can be used to organize and categorize (scope and select) objects. + additionalProperties: + type: string + maxLength: 63 + generation: + type: integer + description: A sequence number representing a specific generation of the desired state. Populated by the system. Read-only. + format: int64 + owner: + type: string + description: A resource that owns this resource, in "kind/name" format. + annotations: + type: object + additionalProperties: + type: string + description: Properties set by the service. + resourceVersion: + type: string + description: An opaque string that identifies the server's internal version of an object. + description: ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create. + MatchExpression: + type: object + properties: + key: + type: string + description: The label key that the selector applies to. + operator: + type: string + description: The operation to apply when matching. + enum: + - In + - NotIn + - Exists + - DoesNotExist + values: + type: array + description: The list of values to match. + items: + type: string + required: + - key + - operator + MatchExpressions: + type: array + description: A list of match expressions. + minItems: 1 + items: + $ref: '#/components/schemas/MatchExpression' + LabelSelector: + type: object + description: A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. Empty/null label selectors match nothing. + properties: + matchLabels: + type: object + description: A map of {key,value} pairs. + additionalProperties: + type: string + matchExpressions: + $ref: '#/components/schemas/MatchExpressions' + LabelList: + type: array + items: + type: string + description: | + A list of distinct labels, where each item is formatted as "key=value". + example: + - environment=production + - region=us-east-1 + - tier=backend + Status: + type: object + properties: + apiVersion: + $ref: '#/components/schemas/ApiVersion' + kind: + type: string + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds.' + code: + type: integer + format: int32 + description: Suggested HTTP return code for this status, 0 if not set. + message: + type: string + description: A human-readable description of the status of this operation. + reason: + type: string + description: A machine-readable description of why this operation is in the "Failure" status. If this value is empty there is no information available. A Reason clarifies an HTTP status code but does not override it. + status: + type: string + description: 'Status of the operation. One of: "Success" or "Failure". More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status.' + description: Status is a return value for calls that don't return other objects. + required: + - apiVersion + - kind + - status + - code + - reason + - message + ConditionBase: + type: object + description: Base condition structure following Kubernetes API conventions. Use with allOf to add a specific type enum. + required: + - status + - lastTransitionTime + - reason + - message + properties: + status: + $ref: '#/components/schemas/ConditionStatus' + observedGeneration: + type: integer + format: int64 + description: The .metadata.generation that the condition was set based upon. + lastTransitionTime: + type: string + format: date-time + description: The last time the condition transitioned from one status to another. + message: + type: string + description: Human readable message indicating details about last transition. + reason: + type: string + description: A (brief) reason for the condition's last transition. + Condition: + description: Condition contains details for one aspect of the current state of this API Resource. + allOf: + - $ref: '#/components/schemas/ConditionBase' + - type: object + required: + - type + properties: + type: + $ref: '#/components/schemas/ConditionType' + ConditionType: + type: string + description: Type of condition in CamelCase. + enum: + - Approved + - TPMVerified + - Approved + - Denied + - Failed + - TPMVerified + - Accessible + - Accessible + - ResourceParsed + - Synced + - Valid + - RolloutInProgress + - Updating + - SpecValid + - MultipleOwners + - DeviceDecommissioning + x-enum-varnames: + - EnrollmentRequestApproved + - EnrollmentRequestTPMVerified + - CertificateSigningRequestApproved + - CertificateSigningRequestDenied + - CertificateSigningRequestFailed + - CertificateSigningRequestTPMVerified + - RepositoryAccessible + - ResourceSyncAccessible + - ResourceSyncResourceParsed + - ResourceSyncSynced + - FleetValid + - FleetRolloutInProgress + - DeviceUpdating + - DeviceSpecValid + - DeviceMultipleOwners + - DeviceDecommissioning + ConditionStatus: + type: string + description: Status of the condition, one of True, False, Unknown. + enum: + - 'True' + - 'False' + - Unknown + x-enum-varnames: + - ConditionStatusTrue + - ConditionStatusFalse + - ConditionStatusUnknown + CertificateSigningRequest: + type: object + properties: + apiVersion: + $ref: '#/components/schemas/ApiVersion' + kind: + type: string + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds.' + metadata: + $ref: '#/components/schemas/ObjectMeta' + spec: + $ref: '#/components/schemas/CertificateSigningRequestSpec' + status: + $ref: '#/components/schemas/CertificateSigningRequestStatus' + required: + - apiVersion + - kind + - metadata + - spec + description: CertificateSigningRequest represents a request for a signed certificate from the CA. + CertificateSigningRequestList: + type: object + properties: + apiVersion: + $ref: '#/components/schemas/ApiVersion' + kind: + type: string + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds.' + metadata: + $ref: '#/components/schemas/ListMeta' + items: + type: array + description: List of CertificateSigningRequest. + items: + $ref: '#/components/schemas/CertificateSigningRequest' + required: + - apiVersion + - kind + - metadata + - items + description: CertificateSigningRequestList is a list of CertificateSigningRequest. + CertificateSigningRequestSpec: + description: Wrapper around a user-created CSR, modeled on kubernetes io.k8s.api.certificates.v1.CertificateSigningRequestSpec. + properties: + expirationSeconds: + description: Requested duration of validity for the certificate. + format: int32 + type: integer + extra: + additionalProperties: + items: + type: string + type: array + description: Extra attributes of the user that created the CSR, populated by the API server on creation and immutable. + type: object + request: + description: The base64-encoded PEM-encoded PKCS#10 CSR. Matches the spec.request field in a kubernetes CertificateSigningRequest resource. + format: byte + type: string + signerName: + description: Indicates the requested signer, and is a qualified name. + type: string + minLength: 1 + uid: + description: UID of the user that created the CSR, populated by the API server on creation and immutable. + type: string + usages: + description: Usages specifies a set of key usages requested in the issued certificate. + items: + type: string + type: array + username: + description: Name of the user that created the CSR, populated by the API server on creation and immutable. + type: string + required: + - request + - signerName + type: object + CertificateSigningRequestStatus: + description: Indicates approval/denial/failure status of the CSR, and contains the issued certificate if any exists. + properties: + certificate: + description: The issued signed certificate, immutable once populated. + format: byte + type: string + conditions: + type: array + description: Conditions applied to the request. Known conditions are Approved, Denied, and Failed. + items: + $ref: '#/components/schemas/Condition' + required: + - conditions + type: object + Version: + type: object + properties: + version: + description: Git version of the service. + type: string + required: + - version + Event: + type: object + description: Event represents a single event that occurred in the system. + required: + - apiVersion + - kind + - metadata + - involvedObject + - reason + - message + - type + - source + - actor + properties: + apiVersion: + $ref: '#/components/schemas/ApiVersion' + kind: + type: string + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds.' + metadata: + $ref: '#/components/schemas/ObjectMeta' + involvedObject: + $ref: '#/components/schemas/ObjectReference' + reason: + type: string + description: A short, machine-readable string that describes the reason for the event. + enum: + - ResourceCreated + - ResourceCreationFailed + - ResourceUpdated + - ResourceUpdateFailed + - ResourceDeleted + - ResourceDeletionFailed + - DeviceDecommissioned + - DeviceDecommissionFailed + - DeviceCPUCritical + - DeviceCPUWarning + - DeviceCPUNormal + - DeviceMemoryCritical + - DeviceMemoryWarning + - DeviceMemoryNormal + - DeviceDiskCritical + - DeviceDiskWarning + - DeviceDiskNormal + - DeviceApplicationError + - DeviceApplicationDegraded + - DeviceApplicationHealthy + - DeviceDisconnected + - DeviceIsRebooting + - DeviceConflictPaused + - DeviceConflictResolved + - DeviceConnected + - DeviceContentUpToDate + - DeviceContentOutOfDate + - DeviceContentUpdating + - DeviceUpdateFailed + - DeviceVulnerabilityCVECritical + - DeviceVulnerabilityCVEResolved + - DeviceVulnerabilityCVEWarning + - DeviceOSImageChanged + - EnrollmentRequestApproved + - EnrollmentRequestApprovalFailed + - DeviceMultipleOwnersDetected + - DeviceMultipleOwnersResolved + - DeviceSpecValid + - DeviceSpecInvalid + - InternalTaskFailed + - InternalTaskPermanentlyFailed + - RepositoryAccessible + - RepositoryInaccessible + - ReferencedRepositoryUpdated + - FleetValid + - FleetInvalid + - FleetRolloutCreated + - FleetRolloutStarted + - FleetRolloutFailed + - FleetRolloutCompleted + - FleetRolloutBatchDispatched + - FleetRolloutDeviceSelected + - FleetRolloutBatchCompleted + - ResourceSyncCommitDetected + - ResourceSyncAccessible + - ResourceSyncInaccessible + - ResourceSyncParsed + - ResourceSyncParsingFailed + - ResourceSyncSynced + - ResourceSyncSyncFailed + - DependencyChangeDetected + - DependencySyncProbeFailed + - SystemRestored + - EncryptionMigrationStarted + - EncryptionMigrationCompleted + - ApplicationLifecycleChanged + message: + type: string + description: A human-readable description of the status of this operation. + details: + $ref: '#/components/schemas/EventDetails' + type: + type: string + description: The type of the event. One of Normal, Warning. + enum: + - Normal + - Warning + source: + $ref: '#/components/schemas/EventSource' + actor: + type: string + description: 'The name of the user or service that triggered the event. The value will be prefixed by either user: (for human users) or service: (for automated services).' + EventSource: + type: object + description: The component that is responsible for the event. + required: + - component + properties: + component: + type: string + description: The name of the component that is responsible for the event. + ObjectReference: + type: object + description: A reference to a resource. + required: + - kind + - name + properties: + kind: + type: string + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds.' + name: + type: string + description: The name of the referenced object. + EventList: + type: object + properties: + apiVersion: + $ref: '#/components/schemas/ApiVersion' + kind: + type: string + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds.' + metadata: + $ref: '#/components/schemas/ListMeta' + items: + type: array + description: List of Events. + items: + $ref: '#/components/schemas/Event' + required: + - apiVersion + - kind + - metadata + - items + description: EventList is a list of Events. + EventDetails: + type: object + required: + - detailType + description: Event-specific details, structured based on event type. + discriminator: + propertyName: detailType + mapping: + ResourceUpdated: '#/components/schemas/ResourceUpdatedDetails' + DeviceOwnershipChanged: '#/components/schemas/DeviceOwnershipChangedDetails' + DeviceMultipleOwnersDetected: '#/components/schemas/DeviceMultipleOwnersDetectedDetails' + DeviceMultipleOwnersResolved: '#/components/schemas/DeviceMultipleOwnersResolvedDetails' + InternalTaskFailed: '#/components/schemas/InternalTaskFailedDetails' + InternalTaskPermanentlyFailed: '#/components/schemas/InternalTaskPermanentlyFailedDetails' + ResourceSyncCompleted: '#/components/schemas/ResourceSyncCompletedDetails' + ReferencedRepositoryUpdated: '#/components/schemas/ReferencedRepositoryUpdatedDetails' + FleetRolloutStarted: '#/components/schemas/FleetRolloutStartedDetails' + FleetRolloutFailed: '#/components/schemas/FleetRolloutFailedDetails' + FleetRolloutCompleted: '#/components/schemas/FleetRolloutCompletedDetails' + FleetRolloutBatchDispatched: '#/components/schemas/FleetRolloutBatchDispatchedDetails' + FleetRolloutBatchCompleted: '#/components/schemas/FleetRolloutBatchCompletedDetails' + FleetRolloutDeviceSelected: '#/components/schemas/FleetRolloutDeviceSelectedDetails' + DeviceVulnerabilityCVE: '#/components/schemas/DeviceVulnerabilityCveDetails' + DependencyChangeDetected: '#/components/schemas/DependencyChangeDetectedDetails' + DependencySyncProbeFailed: '#/components/schemas/DependencySyncProbeFailedDetails' + ApplicationLifecycleChanged: '#/components/schemas/ApplicationLifecycleChangedDetails' + oneOf: + - $ref: '#/components/schemas/ResourceUpdatedDetails' + - $ref: '#/components/schemas/DeviceOwnershipChangedDetails' + - $ref: '#/components/schemas/DeviceMultipleOwnersDetectedDetails' + - $ref: '#/components/schemas/DeviceMultipleOwnersResolvedDetails' + - $ref: '#/components/schemas/InternalTaskFailedDetails' + - $ref: '#/components/schemas/InternalTaskPermanentlyFailedDetails' + - $ref: '#/components/schemas/ResourceSyncCompletedDetails' + - $ref: '#/components/schemas/ReferencedRepositoryUpdatedDetails' + - $ref: '#/components/schemas/FleetRolloutStartedDetails' + - $ref: '#/components/schemas/FleetRolloutFailedDetails' + - $ref: '#/components/schemas/FleetRolloutCompletedDetails' + - $ref: '#/components/schemas/FleetRolloutBatchDispatchedDetails' + - $ref: '#/components/schemas/FleetRolloutBatchCompletedDetails' + - $ref: '#/components/schemas/FleetRolloutDeviceSelectedDetails' + - $ref: '#/components/schemas/DeviceVulnerabilityCveDetails' + - $ref: '#/components/schemas/DependencyChangeDetectedDetails' + - $ref: '#/components/schemas/DependencySyncProbeFailedDetails' + - $ref: '#/components/schemas/ApplicationLifecycleChangedDetails' + DeviceVulnerabilityCveDetails: + type: object + description: Structured details for per-device CVE vulnerability events. + required: + - detailType + - cveId + properties: + detailType: + type: string + enum: + - DeviceVulnerabilityCVE + description: The type of detail for discriminator purposes. + cveId: + type: string + description: CVE identifier (e.g. CVE-2024-1234). MITRE-style CVE-YYYY-sequence identifier, matching device list filter validation. + pattern: ^CVE-[0-9]{4}-[0-9]{4,}$ + maxLength: 64 + firstImageRef: + type: string + description: Human-readable OS image reference when the CVE was first detected on this device (historical/audit field). + firstImageDigest: + type: string + description: Image digest when the CVE was first detected on this device (historical/audit field, e.g. sha256:...). + ResourceUpdatedDetails: + type: object + required: + - detailType + - updatedFields + properties: + detailType: + type: string + enum: + - ResourceUpdated + description: The type of detail for discriminator purposes. + updatedFields: + type: array + items: + type: string + enum: + - owner + - labels + - spec + - spec.selector + - spec.template + description: List of fields that were updated in the resource. + previousOwner: + type: string + nullable: true + description: The previous owner (if applicable). + newOwner: + type: string + nullable: true + description: The new owner (if applicable). + DeviceOwnershipChangedDetails: + type: object + required: + - detailType + properties: + detailType: + type: string + enum: + - DeviceOwnershipChanged + description: The type of detail for discriminator purposes. + previousOwner: + type: string + nullable: true + description: The previous owner fleet (null if none). + newOwner: + type: string + nullable: true + description: The new owner fleet (null if removed). + DeviceMultipleOwnersDetectedDetails: + type: object + required: + - detailType + - matchingFleets + properties: + detailType: + type: string + enum: + - DeviceMultipleOwnersDetected + description: The type of detail for discriminator purposes. + matchingFleets: + type: array + items: + type: string + description: List of fleet names that match the device. + DeviceMultipleOwnersResolvedDetails: + type: object + required: + - detailType + - resolutionType + properties: + detailType: + type: string + enum: + - DeviceMultipleOwnersResolved + description: The type of detail for discriminator purposes. + resolutionType: + type: string + enum: + - SingleMatch + - NoMatch + - FleetDeleted + description: How the conflict was resolved. + assignedOwner: + type: string + nullable: true + description: The fleet assigned as owner (null if no owner). + previousMatchingFleets: + type: array + items: + type: string + description: List of fleets that previously matched the device. + InternalTaskFailedDetails: + type: object + required: + - detailType + - errorMessage + - originalEvent + properties: + detailType: + type: string + enum: + - InternalTaskFailed + description: The type of detail for discriminator purposes. + errorMessage: + type: string + description: The error message describing the failure. + retryCount: + type: integer + description: Number of times the task has been retried. + originalEvent: + $ref: '#/components/schemas/Event' + InternalTaskPermanentlyFailedDetails: + type: object + required: + - detailType + - errorMessage + - retryCount + - originalEvent + properties: + detailType: + type: string + enum: + - InternalTaskPermanentlyFailed + description: The type of detail for discriminator purposes. + errorMessage: + type: string + description: The error message describing the permanent failure. + retryCount: + type: integer + description: Number of times the task was retried before being marked as permanently failed. + originalEvent: + $ref: '#/components/schemas/Event' + ResourceSyncCompletedDetails: + type: object + required: + - detailType + - commitHash + - changeCount + - errorCount + properties: + detailType: + type: string + enum: + - ResourceSyncCompleted + description: The type of detail for discriminator purposes. + commitHash: + type: string + description: Hash of the last commit. + changeCount: + type: integer + description: Number of changes introduced by this ResourceSync update. + errorCount: + type: integer + description: Number of errors encountered by this ResourceSync update. + FleetRolloutStartedDetails: + type: object + required: + - detailType + - templateVersion + - rolloutStrategy + properties: + detailType: + type: string + enum: + - FleetRolloutStarted + description: The type of detail for discriminator purposes. + templateVersion: + type: string + description: The name of the TemplateVersion that is rolling out. + rolloutStrategy: + type: string + enum: + - None + - Batched + description: Rollout strategy type. + FleetRolloutDeviceSelectedDetails: + type: object + required: + - detailType + - fleetName + - templateVersion + properties: + detailType: + type: string + enum: + - FleetRolloutDeviceSelected + description: The type of detail for discriminator purposes. + fleetName: + type: string + description: The name of the fleet that the device is being selected for. + templateVersion: + type: string + description: The name of the TemplateVersion that the device is being selected to render. + ApplicationLifecycleChangedDetails: + type: object + required: + - detailType + - appName + - action + properties: + detailType: + type: string + enum: + - ApplicationLifecycleChanged + x-enum-varnames: + - ApplicationLifecycleChangedDetailType + description: The type of detail for discriminator purposes. + appName: + type: string + description: The name of the application whose device-level lifecycle override changed. + action: + type: string + description: The lifecycle action that was requested. + enum: + - stop + - start + - restart + x-enum-varnames: + - ApplicationLifecycleActionStop + - ApplicationLifecycleActionStart + - ApplicationLifecycleActionRestart + FleetRolloutFailedDetails: + type: object + required: + - detailType + - templateVersion + properties: + detailType: + type: string + enum: + - FleetRolloutFailed + description: The type of detail for discriminator purposes. + templateVersion: + type: string + description: The name of the TemplateVersion that this fleet rollout failed for. + FleetRolloutCompletedDetails: + type: object + required: + - detailType + - templateVersion + properties: + detailType: + type: string + enum: + - FleetRolloutCompleted + description: The type of detail for discriminator purposes. + templateVersion: + type: string + description: The name of the TemplateVersion that this fleet rollout is completed for. + FleetRolloutBatchDispatchedDetails: + type: object + required: + - detailType + - templateVersion + - batch + properties: + detailType: + type: string + enum: + - FleetRolloutBatchDispatched + description: The type of detail for discriminator purposes. + templateVersion: + type: string + description: The name of the TemplateVersion that this batch is rolling out to. + batch: + type: string + description: The batch within the fleet rollout. + FleetRolloutBatchCompletedDetails: + type: object + required: + - detailType + - templateVersion + - batch + - successPercentage + - total + - successful + - failed + - timedOut + properties: + detailType: + type: string + enum: + - FleetRolloutBatchCompleted + description: The type of detail for discriminator purposes. + templateVersion: + type: string + description: The name of the TemplateVersion that this batch is rolling out to. + batch: + type: string + description: The batch within the fleet rollout. + successPercentage: + type: integer + format: int64 + description: The success percentage of the batch. + total: + type: integer + format: int64 + description: The total number of devices in the batch. + successful: + type: integer + format: int64 + description: The number of successful devices in the batch. + failed: + type: integer + format: int64 + description: The number of failed devices in the batch. + timedOut: + type: integer + format: int64 + description: The number of timed out devices in the batch. + ReferencedRepositoryUpdatedDetails: + type: object + required: + - detailType + - repository + properties: + detailType: + type: string + enum: + - ReferencedRepositoryUpdated + description: The type of detail for discriminator purposes. + repository: + type: string + description: The name of the repository that was updated. + DependencyChangeDetectedDetails: + type: object + required: + - detailType + - resourceKey + - fingerprint + properties: + detailType: + type: string + enum: + - DependencyChangeDetected + description: The type of detail for discriminator purposes. + resourceKey: + type: string + description: The resource key identifying the dependency that changed (e.g. "git:my-repo/main"). + fingerprint: + type: string + description: The new fingerprint (e.g. commit SHA) of the changed dependency. + DependencySyncProbeFailedDetails: + type: object + required: + - detailType + - resourceKey + - error + properties: + detailType: + type: string + enum: + - DependencySyncProbeFailed + description: The type of detail for discriminator purposes. + resourceKey: + type: string + description: The resource key identifying the dependency that failed (e.g. "git:my-repo/main"). + error: + type: string + description: The error message from the failed probe. + Organization: + type: object + required: + - apiVersion + - kind + - metadata + properties: + apiVersion: + $ref: '#/components/schemas/ApiVersion' + kind: + type: string + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds.' + metadata: + $ref: '#/components/schemas/ObjectMeta' + spec: + $ref: '#/components/schemas/OrganizationSpec' + OrganizationSpec: + type: object + description: OrganizationSpec describes an organization. + properties: + displayName: + type: string + description: Human readable name shown to users. + externalId: + type: string + description: External ID of the organization. + OrganizationList: + type: object + required: + - apiVersion + - kind + - metadata + - items + properties: + apiVersion: + $ref: '#/components/schemas/ApiVersion' + kind: + type: string + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds.' + metadata: + $ref: '#/components/schemas/ListMeta' + items: + type: array + description: List of Organizations. + items: + $ref: '#/components/schemas/Organization' + description: OrganizationList is a list of Organizations. + AuthProvider: + type: object + properties: + apiVersion: + $ref: '#/components/schemas/ApiVersion' + kind: + type: string + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds.' + metadata: + $ref: '#/components/schemas/ObjectMeta' + spec: + $ref: '#/components/schemas/AuthProviderSpec' + required: + - apiVersion + - kind + - metadata + - spec + description: AuthProvider represents an authentication provider configuration supporting both OIDC and OAuth2. + AuthProviderSpec: + oneOf: + - $ref: '#/components/schemas/OIDCProviderSpec' + - $ref: '#/components/schemas/OAuth2ProviderSpec' + - $ref: '#/components/schemas/OpenShiftProviderSpec' + - $ref: '#/components/schemas/AapProviderSpec' + - $ref: '#/components/schemas/K8sProviderSpec' + discriminator: + propertyName: providerType + mapping: + oidc: '#/components/schemas/OIDCProviderSpec' + oauth2: '#/components/schemas/OAuth2ProviderSpec' + openshift: '#/components/schemas/OpenShiftProviderSpec' + aap: '#/components/schemas/AapProviderSpec' + k8s: '#/components/schemas/K8sProviderSpec' + required: + - providerType + OIDCProviderSpec: + type: object + description: OIDCProviderSpec describes an OIDC provider configuration. + properties: + providerType: + type: string + enum: + - oidc + description: The type of authentication provider. + displayName: + type: string + description: Human-readable display name for the provider. + issuer: + type: string + description: The OIDC issuer URL (e.g., https://accounts.google.com). + clientId: + type: string + description: The OIDC client ID. + clientSecret: + type: string + description: The OIDC client secret. + enabled: + type: boolean + description: Whether this OIDC provider is enabled. + default: true + scopes: + type: array + items: + type: string + description: List of OIDC scopes to request. + organizationAssignment: + $ref: '#/components/schemas/AuthOrganizationAssignment' + usernameClaim: + type: array + items: + type: string + description: JSON path to the username claim in the JWT token as an array of path segments (e.g., ["preferred_username"], ["email"], ["sub"]). + default: + - preferred_username + roleAssignment: + $ref: '#/components/schemas/AuthRoleAssignment' + required: + - providerType + - issuer + - clientId + - clientSecret + - organizationAssignment + - roleAssignment + OAuth2ProviderSpec: + type: object + description: OAuth2ProviderSpec describes an OAuth2 provider configuration. + properties: + providerType: + type: string + enum: + - oauth2 + description: The type of authentication provider. + displayName: + type: string + description: Human-readable display name for the provider. + issuer: + type: string + description: The OAuth2 issuer identifier (used for issuer identification in tokens). + authorizationUrl: + type: string + description: The OAuth2 authorization endpoint URL. + tokenUrl: + type: string + description: The OAuth2 token endpoint URL. + userinfoUrl: + type: string + description: The OAuth2 userinfo endpoint URL. + clientId: + type: string + description: The OAuth2 client ID. + clientSecret: + type: string + description: The OAuth2 client secret. + enabled: + type: boolean + description: Whether this OAuth2 provider is enabled. + default: true + scopes: + type: array + items: + type: string + description: List of OAuth2 scopes to request. + organizationAssignment: + $ref: '#/components/schemas/AuthOrganizationAssignment' + usernameClaim: + type: array + items: + type: string + description: JSON path to the username claim in the userinfo response as an array of path segments (e.g., ["preferred_username"], ["email"], ["sub"]). + default: + - preferred_username + roleAssignment: + $ref: '#/components/schemas/AuthRoleAssignment' + introspection: + $ref: '#/components/schemas/OAuth2Introspection' + required: + - providerType + - authorizationUrl + - tokenUrl + - userinfoUrl + - clientId + - clientSecret + - organizationAssignment + - roleAssignment + OAuth2Introspection: + type: object + description: OAuth2Introspection defines the token introspection configuration. + oneOf: + - $ref: '#/components/schemas/Rfc7662IntrospectionSpec' + - $ref: '#/components/schemas/GitHubIntrospectionSpec' + - $ref: '#/components/schemas/JwtIntrospectionSpec' + discriminator: + propertyName: type + mapping: + rfc7662: '#/components/schemas/Rfc7662IntrospectionSpec' + github: '#/components/schemas/GitHubIntrospectionSpec' + jwt: '#/components/schemas/JwtIntrospectionSpec' + Rfc7662IntrospectionSpec: + type: object + description: Rfc7662IntrospectionSpec defines token introspection using RFC 7662 standard. Uses the OAuth2ProviderSpec clientId and clientSecret for authentication. + properties: + type: + type: string + enum: + - rfc7662 + description: The introspection type. + url: + type: string + description: The RFC 7662 token introspection endpoint URL. + required: + - type + - url + GitHubIntrospectionSpec: + type: object + description: GitHubIntrospectionSpec defines token introspection using GitHub API (POST /applications/{client_id}/token). Uses the OAuth2ProviderSpec clientId and clientSecret for Basic Auth and URL path. + properties: + type: + type: string + enum: + - github + description: The introspection type. + url: + type: string + description: The GitHub API base URL. Defaults to https://api.github.com for GitHub.com, but can be customized for GitHub Enterprise Server. + default: https://api.github.com + required: + - type + JwtIntrospectionSpec: + type: object + description: JwtIntrospectionSpec defines token introspection using JWT validation with JWKS. + properties: + type: + type: string + enum: + - jwt + description: The introspection type. + jwksUrl: + type: string + description: The JWKS (JSON Web Key Set) endpoint URL for fetching public keys to validate JWT signatures. + issuer: + type: string + description: Expected issuer claim value in the JWT. If not specified, uses the OAuth2ProviderSpec issuer. + audience: + type: array + items: + type: string + description: Expected audience claim values in the JWT. If not specified, uses the OAuth2ProviderSpec clientId. + required: + - type + - jwksUrl + OpenShiftProviderSpec: + type: object + description: OpenShiftProviderSpec describes an OpenShift OAuth provider configuration. + properties: + providerType: + type: string + enum: + - openshift + description: The type of authentication provider. + displayName: + type: string + description: Human-readable display name for the provider. + issuer: + type: string + description: The OAuth2 issuer identifier (used for issuer identification in tokens). + authorizationUrl: + type: string + description: The OAuth2 authorization endpoint URL. + tokenUrl: + type: string + description: The OAuth2 token endpoint URL. + clientId: + type: string + description: The OAuth2 client ID. + clientSecret: + type: string + description: The OAuth2 client secret. + enabled: + type: boolean + description: Whether this OpenShift provider is enabled. + default: true + scopes: + type: array + items: + type: string + description: List of OAuth2 scopes to request. + clusterControlPlaneUrl: + type: string + description: The OpenShift cluster control plane URL. + projectLabelFilter: + type: string + description: If specified, only projects with this label will be considered. The label selector should be in the format 'key' or 'key=value'. If only the key is provided, any project with that label (regardless of value) will be included. This enables server-side filtering for better performance. + roleSuffix: + type: string + description: Optional suffix to strip from ClusterRole names when normalizing role names. Used for multi-release deployments where ClusterRoles have namespace-specific names (e.g., flightctl-admin-). + organizationNamePrefix: + type: string + description: Optional prefix for organization (project) names. Incoming names are exposed as prefix + name (e.g. 'ocp-' + project). + required: + - providerType + AapProviderSpec: + type: object + description: AapProviderSpec describes an Ansible Automation Platform (AAP) provider configuration. + properties: + providerType: + type: string + enum: + - aap + description: The type of authentication provider. + displayName: + type: string + description: Human-readable display name for the provider. + apiUrl: + type: string + description: The internal AAP API URL. + authorizationUrl: + type: string + description: The OAuth2 authorization endpoint URL. + tokenUrl: + type: string + description: The OAuth2 token endpoint URL. + clientId: + type: string + description: The OAuth2 client ID. + clientSecret: + type: string + description: The OAuth2 client secret. + enabled: + type: boolean + description: Whether this AAP provider is enabled. + default: true + scopes: + type: array + items: + type: string + description: List of OAuth2 scopes to request. + organizationNamePrefix: + type: string + description: Optional prefix for AAP organization names. Incoming names are exposed as prefix + name. + required: + - providerType + - apiUrl + - authorizationUrl + - tokenUrl + - clientId + - clientSecret + - scopes + K8sProviderSpec: + type: object + description: K8sProviderSpec describes a Kubernetes/OpenShift provider configuration. + properties: + providerType: + type: string + enum: + - k8s + description: The type of authentication provider. + displayName: + type: string + description: Human-readable display name for the provider. + apiUrl: + type: string + description: The internal Kubernetes API URL. + rbacNs: + type: string + description: The RBAC namespace for permissions. + enabled: + type: boolean + description: Whether this K8s provider is enabled. + default: true + organizationAssignment: + $ref: '#/components/schemas/AuthOrganizationAssignment' + roleAssignment: + $ref: '#/components/schemas/AuthRoleAssignment' + roleSuffix: + type: string + description: Optional suffix to strip from ClusterRole names when normalizing role names. Used for multi-release deployments where ClusterRoles have namespace-specific names (e.g., flightctl-admin-). + organizationNamePrefix: + type: string + description: Optional prefix for the organization name. The default org name is exposed as prefix + 'default' when set. + required: + - providerType + - apiUrl + AuthOrganizationAssignment: + type: object + description: AuthOrganizationAssignment defines how users from this auth provider are assigned to organizations. + oneOf: + - $ref: '#/components/schemas/AuthStaticOrganizationAssignment' + - $ref: '#/components/schemas/AuthDynamicOrganizationAssignment' + - $ref: '#/components/schemas/AuthPerUserOrganizationAssignment' + discriminator: + propertyName: type + mapping: + static: '#/components/schemas/AuthStaticOrganizationAssignment' + dynamic: '#/components/schemas/AuthDynamicOrganizationAssignment' + perUser: '#/components/schemas/AuthPerUserOrganizationAssignment' + AuthStaticOrganizationAssignment: + type: object + description: AuthStaticOrganizationAssignment assigns all users from this auth provider to a single static organization. + properties: + type: + type: string + enum: + - static + description: The type of organization assignment. + organizationName: + type: string + description: The name of the organization where all users will be assigned. + required: + - type + - organizationName + AuthDynamicOrganizationAssignment: + type: object + description: AuthDynamicOrganizationAssignment assigns users to organizations based on auth provider claims. + properties: + type: + type: string + enum: + - dynamic + description: The type of organization assignment. + claimPath: + type: array + items: + type: string + description: The JSON path to the claim that contains the organization identifier (e.g., ["groups", "0"] or ["custom", "org"]). + organizationNamePrefix: + type: string + description: The prefix for the organization name (e.g., "org-"). + default: '' + organizationNameSuffix: + type: string + description: The suffix for the organization name (e.g., "-org"). + default: '' + required: + - type + - claimPath + AuthPerUserOrganizationAssignment: + type: object + description: AuthPerUserOrganizationAssignment creates a separate organization for each user. + properties: + type: + type: string + enum: + - perUser + description: The type of organization assignment. + organizationNamePrefix: + type: string + description: The prefix for the user-specific organization name (e.g., "user-org-"). + default: user-org- + organizationNameSuffix: + type: string + description: The suffix for the user-specific organization name (e.g., "-org"). + default: '' + required: + - type + AuthRoleAssignment: + type: object + description: AuthRoleAssignment defines how roles are assigned to users from this auth provider. + oneOf: + - $ref: '#/components/schemas/AuthStaticRoleAssignment' + - $ref: '#/components/schemas/AuthDynamicRoleAssignment' + discriminator: + propertyName: type + mapping: + static: '#/components/schemas/AuthStaticRoleAssignment' + dynamic: '#/components/schemas/AuthDynamicRoleAssignment' + AuthStaticRoleAssignment: + type: object + description: AuthStaticRoleAssignment assigns a static set of roles to all users from this auth provider. + properties: + type: + type: string + enum: + - static + description: The type of role assignment. + roles: + type: array + items: + type: string + description: The list of role names to assign to all users. + required: + - type + - roles + AuthDynamicRoleAssignment: + type: object + description: AuthDynamicRoleAssignment extracts roles from auth provider claims using a JSON path. + properties: + type: + type: string + enum: + - dynamic + description: The type of role assignment. + claimPath: + type: array + items: + type: string + description: The JSON path to the role/group claim (e.g., ["groups"], ["roles"], ["realm_access", "roles"]). + separator: + type: string + description: Separator for org:role format (default ':'). Roles containing the separator are split into organization-scoped roles. Roles without separator are global and apply to all organizations. + default: ':' + required: + - type + - claimPath + AuthProviderList: + type: object + properties: + apiVersion: + $ref: '#/components/schemas/ApiVersion' + kind: + type: string + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds.' + metadata: + $ref: '#/components/schemas/ListMeta' + items: + type: array + description: List of auth providers. + items: + $ref: '#/components/schemas/AuthProvider' + required: + - apiVersion + - kind + - metadata + - items + description: AuthProviderList is a list of auth providers. + PermissionList: + type: object + description: List of available permissions for a user. + properties: + permissions: + type: array + description: List of permissions available to the user. + items: + $ref: '#/components/schemas/Permission' + required: + - permissions + Permission: + type: object + description: A permission defining allowed operations on a resource. + properties: + resource: + type: string + description: The resource (e.g., "devices", "fleets", "*" for all resources). + operations: + type: array + description: List of allowed operations (e.g., "get", "list", "create", "update", "patch", "delete", "*" for all operations). + items: + type: string + required: + - resource + - operations + CheckRepositoryOciTagRequest: + type: object + description: Request to check if a specific image tag exists in an OCI registry. + properties: + imageName: + type: string + description: The image name/path within the registry (e.g. "centos-bootc/centos-bootc"). Combined with the registry host from the Repository resource, this forms the full repository reference (e.g. "quay.io/centos-bootc/centos-bootc"). + minLength: 1 + maxLength: 255 + tag: + type: string + description: The image tag to check for existence (e.g. "9.5"). + minLength: 1 + maxLength: 128 + pattern: ^[\w][\w.-]{0,127}$ + required: + - imageName + - tag + additionalProperties: false + CheckRepositoryOciResult: + type: object + description: Result of an OCI registry check (tag existence or image accessibility). + properties: + accessible: + type: boolean + description: Whether the image or tag is accessible in the registry. + errorCode: + type: integer + description: HTTP status code returned by the OCI registry when accessible is false. Absent when the failure is not an HTTP-level error (e.g. network timeout). + errorMessage: + type: string + description: Error message describing why the image or tag is not accessible. + required: + - accessible + additionalProperties: false + CheckRepositoryOciImageRequest: + type: object + description: Request to check if a specific OCI image is accessible in a registry. + properties: + imageName: + type: string + description: The image name/path within the registry (e.g. "centos-bootc/centos-bootc"). Combined with the registry host from the Repository resource, this forms the full image reference (e.g. "quay.io/centos-bootc/centos-bootc"). + minLength: 1 + maxLength: 255 + required: + - imageName + additionalProperties: false + ImageSpec: + type: object + description: Reference to an OCI image or artifact with tag. + properties: + image: + description: Reference to an OCI image or artifact with tag. + type: string + required: + - image + CatalogItemRefSpec: + type: object + description: A reference to a catalog item, along with its configuration. + properties: + catalog: + type: string + description: The catalog name that the item is part of. + item: + type: string + description: The name of the catalog item itself. + version: + type: string + description: A valid version that currently exists in the catalog item. + channel: + type: string + description: An optional update channel which will be used to provide update cues when available. + required: + - catalog + - item + - version + additionalProperties: false diff --git a/api/bundled/imagebuilder-v1alpha1.yaml b/api/bundled/imagebuilder-v1alpha1.yaml new file mode 100644 index 0000000..db69923 --- /dev/null +++ b/api/bundled/imagebuilder-v1alpha1.yaml @@ -0,0 +1,2201 @@ +openapi: 3.0.1 +info: + title: Flight Control Image Builder API + version: v1alpha1 + description: | + Image Builder service for Flight Control. + This service manages image build resources for building and pushing container images. + contact: + name: The Flight Control Team + url: https://flightctl.io + email: team@flightctl.io + license: + name: Apache 2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html +servers: + - url: / +tags: + - name: imagebuild + description: Operations on ImageBuild resources. + - name: imageexport + description: Operations on ImageExport resources. + - name: imagepromotion + description: Operations on ImagePromotion resources. +paths: + /api/v1/imagebuilds: + x-resource: imagebuilds + get: + tags: + - imagebuild + description: List ImageBuild resources. + operationId: listImageBuilds + parameters: + - name: labelSelector + in: query + description: A selector to restrict the list of returned objects by their labels. + schema: + type: string + - name: fieldSelector + in: query + description: A selector to restrict the list of returned objects by their fields. + schema: + type: string + - name: limit + in: query + description: The maximum number of results returned in the list response. + schema: + type: integer + format: int32 + minimum: 0 + maximum: 1000 + - name: continue + in: query + description: An optional parameter to query more results from the server. + schema: + type: string + - name: withExports + in: query + description: If true, includes related ImageExport resources in each ImageBuild in the response. + schema: + type: boolean + default: false + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ImageBuildList' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + post: + tags: + - imagebuild + description: Create an ImageBuild resource. + operationId: createImageBuild + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ImageBuild' + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/ImageBuild' + links: + GetImageBuild: + operationId: getImageBuild + parameters: + name: $response.body#/metadata/name + DeleteImageBuild: + operationId: deleteImageBuild + parameters: + name: $response.body#/metadata/name + GetImageBuildLog: + operationId: getImageBuildLog + parameters: + name: $response.body#/metadata/name + CancelImageBuild: + operationId: cancelImageBuild + parameters: + name: $response.body#/metadata/name + CreateImageExport: + operationId: createImageExport + requestBody: + apiVersion: flightctl.io/v1alpha1 + kind: ImageExport + metadata: + name: $response.body#/metadata/name + spec: + source: + type: imageBuild + imageBuildRef: $response.body#/metadata/name + format: qcow2 + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '409': + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/imagebuilds/{name}: + x-resource: imagebuilds + get: + tags: + - imagebuild + description: Get an ImageBuild resource. + operationId: getImageBuild + parameters: + - name: name + in: path + description: The name of the ImageBuild resource. + required: true + schema: + type: string + - name: withExports + in: query + description: If true, includes related ImageExport resources in the response. + schema: + type: boolean + default: false + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ImageBuild' + '400': + description: Bad Request. + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + delete: + tags: + - imagebuild + description: Delete an ImageBuild resource. + operationId: deleteImageBuild + parameters: + - name: name + in: path + description: The name of the ImageBuild resource. + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '400': + description: Bad Request. + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/imagebuilds/{name}/log: + x-resource: imagebuilds/log + get: + tags: + - imagebuild + description: Get logs for an ImageBuild resource. For active builds, streams logs live. For completed builds, returns last 500 lines. + operationId: getImageBuildLog + parameters: + - name: name + in: path + description: The name of the ImageBuild resource. + required: true + schema: + type: string + - name: follow + in: query + description: If true, stream logs continuously (like kubectl logs -f). For active builds, keeps connection open. For completed builds, returns all logs and closes. + schema: + type: boolean + default: false + responses: + '200': + description: OK + content: + text/plain: + schema: + type: string + description: Log output as plain text (when follow=false or for completed builds) + text/event-stream: + schema: + type: string + description: Log output as Server-Sent Events stream (when follow=true for active builds) + '400': + description: Bad Request. + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/imagebuilds/{name}/cancel: + x-resource: imagebuilds/cancel + post: + tags: + - imagebuild + description: Cancel a running ImageBuild. Only builds in Pending, Building, or Pushing state can be canceled. + operationId: cancelImageBuild + parameters: + - name: name + in: path + description: The name of the ImageBuild resource to cancel. + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ImageBuild' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '409': + description: Conflict - Build not in cancelable state + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/imagebuilds/{name}/newversion: + x-resource: imagebuilds/newversion + post: + tags: + - imagebuild + description: Create a new ImageBuild derived from an existing one, copying its spec with optional tag overrides. Sets flightctl.io/new-version-from annotation to record lineage. + operationId: createImageBuildNewVersion + parameters: + - name: name + in: path + description: The name of the parent ImageBuild resource. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ImageBuildNewVersionRequest' + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/ImageBuild' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found - parent ImageBuild does not exist + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '409': + description: Conflict - ImageBuild with given name already exists + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/imageexports: + x-resource: imageexports + get: + tags: + - imageexport + description: List ImageExport resources. + operationId: listImageExports + parameters: + - name: labelSelector + in: query + description: A selector to restrict the list of returned objects by their labels. + schema: + type: string + - name: fieldSelector + in: query + description: A selector to restrict the list of returned objects by their fields. + schema: + type: string + - name: limit + in: query + description: The maximum number of results returned in the list response. + schema: + type: integer + format: int32 + minimum: 0 + maximum: 1000 + - name: continue + in: query + description: An optional parameter to query more results from the server. + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ImageExportList' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + post: + tags: + - imageexport + description: Create an ImageExport resource. + operationId: createImageExport + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ImageExport' + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/ImageExport' + links: + GetImageExport: + operationId: getImageExport + parameters: + name: $response.body#/metadata/name + DeleteImageExport: + operationId: deleteImageExport + parameters: + name: $response.body#/metadata/name + GetImageExportLog: + operationId: getImageExportLog + parameters: + name: $response.body#/metadata/name + CancelImageExport: + operationId: cancelImageExport + parameters: + name: $response.body#/metadata/name + DownloadImageExport: + operationId: downloadImageExport + parameters: + name: $response.body#/metadata/name + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '409': + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/imageexports/{name}: + x-resource: imageexports + get: + tags: + - imageexport + description: Get an ImageExport resource. + operationId: getImageExport + parameters: + - name: name + in: path + description: The name of the ImageExport resource. + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ImageExport' + '400': + description: Bad Request. + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + delete: + tags: + - imageexport + description: Delete an ImageExport resource. + operationId: deleteImageExport + parameters: + - name: name + in: path + description: The name of the ImageExport resource. + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '400': + description: Bad Request. + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/imageexports/{name}/cancel: + x-resource: imageexports/cancel + post: + tags: + - imageexport + description: Cancel a running ImageExport. Only exports in Pending, Converting, or Pushing state can be canceled. + operationId: cancelImageExport + parameters: + - name: name + in: path + description: The name of the ImageExport resource to cancel. + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ImageExport' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '409': + description: Conflict - Export not in cancelable state + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/imageexports/{name}/download: + x-resource: imageexports/download + get: + tags: + - imageexport + description: Download an ImageExport artifact from the registry. + operationId: downloadImageExport + parameters: + - name: name + in: path + description: The name of the ImageExport resource. + required: true + schema: + type: string + responses: + '200': + description: OK - Artifact blob content + content: + application/octet-stream: + schema: + type: string + format: binary + '302': + description: Found - Redirect to registry blob URL + headers: + Location: + schema: + type: string + '307': + description: Temporary Redirect - Redirect to registry blob URL + headers: + Location: + schema: + type: string + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/imageexports/{name}/log: + x-resource: imageexports/log + get: + tags: + - imageexport + description: Get logs for an ImageExport resource. For active exports, streams logs live. For completed exports, returns last 500 lines. + operationId: getImageExportLog + parameters: + - name: name + in: path + description: The name of the ImageExport resource. + required: true + schema: + type: string + - name: follow + in: query + description: If true, stream logs continuously (like kubectl logs -f). For active exports, keeps connection open. For completed exports, returns all logs and closes. + schema: + type: boolean + default: false + responses: + '200': + description: OK + content: + text/plain: + schema: + type: string + description: Log output as plain text (when follow=false or for completed exports) + text/event-stream: + schema: + type: string + description: Log output as Server-Sent Events stream (when follow=true for active exports) + '400': + description: Bad Request. + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/imagepromotions: + x-resource: imagepromotions + get: + tags: + - imagepromotion + description: List ImagePromotion resources. + operationId: listImagePromotions + parameters: + - name: labelSelector + in: query + description: A selector to restrict the list of returned objects by their labels. + schema: + type: string + - name: fieldSelector + in: query + description: A selector to restrict the list of returned objects by their fields. + schema: + type: string + - name: limit + in: query + description: The maximum number of results returned in the list response. + schema: + type: integer + format: int32 + minimum: 0 + maximum: 1000 + - name: continue + in: query + description: An optional parameter to query more results from the server. + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ImagePromotionList' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + post: + tags: + - imagepromotion + description: Create an ImagePromotion resource to publish a completed image build to the software catalog. + operationId: createImagePromotion + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ImagePromotion' + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/ImagePromotion' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '409': + description: Conflict - an ImagePromotion with the given name already exists. + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/imagepromotions/{name}: + x-resource: imagepromotions + get: + tags: + - imagepromotion + description: Get an ImagePromotion resource. + operationId: getImagePromotion + parameters: + - name: name + in: path + description: The name of the ImagePromotion resource. + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ImagePromotion' + '400': + description: Bad Request. + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + put: + tags: + - imagepromotion + description: | + Replace an ImagePromotion resource. Only spec.source.exportFormats (append-only — the submitted list must be a superset of the current list) and metadata.labels may be changed. All other spec fields must be identical to the stored values or a 400 is returned. The promotion must not be in Failed or Publishing state. + operationId: replaceImagePromotion + parameters: + - name: name + in: path + description: The name of the ImagePromotion resource. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ImagePromotion' + required: true + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ImagePromotion' + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/ImagePromotion' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '409': + description: Conflict - concurrent update conflict. + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + patch: + tags: + - imagepromotion + description: | + Patch an ImagePromotion resource using RFC 6902 JSON Patch. Only operations targeting /spec/source/exportFormats (or its children) and /metadata/labels are accepted. Export formats may only be added (append-only). The promotion must not be in Failed or Publishing state. + operationId: patchImagePromotion + parameters: + - name: name + in: path + description: The name of the ImagePromotion resource. + required: true + schema: + type: string + requestBody: + content: + application/json-patch+json: + schema: + $ref: '#/components/schemas/PatchRequest' + required: true + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ImagePromotion' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '409': + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + delete: + tags: + - imagepromotion + description: Delete an ImagePromotion resource. + operationId: deleteImagePromotion + parameters: + - name: name + in: path + description: The name of the ImagePromotion resource. + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '400': + description: Bad Request. + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '409': + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' +components: + securitySchemes: + bearerAuth: + type: http + scheme: bearer + bearerFormat: JWT + orgId: + type: apiKey + in: query + name: org_id + description: The UUID of the organization that owns the resource. Maps to an organizations metadata.name. + schemas: + ApiVersion: + type: string + x-go-type: string + description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources.' + enum: + - v1alpha1 + - flightctl.io/v1alpha1 + x-enum-varnames: + - ApiVersionV1alpha1 + - ApiVersionFlightctlIoV1alpha1 + ResourceKind: + type: string + enum: + - ImageBuild + - ImageExport + - ImagePromotion + description: Resource types exposed via the ImageBuilder API. + ImageBuild: + type: object + description: ImageBuild represents a build request for a container image. + properties: + apiVersion: + $ref: '#/components/schemas/ApiVersion' + kind: + type: string + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds.' + metadata: + $ref: '#/components/schemas/ObjectMeta' + spec: + $ref: '#/components/schemas/ImageBuildSpec' + status: + $ref: '#/components/schemas/ImageBuildStatus' + imageexports: + type: array + description: Array of ImageExport resources that reference this ImageBuild. Only populated when withExports query parameter is true. + items: + $ref: '#/components/schemas/ImageExport' + required: + - apiVersion + - kind + - metadata + - spec + example: + apiVersion: flightctl.io/v1alpha1 + kind: ImageBuild + metadata: + name: centos-bootc-stream9-build + spec: + source: + repository: quay-io + imageName: centos-bootc/centos-bootc + imageTag: stream9 + destination: + repository: my-registry + imageName: my-user/centos-bootc-custom + imageTag: v1.0.0 + binding: + type: late + additionalProperties: false + ImageBuildList: + type: object + description: ImageBuildList is a list of ImageBuild resources. + properties: + apiVersion: + $ref: '#/components/schemas/ApiVersion' + kind: + type: string + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds.' + metadata: + $ref: '#/components/schemas/ListMeta' + items: + type: array + description: List of ImageBuild resources. + items: + $ref: '#/components/schemas/ImageBuild' + required: + - apiVersion + - kind + - metadata + - items + ImageBuildSpec: + type: object + description: ImageBuildSpec describes the specification for an image build. + properties: + source: + $ref: '#/components/schemas/ImageBuildSource' + destination: + $ref: '#/components/schemas/ImageBuildDestination' + binding: + $ref: '#/components/schemas/ImageBuildBinding' + userConfiguration: + $ref: '#/components/schemas/ImageBuildUserConfiguration' + onboarding: + type: boolean + description: When true, installs the flightctl-onboarding RPM and enables flightctl-onboarding-setup.service for first-boot device configuration via a Cockpit-based onboarding wizard. Compatible with both early and late binding. Defaults to false. + required: + - source + - destination + - binding + additionalProperties: false + ImageBuildSource: + type: object + description: ImageBuildSource specifies the source image for the build. + properties: + repository: + type: string + minLength: 1 + description: The name of the Repository resource of type OCI containing the source image. + imageName: + type: string + minLength: 1 + maxLength: 255 + description: The name of the source image. + imageTag: + type: string + minLength: 1 + maxLength: 128 + pattern: ^[\w][\w.-]{0,127}$ + description: The tag of the source image. + required: + - repository + - imageName + - imageTag + ImageBuildDestination: + type: object + description: ImageBuildDestination specifies the destination for the built image. + properties: + repository: + type: string + minLength: 1 + description: The name of the Repository resource of type OCI to push the built image to. + imageName: + type: string + minLength: 1 + maxLength: 255 + description: The name of the output image. + imageTag: + type: string + minLength: 1 + maxLength: 128 + pattern: ^[\w][\w.-]{0,127}$ + description: The tag of the output image. + required: + - repository + - imageName + - imageTag + ImageBuildBinding: + description: ImageBuildBinding specifies binding configuration for the build. + oneOf: + - $ref: '#/components/schemas/EarlyBinding' + - $ref: '#/components/schemas/LateBinding' + discriminator: + propertyName: type + mapping: + early: '#/components/schemas/EarlyBinding' + late: '#/components/schemas/LateBinding' + ImageBuildUserConfiguration: + type: object + description: ImageBuildUserConfiguration specifies user configuration for the build. + properties: + username: + type: string + description: The username for the user configuration. + publickey: + type: string + description: The public key for the user configuration. + required: + - username + - publickey + EarlyBinding: + type: object + description: Early binding configuration - embeds certificate in the image. + required: + - type + properties: + type: + type: string + enum: + - early + description: The type of binding. + LateBinding: + type: object + description: Late binding configuration - device binds at first boot. + required: + - type + properties: + type: + type: string + enum: + - late + description: The type of binding. + BindingType: + type: string + description: The type of binding for the image build. + enum: + - early + - late + x-enum-varnames: + - BindingTypeEarly + - BindingTypeLate + ImageBuildStatus: + type: object + description: ImageBuildStatus represents the current status of an ImageBuild. + properties: + conditions: + type: array + description: Current conditions of the ImageBuild. + items: + $ref: '#/components/schemas/ImageBuildCondition' + imageReference: + type: string + description: The full image reference of the built image (e.g., quay.io/org/imagename:tag). + architecture: + type: string + description: The architecture of the built image. + manifestDigest: + type: string + description: The digest of the built image manifest. + lastSeen: + type: string + format: date-time + description: The last time the build was seen (heartbeat). + ImageBuildCondition: + description: Condition for ImageBuild resources. + allOf: + - $ref: '#/components/schemas/ConditionBase' + - type: object + required: + - type + properties: + type: + $ref: '#/components/schemas/ImageBuildConditionType' + ImageBuildConditionType: + type: string + description: Type of ImageBuild condition. + enum: + - Ready + x-enum-varnames: + - ImageBuildConditionTypeReady + ImageBuildConditionReason: + type: string + description: Reason for the ImageBuild Ready condition. + enum: + - Pending + - Building + - Pushing + - GeneratingSBOM + - Completed + - Failed + - Canceling + - Canceled + x-enum-varnames: + - ImageBuildConditionReasonPending + - ImageBuildConditionReasonBuilding + - ImageBuildConditionReasonPushing + - ImageBuildConditionReasonGeneratingSBOM + - ImageBuildConditionReasonCompleted + - ImageBuildConditionReasonFailed + - ImageBuildConditionReasonCanceling + - ImageBuildConditionReasonCanceled + ImageExport: + type: object + description: ImageExport represents an export request to convert and push images to different formats. + properties: + apiVersion: + $ref: '#/components/schemas/ApiVersion' + kind: + type: string + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds.' + metadata: + $ref: '#/components/schemas/ObjectMeta' + spec: + $ref: '#/components/schemas/ImageExportSpec' + status: + $ref: '#/components/schemas/ImageExportStatus' + required: + - apiVersion + - kind + - metadata + - spec + example: + apiVersion: flightctl.io/v1alpha1 + kind: ImageExport + metadata: + name: my-edge-export-from-build + spec: + source: + type: imageBuild + imageBuildRef: centos-bootc-stream9-build + format: qcow2 + additionalProperties: false + ImageExportList: + type: object + description: ImageExportList is a list of ImageExport resources. + properties: + apiVersion: + $ref: '#/components/schemas/ApiVersion' + kind: + type: string + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds.' + metadata: + $ref: '#/components/schemas/ListMeta' + items: + type: array + description: List of ImageExport resources. + items: + $ref: '#/components/schemas/ImageExport' + required: + - apiVersion + - kind + - metadata + - items + ImageExportSpec: + type: object + description: ImageExportSpec describes the specification for an image export. + properties: + source: + $ref: '#/components/schemas/ImageExportSource' + format: + $ref: '#/components/schemas/ExportFormatType' + required: + - source + - format + additionalProperties: false + ImageExportSource: + description: ImageExportSource specifies the source image for the export. + oneOf: + - $ref: '#/components/schemas/ImageBuildRefSource' + discriminator: + propertyName: type + mapping: + imageBuild: '#/components/schemas/ImageBuildRefSource' + ImageBuildRefSource: + type: object + description: ImageBuildRefSource specifies a source image from an ImageBuild resource. + required: + - type + - imageBuildRef + properties: + type: + type: string + enum: + - imageBuild + description: The type of source. + imageBuildRef: + type: string + minLength: 1 + description: The name of the ImageBuild resource to use as source. + ImageExportSourceType: + type: string + description: The type of source for the image export. + enum: + - imageBuild + x-enum-varnames: + - ImageExportSourceTypeImageBuild + ExportFormatType: + type: string + description: The type of format to export the image to. + enum: + - vmdk + - qcow2 + - iso + - qcow2-disk-container + x-enum-varnames: + - ExportFormatTypeVMDK + - ExportFormatTypeQCOW2 + - ExportFormatTypeISO + - ExportFormatTypeQCOW2DiskContainer + ImageExportStatus: + type: object + description: ImageExportStatus represents the current status of an ImageExport. + properties: + conditions: + type: array + description: Current conditions of the ImageExport. + items: + $ref: '#/components/schemas/ImageExportCondition' + manifestDigest: + type: string + description: The digest of the exported image manifest for this format. + lastSeen: + type: string + format: date-time + description: The last time the export was seen (heartbeat). + ImageExportCondition: + description: Condition for ImageExport resources. + allOf: + - $ref: '#/components/schemas/ConditionBase' + - type: object + required: + - type + properties: + type: + $ref: '#/components/schemas/ImageExportConditionType' + ImageExportConditionType: + type: string + description: Type of ImageExport condition. + enum: + - Ready + x-enum-varnames: + - ImageExportConditionTypeReady + ImageExportConditionReason: + type: string + description: Reason for the ImageExport Ready condition. + enum: + - Pending + - Converting + - Pushing + - Completed + - Failed + - Canceling + - Canceled + x-enum-varnames: + - ImageExportConditionReasonPending + - ImageExportConditionReasonConverting + - ImageExportConditionReasonPushing + - ImageExportConditionReasonCompleted + - ImageExportConditionReasonFailed + - ImageExportConditionReasonCanceling + - ImageExportConditionReasonCanceled + ImageExportFormatPhase: + type: string + description: The phase of a single format conversion. + enum: + - queued + - converting + - pushing + - complete + - failed + x-enum-varnames: + - ImageExportFormatPhaseQueued + - ImageExportFormatPhaseConverting + - ImageExportFormatPhasePushing + - ImageExportFormatPhaseComplete + - ImageExportFormatPhaseFailed + Status: + type: object + properties: + apiVersion: + $ref: '#/components/schemas/ApiVersion' + kind: + type: string + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds.' + code: + type: integer + format: int32 + description: Suggested HTTP return code for this status, 0 if not set. + message: + type: string + description: A human-readable description of the status of this operation. + reason: + type: string + description: A machine-readable description of why this operation is in the "Failure" status. If this value is empty there is no information available. A Reason clarifies an HTTP status code but does not override it. + status: + type: string + description: 'Status of the operation. One of: "Success" or "Failure". More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status.' + description: Status is a return value for calls that don't return other objects. + required: + - apiVersion + - kind + - status + - code + - reason + - message + ImageBuildNewVersionRequest: + type: object + description: Request body for the newversion subresource endpoint. + properties: + name: + type: string + minLength: 1 + maxLength: 253 + description: Name for the new ImageBuild resource. + sourceImageTag: + type: string + minLength: 1 + maxLength: 128 + pattern: ^[\w][\w.-]{0,127}$ + description: Override for spec.source.imageTag. If omitted, the parent's tag is used. + destinationImageTag: + type: string + minLength: 1 + maxLength: 128 + pattern: ^[\w][\w.-]{0,127}$ + description: Override for spec.destination.imageTag. If omitted, the parent's tag is used. + required: + - name + additionalProperties: false + ImagePromotion: + type: object + description: ImagePromotion tracks a single publish attempt from an ImageBuild to a CatalogItem. + properties: + apiVersion: + $ref: '#/components/schemas/ApiVersion' + kind: + type: string + description: Kind is a string value representing the REST resource this object represents. + metadata: + $ref: '#/components/schemas/ObjectMeta' + spec: + $ref: '#/components/schemas/ImagePromotionSpec' + status: + $ref: '#/components/schemas/ImagePromotionStatus' + required: + - apiVersion + - kind + - metadata + - spec + additionalProperties: false + ImagePromotionList: + type: object + description: ImagePromotionList is a list of ImagePromotion resources. + properties: + apiVersion: + $ref: '#/components/schemas/ApiVersion' + kind: + type: string + description: Kind is a string value representing the REST resource this object represents. + metadata: + $ref: '#/components/schemas/ListMeta' + items: + type: array + description: List of ImagePromotion resources. + items: + $ref: '#/components/schemas/ImagePromotion' + required: + - apiVersion + - kind + - metadata + - items + ImagePromotionSpec: + type: object + description: Desired state of an ImagePromotion resource. + properties: + source: + $ref: '#/components/schemas/ImagePromotionSource' + target: + $ref: '#/components/schemas/ImagePromotionTarget' + required: + - source + - target + additionalProperties: false + ImagePromotionSource: + type: object + description: Identifies the artifact(s) to publish. + properties: + imageBuildRef: + type: string + minLength: 1 + description: Name of the ImageBuild resource this promotion is linked to. The container/bootc artifact produced by this build is always included in the CatalogItem version entry. + exportFormats: + type: array + description: Optional list of additional artifact formats to include in the CatalogItem version entry. The promotion waits in WaitingForArtifacts until at least one successful ImageExport exists for every requested format. + items: + $ref: '#/components/schemas/ExportFormatType' + required: + - imageBuildRef + additionalProperties: false + ImagePromotionTarget: + description: Specifies where and how to publish the artifact(s). The type field is the discriminator. + oneOf: + - $ref: '#/components/schemas/NewCatalogItemTarget' + - $ref: '#/components/schemas/ExistingCatalogItemTarget' + discriminator: + propertyName: type + mapping: + NewCatalogItem: '#/components/schemas/NewCatalogItemTarget' + ExistingCatalogItem: '#/components/schemas/ExistingCatalogItemTarget' + ImagePromotionTargetBase: + type: object + description: Common fields shared by all ImagePromotionTarget variants. + properties: + type: + type: string + description: Discriminator for the target type. + catalogName: + type: string + minLength: 1 + description: Name of the parent Catalog resource. + catalogItemName: + type: string + minLength: 1 + description: Name of the CatalogItem to create or update. + version: + type: string + description: Semver version string for the new CatalogItem version entry. + required: + - type + - catalogName + - catalogItemName + - version + NewCatalogItemTarget: + description: Publish target that creates a new CatalogItem. Rejected immediately if a CatalogItem with the given catalogItemName already exists. + allOf: + - $ref: '#/components/schemas/ImagePromotionTargetBase' + - type: object + additionalProperties: false + properties: + type: + type: string + enum: + - NewCatalogItem + description: Discriminator for the target type. + catalogName: + type: string + description: Name of the parent Catalog resource. + catalogItemName: + type: string + description: Name of the CatalogItem to create. + version: + type: string + description: Semver version string for the new CatalogItem version entry. + readme: + type: string + description: Optional item-level readme for the new CatalogItem. Markdown is supported. + displayName: + type: string + description: Optional human-readable display name for the new CatalogItem. + ExistingCatalogItemTarget: + description: Publish target that appends a version to an existing CatalogItem. Rejected immediately if the CatalogItem does not exist. + allOf: + - $ref: '#/components/schemas/ImagePromotionTargetBase' + - type: object + additionalProperties: false + properties: + type: + type: string + enum: + - ExistingCatalogItem + description: Discriminator for the target type. + catalogName: + type: string + description: Name of the parent Catalog resource. + catalogItemName: + type: string + description: Name of the CatalogItem to update. + version: + type: string + description: Semver version string for the new CatalogItem version entry. + readme: + type: string + description: Optional version-level readme for this version entry. Markdown is supported. + replaces: + type: string + description: The single version this one replaces, defining the primary upgrade edge. + skips: + type: array + items: + type: string + description: Additional versions that can upgrade directly to this one. + skipRange: + type: string + description: Semver range of versions that can upgrade directly to this one (e.g. ">=1.0.0 <1.3.0"). + ImagePromotionStatus: + type: object + description: Observed state of an ImagePromotion resource. + properties: + conditions: + type: array + description: Conditions describing the current state of the promotion lifecycle. + items: + $ref: '#/components/schemas/ImagePromotionCondition' + publishedAt: + type: string + format: date-time + description: Timestamp of the initial successful promotion. Set once when the promotion first reaches Completed state. Not updated by subsequent amendments. + lastAmendedAt: + type: string + format: date-time + description: Timestamp of the most recent successful amendment (i.e., when the last additional export format was written to the CatalogItemVersion). Absent if the promotion has never been amended. + artifactStatuses: + type: array + description: Per-artifact readiness summary. One entry for the ImageBuild (container artifact) and one entry per requested exportFormat. Updated as artifacts become available or as new formats are added via PATCH/PUT. + items: + $ref: '#/components/schemas/ArtifactPromotionStatus' + ArtifactPromotionStatus: + type: object + properties: + format: + type: string + description: Artifact format. "container" for the ImageBuild artifact; one of the exportFormats values for additional artifacts. + ready: + type: boolean + description: True when at least one successful artifact of this format is available. + published: + type: boolean + description: True when this format's artifact reference has been successfully written to the CatalogItemVersion. For the initial publish, all formats are published atomically. For amendments, formats added via PATCH/PUT start as published=false and transition to published=true when their CatalogItem patch succeeds. + resolvedExport: + type: string + description: Name of the ImageExport resource that will be (or was) used for this format. Absent for the container artifact and for formats not yet ready. + required: + - format + - ready + - published + additionalProperties: false + ImagePromotionCondition: + description: Condition for ImagePromotion resources. + allOf: + - $ref: '#/components/schemas/ConditionBase' + - type: object + required: + - type + properties: + type: + $ref: '#/components/schemas/ImagePromotionConditionType' + ImagePromotionConditionType: + type: string + description: Type of ImagePromotion condition. + enum: + - Ready + x-enum-varnames: + - ImagePromotionConditionTypeReady + ImagePromotionConditionReason: + type: string + description: Reason for the ImagePromotion Ready condition. + enum: + - WaitingForArtifacts + - Publishing + - Completed + - Failed + - BuildFailed + - BuildCanceled + - AmendmentFailed + x-enum-varnames: + - ImagePromotionConditionReasonWaitingForArtifacts + - ImagePromotionConditionReasonPublishing + - ImagePromotionConditionReasonCompleted + - ImagePromotionConditionReasonFailed + - ImagePromotionConditionReasonBuildFailed + - ImagePromotionConditionReasonBuildCanceled + - ImagePromotionConditionReasonAmendmentFailed + ImagePromotionTargetType: + type: string + description: Discriminator for the promotion target type. + enum: + - NewCatalogItem + - ExistingCatalogItem + x-enum-varnames: + - ImagePromotionTargetTypeNewCatalogItem + - ImagePromotionTargetTypeExistingCatalogItem + ListMeta: + type: object + properties: + continue: + type: string + description: May be set if the user set a limit on the number of items returned, and indicates that the server has more data available. The value is opaque and may be used to issue another request to the endpoint that served this list to retrieve the next set of available objects. Continuing a consistent list may not be possible if the server configuration has changed or more than a few minutes have passed. The resourceVersion field returned when using this continue value will be identical to the value in the first response, unless you have received this token from an error message. + remainingItemCount: + type: integer + description: The number of subsequent items in the list which are not included in this list response. If the list request contained label or field selectors, then the number of remaining items is unknown and the field will be left unset and omitted during serialization. If the list is complete (either because it is not chunking or because this is the last chunk), then there are no more remaining items and this field will be left unset and omitted during serialization. Servers older than v1.15 do not set this field. The intended use of the remainingItemCount is *estimating* the size of a collection. Clients should not rely on the remainingItemCount to be set or to be exact. + format: int64 + description: ListMeta describes metadata that synthetic resources must have, including lists and various status objects. A resource may have only one of {ObjectMeta, ListMeta}. + ObjectMeta: + type: object + properties: + creationTimestamp: + type: string + description: The time the object was created. + format: date-time + deletionTimestamp: + type: string + description: The time the object will be deleted. + format: date-time + name: + type: string + maxLength: 253 + description: The name of the object. + labels: + type: object + description: Map of string keys and values that can be used to organize and categorize (scope and select) objects. + additionalProperties: + type: string + maxLength: 63 + generation: + type: integer + description: A sequence number representing a specific generation of the desired state. Populated by the system. Read-only. + format: int64 + owner: + type: string + description: A resource that owns this resource, in "kind/name" format. + annotations: + type: object + additionalProperties: + type: string + description: Properties set by the service. + resourceVersion: + type: string + description: An opaque string that identifies the server's internal version of an object. + description: ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create. + ConditionStatus: + type: string + description: Status of the condition, one of True, False, Unknown. + enum: + - 'True' + - 'False' + - Unknown + x-enum-varnames: + - ConditionStatusTrue + - ConditionStatusFalse + - ConditionStatusUnknown + ConditionBase: + type: object + description: Base condition structure following Kubernetes API conventions. Use with allOf to add a specific type enum. + required: + - status + - lastTransitionTime + - reason + - message + properties: + status: + $ref: '#/components/schemas/ConditionStatus' + observedGeneration: + type: integer + format: int64 + description: The .metadata.generation that the condition was set based upon. + lastTransitionTime: + type: string + format: date-time + description: The last time the condition transitioned from one status to another. + message: + type: string + description: Human readable message indicating details about last transition. + reason: + type: string + description: A (brief) reason for the condition's last transition. + PatchRequest: + type: array + items: + type: object + additionalProperties: false + required: + - op + - path + properties: + path: + description: A JSON Pointer path. + type: string + value: + description: The value to add or replace. + op: + description: The operation to perform. + type: string + enum: + - add + - replace + - remove + - test diff --git a/api/core/v1alpha1/openapi.yaml b/api/core/v1alpha1/openapi.yaml index 8805071..34de767 100644 --- a/api/core/v1alpha1/openapi.yaml +++ b/api/core/v1alpha1/openapi.yaml @@ -1101,6 +1101,79 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /catalogs/{catalog}/items/{name}/deployments: + x-resource: catalogs/deployments + get: + tags: + - catalog + description: Get the CatalogItemDeployments for a particular Catalog Item + operationId: getCatalogItemDeployments + parameters: + - name: catalog + in: path + description: The name of the Catalog resource. + required: true + schema: + type: string + example: edge-apps + - name: name + in: path + description: The name of the CatalogItem resource. + required: true + schema: + type: string + - name: continue + in: query + description: An optional parameter to query more results from the server. The value of the parameter must match the value of the 'continue' field in the previous list response. + required: false + schema: + type: string + - name: limit + in: query + description: 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. + required: false + schema: + type: integer + format: int32 + minimum: 0 + maximum: 1000 + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/CatalogItemDeploymentList' + "400": + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + "401": + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + "403": + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + "404": + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + "503": + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /vulnerabilities/summary: x-resource: vulnerabilities get: @@ -1925,6 +1998,7 @@ components: example: "2.45.0" references: type: object + x-go-type: 'map[CatalogItemArtifactType]string' minProperties: 1 additionalProperties: type: string @@ -1982,6 +2056,71 @@ components: - metadata - items additionalProperties: false + CatalogItemDeployment: + type: object + description: CatalogItemDeployment represents a specific deployment of a catalog item to a fleet or device. A catalog item associated to a fleet that has no devices is still considered a deployment. A deployment is only associated with the fleet and not the individual devices in cases where a device is using a catalog item deployment that came from a device spec template on a fleet. + properties: + apiVersion: + $ref: '#/components/schemas/ApiVersion' + kind: + type: string + description: 'Kind is a string value representing the REST resource this object represents.' + deployedTo: + type: object + description: 'The device or fleet that this deployment pertains to.' + properties: + resourceKind: + type: string + description: 'Either a Device or Fleet.' + resourceName: + type: string + description: 'The name of the device or fleet.' + catalog: + type: string + description: 'The catalog of the catalogItem.' + example: edge-apps + catalogItem: + type: string + description: 'The catalogItem that this deployment corresponds to.' + example: nginx + version: + type: string + description: 'The version of the catalog item that is deployed.' + channel: + type: string + description: The channel, if any, that is intended to be tracked for the catalog item. + applicationName: + type: string + description: For catalog items in the 'application' category, the name of the application on the device that the deployment is associated with. Required for application catalog items. + required: + - apiVersion + - kind + - catalog + - catalogItem + - version + additionalProperties: false + CatalogItemDeploymentList: + type: object + description: CatalogItemDeploymentList is a list of CatalogItemDeployments. + properties: + apiVersion: + $ref: '#/components/schemas/ApiVersion' + kind: + type: string + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds.' + metadata: + $ref: '../v1beta1/openapi.yaml#/components/schemas/ListMeta' + items: + type: array + description: 'List of CatalogItemDeployments.' + items: + $ref: '#/components/schemas/CatalogItemDeployment' + required: + - apiVersion + - kind + - metadata + - items + additionalProperties: false CatalogItemCategory: type: string description: 'Category of a catalog item.' @@ -2525,4 +2664,4 @@ components: type: array description: Per-digest findings within this fleet or fleetless group. items: - $ref: '#/components/schemas/VulnerabilityGroupItem' + $ref: '#/components/schemas/VulnerabilityGroupItem' \ No newline at end of file diff --git a/api/core/v1beta1/openapi.yaml b/api/core/v1beta1/openapi.yaml index bfdb256..36a9fd1 100644 --- a/api/core/v1beta1/openapi.yaml +++ b/api/core/v1beta1/openapi.yaml @@ -42,6 +42,7 @@ tags: description: Operations for receiving service version. paths: /version: + x-resource: version get: tags: - version @@ -1851,6 +1852,240 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /devices/{name}/applications/{appname}/actions/stop: + x-resource: devices/applications/lifecycle + post: + tags: + - device + description: > + Stop an application on this device. Sets a device-level lifecycle override + (independent of the application's declarative spec, fleet template or standalone + device) that is applied on top of the rendered application spec at render time and + survives fleet template rollouts, since it is never stored as part of the device's + spec. + operationId: stopDeviceApplication + x-rbac: + resource: devices/applications/lifecycle + action: update + parameters: + - name: name + in: path + description: The name of the Device resource. + required: true + schema: + type: string + - name: appname + in: path + description: The name of the application, as defined in the device's rendered application spec. + required: true + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Device' + "400": + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + "401": + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + "403": + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + "404": + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + "409": + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + "429": + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + "503": + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /devices/{name}/applications/{appname}/actions/start: + x-resource: devices/applications/lifecycle + post: + tags: + - device + description: > + Start an application on this device. Sets a device-level lifecycle override + (independent of the application's declarative spec, fleet template or standalone + device) that is applied on top of the rendered application spec at render time and + survives fleet template rollouts, since it is never stored as part of the device's + spec. If the application is also owned by a fleet with its own stop/start default for + this application, whichever of the two actions was issued most recently takes effect. + operationId: startDeviceApplication + x-rbac: + resource: devices/applications/lifecycle + action: update + parameters: + - name: name + in: path + description: The name of the Device resource. + required: true + schema: + type: string + - name: appname + in: path + description: The name of the application, as defined in the device's rendered application spec. + required: true + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Device' + "400": + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + "401": + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + "403": + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + "404": + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + "409": + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + "429": + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + "503": + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /devices/{name}/applications/{appname}/actions/restart: + x-resource: devices/applications/lifecycle + post: + tags: + - device + description: > + Restart an application on this device. Sets a device-level restartGeneration override + (independent of the application's declarative spec, fleet template or standalone + device); the control plane computes the next generation, and the agent restarts the + application using the type-appropriate restart operation when it observes the change. + The override is applied on top of the rendered application spec at render time and + survives fleet template rollouts, since it is never stored as part of the device's + spec. Only meaningful while the application's desired state is "running". + operationId: restartDeviceApplication + x-rbac: + resource: devices/applications/lifecycle + action: update + parameters: + - name: name + in: path + description: The name of the Device resource. + required: true + schema: + type: string + - name: appname + in: path + description: The name of the application, as defined in the device's rendered application spec. + required: true + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Device' + "400": + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + "401": + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + "403": + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + "404": + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + "409": + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + "429": + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + "503": + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /devices/{name}/rendered: x-resource: devices/rendered get: @@ -1983,6 +2218,101 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /ws/v1/devices/{name}/console: + x-resource: devices/console + get: + tags: + - device + description: Open a WebSocket console session to the Device. + operationId: getDeviceConsole + x-rbac: + resource: devices/console + action: get + parameters: + - name: name + in: path + description: The name of the Device resource. + required: true + schema: + type: string + responses: + "101": + description: Switching Protocols + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Not Found + "429": + description: Too Many Requests + "500": + description: Internal Server Error + "504": + description: Gateway Timeout + /ws/v1/devices/{name}/applications/{appname}/console: + x-resource: devices/applications/console + get: + tags: + - device + description: Open a WebSocket console session to an application running on the Device. + operationId: getDeviceApplicationConsole + x-rbac: + resource: devices/applications/console + action: get + parameters: + - name: name + in: path + description: The name of the Device resource. + required: true + schema: + type: string + - name: appname + in: path + description: The name of the application to connect to. + required: true + schema: + type: string + - name: consoleType + in: query + required: true + description: The type of console session to open. "serial" opens a text terminal; "vnc" opens a VNC proxy tunnel. + schema: + type: string + enum: + - serial + - vnc + x-enum-varnames: + - ConsoleTypeSerial + - ConsoleTypeVnc + - name: force + in: query + required: false + description: If true, take over an already-active console session of the same type for this application instead of failing with a 409 Conflict. The replaced session is disconnected and told why. + schema: + type: boolean + default: false + responses: + "101": + description: Switching Protocols + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Not Found + "409": + description: Conflict + "429": + description: Too Many Requests + "500": + description: Internal Server Error + "504": + description: Gateway Timeout /deviceactions/resume: x-resource: devices/resume post: @@ -2037,6 +2367,7 @@ paths: schema: $ref: '#/components/schemas/Status' /enrollmentconfig: + x-resource: enrollmentconfig get: tags: - enrollmentrequest @@ -3803,6 +4134,164 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /fleets/{name}/applications/{appname}/actions/stop: + x-resource: fleets/applications/lifecycle + post: + tags: + - fleet + description: > + Stop an application across every device currently owned by this fleet. Sets a + fleet-level lifecycle default (independent of the application's declarative spec) + that is applied on top of the rendered application spec of each member device at + render time, and is automatically inherited by devices that join the fleet later. If a + specific device also has its own override for this application (see + /devices/{name}/applications/{appname}/actions/stop or .../start), whichever of the two + actions was issued most recently takes effect for that device. + operationId: stopFleetApplication + x-rbac: + resource: fleets/applications/lifecycle + action: update + parameters: + - name: name + in: path + description: The name of the Fleet resource. + required: true + schema: + type: string + - name: appname + in: path + description: The name of the application, as defined in the fleet's device template. + required: true + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Fleet' + "400": + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + "401": + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + "403": + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + "404": + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + "409": + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + "429": + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + "503": + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /fleets/{name}/applications/{appname}/actions/start: + x-resource: fleets/applications/lifecycle + post: + tags: + - fleet + description: > + Start an application across every device currently owned by this fleet. Sets a + fleet-level lifecycle default (independent of the application's declarative spec) + that is applied on top of the rendered application spec of each member device at + render time, and is automatically inherited by devices that join the fleet later. If a + specific device also has its own override for this application (see + /devices/{name}/applications/{appname}/actions/stop or .../start), whichever of the two + actions was issued most recently takes effect for that device. + operationId: startFleetApplication + x-rbac: + resource: fleets/applications/lifecycle + action: update + parameters: + - name: name + in: path + description: The name of the Fleet resource. + required: true + schema: + type: string + - name: appname + in: path + description: The name of the application, as defined in the fleet's device template. + required: true + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Fleet' + "400": + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + "401": + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + "403": + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + "404": + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + "409": + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + "429": + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + "503": + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /fleets/{fleet}/templateversions: x-resource: fleets/templateversions get: @@ -5199,6 +5688,7 @@ components: - $ref: '#/components/schemas/QuadletApplication' - $ref: '#/components/schemas/ContainerApplication' - $ref: '#/components/schemas/HelmApplication' + - $ref: '#/components/schemas/VmApplication' discriminator: propertyName: appType mapping: @@ -5206,6 +5696,17 @@ components: quadlet: '#/components/schemas/QuadletApplication' container: '#/components/schemas/ContainerApplication' helm: '#/components/schemas/HelmApplication' + vm: '#/components/schemas/VmApplication' + + ApplicationDesiredState: + type: string + description: Desired lifecycle state for an application. + enum: + - "running" + - "stopped" + x-enum-varnames: + - "ApplicationDesiredStateRunning" + - "ApplicationDesiredStateStopped" ApplicationProviderBase: type: object @@ -5216,9 +5717,32 @@ components: description: The application name must be 1–253 characters long, start with a letter or number, and contain no whitespace. appType: $ref: '#/components/schemas/AppType' + annotations: + type: object + additionalProperties: + type: string + readOnly: true + description: "Arbitrary metadata annotations. Used internally by the control plane (e.g., flightctl.io/workload-type) when transforming application types at render time." + desiredState: + allOf: + - $ref: '#/components/schemas/ApplicationDesiredState' + readOnly: true + description: "Desired lifecycle state for this application, as most recently set by the stop/start device APIs. Read-only: cannot be set directly by apply; only present in the rendered application spec delivered to the agent." + restartGeneration: + type: integer + readOnly: true + description: "Counter incremented by the restart device API each time the application is restarted. Read-only: cannot be set directly by apply; only present in the rendered application spec delivered to the agent." required: - appType + CatalogItemRefApplicationProviderSpec: + type: object + properties: + catalogItemRef: + $ref: '#/components/schemas/CatalogItemRefSpec' + required: + - catalogItemRef + ComposeApplication: type: object allOf: @@ -5227,6 +5751,7 @@ components: - $ref: '#/components/schemas/ApplicationVolumeProviderSpec' - oneOf: - $ref: '#/components/schemas/ImageApplicationProviderSpec' + - $ref: '#/components/schemas/CatalogItemRefApplicationProviderSpec' - $ref: '#/components/schemas/InlineApplicationProviderSpec' QuadletApplication: @@ -5238,6 +5763,7 @@ components: - $ref: '#/components/schemas/ApplicationVolumeProviderSpec' - oneOf: - $ref: '#/components/schemas/ImageApplicationProviderSpec' + - $ref: '#/components/schemas/CatalogItemRefApplicationProviderSpec' - $ref: '#/components/schemas/InlineApplicationProviderSpec' ContainerApplication: @@ -5247,11 +5773,11 @@ components: - $ref: '#/components/schemas/ApplicationEnvVars' - $ref: '#/components/schemas/ApplicationUser' - $ref: '#/components/schemas/ApplicationVolumeProviderSpec' + - oneOf: + - $ref: '#/components/schemas/ImageApplicationProviderSpec' + - $ref: '#/components/schemas/CatalogItemRefApplicationProviderSpec' - type: object properties: - image: - type: string - description: Reference to the image for this container. ports: type: array description: Port mappings. @@ -5259,18 +5785,16 @@ components: $ref: '#/components/schemas/ApplicationPort' resources: $ref: '#/components/schemas/ApplicationResources' - required: - - image HelmApplication: type: object allOf: - $ref: '#/components/schemas/ApplicationProviderBase' + - oneOf: + - $ref: '#/components/schemas/ImageApplicationProviderSpec' + - $ref: '#/components/schemas/CatalogItemRefApplicationProviderSpec' - type: object properties: - image: - type: string - description: Reference to the chart for this helm application. namespace: type: string description: The target namespace for the application deployment. @@ -5304,6 +5828,31 @@ components: - "values-overrides.yml" required: - image + + VmApplication: + type: object + description: >- + A VM workload managed by the FlightCtl agent. The VM definition may be + delivered either as an OCI image/artifact or as inline application content. + For inline providers, the package must contain a KubeVirt VirtualMachine YAML + file named vm.yaml. + allOf: + - $ref: '#/components/schemas/ApplicationProviderBase' + - type: object + properties: + publishPorts: + type: array + description: >- + List of host-to-guest port mappings for the VM. Each entry must follow + the format "hostPort:guestPort" or "hostPort:guestPort/protocol" + (e.g. "8080:80" or "8080:80/tcp"). + items: + type: string + pattern: '^[0-9]+:[0-9]+(/(tcp|udp|sctp))?$' + - oneOf: + - $ref: '#/components/schemas/ImageApplicationProviderSpec' + - $ref: '#/components/schemas/InlineApplicationProviderSpec' + ApplicationUser: type: object properties: @@ -5323,16 +5872,23 @@ components: $ref: '#/components/schemas/ApplicationPort' resources: $ref: '#/components/schemas/ApplicationResources' - ImageApplicationProviderSpec: - type: object + ImageOrCatalogItemRefSpec: + description: Either a specific OCI image reference, or a reference to a catalog item version that can be resolved to an OCI image ref. allOf: - type: object + description: Reference to an OCI image or artifact with tag. properties: image: type: string - description: Reference to the OCI image or artifact for the application package. - required: - - image + description: Reference to an OCI image or artifact with tag. + x-go-type-skip-optional-pointer: true + - type: object + description: Reference to a catalog item version. + properties: + catalogItemRef: + $ref: '#/components/schemas/CatalogItemRefSpec' + ImageApplicationProviderSpec: + $ref: '#/components/schemas/ImageSpec' InlineApplicationProviderSpec: type: object allOf: @@ -5396,15 +5952,16 @@ components: required: [mount] ImageVolumeSource: type: object - description: Describes the source of an OCI-compliant image or artifact. + description: Describes the source of an OCI-compliant image or artifact. Exactly one of 'reference' or 'catalogItemRef' must be specified. properties: reference: type: string description: Reference to an OCI-compliant image or artifact in a registry. This may be a container image or another type of OCI artifact, as long as it conforms to the OCI image specification. + x-go-type-skip-optional-pointer: true + catalogItemRef: + $ref: '#/components/schemas/CatalogItemRefSpec' pullPolicy: $ref: '#/components/schemas/ImagePullPolicy' - required: - - reference MountVolumeProviderSpec: type: object description: Named volume mount configuration. @@ -5472,11 +6029,13 @@ components: - "quadlet" - "container" - "helm" + - "vm" x-enum-varnames: - "AppTypeCompose" - "AppTypeQuadlet" - "AppTypeContainer" - "AppTypeHelm" + - "AppTypeVm" ResourceMonitor: oneOf: - $ref: '#/components/schemas/CpuResourceMonitorSpec' @@ -5730,14 +6289,7 @@ components: - metadata - items DeviceOsSpec: - type: object - description: DeviceOsSpec describes the target OS for the device. - properties: - image: - type: string - description: The target OS image name or URL. - required: - - image + $ref: '#/components/schemas/ImageOrCatalogItemRefSpec' DeviceStatus: type: object description: DeviceStatus represents information about the status of a device. Status may trail the actual state of a device. @@ -5794,6 +6346,8 @@ components: $ref: '#/components/schemas/DeviceLifecycleStatus' dependencySync: $ref: '#/components/schemas/DependencySyncStatus' + capabilities: + $ref: '#/components/schemas/DeviceCapabilities' additionalProperties: false DeviceLastSeen: type: object @@ -6034,6 +6588,8 @@ components: - "Error" - "Unknown" - "Completed" + - "Stopped" + - "Stopping" x-enum-varnames: - "ApplicationStatusPreparing" - "ApplicationStatusStarting" @@ -6041,6 +6597,27 @@ components: - "ApplicationStatusError" - "ApplicationStatusUnknown" - "ApplicationStatusCompleted" + - "ApplicationStatusStopped" + - "ApplicationStatusStopping" + OsModeType: + type: string + description: >- + OS management mode. "image" indicates the OS is managed via + bootc or rpm-ostree image updates. "package" indicates no + image-based OS management is available. + enum: + - image + - package + x-enum-varnames: + - OsModeImage + - OsModePackage + DeviceCapabilities: + type: object + description: Capabilities reported by the device agent. + properties: + osMode: + $ref: '#/components/schemas/OsModeType' + additionalProperties: false DeviceOsStatus: type: object description: Current status of the device OS. @@ -6386,6 +6963,8 @@ components: knownRenderedVersion: type: string description: 'The rendered version of the device from desired.json (optional).' + osMode: + $ref: '#/components/schemas/OsModeType' description: EnrollmentRequestSpec is a description of a EnrollmentRequest's target state. EnrollmentRequestStatus: type: object @@ -6662,7 +7241,7 @@ components: DeviceSpec: type: object description: DeviceSpec describes a device. - properties: + properties: &deviceSpecProps updatePolicy: $ref: '#/components/schemas/DeviceUpdatePolicySpec' os: @@ -6789,6 +7368,20 @@ components: type: integer format: int64 description: A breakdown of the devices in the fleet by "updated" status. + capabilities: + $ref: '#/components/schemas/DevicesSummaryCapabilities' + DevicesSummaryCapabilities: + type: object + description: Breakdowns of devices by status.capabilities fields. + properties: + osMode: + type: object + default: {} + additionalProperties: + type: integer + format: int64 + description: Counts by status.capabilities.osMode (e.g. image, package). The key "unknown" counts devices that have not reported the capability. + additionalProperties: false TemplateVersion: type: object properties: @@ -7373,6 +7966,9 @@ components: - DependencyChangeDetected - DependencySyncProbeFailed - SystemRestored + - EncryptionMigrationStarted + - EncryptionMigrationCompleted + - ApplicationLifecycleChanged message: type: string description: A human-readable description of the status of this operation. @@ -7457,6 +8053,7 @@ components: DeviceVulnerabilityCVE: "#/components/schemas/DeviceVulnerabilityCveDetails" DependencyChangeDetected: "#/components/schemas/DependencyChangeDetectedDetails" DependencySyncProbeFailed: "#/components/schemas/DependencySyncProbeFailedDetails" + ApplicationLifecycleChanged: "#/components/schemas/ApplicationLifecycleChangedDetails" oneOf: - $ref: "#/components/schemas/ResourceUpdatedDetails" - $ref: "#/components/schemas/DeviceOwnershipChangedDetails" @@ -7475,6 +8072,7 @@ components: - $ref: "#/components/schemas/DeviceVulnerabilityCveDetails" - $ref: "#/components/schemas/DependencyChangeDetectedDetails" - $ref: "#/components/schemas/DependencySyncProbeFailedDetails" + - $ref: "#/components/schemas/ApplicationLifecycleChangedDetails" DeviceVulnerabilityCveDetails: type: object description: Structured details for per-device CVE vulnerability events. @@ -7672,6 +8270,33 @@ components: templateVersion: type: string description: The name of the TemplateVersion that the device is being selected to render. + ApplicationLifecycleChangedDetails: + type: object + required: + - detailType + - appName + - action + properties: + detailType: + type: string + enum: [ApplicationLifecycleChanged] + x-enum-varnames: + - ApplicationLifecycleChangedDetailType + description: The type of detail for discriminator purposes. + appName: + type: string + description: The name of the application whose device-level lifecycle override changed. + action: + type: string + description: The lifecycle action that was requested. + enum: + - stop + - start + - restart + x-enum-varnames: + - ApplicationLifecycleActionStop + - ApplicationLifecycleActionStart + - ApplicationLifecycleActionRestart FleetRolloutFailedDetails: type: object required: @@ -8401,4 +9026,33 @@ components: required: - imageName additionalProperties: false - + ImageSpec: + type: object + description: Reference to an OCI image or artifact with tag. + properties: + image: + description: Reference to an OCI image or artifact with tag. + type: string + required: + - image + CatalogItemRefSpec: + type: object + description: A reference to a catalog item, along with its configuration. + properties: + catalog: + type: string + description: The catalog name that the item is part of. + item: + type: string + description: The name of the catalog item itself. + version: + type: string + description: A valid version that currently exists in the catalog item. + channel: + type: string + description: An optional update channel which will be used to provide update cues when available. + required: + - catalog + - item + - version + additionalProperties: false \ No newline at end of file diff --git a/api/imagebuilder/v1alpha1/openapi.yaml b/api/imagebuilder/v1alpha1/openapi.yaml index 8752961..36a16a6 100644 --- a/api/imagebuilder/v1alpha1/openapi.yaml +++ b/api/imagebuilder/v1alpha1/openapi.yaml @@ -1447,6 +1447,13 @@ components: $ref: '#/components/schemas/ImageBuildBinding' userConfiguration: $ref: '#/components/schemas/ImageBuildUserConfiguration' + onboarding: + type: boolean + description: >- + When true, installs the flightctl-onboarding RPM and enables + flightctl-onboarding-setup.service for first-boot device + configuration via a Cockpit-based onboarding wizard. Compatible + with both early and late binding. Defaults to false. required: - source - destination @@ -2134,4 +2141,3 @@ components: - ImagePromotionTargetTypeNewCatalogItem - ImagePromotionTargetTypeExistingCatalogItem - diff --git a/docs/AppType.md b/docs/AppType.md index 4f5a212..85916b9 100644 --- a/docs/AppType.md +++ b/docs/AppType.md @@ -12,6 +12,8 @@ The type of the application. * `AppTypeHelm` (value: `'helm'`) +* `AppTypeVm` (value: `'vm'`) + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ApplicationDesiredState.md b/docs/ApplicationDesiredState.md new file mode 100644 index 0000000..c5d45b2 --- /dev/null +++ b/docs/ApplicationDesiredState.md @@ -0,0 +1,13 @@ +# ApplicationDesiredState + +Desired lifecycle state for an application. + +## Enum + +* `ApplicationDesiredStateRunning` (value: `'running'`) + +* `ApplicationDesiredStateStopped` (value: `'stopped'`) + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ApplicationLifecycleChangedDetails.md b/docs/ApplicationLifecycleChangedDetails.md new file mode 100644 index 0000000..b2e6d9e --- /dev/null +++ b/docs/ApplicationLifecycleChangedDetails.md @@ -0,0 +1,31 @@ +# ApplicationLifecycleChangedDetails + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**detail_type** | **str** | The type of detail for discriminator purposes. | +**app_name** | **str** | The name of the application whose device-level lifecycle override changed. | +**action** | **str** | The lifecycle action that was requested. | + +## Example + +```python +from flightctl.models.application_lifecycle_changed_details import ApplicationLifecycleChangedDetails + +# TODO update the JSON string below +json = "{}" +# create an instance of ApplicationLifecycleChangedDetails from a JSON string +application_lifecycle_changed_details_instance = ApplicationLifecycleChangedDetails.from_json(json) +# print the JSON string representation of the object +print(ApplicationLifecycleChangedDetails.to_json()) + +# convert the object into a dict +application_lifecycle_changed_details_dict = application_lifecycle_changed_details_instance.to_dict() +# create an instance of ApplicationLifecycleChangedDetails from a dict +application_lifecycle_changed_details_from_dict = ApplicationLifecycleChangedDetails.from_dict(application_lifecycle_changed_details_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ApplicationProviderBase.md b/docs/ApplicationProviderBase.md index a06d510..405235d 100644 --- a/docs/ApplicationProviderBase.md +++ b/docs/ApplicationProviderBase.md @@ -8,6 +8,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | The application name must be 1–253 characters long, start with a letter or number, and contain no whitespace. | [optional] **app_type** | [**AppType**](AppType.md) | | +**annotations** | **Dict[str, str]** | Arbitrary metadata annotations. Used internally by the control plane (e.g., flightctl.io/workload-type) when transforming application types at render time. | [optional] [readonly] +**desired_state** | [**ApplicationDesiredState**](ApplicationDesiredState.md) | Desired lifecycle state for this application, as most recently set by the stop/start device APIs. Read-only: cannot be set directly by apply; only present in the rendered application spec delivered to the agent. | [optional] [readonly] +**restart_generation** | **int** | Counter incremented by the restart device API each time the application is restarted. Read-only: cannot be set directly by apply; only present in the rendered application spec delivered to the agent. | [optional] [readonly] ## Example diff --git a/docs/ApplicationProviderSpec.md b/docs/ApplicationProviderSpec.md index 6fe6905..91e958a 100644 --- a/docs/ApplicationProviderSpec.md +++ b/docs/ApplicationProviderSpec.md @@ -7,9 +7,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | The application name must be 1–253 characters long, start with a letter or number, and contain no whitespace. | [optional] **app_type** | [**AppType**](AppType.md) | | +**annotations** | **Dict[str, str]** | Arbitrary metadata annotations. Used internally by the control plane (e.g., flightctl.io/workload-type) when transforming application types at render time. | [optional] [readonly] +**desired_state** | [**ApplicationDesiredState**](ApplicationDesiredState.md) | Desired lifecycle state for this application, as most recently set by the stop/start device APIs. Read-only: cannot be set directly by apply; only present in the rendered application spec delivered to the agent. | [optional] [readonly] +**restart_generation** | **int** | Counter incremented by the restart device API each time the application is restarted. Read-only: cannot be set directly by apply; only present in the rendered application spec delivered to the agent. | [optional] [readonly] **env_vars** | **Dict[str, str]** | Environment variable key-value pairs, injected during runtime. The key and value each must be between 1 and 253 characters. | [optional] **volumes** | [**List[ApplicationVolume]**](ApplicationVolume.md) | List of application volumes. | [optional] -**image** | **str** | Reference to the chart for this helm application. | +**image** | **str** | Reference to an OCI image or artifact with tag. | +**catalog_item_ref** | [**CatalogItemRefSpec**](CatalogItemRefSpec.md) | | **inline** | [**List[ApplicationContent]**](ApplicationContent.md) | A list of application content. | **run_as** | **str** | The username of the system user this application should be run under. This is not the same as the user within any containers of the application (if applicable). Defaults to the user that the agent runs as (generally root) if not specified. | [optional] **ports** | **List[str]** | Port mappings. | [optional] @@ -17,6 +21,7 @@ Name | Type | Description | Notes **namespace** | **str** | The target namespace for the application deployment. | [optional] **values** | **Dict[str, object]** | Configuration values for the application. Supports arbitrarily nested structures. | [optional] **values_files** | **List[str]** | List of values files to apply during deployment. Files are relative paths and applied in array order before user-provided values. | [optional] +**publish_ports** | **List[str]** | List of host-to-guest port mappings for the VM. Each entry must follow the format \"hostPort:guestPort\" or \"hostPort:guestPort/protocol\" (e.g. \"8080:80\" or \"8080:80/tcp\"). | [optional] ## Example diff --git a/docs/ApplicationStatusType.md b/docs/ApplicationStatusType.md index 4bae259..a6167ae 100644 --- a/docs/ApplicationStatusType.md +++ b/docs/ApplicationStatusType.md @@ -16,6 +16,10 @@ Status of a single application on the device. * `ApplicationStatusCompleted` (value: `'Completed'`) +* `ApplicationStatusStopped` (value: `'Stopped'`) + +* `ApplicationStatusStopping` (value: `'Stopping'`) + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CatalogItemRefApplicationProviderSpec.md b/docs/CatalogItemRefApplicationProviderSpec.md new file mode 100644 index 0000000..c553091 --- /dev/null +++ b/docs/CatalogItemRefApplicationProviderSpec.md @@ -0,0 +1,29 @@ +# CatalogItemRefApplicationProviderSpec + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**catalog_item_ref** | [**CatalogItemRefSpec**](CatalogItemRefSpec.md) | | + +## Example + +```python +from flightctl.models.catalog_item_ref_application_provider_spec import CatalogItemRefApplicationProviderSpec + +# TODO update the JSON string below +json = "{}" +# create an instance of CatalogItemRefApplicationProviderSpec from a JSON string +catalog_item_ref_application_provider_spec_instance = CatalogItemRefApplicationProviderSpec.from_json(json) +# print the JSON string representation of the object +print(CatalogItemRefApplicationProviderSpec.to_json()) + +# convert the object into a dict +catalog_item_ref_application_provider_spec_dict = catalog_item_ref_application_provider_spec_instance.to_dict() +# create an instance of CatalogItemRefApplicationProviderSpec from a dict +catalog_item_ref_application_provider_spec_from_dict = CatalogItemRefApplicationProviderSpec.from_dict(catalog_item_ref_application_provider_spec_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CatalogItemRefSpec.md b/docs/CatalogItemRefSpec.md new file mode 100644 index 0000000..3ceac9c --- /dev/null +++ b/docs/CatalogItemRefSpec.md @@ -0,0 +1,33 @@ +# CatalogItemRefSpec + +A reference to a catalog item, along with its configuration. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**catalog** | **str** | The catalog name that the item is part of. | +**item** | **str** | The name of the catalog item itself. | +**version** | **str** | A valid version that currently exists in the catalog item. | +**channel** | **str** | An optional update channel which will be used to provide update cues when available. | [optional] + +## Example + +```python +from flightctl.models.catalog_item_ref_spec import CatalogItemRefSpec + +# TODO update the JSON string below +json = "{}" +# create an instance of CatalogItemRefSpec from a JSON string +catalog_item_ref_spec_instance = CatalogItemRefSpec.from_json(json) +# print the JSON string representation of the object +print(CatalogItemRefSpec.to_json()) + +# convert the object into a dict +catalog_item_ref_spec_dict = catalog_item_ref_spec_instance.to_dict() +# create an instance of CatalogItemRefSpec from a dict +catalog_item_ref_spec_from_dict = CatalogItemRefSpec.from_dict(catalog_item_ref_spec_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ComposeApplication.md b/docs/ComposeApplication.md index dad1e06..adfe168 100644 --- a/docs/ComposeApplication.md +++ b/docs/ComposeApplication.md @@ -7,9 +7,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | The application name must be 1–253 characters long, start with a letter or number, and contain no whitespace. | [optional] **app_type** | [**AppType**](AppType.md) | | +**annotations** | **Dict[str, str]** | Arbitrary metadata annotations. Used internally by the control plane (e.g., flightctl.io/workload-type) when transforming application types at render time. | [optional] [readonly] +**desired_state** | [**ApplicationDesiredState**](ApplicationDesiredState.md) | Desired lifecycle state for this application, as most recently set by the stop/start device APIs. Read-only: cannot be set directly by apply; only present in the rendered application spec delivered to the agent. | [optional] [readonly] +**restart_generation** | **int** | Counter incremented by the restart device API each time the application is restarted. Read-only: cannot be set directly by apply; only present in the rendered application spec delivered to the agent. | [optional] [readonly] **env_vars** | **Dict[str, str]** | Environment variable key-value pairs, injected during runtime. The key and value each must be between 1 and 253 characters. | [optional] **volumes** | [**List[ApplicationVolume]**](ApplicationVolume.md) | List of application volumes. | [optional] -**image** | **str** | Reference to the OCI image or artifact for the application package. | +**image** | **str** | Reference to an OCI image or artifact with tag. | +**catalog_item_ref** | [**CatalogItemRefSpec**](CatalogItemRefSpec.md) | | **inline** | [**List[ApplicationContent]**](ApplicationContent.md) | A list of application content. | ## Example diff --git a/docs/ContainerApplication.md b/docs/ContainerApplication.md index cd85cb8..96719d4 100644 --- a/docs/ContainerApplication.md +++ b/docs/ContainerApplication.md @@ -7,10 +7,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | The application name must be 1–253 characters long, start with a letter or number, and contain no whitespace. | [optional] **app_type** | [**AppType**](AppType.md) | | +**annotations** | **Dict[str, str]** | Arbitrary metadata annotations. Used internally by the control plane (e.g., flightctl.io/workload-type) when transforming application types at render time. | [optional] [readonly] +**desired_state** | [**ApplicationDesiredState**](ApplicationDesiredState.md) | Desired lifecycle state for this application, as most recently set by the stop/start device APIs. Read-only: cannot be set directly by apply; only present in the rendered application spec delivered to the agent. | [optional] [readonly] +**restart_generation** | **int** | Counter incremented by the restart device API each time the application is restarted. Read-only: cannot be set directly by apply; only present in the rendered application spec delivered to the agent. | [optional] [readonly] **env_vars** | **Dict[str, str]** | Environment variable key-value pairs, injected during runtime. The key and value each must be between 1 and 253 characters. | [optional] **run_as** | **str** | The username of the system user this application should be run under. This is not the same as the user within any containers of the application (if applicable). Defaults to the user that the agent runs as (generally root) if not specified. | [optional] **volumes** | [**List[ApplicationVolume]**](ApplicationVolume.md) | List of application volumes. | [optional] -**image** | **str** | Reference to the image for this container. | +**image** | **str** | Reference to an OCI image or artifact with tag. | +**catalog_item_ref** | [**CatalogItemRefSpec**](CatalogItemRefSpec.md) | | **ports** | **List[str]** | Port mappings. | [optional] **resources** | [**ApplicationResources**](ApplicationResources.md) | | [optional] diff --git a/docs/DeviceApi.md b/docs/DeviceApi.md index e867682..b538885 100644 --- a/docs/DeviceApi.md +++ b/docs/DeviceApi.md @@ -8,6 +8,8 @@ Method | HTTP request | Description [**decommission_device**](DeviceApi.md#decommission_device) | **PUT** /devices/{name}/decommission | [**delete_device**](DeviceApi.md#delete_device) | **DELETE** /devices/{name} | [**get_device**](DeviceApi.md#get_device) | **GET** /devices/{name} | +[**get_device_application_console**](DeviceApi.md#get_device_application_console) | **GET** /ws/v1/devices/{name}/applications/{appname}/console | +[**get_device_console**](DeviceApi.md#get_device_console) | **GET** /ws/v1/devices/{name}/console | [**get_device_last_seen**](DeviceApi.md#get_device_last_seen) | **GET** /devices/{name}/lastseen | [**get_device_status**](DeviceApi.md#get_device_status) | **GET** /devices/{name}/status | [**get_rendered_device**](DeviceApi.md#get_rendered_device) | **GET** /devices/{name}/rendered | @@ -16,6 +18,9 @@ Method | HTTP request | Description [**patch_device_status**](DeviceApi.md#patch_device_status) | **PATCH** /devices/{name}/status | [**replace_device**](DeviceApi.md#replace_device) | **PUT** /devices/{name} | [**replace_device_status**](DeviceApi.md#replace_device_status) | **PUT** /devices/{name}/status | +[**restart_device_application**](DeviceApi.md#restart_device_application) | **POST** /devices/{name}/applications/{appname}/actions/restart | +[**start_device_application**](DeviceApi.md#start_device_application) | **POST** /devices/{name}/applications/{appname}/actions/start | +[**stop_device_application**](DeviceApi.md#stop_device_application) | **POST** /devices/{name}/applications/{appname}/actions/stop | # **create_device** @@ -306,6 +311,151 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **get_device_application_console** +> get_device_application_console(name, appname, console_type, force=force) + +Open a WebSocket console session to an application running on the Device. + +### Example + + +```python +import flightctl +from flightctl.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to /api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = flightctl.Configuration( + host = "/api/v1" +) + + +# 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. + appname = 'appname_example' # str | The name of the application to connect to. + console_type = 'console_type_example' # str | The type of console session to open. \"serial\" opens a text terminal; \"vnc\" opens a VNC proxy tunnel. + force = False # bool | If true, take over an already-active console session of the same type for this application instead of failing with a 409 Conflict. The replaced session is disconnected and told why. (optional) (default to False) + + try: + api_instance.get_device_application_console(name, appname, console_type, force=force) + except Exception as e: + print("Exception when calling DeviceApi->get_device_application_console: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **str**| The name of the Device resource. | + **appname** | **str**| The name of the application to connect to. | + **console_type** | **str**| The type of console session to open. \"serial\" opens a text terminal; \"vnc\" opens a VNC proxy tunnel. | + **force** | **bool**| If true, take over an already-active console session of the same type for this application instead of failing with a 409 Conflict. The replaced session is disconnected and told why. | [optional] [default to False] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**101** | Switching Protocols | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**409** | Conflict | - | +**429** | Too Many Requests | - | +**500** | Internal Server Error | - | +**504** | Gateway Timeout | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_device_console** +> get_device_console(name) + +Open a WebSocket console session to the Device. + +### Example + + +```python +import flightctl +from flightctl.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to /api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = flightctl.Configuration( + host = "/api/v1" +) + + +# 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. + + try: + api_instance.get_device_console(name) + except Exception as e: + print("Exception when calling DeviceApi->get_device_console: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **str**| The name of the Device resource. | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**101** | Switching Protocols | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**429** | Too Many Requests | - | +**500** | Internal Server Error | - | +**504** | Gateway Timeout | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **get_device_last_seen** > DeviceLastSeen get_device_last_seen(name) @@ -902,3 +1052,228 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **restart_device_application** +> Device restart_device_application(name, appname) + +Restart an application on this device. Sets a device-level restartGeneration override (independent of the application's declarative spec, fleet template or standalone device); the control plane computes the next generation, and the agent restarts the application using the type-appropriate restart operation when it observes the change. The override is applied on top of the rendered application spec at render time and survives fleet template rollouts, since it is never stored as part of the device's spec. Only meaningful while the application's desired state is "running". + + +### Example + + +```python +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 /api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = flightctl.Configuration( + host = "/api/v1" +) + + +# 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. + appname = 'appname_example' # str | The name of the application, as defined in the device's rendered application spec. + + try: + api_response = api_instance.restart_device_application(name, appname) + print("The response of DeviceApi->restart_device_application:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DeviceApi->restart_device_application: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **str**| The name of the Device resource. | + **appname** | **str**| The name of the application, as defined in the device's rendered application spec. | + +### Return type + +[**Device**](Device.md) + +### 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 | - | +**404** | Not Found | - | +**409** | Conflict | - | +**429** | Too Many Requests | - | +**503** | Service Unavailable | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **start_device_application** +> Device start_device_application(name, appname) + +Start an application on this device. Sets a device-level lifecycle override (independent of the application's declarative spec, fleet template or standalone device) that is applied on top of the rendered application spec at render time and survives fleet template rollouts, since it is never stored as part of the device's spec. If the application is also owned by a fleet with its own stop/start default for this application, whichever of the two actions was issued most recently takes effect. + + +### Example + + +```python +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 /api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = flightctl.Configuration( + host = "/api/v1" +) + + +# 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. + appname = 'appname_example' # str | The name of the application, as defined in the device's rendered application spec. + + try: + api_response = api_instance.start_device_application(name, appname) + print("The response of DeviceApi->start_device_application:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DeviceApi->start_device_application: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **str**| The name of the Device resource. | + **appname** | **str**| The name of the application, as defined in the device's rendered application spec. | + +### Return type + +[**Device**](Device.md) + +### 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 | - | +**404** | Not Found | - | +**409** | Conflict | - | +**429** | Too Many Requests | - | +**503** | Service Unavailable | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **stop_device_application** +> Device stop_device_application(name, appname) + +Stop an application on this device. Sets a device-level lifecycle override (independent of the application's declarative spec, fleet template or standalone device) that is applied on top of the rendered application spec at render time and survives fleet template rollouts, since it is never stored as part of the device's spec. + + +### Example + + +```python +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 /api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = flightctl.Configuration( + host = "/api/v1" +) + + +# 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. + appname = 'appname_example' # str | The name of the application, as defined in the device's rendered application spec. + + try: + api_response = api_instance.stop_device_application(name, appname) + print("The response of DeviceApi->stop_device_application:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DeviceApi->stop_device_application: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **str**| The name of the Device resource. | + **appname** | **str**| The name of the application, as defined in the device's rendered application spec. | + +### Return type + +[**Device**](Device.md) + +### 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 | - | +**404** | Not Found | - | +**409** | Conflict | - | +**429** | Too Many Requests | - | +**503** | Service Unavailable | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/DeviceCapabilities.md b/docs/DeviceCapabilities.md new file mode 100644 index 0000000..62e5d8b --- /dev/null +++ b/docs/DeviceCapabilities.md @@ -0,0 +1,30 @@ +# DeviceCapabilities + +Capabilities reported by the device agent. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**os_mode** | [**OsModeType**](OsModeType.md) | | [optional] + +## Example + +```python +from flightctl.models.device_capabilities import DeviceCapabilities + +# TODO update the JSON string below +json = "{}" +# create an instance of DeviceCapabilities from a JSON string +device_capabilities_instance = DeviceCapabilities.from_json(json) +# print the JSON string representation of the object +print(DeviceCapabilities.to_json()) + +# convert the object into a dict +device_capabilities_dict = device_capabilities_instance.to_dict() +# create an instance of DeviceCapabilities from a dict +device_capabilities_from_dict = DeviceCapabilities.from_dict(device_capabilities_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/DeviceSpec.md b/docs/DeviceSpec.md index 033a5d1..b21e800 100644 --- a/docs/DeviceSpec.md +++ b/docs/DeviceSpec.md @@ -7,7 +7,7 @@ DeviceSpec describes a device. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **update_policy** | [**DeviceUpdatePolicySpec**](DeviceUpdatePolicySpec.md) | | [optional] -**os** | [**DeviceOsSpec**](DeviceOsSpec.md) | | [optional] +**os** | [**ImageOrCatalogItemRefSpec**](ImageOrCatalogItemRefSpec.md) | | [optional] **config** | [**List[ConfigProviderSpec]**](ConfigProviderSpec.md) | List of config providers. | [optional] **applications** | [**List[ApplicationProviderSpec]**](ApplicationProviderSpec.md) | List of application providers. | [optional] **systemd** | [**DeviceSpecSystemd**](DeviceSpecSystemd.md) | | [optional] diff --git a/docs/DeviceStatus.md b/docs/DeviceStatus.md index f3bf395..c10b1b7 100644 --- a/docs/DeviceStatus.md +++ b/docs/DeviceStatus.md @@ -20,6 +20,7 @@ Name | Type | Description | Notes **last_seen** | **datetime** | The last time the device was seen by the service (NOTE: this property is not returned by the API). | [optional] **lifecycle** | [**DeviceLifecycleStatus**](DeviceLifecycleStatus.md) | | **dependency_sync** | [**DependencySyncStatus**](DependencySyncStatus.md) | | [optional] +**capabilities** | [**DeviceCapabilities**](DeviceCapabilities.md) | | [optional] ## Example diff --git a/docs/DevicesSummary.md b/docs/DevicesSummary.md index a58676c..e1cafc1 100644 --- a/docs/DevicesSummary.md +++ b/docs/DevicesSummary.md @@ -10,6 +10,7 @@ Name | Type | Description | Notes **application_status** | **Dict[str, int]** | A breakdown of the devices in the fleet by \"application\" status. | **summary_status** | **Dict[str, int]** | A breakdown of the devices in the fleet by \"summary\" status. | **update_status** | **Dict[str, int]** | A breakdown of the devices in the fleet by \"updated\" status. | +**capabilities** | [**DevicesSummaryCapabilities**](DevicesSummaryCapabilities.md) | | [optional] ## Example diff --git a/docs/DevicesSummaryCapabilities.md b/docs/DevicesSummaryCapabilities.md new file mode 100644 index 0000000..c946450 --- /dev/null +++ b/docs/DevicesSummaryCapabilities.md @@ -0,0 +1,30 @@ +# DevicesSummaryCapabilities + +Breakdowns of devices by status.capabilities fields. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**os_mode** | **Dict[str, int]** | Counts by status.capabilities.osMode (e.g. image, package). The key \"unknown\" counts devices that have not reported the capability. | [optional] + +## Example + +```python +from flightctl.models.devices_summary_capabilities import DevicesSummaryCapabilities + +# TODO update the JSON string below +json = "{}" +# create an instance of DevicesSummaryCapabilities from a JSON string +devices_summary_capabilities_instance = DevicesSummaryCapabilities.from_json(json) +# print the JSON string representation of the object +print(DevicesSummaryCapabilities.to_json()) + +# convert the object into a dict +devices_summary_capabilities_dict = devices_summary_capabilities_instance.to_dict() +# create an instance of DevicesSummaryCapabilities from a dict +devices_summary_capabilities_from_dict = DevicesSummaryCapabilities.from_dict(devices_summary_capabilities_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/EnrollmentRequestSpec.md b/docs/EnrollmentRequestSpec.md index 38d80f5..05489e5 100644 --- a/docs/EnrollmentRequestSpec.md +++ b/docs/EnrollmentRequestSpec.md @@ -10,6 +10,7 @@ Name | Type | Description | Notes **device_status** | [**DeviceStatus**](DeviceStatus.md) | | [optional] **labels** | **Dict[str, str]** | A set of labels that the service will apply to this device when its enrollment is approved. | [optional] **known_rendered_version** | **str** | The rendered version of the device from desired.json (optional). | [optional] +**os_mode** | [**OsModeType**](OsModeType.md) | | [optional] ## Example diff --git a/docs/EventDetails.md b/docs/EventDetails.md index bd78b7e..080ab47 100644 --- a/docs/EventDetails.md +++ b/docs/EventDetails.md @@ -36,6 +36,8 @@ Name | Type | Description | Notes **resource_key** | **str** | The resource key identifying the dependency that failed (e.g. \"git:my-repo/main\"). | **fingerprint** | **str** | The new fingerprint (e.g. commit SHA) of the changed dependency. | **error** | **str** | The error message from the failed probe. | +**app_name** | **str** | The name of the application whose device-level lifecycle override changed. | +**action** | **str** | The lifecycle action that was requested. | ## Example diff --git a/docs/FleetApi.md b/docs/FleetApi.md index 9bd4b9c..b95276e 100644 --- a/docs/FleetApi.md +++ b/docs/FleetApi.md @@ -16,6 +16,8 @@ Method | HTTP request | Description [**patch_fleet_status**](FleetApi.md#patch_fleet_status) | **PATCH** /fleets/{name}/status | [**replace_fleet**](FleetApi.md#replace_fleet) | **PUT** /fleets/{name} | [**replace_fleet_status**](FleetApi.md#replace_fleet_status) | **PUT** /fleets/{name}/status | +[**start_fleet_application**](FleetApi.md#start_fleet_application) | **POST** /fleets/{name}/applications/{appname}/actions/start | +[**stop_fleet_application**](FleetApi.md#stop_fleet_application) | **POST** /fleets/{name}/applications/{appname}/actions/stop | # **create_fleet** @@ -903,3 +905,153 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **start_fleet_application** +> Fleet start_fleet_application(name, appname) + +Start an application across every device currently owned by this fleet. Sets a fleet-level lifecycle default (independent of the application's declarative spec) that is applied on top of the rendered application spec of each member device at render time, and is automatically inherited by devices that join the fleet later. If a specific device also has its own override for this application (see /devices/{name}/applications/{appname}/actions/stop or .../start), whichever of the two actions was issued most recently takes effect for that device. + + +### Example + + +```python +import flightctl +from flightctl.models.fleet import Fleet +from flightctl.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to /api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = flightctl.Configuration( + host = "/api/v1" +) + + +# 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.FleetApi(api_client) + name = 'name_example' # str | The name of the Fleet resource. + appname = 'appname_example' # str | The name of the application, as defined in the fleet's device template. + + try: + api_response = api_instance.start_fleet_application(name, appname) + print("The response of FleetApi->start_fleet_application:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FleetApi->start_fleet_application: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **str**| The name of the Fleet resource. | + **appname** | **str**| The name of the application, as defined in the fleet's device template. | + +### Return type + +[**Fleet**](Fleet.md) + +### 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 | - | +**404** | Not Found | - | +**409** | Conflict | - | +**429** | Too Many Requests | - | +**503** | Service Unavailable | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **stop_fleet_application** +> Fleet stop_fleet_application(name, appname) + +Stop an application across every device currently owned by this fleet. Sets a fleet-level lifecycle default (independent of the application's declarative spec) that is applied on top of the rendered application spec of each member device at render time, and is automatically inherited by devices that join the fleet later. If a specific device also has its own override for this application (see /devices/{name}/applications/{appname}/actions/stop or .../start), whichever of the two actions was issued most recently takes effect for that device. + + +### Example + + +```python +import flightctl +from flightctl.models.fleet import Fleet +from flightctl.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to /api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = flightctl.Configuration( + host = "/api/v1" +) + + +# 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.FleetApi(api_client) + name = 'name_example' # str | The name of the Fleet resource. + appname = 'appname_example' # str | The name of the application, as defined in the fleet's device template. + + try: + api_response = api_instance.stop_fleet_application(name, appname) + print("The response of FleetApi->stop_fleet_application:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FleetApi->stop_fleet_application: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **str**| The name of the Fleet resource. | + **appname** | **str**| The name of the application, as defined in the fleet's device template. | + +### Return type + +[**Fleet**](Fleet.md) + +### 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 | - | +**404** | Not Found | - | +**409** | Conflict | - | +**429** | Too Many Requests | - | +**503** | Service Unavailable | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/HelmApplication.md b/docs/HelmApplication.md index 07a1c53..afc2074 100644 --- a/docs/HelmApplication.md +++ b/docs/HelmApplication.md @@ -7,7 +7,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | The application name must be 1–253 characters long, start with a letter or number, and contain no whitespace. | [optional] **app_type** | [**AppType**](AppType.md) | | -**image** | **str** | Reference to the chart for this helm application. | +**annotations** | **Dict[str, str]** | Arbitrary metadata annotations. Used internally by the control plane (e.g., flightctl.io/workload-type) when transforming application types at render time. | [optional] [readonly] +**desired_state** | [**ApplicationDesiredState**](ApplicationDesiredState.md) | Desired lifecycle state for this application, as most recently set by the stop/start device APIs. Read-only: cannot be set directly by apply; only present in the rendered application spec delivered to the agent. | [optional] [readonly] +**restart_generation** | **int** | Counter incremented by the restart device API each time the application is restarted. Read-only: cannot be set directly by apply; only present in the rendered application spec delivered to the agent. | [optional] [readonly] +**image** | **str** | Reference to an OCI image or artifact with tag. | +**catalog_item_ref** | [**CatalogItemRefSpec**](CatalogItemRefSpec.md) | | **namespace** | **str** | The target namespace for the application deployment. | [optional] **values** | **Dict[str, object]** | Configuration values for the application. Supports arbitrarily nested structures. | [optional] **values_files** | **List[str]** | List of values files to apply during deployment. Files are relative paths and applied in array order before user-provided values. | [optional] diff --git a/docs/ImageOrCatalogItemRefSpec.md b/docs/ImageOrCatalogItemRefSpec.md new file mode 100644 index 0000000..5012665 --- /dev/null +++ b/docs/ImageOrCatalogItemRefSpec.md @@ -0,0 +1,31 @@ +# ImageOrCatalogItemRefSpec + +Either a specific OCI image reference, or a reference to a catalog item version that can be resolved to an OCI image ref. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**image** | **str** | Reference to an OCI image or artifact with tag. | [optional] +**catalog_item_ref** | [**CatalogItemRefSpec**](CatalogItemRefSpec.md) | | [optional] + +## Example + +```python +from flightctl.models.image_or_catalog_item_ref_spec import ImageOrCatalogItemRefSpec + +# TODO update the JSON string below +json = "{}" +# create an instance of ImageOrCatalogItemRefSpec from a JSON string +image_or_catalog_item_ref_spec_instance = ImageOrCatalogItemRefSpec.from_json(json) +# print the JSON string representation of the object +print(ImageOrCatalogItemRefSpec.to_json()) + +# convert the object into a dict +image_or_catalog_item_ref_spec_dict = image_or_catalog_item_ref_spec_instance.to_dict() +# create an instance of ImageOrCatalogItemRefSpec from a dict +image_or_catalog_item_ref_spec_from_dict = ImageOrCatalogItemRefSpec.from_dict(image_or_catalog_item_ref_spec_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ImageSpec.md b/docs/ImageSpec.md new file mode 100644 index 0000000..8221f25 --- /dev/null +++ b/docs/ImageSpec.md @@ -0,0 +1,30 @@ +# ImageSpec + +Reference to an OCI image or artifact with tag. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**image** | **str** | Reference to an OCI image or artifact with tag. | + +## Example + +```python +from flightctl.models.image_spec import ImageSpec + +# TODO update the JSON string below +json = "{}" +# create an instance of ImageSpec from a JSON string +image_spec_instance = ImageSpec.from_json(json) +# print the JSON string representation of the object +print(ImageSpec.to_json()) + +# convert the object into a dict +image_spec_dict = image_spec_instance.to_dict() +# create an instance of ImageSpec from a dict +image_spec_from_dict = ImageSpec.from_dict(image_spec_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ImageVolumeSource.md b/docs/ImageVolumeSource.md index 1d0234e..9ee5815 100644 --- a/docs/ImageVolumeSource.md +++ b/docs/ImageVolumeSource.md @@ -1,12 +1,13 @@ # ImageVolumeSource -Describes the source of an OCI-compliant image or artifact. +Describes the source of an OCI-compliant image or artifact. Exactly one of 'reference' or 'catalogItemRef' must be specified. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**reference** | **str** | Reference to an OCI-compliant image or artifact in a registry. This may be a container image or another type of OCI artifact, as long as it conforms to the OCI image specification. | +**reference** | **str** | Reference to an OCI-compliant image or artifact in a registry. This may be a container image or another type of OCI artifact, as long as it conforms to the OCI image specification. | [optional] +**catalog_item_ref** | [**CatalogItemRefSpec**](CatalogItemRefSpec.md) | | [optional] **pull_policy** | [**ImagePullPolicy**](ImagePullPolicy.md) | | [optional] [default to ImagePullPolicy.NUMBER_PullIfNotPresent] ## Example diff --git a/docs/OsModeType.md b/docs/OsModeType.md new file mode 100644 index 0000000..4922c03 --- /dev/null +++ b/docs/OsModeType.md @@ -0,0 +1,13 @@ +# OsModeType + +OS management mode. \"image\" indicates the OS is managed via bootc or rpm-ostree image updates. \"package\" indicates no image-based OS management is available. + +## Enum + +* `OsModeImage` (value: `'image'`) + +* `OsModePackage` (value: `'package'`) + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/QuadletApplication.md b/docs/QuadletApplication.md index dedd460..bdd14bb 100644 --- a/docs/QuadletApplication.md +++ b/docs/QuadletApplication.md @@ -7,10 +7,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | The application name must be 1–253 characters long, start with a letter or number, and contain no whitespace. | [optional] **app_type** | [**AppType**](AppType.md) | | +**annotations** | **Dict[str, str]** | Arbitrary metadata annotations. Used internally by the control plane (e.g., flightctl.io/workload-type) when transforming application types at render time. | [optional] [readonly] +**desired_state** | [**ApplicationDesiredState**](ApplicationDesiredState.md) | Desired lifecycle state for this application, as most recently set by the stop/start device APIs. Read-only: cannot be set directly by apply; only present in the rendered application spec delivered to the agent. | [optional] [readonly] +**restart_generation** | **int** | Counter incremented by the restart device API each time the application is restarted. Read-only: cannot be set directly by apply; only present in the rendered application spec delivered to the agent. | [optional] [readonly] **env_vars** | **Dict[str, str]** | Environment variable key-value pairs, injected during runtime. The key and value each must be between 1 and 253 characters. | [optional] **run_as** | **str** | The username of the system user this application should be run under. This is not the same as the user within any containers of the application (if applicable). Defaults to the user that the agent runs as (generally root) if not specified. | [optional] **volumes** | [**List[ApplicationVolume]**](ApplicationVolume.md) | List of application volumes. | [optional] -**image** | **str** | Reference to the OCI image or artifact for the application package. | +**image** | **str** | Reference to an OCI image or artifact with tag. | +**catalog_item_ref** | [**CatalogItemRefSpec**](CatalogItemRefSpec.md) | | **inline** | [**List[ApplicationContent]**](ApplicationContent.md) | A list of application content. | ## Example diff --git a/docs/TemplateVersionStatus.md b/docs/TemplateVersionStatus.md index e539a4d..46f713a 100644 --- a/docs/TemplateVersionStatus.md +++ b/docs/TemplateVersionStatus.md @@ -7,7 +7,7 @@ TemplateVersionStatus represents information about the status of a template vers Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **update_policy** | [**DeviceUpdatePolicySpec**](DeviceUpdatePolicySpec.md) | | [optional] -**os** | [**DeviceOsSpec**](DeviceOsSpec.md) | | [optional] +**os** | [**ImageOrCatalogItemRefSpec**](ImageOrCatalogItemRefSpec.md) | | [optional] **config** | [**List[ConfigProviderSpec]**](ConfigProviderSpec.md) | List of config providers. | [optional] **applications** | [**List[ApplicationProviderSpec]**](ApplicationProviderSpec.md) | List of application providers. | [optional] **systemd** | [**DeviceSpecSystemd**](DeviceSpecSystemd.md) | | [optional] diff --git a/docs/VmApplication.md b/docs/VmApplication.md new file mode 100644 index 0000000..6ef6e69 --- /dev/null +++ b/docs/VmApplication.md @@ -0,0 +1,37 @@ +# VmApplication + +A VM workload managed by the FlightCtl agent. The VM definition may be delivered either as an OCI image/artifact or as inline application content. For inline providers, the package must contain a KubeVirt VirtualMachine YAML file named vm.yaml. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | The application name must be 1–253 characters long, start with a letter or number, and contain no whitespace. | [optional] +**app_type** | [**AppType**](AppType.md) | | +**annotations** | **Dict[str, str]** | Arbitrary metadata annotations. Used internally by the control plane (e.g., flightctl.io/workload-type) when transforming application types at render time. | [optional] [readonly] +**desired_state** | [**ApplicationDesiredState**](ApplicationDesiredState.md) | Desired lifecycle state for this application, as most recently set by the stop/start device APIs. Read-only: cannot be set directly by apply; only present in the rendered application spec delivered to the agent. | [optional] [readonly] +**restart_generation** | **int** | Counter incremented by the restart device API each time the application is restarted. Read-only: cannot be set directly by apply; only present in the rendered application spec delivered to the agent. | [optional] [readonly] +**publish_ports** | **List[str]** | List of host-to-guest port mappings for the VM. Each entry must follow the format \"hostPort:guestPort\" or \"hostPort:guestPort/protocol\" (e.g. \"8080:80\" or \"8080:80/tcp\"). | [optional] +**image** | **str** | Reference to an OCI image or artifact with tag. | +**inline** | [**List[ApplicationContent]**](ApplicationContent.md) | A list of application content. | + +## Example + +```python +from flightctl.models.vm_application import VmApplication + +# TODO update the JSON string below +json = "{}" +# create an instance of VmApplication from a JSON string +vm_application_instance = VmApplication.from_json(json) +# print the JSON string representation of the object +print(VmApplication.to_json()) + +# convert the object into a dict +vm_application_dict = vm_application_instance.to_dict() +# create an instance of VmApplication from a dict +vm_application_from_dict = VmApplication.from_dict(vm_application_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/flightctl/api/device_api.py b/flightctl/api/device_api.py index 43cecd3..f2b3538 100644 --- a/flightctl/api/device_api.py +++ b/flightctl/api/device_api.py @@ -1202,9 +1202,12 @@ def _get_device_serialize( @validate_call - def get_device_last_seen( + def get_device_application_console( self, - name: Annotated[StrictStr, Field(description="The name of the Device resource to get the last seen timestamp for.")], + name: Annotated[StrictStr, Field(description="The name of the Device resource.")], + appname: Annotated[StrictStr, Field(description="The name of the application to connect to.")], + console_type: Annotated[StrictStr, Field(description="The type of console session to open. \"serial\" opens a text terminal; \"vnc\" opens a VNC proxy tunnel.")], + force: Annotated[Optional[StrictBool], Field(description="If true, take over an already-active console session of the same type for this application instead of failing with a 409 Conflict. The replaced session is disconnected and told why.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1217,13 +1220,19 @@ def get_device_last_seen( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> DeviceLastSeen: - """get_device_last_seen + ) -> None: + """get_device_application_console - Get the last seen timestamp of the Device resource. + Open a WebSocket console session to an application running on the Device. - :param name: The name of the Device resource to get the last seen timestamp for. (required) + :param name: The name of the Device resource. (required) :type name: str + :param appname: The name of the application to connect to. (required) + :type appname: str + :param console_type: The type of console session to open. \"serial\" opens a text terminal; \"vnc\" opens a VNC proxy tunnel. (required) + :type console_type: str + :param force: If true, take over an already-active console session of the same type for this application instead of failing with a 409 Conflict. The replaced session is disconnected and told why. + :type force: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1246,8 +1255,11 @@ def get_device_last_seen( :return: Returns the result object. """ # noqa: E501 - _param = self._get_device_last_seen_serialize( + _param = self._get_device_application_console_serialize( name=name, + appname=appname, + console_type=console_type, + force=force, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1255,14 +1267,15 @@ def get_device_last_seen( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "DeviceLastSeen", - '204': None, - '400': "Status", - '401': "Status", - '403': "Status", - '404': "Status", - '429': "Status", - '503': "Status", + '101': None, + '400': None, + '401': None, + '403': None, + '404': None, + '409': None, + '429': None, + '500': None, + '504': None, } response_data = self.api_client.call_api( *_param, @@ -1276,9 +1289,12 @@ def get_device_last_seen( @validate_call - def get_device_last_seen_with_http_info( + def get_device_application_console_with_http_info( self, - name: Annotated[StrictStr, Field(description="The name of the Device resource to get the last seen timestamp for.")], + name: Annotated[StrictStr, Field(description="The name of the Device resource.")], + appname: Annotated[StrictStr, Field(description="The name of the application to connect to.")], + console_type: Annotated[StrictStr, Field(description="The type of console session to open. \"serial\" opens a text terminal; \"vnc\" opens a VNC proxy tunnel.")], + force: Annotated[Optional[StrictBool], Field(description="If true, take over an already-active console session of the same type for this application instead of failing with a 409 Conflict. The replaced session is disconnected and told why.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1291,13 +1307,19 @@ def get_device_last_seen_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[DeviceLastSeen]: - """get_device_last_seen + ) -> ApiResponse[None]: + """get_device_application_console - Get the last seen timestamp of the Device resource. + Open a WebSocket console session to an application running on the Device. - :param name: The name of the Device resource to get the last seen timestamp for. (required) + :param name: The name of the Device resource. (required) :type name: str + :param appname: The name of the application to connect to. (required) + :type appname: str + :param console_type: The type of console session to open. \"serial\" opens a text terminal; \"vnc\" opens a VNC proxy tunnel. (required) + :type console_type: str + :param force: If true, take over an already-active console session of the same type for this application instead of failing with a 409 Conflict. The replaced session is disconnected and told why. + :type force: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1320,8 +1342,11 @@ def get_device_last_seen_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_device_last_seen_serialize( + _param = self._get_device_application_console_serialize( name=name, + appname=appname, + console_type=console_type, + force=force, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1329,14 +1354,15 @@ def get_device_last_seen_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "DeviceLastSeen", - '204': None, - '400': "Status", - '401': "Status", - '403': "Status", - '404': "Status", - '429': "Status", - '503': "Status", + '101': None, + '400': None, + '401': None, + '403': None, + '404': None, + '409': None, + '429': None, + '500': None, + '504': None, } response_data = self.api_client.call_api( *_param, @@ -1350,9 +1376,12 @@ def get_device_last_seen_with_http_info( @validate_call - def get_device_last_seen_without_preload_content( + def get_device_application_console_without_preload_content( self, - name: Annotated[StrictStr, Field(description="The name of the Device resource to get the last seen timestamp for.")], + name: Annotated[StrictStr, Field(description="The name of the Device resource.")], + appname: Annotated[StrictStr, Field(description="The name of the application to connect to.")], + console_type: Annotated[StrictStr, Field(description="The type of console session to open. \"serial\" opens a text terminal; \"vnc\" opens a VNC proxy tunnel.")], + force: Annotated[Optional[StrictBool], Field(description="If true, take over an already-active console session of the same type for this application instead of failing with a 409 Conflict. The replaced session is disconnected and told why.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1366,12 +1395,18 @@ def get_device_last_seen_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """get_device_last_seen + """get_device_application_console - Get the last seen timestamp of the Device resource. + Open a WebSocket console session to an application running on the Device. - :param name: The name of the Device resource to get the last seen timestamp for. (required) + :param name: The name of the Device resource. (required) :type name: str + :param appname: The name of the application to connect to. (required) + :type appname: str + :param console_type: The type of console session to open. \"serial\" opens a text terminal; \"vnc\" opens a VNC proxy tunnel. (required) + :type console_type: str + :param force: If true, take over an already-active console session of the same type for this application instead of failing with a 409 Conflict. The replaced session is disconnected and told why. + :type force: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1394,8 +1429,11 @@ def get_device_last_seen_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_device_last_seen_serialize( + _param = self._get_device_application_console_serialize( name=name, + appname=appname, + console_type=console_type, + force=force, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1403,14 +1441,15 @@ def get_device_last_seen_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "DeviceLastSeen", - '204': None, - '400': "Status", - '401': "Status", - '403': "Status", - '404': "Status", - '429': "Status", - '503': "Status", + '101': None, + '400': None, + '401': None, + '403': None, + '404': None, + '409': None, + '429': None, + '500': None, + '504': None, } response_data = self.api_client.call_api( *_param, @@ -1419,9 +1458,12 @@ def get_device_last_seen_without_preload_content( return response_data.response - def _get_device_last_seen_serialize( + def _get_device_application_console_serialize( self, name, + appname, + console_type, + force, _request_auth, _content_type, _headers, @@ -1445,19 +1487,22 @@ def _get_device_last_seen_serialize( # process the path parameters if name is not None: _path_params['name'] = name + if appname is not None: + _path_params['appname'] = appname # process the query parameters + if console_type is not None: + + _query_params.append(('consoleType', console_type)) + + if force is not None: + + _query_params.append(('force', force)) + # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) # authentication setting @@ -1466,7 +1511,7 @@ def _get_device_last_seen_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/devices/{name}/lastseen', + resource_path='/ws/v1/devices/{name}/applications/{appname}/console', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1483,9 +1528,9 @@ def _get_device_last_seen_serialize( @validate_call - def get_device_status( + def get_device_console( self, - name: Annotated[StrictStr, Field(description="The name of the Device resource to get.")], + name: Annotated[StrictStr, Field(description="The name of the Device resource.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1498,12 +1543,12 @@ def get_device_status( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Device: - """get_device_status + ) -> None: + """get_device_console - Get the status of a Device resource. + Open a WebSocket console session to the Device. - :param name: The name of the Device resource to get. (required) + :param name: The name of the Device resource. (required) :type name: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -1527,7 +1572,7 @@ def get_device_status( :return: Returns the result object. """ # noqa: E501 - _param = self._get_device_status_serialize( + _param = self._get_device_console_serialize( name=name, _request_auth=_request_auth, _content_type=_content_type, @@ -1536,13 +1581,14 @@ def get_device_status( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Device", - '400': "Status", - '401': "Status", - '403': "Status", - '404': "Status", - '429': "Status", - '503': "Status", + '101': None, + '400': None, + '401': None, + '403': None, + '404': None, + '429': None, + '500': None, + '504': None, } response_data = self.api_client.call_api( *_param, @@ -1556,9 +1602,9 @@ def get_device_status( @validate_call - def get_device_status_with_http_info( + def get_device_console_with_http_info( self, - name: Annotated[StrictStr, Field(description="The name of the Device resource to get.")], + name: Annotated[StrictStr, Field(description="The name of the Device resource.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1571,12 +1617,12 @@ def get_device_status_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Device]: - """get_device_status + ) -> ApiResponse[None]: + """get_device_console - Get the status of a Device resource. + Open a WebSocket console session to the Device. - :param name: The name of the Device resource to get. (required) + :param name: The name of the Device resource. (required) :type name: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -1600,7 +1646,7 @@ def get_device_status_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_device_status_serialize( + _param = self._get_device_console_serialize( name=name, _request_auth=_request_auth, _content_type=_content_type, @@ -1609,13 +1655,14 @@ def get_device_status_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Device", - '400': "Status", - '401': "Status", - '403': "Status", - '404': "Status", - '429': "Status", - '503': "Status", + '101': None, + '400': None, + '401': None, + '403': None, + '404': None, + '429': None, + '500': None, + '504': None, } response_data = self.api_client.call_api( *_param, @@ -1629,9 +1676,9 @@ def get_device_status_with_http_info( @validate_call - def get_device_status_without_preload_content( + def get_device_console_without_preload_content( self, - name: Annotated[StrictStr, Field(description="The name of the Device resource to get.")], + name: Annotated[StrictStr, Field(description="The name of the Device resource.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1645,11 +1692,11 @@ def get_device_status_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """get_device_status + """get_device_console - Get the status of a Device resource. + Open a WebSocket console session to the Device. - :param name: The name of the Device resource to get. (required) + :param name: The name of the Device resource. (required) :type name: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -1673,7 +1720,7 @@ def get_device_status_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_device_status_serialize( + _param = self._get_device_console_serialize( name=name, _request_auth=_request_auth, _content_type=_content_type, @@ -1682,13 +1729,14 @@ def get_device_status_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Device", - '400': "Status", - '401': "Status", - '403': "Status", - '404': "Status", - '429': "Status", - '503': "Status", + '101': None, + '400': None, + '401': None, + '403': None, + '404': None, + '429': None, + '500': None, + '504': None, } response_data = self.api_client.call_api( *_param, @@ -1697,7 +1745,7 @@ def get_device_status_without_preload_content( return response_data.response - def _get_device_status_serialize( + def _get_device_console_serialize( self, name, _request_auth, @@ -1729,13 +1777,6 @@ def _get_device_status_serialize( # process the body parameter - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) # authentication setting @@ -1744,7 +1785,7 @@ def _get_device_status_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/devices/{name}/status', + resource_path='/ws/v1/devices/{name}/console', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1761,10 +1802,9 @@ def _get_device_status_serialize( @validate_call - def get_rendered_device( + def get_device_last_seen( self, - name: Annotated[StrictStr, Field(description="The name of the Device resource to get the rendered device specification for.")], - known_rendered_version: Annotated[Optional[StrictStr], Field(description="The last known renderedVersion.")] = None, + name: Annotated[StrictStr, Field(description="The name of the Device resource to get the last seen timestamp for.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1777,15 +1817,13 @@ def get_rendered_device( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Device: - """get_rendered_device + ) -> DeviceLastSeen: + """get_device_last_seen - Get the rendered device. + Get the last seen timestamp of the Device resource. - :param name: The name of the Device resource to get the rendered device specification for. (required) + :param name: The name of the Device resource to get the last seen timestamp for. (required) :type name: str - :param known_rendered_version: The last known renderedVersion. - :type known_rendered_version: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1808,9 +1846,8 @@ def get_rendered_device( :return: Returns the result object. """ # noqa: E501 - _param = self._get_rendered_device_serialize( + _param = self._get_device_last_seen_serialize( name=name, - known_rendered_version=known_rendered_version, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1818,13 +1855,12 @@ def get_rendered_device( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Device", + '200': "DeviceLastSeen", '204': None, '400': "Status", '401': "Status", '403': "Status", '404': "Status", - '409': "Status", '429': "Status", '503': "Status", } @@ -1840,10 +1876,9 @@ def get_rendered_device( @validate_call - def get_rendered_device_with_http_info( + def get_device_last_seen_with_http_info( self, - name: Annotated[StrictStr, Field(description="The name of the Device resource to get the rendered device specification for.")], - known_rendered_version: Annotated[Optional[StrictStr], Field(description="The last known renderedVersion.")] = None, + name: Annotated[StrictStr, Field(description="The name of the Device resource to get the last seen timestamp for.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1856,15 +1891,13 @@ def get_rendered_device_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Device]: - """get_rendered_device + ) -> ApiResponse[DeviceLastSeen]: + """get_device_last_seen - Get the rendered device. + Get the last seen timestamp of the Device resource. - :param name: The name of the Device resource to get the rendered device specification for. (required) + :param name: The name of the Device resource to get the last seen timestamp for. (required) :type name: str - :param known_rendered_version: The last known renderedVersion. - :type known_rendered_version: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1887,9 +1920,8 @@ def get_rendered_device_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_rendered_device_serialize( + _param = self._get_device_last_seen_serialize( name=name, - known_rendered_version=known_rendered_version, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1897,13 +1929,12 @@ def get_rendered_device_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Device", + '200': "DeviceLastSeen", '204': None, '400': "Status", '401': "Status", '403': "Status", '404': "Status", - '409': "Status", '429': "Status", '503': "Status", } @@ -1919,10 +1950,9 @@ def get_rendered_device_with_http_info( @validate_call - def get_rendered_device_without_preload_content( + def get_device_last_seen_without_preload_content( self, - name: Annotated[StrictStr, Field(description="The name of the Device resource to get the rendered device specification for.")], - known_rendered_version: Annotated[Optional[StrictStr], Field(description="The last known renderedVersion.")] = None, + name: Annotated[StrictStr, Field(description="The name of the Device resource to get the last seen timestamp for.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1936,14 +1966,12 @@ def get_rendered_device_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """get_rendered_device + """get_device_last_seen - Get the rendered device. + Get the last seen timestamp of the Device resource. - :param name: The name of the Device resource to get the rendered device specification for. (required) + :param name: The name of the Device resource to get the last seen timestamp for. (required) :type name: str - :param known_rendered_version: The last known renderedVersion. - :type known_rendered_version: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1966,9 +1994,8 @@ def get_rendered_device_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_rendered_device_serialize( + _param = self._get_device_last_seen_serialize( name=name, - known_rendered_version=known_rendered_version, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1976,13 +2003,12 @@ def get_rendered_device_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Device", + '200': "DeviceLastSeen", '204': None, '400': "Status", '401': "Status", '403': "Status", '404': "Status", - '409': "Status", '429': "Status", '503': "Status", } @@ -1993,10 +2019,9 @@ def get_rendered_device_without_preload_content( return response_data.response - def _get_rendered_device_serialize( + def _get_device_last_seen_serialize( self, name, - known_rendered_version, _request_auth, _content_type, _headers, @@ -2021,10 +2046,6 @@ def _get_rendered_device_serialize( if name is not None: _path_params['name'] = name # process the query parameters - if known_rendered_version is not None: - - _query_params.append(('knownRenderedVersion', known_rendered_version)) - # process the header parameters # process the form parameters # process the body parameter @@ -2045,7 +2066,7 @@ def _get_rendered_device_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/devices/{name}/rendered', + resource_path='/devices/{name}/lastseen', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2062,14 +2083,9 @@ def _get_rendered_device_serialize( @validate_call - def list_devices( + def get_device_status( self, - var_continue: Annotated[Optional[StrictStr], Field(description="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.")] = None, - label_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their labels. Defaults to everything.")] = None, - field_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their fields, supporting operators like '=', '==', and '!=' (e.g., \"key1=value1,key2!=value2\").")] = None, - limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=0)]], Field(description="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.")] = None, - summary_only: Annotated[Optional[StrictBool], Field(description="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.")] = None, - cve_id: Annotated[Optional[Annotated[str, Field(strict=True, max_length=64)]], Field(description="Filter devices by CVE ID. Only returns devices whose OS image digest has the specified vulnerability. Must be a MITRE-style identifier (CVE-YYYY-sequence, e.g. CVE-2024-12345).")] = None, + name: Annotated[StrictStr, Field(description="The name of the Device resource to get.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2082,23 +2098,13 @@ def list_devices( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> DeviceList: - """list_devices + ) -> Device: + """get_device_status - List Device resources. + Get the status of a Device resource. - :param var_continue: 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. - :type var_continue: str - :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. - :type label_selector: str - :param field_selector: A selector to restrict the list of returned objects by their fields, supporting operators like '=', '==', and '!=' (e.g., \"key1=value1,key2!=value2\"). - :type field_selector: str - :param limit: 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. - :type limit: int - :param summary_only: 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. - :type summary_only: bool - :param cve_id: Filter devices by CVE ID. Only returns devices whose OS image digest has the specified vulnerability. Must be a MITRE-style identifier (CVE-YYYY-sequence, e.g. CVE-2024-12345). - :type cve_id: str + :param name: The name of the Device resource to get. (required) + :type name: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2121,13 +2127,8 @@ def list_devices( :return: Returns the result object. """ # noqa: E501 - _param = self._list_devices_serialize( - var_continue=var_continue, - label_selector=label_selector, - field_selector=field_selector, - limit=limit, - summary_only=summary_only, - cve_id=cve_id, + _param = self._get_device_status_serialize( + name=name, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2135,10 +2136,11 @@ def list_devices( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "DeviceList", + '200': "Device", '400': "Status", '401': "Status", '403': "Status", + '404': "Status", '429': "Status", '503': "Status", } @@ -2154,14 +2156,9 @@ def list_devices( @validate_call - def list_devices_with_http_info( + def get_device_status_with_http_info( self, - var_continue: Annotated[Optional[StrictStr], Field(description="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.")] = None, - label_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their labels. Defaults to everything.")] = None, - field_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their fields, supporting operators like '=', '==', and '!=' (e.g., \"key1=value1,key2!=value2\").")] = None, - limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=0)]], Field(description="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.")] = None, - summary_only: Annotated[Optional[StrictBool], Field(description="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.")] = None, - cve_id: Annotated[Optional[Annotated[str, Field(strict=True, max_length=64)]], Field(description="Filter devices by CVE ID. Only returns devices whose OS image digest has the specified vulnerability. Must be a MITRE-style identifier (CVE-YYYY-sequence, e.g. CVE-2024-12345).")] = None, + name: Annotated[StrictStr, Field(description="The name of the Device resource to get.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2174,23 +2171,13 @@ def list_devices_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[DeviceList]: - """list_devices + ) -> ApiResponse[Device]: + """get_device_status - List Device resources. + Get the status of a Device resource. - :param var_continue: 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. - :type var_continue: str - :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. - :type label_selector: str - :param field_selector: A selector to restrict the list of returned objects by their fields, supporting operators like '=', '==', and '!=' (e.g., \"key1=value1,key2!=value2\"). - :type field_selector: str - :param limit: 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. - :type limit: int - :param summary_only: 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. - :type summary_only: bool - :param cve_id: Filter devices by CVE ID. Only returns devices whose OS image digest has the specified vulnerability. Must be a MITRE-style identifier (CVE-YYYY-sequence, e.g. CVE-2024-12345). - :type cve_id: str + :param name: The name of the Device resource to get. (required) + :type name: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2213,13 +2200,8 @@ def list_devices_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_devices_serialize( - var_continue=var_continue, - label_selector=label_selector, - field_selector=field_selector, - limit=limit, - summary_only=summary_only, - cve_id=cve_id, + _param = self._get_device_status_serialize( + name=name, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2227,10 +2209,11 @@ def list_devices_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "DeviceList", + '200': "Device", '400': "Status", '401': "Status", '403': "Status", + '404': "Status", '429': "Status", '503': "Status", } @@ -2246,14 +2229,9 @@ def list_devices_with_http_info( @validate_call - def list_devices_without_preload_content( + def get_device_status_without_preload_content( self, - var_continue: Annotated[Optional[StrictStr], Field(description="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.")] = None, - label_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their labels. Defaults to everything.")] = None, - field_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their fields, supporting operators like '=', '==', and '!=' (e.g., \"key1=value1,key2!=value2\").")] = None, - limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=0)]], Field(description="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.")] = None, - summary_only: Annotated[Optional[StrictBool], Field(description="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.")] = None, - cve_id: Annotated[Optional[Annotated[str, Field(strict=True, max_length=64)]], Field(description="Filter devices by CVE ID. Only returns devices whose OS image digest has the specified vulnerability. Must be a MITRE-style identifier (CVE-YYYY-sequence, e.g. CVE-2024-12345).")] = None, + name: Annotated[StrictStr, Field(description="The name of the Device resource to get.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2267,22 +2245,12 @@ def list_devices_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """list_devices + """get_device_status - List Device resources. + Get the status of a Device resource. - :param var_continue: 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. - :type var_continue: str - :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. - :type label_selector: str - :param field_selector: A selector to restrict the list of returned objects by their fields, supporting operators like '=', '==', and '!=' (e.g., \"key1=value1,key2!=value2\"). - :type field_selector: str - :param limit: 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. - :type limit: int - :param summary_only: 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. - :type summary_only: bool - :param cve_id: Filter devices by CVE ID. Only returns devices whose OS image digest has the specified vulnerability. Must be a MITRE-style identifier (CVE-YYYY-sequence, e.g. CVE-2024-12345). - :type cve_id: str + :param name: The name of the Device resource to get. (required) + :type name: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2305,13 +2273,8 @@ def list_devices_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_devices_serialize( - var_continue=var_continue, - label_selector=label_selector, - field_selector=field_selector, - limit=limit, - summary_only=summary_only, - cve_id=cve_id, + _param = self._get_device_status_serialize( + name=name, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2319,10 +2282,11 @@ def list_devices_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "DeviceList", + '200': "Device", '400': "Status", '401': "Status", '403': "Status", + '404': "Status", '429': "Status", '503': "Status", } @@ -2333,14 +2297,9 @@ def list_devices_without_preload_content( return response_data.response - def _list_devices_serialize( + def _get_device_status_serialize( self, - var_continue, - label_selector, - field_selector, - limit, - summary_only, - cve_id, + name, _request_auth, _content_type, _headers, @@ -2362,34 +2321,1591 @@ def _list_devices_serialize( _body_params: Optional[bytes] = None # process the path parameters + if name is not None: + _path_params['name'] = name + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/devices/{name}/status', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_rendered_device( + self, + name: Annotated[StrictStr, Field(description="The name of the Device resource to get the rendered device specification for.")], + known_rendered_version: Annotated[Optional[StrictStr], Field(description="The last known renderedVersion.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Device: + """get_rendered_device + + Get the rendered device. + + :param name: The name of the Device resource to get the rendered device specification for. (required) + :type name: str + :param known_rendered_version: The last known renderedVersion. + :type known_rendered_version: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_rendered_device_serialize( + name=name, + known_rendered_version=known_rendered_version, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Device", + '204': None, + '400': "Status", + '401': "Status", + '403': "Status", + '404': "Status", + '409': "Status", + '429': "Status", + '503': "Status", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_rendered_device_with_http_info( + self, + name: Annotated[StrictStr, Field(description="The name of the Device resource to get the rendered device specification for.")], + known_rendered_version: Annotated[Optional[StrictStr], Field(description="The last known renderedVersion.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Device]: + """get_rendered_device + + Get the rendered device. + + :param name: The name of the Device resource to get the rendered device specification for. (required) + :type name: str + :param known_rendered_version: The last known renderedVersion. + :type known_rendered_version: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_rendered_device_serialize( + name=name, + known_rendered_version=known_rendered_version, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Device", + '204': None, + '400': "Status", + '401': "Status", + '403': "Status", + '404': "Status", + '409': "Status", + '429': "Status", + '503': "Status", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_rendered_device_without_preload_content( + self, + name: Annotated[StrictStr, Field(description="The name of the Device resource to get the rendered device specification for.")], + known_rendered_version: Annotated[Optional[StrictStr], Field(description="The last known renderedVersion.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """get_rendered_device + + Get the rendered device. + + :param name: The name of the Device resource to get the rendered device specification for. (required) + :type name: str + :param known_rendered_version: The last known renderedVersion. + :type known_rendered_version: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_rendered_device_serialize( + name=name, + known_rendered_version=known_rendered_version, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Device", + '204': None, + '400': "Status", + '401': "Status", + '403': "Status", + '404': "Status", + '409': "Status", + '429': "Status", + '503': "Status", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_rendered_device_serialize( + self, + name, + known_rendered_version, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if name is not None: + _path_params['name'] = name + # process the query parameters + if known_rendered_version is not None: + + _query_params.append(('knownRenderedVersion', known_rendered_version)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/devices/{name}/rendered', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_devices( + self, + var_continue: Annotated[Optional[StrictStr], Field(description="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.")] = None, + label_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their labels. Defaults to everything.")] = None, + field_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their fields, supporting operators like '=', '==', and '!=' (e.g., \"key1=value1,key2!=value2\").")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=0)]], Field(description="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.")] = None, + summary_only: Annotated[Optional[StrictBool], Field(description="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.")] = None, + cve_id: Annotated[Optional[Annotated[str, Field(strict=True, max_length=64)]], Field(description="Filter devices by CVE ID. Only returns devices whose OS image digest has the specified vulnerability. Must be a MITRE-style identifier (CVE-YYYY-sequence, e.g. CVE-2024-12345).")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DeviceList: + """list_devices + + List Device resources. + + :param var_continue: 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. + :type var_continue: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param field_selector: A selector to restrict the list of returned objects by their fields, supporting operators like '=', '==', and '!=' (e.g., \"key1=value1,key2!=value2\"). + :type field_selector: str + :param limit: 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. + :type limit: int + :param summary_only: 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. + :type summary_only: bool + :param cve_id: Filter devices by CVE ID. Only returns devices whose OS image digest has the specified vulnerability. Must be a MITRE-style identifier (CVE-YYYY-sequence, e.g. CVE-2024-12345). + :type cve_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_devices_serialize( + var_continue=var_continue, + label_selector=label_selector, + field_selector=field_selector, + limit=limit, + summary_only=summary_only, + cve_id=cve_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DeviceList", + '400': "Status", + '401': "Status", + '403': "Status", + '429': "Status", + '503': "Status", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_devices_with_http_info( + self, + var_continue: Annotated[Optional[StrictStr], Field(description="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.")] = None, + label_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their labels. Defaults to everything.")] = None, + field_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their fields, supporting operators like '=', '==', and '!=' (e.g., \"key1=value1,key2!=value2\").")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=0)]], Field(description="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.")] = None, + summary_only: Annotated[Optional[StrictBool], Field(description="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.")] = None, + cve_id: Annotated[Optional[Annotated[str, Field(strict=True, max_length=64)]], Field(description="Filter devices by CVE ID. Only returns devices whose OS image digest has the specified vulnerability. Must be a MITRE-style identifier (CVE-YYYY-sequence, e.g. CVE-2024-12345).")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DeviceList]: + """list_devices + + List Device resources. + + :param var_continue: 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. + :type var_continue: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param field_selector: A selector to restrict the list of returned objects by their fields, supporting operators like '=', '==', and '!=' (e.g., \"key1=value1,key2!=value2\"). + :type field_selector: str + :param limit: 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. + :type limit: int + :param summary_only: 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. + :type summary_only: bool + :param cve_id: Filter devices by CVE ID. Only returns devices whose OS image digest has the specified vulnerability. Must be a MITRE-style identifier (CVE-YYYY-sequence, e.g. CVE-2024-12345). + :type cve_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_devices_serialize( + var_continue=var_continue, + label_selector=label_selector, + field_selector=field_selector, + limit=limit, + summary_only=summary_only, + cve_id=cve_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DeviceList", + '400': "Status", + '401': "Status", + '403': "Status", + '429': "Status", + '503': "Status", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_devices_without_preload_content( + self, + var_continue: Annotated[Optional[StrictStr], Field(description="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.")] = None, + label_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their labels. Defaults to everything.")] = None, + field_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their fields, supporting operators like '=', '==', and '!=' (e.g., \"key1=value1,key2!=value2\").")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=0)]], Field(description="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.")] = None, + summary_only: Annotated[Optional[StrictBool], Field(description="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.")] = None, + cve_id: Annotated[Optional[Annotated[str, Field(strict=True, max_length=64)]], Field(description="Filter devices by CVE ID. Only returns devices whose OS image digest has the specified vulnerability. Must be a MITRE-style identifier (CVE-YYYY-sequence, e.g. CVE-2024-12345).")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list_devices + + List Device resources. + + :param var_continue: 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. + :type var_continue: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param field_selector: A selector to restrict the list of returned objects by their fields, supporting operators like '=', '==', and '!=' (e.g., \"key1=value1,key2!=value2\"). + :type field_selector: str + :param limit: 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. + :type limit: int + :param summary_only: 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. + :type summary_only: bool + :param cve_id: Filter devices by CVE ID. Only returns devices whose OS image digest has the specified vulnerability. Must be a MITRE-style identifier (CVE-YYYY-sequence, e.g. CVE-2024-12345). + :type cve_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_devices_serialize( + var_continue=var_continue, + label_selector=label_selector, + field_selector=field_selector, + limit=limit, + summary_only=summary_only, + cve_id=cve_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DeviceList", + '400': "Status", + '401': "Status", + '403': "Status", + '429': "Status", + '503': "Status", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_devices_serialize( + self, + var_continue, + label_selector, + field_selector, + limit, + summary_only, + cve_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if var_continue is not None: + + _query_params.append(('continue', var_continue)) + + if label_selector is not None: + + _query_params.append(('labelSelector', label_selector)) + + if field_selector is not None: + + _query_params.append(('fieldSelector', field_selector)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + if summary_only is not None: + + _query_params.append(('summaryOnly', summary_only)) + + if cve_id is not None: + + _query_params.append(('cveId', cve_id)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/devices', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def patch_device( + self, + name: Annotated[StrictStr, Field(description="The name of the Device resource to patch.")], + patch_request_inner: List[PatchRequestInner], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Device: + """patch_device + + Patch a Device resource. + + :param name: The name of the Device resource to patch. (required) + :type name: str + :param patch_request_inner: (required) + :type patch_request_inner: List[PatchRequestInner] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._patch_device_serialize( + name=name, + patch_request_inner=patch_request_inner, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Device", + '400': "Status", + '401': "Status", + '403': "Status", + '404': "Status", + '409': "Status", + '429': "Status", + '503': "Status", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def patch_device_with_http_info( + self, + name: Annotated[StrictStr, Field(description="The name of the Device resource to patch.")], + patch_request_inner: List[PatchRequestInner], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Device]: + """patch_device + + Patch a Device resource. + + :param name: The name of the Device resource to patch. (required) + :type name: str + :param patch_request_inner: (required) + :type patch_request_inner: List[PatchRequestInner] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._patch_device_serialize( + name=name, + patch_request_inner=patch_request_inner, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Device", + '400': "Status", + '401': "Status", + '403': "Status", + '404': "Status", + '409': "Status", + '429': "Status", + '503': "Status", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def patch_device_without_preload_content( + self, + name: Annotated[StrictStr, Field(description="The name of the Device resource to patch.")], + patch_request_inner: List[PatchRequestInner], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """patch_device + + Patch a Device resource. + + :param name: The name of the Device resource to patch. (required) + :type name: str + :param patch_request_inner: (required) + :type patch_request_inner: List[PatchRequestInner] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._patch_device_serialize( + name=name, + patch_request_inner=patch_request_inner, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Device", + '400': "Status", + '401': "Status", + '403': "Status", + '404': "Status", + '409': "Status", + '429': "Status", + '503': "Status", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _patch_device_serialize( + self, + name, + patch_request_inner, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'PatchRequestInner': '', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if name is not None: + _path_params['name'] = name + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if patch_request_inner is not None: + _body_params = patch_request_inner + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json-patch+json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='PATCH', + resource_path='/devices/{name}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def patch_device_status( + self, + name: Annotated[StrictStr, Field(description="The name of the Device resource to patch.")], + patch_request_inner: List[PatchRequestInner], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Device: + """patch_device_status + + Patch the status of a Device resource. + + :param name: The name of the Device resource to patch. (required) + :type name: str + :param patch_request_inner: (required) + :type patch_request_inner: List[PatchRequestInner] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._patch_device_status_serialize( + name=name, + patch_request_inner=patch_request_inner, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Device", + '400': "Status", + '401': "Status", + '403': "Status", + '404': "Status", + '429': "Status", + '503': "Status", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def patch_device_status_with_http_info( + self, + name: Annotated[StrictStr, Field(description="The name of the Device resource to patch.")], + patch_request_inner: List[PatchRequestInner], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Device]: + """patch_device_status + + Patch the status of a Device resource. + + :param name: The name of the Device resource to patch. (required) + :type name: str + :param patch_request_inner: (required) + :type patch_request_inner: List[PatchRequestInner] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._patch_device_status_serialize( + name=name, + patch_request_inner=patch_request_inner, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Device", + '400': "Status", + '401': "Status", + '403': "Status", + '404': "Status", + '429': "Status", + '503': "Status", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def patch_device_status_without_preload_content( + self, + name: Annotated[StrictStr, Field(description="The name of the Device resource to patch.")], + patch_request_inner: List[PatchRequestInner], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """patch_device_status + + Patch the status of a Device resource. + + :param name: The name of the Device resource to patch. (required) + :type name: str + :param patch_request_inner: (required) + :type patch_request_inner: List[PatchRequestInner] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._patch_device_status_serialize( + name=name, + patch_request_inner=patch_request_inner, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Device", + '400': "Status", + '401': "Status", + '403': "Status", + '404': "Status", + '429': "Status", + '503': "Status", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _patch_device_status_serialize( + self, + name, + patch_request_inner, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'PatchRequestInner': '', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if name is not None: + _path_params['name'] = name + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if patch_request_inner is not None: + _body_params = patch_request_inner + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json-patch+json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='PATCH', + resource_path='/devices/{name}/status', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def replace_device( + self, + name: Annotated[StrictStr, Field(description="The name of the Device resource to update.")], + device: Device, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Device: + """replace_device + + Update a Device resource. + + :param name: The name of the Device resource to update. (required) + :type name: str + :param device: (required) + :type device: Device + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._replace_device_serialize( + name=name, + device=device, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Device", + '201': "Device", + '400': "Status", + '401': "Status", + '403': "Status", + '404': "Status", + '409': "Status", + '429': "Status", + '503': "Status", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def replace_device_with_http_info( + self, + name: Annotated[StrictStr, Field(description="The name of the Device resource to update.")], + device: Device, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Device]: + """replace_device + + Update a Device resource. + + :param name: The name of the Device resource to update. (required) + :type name: str + :param device: (required) + :type device: Device + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._replace_device_serialize( + name=name, + device=device, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Device", + '201': "Device", + '400': "Status", + '401': "Status", + '403': "Status", + '404': "Status", + '409': "Status", + '429': "Status", + '503': "Status", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def replace_device_without_preload_content( + self, + name: Annotated[StrictStr, Field(description="The name of the Device resource to update.")], + device: Device, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """replace_device + + Update a Device resource. + + :param name: The name of the Device resource to update. (required) + :type name: str + :param device: (required) + :type device: Device + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._replace_device_serialize( + name=name, + device=device, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Device", + '201': "Device", + '400': "Status", + '401': "Status", + '403': "Status", + '404': "Status", + '409': "Status", + '429': "Status", + '503': "Status", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _replace_device_serialize( + self, + name, + device, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if name is not None: + _path_params['name'] = name # process the query parameters - if var_continue is not None: - - _query_params.append(('continue', var_continue)) - - if label_selector is not None: - - _query_params.append(('labelSelector', label_selector)) - - if field_selector is not None: - - _query_params.append(('fieldSelector', field_selector)) - - if limit is not None: - - _query_params.append(('limit', limit)) - - if summary_only is not None: - - _query_params.append(('summaryOnly', summary_only)) - - if cve_id is not None: - - _query_params.append(('cveId', cve_id)) - # process the header parameters # process the form parameters # process the body parameter + if device is not None: + _body_params = device # set the HTTP header `Accept` @@ -2400,14 +3916,27 @@ def _list_devices_serialize( ] ) + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ ] return self.api_client.param_serialize( - method='GET', - resource_path='/devices', + method='PUT', + resource_path='/devices/{name}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2424,10 +3953,10 @@ def _list_devices_serialize( @validate_call - def patch_device( + def replace_device_status( self, - name: Annotated[StrictStr, Field(description="The name of the Device resource to patch.")], - patch_request_inner: List[PatchRequestInner], + name: Annotated[StrictStr, Field(description="The name of the Device resource to update.")], + device: Device, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2441,14 +3970,14 @@ def patch_device( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> Device: - """patch_device + """replace_device_status - Patch a Device resource. + Update the status of a Device resource. - :param name: The name of the Device resource to patch. (required) + :param name: The name of the Device resource to update. (required) :type name: str - :param patch_request_inner: (required) - :type patch_request_inner: List[PatchRequestInner] + :param device: (required) + :type device: Device :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2471,9 +4000,9 @@ def patch_device( :return: Returns the result object. """ # noqa: E501 - _param = self._patch_device_serialize( + _param = self._replace_device_status_serialize( name=name, - patch_request_inner=patch_request_inner, + device=device, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2502,10 +4031,10 @@ def patch_device( @validate_call - def patch_device_with_http_info( + def replace_device_status_with_http_info( self, - name: Annotated[StrictStr, Field(description="The name of the Device resource to patch.")], - patch_request_inner: List[PatchRequestInner], + name: Annotated[StrictStr, Field(description="The name of the Device resource to update.")], + device: Device, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2519,14 +4048,14 @@ def patch_device_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[Device]: - """patch_device + """replace_device_status - Patch a Device resource. + Update the status of a Device resource. - :param name: The name of the Device resource to patch. (required) + :param name: The name of the Device resource to update. (required) :type name: str - :param patch_request_inner: (required) - :type patch_request_inner: List[PatchRequestInner] + :param device: (required) + :type device: Device :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2549,9 +4078,9 @@ def patch_device_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._patch_device_serialize( + _param = self._replace_device_status_serialize( name=name, - patch_request_inner=patch_request_inner, + device=device, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2580,10 +4109,10 @@ def patch_device_with_http_info( @validate_call - def patch_device_without_preload_content( + def replace_device_status_without_preload_content( self, - name: Annotated[StrictStr, Field(description="The name of the Device resource to patch.")], - patch_request_inner: List[PatchRequestInner], + name: Annotated[StrictStr, Field(description="The name of the Device resource to update.")], + device: Device, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2597,14 +4126,14 @@ def patch_device_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """patch_device + """replace_device_status - Patch a Device resource. + Update the status of a Device resource. - :param name: The name of the Device resource to patch. (required) + :param name: The name of the Device resource to update. (required) :type name: str - :param patch_request_inner: (required) - :type patch_request_inner: List[PatchRequestInner] + :param device: (required) + :type device: Device :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2627,9 +4156,9 @@ def patch_device_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._patch_device_serialize( + _param = self._replace_device_status_serialize( name=name, - patch_request_inner=patch_request_inner, + device=device, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2653,10 +4182,10 @@ def patch_device_without_preload_content( return response_data.response - def _patch_device_serialize( + def _replace_device_status_serialize( self, name, - patch_request_inner, + device, _request_auth, _content_type, _headers, @@ -2666,7 +4195,6 @@ def _patch_device_serialize( _host = None _collection_formats: Dict[str, str] = { - 'PatchRequestInner': '', } _path_params: Dict[str, str] = {} @@ -2685,8 +4213,8 @@ def _patch_device_serialize( # process the header parameters # process the form parameters # process the body parameter - if patch_request_inner is not None: - _body_params = patch_request_inner + if device is not None: + _body_params = device # set the HTTP header `Accept` @@ -2704,7 +4232,7 @@ def _patch_device_serialize( _default_content_type = ( self.api_client.select_header_content_type( [ - 'application/json-patch+json' + 'application/json' ] ) ) @@ -2716,8 +4244,8 @@ def _patch_device_serialize( ] return self.api_client.param_serialize( - method='PATCH', - resource_path='/devices/{name}', + method='PUT', + resource_path='/devices/{name}/status', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2734,10 +4262,10 @@ def _patch_device_serialize( @validate_call - def patch_device_status( + def restart_device_application( self, - name: Annotated[StrictStr, Field(description="The name of the Device resource to patch.")], - patch_request_inner: List[PatchRequestInner], + name: Annotated[StrictStr, Field(description="The name of the Device resource.")], + appname: Annotated[StrictStr, Field(description="The name of the application, as defined in the device's rendered application spec.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2751,14 +4279,14 @@ def patch_device_status( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> Device: - """patch_device_status + """restart_device_application - Patch the status of a Device resource. + Restart an application on this device. Sets a device-level restartGeneration override (independent of the application's declarative spec, fleet template or standalone device); the control plane computes the next generation, and the agent restarts the application using the type-appropriate restart operation when it observes the change. The override is applied on top of the rendered application spec at render time and survives fleet template rollouts, since it is never stored as part of the device's spec. Only meaningful while the application's desired state is \"running\". - :param name: The name of the Device resource to patch. (required) + :param name: The name of the Device resource. (required) :type name: str - :param patch_request_inner: (required) - :type patch_request_inner: List[PatchRequestInner] + :param appname: The name of the application, as defined in the device's rendered application spec. (required) + :type appname: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2781,9 +4309,9 @@ def patch_device_status( :return: Returns the result object. """ # noqa: E501 - _param = self._patch_device_status_serialize( + _param = self._restart_device_application_serialize( name=name, - patch_request_inner=patch_request_inner, + appname=appname, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2796,6 +4324,7 @@ def patch_device_status( '401': "Status", '403': "Status", '404': "Status", + '409': "Status", '429': "Status", '503': "Status", } @@ -2811,10 +4340,10 @@ def patch_device_status( @validate_call - def patch_device_status_with_http_info( + def restart_device_application_with_http_info( self, - name: Annotated[StrictStr, Field(description="The name of the Device resource to patch.")], - patch_request_inner: List[PatchRequestInner], + name: Annotated[StrictStr, Field(description="The name of the Device resource.")], + appname: Annotated[StrictStr, Field(description="The name of the application, as defined in the device's rendered application spec.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2828,14 +4357,14 @@ def patch_device_status_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[Device]: - """patch_device_status + """restart_device_application - Patch the status of a Device resource. + Restart an application on this device. Sets a device-level restartGeneration override (independent of the application's declarative spec, fleet template or standalone device); the control plane computes the next generation, and the agent restarts the application using the type-appropriate restart operation when it observes the change. The override is applied on top of the rendered application spec at render time and survives fleet template rollouts, since it is never stored as part of the device's spec. Only meaningful while the application's desired state is \"running\". - :param name: The name of the Device resource to patch. (required) + :param name: The name of the Device resource. (required) :type name: str - :param patch_request_inner: (required) - :type patch_request_inner: List[PatchRequestInner] + :param appname: The name of the application, as defined in the device's rendered application spec. (required) + :type appname: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2858,9 +4387,9 @@ def patch_device_status_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._patch_device_status_serialize( + _param = self._restart_device_application_serialize( name=name, - patch_request_inner=patch_request_inner, + appname=appname, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2873,6 +4402,7 @@ def patch_device_status_with_http_info( '401': "Status", '403': "Status", '404': "Status", + '409': "Status", '429': "Status", '503': "Status", } @@ -2888,10 +4418,10 @@ def patch_device_status_with_http_info( @validate_call - def patch_device_status_without_preload_content( + def restart_device_application_without_preload_content( self, - name: Annotated[StrictStr, Field(description="The name of the Device resource to patch.")], - patch_request_inner: List[PatchRequestInner], + name: Annotated[StrictStr, Field(description="The name of the Device resource.")], + appname: Annotated[StrictStr, Field(description="The name of the application, as defined in the device's rendered application spec.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2905,14 +4435,14 @@ def patch_device_status_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """patch_device_status + """restart_device_application - Patch the status of a Device resource. + Restart an application on this device. Sets a device-level restartGeneration override (independent of the application's declarative spec, fleet template or standalone device); the control plane computes the next generation, and the agent restarts the application using the type-appropriate restart operation when it observes the change. The override is applied on top of the rendered application spec at render time and survives fleet template rollouts, since it is never stored as part of the device's spec. Only meaningful while the application's desired state is \"running\". - :param name: The name of the Device resource to patch. (required) + :param name: The name of the Device resource. (required) :type name: str - :param patch_request_inner: (required) - :type patch_request_inner: List[PatchRequestInner] + :param appname: The name of the application, as defined in the device's rendered application spec. (required) + :type appname: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2935,9 +4465,9 @@ def patch_device_status_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._patch_device_status_serialize( + _param = self._restart_device_application_serialize( name=name, - patch_request_inner=patch_request_inner, + appname=appname, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2950,6 +4480,7 @@ def patch_device_status_without_preload_content( '401': "Status", '403': "Status", '404': "Status", + '409': "Status", '429': "Status", '503': "Status", } @@ -2960,10 +4491,10 @@ def patch_device_status_without_preload_content( return response_data.response - def _patch_device_status_serialize( + def _restart_device_application_serialize( self, name, - patch_request_inner, + appname, _request_auth, _content_type, _headers, @@ -2973,7 +4504,6 @@ def _patch_device_status_serialize( _host = None _collection_formats: Dict[str, str] = { - 'PatchRequestInner': '', } _path_params: Dict[str, str] = {} @@ -2988,12 +4518,12 @@ def _patch_device_status_serialize( # process the path parameters if name is not None: _path_params['name'] = name + if appname is not None: + _path_params['appname'] = appname # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if patch_request_inner is not None: - _body_params = patch_request_inner # set the HTTP header `Accept` @@ -3004,27 +4534,14 @@ def _patch_device_status_serialize( ] ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json-patch+json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ ] return self.api_client.param_serialize( - method='PATCH', - resource_path='/devices/{name}/status', + method='POST', + resource_path='/devices/{name}/applications/{appname}/actions/restart', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3041,10 +4558,10 @@ def _patch_device_status_serialize( @validate_call - def replace_device( + def start_device_application( self, - name: Annotated[StrictStr, Field(description="The name of the Device resource to update.")], - device: Device, + name: Annotated[StrictStr, Field(description="The name of the Device resource.")], + appname: Annotated[StrictStr, Field(description="The name of the application, as defined in the device's rendered application spec.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3058,14 +4575,14 @@ def replace_device( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> Device: - """replace_device + """start_device_application - Update a Device resource. + Start an application on this device. Sets a device-level lifecycle override (independent of the application's declarative spec, fleet template or standalone device) that is applied on top of the rendered application spec at render time and survives fleet template rollouts, since it is never stored as part of the device's spec. If the application is also owned by a fleet with its own stop/start default for this application, whichever of the two actions was issued most recently takes effect. - :param name: The name of the Device resource to update. (required) + :param name: The name of the Device resource. (required) :type name: str - :param device: (required) - :type device: Device + :param appname: The name of the application, as defined in the device's rendered application spec. (required) + :type appname: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3088,9 +4605,9 @@ def replace_device( :return: Returns the result object. """ # noqa: E501 - _param = self._replace_device_serialize( + _param = self._start_device_application_serialize( name=name, - device=device, + appname=appname, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3099,7 +4616,6 @@ def replace_device( _response_types_map: Dict[str, Optional[str]] = { '200': "Device", - '201': "Device", '400': "Status", '401': "Status", '403': "Status", @@ -3120,10 +4636,10 @@ def replace_device( @validate_call - def replace_device_with_http_info( + def start_device_application_with_http_info( self, - name: Annotated[StrictStr, Field(description="The name of the Device resource to update.")], - device: Device, + name: Annotated[StrictStr, Field(description="The name of the Device resource.")], + appname: Annotated[StrictStr, Field(description="The name of the application, as defined in the device's rendered application spec.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3137,14 +4653,14 @@ def replace_device_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[Device]: - """replace_device + """start_device_application - Update a Device resource. + Start an application on this device. Sets a device-level lifecycle override (independent of the application's declarative spec, fleet template or standalone device) that is applied on top of the rendered application spec at render time and survives fleet template rollouts, since it is never stored as part of the device's spec. If the application is also owned by a fleet with its own stop/start default for this application, whichever of the two actions was issued most recently takes effect. - :param name: The name of the Device resource to update. (required) + :param name: The name of the Device resource. (required) :type name: str - :param device: (required) - :type device: Device + :param appname: The name of the application, as defined in the device's rendered application spec. (required) + :type appname: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3167,9 +4683,9 @@ def replace_device_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._replace_device_serialize( + _param = self._start_device_application_serialize( name=name, - device=device, + appname=appname, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3178,7 +4694,6 @@ def replace_device_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "Device", - '201': "Device", '400': "Status", '401': "Status", '403': "Status", @@ -3199,10 +4714,10 @@ def replace_device_with_http_info( @validate_call - def replace_device_without_preload_content( + def start_device_application_without_preload_content( self, - name: Annotated[StrictStr, Field(description="The name of the Device resource to update.")], - device: Device, + name: Annotated[StrictStr, Field(description="The name of the Device resource.")], + appname: Annotated[StrictStr, Field(description="The name of the application, as defined in the device's rendered application spec.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3216,14 +4731,14 @@ def replace_device_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """replace_device + """start_device_application - Update a Device resource. + Start an application on this device. Sets a device-level lifecycle override (independent of the application's declarative spec, fleet template or standalone device) that is applied on top of the rendered application spec at render time and survives fleet template rollouts, since it is never stored as part of the device's spec. If the application is also owned by a fleet with its own stop/start default for this application, whichever of the two actions was issued most recently takes effect. - :param name: The name of the Device resource to update. (required) + :param name: The name of the Device resource. (required) :type name: str - :param device: (required) - :type device: Device + :param appname: The name of the application, as defined in the device's rendered application spec. (required) + :type appname: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3246,9 +4761,9 @@ def replace_device_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._replace_device_serialize( + _param = self._start_device_application_serialize( name=name, - device=device, + appname=appname, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3257,7 +4772,6 @@ def replace_device_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "Device", - '201': "Device", '400': "Status", '401': "Status", '403': "Status", @@ -3273,10 +4787,10 @@ def replace_device_without_preload_content( return response_data.response - def _replace_device_serialize( + def _start_device_application_serialize( self, name, - device, + appname, _request_auth, _content_type, _headers, @@ -3300,12 +4814,12 @@ def _replace_device_serialize( # process the path parameters if name is not None: _path_params['name'] = name + if appname is not None: + _path_params['appname'] = appname # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if device is not None: - _body_params = device # set the HTTP header `Accept` @@ -3316,27 +4830,14 @@ def _replace_device_serialize( ] ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ ] return self.api_client.param_serialize( - method='PUT', - resource_path='/devices/{name}', + method='POST', + resource_path='/devices/{name}/applications/{appname}/actions/start', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3353,10 +4854,10 @@ def _replace_device_serialize( @validate_call - def replace_device_status( + def stop_device_application( self, - name: Annotated[StrictStr, Field(description="The name of the Device resource to update.")], - device: Device, + name: Annotated[StrictStr, Field(description="The name of the Device resource.")], + appname: Annotated[StrictStr, Field(description="The name of the application, as defined in the device's rendered application spec.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3370,14 +4871,14 @@ def replace_device_status( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> Device: - """replace_device_status + """stop_device_application - Update the status of a Device resource. + Stop an application on this device. Sets a device-level lifecycle override (independent of the application's declarative spec, fleet template or standalone device) that is applied on top of the rendered application spec at render time and survives fleet template rollouts, since it is never stored as part of the device's spec. - :param name: The name of the Device resource to update. (required) + :param name: The name of the Device resource. (required) :type name: str - :param device: (required) - :type device: Device + :param appname: The name of the application, as defined in the device's rendered application spec. (required) + :type appname: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3400,9 +4901,9 @@ def replace_device_status( :return: Returns the result object. """ # noqa: E501 - _param = self._replace_device_status_serialize( + _param = self._stop_device_application_serialize( name=name, - device=device, + appname=appname, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3431,10 +4932,10 @@ def replace_device_status( @validate_call - def replace_device_status_with_http_info( + def stop_device_application_with_http_info( self, - name: Annotated[StrictStr, Field(description="The name of the Device resource to update.")], - device: Device, + name: Annotated[StrictStr, Field(description="The name of the Device resource.")], + appname: Annotated[StrictStr, Field(description="The name of the application, as defined in the device's rendered application spec.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3448,14 +4949,14 @@ def replace_device_status_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[Device]: - """replace_device_status + """stop_device_application - Update the status of a Device resource. + Stop an application on this device. Sets a device-level lifecycle override (independent of the application's declarative spec, fleet template or standalone device) that is applied on top of the rendered application spec at render time and survives fleet template rollouts, since it is never stored as part of the device's spec. - :param name: The name of the Device resource to update. (required) + :param name: The name of the Device resource. (required) :type name: str - :param device: (required) - :type device: Device + :param appname: The name of the application, as defined in the device's rendered application spec. (required) + :type appname: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3478,9 +4979,9 @@ def replace_device_status_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._replace_device_status_serialize( + _param = self._stop_device_application_serialize( name=name, - device=device, + appname=appname, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3509,10 +5010,10 @@ def replace_device_status_with_http_info( @validate_call - def replace_device_status_without_preload_content( + def stop_device_application_without_preload_content( self, - name: Annotated[StrictStr, Field(description="The name of the Device resource to update.")], - device: Device, + name: Annotated[StrictStr, Field(description="The name of the Device resource.")], + appname: Annotated[StrictStr, Field(description="The name of the application, as defined in the device's rendered application spec.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3526,14 +5027,14 @@ def replace_device_status_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """replace_device_status + """stop_device_application - Update the status of a Device resource. + Stop an application on this device. Sets a device-level lifecycle override (independent of the application's declarative spec, fleet template or standalone device) that is applied on top of the rendered application spec at render time and survives fleet template rollouts, since it is never stored as part of the device's spec. - :param name: The name of the Device resource to update. (required) + :param name: The name of the Device resource. (required) :type name: str - :param device: (required) - :type device: Device + :param appname: The name of the application, as defined in the device's rendered application spec. (required) + :type appname: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3556,9 +5057,9 @@ def replace_device_status_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._replace_device_status_serialize( + _param = self._stop_device_application_serialize( name=name, - device=device, + appname=appname, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3582,10 +5083,10 @@ def replace_device_status_without_preload_content( return response_data.response - def _replace_device_status_serialize( + def _stop_device_application_serialize( self, name, - device, + appname, _request_auth, _content_type, _headers, @@ -3609,12 +5110,12 @@ def _replace_device_status_serialize( # process the path parameters if name is not None: _path_params['name'] = name + if appname is not None: + _path_params['appname'] = appname # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if device is not None: - _body_params = device # set the HTTP header `Accept` @@ -3625,27 +5126,14 @@ def _replace_device_status_serialize( ] ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ ] return self.api_client.param_serialize( - method='PUT', - resource_path='/devices/{name}/status', + method='POST', + resource_path='/devices/{name}/applications/{appname}/actions/stop', path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/flightctl/api/fleet_api.py b/flightctl/api/fleet_api.py index bc0dbd8..c00ff4b 100644 --- a/flightctl/api/fleet_api.py +++ b/flightctl/api/fleet_api.py @@ -3694,3 +3694,595 @@ def _replace_fleet_status_serialize( ) + + + @validate_call + def start_fleet_application( + self, + name: Annotated[StrictStr, Field(description="The name of the Fleet resource.")], + appname: Annotated[StrictStr, Field(description="The name of the application, as defined in the fleet's device template.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Fleet: + """start_fleet_application + + Start an application across every device currently owned by this fleet. Sets a fleet-level lifecycle default (independent of the application's declarative spec) that is applied on top of the rendered application spec of each member device at render time, and is automatically inherited by devices that join the fleet later. If a specific device also has its own override for this application (see /devices/{name}/applications/{appname}/actions/stop or .../start), whichever of the two actions was issued most recently takes effect for that device. + + :param name: The name of the Fleet resource. (required) + :type name: str + :param appname: The name of the application, as defined in the fleet's device template. (required) + :type appname: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._start_fleet_application_serialize( + name=name, + appname=appname, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Fleet", + '400': "Status", + '401': "Status", + '403': "Status", + '404': "Status", + '409': "Status", + '429': "Status", + '503': "Status", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def start_fleet_application_with_http_info( + self, + name: Annotated[StrictStr, Field(description="The name of the Fleet resource.")], + appname: Annotated[StrictStr, Field(description="The name of the application, as defined in the fleet's device template.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Fleet]: + """start_fleet_application + + Start an application across every device currently owned by this fleet. Sets a fleet-level lifecycle default (independent of the application's declarative spec) that is applied on top of the rendered application spec of each member device at render time, and is automatically inherited by devices that join the fleet later. If a specific device also has its own override for this application (see /devices/{name}/applications/{appname}/actions/stop or .../start), whichever of the two actions was issued most recently takes effect for that device. + + :param name: The name of the Fleet resource. (required) + :type name: str + :param appname: The name of the application, as defined in the fleet's device template. (required) + :type appname: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._start_fleet_application_serialize( + name=name, + appname=appname, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Fleet", + '400': "Status", + '401': "Status", + '403': "Status", + '404': "Status", + '409': "Status", + '429': "Status", + '503': "Status", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def start_fleet_application_without_preload_content( + self, + name: Annotated[StrictStr, Field(description="The name of the Fleet resource.")], + appname: Annotated[StrictStr, Field(description="The name of the application, as defined in the fleet's device template.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """start_fleet_application + + Start an application across every device currently owned by this fleet. Sets a fleet-level lifecycle default (independent of the application's declarative spec) that is applied on top of the rendered application spec of each member device at render time, and is automatically inherited by devices that join the fleet later. If a specific device also has its own override for this application (see /devices/{name}/applications/{appname}/actions/stop or .../start), whichever of the two actions was issued most recently takes effect for that device. + + :param name: The name of the Fleet resource. (required) + :type name: str + :param appname: The name of the application, as defined in the fleet's device template. (required) + :type appname: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._start_fleet_application_serialize( + name=name, + appname=appname, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Fleet", + '400': "Status", + '401': "Status", + '403': "Status", + '404': "Status", + '409': "Status", + '429': "Status", + '503': "Status", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _start_fleet_application_serialize( + self, + name, + appname, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if name is not None: + _path_params['name'] = name + if appname is not None: + _path_params['appname'] = appname + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/fleets/{name}/applications/{appname}/actions/start', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def stop_fleet_application( + self, + name: Annotated[StrictStr, Field(description="The name of the Fleet resource.")], + appname: Annotated[StrictStr, Field(description="The name of the application, as defined in the fleet's device template.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Fleet: + """stop_fleet_application + + Stop an application across every device currently owned by this fleet. Sets a fleet-level lifecycle default (independent of the application's declarative spec) that is applied on top of the rendered application spec of each member device at render time, and is automatically inherited by devices that join the fleet later. If a specific device also has its own override for this application (see /devices/{name}/applications/{appname}/actions/stop or .../start), whichever of the two actions was issued most recently takes effect for that device. + + :param name: The name of the Fleet resource. (required) + :type name: str + :param appname: The name of the application, as defined in the fleet's device template. (required) + :type appname: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._stop_fleet_application_serialize( + name=name, + appname=appname, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Fleet", + '400': "Status", + '401': "Status", + '403': "Status", + '404': "Status", + '409': "Status", + '429': "Status", + '503': "Status", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def stop_fleet_application_with_http_info( + self, + name: Annotated[StrictStr, Field(description="The name of the Fleet resource.")], + appname: Annotated[StrictStr, Field(description="The name of the application, as defined in the fleet's device template.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Fleet]: + """stop_fleet_application + + Stop an application across every device currently owned by this fleet. Sets a fleet-level lifecycle default (independent of the application's declarative spec) that is applied on top of the rendered application spec of each member device at render time, and is automatically inherited by devices that join the fleet later. If a specific device also has its own override for this application (see /devices/{name}/applications/{appname}/actions/stop or .../start), whichever of the two actions was issued most recently takes effect for that device. + + :param name: The name of the Fleet resource. (required) + :type name: str + :param appname: The name of the application, as defined in the fleet's device template. (required) + :type appname: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._stop_fleet_application_serialize( + name=name, + appname=appname, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Fleet", + '400': "Status", + '401': "Status", + '403': "Status", + '404': "Status", + '409': "Status", + '429': "Status", + '503': "Status", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def stop_fleet_application_without_preload_content( + self, + name: Annotated[StrictStr, Field(description="The name of the Fleet resource.")], + appname: Annotated[StrictStr, Field(description="The name of the application, as defined in the fleet's device template.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """stop_fleet_application + + Stop an application across every device currently owned by this fleet. Sets a fleet-level lifecycle default (independent of the application's declarative spec) that is applied on top of the rendered application spec of each member device at render time, and is automatically inherited by devices that join the fleet later. If a specific device also has its own override for this application (see /devices/{name}/applications/{appname}/actions/stop or .../start), whichever of the two actions was issued most recently takes effect for that device. + + :param name: The name of the Fleet resource. (required) + :type name: str + :param appname: The name of the application, as defined in the fleet's device template. (required) + :type appname: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._stop_fleet_application_serialize( + name=name, + appname=appname, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Fleet", + '400': "Status", + '401': "Status", + '403': "Status", + '404': "Status", + '409': "Status", + '429': "Status", + '503': "Status", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _stop_fleet_application_serialize( + self, + name, + appname, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if name is not None: + _path_params['name'] = name + if appname is not None: + _path_params['appname'] = appname + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/fleets/{name}/applications/{appname}/actions/stop', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/flightctl/api_client.py b/flightctl/api_client.py index 5dca699..753e9b8 100644 --- a/flightctl/api_client.py +++ b/flightctl/api_client.py @@ -92,7 +92,7 @@ def __init__( self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/1.2.1/python' + self.user_agent = 'OpenAPI-Generator/1.3.0/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/flightctl/configuration.py b/flightctl/configuration.py index 1f4615e..6009acf 100644 --- a/flightctl/configuration.py +++ b/flightctl/configuration.py @@ -545,7 +545,7 @@ def to_debug_report(self) -> str: "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: v1beta1\n"\ - "SDK Package Version: 1.2.1".\ + "SDK Package Version: 1.3.0".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self) -> List[HostSetting]: diff --git a/flightctl/imagebuilder/__init__.py b/flightctl/imagebuilder/__init__.py index acaba1f..04c24e3 100644 --- a/flightctl/imagebuilder/__init__.py +++ b/flightctl/imagebuilder/__init__.py @@ -15,7 +15,7 @@ """ # noqa: E501 -__version__ = "1.2.1" +__version__ = "1.3.0" # Define package exports __all__ = [ diff --git a/flightctl/imagebuilder/api_client.py b/flightctl/imagebuilder/api_client.py index e1774ed..6347bd6 100644 --- a/flightctl/imagebuilder/api_client.py +++ b/flightctl/imagebuilder/api_client.py @@ -92,7 +92,7 @@ def __init__( self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/1.2.1/python' + self.user_agent = 'OpenAPI-Generator/1.3.0/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/flightctl/imagebuilder/configuration.py b/flightctl/imagebuilder/configuration.py index d09e30d..c2bd005 100644 --- a/flightctl/imagebuilder/configuration.py +++ b/flightctl/imagebuilder/configuration.py @@ -545,7 +545,7 @@ def to_debug_report(self) -> str: "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: v1alpha1\n"\ - "SDK Package Version: 1.2.1".\ + "SDK Package Version: 1.3.0".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self) -> List[HostSetting]: diff --git a/flightctl/imagebuilder/docs/ImageBuildSpec.md b/flightctl/imagebuilder/docs/ImageBuildSpec.md index 39dd5ba..a928020 100644 --- a/flightctl/imagebuilder/docs/ImageBuildSpec.md +++ b/flightctl/imagebuilder/docs/ImageBuildSpec.md @@ -10,6 +10,7 @@ Name | Type | Description | Notes **destination** | [**ImageBuildDestination**](ImageBuildDestination.md) | | **binding** | [**ImageBuildBinding**](ImageBuildBinding.md) | | **user_configuration** | [**ImageBuildUserConfiguration**](ImageBuildUserConfiguration.md) | | [optional] +**onboarding** | **bool** | When true, installs the flightctl-onboarding RPM and enables flightctl-onboarding-setup.service for first-boot device configuration via a Cockpit-based onboarding wizard. Compatible with both early and late binding. Defaults to false. | [optional] ## Example diff --git a/flightctl/imagebuilder/models/image_build_spec.py b/flightctl/imagebuilder/models/image_build_spec.py index 36652bf..4318853 100644 --- a/flightctl/imagebuilder/models/image_build_spec.py +++ b/flightctl/imagebuilder/models/image_build_spec.py @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field +from pydantic import BaseModel, ConfigDict, Field, StrictBool from typing import Any, ClassVar, Dict, List, Optional from flightctl.imagebuilder.models.image_build_binding import ImageBuildBinding from flightctl.imagebuilder.models.image_build_destination import ImageBuildDestination @@ -35,7 +35,8 @@ class ImageBuildSpec(BaseModel): destination: ImageBuildDestination binding: ImageBuildBinding user_configuration: Optional[ImageBuildUserConfiguration] = Field(default=None, alias="userConfiguration") - __properties: ClassVar[List[str]] = ["source", "destination", "binding", "userConfiguration"] + onboarding: Optional[StrictBool] = Field(default=None, description="When true, installs the flightctl-onboarding RPM and enables flightctl-onboarding-setup.service for first-boot device configuration via a Cockpit-based onboarding wizard. Compatible with both early and late binding. Defaults to false.") + __properties: ClassVar[List[str]] = ["source", "destination", "binding", "userConfiguration", "onboarding"] model_config = ConfigDict( populate_by_name=True, @@ -103,7 +104,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "source": ImageBuildSource.from_dict(obj["source"]) if obj.get("source") is not None else None, "destination": ImageBuildDestination.from_dict(obj["destination"]) if obj.get("destination") is not None else None, "binding": ImageBuildBinding.from_dict(obj["binding"]) if obj.get("binding") is not None else None, - "userConfiguration": ImageBuildUserConfiguration.from_dict(obj["userConfiguration"]) if obj.get("userConfiguration") is not None else None + "userConfiguration": ImageBuildUserConfiguration.from_dict(obj["userConfiguration"]) if obj.get("userConfiguration") is not None else None, + "onboarding": obj.get("onboarding") }) return _obj diff --git a/flightctl/imagebuilder_README.md b/flightctl/imagebuilder_README.md index 0c38efe..b8cf1de 100644 --- a/flightctl/imagebuilder_README.md +++ b/flightctl/imagebuilder_README.md @@ -4,7 +4,7 @@ Image Builder service for Flight Control. This service manages image build resou The `flightctl.imagebuilder` package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: v1alpha1 -- Package version: 1.2.1 +- Package version: 1.3.0 - Generator version: 7.17.0 - Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit [https://flightctl.io](https://flightctl.io) diff --git a/flightctl/models/__init__.py b/flightctl/models/__init__.py index 7ce6a9f..d773609 100644 --- a/flightctl/models/__init__.py +++ b/flightctl/models/__init__.py @@ -19,7 +19,9 @@ from flightctl.models.api_version import ApiVersion from flightctl.models.app_type import AppType from flightctl.models.application_content import ApplicationContent +from flightctl.models.application_desired_state import ApplicationDesiredState from flightctl.models.application_env_vars import ApplicationEnvVars +from flightctl.models.application_lifecycle_changed_details import ApplicationLifecycleChangedDetails from flightctl.models.application_provider_base import ApplicationProviderBase from flightctl.models.application_provider_spec import ApplicationProviderSpec from flightctl.models.application_resource_limits import ApplicationResourceLimits @@ -46,6 +48,8 @@ from flightctl.models.batch import Batch from flightctl.models.batch_limit import BatchLimit from flightctl.models.batch_sequence import BatchSequence +from flightctl.models.catalog_item_ref_application_provider_spec import CatalogItemRefApplicationProviderSpec +from flightctl.models.catalog_item_ref_spec import CatalogItemRefSpec from flightctl.models.certificate_signing_request import CertificateSigningRequest from flightctl.models.certificate_signing_request_list import CertificateSigningRequestList from flightctl.models.certificate_signing_request_spec import CertificateSigningRequestSpec @@ -69,6 +73,7 @@ from flightctl.models.device import Device from flightctl.models.device_application_status import DeviceApplicationStatus from flightctl.models.device_applications_summary_status import DeviceApplicationsSummaryStatus +from flightctl.models.device_capabilities import DeviceCapabilities from flightctl.models.device_config_status import DeviceConfigStatus from flightctl.models.device_console import DeviceConsole from flightctl.models.device_decommission import DeviceDecommission @@ -84,7 +89,6 @@ from flightctl.models.device_list import DeviceList from flightctl.models.device_multiple_owners_detected_details import DeviceMultipleOwnersDetectedDetails from flightctl.models.device_multiple_owners_resolved_details import DeviceMultipleOwnersResolvedDetails -from flightctl.models.device_os_spec import DeviceOsSpec from flightctl.models.device_os_status import DeviceOsStatus from flightctl.models.device_ownership_changed_details import DeviceOwnershipChangedDetails from flightctl.models.device_resource_status import DeviceResourceStatus @@ -102,6 +106,7 @@ from flightctl.models.device_updated_status_type import DeviceUpdatedStatusType from flightctl.models.device_vulnerability_cve_details import DeviceVulnerabilityCveDetails from flightctl.models.devices_summary import DevicesSummary +from flightctl.models.devices_summary_capabilities import DevicesSummaryCapabilities from flightctl.models.disk_resource_monitor_spec import DiskResourceMonitorSpec from flightctl.models.disruption_budget import DisruptionBudget from flightctl.models.docker_auth import DockerAuth @@ -149,9 +154,10 @@ from flightctl.models.http_config_provider_spec import HttpConfigProviderSpec from flightctl.models.http_config_provider_spec_http_ref import HttpConfigProviderSpecHttpRef from flightctl.models.http_repo_spec import HttpRepoSpec -from flightctl.models.image_application_provider_spec import ImageApplicationProviderSpec from flightctl.models.image_mount_volume_provider_spec import ImageMountVolumeProviderSpec +from flightctl.models.image_or_catalog_item_ref_spec import ImageOrCatalogItemRefSpec from flightctl.models.image_pull_policy import ImagePullPolicy +from flightctl.models.image_spec import ImageSpec from flightctl.models.image_volume_provider_spec import ImageVolumeProviderSpec from flightctl.models.image_volume_source import ImageVolumeSource from flightctl.models.inline_application_provider_spec import InlineApplicationProviderSpec @@ -178,6 +184,7 @@ from flightctl.models.organization import Organization from flightctl.models.organization_list import OrganizationList from flightctl.models.organization_spec import OrganizationSpec +from flightctl.models.os_mode_type import OsModeType from flightctl.models.patch_request_inner import PatchRequestInner from flightctl.models.permission import Permission from flightctl.models.permission_list import PermissionList @@ -219,5 +226,6 @@ from flightctl.models.update_schedule import UpdateSchedule from flightctl.models.user_info_response import UserInfoResponse from flightctl.models.version import Version +from flightctl.models.vm_application import VmApplication from flightctl.models.volume_mount import VolumeMount diff --git a/flightctl/models/app_type.py b/flightctl/models/app_type.py index 5760403..6245545 100644 --- a/flightctl/models/app_type.py +++ b/flightctl/models/app_type.py @@ -31,6 +31,7 @@ class AppType(str, Enum): AppTypeQuadlet = 'quadlet' AppTypeContainer = 'container' AppTypeHelm = 'helm' + AppTypeVm = 'vm' @classmethod def from_json(cls, json_str: str) -> Self: diff --git a/flightctl/models/application_desired_state.py b/flightctl/models/application_desired_state.py new file mode 100644 index 0000000..cd51694 --- /dev/null +++ b/flightctl/models/application_desired_state.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Flight Control API + + [Flight Control](https://flightctl.io) is a service for declarative management of fleets of edge devices and their workloads. + + The version of the OpenAPI document: v1beta1 + Contact: team@flightctl.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class ApplicationDesiredState(str, Enum): + """ + Desired lifecycle state for an application. + """ + + """ + allowed enum values + """ + ApplicationDesiredStateRunning = 'running' + ApplicationDesiredStateStopped = 'stopped' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ApplicationDesiredState from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/flightctl/models/application_lifecycle_changed_details.py b/flightctl/models/application_lifecycle_changed_details.py new file mode 100644 index 0000000..335bf2f --- /dev/null +++ b/flightctl/models/application_lifecycle_changed_details.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + Flight Control API + + [Flight Control](https://flightctl.io) is a service for declarative management of fleets of edge devices and their workloads. + + The version of the OpenAPI document: v1beta1 + Contact: team@flightctl.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class ApplicationLifecycleChangedDetails(BaseModel): + """ + ApplicationLifecycleChangedDetails + """ # noqa: E501 + detail_type: StrictStr = Field(description="The type of detail for discriminator purposes.", alias="detailType") + app_name: StrictStr = Field(description="The name of the application whose device-level lifecycle override changed.", alias="appName") + action: StrictStr = Field(description="The lifecycle action that was requested.") + __properties: ClassVar[List[str]] = ["detailType", "appName", "action"] + + @field_validator('detail_type') + def detail_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['ApplicationLifecycleChanged']): + raise ValueError("must be one of enum values ('ApplicationLifecycleChanged')") + return value + + @field_validator('action') + def action_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['stop', 'start', 'restart']): + raise ValueError("must be one of enum values ('stop', 'start', 'restart')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ApplicationLifecycleChangedDetails from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ApplicationLifecycleChangedDetails from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "detailType": obj.get("detailType"), + "appName": obj.get("appName"), + "action": obj.get("action") + }) + return _obj + + diff --git a/flightctl/models/application_provider_base.py b/flightctl/models/application_provider_base.py index 5fc9120..2fd01e7 100644 --- a/flightctl/models/application_provider_base.py +++ b/flightctl/models/application_provider_base.py @@ -18,9 +18,10 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from flightctl.models.app_type import AppType +from flightctl.models.application_desired_state import ApplicationDesiredState from typing import Optional, Set from typing_extensions import Self @@ -30,7 +31,10 @@ class ApplicationProviderBase(BaseModel): """ # noqa: E501 name: Optional[StrictStr] = Field(default=None, description="The application name must be 1–253 characters long, start with a letter or number, and contain no whitespace.") app_type: AppType = Field(alias="appType") - __properties: ClassVar[List[str]] = ["name", "appType"] + annotations: Optional[Dict[str, StrictStr]] = Field(default=None, description="Arbitrary metadata annotations. Used internally by the control plane (e.g., flightctl.io/workload-type) when transforming application types at render time.") + desired_state: Optional[ApplicationDesiredState] = Field(default=None, description="Desired lifecycle state for this application, as most recently set by the stop/start device APIs. Read-only: cannot be set directly by apply; only present in the rendered application spec delivered to the agent.", alias="desiredState") + restart_generation: Optional[StrictInt] = Field(default=None, description="Counter incremented by the restart device API each time the application is restarted. Read-only: cannot be set directly by apply; only present in the rendered application spec delivered to the agent.", alias="restartGeneration") + __properties: ClassVar[List[str]] = ["name", "appType", "annotations", "desiredState", "restartGeneration"] model_config = ConfigDict( populate_by_name=True, @@ -62,8 +66,14 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set([ + "annotations", + "desired_state", + "restart_generation", ]) _dict = self.model_dump( @@ -84,7 +94,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "name": obj.get("name"), - "appType": obj.get("appType") + "appType": obj.get("appType"), + "annotations": obj.get("annotations"), + "desiredState": obj.get("desiredState"), + "restartGeneration": obj.get("restartGeneration") }) return _obj diff --git a/flightctl/models/application_provider_spec.py b/flightctl/models/application_provider_spec.py index 3c10426..2fa9104 100644 --- a/flightctl/models/application_provider_spec.py +++ b/flightctl/models/application_provider_spec.py @@ -22,11 +22,12 @@ from flightctl.models.container_application import ContainerApplication from flightctl.models.helm_application import HelmApplication from flightctl.models.quadlet_application import QuadletApplication +from flightctl.models.vm_application import VmApplication from pydantic import StrictStr, Field from typing import Union, List, Set, Optional, Dict from typing_extensions import Literal, Self -APPLICATIONPROVIDERSPEC_ONE_OF_SCHEMAS = ["ComposeApplication", "ContainerApplication", "HelmApplication", "QuadletApplication"] +APPLICATIONPROVIDERSPEC_ONE_OF_SCHEMAS = ["ComposeApplication", "ContainerApplication", "HelmApplication", "QuadletApplication", "VmApplication"] class ApplicationProviderSpec(BaseModel): """ @@ -40,8 +41,10 @@ class ApplicationProviderSpec(BaseModel): oneof_schema_3_validator: Optional[ContainerApplication] = None # data type: HelmApplication oneof_schema_4_validator: Optional[HelmApplication] = None - actual_instance: Optional[Union[ComposeApplication, ContainerApplication, HelmApplication, QuadletApplication]] = None - one_of_schemas: Set[str] = { "ComposeApplication", "ContainerApplication", "HelmApplication", "QuadletApplication" } + # data type: VmApplication + oneof_schema_5_validator: Optional[VmApplication] = None + actual_instance: Optional[Union[ComposeApplication, ContainerApplication, HelmApplication, QuadletApplication, VmApplication]] = None + one_of_schemas: Set[str] = { "ComposeApplication", "ContainerApplication", "HelmApplication", "QuadletApplication", "VmApplication" } model_config = ConfigDict( validate_assignment=True, @@ -87,12 +90,17 @@ def actual_instance_must_validate_oneof(cls, v): error_messages.append(f"Error! Input type `{type(v)}` is not `HelmApplication`") else: match += 1 + # validate data type: VmApplication + if not isinstance(v, VmApplication): + error_messages.append(f"Error! Input type `{type(v)}` is not `VmApplication`") + else: + match += 1 if match > 1: # more than 1 match - raise ValueError("Multiple matches found when setting `actual_instance` in ApplicationProviderSpec with oneOf schemas: ComposeApplication, ContainerApplication, HelmApplication, QuadletApplication. Details: " + ", ".join(error_messages)) + raise ValueError("Multiple matches found when setting `actual_instance` in ApplicationProviderSpec with oneOf schemas: ComposeApplication, ContainerApplication, HelmApplication, QuadletApplication, VmApplication. Details: " + ", ".join(error_messages)) elif match == 0: # no match - raise ValueError("No match found when setting `actual_instance` in ApplicationProviderSpec with oneOf schemas: ComposeApplication, ContainerApplication, HelmApplication, QuadletApplication. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when setting `actual_instance` in ApplicationProviderSpec with oneOf schemas: ComposeApplication, ContainerApplication, HelmApplication, QuadletApplication, VmApplication. Details: " + ", ".join(error_messages)) else: return v @@ -132,6 +140,11 @@ def from_json(cls, json_str: str) -> Self: instance.actual_instance = QuadletApplication.from_json(json_str) return instance + # check if data type is `VmApplication` + if _data_type == "vm": + instance.actual_instance = VmApplication.from_json(json_str) + return instance + # deserialize data into ComposeApplication try: instance.actual_instance = ComposeApplication.from_json(json_str) @@ -156,13 +169,19 @@ def from_json(cls, json_str: str) -> Self: match += 1 except (ValidationError, ValueError) as e: error_messages.append(str(e)) + # deserialize data into VmApplication + try: + instance.actual_instance = VmApplication.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) if match > 1: # more than 1 match - raise ValueError("Multiple matches found when deserializing the JSON string into ApplicationProviderSpec with oneOf schemas: ComposeApplication, ContainerApplication, HelmApplication, QuadletApplication. Details: " + ", ".join(error_messages)) + raise ValueError("Multiple matches found when deserializing the JSON string into ApplicationProviderSpec with oneOf schemas: ComposeApplication, ContainerApplication, HelmApplication, QuadletApplication, VmApplication. Details: " + ", ".join(error_messages)) elif match == 0: # no match - raise ValueError("No match found when deserializing the JSON string into ApplicationProviderSpec with oneOf schemas: ComposeApplication, ContainerApplication, HelmApplication, QuadletApplication. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when deserializing the JSON string into ApplicationProviderSpec with oneOf schemas: ComposeApplication, ContainerApplication, HelmApplication, QuadletApplication, VmApplication. Details: " + ", ".join(error_messages)) else: return instance @@ -176,7 +195,7 @@ def to_json(self) -> str: else: return json.dumps(self.actual_instance) - def to_dict(self) -> Optional[Union[Dict[str, Any], ComposeApplication, ContainerApplication, HelmApplication, QuadletApplication]]: + def to_dict(self) -> Optional[Union[Dict[str, Any], ComposeApplication, ContainerApplication, HelmApplication, QuadletApplication, VmApplication]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None diff --git a/flightctl/models/application_status_type.py b/flightctl/models/application_status_type.py index 9e0b0fb..5f12ebe 100644 --- a/flightctl/models/application_status_type.py +++ b/flightctl/models/application_status_type.py @@ -33,6 +33,8 @@ class ApplicationStatusType(str, Enum): ApplicationStatusError = 'Error' ApplicationStatusUnknown = 'Unknown' ApplicationStatusCompleted = 'Completed' + ApplicationStatusStopped = 'Stopped' + ApplicationStatusStopping = 'Stopping' @classmethod def from_json(cls, json_str: str) -> Self: diff --git a/flightctl/models/catalog_item_ref_application_provider_spec.py b/flightctl/models/catalog_item_ref_application_provider_spec.py new file mode 100644 index 0000000..6a73fc8 --- /dev/null +++ b/flightctl/models/catalog_item_ref_application_provider_spec.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Flight Control API + + [Flight Control](https://flightctl.io) is a service for declarative management of fleets of edge devices and their workloads. + + The version of the OpenAPI document: v1beta1 + Contact: team@flightctl.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List +from flightctl.models.catalog_item_ref_spec import CatalogItemRefSpec +from typing import Optional, Set +from typing_extensions import Self + +class CatalogItemRefApplicationProviderSpec(BaseModel): + """ + CatalogItemRefApplicationProviderSpec + """ # noqa: E501 + catalog_item_ref: CatalogItemRefSpec = Field(alias="catalogItemRef") + __properties: ClassVar[List[str]] = ["catalogItemRef"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CatalogItemRefApplicationProviderSpec from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of catalog_item_ref + if self.catalog_item_ref: + _dict['catalogItemRef'] = self.catalog_item_ref.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CatalogItemRefApplicationProviderSpec from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "catalogItemRef": CatalogItemRefSpec.from_dict(obj["catalogItemRef"]) if obj.get("catalogItemRef") is not None else None + }) + return _obj + + diff --git a/flightctl/models/catalog_item_ref_spec.py b/flightctl/models/catalog_item_ref_spec.py new file mode 100644 index 0000000..f8ed43e --- /dev/null +++ b/flightctl/models/catalog_item_ref_spec.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Flight Control API + + [Flight Control](https://flightctl.io) is a service for declarative management of fleets of edge devices and their workloads. + + The version of the OpenAPI document: v1beta1 + Contact: team@flightctl.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class CatalogItemRefSpec(BaseModel): + """ + A reference to a catalog item, along with its configuration. + """ # noqa: E501 + catalog: StrictStr = Field(description="The catalog name that the item is part of.") + item: StrictStr = Field(description="The name of the catalog item itself.") + version: StrictStr = Field(description="A valid version that currently exists in the catalog item.") + channel: Optional[StrictStr] = Field(default=None, description="An optional update channel which will be used to provide update cues when available.") + __properties: ClassVar[List[str]] = ["catalog", "item", "version", "channel"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CatalogItemRefSpec from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CatalogItemRefSpec from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "catalog": obj.get("catalog"), + "item": obj.get("item"), + "version": obj.get("version"), + "channel": obj.get("channel") + }) + return _obj + + diff --git a/flightctl/models/compose_application.py b/flightctl/models/compose_application.py index 7edf379..9b4838b 100644 --- a/flightctl/models/compose_application.py +++ b/flightctl/models/compose_application.py @@ -18,11 +18,13 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from flightctl.models.app_type import AppType from flightctl.models.application_content import ApplicationContent +from flightctl.models.application_desired_state import ApplicationDesiredState from flightctl.models.application_volume import ApplicationVolume +from flightctl.models.catalog_item_ref_spec import CatalogItemRefSpec from typing import Optional, Set from typing_extensions import Self @@ -32,11 +34,15 @@ class ComposeApplication(BaseModel): """ # noqa: E501 name: Optional[StrictStr] = Field(default=None, description="The application name must be 1–253 characters long, start with a letter or number, and contain no whitespace.") app_type: AppType = Field(alias="appType") + annotations: Optional[Dict[str, StrictStr]] = Field(default=None, description="Arbitrary metadata annotations. Used internally by the control plane (e.g., flightctl.io/workload-type) when transforming application types at render time.") + desired_state: Optional[ApplicationDesiredState] = Field(default=None, description="Desired lifecycle state for this application, as most recently set by the stop/start device APIs. Read-only: cannot be set directly by apply; only present in the rendered application spec delivered to the agent.", alias="desiredState") + restart_generation: Optional[StrictInt] = Field(default=None, description="Counter incremented by the restart device API each time the application is restarted. Read-only: cannot be set directly by apply; only present in the rendered application spec delivered to the agent.", alias="restartGeneration") env_vars: Optional[Dict[str, StrictStr]] = Field(default=None, description="Environment variable key-value pairs, injected during runtime. The key and value each must be between 1 and 253 characters.", alias="envVars") volumes: Optional[List[ApplicationVolume]] = Field(default=None, description="List of application volumes.") - image: StrictStr = Field(description="Reference to the OCI image or artifact for the application package.") + image: StrictStr = Field(description="Reference to an OCI image or artifact with tag.") + catalog_item_ref: CatalogItemRefSpec = Field(alias="catalogItemRef") inline: List[ApplicationContent] = Field(description="A list of application content.") - __properties: ClassVar[List[str]] = ["name", "appType", "envVars", "volumes", "image", "inline"] + __properties: ClassVar[List[str]] = ["name", "appType", "annotations", "desiredState", "restartGeneration", "envVars", "volumes", "image", "catalogItemRef", "inline"] model_config = ConfigDict( populate_by_name=True, @@ -68,8 +74,14 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set([ + "annotations", + "desired_state", + "restart_generation", ]) _dict = self.model_dump( @@ -84,6 +96,9 @@ def to_dict(self) -> Dict[str, Any]: if _item_volumes: _items.append(_item_volumes.to_dict()) _dict['volumes'] = _items + # override the default output from pydantic by calling `to_dict()` of catalog_item_ref + if self.catalog_item_ref: + _dict['catalogItemRef'] = self.catalog_item_ref.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in inline (list) _items = [] if self.inline: @@ -105,9 +120,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "name": obj.get("name"), "appType": obj.get("appType"), + "annotations": obj.get("annotations"), + "desiredState": obj.get("desiredState"), + "restartGeneration": obj.get("restartGeneration"), "envVars": obj.get("envVars"), "volumes": [ApplicationVolume.from_dict(_item) for _item in obj["volumes"]] if obj.get("volumes") is not None else None, "image": obj.get("image"), + "catalogItemRef": CatalogItemRefSpec.from_dict(obj["catalogItemRef"]) if obj.get("catalogItemRef") is not None else None, "inline": [ApplicationContent.from_dict(_item) for _item in obj["inline"]] if obj.get("inline") is not None else None }) return _obj diff --git a/flightctl/models/container_application.py b/flightctl/models/container_application.py index 52c0b68..2e8e91c 100644 --- a/flightctl/models/container_application.py +++ b/flightctl/models/container_application.py @@ -18,12 +18,14 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated from flightctl.models.app_type import AppType +from flightctl.models.application_desired_state import ApplicationDesiredState from flightctl.models.application_resources import ApplicationResources from flightctl.models.application_volume import ApplicationVolume +from flightctl.models.catalog_item_ref_spec import CatalogItemRefSpec from typing import Optional, Set from typing_extensions import Self @@ -33,13 +35,17 @@ class ContainerApplication(BaseModel): """ # noqa: E501 name: Optional[StrictStr] = Field(default=None, description="The application name must be 1–253 characters long, start with a letter or number, and contain no whitespace.") app_type: AppType = Field(alias="appType") + annotations: Optional[Dict[str, StrictStr]] = Field(default=None, description="Arbitrary metadata annotations. Used internally by the control plane (e.g., flightctl.io/workload-type) when transforming application types at render time.") + desired_state: Optional[ApplicationDesiredState] = Field(default=None, description="Desired lifecycle state for this application, as most recently set by the stop/start device APIs. Read-only: cannot be set directly by apply; only present in the rendered application spec delivered to the agent.", alias="desiredState") + restart_generation: Optional[StrictInt] = Field(default=None, description="Counter incremented by the restart device API each time the application is restarted. Read-only: cannot be set directly by apply; only present in the rendered application spec delivered to the agent.", alias="restartGeneration") env_vars: Optional[Dict[str, StrictStr]] = Field(default=None, description="Environment variable key-value pairs, injected during runtime. The key and value each must be between 1 and 253 characters.", alias="envVars") run_as: Optional[StrictStr] = Field(default=None, description="The username of the system user this application should be run under. This is not the same as the user within any containers of the application (if applicable). Defaults to the user that the agent runs as (generally root) if not specified.", alias="runAs") volumes: Optional[List[ApplicationVolume]] = Field(default=None, description="List of application volumes.") - image: StrictStr = Field(description="Reference to the image for this container.") + image: StrictStr = Field(description="Reference to an OCI image or artifact with tag.") + catalog_item_ref: CatalogItemRefSpec = Field(alias="catalogItemRef") ports: Optional[List[Annotated[str, Field(strict=True)]]] = Field(default=None, description="Port mappings.") resources: Optional[ApplicationResources] = None - __properties: ClassVar[List[str]] = ["name", "appType", "envVars", "runAs", "volumes", "image", "ports", "resources"] + __properties: ClassVar[List[str]] = ["name", "appType", "annotations", "desiredState", "restartGeneration", "envVars", "runAs", "volumes", "image", "catalogItemRef", "ports", "resources"] model_config = ConfigDict( populate_by_name=True, @@ -71,8 +77,14 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set([ + "annotations", + "desired_state", + "restart_generation", ]) _dict = self.model_dump( @@ -87,6 +99,9 @@ def to_dict(self) -> Dict[str, Any]: if _item_volumes: _items.append(_item_volumes.to_dict()) _dict['volumes'] = _items + # override the default output from pydantic by calling `to_dict()` of catalog_item_ref + if self.catalog_item_ref: + _dict['catalogItemRef'] = self.catalog_item_ref.to_dict() # override the default output from pydantic by calling `to_dict()` of resources if self.resources: _dict['resources'] = self.resources.to_dict() @@ -104,10 +119,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "name": obj.get("name"), "appType": obj.get("appType"), + "annotations": obj.get("annotations"), + "desiredState": obj.get("desiredState"), + "restartGeneration": obj.get("restartGeneration"), "envVars": obj.get("envVars"), "runAs": obj.get("runAs"), "volumes": [ApplicationVolume.from_dict(_item) for _item in obj["volumes"]] if obj.get("volumes") is not None else None, "image": obj.get("image"), + "catalogItemRef": CatalogItemRefSpec.from_dict(obj["catalogItemRef"]) if obj.get("catalogItemRef") is not None else None, "ports": obj.get("ports"), "resources": ApplicationResources.from_dict(obj["resources"]) if obj.get("resources") is not None else None }) diff --git a/flightctl/models/device_capabilities.py b/flightctl/models/device_capabilities.py new file mode 100644 index 0000000..7a47e37 --- /dev/null +++ b/flightctl/models/device_capabilities.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Flight Control API + + [Flight Control](https://flightctl.io) is a service for declarative management of fleets of edge devices and their workloads. + + The version of the OpenAPI document: v1beta1 + Contact: team@flightctl.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from flightctl.models.os_mode_type import OsModeType +from typing import Optional, Set +from typing_extensions import Self + +class DeviceCapabilities(BaseModel): + """ + Capabilities reported by the device agent. + """ # noqa: E501 + os_mode: Optional[OsModeType] = Field(default=None, alias="osMode") + __properties: ClassVar[List[str]] = ["osMode"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DeviceCapabilities from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DeviceCapabilities from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "osMode": obj.get("osMode") + }) + return _obj + + diff --git a/flightctl/models/device_spec.py b/flightctl/models/device_spec.py index 3e27a39..b1ef4db 100644 --- a/flightctl/models/device_spec.py +++ b/flightctl/models/device_spec.py @@ -24,9 +24,9 @@ from flightctl.models.config_provider_spec import ConfigProviderSpec from flightctl.models.device_console import DeviceConsole from flightctl.models.device_decommission import DeviceDecommission -from flightctl.models.device_os_spec import DeviceOsSpec from flightctl.models.device_spec_systemd import DeviceSpecSystemd from flightctl.models.device_update_policy_spec import DeviceUpdatePolicySpec +from flightctl.models.image_or_catalog_item_ref_spec import ImageOrCatalogItemRefSpec from flightctl.models.resource_monitor import ResourceMonitor from typing import Optional, Set from typing_extensions import Self @@ -36,7 +36,7 @@ class DeviceSpec(BaseModel): DeviceSpec describes a device. """ # noqa: E501 update_policy: Optional[DeviceUpdatePolicySpec] = Field(default=None, alias="updatePolicy") - os: Optional[DeviceOsSpec] = None + os: Optional[ImageOrCatalogItemRefSpec] = None config: Optional[List[ConfigProviderSpec]] = Field(default=None, description="List of config providers.") applications: Optional[List[ApplicationProviderSpec]] = Field(default=None, description="List of application providers.") systemd: Optional[DeviceSpecSystemd] = None @@ -137,7 +137,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "updatePolicy": DeviceUpdatePolicySpec.from_dict(obj["updatePolicy"]) if obj.get("updatePolicy") is not None else None, - "os": DeviceOsSpec.from_dict(obj["os"]) if obj.get("os") is not None else None, + "os": ImageOrCatalogItemRefSpec.from_dict(obj["os"]) if obj.get("os") is not None else None, "config": [ConfigProviderSpec.from_dict(_item) for _item in obj["config"]] if obj.get("config") is not None else None, "applications": [ApplicationProviderSpec.from_dict(_item) for _item in obj["applications"]] if obj.get("applications") is not None else None, "systemd": DeviceSpecSystemd.from_dict(obj["systemd"]) if obj.get("systemd") is not None else None, diff --git a/flightctl/models/device_status.py b/flightctl/models/device_status.py index 7a6e8e6..a3261c6 100644 --- a/flightctl/models/device_status.py +++ b/flightctl/models/device_status.py @@ -25,6 +25,7 @@ from flightctl.models.dependency_sync_status import DependencySyncStatus from flightctl.models.device_application_status import DeviceApplicationStatus from flightctl.models.device_applications_summary_status import DeviceApplicationsSummaryStatus +from flightctl.models.device_capabilities import DeviceCapabilities from flightctl.models.device_config_status import DeviceConfigStatus from flightctl.models.device_integrity_status import DeviceIntegrityStatus from flightctl.models.device_lifecycle_status import DeviceLifecycleStatus @@ -55,7 +56,8 @@ class DeviceStatus(BaseModel): last_seen: Optional[datetime] = Field(default=None, description="The last time the device was seen by the service (NOTE: this property is not returned by the API).", alias="lastSeen") lifecycle: DeviceLifecycleStatus dependency_sync: Optional[DependencySyncStatus] = Field(default=None, alias="dependencySync") - __properties: ClassVar[List[str]] = ["conditions", "systemInfo", "systemd", "applications", "applicationsSummary", "resources", "integrity", "config", "os", "updated", "summary", "lastSeen", "lifecycle", "dependencySync"] + capabilities: Optional[DeviceCapabilities] = None + __properties: ClassVar[List[str]] = ["conditions", "systemInfo", "systemd", "applications", "applicationsSummary", "resources", "integrity", "config", "os", "updated", "summary", "lastSeen", "lifecycle", "dependencySync", "capabilities"] model_config = ConfigDict( populate_by_name=True, @@ -147,6 +149,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of dependency_sync if self.dependency_sync: _dict['dependencySync'] = self.dependency_sync.to_dict() + # override the default output from pydantic by calling `to_dict()` of capabilities + if self.capabilities: + _dict['capabilities'] = self.capabilities.to_dict() return _dict @classmethod @@ -172,7 +177,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "summary": DeviceSummaryStatus.from_dict(obj["summary"]) if obj.get("summary") is not None else None, "lastSeen": obj.get("lastSeen"), "lifecycle": DeviceLifecycleStatus.from_dict(obj["lifecycle"]) if obj.get("lifecycle") is not None else None, - "dependencySync": DependencySyncStatus.from_dict(obj["dependencySync"]) if obj.get("dependencySync") is not None else None + "dependencySync": DependencySyncStatus.from_dict(obj["dependencySync"]) if obj.get("dependencySync") is not None else None, + "capabilities": DeviceCapabilities.from_dict(obj["capabilities"]) if obj.get("capabilities") is not None else None }) return _obj diff --git a/flightctl/models/devices_summary.py b/flightctl/models/devices_summary.py index f29f1ec..6ce6b2f 100644 --- a/flightctl/models/devices_summary.py +++ b/flightctl/models/devices_summary.py @@ -19,7 +19,8 @@ import json from pydantic import BaseModel, ConfigDict, Field, StrictInt -from typing import Any, ClassVar, Dict, List +from typing import Any, ClassVar, Dict, List, Optional +from flightctl.models.devices_summary_capabilities import DevicesSummaryCapabilities from typing import Optional, Set from typing_extensions import Self @@ -31,7 +32,8 @@ class DevicesSummary(BaseModel): application_status: Dict[str, StrictInt] = Field(description="A breakdown of the devices in the fleet by \"application\" status.", alias="applicationStatus") summary_status: Dict[str, StrictInt] = Field(description="A breakdown of the devices in the fleet by \"summary\" status.", alias="summaryStatus") update_status: Dict[str, StrictInt] = Field(description="A breakdown of the devices in the fleet by \"updated\" status.", alias="updateStatus") - __properties: ClassVar[List[str]] = ["total", "applicationStatus", "summaryStatus", "updateStatus"] + capabilities: Optional[DevicesSummaryCapabilities] = None + __properties: ClassVar[List[str]] = ["total", "applicationStatus", "summaryStatus", "updateStatus", "capabilities"] model_config = ConfigDict( populate_by_name=True, @@ -72,6 +74,9 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of capabilities + if self.capabilities: + _dict['capabilities'] = self.capabilities.to_dict() return _dict @classmethod @@ -87,7 +92,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "total": obj.get("total"), "applicationStatus": obj.get("applicationStatus"), "summaryStatus": obj.get("summaryStatus"), - "updateStatus": obj.get("updateStatus") + "updateStatus": obj.get("updateStatus"), + "capabilities": DevicesSummaryCapabilities.from_dict(obj["capabilities"]) if obj.get("capabilities") is not None else None }) return _obj diff --git a/flightctl/models/devices_summary_capabilities.py b/flightctl/models/devices_summary_capabilities.py new file mode 100644 index 0000000..59f48c0 --- /dev/null +++ b/flightctl/models/devices_summary_capabilities.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Flight Control API + + [Flight Control](https://flightctl.io) is a service for declarative management of fleets of edge devices and their workloads. + + The version of the OpenAPI document: v1beta1 + Contact: team@flightctl.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class DevicesSummaryCapabilities(BaseModel): + """ + Breakdowns of devices by status.capabilities fields. + """ # noqa: E501 + os_mode: Optional[Dict[str, StrictInt]] = Field(default=None, description="Counts by status.capabilities.osMode (e.g. image, package). The key \"unknown\" counts devices that have not reported the capability.", alias="osMode") + __properties: ClassVar[List[str]] = ["osMode"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DevicesSummaryCapabilities from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DevicesSummaryCapabilities from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "osMode": obj.get("osMode") + }) + return _obj + + diff --git a/flightctl/models/enrollment_request_spec.py b/flightctl/models/enrollment_request_spec.py index cb36e69..40ec70b 100644 --- a/flightctl/models/enrollment_request_spec.py +++ b/flightctl/models/enrollment_request_spec.py @@ -21,6 +21,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from flightctl.models.device_status import DeviceStatus +from flightctl.models.os_mode_type import OsModeType from typing import Optional, Set from typing_extensions import Self @@ -32,7 +33,8 @@ class EnrollmentRequestSpec(BaseModel): device_status: Optional[DeviceStatus] = Field(default=None, alias="deviceStatus") labels: Optional[Dict[str, StrictStr]] = Field(default=None, description="A set of labels that the service will apply to this device when its enrollment is approved.") known_rendered_version: Optional[StrictStr] = Field(default=None, description="The rendered version of the device from desired.json (optional).", alias="knownRenderedVersion") - __properties: ClassVar[List[str]] = ["csr", "deviceStatus", "labels", "knownRenderedVersion"] + os_mode: Optional[OsModeType] = Field(default=None, alias="osMode") + __properties: ClassVar[List[str]] = ["csr", "deviceStatus", "labels", "knownRenderedVersion", "osMode"] model_config = ConfigDict( populate_by_name=True, @@ -91,7 +93,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "csr": obj.get("csr"), "deviceStatus": DeviceStatus.from_dict(obj["deviceStatus"]) if obj.get("deviceStatus") is not None else None, "labels": obj.get("labels"), - "knownRenderedVersion": obj.get("knownRenderedVersion") + "knownRenderedVersion": obj.get("knownRenderedVersion"), + "osMode": obj.get("osMode") }) return _obj diff --git a/flightctl/models/event.py b/flightctl/models/event.py index c4c48d3..67f2ff6 100644 --- a/flightctl/models/event.py +++ b/flightctl/models/event.py @@ -46,8 +46,8 @@ class Event(BaseModel): @field_validator('reason') def reason_validate_enum(cls, value): """Validates the enum""" - if value not in set(['ResourceCreated', 'ResourceCreationFailed', 'ResourceUpdated', 'ResourceUpdateFailed', 'ResourceDeleted', 'ResourceDeletionFailed', 'DeviceDecommissioned', 'DeviceDecommissionFailed', 'DeviceCPUCritical', 'DeviceCPUWarning', 'DeviceCPUNormal', 'DeviceMemoryCritical', 'DeviceMemoryWarning', 'DeviceMemoryNormal', 'DeviceDiskCritical', 'DeviceDiskWarning', 'DeviceDiskNormal', 'DeviceApplicationError', 'DeviceApplicationDegraded', 'DeviceApplicationHealthy', 'DeviceDisconnected', 'DeviceIsRebooting', 'DeviceConflictPaused', 'DeviceConflictResolved', 'DeviceConnected', 'DeviceContentUpToDate', 'DeviceContentOutOfDate', 'DeviceContentUpdating', 'DeviceUpdateFailed', 'DeviceVulnerabilityCVECritical', 'DeviceVulnerabilityCVEResolved', 'DeviceVulnerabilityCVEWarning', 'DeviceOSImageChanged', 'EnrollmentRequestApproved', 'EnrollmentRequestApprovalFailed', 'DeviceMultipleOwnersDetected', 'DeviceMultipleOwnersResolved', 'DeviceSpecValid', 'DeviceSpecInvalid', 'InternalTaskFailed', 'InternalTaskPermanentlyFailed', 'RepositoryAccessible', 'RepositoryInaccessible', 'ReferencedRepositoryUpdated', 'FleetValid', 'FleetInvalid', 'FleetRolloutCreated', 'FleetRolloutStarted', 'FleetRolloutFailed', 'FleetRolloutCompleted', 'FleetRolloutBatchDispatched', 'FleetRolloutDeviceSelected', 'FleetRolloutBatchCompleted', 'ResourceSyncCommitDetected', 'ResourceSyncAccessible', 'ResourceSyncInaccessible', 'ResourceSyncParsed', 'ResourceSyncParsingFailed', 'ResourceSyncSynced', 'ResourceSyncSyncFailed', 'DependencyChangeDetected', 'DependencySyncProbeFailed', 'SystemRestored']): - raise ValueError("must be one of enum values ('ResourceCreated', 'ResourceCreationFailed', 'ResourceUpdated', 'ResourceUpdateFailed', 'ResourceDeleted', 'ResourceDeletionFailed', 'DeviceDecommissioned', 'DeviceDecommissionFailed', 'DeviceCPUCritical', 'DeviceCPUWarning', 'DeviceCPUNormal', 'DeviceMemoryCritical', 'DeviceMemoryWarning', 'DeviceMemoryNormal', 'DeviceDiskCritical', 'DeviceDiskWarning', 'DeviceDiskNormal', 'DeviceApplicationError', 'DeviceApplicationDegraded', 'DeviceApplicationHealthy', 'DeviceDisconnected', 'DeviceIsRebooting', 'DeviceConflictPaused', 'DeviceConflictResolved', 'DeviceConnected', 'DeviceContentUpToDate', 'DeviceContentOutOfDate', 'DeviceContentUpdating', 'DeviceUpdateFailed', 'DeviceVulnerabilityCVECritical', 'DeviceVulnerabilityCVEResolved', 'DeviceVulnerabilityCVEWarning', 'DeviceOSImageChanged', 'EnrollmentRequestApproved', 'EnrollmentRequestApprovalFailed', 'DeviceMultipleOwnersDetected', 'DeviceMultipleOwnersResolved', 'DeviceSpecValid', 'DeviceSpecInvalid', 'InternalTaskFailed', 'InternalTaskPermanentlyFailed', 'RepositoryAccessible', 'RepositoryInaccessible', 'ReferencedRepositoryUpdated', 'FleetValid', 'FleetInvalid', 'FleetRolloutCreated', 'FleetRolloutStarted', 'FleetRolloutFailed', 'FleetRolloutCompleted', 'FleetRolloutBatchDispatched', 'FleetRolloutDeviceSelected', 'FleetRolloutBatchCompleted', 'ResourceSyncCommitDetected', 'ResourceSyncAccessible', 'ResourceSyncInaccessible', 'ResourceSyncParsed', 'ResourceSyncParsingFailed', 'ResourceSyncSynced', 'ResourceSyncSyncFailed', 'DependencyChangeDetected', 'DependencySyncProbeFailed', 'SystemRestored')") + if value not in set(['ResourceCreated', 'ResourceCreationFailed', 'ResourceUpdated', 'ResourceUpdateFailed', 'ResourceDeleted', 'ResourceDeletionFailed', 'DeviceDecommissioned', 'DeviceDecommissionFailed', 'DeviceCPUCritical', 'DeviceCPUWarning', 'DeviceCPUNormal', 'DeviceMemoryCritical', 'DeviceMemoryWarning', 'DeviceMemoryNormal', 'DeviceDiskCritical', 'DeviceDiskWarning', 'DeviceDiskNormal', 'DeviceApplicationError', 'DeviceApplicationDegraded', 'DeviceApplicationHealthy', 'DeviceDisconnected', 'DeviceIsRebooting', 'DeviceConflictPaused', 'DeviceConflictResolved', 'DeviceConnected', 'DeviceContentUpToDate', 'DeviceContentOutOfDate', 'DeviceContentUpdating', 'DeviceUpdateFailed', 'DeviceVulnerabilityCVECritical', 'DeviceVulnerabilityCVEResolved', 'DeviceVulnerabilityCVEWarning', 'DeviceOSImageChanged', 'EnrollmentRequestApproved', 'EnrollmentRequestApprovalFailed', 'DeviceMultipleOwnersDetected', 'DeviceMultipleOwnersResolved', 'DeviceSpecValid', 'DeviceSpecInvalid', 'InternalTaskFailed', 'InternalTaskPermanentlyFailed', 'RepositoryAccessible', 'RepositoryInaccessible', 'ReferencedRepositoryUpdated', 'FleetValid', 'FleetInvalid', 'FleetRolloutCreated', 'FleetRolloutStarted', 'FleetRolloutFailed', 'FleetRolloutCompleted', 'FleetRolloutBatchDispatched', 'FleetRolloutDeviceSelected', 'FleetRolloutBatchCompleted', 'ResourceSyncCommitDetected', 'ResourceSyncAccessible', 'ResourceSyncInaccessible', 'ResourceSyncParsed', 'ResourceSyncParsingFailed', 'ResourceSyncSynced', 'ResourceSyncSyncFailed', 'DependencyChangeDetected', 'DependencySyncProbeFailed', 'SystemRestored', 'EncryptionMigrationStarted', 'EncryptionMigrationCompleted', 'ApplicationLifecycleChanged']): + raise ValueError("must be one of enum values ('ResourceCreated', 'ResourceCreationFailed', 'ResourceUpdated', 'ResourceUpdateFailed', 'ResourceDeleted', 'ResourceDeletionFailed', 'DeviceDecommissioned', 'DeviceDecommissionFailed', 'DeviceCPUCritical', 'DeviceCPUWarning', 'DeviceCPUNormal', 'DeviceMemoryCritical', 'DeviceMemoryWarning', 'DeviceMemoryNormal', 'DeviceDiskCritical', 'DeviceDiskWarning', 'DeviceDiskNormal', 'DeviceApplicationError', 'DeviceApplicationDegraded', 'DeviceApplicationHealthy', 'DeviceDisconnected', 'DeviceIsRebooting', 'DeviceConflictPaused', 'DeviceConflictResolved', 'DeviceConnected', 'DeviceContentUpToDate', 'DeviceContentOutOfDate', 'DeviceContentUpdating', 'DeviceUpdateFailed', 'DeviceVulnerabilityCVECritical', 'DeviceVulnerabilityCVEResolved', 'DeviceVulnerabilityCVEWarning', 'DeviceOSImageChanged', 'EnrollmentRequestApproved', 'EnrollmentRequestApprovalFailed', 'DeviceMultipleOwnersDetected', 'DeviceMultipleOwnersResolved', 'DeviceSpecValid', 'DeviceSpecInvalid', 'InternalTaskFailed', 'InternalTaskPermanentlyFailed', 'RepositoryAccessible', 'RepositoryInaccessible', 'ReferencedRepositoryUpdated', 'FleetValid', 'FleetInvalid', 'FleetRolloutCreated', 'FleetRolloutStarted', 'FleetRolloutFailed', 'FleetRolloutCompleted', 'FleetRolloutBatchDispatched', 'FleetRolloutDeviceSelected', 'FleetRolloutBatchCompleted', 'ResourceSyncCommitDetected', 'ResourceSyncAccessible', 'ResourceSyncInaccessible', 'ResourceSyncParsed', 'ResourceSyncParsingFailed', 'ResourceSyncSynced', 'ResourceSyncSyncFailed', 'DependencyChangeDetected', 'DependencySyncProbeFailed', 'SystemRestored', 'EncryptionMigrationStarted', 'EncryptionMigrationCompleted', 'ApplicationLifecycleChanged')") return value @field_validator('type') diff --git a/flightctl/models/event_details.py b/flightctl/models/event_details.py index a1d90b3..d8923bb 100644 --- a/flightctl/models/event_details.py +++ b/flightctl/models/event_details.py @@ -18,6 +18,7 @@ import pprint from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator from typing import Any, List, Optional +from flightctl.models.application_lifecycle_changed_details import ApplicationLifecycleChangedDetails from flightctl.models.dependency_change_detected_details import DependencyChangeDetectedDetails from flightctl.models.dependency_sync_probe_failed_details import DependencySyncProbeFailedDetails from flightctl.models.device_multiple_owners_detected_details import DeviceMultipleOwnersDetectedDetails @@ -37,7 +38,7 @@ from typing import Union, List, Set, Optional, Dict from typing_extensions import Literal, Self -EVENTDETAILS_ONE_OF_SCHEMAS = ["DependencyChangeDetectedDetails", "DependencySyncProbeFailedDetails", "DeviceMultipleOwnersDetectedDetails", "DeviceMultipleOwnersResolvedDetails", "DeviceOwnershipChangedDetails", "DeviceVulnerabilityCveDetails", "FleetRolloutBatchCompletedDetails", "FleetRolloutBatchDispatchedDetails", "FleetRolloutCompletedDetails", "FleetRolloutDeviceSelectedDetails", "FleetRolloutFailedDetails", "FleetRolloutStartedDetails", "InternalTaskFailedDetails", "InternalTaskPermanentlyFailedDetails", "ReferencedRepositoryUpdatedDetails", "ResourceSyncCompletedDetails", "ResourceUpdatedDetails"] +EVENTDETAILS_ONE_OF_SCHEMAS = ["ApplicationLifecycleChangedDetails", "DependencyChangeDetectedDetails", "DependencySyncProbeFailedDetails", "DeviceMultipleOwnersDetectedDetails", "DeviceMultipleOwnersResolvedDetails", "DeviceOwnershipChangedDetails", "DeviceVulnerabilityCveDetails", "FleetRolloutBatchCompletedDetails", "FleetRolloutBatchDispatchedDetails", "FleetRolloutCompletedDetails", "FleetRolloutDeviceSelectedDetails", "FleetRolloutFailedDetails", "FleetRolloutStartedDetails", "InternalTaskFailedDetails", "InternalTaskPermanentlyFailedDetails", "ReferencedRepositoryUpdatedDetails", "ResourceSyncCompletedDetails", "ResourceUpdatedDetails"] class EventDetails(BaseModel): """ @@ -77,8 +78,10 @@ class EventDetails(BaseModel): oneof_schema_16_validator: Optional[DependencyChangeDetectedDetails] = None # data type: DependencySyncProbeFailedDetails oneof_schema_17_validator: Optional[DependencySyncProbeFailedDetails] = None - actual_instance: Optional[Union[DependencyChangeDetectedDetails, DependencySyncProbeFailedDetails, DeviceMultipleOwnersDetectedDetails, DeviceMultipleOwnersResolvedDetails, DeviceOwnershipChangedDetails, DeviceVulnerabilityCveDetails, FleetRolloutBatchCompletedDetails, FleetRolloutBatchDispatchedDetails, FleetRolloutCompletedDetails, FleetRolloutDeviceSelectedDetails, FleetRolloutFailedDetails, FleetRolloutStartedDetails, InternalTaskFailedDetails, InternalTaskPermanentlyFailedDetails, ReferencedRepositoryUpdatedDetails, ResourceSyncCompletedDetails, ResourceUpdatedDetails]] = None - one_of_schemas: Set[str] = { "DependencyChangeDetectedDetails", "DependencySyncProbeFailedDetails", "DeviceMultipleOwnersDetectedDetails", "DeviceMultipleOwnersResolvedDetails", "DeviceOwnershipChangedDetails", "DeviceVulnerabilityCveDetails", "FleetRolloutBatchCompletedDetails", "FleetRolloutBatchDispatchedDetails", "FleetRolloutCompletedDetails", "FleetRolloutDeviceSelectedDetails", "FleetRolloutFailedDetails", "FleetRolloutStartedDetails", "InternalTaskFailedDetails", "InternalTaskPermanentlyFailedDetails", "ReferencedRepositoryUpdatedDetails", "ResourceSyncCompletedDetails", "ResourceUpdatedDetails" } + # data type: ApplicationLifecycleChangedDetails + oneof_schema_18_validator: Optional[ApplicationLifecycleChangedDetails] = None + actual_instance: Optional[Union[ApplicationLifecycleChangedDetails, DependencyChangeDetectedDetails, DependencySyncProbeFailedDetails, DeviceMultipleOwnersDetectedDetails, DeviceMultipleOwnersResolvedDetails, DeviceOwnershipChangedDetails, DeviceVulnerabilityCveDetails, FleetRolloutBatchCompletedDetails, FleetRolloutBatchDispatchedDetails, FleetRolloutCompletedDetails, FleetRolloutDeviceSelectedDetails, FleetRolloutFailedDetails, FleetRolloutStartedDetails, InternalTaskFailedDetails, InternalTaskPermanentlyFailedDetails, ReferencedRepositoryUpdatedDetails, ResourceSyncCompletedDetails, ResourceUpdatedDetails]] = None + one_of_schemas: Set[str] = { "ApplicationLifecycleChangedDetails", "DependencyChangeDetectedDetails", "DependencySyncProbeFailedDetails", "DeviceMultipleOwnersDetectedDetails", "DeviceMultipleOwnersResolvedDetails", "DeviceOwnershipChangedDetails", "DeviceVulnerabilityCveDetails", "FleetRolloutBatchCompletedDetails", "FleetRolloutBatchDispatchedDetails", "FleetRolloutCompletedDetails", "FleetRolloutDeviceSelectedDetails", "FleetRolloutFailedDetails", "FleetRolloutStartedDetails", "InternalTaskFailedDetails", "InternalTaskPermanentlyFailedDetails", "ReferencedRepositoryUpdatedDetails", "ResourceSyncCompletedDetails", "ResourceUpdatedDetails" } model_config = ConfigDict( validate_assignment=True, @@ -189,12 +192,17 @@ def actual_instance_must_validate_oneof(cls, v): error_messages.append(f"Error! Input type `{type(v)}` is not `DependencySyncProbeFailedDetails`") else: match += 1 + # validate data type: ApplicationLifecycleChangedDetails + if not isinstance(v, ApplicationLifecycleChangedDetails): + error_messages.append(f"Error! Input type `{type(v)}` is not `ApplicationLifecycleChangedDetails`") + else: + match += 1 if match > 1: # more than 1 match - raise ValueError("Multiple matches found when setting `actual_instance` in EventDetails with oneOf schemas: DependencyChangeDetectedDetails, DependencySyncProbeFailedDetails, DeviceMultipleOwnersDetectedDetails, DeviceMultipleOwnersResolvedDetails, DeviceOwnershipChangedDetails, DeviceVulnerabilityCveDetails, FleetRolloutBatchCompletedDetails, FleetRolloutBatchDispatchedDetails, FleetRolloutCompletedDetails, FleetRolloutDeviceSelectedDetails, FleetRolloutFailedDetails, FleetRolloutStartedDetails, InternalTaskFailedDetails, InternalTaskPermanentlyFailedDetails, ReferencedRepositoryUpdatedDetails, ResourceSyncCompletedDetails, ResourceUpdatedDetails. Details: " + ", ".join(error_messages)) + raise ValueError("Multiple matches found when setting `actual_instance` in EventDetails with oneOf schemas: ApplicationLifecycleChangedDetails, DependencyChangeDetectedDetails, DependencySyncProbeFailedDetails, DeviceMultipleOwnersDetectedDetails, DeviceMultipleOwnersResolvedDetails, DeviceOwnershipChangedDetails, DeviceVulnerabilityCveDetails, FleetRolloutBatchCompletedDetails, FleetRolloutBatchDispatchedDetails, FleetRolloutCompletedDetails, FleetRolloutDeviceSelectedDetails, FleetRolloutFailedDetails, FleetRolloutStartedDetails, InternalTaskFailedDetails, InternalTaskPermanentlyFailedDetails, ReferencedRepositoryUpdatedDetails, ResourceSyncCompletedDetails, ResourceUpdatedDetails. Details: " + ", ".join(error_messages)) elif match == 0: # no match - raise ValueError("No match found when setting `actual_instance` in EventDetails with oneOf schemas: DependencyChangeDetectedDetails, DependencySyncProbeFailedDetails, DeviceMultipleOwnersDetectedDetails, DeviceMultipleOwnersResolvedDetails, DeviceOwnershipChangedDetails, DeviceVulnerabilityCveDetails, FleetRolloutBatchCompletedDetails, FleetRolloutBatchDispatchedDetails, FleetRolloutCompletedDetails, FleetRolloutDeviceSelectedDetails, FleetRolloutFailedDetails, FleetRolloutStartedDetails, InternalTaskFailedDetails, InternalTaskPermanentlyFailedDetails, ReferencedRepositoryUpdatedDetails, ResourceSyncCompletedDetails, ResourceUpdatedDetails. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when setting `actual_instance` in EventDetails with oneOf schemas: ApplicationLifecycleChangedDetails, DependencyChangeDetectedDetails, DependencySyncProbeFailedDetails, DeviceMultipleOwnersDetectedDetails, DeviceMultipleOwnersResolvedDetails, DeviceOwnershipChangedDetails, DeviceVulnerabilityCveDetails, FleetRolloutBatchCompletedDetails, FleetRolloutBatchDispatchedDetails, FleetRolloutCompletedDetails, FleetRolloutDeviceSelectedDetails, FleetRolloutFailedDetails, FleetRolloutStartedDetails, InternalTaskFailedDetails, InternalTaskPermanentlyFailedDetails, ReferencedRepositoryUpdatedDetails, ResourceSyncCompletedDetails, ResourceUpdatedDetails. Details: " + ", ".join(error_messages)) else: return v @@ -214,6 +222,11 @@ def from_json(cls, json_str: str) -> Self: if not _data_type: raise ValueError("Failed to lookup data type from the field `detailType` in the input.") + # check if data type is `ApplicationLifecycleChangedDetails` + if _data_type == "ApplicationLifecycleChanged": + instance.actual_instance = ApplicationLifecycleChangedDetails.from_json(json_str) + return instance + # check if data type is `DependencyChangeDetectedDetails` if _data_type == "DependencyChangeDetected": instance.actual_instance = DependencyChangeDetectedDetails.from_json(json_str) @@ -401,13 +414,19 @@ def from_json(cls, json_str: str) -> Self: match += 1 except (ValidationError, ValueError) as e: error_messages.append(str(e)) + # deserialize data into ApplicationLifecycleChangedDetails + try: + instance.actual_instance = ApplicationLifecycleChangedDetails.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) if match > 1: # more than 1 match - raise ValueError("Multiple matches found when deserializing the JSON string into EventDetails with oneOf schemas: DependencyChangeDetectedDetails, DependencySyncProbeFailedDetails, DeviceMultipleOwnersDetectedDetails, DeviceMultipleOwnersResolvedDetails, DeviceOwnershipChangedDetails, DeviceVulnerabilityCveDetails, FleetRolloutBatchCompletedDetails, FleetRolloutBatchDispatchedDetails, FleetRolloutCompletedDetails, FleetRolloutDeviceSelectedDetails, FleetRolloutFailedDetails, FleetRolloutStartedDetails, InternalTaskFailedDetails, InternalTaskPermanentlyFailedDetails, ReferencedRepositoryUpdatedDetails, ResourceSyncCompletedDetails, ResourceUpdatedDetails. Details: " + ", ".join(error_messages)) + raise ValueError("Multiple matches found when deserializing the JSON string into EventDetails with oneOf schemas: ApplicationLifecycleChangedDetails, DependencyChangeDetectedDetails, DependencySyncProbeFailedDetails, DeviceMultipleOwnersDetectedDetails, DeviceMultipleOwnersResolvedDetails, DeviceOwnershipChangedDetails, DeviceVulnerabilityCveDetails, FleetRolloutBatchCompletedDetails, FleetRolloutBatchDispatchedDetails, FleetRolloutCompletedDetails, FleetRolloutDeviceSelectedDetails, FleetRolloutFailedDetails, FleetRolloutStartedDetails, InternalTaskFailedDetails, InternalTaskPermanentlyFailedDetails, ReferencedRepositoryUpdatedDetails, ResourceSyncCompletedDetails, ResourceUpdatedDetails. Details: " + ", ".join(error_messages)) elif match == 0: # no match - raise ValueError("No match found when deserializing the JSON string into EventDetails with oneOf schemas: DependencyChangeDetectedDetails, DependencySyncProbeFailedDetails, DeviceMultipleOwnersDetectedDetails, DeviceMultipleOwnersResolvedDetails, DeviceOwnershipChangedDetails, DeviceVulnerabilityCveDetails, FleetRolloutBatchCompletedDetails, FleetRolloutBatchDispatchedDetails, FleetRolloutCompletedDetails, FleetRolloutDeviceSelectedDetails, FleetRolloutFailedDetails, FleetRolloutStartedDetails, InternalTaskFailedDetails, InternalTaskPermanentlyFailedDetails, ReferencedRepositoryUpdatedDetails, ResourceSyncCompletedDetails, ResourceUpdatedDetails. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when deserializing the JSON string into EventDetails with oneOf schemas: ApplicationLifecycleChangedDetails, DependencyChangeDetectedDetails, DependencySyncProbeFailedDetails, DeviceMultipleOwnersDetectedDetails, DeviceMultipleOwnersResolvedDetails, DeviceOwnershipChangedDetails, DeviceVulnerabilityCveDetails, FleetRolloutBatchCompletedDetails, FleetRolloutBatchDispatchedDetails, FleetRolloutCompletedDetails, FleetRolloutDeviceSelectedDetails, FleetRolloutFailedDetails, FleetRolloutStartedDetails, InternalTaskFailedDetails, InternalTaskPermanentlyFailedDetails, ReferencedRepositoryUpdatedDetails, ResourceSyncCompletedDetails, ResourceUpdatedDetails. Details: " + ", ".join(error_messages)) else: return instance @@ -421,7 +440,7 @@ def to_json(self) -> str: else: return json.dumps(self.actual_instance) - def to_dict(self) -> Optional[Union[Dict[str, Any], DependencyChangeDetectedDetails, DependencySyncProbeFailedDetails, DeviceMultipleOwnersDetectedDetails, DeviceMultipleOwnersResolvedDetails, DeviceOwnershipChangedDetails, DeviceVulnerabilityCveDetails, FleetRolloutBatchCompletedDetails, FleetRolloutBatchDispatchedDetails, FleetRolloutCompletedDetails, FleetRolloutDeviceSelectedDetails, FleetRolloutFailedDetails, FleetRolloutStartedDetails, InternalTaskFailedDetails, InternalTaskPermanentlyFailedDetails, ReferencedRepositoryUpdatedDetails, ResourceSyncCompletedDetails, ResourceUpdatedDetails]]: + def to_dict(self) -> Optional[Union[Dict[str, Any], ApplicationLifecycleChangedDetails, DependencyChangeDetectedDetails, DependencySyncProbeFailedDetails, DeviceMultipleOwnersDetectedDetails, DeviceMultipleOwnersResolvedDetails, DeviceOwnershipChangedDetails, DeviceVulnerabilityCveDetails, FleetRolloutBatchCompletedDetails, FleetRolloutBatchDispatchedDetails, FleetRolloutCompletedDetails, FleetRolloutDeviceSelectedDetails, FleetRolloutFailedDetails, FleetRolloutStartedDetails, InternalTaskFailedDetails, InternalTaskPermanentlyFailedDetails, ReferencedRepositoryUpdatedDetails, ResourceSyncCompletedDetails, ResourceUpdatedDetails]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None diff --git a/flightctl/models/helm_application.py b/flightctl/models/helm_application.py index 4f65641..ace5f44 100644 --- a/flightctl/models/helm_application.py +++ b/flightctl/models/helm_application.py @@ -18,9 +18,11 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from flightctl.models.app_type import AppType +from flightctl.models.application_desired_state import ApplicationDesiredState +from flightctl.models.catalog_item_ref_spec import CatalogItemRefSpec from typing import Optional, Set from typing_extensions import Self @@ -30,11 +32,15 @@ class HelmApplication(BaseModel): """ # noqa: E501 name: Optional[StrictStr] = Field(default=None, description="The application name must be 1–253 characters long, start with a letter or number, and contain no whitespace.") app_type: AppType = Field(alias="appType") - image: StrictStr = Field(description="Reference to the chart for this helm application.") + annotations: Optional[Dict[str, StrictStr]] = Field(default=None, description="Arbitrary metadata annotations. Used internally by the control plane (e.g., flightctl.io/workload-type) when transforming application types at render time.") + desired_state: Optional[ApplicationDesiredState] = Field(default=None, description="Desired lifecycle state for this application, as most recently set by the stop/start device APIs. Read-only: cannot be set directly by apply; only present in the rendered application spec delivered to the agent.", alias="desiredState") + restart_generation: Optional[StrictInt] = Field(default=None, description="Counter incremented by the restart device API each time the application is restarted. Read-only: cannot be set directly by apply; only present in the rendered application spec delivered to the agent.", alias="restartGeneration") + image: StrictStr = Field(description="Reference to an OCI image or artifact with tag.") + catalog_item_ref: CatalogItemRefSpec = Field(alias="catalogItemRef") namespace: Optional[StrictStr] = Field(default=None, description="The target namespace for the application deployment.") values: Optional[Dict[str, Any]] = Field(default=None, description="Configuration values for the application. Supports arbitrarily nested structures.") values_files: Optional[List[StrictStr]] = Field(default=None, description="List of values files to apply during deployment. Files are relative paths and applied in array order before user-provided values.", alias="valuesFiles") - __properties: ClassVar[List[str]] = ["name", "appType", "image", "namespace", "values", "valuesFiles"] + __properties: ClassVar[List[str]] = ["name", "appType", "annotations", "desiredState", "restartGeneration", "image", "catalogItemRef", "namespace", "values", "valuesFiles"] model_config = ConfigDict( populate_by_name=True, @@ -66,8 +72,14 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set([ + "annotations", + "desired_state", + "restart_generation", ]) _dict = self.model_dump( @@ -75,6 +87,9 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of catalog_item_ref + if self.catalog_item_ref: + _dict['catalogItemRef'] = self.catalog_item_ref.to_dict() return _dict @classmethod @@ -89,7 +104,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "name": obj.get("name"), "appType": obj.get("appType"), + "annotations": obj.get("annotations"), + "desiredState": obj.get("desiredState"), + "restartGeneration": obj.get("restartGeneration"), "image": obj.get("image"), + "catalogItemRef": CatalogItemRefSpec.from_dict(obj["catalogItemRef"]) if obj.get("catalogItemRef") is not None else None, "namespace": obj.get("namespace"), "values": obj.get("values"), "valuesFiles": obj.get("valuesFiles") diff --git a/flightctl/models/image_or_catalog_item_ref_spec.py b/flightctl/models/image_or_catalog_item_ref_spec.py new file mode 100644 index 0000000..1f96d73 --- /dev/null +++ b/flightctl/models/image_or_catalog_item_ref_spec.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Flight Control API + + [Flight Control](https://flightctl.io) is a service for declarative management of fleets of edge devices and their workloads. + + The version of the OpenAPI document: v1beta1 + Contact: team@flightctl.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from flightctl.models.catalog_item_ref_spec import CatalogItemRefSpec +from typing import Optional, Set +from typing_extensions import Self + +class ImageOrCatalogItemRefSpec(BaseModel): + """ + Either a specific OCI image reference, or a reference to a catalog item version that can be resolved to an OCI image ref. + """ # noqa: E501 + image: Optional[StrictStr] = Field(default=None, description="Reference to an OCI image or artifact with tag.") + catalog_item_ref: Optional[CatalogItemRefSpec] = Field(default=None, alias="catalogItemRef") + __properties: ClassVar[List[str]] = ["image", "catalogItemRef"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ImageOrCatalogItemRefSpec from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of catalog_item_ref + if self.catalog_item_ref: + _dict['catalogItemRef'] = self.catalog_item_ref.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ImageOrCatalogItemRefSpec from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "image": obj.get("image"), + "catalogItemRef": CatalogItemRefSpec.from_dict(obj["catalogItemRef"]) if obj.get("catalogItemRef") is not None else None + }) + return _obj + + diff --git a/flightctl/models/image_spec.py b/flightctl/models/image_spec.py new file mode 100644 index 0000000..13e04d2 --- /dev/null +++ b/flightctl/models/image_spec.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Flight Control API + + [Flight Control](https://flightctl.io) is a service for declarative management of fleets of edge devices and their workloads. + + The version of the OpenAPI document: v1beta1 + Contact: team@flightctl.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class ImageSpec(BaseModel): + """ + Reference to an OCI image or artifact with tag. + """ # noqa: E501 + image: StrictStr = Field(description="Reference to an OCI image or artifact with tag.") + __properties: ClassVar[List[str]] = ["image"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ImageSpec from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ImageSpec from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "image": obj.get("image") + }) + return _obj + + diff --git a/flightctl/models/image_volume_source.py b/flightctl/models/image_volume_source.py index 63590ae..42f1cb4 100644 --- a/flightctl/models/image_volume_source.py +++ b/flightctl/models/image_volume_source.py @@ -20,17 +20,19 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional +from flightctl.models.catalog_item_ref_spec import CatalogItemRefSpec from flightctl.models.image_pull_policy import ImagePullPolicy from typing import Optional, Set from typing_extensions import Self class ImageVolumeSource(BaseModel): """ - Describes the source of an OCI-compliant image or artifact. + Describes the source of an OCI-compliant image or artifact. Exactly one of 'reference' or 'catalogItemRef' must be specified. """ # noqa: E501 - reference: StrictStr = Field(description="Reference to an OCI-compliant image or artifact in a registry. This may be a container image or another type of OCI artifact, as long as it conforms to the OCI image specification.") - pull_policy: Optional[ImagePullPolicy] = Field(default=ImagePullPolicy.PullIfNotPresent, alias="pullPolicy") - __properties: ClassVar[List[str]] = ["reference", "pullPolicy"] + reference: Optional[StrictStr] = Field(default=None, description="Reference to an OCI-compliant image or artifact in a registry. This may be a container image or another type of OCI artifact, as long as it conforms to the OCI image specification.") + catalog_item_ref: Optional[CatalogItemRefSpec] = Field(default=None, alias="catalogItemRef") + pull_policy: Optional[ImagePullPolicy] = Field(default=ImagePullPolicy.NUMBER_PullIfNotPresent, alias="pullPolicy") + __properties: ClassVar[List[str]] = ["reference", "catalogItemRef", "pullPolicy"] model_config = ConfigDict( populate_by_name=True, @@ -71,6 +73,9 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of catalog_item_ref + if self.catalog_item_ref: + _dict['catalogItemRef'] = self.catalog_item_ref.to_dict() return _dict @classmethod @@ -84,7 +89,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "reference": obj.get("reference"), - "pullPolicy": obj.get("pullPolicy") if obj.get("pullPolicy") is not None else ImagePullPolicy.PullIfNotPresent + "catalogItemRef": CatalogItemRefSpec.from_dict(obj["catalogItemRef"]) if obj.get("catalogItemRef") is not None else None, + "pullPolicy": obj.get("pullPolicy") if obj.get("pullPolicy") is not None else ImagePullPolicy.NUMBER_PullIfNotPresent }) return _obj diff --git a/flightctl/models/os_mode_type.py b/flightctl/models/os_mode_type.py new file mode 100644 index 0000000..c968ed3 --- /dev/null +++ b/flightctl/models/os_mode_type.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Flight Control API + + [Flight Control](https://flightctl.io) is a service for declarative management of fleets of edge devices and their workloads. + + The version of the OpenAPI document: v1beta1 + Contact: team@flightctl.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class OsModeType(str, Enum): + """ + OS management mode. \"image\" indicates the OS is managed via bootc or rpm-ostree image updates. \"package\" indicates no image-based OS management is available. + """ + + """ + allowed enum values + """ + OsModeImage = 'image' + OsModePackage = 'package' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of OsModeType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/flightctl/models/quadlet_application.py b/flightctl/models/quadlet_application.py index a97e3c6..0b698f6 100644 --- a/flightctl/models/quadlet_application.py +++ b/flightctl/models/quadlet_application.py @@ -18,11 +18,13 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from flightctl.models.app_type import AppType from flightctl.models.application_content import ApplicationContent +from flightctl.models.application_desired_state import ApplicationDesiredState from flightctl.models.application_volume import ApplicationVolume +from flightctl.models.catalog_item_ref_spec import CatalogItemRefSpec from typing import Optional, Set from typing_extensions import Self @@ -32,12 +34,16 @@ class QuadletApplication(BaseModel): """ # noqa: E501 name: Optional[StrictStr] = Field(default=None, description="The application name must be 1–253 characters long, start with a letter or number, and contain no whitespace.") app_type: AppType = Field(alias="appType") + annotations: Optional[Dict[str, StrictStr]] = Field(default=None, description="Arbitrary metadata annotations. Used internally by the control plane (e.g., flightctl.io/workload-type) when transforming application types at render time.") + desired_state: Optional[ApplicationDesiredState] = Field(default=None, description="Desired lifecycle state for this application, as most recently set by the stop/start device APIs. Read-only: cannot be set directly by apply; only present in the rendered application spec delivered to the agent.", alias="desiredState") + restart_generation: Optional[StrictInt] = Field(default=None, description="Counter incremented by the restart device API each time the application is restarted. Read-only: cannot be set directly by apply; only present in the rendered application spec delivered to the agent.", alias="restartGeneration") env_vars: Optional[Dict[str, StrictStr]] = Field(default=None, description="Environment variable key-value pairs, injected during runtime. The key and value each must be between 1 and 253 characters.", alias="envVars") run_as: Optional[StrictStr] = Field(default=None, description="The username of the system user this application should be run under. This is not the same as the user within any containers of the application (if applicable). Defaults to the user that the agent runs as (generally root) if not specified.", alias="runAs") volumes: Optional[List[ApplicationVolume]] = Field(default=None, description="List of application volumes.") - image: StrictStr = Field(description="Reference to the OCI image or artifact for the application package.") + image: StrictStr = Field(description="Reference to an OCI image or artifact with tag.") + catalog_item_ref: CatalogItemRefSpec = Field(alias="catalogItemRef") inline: List[ApplicationContent] = Field(description="A list of application content.") - __properties: ClassVar[List[str]] = ["name", "appType", "envVars", "runAs", "volumes", "image", "inline"] + __properties: ClassVar[List[str]] = ["name", "appType", "annotations", "desiredState", "restartGeneration", "envVars", "runAs", "volumes", "image", "catalogItemRef", "inline"] model_config = ConfigDict( populate_by_name=True, @@ -69,8 +75,14 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set([ + "annotations", + "desired_state", + "restart_generation", ]) _dict = self.model_dump( @@ -85,6 +97,9 @@ def to_dict(self) -> Dict[str, Any]: if _item_volumes: _items.append(_item_volumes.to_dict()) _dict['volumes'] = _items + # override the default output from pydantic by calling `to_dict()` of catalog_item_ref + if self.catalog_item_ref: + _dict['catalogItemRef'] = self.catalog_item_ref.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in inline (list) _items = [] if self.inline: @@ -106,10 +121,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "name": obj.get("name"), "appType": obj.get("appType"), + "annotations": obj.get("annotations"), + "desiredState": obj.get("desiredState"), + "restartGeneration": obj.get("restartGeneration"), "envVars": obj.get("envVars"), "runAs": obj.get("runAs"), "volumes": [ApplicationVolume.from_dict(_item) for _item in obj["volumes"]] if obj.get("volumes") is not None else None, "image": obj.get("image"), + "catalogItemRef": CatalogItemRefSpec.from_dict(obj["catalogItemRef"]) if obj.get("catalogItemRef") is not None else None, "inline": [ApplicationContent.from_dict(_item) for _item in obj["inline"]] if obj.get("inline") is not None else None }) return _obj diff --git a/flightctl/models/resource_sync_spec.py b/flightctl/models/resource_sync_spec.py index d87933b..859f4db 100644 --- a/flightctl/models/resource_sync_spec.py +++ b/flightctl/models/resource_sync_spec.py @@ -29,7 +29,7 @@ class ResourceSyncSpec(BaseModel): """ ResourceSyncSpec describes the file(s) to sync from a repository. """ # noqa: E501 - type: Optional[ResourceSyncType] = ResourceSyncType.ResourceSyncTypeFleet + type: Optional[ResourceSyncType] = ResourceSyncType.NUMBER_ResourceSyncTypeFleet repository: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of the repository resource to use as the sync source.") target_revision: Annotated[str, Field(min_length=1, strict=True, max_length=244)] = Field(description="The desired revision in the repository.", alias="targetRevision") path: Annotated[str, Field(min_length=0, strict=True, max_length=2048)] = Field(description="The path of a file or directory in the repository. If a directory, the directory should contain only resource definitions with no subdirectories. Each file should contain the definition of one or more resources.") @@ -86,7 +86,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "type": obj.get("type") if obj.get("type") is not None else ResourceSyncType.ResourceSyncTypeFleet, + "type": obj.get("type") if obj.get("type") is not None else ResourceSyncType.NUMBER_ResourceSyncTypeFleet, "repository": obj.get("repository"), "targetRevision": obj.get("targetRevision"), "path": obj.get("path") diff --git a/flightctl/models/template_version_status.py b/flightctl/models/template_version_status.py index a8fb9b2..90c278e 100644 --- a/flightctl/models/template_version_status.py +++ b/flightctl/models/template_version_status.py @@ -26,9 +26,9 @@ from flightctl.models.config_provider_spec import ConfigProviderSpec from flightctl.models.device_console import DeviceConsole from flightctl.models.device_decommission import DeviceDecommission -from flightctl.models.device_os_spec import DeviceOsSpec from flightctl.models.device_spec_systemd import DeviceSpecSystemd from flightctl.models.device_update_policy_spec import DeviceUpdatePolicySpec +from flightctl.models.image_or_catalog_item_ref_spec import ImageOrCatalogItemRefSpec from flightctl.models.resource_monitor import ResourceMonitor from typing import Optional, Set from typing_extensions import Self @@ -38,7 +38,7 @@ class TemplateVersionStatus(BaseModel): TemplateVersionStatus represents information about the status of a template version. """ # noqa: E501 update_policy: Optional[DeviceUpdatePolicySpec] = Field(default=None, alias="updatePolicy") - os: Optional[DeviceOsSpec] = None + os: Optional[ImageOrCatalogItemRefSpec] = None config: Optional[List[ConfigProviderSpec]] = Field(default=None, description="List of config providers.") applications: Optional[List[ApplicationProviderSpec]] = Field(default=None, description="List of application providers.") systemd: Optional[DeviceSpecSystemd] = None @@ -148,7 +148,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "updatePolicy": DeviceUpdatePolicySpec.from_dict(obj["updatePolicy"]) if obj.get("updatePolicy") is not None else None, - "os": DeviceOsSpec.from_dict(obj["os"]) if obj.get("os") is not None else None, + "os": ImageOrCatalogItemRefSpec.from_dict(obj["os"]) if obj.get("os") is not None else None, "config": [ConfigProviderSpec.from_dict(_item) for _item in obj["config"]] if obj.get("config") is not None else None, "applications": [ApplicationProviderSpec.from_dict(_item) for _item in obj["applications"]] if obj.get("applications") is not None else None, "systemd": DeviceSpecSystemd.from_dict(obj["systemd"]) if obj.get("systemd") is not None else None, diff --git a/flightctl/models/vm_application.py b/flightctl/models/vm_application.py new file mode 100644 index 0000000..7e7380f --- /dev/null +++ b/flightctl/models/vm_application.py @@ -0,0 +1,119 @@ +# coding: utf-8 + +""" + Flight Control API + + [Flight Control](https://flightctl.io) is a service for declarative management of fleets of edge devices and their workloads. + + The version of the OpenAPI document: v1beta1 + Contact: team@flightctl.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from flightctl.models.app_type import AppType +from flightctl.models.application_content import ApplicationContent +from flightctl.models.application_desired_state import ApplicationDesiredState +from typing import Optional, Set +from typing_extensions import Self + +class VmApplication(BaseModel): + """ + A VM workload managed by the FlightCtl agent. The VM definition may be delivered either as an OCI image/artifact or as inline application content. For inline providers, the package must contain a KubeVirt VirtualMachine YAML file named vm.yaml. + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="The application name must be 1–253 characters long, start with a letter or number, and contain no whitespace.") + app_type: AppType = Field(alias="appType") + annotations: Optional[Dict[str, StrictStr]] = Field(default=None, description="Arbitrary metadata annotations. Used internally by the control plane (e.g., flightctl.io/workload-type) when transforming application types at render time.") + desired_state: Optional[ApplicationDesiredState] = Field(default=None, description="Desired lifecycle state for this application, as most recently set by the stop/start device APIs. Read-only: cannot be set directly by apply; only present in the rendered application spec delivered to the agent.", alias="desiredState") + restart_generation: Optional[StrictInt] = Field(default=None, description="Counter incremented by the restart device API each time the application is restarted. Read-only: cannot be set directly by apply; only present in the rendered application spec delivered to the agent.", alias="restartGeneration") + publish_ports: Optional[List[Annotated[str, Field(strict=True)]]] = Field(default=None, description="List of host-to-guest port mappings for the VM. Each entry must follow the format \"hostPort:guestPort\" or \"hostPort:guestPort/protocol\" (e.g. \"8080:80\" or \"8080:80/tcp\").", alias="publishPorts") + image: StrictStr = Field(description="Reference to an OCI image or artifact with tag.") + inline: List[ApplicationContent] = Field(description="A list of application content.") + __properties: ClassVar[List[str]] = ["name", "appType", "annotations", "desiredState", "restartGeneration", "publishPorts", "image", "inline"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of VmApplication from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "annotations", + "desired_state", + "restart_generation", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in inline (list) + _items = [] + if self.inline: + for _item_inline in self.inline: + if _item_inline: + _items.append(_item_inline.to_dict()) + _dict['inline'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of VmApplication from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "appType": obj.get("appType"), + "annotations": obj.get("annotations"), + "desiredState": obj.get("desiredState"), + "restartGeneration": obj.get("restartGeneration"), + "publishPorts": obj.get("publishPorts"), + "image": obj.get("image"), + "inline": [ApplicationContent.from_dict(_item) for _item in obj["inline"]] if obj.get("inline") is not None else None + }) + return _obj + + diff --git a/flightctl/v1alpha1/__init__.py b/flightctl/v1alpha1/__init__.py index 5a8bae4..feb57f5 100644 --- a/flightctl/v1alpha1/__init__.py +++ b/flightctl/v1alpha1/__init__.py @@ -15,7 +15,7 @@ """ # noqa: E501 -__version__ = "1.2.1" +__version__ = "1.3.0" # Define package exports __all__ = [ @@ -38,6 +38,9 @@ "CatalogItemArtifactType", "CatalogItemCategory", "CatalogItemConfigurable", + "CatalogItemDeployment", + "CatalogItemDeploymentDeployedTo", + "CatalogItemDeploymentList", "CatalogItemDeprecation", "CatalogItemList", "CatalogItemMeta", @@ -95,6 +98,9 @@ from flightctl.v1alpha1.models.catalog_item_artifact_type import CatalogItemArtifactType as CatalogItemArtifactType from flightctl.v1alpha1.models.catalog_item_category import CatalogItemCategory as CatalogItemCategory from flightctl.v1alpha1.models.catalog_item_configurable import CatalogItemConfigurable as CatalogItemConfigurable +from flightctl.v1alpha1.models.catalog_item_deployment import CatalogItemDeployment as CatalogItemDeployment +from flightctl.v1alpha1.models.catalog_item_deployment_deployed_to import CatalogItemDeploymentDeployedTo as CatalogItemDeploymentDeployedTo +from flightctl.v1alpha1.models.catalog_item_deployment_list import CatalogItemDeploymentList as CatalogItemDeploymentList from flightctl.v1alpha1.models.catalog_item_deprecation import CatalogItemDeprecation as CatalogItemDeprecation from flightctl.v1alpha1.models.catalog_item_list import CatalogItemList as CatalogItemList from flightctl.v1alpha1.models.catalog_item_meta import CatalogItemMeta as CatalogItemMeta diff --git a/flightctl/v1alpha1/api/catalog_api.py b/flightctl/v1alpha1/api/catalog_api.py index 7ba81ad..4be9b89 100644 --- a/flightctl/v1alpha1/api/catalog_api.py +++ b/flightctl/v1alpha1/api/catalog_api.py @@ -22,6 +22,7 @@ from typing_extensions import Annotated from flightctl.v1alpha1.models.catalog import Catalog from flightctl.v1alpha1.models.catalog_item import CatalogItem +from flightctl.v1alpha1.models.catalog_item_deployment_list import CatalogItemDeploymentList from flightctl.v1alpha1.models.catalog_item_list import CatalogItemList from flightctl.v1alpha1.models.catalog_list import CatalogList from flightctl.v1alpha1.models.patch_request_inner import PatchRequestInner @@ -1781,6 +1782,330 @@ def _get_catalog_item_serialize( + @validate_call + def get_catalog_item_deployments( + self, + catalog: Annotated[StrictStr, Field(description="The name of the Catalog resource.")], + name: Annotated[StrictStr, Field(description="The name of the CatalogItem resource.")], + var_continue: Annotated[Optional[StrictStr], Field(description="An optional parameter to query more results from the server. The value of the parameter must match the value of the 'continue' field in the previous list response.")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=0)]], Field(description="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.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CatalogItemDeploymentList: + """get_catalog_item_deployments + + Get the CatalogItemDeployments for a particular Catalog Item + + :param catalog: The name of the Catalog resource. (required) + :type catalog: str + :param name: The name of the CatalogItem resource. (required) + :type name: str + :param var_continue: An optional parameter to query more results from the server. The value of the parameter must match the value of the 'continue' field in the previous list response. + :type var_continue: str + :param limit: 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. + :type limit: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_catalog_item_deployments_serialize( + catalog=catalog, + name=name, + var_continue=var_continue, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CatalogItemDeploymentList", + '400': "Status", + '401': "Status", + '403': "Status", + '404': "Status", + '503': "Status", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_catalog_item_deployments_with_http_info( + self, + catalog: Annotated[StrictStr, Field(description="The name of the Catalog resource.")], + name: Annotated[StrictStr, Field(description="The name of the CatalogItem resource.")], + var_continue: Annotated[Optional[StrictStr], Field(description="An optional parameter to query more results from the server. The value of the parameter must match the value of the 'continue' field in the previous list response.")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=0)]], Field(description="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.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CatalogItemDeploymentList]: + """get_catalog_item_deployments + + Get the CatalogItemDeployments for a particular Catalog Item + + :param catalog: The name of the Catalog resource. (required) + :type catalog: str + :param name: The name of the CatalogItem resource. (required) + :type name: str + :param var_continue: An optional parameter to query more results from the server. The value of the parameter must match the value of the 'continue' field in the previous list response. + :type var_continue: str + :param limit: 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. + :type limit: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_catalog_item_deployments_serialize( + catalog=catalog, + name=name, + var_continue=var_continue, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CatalogItemDeploymentList", + '400': "Status", + '401': "Status", + '403': "Status", + '404': "Status", + '503': "Status", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_catalog_item_deployments_without_preload_content( + self, + catalog: Annotated[StrictStr, Field(description="The name of the Catalog resource.")], + name: Annotated[StrictStr, Field(description="The name of the CatalogItem resource.")], + var_continue: Annotated[Optional[StrictStr], Field(description="An optional parameter to query more results from the server. The value of the parameter must match the value of the 'continue' field in the previous list response.")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=0)]], Field(description="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.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """get_catalog_item_deployments + + Get the CatalogItemDeployments for a particular Catalog Item + + :param catalog: The name of the Catalog resource. (required) + :type catalog: str + :param name: The name of the CatalogItem resource. (required) + :type name: str + :param var_continue: An optional parameter to query more results from the server. The value of the parameter must match the value of the 'continue' field in the previous list response. + :type var_continue: str + :param limit: 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. + :type limit: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_catalog_item_deployments_serialize( + catalog=catalog, + name=name, + var_continue=var_continue, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CatalogItemDeploymentList", + '400': "Status", + '401': "Status", + '403': "Status", + '404': "Status", + '503': "Status", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_catalog_item_deployments_serialize( + self, + catalog, + name, + var_continue, + limit, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if catalog is not None: + _path_params['catalog'] = catalog + if name is not None: + _path_params['name'] = name + # process the query parameters + if var_continue is not None: + + _query_params.append(('continue', var_continue)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/catalogs/{catalog}/items/{name}/deployments', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def get_catalog_status( self, diff --git a/flightctl/v1alpha1/api_client.py b/flightctl/v1alpha1/api_client.py index cca6872..796808d 100644 --- a/flightctl/v1alpha1/api_client.py +++ b/flightctl/v1alpha1/api_client.py @@ -92,7 +92,7 @@ def __init__( self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/1.2.1/python' + self.user_agent = 'OpenAPI-Generator/1.3.0/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/flightctl/v1alpha1/configuration.py b/flightctl/v1alpha1/configuration.py index 2c7047f..558bca9 100644 --- a/flightctl/v1alpha1/configuration.py +++ b/flightctl/v1alpha1/configuration.py @@ -545,7 +545,7 @@ def to_debug_report(self) -> str: "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: v1alpha1\n"\ - "SDK Package Version: 1.2.1".\ + "SDK Package Version: 1.3.0".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self) -> List[HostSetting]: diff --git a/flightctl/v1alpha1/docs/CatalogApi.md b/flightctl/v1alpha1/docs/CatalogApi.md index 300b427..4154775 100644 --- a/flightctl/v1alpha1/docs/CatalogApi.md +++ b/flightctl/v1alpha1/docs/CatalogApi.md @@ -10,6 +10,7 @@ Method | HTTP request | Description [**delete_catalog_item**](CatalogApi.md#delete_catalog_item) | **DELETE** /catalogs/{catalog}/items/{name} | [**get_catalog**](CatalogApi.md#get_catalog) | **GET** /catalogs/{name} | [**get_catalog_item**](CatalogApi.md#get_catalog_item) | **GET** /catalogs/{catalog}/items/{name} | +[**get_catalog_item_deployments**](CatalogApi.md#get_catalog_item_deployments) | **GET** /catalogs/{catalog}/items/{name}/deployments | [**get_catalog_status**](CatalogApi.md#get_catalog_status) | **GET** /catalogs/{name}/status | [**list_all_catalog_items**](CatalogApi.md#list_all_catalog_items) | **GET** /catalogitems | [**list_catalog_items**](CatalogApi.md#list_catalog_items) | **GET** /catalogs/{catalog}/items | @@ -453,6 +454,82 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **get_catalog_item_deployments** +> CatalogItemDeploymentList get_catalog_item_deployments(catalog, name, var_continue=var_continue, limit=limit) + +Get the CatalogItemDeployments for a particular Catalog Item + +### Example + + +```python +import flightctl.v1alpha1 +from flightctl.v1alpha1.models.catalog_item_deployment_list import CatalogItemDeploymentList +from flightctl.v1alpha1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to /api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = flightctl.v1alpha1.Configuration( + host = "/api/v1" +) + + +# Enter a context with an instance of the API client +with flightctl.v1alpha1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = flightctl.v1alpha1.CatalogApi(api_client) + catalog = 'edge-apps' # str | The name of the Catalog resource. + name = 'name_example' # str | The name of the CatalogItem resource. + var_continue = 'var_continue_example' # str | An optional parameter to query more results from the server. The value of the parameter must match the value of the 'continue' field in the previous list response. (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) + + try: + api_response = api_instance.get_catalog_item_deployments(catalog, name, var_continue=var_continue, limit=limit) + print("The response of CatalogApi->get_catalog_item_deployments:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CatalogApi->get_catalog_item_deployments: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **catalog** | **str**| The name of the Catalog resource. | + **name** | **str**| The name of the CatalogItem resource. | + **var_continue** | **str**| An optional parameter to query more results from the server. The value of the parameter must match the value of the 'continue' field in the previous list response. | [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] + +### Return type + +[**CatalogItemDeploymentList**](CatalogItemDeploymentList.md) + +### 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 | - | +**404** | Not Found | - | +**503** | Service Unavailable | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **get_catalog_status** > Catalog get_catalog_status(name) diff --git a/flightctl/v1alpha1/docs/CatalogItemDeployment.md b/flightctl/v1alpha1/docs/CatalogItemDeployment.md new file mode 100644 index 0000000..883ee4d --- /dev/null +++ b/flightctl/v1alpha1/docs/CatalogItemDeployment.md @@ -0,0 +1,37 @@ +# CatalogItemDeployment + +CatalogItemDeployment represents a specific deployment of a catalog item to a fleet or device. A catalog item associated to a fleet that has no devices is still considered a deployment. A deployment is only associated with the fleet and not the individual devices in cases where a device is using a catalog item deployment that came from a device spec template on a fleet. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | [**ApiVersion**](ApiVersion.md) | | +**kind** | **str** | Kind is a string value representing the REST resource this object represents. | +**deployed_to** | [**CatalogItemDeploymentDeployedTo**](CatalogItemDeploymentDeployedTo.md) | | [optional] +**catalog** | **str** | The catalog of the catalogItem. | +**catalog_item** | **str** | The catalogItem that this deployment corresponds to. | +**version** | **str** | The version of the catalog item that is deployed. | +**channel** | **str** | The channel, if any, that is intended to be tracked for the catalog item. | [optional] +**application_name** | **str** | For catalog items in the 'application' category, the name of the application on the device that the deployment is associated with. Required for application catalog items. | [optional] + +## Example + +```python +from flightctl.v1alpha1.models.catalog_item_deployment import CatalogItemDeployment + +# TODO update the JSON string below +json = "{}" +# create an instance of CatalogItemDeployment from a JSON string +catalog_item_deployment_instance = CatalogItemDeployment.from_json(json) +# print the JSON string representation of the object +print(CatalogItemDeployment.to_json()) + +# convert the object into a dict +catalog_item_deployment_dict = catalog_item_deployment_instance.to_dict() +# create an instance of CatalogItemDeployment from a dict +catalog_item_deployment_from_dict = CatalogItemDeployment.from_dict(catalog_item_deployment_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/flightctl/v1alpha1/docs/CatalogItemDeploymentDeployedTo.md b/flightctl/v1alpha1/docs/CatalogItemDeploymentDeployedTo.md new file mode 100644 index 0000000..151e423 --- /dev/null +++ b/flightctl/v1alpha1/docs/CatalogItemDeploymentDeployedTo.md @@ -0,0 +1,31 @@ +# CatalogItemDeploymentDeployedTo + +The device or fleet that this deployment pertains to. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**resource_kind** | **str** | Either a Device or Fleet. | [optional] +**resource_name** | **str** | The name of the device or fleet. | [optional] + +## Example + +```python +from flightctl.v1alpha1.models.catalog_item_deployment_deployed_to import CatalogItemDeploymentDeployedTo + +# TODO update the JSON string below +json = "{}" +# create an instance of CatalogItemDeploymentDeployedTo from a JSON string +catalog_item_deployment_deployed_to_instance = CatalogItemDeploymentDeployedTo.from_json(json) +# print the JSON string representation of the object +print(CatalogItemDeploymentDeployedTo.to_json()) + +# convert the object into a dict +catalog_item_deployment_deployed_to_dict = catalog_item_deployment_deployed_to_instance.to_dict() +# create an instance of CatalogItemDeploymentDeployedTo from a dict +catalog_item_deployment_deployed_to_from_dict = CatalogItemDeploymentDeployedTo.from_dict(catalog_item_deployment_deployed_to_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/flightctl/v1alpha1/docs/CatalogItemDeploymentList.md b/flightctl/v1alpha1/docs/CatalogItemDeploymentList.md new file mode 100644 index 0000000..e5277b6 --- /dev/null +++ b/flightctl/v1alpha1/docs/CatalogItemDeploymentList.md @@ -0,0 +1,33 @@ +# CatalogItemDeploymentList + +CatalogItemDeploymentList is a list of CatalogItemDeployments. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | [**ApiVersion**](ApiVersion.md) | | +**kind** | **str** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds. | +**metadata** | [**ListMeta**](ListMeta.md) | | +**items** | [**List[CatalogItemDeployment]**](CatalogItemDeployment.md) | List of CatalogItemDeployments. | + +## Example + +```python +from flightctl.v1alpha1.models.catalog_item_deployment_list import CatalogItemDeploymentList + +# TODO update the JSON string below +json = "{}" +# create an instance of CatalogItemDeploymentList from a JSON string +catalog_item_deployment_list_instance = CatalogItemDeploymentList.from_json(json) +# print the JSON string representation of the object +print(CatalogItemDeploymentList.to_json()) + +# convert the object into a dict +catalog_item_deployment_list_dict = catalog_item_deployment_list_instance.to_dict() +# create an instance of CatalogItemDeploymentList from a dict +catalog_item_deployment_list_from_dict = CatalogItemDeploymentList.from_dict(catalog_item_deployment_list_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/flightctl/v1alpha1/models/__init__.py b/flightctl/v1alpha1/models/__init__.py index 893bf8b..8ceffcd 100644 --- a/flightctl/v1alpha1/models/__init__.py +++ b/flightctl/v1alpha1/models/__init__.py @@ -22,6 +22,9 @@ from flightctl.v1alpha1.models.catalog_item_artifact_type import CatalogItemArtifactType from flightctl.v1alpha1.models.catalog_item_category import CatalogItemCategory from flightctl.v1alpha1.models.catalog_item_configurable import CatalogItemConfigurable +from flightctl.v1alpha1.models.catalog_item_deployment import CatalogItemDeployment +from flightctl.v1alpha1.models.catalog_item_deployment_deployed_to import CatalogItemDeploymentDeployedTo +from flightctl.v1alpha1.models.catalog_item_deployment_list import CatalogItemDeploymentList from flightctl.v1alpha1.models.catalog_item_deprecation import CatalogItemDeprecation from flightctl.v1alpha1.models.catalog_item_list import CatalogItemList from flightctl.v1alpha1.models.catalog_item_meta import CatalogItemMeta diff --git a/flightctl/v1alpha1/models/catalog_item_deployment.py b/flightctl/v1alpha1/models/catalog_item_deployment.py new file mode 100644 index 0000000..f51e321 --- /dev/null +++ b/flightctl/v1alpha1/models/catalog_item_deployment.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Flight Control API + + [Flight Control](https://flightctl.io) is a service for declarative management of fleets of edge devices and their workloads. This API version (v1alpha1) contains alpha-stage resources that are subject to change. + + The version of the OpenAPI document: v1alpha1 + Contact: team@flightctl.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from flightctl.v1alpha1.models.api_version import ApiVersion +from flightctl.v1alpha1.models.catalog_item_deployment_deployed_to import CatalogItemDeploymentDeployedTo +from typing import Optional, Set +from typing_extensions import Self + +class CatalogItemDeployment(BaseModel): + """ + CatalogItemDeployment represents a specific deployment of a catalog item to a fleet or device. A catalog item associated to a fleet that has no devices is still considered a deployment. A deployment is only associated with the fleet and not the individual devices in cases where a device is using a catalog item deployment that came from a device spec template on a fleet. + """ # noqa: E501 + api_version: ApiVersion = Field(alias="apiVersion") + kind: StrictStr = Field(description="Kind is a string value representing the REST resource this object represents.") + deployed_to: Optional[CatalogItemDeploymentDeployedTo] = Field(default=None, alias="deployedTo") + catalog: StrictStr = Field(description="The catalog of the catalogItem.") + catalog_item: StrictStr = Field(description="The catalogItem that this deployment corresponds to.", alias="catalogItem") + version: StrictStr = Field(description="The version of the catalog item that is deployed.") + channel: Optional[StrictStr] = Field(default=None, description="The channel, if any, that is intended to be tracked for the catalog item.") + application_name: Optional[StrictStr] = Field(default=None, description="For catalog items in the 'application' category, the name of the application on the device that the deployment is associated with. Required for application catalog items.", alias="applicationName") + __properties: ClassVar[List[str]] = ["apiVersion", "kind", "deployedTo", "catalog", "catalogItem", "version", "channel", "applicationName"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CatalogItemDeployment from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of deployed_to + if self.deployed_to: + _dict['deployedTo'] = self.deployed_to.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CatalogItemDeployment from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "apiVersion": obj.get("apiVersion"), + "kind": obj.get("kind"), + "deployedTo": CatalogItemDeploymentDeployedTo.from_dict(obj["deployedTo"]) if obj.get("deployedTo") is not None else None, + "catalog": obj.get("catalog"), + "catalogItem": obj.get("catalogItem"), + "version": obj.get("version"), + "channel": obj.get("channel"), + "applicationName": obj.get("applicationName") + }) + return _obj + + diff --git a/flightctl/v1alpha1/models/catalog_item_deployment_deployed_to.py b/flightctl/v1alpha1/models/catalog_item_deployment_deployed_to.py new file mode 100644 index 0000000..29d42b6 --- /dev/null +++ b/flightctl/v1alpha1/models/catalog_item_deployment_deployed_to.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Flight Control API + + [Flight Control](https://flightctl.io) is a service for declarative management of fleets of edge devices and their workloads. This API version (v1alpha1) contains alpha-stage resources that are subject to change. + + The version of the OpenAPI document: v1alpha1 + Contact: team@flightctl.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class CatalogItemDeploymentDeployedTo(BaseModel): + """ + The device or fleet that this deployment pertains to. + """ # noqa: E501 + resource_kind: Optional[StrictStr] = Field(default=None, description="Either a Device or Fleet.", alias="resourceKind") + resource_name: Optional[StrictStr] = Field(default=None, description="The name of the device or fleet.", alias="resourceName") + __properties: ClassVar[List[str]] = ["resourceKind", "resourceName"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CatalogItemDeploymentDeployedTo from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CatalogItemDeploymentDeployedTo from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "resourceKind": obj.get("resourceKind"), + "resourceName": obj.get("resourceName") + }) + return _obj + + diff --git a/flightctl/v1alpha1/models/catalog_item_deployment_list.py b/flightctl/v1alpha1/models/catalog_item_deployment_list.py new file mode 100644 index 0000000..5dd38a9 --- /dev/null +++ b/flightctl/v1alpha1/models/catalog_item_deployment_list.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Flight Control API + + [Flight Control](https://flightctl.io) is a service for declarative management of fleets of edge devices and their workloads. This API version (v1alpha1) contains alpha-stage resources that are subject to change. + + The version of the OpenAPI document: v1alpha1 + Contact: team@flightctl.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from flightctl.v1alpha1.models.api_version import ApiVersion +from flightctl.v1alpha1.models.catalog_item_deployment import CatalogItemDeployment +from flightctl.v1alpha1.models.list_meta import ListMeta +from typing import Optional, Set +from typing_extensions import Self + +class CatalogItemDeploymentList(BaseModel): + """ + CatalogItemDeploymentList is a list of CatalogItemDeployments. + """ # noqa: E501 + api_version: ApiVersion = Field(alias="apiVersion") + kind: StrictStr = Field(description="Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds.") + metadata: ListMeta + items: List[CatalogItemDeployment] = Field(description="List of CatalogItemDeployments.") + __properties: ClassVar[List[str]] = ["apiVersion", "kind", "metadata", "items"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CatalogItemDeploymentList from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of metadata + if self.metadata: + _dict['metadata'] = self.metadata.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CatalogItemDeploymentList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "apiVersion": obj.get("apiVersion"), + "kind": obj.get("kind"), + "metadata": ListMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "items": [CatalogItemDeployment.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + }) + return _obj + + diff --git a/flightctl/v1alpha1/models/catalog_item_spec.py b/flightctl/v1alpha1/models/catalog_item_spec.py index 447d198..4df1ce2 100644 --- a/flightctl/v1alpha1/models/catalog_item_spec.py +++ b/flightctl/v1alpha1/models/catalog_item_spec.py @@ -34,7 +34,7 @@ class CatalogItemSpec(BaseModel): """ CatalogItemSpec defines the configuration for a catalog item. """ # noqa: E501 - category: Optional[CatalogItemCategory] = CatalogItemCategory.CatalogItemCategoryApplication + category: Optional[CatalogItemCategory] = CatalogItemCategory.NUMBER_CatalogItemCategoryApplication type: CatalogItemType artifacts: Annotated[List[CatalogItemArtifact], Field(min_length=1)] = Field(description="Artifact definitions for this catalog item. Defined once; version references resolve each artifact independently. Type must be unique within the list.") versions: List[CatalogItemVersion] = Field(description="Available versions using Cincinnati model. Use replaces for primary edge, skips when stable channel skips intermediate versions.") @@ -120,7 +120,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "category": obj.get("category") if obj.get("category") is not None else CatalogItemCategory.CatalogItemCategoryApplication, + "category": obj.get("category") if obj.get("category") is not None else CatalogItemCategory.NUMBER_CatalogItemCategoryApplication, "type": obj.get("type"), "artifacts": [CatalogItemArtifact.from_dict(_item) for _item in obj["artifacts"]] if obj.get("artifacts") is not None else None, "versions": [CatalogItemVersion.from_dict(_item) for _item in obj["versions"]] if obj.get("versions") is not None else None, diff --git a/flightctl/v1alpha1/test/test_catalog_item_deployment.py b/flightctl/v1alpha1/test/test_catalog_item_deployment.py new file mode 100644 index 0000000..1244e91 --- /dev/null +++ b/flightctl/v1alpha1/test/test_catalog_item_deployment.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + Flight Control API + + [Flight Control](https://flightctl.io) is a service for declarative management of fleets of edge devices and their workloads. This API version (v1alpha1) contains alpha-stage resources that are subject to change. + + The version of the OpenAPI document: v1alpha1 + Contact: team@flightctl.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from flightctl.v1alpha1.models.catalog_item_deployment import CatalogItemDeployment + +class TestCatalogItemDeployment(unittest.TestCase): + """CatalogItemDeployment unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CatalogItemDeployment: + """Test CatalogItemDeployment + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CatalogItemDeployment` + """ + model = CatalogItemDeployment() + if include_optional: + return CatalogItemDeployment( + api_version = 'v1alpha1', + kind = '', + deployed_to = flightctl.v1alpha1.models.catalog_item_deployment_deployed_to.CatalogItemDeployment_deployedTo( + resource_kind = '', + resource_name = '', ), + catalog = 'edge-apps', + catalog_item = 'nginx', + version = '', + channel = '', + application_name = '' + ) + else: + return CatalogItemDeployment( + api_version = 'v1alpha1', + kind = '', + catalog = 'edge-apps', + catalog_item = 'nginx', + version = '', + ) + """ + + def testCatalogItemDeployment(self): + """Test CatalogItemDeployment""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/flightctl/v1alpha1/test/test_catalog_item_deployment_deployed_to.py b/flightctl/v1alpha1/test/test_catalog_item_deployment_deployed_to.py new file mode 100644 index 0000000..759174b --- /dev/null +++ b/flightctl/v1alpha1/test/test_catalog_item_deployment_deployed_to.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Flight Control API + + [Flight Control](https://flightctl.io) is a service for declarative management of fleets of edge devices and their workloads. This API version (v1alpha1) contains alpha-stage resources that are subject to change. + + The version of the OpenAPI document: v1alpha1 + Contact: team@flightctl.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from flightctl.v1alpha1.models.catalog_item_deployment_deployed_to import CatalogItemDeploymentDeployedTo + +class TestCatalogItemDeploymentDeployedTo(unittest.TestCase): + """CatalogItemDeploymentDeployedTo unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CatalogItemDeploymentDeployedTo: + """Test CatalogItemDeploymentDeployedTo + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CatalogItemDeploymentDeployedTo` + """ + model = CatalogItemDeploymentDeployedTo() + if include_optional: + return CatalogItemDeploymentDeployedTo( + resource_kind = '', + resource_name = '' + ) + else: + return CatalogItemDeploymentDeployedTo( + ) + """ + + def testCatalogItemDeploymentDeployedTo(self): + """Test CatalogItemDeploymentDeployedTo""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/flightctl/v1alpha1/test/test_catalog_item_deployment_list.py b/flightctl/v1alpha1/test/test_catalog_item_deployment_list.py new file mode 100644 index 0000000..26434ce --- /dev/null +++ b/flightctl/v1alpha1/test/test_catalog_item_deployment_list.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Flight Control API + + [Flight Control](https://flightctl.io) is a service for declarative management of fleets of edge devices and their workloads. This API version (v1alpha1) contains alpha-stage resources that are subject to change. + + The version of the OpenAPI document: v1alpha1 + Contact: team@flightctl.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from flightctl.v1alpha1.models.catalog_item_deployment_list import CatalogItemDeploymentList + +class TestCatalogItemDeploymentList(unittest.TestCase): + """CatalogItemDeploymentList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CatalogItemDeploymentList: + """Test CatalogItemDeploymentList + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CatalogItemDeploymentList` + """ + model = CatalogItemDeploymentList() + if include_optional: + return CatalogItemDeploymentList( + api_version = 'v1alpha1', + kind = '', + metadata = flightctl.v1alpha1.models.list_meta.ListMeta( + continue = '', + remaining_item_count = 56, ), + items = [ + flightctl.v1alpha1.models.catalog_item_deployment.CatalogItemDeployment( + api_version = 'v1alpha1', + kind = '', + deployed_to = flightctl.v1alpha1.models.catalog_item_deployment_deployed_to.CatalogItemDeployment_deployedTo( + resource_kind = '', + resource_name = '', ), + catalog = 'edge-apps', + catalog_item = 'nginx', + version = '', + channel = '', + application_name = '', ) + ] + ) + else: + return CatalogItemDeploymentList( + api_version = 'v1alpha1', + kind = '', + metadata = flightctl.v1alpha1.models.list_meta.ListMeta( + continue = '', + remaining_item_count = 56, ), + items = [ + flightctl.v1alpha1.models.catalog_item_deployment.CatalogItemDeployment( + api_version = 'v1alpha1', + kind = '', + deployed_to = flightctl.v1alpha1.models.catalog_item_deployment_deployed_to.CatalogItemDeployment_deployedTo( + resource_kind = '', + resource_name = '', ), + catalog = 'edge-apps', + catalog_item = 'nginx', + version = '', + channel = '', + application_name = '', ) + ], + ) + """ + + def testCatalogItemDeploymentList(self): + """Test CatalogItemDeploymentList""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/flightctl/v1alpha1_README.md b/flightctl/v1alpha1_README.md index df491f4..5632bfc 100644 --- a/flightctl/v1alpha1_README.md +++ b/flightctl/v1alpha1_README.md @@ -4,7 +4,7 @@ The `flightctl.v1alpha1` package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: v1alpha1 -- Package version: 1.2.1 +- Package version: 1.3.0 - Generator version: 7.17.0 - Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit [https://flightctl.io](https://flightctl.io) @@ -70,6 +70,7 @@ Class | Method | HTTP request | Description *CatalogApi* | [**delete_catalog_item**](flightctl/v1alpha1/docs/CatalogApi.md#delete_catalog_item) | **DELETE** /catalogs/{catalog}/items/{name} | *CatalogApi* | [**get_catalog**](flightctl/v1alpha1/docs/CatalogApi.md#get_catalog) | **GET** /catalogs/{name} | *CatalogApi* | [**get_catalog_item**](flightctl/v1alpha1/docs/CatalogApi.md#get_catalog_item) | **GET** /catalogs/{catalog}/items/{name} | +*CatalogApi* | [**get_catalog_item_deployments**](flightctl/v1alpha1/docs/CatalogApi.md#get_catalog_item_deployments) | **GET** /catalogs/{catalog}/items/{name}/deployments | *CatalogApi* | [**get_catalog_status**](flightctl/v1alpha1/docs/CatalogApi.md#get_catalog_status) | **GET** /catalogs/{name}/status | *CatalogApi* | [**list_all_catalog_items**](flightctl/v1alpha1/docs/CatalogApi.md#list_all_catalog_items) | **GET** /catalogitems | *CatalogApi* | [**list_catalog_items**](flightctl/v1alpha1/docs/CatalogApi.md#list_catalog_items) | **GET** /catalogs/{catalog}/items | @@ -99,6 +100,9 @@ Class | Method | HTTP request | Description - [CatalogItemArtifactType](flightctl/v1alpha1/docs/CatalogItemArtifactType.md) - [CatalogItemCategory](flightctl/v1alpha1/docs/CatalogItemCategory.md) - [CatalogItemConfigurable](flightctl/v1alpha1/docs/CatalogItemConfigurable.md) + - [CatalogItemDeployment](flightctl/v1alpha1/docs/CatalogItemDeployment.md) + - [CatalogItemDeploymentDeployedTo](flightctl/v1alpha1/docs/CatalogItemDeploymentDeployedTo.md) + - [CatalogItemDeploymentList](flightctl/v1alpha1/docs/CatalogItemDeploymentList.md) - [CatalogItemDeprecation](flightctl/v1alpha1/docs/CatalogItemDeprecation.md) - [CatalogItemList](flightctl/v1alpha1/docs/CatalogItemList.md) - [CatalogItemMeta](flightctl/v1alpha1/docs/CatalogItemMeta.md) diff --git a/pyproject.toml b/pyproject.toml index da10c69..aa52255 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] -name = "flightctl-client" -version = "1.2.1" +name = "flightctl" +version = "1.3.0" description = "Flight Control API" authors = [ {name = "The Flight Control Team",email = "team@flightctl.io"}, @@ -77,13 +77,6 @@ disallow_any_generics = true ### This one can be tricky to get passing if you use a lot of untyped libraries #warn_return_any = true -[[tool.mypy.overrides]] -module = [ - "flightctl.v1alpha1.test.*", - "flightctl.imagebuilder.test.*", -] -ignore_errors = true - [[tool.mypy.overrides]] module = [ "flightctl.configuration", diff --git a/setup.py b/setup.py index 1134969..bba8b3e 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools NAME = "flightctl" -VERSION = "1.2.1" +VERSION = "1.3.0" PYTHON_REQUIRES = ">= 3.9" REQUIRES = [ "urllib3 >= 2.1.0, < 3.0.0", diff --git a/test/test_application_desired_state.py b/test/test_application_desired_state.py new file mode 100644 index 0000000..283ff06 --- /dev/null +++ b/test/test_application_desired_state.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Flight Control API + + [Flight Control](https://flightctl.io) is a service for declarative management of fleets of edge devices and their workloads. + + The version of the OpenAPI document: v1beta1 + Contact: team@flightctl.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from flightctl.models.application_desired_state import ApplicationDesiredState + +class TestApplicationDesiredState(unittest.TestCase): + """ApplicationDesiredState unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testApplicationDesiredState(self): + """Test ApplicationDesiredState""" + # inst = ApplicationDesiredState() + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_application_lifecycle_changed_details.py b/test/test_application_lifecycle_changed_details.py new file mode 100644 index 0000000..89cc3a8 --- /dev/null +++ b/test/test_application_lifecycle_changed_details.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Flight Control API + + [Flight Control](https://flightctl.io) is a service for declarative management of fleets of edge devices and their workloads. + + The version of the OpenAPI document: v1beta1 + Contact: team@flightctl.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from flightctl.models.application_lifecycle_changed_details import ApplicationLifecycleChangedDetails + +class TestApplicationLifecycleChangedDetails(unittest.TestCase): + """ApplicationLifecycleChangedDetails unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ApplicationLifecycleChangedDetails: + """Test ApplicationLifecycleChangedDetails + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ApplicationLifecycleChangedDetails` + """ + model = ApplicationLifecycleChangedDetails() + if include_optional: + return ApplicationLifecycleChangedDetails( + detail_type = 'ApplicationLifecycleChanged', + app_name = '', + action = 'stop' + ) + else: + return ApplicationLifecycleChangedDetails( + detail_type = 'ApplicationLifecycleChanged', + app_name = '', + action = 'stop', + ) + """ + + def testApplicationLifecycleChangedDetails(self): + """Test ApplicationLifecycleChangedDetails""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_catalog_item_ref_application_provider_spec.py b/test/test_catalog_item_ref_application_provider_spec.py new file mode 100644 index 0000000..4649637 --- /dev/null +++ b/test/test_catalog_item_ref_application_provider_spec.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + Flight Control API + + [Flight Control](https://flightctl.io) is a service for declarative management of fleets of edge devices and their workloads. + + The version of the OpenAPI document: v1beta1 + Contact: team@flightctl.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from flightctl.models.catalog_item_ref_application_provider_spec import CatalogItemRefApplicationProviderSpec + +class TestCatalogItemRefApplicationProviderSpec(unittest.TestCase): + """CatalogItemRefApplicationProviderSpec unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CatalogItemRefApplicationProviderSpec: + """Test CatalogItemRefApplicationProviderSpec + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CatalogItemRefApplicationProviderSpec` + """ + model = CatalogItemRefApplicationProviderSpec() + if include_optional: + return CatalogItemRefApplicationProviderSpec( + catalog_item_ref = flightctl.models.catalog_item_ref_spec.CatalogItemRefSpec( + catalog = '', + item = '', + version = '', + channel = '', ) + ) + else: + return CatalogItemRefApplicationProviderSpec( + catalog_item_ref = flightctl.models.catalog_item_ref_spec.CatalogItemRefSpec( + catalog = '', + item = '', + version = '', + channel = '', ), + ) + """ + + def testCatalogItemRefApplicationProviderSpec(self): + """Test CatalogItemRefApplicationProviderSpec""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_catalog_item_ref_spec.py b/test/test_catalog_item_ref_spec.py new file mode 100644 index 0000000..67a14dc --- /dev/null +++ b/test/test_catalog_item_ref_spec.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Flight Control API + + [Flight Control](https://flightctl.io) is a service for declarative management of fleets of edge devices and their workloads. + + The version of the OpenAPI document: v1beta1 + Contact: team@flightctl.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from flightctl.models.catalog_item_ref_spec import CatalogItemRefSpec + +class TestCatalogItemRefSpec(unittest.TestCase): + """CatalogItemRefSpec unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CatalogItemRefSpec: + """Test CatalogItemRefSpec + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CatalogItemRefSpec` + """ + model = CatalogItemRefSpec() + if include_optional: + return CatalogItemRefSpec( + catalog = '', + item = '', + version = '', + channel = '' + ) + else: + return CatalogItemRefSpec( + catalog = '', + item = '', + version = '', + ) + """ + + def testCatalogItemRefSpec(self): + """Test CatalogItemRefSpec""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_device_capabilities.py b/test/test_device_capabilities.py new file mode 100644 index 0000000..98f5a57 --- /dev/null +++ b/test/test_device_capabilities.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Flight Control API + + [Flight Control](https://flightctl.io) is a service for declarative management of fleets of edge devices and their workloads. + + The version of the OpenAPI document: v1beta1 + Contact: team@flightctl.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from flightctl.models.device_capabilities import DeviceCapabilities + +class TestDeviceCapabilities(unittest.TestCase): + """DeviceCapabilities unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DeviceCapabilities: + """Test DeviceCapabilities + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DeviceCapabilities` + """ + model = DeviceCapabilities() + if include_optional: + return DeviceCapabilities( + os_mode = 'image' + ) + else: + return DeviceCapabilities( + ) + """ + + def testDeviceCapabilities(self): + """Test DeviceCapabilities""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_devices_summary_capabilities.py b/test/test_devices_summary_capabilities.py new file mode 100644 index 0000000..c0f2505 --- /dev/null +++ b/test/test_devices_summary_capabilities.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Flight Control API + + [Flight Control](https://flightctl.io) is a service for declarative management of fleets of edge devices and their workloads. + + The version of the OpenAPI document: v1beta1 + Contact: team@flightctl.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from flightctl.models.devices_summary_capabilities import DevicesSummaryCapabilities + +class TestDevicesSummaryCapabilities(unittest.TestCase): + """DevicesSummaryCapabilities unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DevicesSummaryCapabilities: + """Test DevicesSummaryCapabilities + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DevicesSummaryCapabilities` + """ + model = DevicesSummaryCapabilities() + if include_optional: + return DevicesSummaryCapabilities( + os_mode = { + 'key' : 56 + } + ) + else: + return DevicesSummaryCapabilities( + ) + """ + + def testDevicesSummaryCapabilities(self): + """Test DevicesSummaryCapabilities""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_image_or_catalog_item_ref_spec.py b/test/test_image_or_catalog_item_ref_spec.py new file mode 100644 index 0000000..72b088f --- /dev/null +++ b/test/test_image_or_catalog_item_ref_spec.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Flight Control API + + [Flight Control](https://flightctl.io) is a service for declarative management of fleets of edge devices and their workloads. + + The version of the OpenAPI document: v1beta1 + Contact: team@flightctl.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from flightctl.models.image_or_catalog_item_ref_spec import ImageOrCatalogItemRefSpec + +class TestImageOrCatalogItemRefSpec(unittest.TestCase): + """ImageOrCatalogItemRefSpec unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ImageOrCatalogItemRefSpec: + """Test ImageOrCatalogItemRefSpec + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ImageOrCatalogItemRefSpec` + """ + model = ImageOrCatalogItemRefSpec() + if include_optional: + return ImageOrCatalogItemRefSpec( + image = '', + catalog_item_ref = flightctl.models.catalog_item_ref_spec.CatalogItemRefSpec( + catalog = '', + item = '', + version = '', + channel = '', ) + ) + else: + return ImageOrCatalogItemRefSpec( + ) + """ + + def testImageOrCatalogItemRefSpec(self): + """Test ImageOrCatalogItemRefSpec""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_image_spec.py b/test/test_image_spec.py new file mode 100644 index 0000000..3722b9b --- /dev/null +++ b/test/test_image_spec.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Flight Control API + + [Flight Control](https://flightctl.io) is a service for declarative management of fleets of edge devices and their workloads. + + The version of the OpenAPI document: v1beta1 + Contact: team@flightctl.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from flightctl.models.image_spec import ImageSpec + +class TestImageSpec(unittest.TestCase): + """ImageSpec unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ImageSpec: + """Test ImageSpec + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ImageSpec` + """ + model = ImageSpec() + if include_optional: + return ImageSpec( + image = '' + ) + else: + return ImageSpec( + image = '', + ) + """ + + def testImageSpec(self): + """Test ImageSpec""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_os_mode_type.py b/test/test_os_mode_type.py new file mode 100644 index 0000000..cfb40a2 --- /dev/null +++ b/test/test_os_mode_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Flight Control API + + [Flight Control](https://flightctl.io) is a service for declarative management of fleets of edge devices and their workloads. + + The version of the OpenAPI document: v1beta1 + Contact: team@flightctl.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from flightctl.models.os_mode_type import OsModeType + +class TestOsModeType(unittest.TestCase): + """OsModeType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOsModeType(self): + """Test OsModeType""" + # inst = OsModeType() + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_vm_application.py b/test/test_vm_application.py new file mode 100644 index 0000000..6c3cf96 --- /dev/null +++ b/test/test_vm_application.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +""" + Flight Control API + + [Flight Control](https://flightctl.io) is a service for declarative management of fleets of edge devices and their workloads. + + The version of the OpenAPI document: v1beta1 + Contact: team@flightctl.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from flightctl.models.vm_application import VmApplication + +class TestVmApplication(unittest.TestCase): + """VmApplication unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VmApplication: + """Test VmApplication + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `VmApplication` + """ + model = VmApplication() + if include_optional: + return VmApplication( + name = '', + app_type = 'compose', + annotations = { + 'key' : '' + }, + desired_state = 'running', + restart_generation = 56, + publish_ports = [ + '4:072888001528021798096225500850762068629/tcp' + ], + image = '', + inline = [ + null + ] + ) + else: + return VmApplication( + app_type = 'compose', + image = '', + inline = [ + null + ], + ) + """ + + def testVmApplication(self): + """Test VmApplication""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main()