From 972c8ba7fef350cc64fc11a70a9a784e81926531 Mon Sep 17 00:00:00 2001 From: Siddarth R Date: Wed, 17 Jun 2026 18:02:39 -0400 Subject: [PATCH] NO-ISSUE: Update python-client to v1.2 Assisted-by: Cursor/Claude --- .gitignore | 3 - .openapi-generator/FILES | 68 +- Makefile | 5 +- README.md | 13 +- api/bundled/core-v1alpha1.yaml | 2720 ++++++ api/bundled/core-v1beta1.yaml | 8413 +++++++++++++++++ api/bundled/imagebuilder-v1alpha1.yaml | 2198 +++++ api/core/v1alpha1/openapi.yaml | 1572 ++- api/core/v1beta1/openapi.yaml | 727 +- api/imagebuilder/v1alpha1/openapi.yaml | 1065 ++- docs/AapProviderSpec.md | 1 + docs/AuthProviderSpec.md | 1 + docs/AuthproviderApi.md | 2 + docs/BaseImageEntry.md | 32 + docs/CertificatesigningrequestApi.md | 2 + docs/CheckRepositoryOciImageRequest.md | 30 + docs/CheckRepositoryOciResult.md | 32 + docs/CheckRepositoryOciTagRequest.md | 31 + docs/DependencyChangeDetectedDetails.md | 31 + docs/DependencySyncConfigRefStatus.md | 32 + docs/DependencySyncProbeFailedDetails.md | 31 + docs/DependencySyncStatus.md | 30 + docs/DeviceApi.md | 12 +- docs/DeviceStatus.md | 1 + docs/DeviceVulnerabilityCveDetails.md | 33 + docs/EnrollmentRequestApproval.md | 3 +- docs/EnrollmentRequestApprovalStatus.md | 3 +- docs/EnrollmentrequestApi.md | 4 + docs/EventDetails.md | 6 + docs/FleetApi.md | 6 + docs/K8sProviderSpec.md | 5 +- docs/OciRepoSpec.md | 1 + docs/OpenShiftProviderSpec.md | 1 + docs/RepositoryApi.md | 154 + docs/RepositorySpec.md | 1 + docs/ResourcesyncApi.md | 2 + flightctl/api/authprovider_api.py | 14 +- .../api/certificatesigningrequest_api.py | 14 +- flightctl/api/device_api.py | 43 +- flightctl/api/enrollmentrequest_api.py | 20 +- flightctl/api/event_api.py | 8 +- flightctl/api/fleet_api.py | 32 +- flightctl/api/label_api.py | 8 +- flightctl/api/repository_api.py | 629 +- flightctl/api/resourcesync_api.py | 14 +- flightctl/api_client.py | 2 +- flightctl/configuration.py | 4 +- flightctl/imagebuilder/__init__.py | 36 +- flightctl/imagebuilder/api/__init__.py | 1 + flightctl/imagebuilder/api/imagebuild_api.py | 338 +- flightctl/imagebuilder/api/imageexport_api.py | 28 +- .../imagebuilder/api/imagepromotion_api.py | 1843 ++++ flightctl/imagebuilder/api_client.py | 2 +- flightctl/imagebuilder/configuration.py | 2 +- .../docs/ArtifactPromotionStatus.md | 32 + .../docs/ExistingCatalogItemTarget.md | 37 + .../docs/ImageBuildConditionReason.md | 2 + .../docs/ImageBuildNewVersionRequest.md | 32 + flightctl/imagebuilder/docs/ImagePromotion.md | 34 + .../docs/ImagePromotionCondition.md | 35 + .../docs/ImagePromotionConditionReason.md | 23 + .../docs/ImagePromotionConditionType.md | 11 + .../imagebuilder/docs/ImagePromotionList.md | 33 + .../imagebuilder/docs/ImagePromotionSource.md | 31 + .../imagebuilder/docs/ImagePromotionSpec.md | 31 + .../imagebuilder/docs/ImagePromotionStatus.md | 33 + .../imagebuilder/docs/ImagePromotionTarget.md | 38 + .../docs/ImagePromotionTargetBase.md | 33 + .../docs/ImagePromotionTargetType.md | 13 + flightctl/imagebuilder/docs/ImagebuildApi.md | 85 +- flightctl/imagebuilder/docs/ImageexportApi.md | 9 +- .../imagebuilder/docs/ImagepromotionApi.md | 456 + .../imagebuilder/docs/NewCatalogItemTarget.md | 35 + .../imagebuilder/docs/PatchRequestInner.md | 31 + flightctl/imagebuilder/docs/ResourceKind.md | 2 + flightctl/imagebuilder/models/__init__.py | 16 + .../models/artifact_promotion_status.py | 94 + .../models/existing_catalog_item_target.py | 109 + .../models/image_build_condition_reason.py | 1 + .../models/image_build_destination.py | 16 +- .../models/image_build_new_version_request.py | 113 + .../models/image_build_ref_source.py | 3 +- .../imagebuilder/models/image_build_source.py | 16 +- .../imagebuilder/models/image_promotion.py | 109 + .../models/image_promotion_condition.py | 101 + .../image_promotion_condition_reason.py | 43 + .../models/image_promotion_condition_type.py | 37 + .../models/image_promotion_list.py | 107 + .../models/image_promotion_source.py | 92 + .../models/image_promotion_spec.py | 98 + .../models/image_promotion_status.py | 111 + .../models/image_promotion_target.py | 156 + .../models/image_promotion_target_base.py | 95 + .../models/image_promotion_target_type.py | 38 + .../models/new_catalog_item_target.py | 105 + flightctl/imagebuilder/models/object_meta.py | 5 +- .../models/patch_request_inner.py | 104 + .../imagebuilder/models/resource_kind.py | 1 + .../test/test_artifact_promotion_status.py | 58 + .../test/test_existing_catalog_item_target.py | 65 + .../test_image_build_new_version_request.py | 55 + .../imagebuilder/test/test_image_promotion.py | 108 + .../test/test_image_promotion_condition.py | 62 + .../test_image_promotion_condition_reason.py | 34 + .../test_image_promotion_condition_type.py | 34 + .../test/test_image_promotion_list.py | 137 + .../test/test_image_promotion_source.py | 56 + .../test/test_image_promotion_spec.py | 63 + .../test/test_image_promotion_status.py | 63 + .../test/test_image_promotion_target.py | 66 + .../test/test_image_promotion_target_base.py | 59 + .../test/test_image_promotion_target_type.py | 34 + .../test/test_imagepromotion_api.py | 68 + .../test/test_new_catalog_item_target.py | 61 + .../test/test_patch_request_inner.py | 56 + flightctl/imagebuilder_README.md | 25 +- flightctl/models/__init__.py | 9 + flightctl/models/aap_provider_spec.py | 6 +- flightctl/models/base_image_entry.py | 93 + .../certificate_signing_request_spec.py | 3 +- .../check_repository_oci_image_request.py | 89 + .../models/check_repository_oci_result.py | 92 + .../check_repository_oci_tag_request.py | 98 + .../dependency_change_detected_details.py | 99 + .../dependency_sync_config_ref_status.py | 93 + .../dependency_sync_probe_failed_details.py | 99 + flightctl/models/dependency_sync_status.py | 96 + flightctl/models/device_spec.py | 2 +- flightctl/models/device_status.py | 10 +- .../device_vulnerability_cve_details.py | 109 + .../models/enrollment_request_approval.py | 6 +- .../enrollment_request_approval_status.py | 6 +- flightctl/models/event.py | 4 +- flightctl/models/event_details.py | 73 +- flightctl/models/git_repo_spec.py | 3 +- flightctl/models/http_repo_spec.py | 3 +- flightctl/models/k8s_provider_spec.py | 10 +- flightctl/models/object_meta.py | 5 +- flightctl/models/oci_repo_spec.py | 14 +- flightctl/models/open_shift_provider_spec.py | 6 +- flightctl/models/resource_sync_spec.py | 9 +- flightctl/models/template_version_status.py | 2 +- flightctl/models/token_request.py | 3 +- flightctl/v1alpha1/__init__.py | 38 +- flightctl/v1alpha1/api/__init__.py | 1 + flightctl/v1alpha1/api/catalog_api.py | 71 +- flightctl/v1alpha1/api/vulnerability_api.py | 2329 +++++ flightctl/v1alpha1/api_client.py | 2 +- flightctl/v1alpha1/configuration.py | 4 +- flightctl/v1alpha1/docs/AffectedFleet.md | 33 + flightctl/v1alpha1/docs/ApiVersion.md | 4 +- flightctl/v1alpha1/docs/CatalogApi.md | 19 +- .../v1alpha1/docs/CatalogItemArtifactType.md | 2 + flightctl/v1alpha1/docs/CatalogItemVersion.md | 2 +- .../v1alpha1/docs/CveCountsBySeverity.md | 36 + .../v1alpha1/docs/DeviceCountsBySeverity.md | 36 + .../DeviceVulnerabilitySummaryResponse.md | 34 + .../docs/FleetVulnerabilitySummary.md | 37 + .../docs/FleetVulnerabilitySummaryResponse.md | 32 + flightctl/v1alpha1/docs/Vulnerability.md | 42 + flightctl/v1alpha1/docs/VulnerabilityApi.md | 548 ++ flightctl/v1alpha1/docs/VulnerabilityGroup.md | 37 + .../v1alpha1/docs/VulnerabilityGroupItem.md | 40 + .../v1alpha1/docs/VulnerabilityGroupList.md | 33 + .../v1alpha1/docs/VulnerabilityImageRef.md | 32 + .../v1alpha1/docs/VulnerabilityImpact.md | 39 + flightctl/v1alpha1/docs/VulnerabilityList.md | 33 + .../docs/VulnerabilitySeveritySummary.md | 36 + .../docs/VulnerabilitySummaryResponse.md | 32 + flightctl/v1alpha1/models/__init__.py | 17 +- flightctl/v1alpha1/models/affected_fleet.py | 102 + flightctl/v1alpha1/models/api_version.py | 4 +- .../models/catalog_item_artifact_type.py | 1 + .../v1alpha1/models/catalog_item_meta.py | 5 +- .../v1alpha1/models/catalog_item_version.py | 39 +- .../v1alpha1/models/cve_counts_by_severity.py | 100 + .../models/device_counts_by_severity.py | 100 + .../device_vulnerability_summary_response.py | 101 + .../models/fleet_vulnerability_summary.py | 102 + .../fleet_vulnerability_summary_response.py | 97 + flightctl/v1alpha1/models/object_meta.py | 5 +- flightctl/v1alpha1/models/vulnerability.py | 121 + .../v1alpha1/models/vulnerability_group.py | 119 + .../models/vulnerability_group_item.py | 116 + .../models/vulnerability_group_list.py | 107 + .../models/vulnerability_image_ref.py | 92 + .../v1alpha1/models/vulnerability_impact.py | 127 + .../v1alpha1/models/vulnerability_list.py | 107 + .../models/vulnerability_severity_summary.py | 100 + .../models/vulnerability_summary_response.py | 97 + .../v1alpha1/test/test_affected_fleet.py | 89 + .../test/test_cve_counts_by_severity.py | 65 + .../test/test_device_counts_by_severity.py | 65 + ...t_device_vulnerability_summary_response.py | 73 + .../test/test_fleet_vulnerability_summary.py | 67 + ...st_fleet_vulnerability_summary_response.py | 57 + flightctl/v1alpha1/test/test_vulnerability.py | 68 + .../v1alpha1/test/test_vulnerability_api.py | 74 + .../v1alpha1/test/test_vulnerability_group.py | 94 + .../test/test_vulnerability_group_item.py | 69 + .../test/test_vulnerability_group_list.py | 113 + .../test/test_vulnerability_image_ref.py | 56 + .../test/test_vulnerability_impact.py | 113 + .../v1alpha1/test/test_vulnerability_list.py | 93 + .../test_vulnerability_severity_summary.py | 65 + .../test_vulnerability_summary_response.py | 71 + flightctl/v1alpha1_README.md | 26 +- pyproject.toml | 11 +- setup.py | 4 +- test/test_base_image_entry.py | 60 + ...test_check_repository_oci_image_request.py | 53 + test/test_check_repository_oci_result.py | 55 + test/test_check_repository_oci_tag_request.py | 55 + ...test_dependency_change_detected_details.py | 57 + .../test_dependency_sync_config_ref_status.py | 55 + ...st_dependency_sync_probe_failed_details.py | 57 + test/test_dependency_sync_status.py | 57 + test/test_device_vulnerability_cve_details.py | 57 + 218 files changed, 31507 insertions(+), 544 deletions(-) create mode 100644 api/bundled/core-v1alpha1.yaml create mode 100644 api/bundled/core-v1beta1.yaml create mode 100644 api/bundled/imagebuilder-v1alpha1.yaml create mode 100644 docs/BaseImageEntry.md create mode 100644 docs/CheckRepositoryOciImageRequest.md create mode 100644 docs/CheckRepositoryOciResult.md create mode 100644 docs/CheckRepositoryOciTagRequest.md create mode 100644 docs/DependencyChangeDetectedDetails.md create mode 100644 docs/DependencySyncConfigRefStatus.md create mode 100644 docs/DependencySyncProbeFailedDetails.md create mode 100644 docs/DependencySyncStatus.md create mode 100644 docs/DeviceVulnerabilityCveDetails.md create mode 100644 flightctl/imagebuilder/api/imagepromotion_api.py create mode 100644 flightctl/imagebuilder/docs/ArtifactPromotionStatus.md create mode 100644 flightctl/imagebuilder/docs/ExistingCatalogItemTarget.md create mode 100644 flightctl/imagebuilder/docs/ImageBuildNewVersionRequest.md create mode 100644 flightctl/imagebuilder/docs/ImagePromotion.md create mode 100644 flightctl/imagebuilder/docs/ImagePromotionCondition.md create mode 100644 flightctl/imagebuilder/docs/ImagePromotionConditionReason.md create mode 100644 flightctl/imagebuilder/docs/ImagePromotionConditionType.md create mode 100644 flightctl/imagebuilder/docs/ImagePromotionList.md create mode 100644 flightctl/imagebuilder/docs/ImagePromotionSource.md create mode 100644 flightctl/imagebuilder/docs/ImagePromotionSpec.md create mode 100644 flightctl/imagebuilder/docs/ImagePromotionStatus.md create mode 100644 flightctl/imagebuilder/docs/ImagePromotionTarget.md create mode 100644 flightctl/imagebuilder/docs/ImagePromotionTargetBase.md create mode 100644 flightctl/imagebuilder/docs/ImagePromotionTargetType.md create mode 100644 flightctl/imagebuilder/docs/ImagepromotionApi.md create mode 100644 flightctl/imagebuilder/docs/NewCatalogItemTarget.md create mode 100644 flightctl/imagebuilder/docs/PatchRequestInner.md create mode 100644 flightctl/imagebuilder/models/artifact_promotion_status.py create mode 100644 flightctl/imagebuilder/models/existing_catalog_item_target.py create mode 100644 flightctl/imagebuilder/models/image_build_new_version_request.py create mode 100644 flightctl/imagebuilder/models/image_promotion.py create mode 100644 flightctl/imagebuilder/models/image_promotion_condition.py create mode 100644 flightctl/imagebuilder/models/image_promotion_condition_reason.py create mode 100644 flightctl/imagebuilder/models/image_promotion_condition_type.py create mode 100644 flightctl/imagebuilder/models/image_promotion_list.py create mode 100644 flightctl/imagebuilder/models/image_promotion_source.py create mode 100644 flightctl/imagebuilder/models/image_promotion_spec.py create mode 100644 flightctl/imagebuilder/models/image_promotion_status.py create mode 100644 flightctl/imagebuilder/models/image_promotion_target.py create mode 100644 flightctl/imagebuilder/models/image_promotion_target_base.py create mode 100644 flightctl/imagebuilder/models/image_promotion_target_type.py create mode 100644 flightctl/imagebuilder/models/new_catalog_item_target.py create mode 100644 flightctl/imagebuilder/models/patch_request_inner.py create mode 100644 flightctl/imagebuilder/test/test_artifact_promotion_status.py create mode 100644 flightctl/imagebuilder/test/test_existing_catalog_item_target.py create mode 100644 flightctl/imagebuilder/test/test_image_build_new_version_request.py create mode 100644 flightctl/imagebuilder/test/test_image_promotion.py create mode 100644 flightctl/imagebuilder/test/test_image_promotion_condition.py create mode 100644 flightctl/imagebuilder/test/test_image_promotion_condition_reason.py create mode 100644 flightctl/imagebuilder/test/test_image_promotion_condition_type.py create mode 100644 flightctl/imagebuilder/test/test_image_promotion_list.py create mode 100644 flightctl/imagebuilder/test/test_image_promotion_source.py create mode 100644 flightctl/imagebuilder/test/test_image_promotion_spec.py create mode 100644 flightctl/imagebuilder/test/test_image_promotion_status.py create mode 100644 flightctl/imagebuilder/test/test_image_promotion_target.py create mode 100644 flightctl/imagebuilder/test/test_image_promotion_target_base.py create mode 100644 flightctl/imagebuilder/test/test_image_promotion_target_type.py create mode 100644 flightctl/imagebuilder/test/test_imagepromotion_api.py create mode 100644 flightctl/imagebuilder/test/test_new_catalog_item_target.py create mode 100644 flightctl/imagebuilder/test/test_patch_request_inner.py create mode 100644 flightctl/models/base_image_entry.py create mode 100644 flightctl/models/check_repository_oci_image_request.py create mode 100644 flightctl/models/check_repository_oci_result.py create mode 100644 flightctl/models/check_repository_oci_tag_request.py create mode 100644 flightctl/models/dependency_change_detected_details.py create mode 100644 flightctl/models/dependency_sync_config_ref_status.py create mode 100644 flightctl/models/dependency_sync_probe_failed_details.py create mode 100644 flightctl/models/dependency_sync_status.py create mode 100644 flightctl/models/device_vulnerability_cve_details.py create mode 100644 flightctl/v1alpha1/api/vulnerability_api.py create mode 100644 flightctl/v1alpha1/docs/AffectedFleet.md create mode 100644 flightctl/v1alpha1/docs/CveCountsBySeverity.md create mode 100644 flightctl/v1alpha1/docs/DeviceCountsBySeverity.md create mode 100644 flightctl/v1alpha1/docs/DeviceVulnerabilitySummaryResponse.md create mode 100644 flightctl/v1alpha1/docs/FleetVulnerabilitySummary.md create mode 100644 flightctl/v1alpha1/docs/FleetVulnerabilitySummaryResponse.md create mode 100644 flightctl/v1alpha1/docs/Vulnerability.md create mode 100644 flightctl/v1alpha1/docs/VulnerabilityApi.md create mode 100644 flightctl/v1alpha1/docs/VulnerabilityGroup.md create mode 100644 flightctl/v1alpha1/docs/VulnerabilityGroupItem.md create mode 100644 flightctl/v1alpha1/docs/VulnerabilityGroupList.md create mode 100644 flightctl/v1alpha1/docs/VulnerabilityImageRef.md create mode 100644 flightctl/v1alpha1/docs/VulnerabilityImpact.md create mode 100644 flightctl/v1alpha1/docs/VulnerabilityList.md create mode 100644 flightctl/v1alpha1/docs/VulnerabilitySeveritySummary.md create mode 100644 flightctl/v1alpha1/docs/VulnerabilitySummaryResponse.md create mode 100644 flightctl/v1alpha1/models/affected_fleet.py create mode 100644 flightctl/v1alpha1/models/cve_counts_by_severity.py create mode 100644 flightctl/v1alpha1/models/device_counts_by_severity.py create mode 100644 flightctl/v1alpha1/models/device_vulnerability_summary_response.py create mode 100644 flightctl/v1alpha1/models/fleet_vulnerability_summary.py create mode 100644 flightctl/v1alpha1/models/fleet_vulnerability_summary_response.py create mode 100644 flightctl/v1alpha1/models/vulnerability.py create mode 100644 flightctl/v1alpha1/models/vulnerability_group.py create mode 100644 flightctl/v1alpha1/models/vulnerability_group_item.py create mode 100644 flightctl/v1alpha1/models/vulnerability_group_list.py create mode 100644 flightctl/v1alpha1/models/vulnerability_image_ref.py create mode 100644 flightctl/v1alpha1/models/vulnerability_impact.py create mode 100644 flightctl/v1alpha1/models/vulnerability_list.py create mode 100644 flightctl/v1alpha1/models/vulnerability_severity_summary.py create mode 100644 flightctl/v1alpha1/models/vulnerability_summary_response.py create mode 100644 flightctl/v1alpha1/test/test_affected_fleet.py create mode 100644 flightctl/v1alpha1/test/test_cve_counts_by_severity.py create mode 100644 flightctl/v1alpha1/test/test_device_counts_by_severity.py create mode 100644 flightctl/v1alpha1/test/test_device_vulnerability_summary_response.py create mode 100644 flightctl/v1alpha1/test/test_fleet_vulnerability_summary.py create mode 100644 flightctl/v1alpha1/test/test_fleet_vulnerability_summary_response.py create mode 100644 flightctl/v1alpha1/test/test_vulnerability.py create mode 100644 flightctl/v1alpha1/test/test_vulnerability_api.py create mode 100644 flightctl/v1alpha1/test/test_vulnerability_group.py create mode 100644 flightctl/v1alpha1/test/test_vulnerability_group_item.py create mode 100644 flightctl/v1alpha1/test/test_vulnerability_group_list.py create mode 100644 flightctl/v1alpha1/test/test_vulnerability_image_ref.py create mode 100644 flightctl/v1alpha1/test/test_vulnerability_impact.py create mode 100644 flightctl/v1alpha1/test/test_vulnerability_list.py create mode 100644 flightctl/v1alpha1/test/test_vulnerability_severity_summary.py create mode 100644 flightctl/v1alpha1/test/test_vulnerability_summary_response.py create mode 100644 test/test_base_image_entry.py create mode 100644 test/test_check_repository_oci_image_request.py create mode 100644 test/test_check_repository_oci_result.py create mode 100644 test/test_check_repository_oci_tag_request.py create mode 100644 test/test_dependency_change_detected_details.py create mode 100644 test/test_dependency_sync_config_ref_status.py create mode 100644 test/test_dependency_sync_probe_failed_details.py create mode 100644 test/test_dependency_sync_status.py create mode 100644 test/test_device_vulnerability_cve_details.py 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/.openapi-generator/FILES b/.openapi-generator/FILES index bdbff12..fd251e5 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -3,14 +3,17 @@ flightctl/imagebuilder/__init__.py flightctl/imagebuilder/api/__init__.py flightctl/imagebuilder/api/imagebuild_api.py flightctl/imagebuilder/api/imageexport_api.py +flightctl/imagebuilder/api/imagepromotion_api.py flightctl/imagebuilder/api_client.py flightctl/imagebuilder/api_response.py flightctl/imagebuilder/configuration.py flightctl/imagebuilder/docs/ApiVersion.md +flightctl/imagebuilder/docs/ArtifactPromotionStatus.md flightctl/imagebuilder/docs/BindingType.md flightctl/imagebuilder/docs/ConditionBase.md flightctl/imagebuilder/docs/ConditionStatus.md flightctl/imagebuilder/docs/EarlyBinding.md +flightctl/imagebuilder/docs/ExistingCatalogItemTarget.md flightctl/imagebuilder/docs/ExportFormatType.md flightctl/imagebuilder/docs/ImageBuild.md flightctl/imagebuilder/docs/ImageBuildBinding.md @@ -19,6 +22,7 @@ flightctl/imagebuilder/docs/ImageBuildConditionReason.md flightctl/imagebuilder/docs/ImageBuildConditionType.md flightctl/imagebuilder/docs/ImageBuildDestination.md flightctl/imagebuilder/docs/ImageBuildList.md +flightctl/imagebuilder/docs/ImageBuildNewVersionRequest.md flightctl/imagebuilder/docs/ImageBuildRefSource.md flightctl/imagebuilder/docs/ImageBuildSource.md flightctl/imagebuilder/docs/ImageBuildSpec.md @@ -33,20 +37,36 @@ flightctl/imagebuilder/docs/ImageExportList.md flightctl/imagebuilder/docs/ImageExportSourceType.md flightctl/imagebuilder/docs/ImageExportSpec.md flightctl/imagebuilder/docs/ImageExportStatus.md +flightctl/imagebuilder/docs/ImagePromotion.md +flightctl/imagebuilder/docs/ImagePromotionCondition.md +flightctl/imagebuilder/docs/ImagePromotionConditionReason.md +flightctl/imagebuilder/docs/ImagePromotionConditionType.md +flightctl/imagebuilder/docs/ImagePromotionList.md +flightctl/imagebuilder/docs/ImagePromotionSource.md +flightctl/imagebuilder/docs/ImagePromotionSpec.md +flightctl/imagebuilder/docs/ImagePromotionStatus.md +flightctl/imagebuilder/docs/ImagePromotionTarget.md +flightctl/imagebuilder/docs/ImagePromotionTargetBase.md +flightctl/imagebuilder/docs/ImagePromotionTargetType.md flightctl/imagebuilder/docs/ImagebuildApi.md flightctl/imagebuilder/docs/ImageexportApi.md +flightctl/imagebuilder/docs/ImagepromotionApi.md flightctl/imagebuilder/docs/LateBinding.md flightctl/imagebuilder/docs/ListMeta.md +flightctl/imagebuilder/docs/NewCatalogItemTarget.md flightctl/imagebuilder/docs/ObjectMeta.md +flightctl/imagebuilder/docs/PatchRequestInner.md flightctl/imagebuilder/docs/ResourceKind.md flightctl/imagebuilder/docs/Status.md flightctl/imagebuilder/exceptions.py flightctl/imagebuilder/models/__init__.py flightctl/imagebuilder/models/api_version.py +flightctl/imagebuilder/models/artifact_promotion_status.py flightctl/imagebuilder/models/binding_type.py flightctl/imagebuilder/models/condition_base.py flightctl/imagebuilder/models/condition_status.py flightctl/imagebuilder/models/early_binding.py +flightctl/imagebuilder/models/existing_catalog_item_target.py flightctl/imagebuilder/models/export_format_type.py flightctl/imagebuilder/models/image_build.py flightctl/imagebuilder/models/image_build_binding.py @@ -55,6 +75,7 @@ flightctl/imagebuilder/models/image_build_condition_reason.py flightctl/imagebuilder/models/image_build_condition_type.py flightctl/imagebuilder/models/image_build_destination.py flightctl/imagebuilder/models/image_build_list.py +flightctl/imagebuilder/models/image_build_new_version_request.py flightctl/imagebuilder/models/image_build_ref_source.py flightctl/imagebuilder/models/image_build_source.py flightctl/imagebuilder/models/image_build_spec.py @@ -69,45 +90,24 @@ flightctl/imagebuilder/models/image_export_list.py flightctl/imagebuilder/models/image_export_source_type.py flightctl/imagebuilder/models/image_export_spec.py flightctl/imagebuilder/models/image_export_status.py +flightctl/imagebuilder/models/image_promotion.py +flightctl/imagebuilder/models/image_promotion_condition.py +flightctl/imagebuilder/models/image_promotion_condition_reason.py +flightctl/imagebuilder/models/image_promotion_condition_type.py +flightctl/imagebuilder/models/image_promotion_list.py +flightctl/imagebuilder/models/image_promotion_source.py +flightctl/imagebuilder/models/image_promotion_spec.py +flightctl/imagebuilder/models/image_promotion_status.py +flightctl/imagebuilder/models/image_promotion_target.py +flightctl/imagebuilder/models/image_promotion_target_base.py +flightctl/imagebuilder/models/image_promotion_target_type.py flightctl/imagebuilder/models/late_binding.py flightctl/imagebuilder/models/list_meta.py +flightctl/imagebuilder/models/new_catalog_item_target.py flightctl/imagebuilder/models/object_meta.py +flightctl/imagebuilder/models/patch_request_inner.py flightctl/imagebuilder/models/resource_kind.py flightctl/imagebuilder/models/status.py flightctl/imagebuilder/rest.py flightctl/imagebuilder/test/__init__.py -flightctl/imagebuilder/test/test_api_version.py -flightctl/imagebuilder/test/test_binding_type.py -flightctl/imagebuilder/test/test_condition_base.py -flightctl/imagebuilder/test/test_condition_status.py -flightctl/imagebuilder/test/test_early_binding.py -flightctl/imagebuilder/test/test_export_format_type.py -flightctl/imagebuilder/test/test_image_build.py -flightctl/imagebuilder/test/test_image_build_binding.py -flightctl/imagebuilder/test/test_image_build_condition.py -flightctl/imagebuilder/test/test_image_build_condition_reason.py -flightctl/imagebuilder/test/test_image_build_condition_type.py -flightctl/imagebuilder/test/test_image_build_destination.py -flightctl/imagebuilder/test/test_image_build_list.py -flightctl/imagebuilder/test/test_image_build_ref_source.py -flightctl/imagebuilder/test/test_image_build_source.py -flightctl/imagebuilder/test/test_image_build_spec.py -flightctl/imagebuilder/test/test_image_build_status.py -flightctl/imagebuilder/test/test_image_build_user_configuration.py -flightctl/imagebuilder/test/test_image_export.py -flightctl/imagebuilder/test/test_image_export_condition.py -flightctl/imagebuilder/test/test_image_export_condition_reason.py -flightctl/imagebuilder/test/test_image_export_condition_type.py -flightctl/imagebuilder/test/test_image_export_format_phase.py -flightctl/imagebuilder/test/test_image_export_list.py -flightctl/imagebuilder/test/test_image_export_source_type.py -flightctl/imagebuilder/test/test_image_export_spec.py -flightctl/imagebuilder/test/test_image_export_status.py -flightctl/imagebuilder/test/test_imagebuild_api.py -flightctl/imagebuilder/test/test_imageexport_api.py -flightctl/imagebuilder/test/test_late_binding.py -flightctl/imagebuilder/test/test_list_meta.py -flightctl/imagebuilder/test/test_object_meta.py -flightctl/imagebuilder/test/test_resource_kind.py -flightctl/imagebuilder/test/test_status.py flightctl/imagebuilder_README.md diff --git a/Makefile b/Makefile index 243d49d..84075f4 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -VERSION = 1.1.0 +VERSION = 1.2.0 GENERATOR_VERSION = 7.17.0 COMMON_PROPS = packageName=flightctl,useOneOfDiscriminatorLookup=true,packageVersion=$(VERSION) GIT_USER = flightctl @@ -20,6 +20,7 @@ generate-core: bundle-specs -g python \ -i api/bundled/core-v1beta1.yaml \ -o . \ + --skip-validate-spec \ --additional-properties=$(COMMON_PROPS) \ --git-user-id $(GIT_USER) \ --git-repo-id $(GIT_REPO) @@ -31,6 +32,7 @@ generate-v1alpha1: bundle-specs -g python \ -i api/bundled/core-v1alpha1.yaml \ -o . \ + --skip-validate-spec \ --additional-properties=packageName=flightctl.v1alpha1,useOneOfDiscriminatorLookup=true,generateSourceCodeOnly=true,packageVersion=$(VERSION) \ --git-user-id $(GIT_USER) \ --git-repo-id $(GIT_REPO) @@ -42,6 +44,7 @@ generate-imagebuilder: bundle-specs -g python \ -i api/bundled/imagebuilder-v1alpha1.yaml \ -o . \ + --skip-validate-spec \ --additional-properties=packageName=flightctl.imagebuilder,useOneOfDiscriminatorLookup=true,generateSourceCodeOnly=true,packageVersion=$(VERSION) \ --git-user-id $(GIT_USER) \ --git-repo-id $(GIT_REPO) diff --git a/README.md b/README.md index 6d65bce..bfeb0ab 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.1.0 +- Package version: 1.2.0 - Generator version: 7.17.0 - Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit [https://flightctl.io](https://flightctl.io) @@ -142,6 +142,8 @@ Class | Method | HTTP request | Description *FleetApi* | [**replace_fleet_status**](docs/FleetApi.md#replace_fleet_status) | **PUT** /fleets/{name}/status | *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 | +*RepositoryApi* | [**check_repository_oci_tag**](docs/RepositoryApi.md#check_repository_oci_tag) | **POST** /repositories/{name}/check-oci-tag | *RepositoryApi* | [**create_repository**](docs/RepositoryApi.md#create_repository) | **POST** /repositories | *RepositoryApi* | [**delete_repository**](docs/RepositoryApi.md#delete_repository) | **DELETE** /repositories/{name} | *RepositoryApi* | [**get_repository**](docs/RepositoryApi.md#get_repository) | **GET** /repositories/{name} | @@ -187,6 +189,7 @@ Class | Method | HTTP request | Description - [AuthRoleAssignment](docs/AuthRoleAssignment.md) - [AuthStaticOrganizationAssignment](docs/AuthStaticOrganizationAssignment.md) - [AuthStaticRoleAssignment](docs/AuthStaticRoleAssignment.md) + - [BaseImageEntry](docs/BaseImageEntry.md) - [Batch](docs/Batch.md) - [BatchLimit](docs/BatchLimit.md) - [BatchSequence](docs/BatchSequence.md) @@ -194,6 +197,9 @@ Class | Method | HTTP request | Description - [CertificateSigningRequestList](docs/CertificateSigningRequestList.md) - [CertificateSigningRequestSpec](docs/CertificateSigningRequestSpec.md) - [CertificateSigningRequestStatus](docs/CertificateSigningRequestStatus.md) + - [CheckRepositoryOciImageRequest](docs/CheckRepositoryOciImageRequest.md) + - [CheckRepositoryOciResult](docs/CheckRepositoryOciResult.md) + - [CheckRepositoryOciTagRequest](docs/CheckRepositoryOciTagRequest.md) - [ComposeApplication](docs/ComposeApplication.md) - [Condition](docs/Condition.md) - [ConditionBase](docs/ConditionBase.md) @@ -203,6 +209,10 @@ Class | Method | HTTP request | Description - [ContainerApplication](docs/ContainerApplication.md) - [ContainerApplicationProperties](docs/ContainerApplicationProperties.md) - [CpuResourceMonitorSpec](docs/CpuResourceMonitorSpec.md) + - [DependencyChangeDetectedDetails](docs/DependencyChangeDetectedDetails.md) + - [DependencySyncConfigRefStatus](docs/DependencySyncConfigRefStatus.md) + - [DependencySyncProbeFailedDetails](docs/DependencySyncProbeFailedDetails.md) + - [DependencySyncStatus](docs/DependencySyncStatus.md) - [Device](docs/Device.md) - [DeviceApplicationStatus](docs/DeviceApplicationStatus.md) - [DeviceApplicationsSummaryStatus](docs/DeviceApplicationsSummaryStatus.md) @@ -237,6 +247,7 @@ Class | Method | HTTP request | Description - [DeviceUpdatePolicySpec](docs/DeviceUpdatePolicySpec.md) - [DeviceUpdatedStatus](docs/DeviceUpdatedStatus.md) - [DeviceUpdatedStatusType](docs/DeviceUpdatedStatusType.md) + - [DeviceVulnerabilityCveDetails](docs/DeviceVulnerabilityCveDetails.md) - [DevicesSummary](docs/DevicesSummary.md) - [DiskResourceMonitorSpec](docs/DiskResourceMonitorSpec.md) - [DisruptionBudget](docs/DisruptionBudget.md) diff --git a/api/bundled/core-v1alpha1.yaml b/api/bundled/core-v1alpha1.yaml new file mode 100644 index 0000000..7279265 --- /dev/null +++ b/api/bundled/core-v1alpha1.yaml @@ -0,0 +1,2720 @@ +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' + /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 + 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 + 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..c013ac1 --- /dev/null +++ b/api/bundled/core-v1beta1.yaml @@ -0,0 +1,8413 @@ +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: + 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}/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' + /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: + 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/{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' + discriminator: + propertyName: appType + mapping: + compose: '#/components/schemas/ComposeApplication' + quadlet: '#/components/schemas/QuadletApplication' + container: '#/components/schemas/ContainerApplication' + helm: '#/components/schemas/HelmApplication' + 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' + required: + - appType + ComposeApplication: + type: object + allOf: + - $ref: '#/components/schemas/ApplicationProviderBase' + - $ref: '#/components/schemas/ApplicationEnvVars' + - $ref: '#/components/schemas/ApplicationVolumeProviderSpec' + - oneOf: + - $ref: '#/components/schemas/ImageApplicationProviderSpec' + - $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/InlineApplicationProviderSpec' + ContainerApplication: + type: object + allOf: + - $ref: '#/components/schemas/ApplicationProviderBase' + - $ref: '#/components/schemas/ApplicationEnvVars' + - $ref: '#/components/schemas/ApplicationUser' + - $ref: '#/components/schemas/ApplicationVolumeProviderSpec' + - type: object + properties: + image: + type: string + description: Reference to the image for this container. + ports: + type: array + description: Port mappings. + items: + $ref: '#/components/schemas/ApplicationPort' + resources: + $ref: '#/components/schemas/ApplicationResources' + required: + - image + HelmApplication: + type: object + allOf: + - $ref: '#/components/schemas/ApplicationProviderBase' + - 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. + 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 + 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' + ImageApplicationProviderSpec: + type: object + allOf: + - type: object + properties: + image: + type: string + description: Reference to the OCI image or artifact for the application package. + required: + - image + 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. + 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. + pullPolicy: + $ref: '#/components/schemas/ImagePullPolicy' + required: + - reference + 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 + x-enum-varnames: + - AppTypeCompose + - AppTypeQuadlet + - AppTypeContainer + - AppTypeHelm + 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: + 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 + 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' + 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 + x-enum-varnames: + - ApplicationStatusPreparing + - ApplicationStatusStarting + - ApplicationStatusRunning + - ApplicationStatusError + - ApplicationStatusUnknown + - ApplicationStatusCompleted + 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). + 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. + 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 + 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' + 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' + 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. + 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 diff --git a/api/bundled/imagebuilder-v1alpha1.yaml b/api/bundled/imagebuilder-v1alpha1.yaml new file mode 100644 index 0000000..bcfbf09 --- /dev/null +++ b/api/bundled/imagebuilder-v1alpha1.yaml @@ -0,0 +1,2198 @@ +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' + 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 fbd092a..8805071 100644 --- a/api/core/v1alpha1/openapi.yaml +++ b/api/core/v1alpha1/openapi.yaml @@ -18,6 +18,8 @@ servers: tags: - name: catalog description: Operations on Catalog resources. + - name: vulnerability + description: Operations for vulnerability reports and organization-wide summaries. paths: /catalogitems: x-resource: catalogitems @@ -50,6 +52,8 @@ paths: schema: type: integer format: int32 + minimum: 0 + maximum: 1000 responses: "200": description: OK @@ -62,31 +66,31 @@ paths: content: application/json: schema: - $ref: '../v1beta1/openapi.yaml#/components/schemas/Status' + $ref: '#/components/schemas/Status' "401": description: Unauthorized content: application/json: schema: - $ref: '../v1beta1/openapi.yaml#/components/schemas/Status' + $ref: '#/components/schemas/Status' "403": description: Forbidden content: application/json: schema: - $ref: '../v1beta1/openapi.yaml#/components/schemas/Status' + $ref: '#/components/schemas/Status' "429": description: Too Many Requests content: application/json: schema: - $ref: '../v1beta1/openapi.yaml#/components/schemas/Status' + $ref: '#/components/schemas/Status' "503": description: Service Unavailable content: application/json: schema: - $ref: '../v1beta1/openapi.yaml#/components/schemas/Status' + $ref: '#/components/schemas/Status' /catalogs: x-resource: catalogs get: @@ -118,6 +122,8 @@ paths: schema: type: integer format: int32 + minimum: 0 + maximum: 1000 responses: "200": description: OK @@ -173,6 +179,35 @@ paths: 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: @@ -230,6 +265,12 @@ paths: application/json: schema: $ref: '#/components/schemas/Catalog' + "400": + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' "401": description: Unauthorized content: @@ -352,6 +393,12 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + "400": + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' "401": description: Unauthorized content: @@ -370,6 +417,12 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + "409": + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Status' "429": description: Too Many Requests content: @@ -470,6 +523,12 @@ paths: application/json: schema: $ref: '#/components/schemas/Catalog' + "400": + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' "401": description: Unauthorized content: @@ -525,6 +584,12 @@ paths: application/json: schema: $ref: '#/components/schemas/Catalog' + "400": + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' "401": description: Unauthorized content: @@ -636,6 +701,7 @@ paths: required: true schema: type: string + example: edge-apps - name: continue in: query description: An optional parameter to query more results from the server. @@ -654,6 +720,8 @@ paths: schema: type: integer format: int32 + minimum: 0 + maximum: 1000 responses: "200": description: OK @@ -709,6 +777,7 @@ paths: required: true schema: type: string + example: edge-apps requestBody: description: The CatalogItem resource to create. required: true @@ -723,6 +792,22 @@ paths: 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: @@ -773,6 +858,7 @@ paths: required: true schema: type: string + example: edge-apps - name: name in: path description: The name of the CatalogItem resource. @@ -786,6 +872,12 @@ paths: application/json: schema: $ref: '#/components/schemas/CatalogItem' + "400": + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' "401": description: Unauthorized content: @@ -822,6 +914,7 @@ paths: required: true schema: type: string + example: edge-apps - name: name in: path description: The name of the CatalogItem resource. @@ -896,6 +989,7 @@ paths: required: true schema: type: string + example: edge-apps - name: name in: path description: The name of the CatalogItem resource. @@ -909,6 +1003,12 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + "400": + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' "401": description: Unauthorized content: @@ -945,6 +1045,7 @@ paths: required: true schema: type: string + example: edge-apps - name: name in: path description: The name of the CatalogItem resource to patch. @@ -1000,215 +1101,774 @@ paths: 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 - # Catalog-specific schemas (shared types come from v1beta1 via external refs) - 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: '../v1beta1/openapi.yaml#/components/schemas/ObjectMeta' - spec: - $ref: '#/components/schemas/CatalogSpec' - status: - $ref: '#/components/schemas/CatalogStatus' - required: - - apiVersion - - kind - - metadata - - spec - 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. - 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: '../v1beta1/openapi.yaml#/components/schemas/Condition' - required: - - conditions - 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: '../v1beta1/openapi.yaml#/components/schemas/ListMeta' - items: - type: array - description: 'List of Catalogs.' - items: - $ref: '#/components/schemas/Catalog' - required: - - apiVersion - - kind - - metadata - - items - CatalogItemMeta: - type: object - description: 'Metadata for CatalogItem resources. Extends ObjectMeta with catalog scoping.' - allOf: - - $ref: '../v1beta1/openapi.yaml#/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 - 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 - CatalogItemArtifactType: - type: string - description: 'Artifact format discriminator. Must be unique within the artifacts list. Includes bootc-image-builder output formats.' - enum: - - container - - qcow2 - - ami - - iso - - anaconda-iso - - vmdk - - vhd - - raw - - gce - x-enum-varnames: - - CatalogItemArtifactTypeContainer - - CatalogItemArtifactTypeQcow2 - - CatalogItemArtifactTypeAmi - - CatalogItemArtifactTypeIso - - CatalogItemArtifactTypeAnacondaIso - - CatalogItemArtifactTypeVmdk - - CatalogItemArtifactTypeVhd - - CatalogItemArtifactTypeRaw - - CatalogItemArtifactTypeGce - 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] + /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-specific schemas (shared types come from v1beta1 via external refs) + 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: '../v1beta1/openapi.yaml#/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: '../v1beta1/openapi.yaml#/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: '../v1beta1/openapi.yaml#/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: '../v1beta1/openapi.yaml#/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 + # Note: No additionalProperties: false here because this schema is used in allOf compositions + # with ObjectMeta. Setting additionalProperties: false would prevent the composition from working + # properly and would reject valid ObjectMeta fields like name, labels, annotations, etc. + 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.' + # Note: No additionalProperties: false here because this schema is used in allOf compositions + # (e.g., CatalogItemVersion) where other schemas add their own properties. Setting + # additionalProperties: false would prevent the composition from working properly. + 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" @@ -1245,6 +1905,7 @@ components: - type - artifacts - versions + additionalProperties: false CatalogItemVersion: type: object description: | @@ -1258,8 +1919,9 @@ components: - type: object properties: version: - type: string - description: 'Semantic version identifier (e.g., 1.2.3, v2.0.0-rc1). Required for version ordering and upgrade graph.' + 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 @@ -1273,20 +1935,23 @@ components: qcow2: "v2.45.0" channels: type: array + minItems: 1 items: type: string description: 'Channels this version belongs to.' replaces: - type: string + allOf: + - $ref: '#/components/schemas/SemVer' description: 'The single version this one replaces, defining the primary upgrade edge.' skips: type: array items: - type: string + $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: - type: string + 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: @@ -1316,6 +1981,7 @@ components: - kind - metadata - items + additionalProperties: false CatalogItemCategory: type: string description: 'Category of a catalog item.' @@ -1363,6 +2029,7 @@ components: example: nginx-plus required: - message + additionalProperties: false Status: type: object properties: @@ -1392,3 +2059,470 @@ components: - 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: '../v1beta1/openapi.yaml#/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: '../v1beta1/openapi.yaml#/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: '../v1beta1/openapi.yaml#/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' diff --git a/api/core/v1beta1/openapi.yaml b/api/core/v1beta1/openapi.yaml index aeed9c5..bfdb256 100644 --- a/api/core/v1beta1/openapi.yaml +++ b/api/core/v1beta1/openapi.yaml @@ -292,6 +292,8 @@ paths: schema: type: integer format: int32 + minimum: 0 + maximum: 1000 responses: "200": description: OK @@ -347,6 +349,19 @@ paths: 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: @@ -404,6 +419,12 @@ paths: application/json: schema: $ref: '#/components/schemas/ResourceSync' + "400": + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' "401": description: Unauthorized content: @@ -593,6 +614,12 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + "400": + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' "401": description: Unauthorized content: @@ -654,6 +681,8 @@ paths: schema: type: integer format: int32 + minimum: 0 + maximum: 1000 responses: "200": description: OK @@ -709,6 +738,24 @@ paths: 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: @@ -766,6 +813,12 @@ paths: application/json: schema: $ref: '#/components/schemas/Repository' + "400": + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' "401": description: Unauthorized content: @@ -888,6 +941,12 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + "400": + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' "401": description: Unauthorized content: @@ -985,6 +1044,136 @@ paths: 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: @@ -1016,12 +1205,22 @@ paths: 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 @@ -1077,6 +1276,39 @@ paths: 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: @@ -1134,6 +1366,12 @@ paths: application/json: schema: $ref: '#/components/schemas/Device' + "400": + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' "401": description: Unauthorized content: @@ -1256,6 +1494,12 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + "400": + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' "401": description: Unauthorized content: @@ -1374,6 +1618,12 @@ paths: application/json: schema: $ref: '#/components/schemas/Device' + "400": + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' "401": description: Unauthorized content: @@ -1583,6 +1833,12 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + "409": + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Status' "429": description: Too Many Requests content: @@ -1625,6 +1881,12 @@ paths: "204": description: No Content content: {} + "400": + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' "401": description: Unauthorized content: @@ -1685,6 +1947,12 @@ paths: "204": description: No Content content: {} + "400": + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' "401": description: Unauthorized content: @@ -1856,6 +2124,8 @@ paths: schema: type: integer format: int32 + minimum: 0 + maximum: 1000 responses: "200": description: OK @@ -1911,6 +2181,31 @@ paths: 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: @@ -1968,6 +2263,12 @@ paths: application/json: schema: $ref: '#/components/schemas/EnrollmentRequest' + "400": + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' "401": description: Unauthorized content: @@ -2157,6 +2458,12 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + "400": + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' "401": description: Unauthorized content: @@ -2214,6 +2521,12 @@ paths: application/json: schema: $ref: '#/components/schemas/EnrollmentRequest' + "400": + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' "401": description: Unauthorized content: @@ -2269,6 +2582,12 @@ paths: application/json: schema: $ref: '#/components/schemas/EnrollmentRequest' + "400": + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' "401": description: Unauthorized content: @@ -2460,6 +2779,8 @@ paths: schema: type: integer format: int32 + minimum: 0 + maximum: 1000 responses: "200": description: OK @@ -2515,6 +2836,23 @@ paths: 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: @@ -2640,6 +2978,12 @@ paths: application/json: schema: $ref: '#/components/schemas/CertificateSigningRequest' + "400": + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' "401": description: Unauthorized content: @@ -2762,6 +3106,12 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + "400": + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' "401": description: Unauthorized content: @@ -2892,6 +3242,8 @@ paths: schema: type: integer format: int32 + minimum: 0 + maximum: 1000 - name: addDevicesSummary in: query description: Include a summary of the devices in the fleet. @@ -2953,6 +3305,31 @@ paths: 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: @@ -3016,6 +3393,12 @@ paths: application/json: schema: $ref: '#/components/schemas/Fleet' + "400": + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' "401": description: Unauthorized content: @@ -3205,6 +3588,12 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + "400": + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' "401": description: Unauthorized content: @@ -3256,6 +3645,12 @@ paths: application/json: schema: $ref: '#/components/schemas/Fleet' + "400": + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' "401": description: Unauthorized content: @@ -3372,6 +3767,12 @@ paths: application/json: schema: $ref: '#/components/schemas/Fleet' + "400": + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' "401": description: Unauthorized content: @@ -3439,6 +3840,8 @@ paths: schema: type: integer format: int32 + minimum: 0 + maximum: 1000 responses: "200": description: OK @@ -3503,6 +3906,12 @@ paths: application/json: schema: $ref: '#/components/schemas/TemplateVersion' + "400": + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' "401": description: Unauthorized content: @@ -3558,6 +3967,12 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + "400": + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' "401": description: Unauthorized content: @@ -3622,6 +4037,8 @@ paths: schema: type: integer format: int32 + minimum: 0 + maximum: 1000 responses: "200": description: OK @@ -3695,9 +4112,12 @@ paths: 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: @@ -3819,6 +4239,8 @@ paths: schema: type: integer format: int32 + minimum: 0 + maximum: 1000 responses: "200": description: OK @@ -3874,6 +4296,19 @@ paths: 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: @@ -3931,6 +4366,12 @@ paths: application/json: schema: $ref: '#/components/schemas/AuthProvider' + "400": + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' "401": description: Unauthorized content: @@ -4120,6 +4561,12 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + "400": + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/Status' "401": description: Unauthorized content: @@ -4271,6 +4718,17 @@ components: - 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. @@ -4308,6 +4766,8 @@ components: properties: url: type: string + minLength: 1 + example: "https://example.com/config" description: 'The HTTP URL to call.' type: type: string @@ -4347,6 +4807,8 @@ components: properties: url: type: string + minLength: 1 + example: "https://github.com/example/repo.git" description: 'The Git repository URL to clone from.' type: type: string @@ -4398,6 +4860,32 @@ components: 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. @@ -4435,6 +4923,11 @@ components: 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 @@ -4512,7 +5005,15 @@ components: - 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. @@ -5291,6 +5792,9 @@ components: x-go-json-ignore: true lifecycle: $ref: '#/components/schemas/DeviceLifecycleStatus' + dependencySync: + $ref: '#/components/schemas/DependencySyncStatus' + additionalProperties: false DeviceLastSeen: type: object description: DeviceLastSeen represents the last seen timestamp of a device. @@ -5733,7 +6237,11 @@ components: type: object additionalProperties: type: string - description: A set of labels to apply to the device. + 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. @@ -5824,6 +6332,21 @@ components: - 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: @@ -5901,6 +6424,17 @@ components: - 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. @@ -5909,12 +6443,19 @@ components: $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 @@ -5987,6 +6528,7 @@ components: - kind - metadata - spec + additionalProperties: false description: Fleet represents a set of devices. FleetList: type: object @@ -6113,8 +6655,10 @@ components: $ref: '#/components/schemas/DeviceSpec' required: - spec + additionalProperties: false required: - template + additionalProperties: false DeviceSpec: type: object description: DeviceSpec describes a device. @@ -6145,6 +6689,7 @@ components: 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\[\]!\-\*\?]+)?$' # SystemD unit pattern supports all allowed formats for unit files and glob searches including templated services maxLength: 256 + additionalProperties: false resources: type: array description: 'Array of resource monitor configurations.' @@ -6157,6 +6702,9 @@ components: $ref: '#/components/schemas/DeviceConsole' decommissioning: $ref: '#/components/schemas/DeviceDecommission' + # Note: No additionalProperties: false here because this schema is used in allOf compositions + # (e.g., TemplateVersionStatus) where other schemas add their own properties. Setting + # additionalProperties: false would prevent the composition from working properly. FleetRolloutStatus: type: object description: FleetRolloutStatus represents information about the status of a fleet rollout. @@ -6164,6 +6712,33 @@ components: 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. @@ -6179,6 +6754,7 @@ components: $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. @@ -6312,6 +6888,7 @@ components: form: grant_type client_id: type: string + minLength: 1 description: OAuth2 client identifier. x-oapi-codegen-extra-tags: form: client_id @@ -6346,6 +6923,7 @@ components: x-oapi-codegen-extra-tags: form: redirect_uri,omitempty description: OAuth2 token request + additionalProperties: false TokenResponse: type: object properties: @@ -6372,6 +6950,7 @@ components: type: string description: OAuth2 error description. description: OAuth2 token response + additionalProperties: false UserInfoResponse: type: object properties: @@ -6393,6 +6972,7 @@ components: type: string description: Error code. description: OIDC UserInfo response + additionalProperties: false ListMeta: type: object properties: @@ -6417,12 +6997,14 @@ components: 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. @@ -6441,6 +7023,7 @@ components: description: ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create. MatchExpression: + type: object properties: key: type: string @@ -6661,6 +7244,7 @@ components: 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 @@ -6692,6 +7276,7 @@ components: - conditions type: object Version: + type: object properties: version: description: Git version of the service. @@ -6754,6 +7339,10 @@ components: - DeviceContentOutOfDate - DeviceContentUpdating - DeviceUpdateFailed + - DeviceVulnerabilityCVECritical + - DeviceVulnerabilityCVEResolved + - DeviceVulnerabilityCVEWarning + - DeviceOSImageChanged - EnrollmentRequestApproved - EnrollmentRequestApprovalFailed - DeviceMultipleOwnersDetected @@ -6781,6 +7370,8 @@ components: - ResourceSyncParsingFailed - ResourceSyncSynced - ResourceSyncSyncFailed + - DependencyChangeDetected + - DependencySyncProbeFailed - SystemRestored message: type: string @@ -6863,6 +7454,9 @@ components: FleetRolloutBatchDispatched: "#/components/schemas/FleetRolloutBatchDispatchedDetails" FleetRolloutBatchCompleted: "#/components/schemas/FleetRolloutBatchCompletedDetails" FleetRolloutDeviceSelected: "#/components/schemas/FleetRolloutDeviceSelectedDetails" + DeviceVulnerabilityCVE: "#/components/schemas/DeviceVulnerabilityCveDetails" + DependencyChangeDetected: "#/components/schemas/DependencyChangeDetectedDetails" + DependencySyncProbeFailed: "#/components/schemas/DependencySyncProbeFailedDetails" oneOf: - $ref: "#/components/schemas/ResourceUpdatedDetails" - $ref: "#/components/schemas/DeviceOwnershipChangedDetails" @@ -6878,6 +7472,32 @@ components: - $ref: "#/components/schemas/FleetRolloutBatchDispatchedDetails" - $ref: "#/components/schemas/FleetRolloutBatchCompletedDetails" - $ref: "#/components/schemas/FleetRolloutDeviceSelectedDetails" + - $ref: "#/components/schemas/DeviceVulnerabilityCveDetails" + - $ref: "#/components/schemas/DependencyChangeDetectedDetails" + - $ref: "#/components/schemas/DependencySyncProbeFailedDetails" + 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: @@ -7150,6 +7770,40 @@ components: 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: @@ -7252,7 +7906,6 @@ components: clientSecret: type: string description: The OIDC client secret. - writeOnly: true enabled: type: boolean description: Whether this OIDC provider is enabled. @@ -7308,7 +7961,6 @@ components: clientSecret: type: string description: The OAuth2 client secret. - writeOnly: true enabled: type: boolean description: Whether this OAuth2 provider is enabled. @@ -7428,7 +8080,6 @@ components: clientSecret: type: string description: The OAuth2 client secret. - writeOnly: true enabled: type: boolean description: Whether this OpenShift provider is enabled. @@ -7447,6 +8098,9 @@ components: 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: @@ -7475,7 +8129,6 @@ components: clientSecret: type: string description: The OAuth2 client secret. - writeOnly: true enabled: type: boolean description: Whether this AAP provider is enabled. @@ -7485,6 +8138,9 @@ components: 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 @@ -7521,11 +8177,12 @@ components: 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 - - organizationAssignment - - roleAssignment AuthOrganizationAssignment: type: object description: AuthOrganizationAssignment defines how users from this auth provider are assigned to organizations. @@ -7689,3 +8346,59 @@ components: 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 + diff --git a/api/imagebuilder/v1alpha1/openapi.yaml b/api/imagebuilder/v1alpha1/openapi.yaml index e34eb61..8752961 100644 --- a/api/imagebuilder/v1alpha1/openapi.yaml +++ b/api/imagebuilder/v1alpha1/openapi.yaml @@ -19,6 +19,8 @@ tags: description: Operations on ImageBuild resources. - name: imageexport description: Operations on ImageExport resources. + - name: imagepromotion + description: Operations on ImagePromotion resources. # Note: Security is handled by Chi middleware (auth.CreateAuthNMiddleware), not OpenAPI validation # The securitySchemes are defined in components for documentation purposes paths: @@ -46,6 +48,8 @@ paths: schema: type: integer format: int32 + minimum: 0 + maximum: 1000 - name: continue in: query description: An optional parameter to query more results from the server. @@ -112,6 +116,35 @@ paths: 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: @@ -175,6 +208,12 @@ paths: application/json: schema: $ref: '#/components/schemas/ImageBuild' + "400": + description: Bad Request. + content: + application/json: + schema: + $ref: '#/components/schemas/Status' "401": description: Unauthorized content: @@ -223,7 +262,13 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ImageBuild' + $ref: '#/components/schemas/Status' + "400": + description: Bad Request. + content: + application/json: + schema: + $ref: '#/components/schemas/Status' "401": description: Unauthorized content: @@ -286,6 +331,12 @@ paths: 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: @@ -379,6 +430,75 @@ paths: 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: @@ -403,6 +523,8 @@ paths: schema: type: integer format: int32 + minimum: 0 + maximum: 1000 - name: continue in: query description: An optional parameter to query more results from the server. @@ -463,6 +585,27 @@ paths: 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: @@ -498,28 +641,418 @@ paths: 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 + $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/ImageExport' + $ref: '#/components/schemas/Status' "401": description: Unauthorized content: @@ -532,8 +1065,8 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - "404": - description: Not Found + "409": + description: Conflict - an ImagePromotion with the given name already exists. content: application/json: schema: @@ -550,15 +1083,17 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - delete: + /api/v1/imagepromotions/{name}: + x-resource: imagepromotions + get: tags: - - imageexport - description: Delete an ImageExport resource. - operationId: deleteImageExport + - imagepromotion + description: Get an ImagePromotion resource. + operationId: getImagePromotion parameters: - name: name in: path - description: The name of the ImageExport resource. + description: The name of the ImagePromotion resource. required: true schema: type: string @@ -568,7 +1103,13 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ImageExport' + $ref: '#/components/schemas/ImagePromotion' + "400": + description: Bad Request. + content: + application/json: + schema: + $ref: '#/components/schemas/Status' "401": description: Unauthorized content: @@ -599,27 +1140,41 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/imageexports/{name}/cancel: - x-resource: imageexports/cancel - post: + put: tags: - - imageexport - description: Cancel a running ImageExport. Only exports in Pending, Converting, or Pushing state can be canceled. - operationId: cancelImageExport + - 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 ImageExport resource to cancel. + 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/ImageExport' + $ref: '#/components/schemas/ImagePromotion' + "201": + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/ImagePromotion' "400": description: Bad Request content: @@ -645,7 +1200,7 @@ paths: schema: $ref: '#/components/schemas/Status' "409": - description: Conflict - Export not in cancelable state + description: Conflict - concurrent update conflict. content: application/json: schema: @@ -662,40 +1217,35 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/imageexports/{name}/download: - x-resource: imageexports/download - get: + patch: tags: - - imageexport - description: Download an ImageExport artifact from the registry. - operationId: downloadImageExport + - 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 ImageExport resource. + description: The name of the ImagePromotion resource. required: true schema: type: string + requestBody: + content: + application/json-patch+json: + schema: + $ref: '../../core/v1beta1/openapi.yaml#/components/schemas/PatchRequest' + required: true responses: "200": - description: OK - Artifact blob content + description: OK 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: + application/json: schema: - type: string + $ref: '#/components/schemas/ImagePromotion' "400": description: Bad Request content: @@ -720,14 +1270,14 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - "429": - description: Too Many Requests + "409": + description: Conflict content: application/json: schema: $ref: '#/components/schemas/Status' - "500": - description: Internal Server Error + "429": + description: Too Many Requests content: application/json: schema: @@ -738,38 +1288,31 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/imageexports/{name}/log: - x-resource: imageexports/log - get: + delete: tags: - - imageexport - description: Get logs for an ImageExport resource. For active exports, streams logs live. For completed exports, returns last 500 lines. - operationId: getImageExportLog + - imagepromotion + description: Delete an ImagePromotion resource. + operationId: deleteImagePromotion parameters: - name: name in: path - description: The name of the ImageExport resource. + description: The name of the ImagePromotion 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: + application/json: schema: - type: string - description: Log output as plain text (when follow=false or for completed exports) - text/event-stream: + $ref: '#/components/schemas/Status' + "400": + description: Bad Request. + content: + application/json: schema: - type: string - description: Log output as Server-Sent Events stream (when follow=true for active exports) + $ref: '#/components/schemas/Status' "401": description: Unauthorized content: @@ -788,6 +1331,12 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + "409": + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Status' "429": description: Too Many Requests content: @@ -819,7 +1368,7 @@ components: - ApiVersionFlightctlIoV1alpha1 ResourceKind: type: string - enum: [ImageBuild, ImageExport] + enum: [ImageBuild, ImageExport, ImagePromotion] description: Resource types exposed via the ImageBuilder API. ImageBuild: type: object @@ -846,6 +1395,23 @@ components: - 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 @@ -885,6 +1451,7 @@ components: - source - destination - binding + additionalProperties: false ImageBuildSource: type: object @@ -892,12 +1459,18 @@ components: 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 @@ -910,12 +1483,18 @@ components: 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 @@ -1026,6 +1605,7 @@ components: - Pending - Building - Pushing + - GeneratingSBOM - Completed - Failed - Canceling @@ -1034,6 +1614,7 @@ components: - ImageBuildConditionReasonPending - ImageBuildConditionReasonBuilding - ImageBuildConditionReasonPushing + - ImageBuildConditionReasonGeneratingSBOM - ImageBuildConditionReasonCompleted - ImageBuildConditionReasonFailed - ImageBuildConditionReasonCanceling @@ -1059,6 +1640,17 @@ components: - 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 @@ -1093,6 +1685,7 @@ components: required: - source - format + additionalProperties: false ImageExportSource: description: ImageExportSource specifies the source image for the export. @@ -1116,6 +1709,7 @@ components: description: The type of source. imageBuildRef: type: string + minLength: 1 description: The name of the ImageBuild resource to use as source. ImageExportSourceType: @@ -1238,3 +1832,306 @@ components: - 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: '../../core/v1beta1/openapi.yaml#/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: '../../core/v1beta1/openapi.yaml#/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: '../../core/v1beta1/openapi.yaml#/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 + + diff --git a/docs/AapProviderSpec.md b/docs/AapProviderSpec.md index e1a462a..0c4d4dd 100644 --- a/docs/AapProviderSpec.md +++ b/docs/AapProviderSpec.md @@ -15,6 +15,7 @@ Name | Type | Description | Notes **client_secret** | **str** | The OAuth2 client secret. | **enabled** | **bool** | Whether this AAP provider is enabled. | [optional] [default to True] **scopes** | **List[str]** | List of OAuth2 scopes to request. | +**organization_name_prefix** | **str** | Optional prefix for AAP organization names. Incoming names are exposed as prefix + name. | [optional] ## Example diff --git a/docs/AuthProviderSpec.md b/docs/AuthProviderSpec.md index a82df82..a137999 100644 --- a/docs/AuthProviderSpec.md +++ b/docs/AuthProviderSpec.md @@ -22,6 +22,7 @@ Name | Type | Description | Notes **cluster_control_plane_url** | **str** | The OpenShift cluster control plane URL. | [optional] **project_label_filter** | **str** | 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. | [optional] **role_suffix** | **str** | 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-<namespace>). | [optional] +**organization_name_prefix** | **str** | Optional prefix for the organization name. The default org name is exposed as prefix + 'default' when set. | [optional] **api_url** | **str** | The internal Kubernetes API URL. | **rbac_ns** | **str** | The RBAC namespace for permissions. | [optional] diff --git a/docs/AuthproviderApi.md b/docs/AuthproviderApi.md index d3f65bb..7ab454c 100644 --- a/docs/AuthproviderApi.md +++ b/docs/AuthproviderApi.md @@ -145,6 +145,7 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | +**400** | Bad Request | - | **401** | Unauthorized | - | **403** | Forbidden | - | **404** | Not Found | - | @@ -215,6 +216,7 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | +**400** | Bad Request | - | **401** | Unauthorized | - | **403** | Forbidden | - | **404** | Not Found | - | diff --git a/docs/BaseImageEntry.md b/docs/BaseImageEntry.md new file mode 100644 index 0000000..21a8127 --- /dev/null +++ b/docs/BaseImageEntry.md @@ -0,0 +1,32 @@ +# BaseImageEntry + +A curated base image entry available in an OCI registry. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**display_name** | **str** | Human-readable label shown in the UI (e.g., \"CentOS\"). | [optional] +**image_name** | **str** | Image path within the registry (e.g., \"centos-bootc/centos-bootc\"). | +**tags** | **List[str]** | Selectable tags for this image (e.g., [\"stream9\", \"stream10\"]). | + +## Example + +```python +from flightctl.models.base_image_entry import BaseImageEntry + +# TODO update the JSON string below +json = "{}" +# create an instance of BaseImageEntry from a JSON string +base_image_entry_instance = BaseImageEntry.from_json(json) +# print the JSON string representation of the object +print(BaseImageEntry.to_json()) + +# convert the object into a dict +base_image_entry_dict = base_image_entry_instance.to_dict() +# create an instance of BaseImageEntry from a dict +base_image_entry_from_dict = BaseImageEntry.from_dict(base_image_entry_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/CertificatesigningrequestApi.md b/docs/CertificatesigningrequestApi.md index 10827b4..cc18004 100644 --- a/docs/CertificatesigningrequestApi.md +++ b/docs/CertificatesigningrequestApi.md @@ -146,6 +146,7 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | +**400** | Bad Request | - | **401** | Unauthorized | - | **403** | Forbidden | - | **404** | Not Found | - | @@ -216,6 +217,7 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | +**400** | Bad Request | - | **401** | Unauthorized | - | **403** | Forbidden | - | **404** | Not Found | - | diff --git a/docs/CheckRepositoryOciImageRequest.md b/docs/CheckRepositoryOciImageRequest.md new file mode 100644 index 0000000..24c3c75 --- /dev/null +++ b/docs/CheckRepositoryOciImageRequest.md @@ -0,0 +1,30 @@ +# CheckRepositoryOciImageRequest + +Request to check if a specific OCI image is accessible in a registry. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**image_name** | **str** | 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\"). | + +## Example + +```python +from flightctl.models.check_repository_oci_image_request import CheckRepositoryOciImageRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of CheckRepositoryOciImageRequest from a JSON string +check_repository_oci_image_request_instance = CheckRepositoryOciImageRequest.from_json(json) +# print the JSON string representation of the object +print(CheckRepositoryOciImageRequest.to_json()) + +# convert the object into a dict +check_repository_oci_image_request_dict = check_repository_oci_image_request_instance.to_dict() +# create an instance of CheckRepositoryOciImageRequest from a dict +check_repository_oci_image_request_from_dict = CheckRepositoryOciImageRequest.from_dict(check_repository_oci_image_request_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/CheckRepositoryOciResult.md b/docs/CheckRepositoryOciResult.md new file mode 100644 index 0000000..ff558b3 --- /dev/null +++ b/docs/CheckRepositoryOciResult.md @@ -0,0 +1,32 @@ +# CheckRepositoryOciResult + +Result of an OCI registry check (tag existence or image accessibility). + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**accessible** | **bool** | Whether the image or tag is accessible in the registry. | +**error_code** | **int** | 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). | [optional] +**error_message** | **str** | Error message describing why the image or tag is not accessible. | [optional] + +## Example + +```python +from flightctl.models.check_repository_oci_result import CheckRepositoryOciResult + +# TODO update the JSON string below +json = "{}" +# create an instance of CheckRepositoryOciResult from a JSON string +check_repository_oci_result_instance = CheckRepositoryOciResult.from_json(json) +# print the JSON string representation of the object +print(CheckRepositoryOciResult.to_json()) + +# convert the object into a dict +check_repository_oci_result_dict = check_repository_oci_result_instance.to_dict() +# create an instance of CheckRepositoryOciResult from a dict +check_repository_oci_result_from_dict = CheckRepositoryOciResult.from_dict(check_repository_oci_result_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/CheckRepositoryOciTagRequest.md b/docs/CheckRepositoryOciTagRequest.md new file mode 100644 index 0000000..8ed620b --- /dev/null +++ b/docs/CheckRepositoryOciTagRequest.md @@ -0,0 +1,31 @@ +# CheckRepositoryOciTagRequest + +Request to check if a specific image tag exists in an OCI registry. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**image_name** | **str** | 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\"). | +**tag** | **str** | The image tag to check for existence (e.g. \"9.5\"). | + +## Example + +```python +from flightctl.models.check_repository_oci_tag_request import CheckRepositoryOciTagRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of CheckRepositoryOciTagRequest from a JSON string +check_repository_oci_tag_request_instance = CheckRepositoryOciTagRequest.from_json(json) +# print the JSON string representation of the object +print(CheckRepositoryOciTagRequest.to_json()) + +# convert the object into a dict +check_repository_oci_tag_request_dict = check_repository_oci_tag_request_instance.to_dict() +# create an instance of CheckRepositoryOciTagRequest from a dict +check_repository_oci_tag_request_from_dict = CheckRepositoryOciTagRequest.from_dict(check_repository_oci_tag_request_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/DependencyChangeDetectedDetails.md b/docs/DependencyChangeDetectedDetails.md new file mode 100644 index 0000000..1520c2c --- /dev/null +++ b/docs/DependencyChangeDetectedDetails.md @@ -0,0 +1,31 @@ +# DependencyChangeDetectedDetails + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**detail_type** | **str** | The type of detail for discriminator purposes. | +**resource_key** | **str** | The resource key identifying the dependency that changed (e.g. \"git:my-repo/main\"). | +**fingerprint** | **str** | The new fingerprint (e.g. commit SHA) of the changed dependency. | + +## Example + +```python +from flightctl.models.dependency_change_detected_details import DependencyChangeDetectedDetails + +# TODO update the JSON string below +json = "{}" +# create an instance of DependencyChangeDetectedDetails from a JSON string +dependency_change_detected_details_instance = DependencyChangeDetectedDetails.from_json(json) +# print the JSON string representation of the object +print(DependencyChangeDetectedDetails.to_json()) + +# convert the object into a dict +dependency_change_detected_details_dict = dependency_change_detected_details_instance.to_dict() +# create an instance of DependencyChangeDetectedDetails from a dict +dependency_change_detected_details_from_dict = DependencyChangeDetectedDetails.from_dict(dependency_change_detected_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/DependencySyncConfigRefStatus.md b/docs/DependencySyncConfigRefStatus.md new file mode 100644 index 0000000..4c8accc --- /dev/null +++ b/docs/DependencySyncConfigRefStatus.md @@ -0,0 +1,32 @@ +# DependencySyncConfigRefStatus + +DependencySyncConfigRefStatus represents the rendered fingerprint for a single config provider's external dependency. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**config_provider_name** | **str** | The name of the config provider (e.g. the git or HTTP config source name). | +**fingerprint** | **str** | The fingerprint of the rendered content (e.g. git commit SHA, sha256 of HTTP body, K8s secret ResourceVersion). | [optional] +**last_updated_at** | **datetime** | The last time the fingerprint changed (i.e. the dependency content was updated). | [optional] + +## Example + +```python +from flightctl.models.dependency_sync_config_ref_status import DependencySyncConfigRefStatus + +# TODO update the JSON string below +json = "{}" +# create an instance of DependencySyncConfigRefStatus from a JSON string +dependency_sync_config_ref_status_instance = DependencySyncConfigRefStatus.from_json(json) +# print the JSON string representation of the object +print(DependencySyncConfigRefStatus.to_json()) + +# convert the object into a dict +dependency_sync_config_ref_status_dict = dependency_sync_config_ref_status_instance.to_dict() +# create an instance of DependencySyncConfigRefStatus from a dict +dependency_sync_config_ref_status_from_dict = DependencySyncConfigRefStatus.from_dict(dependency_sync_config_ref_status_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/DependencySyncProbeFailedDetails.md b/docs/DependencySyncProbeFailedDetails.md new file mode 100644 index 0000000..69bc422 --- /dev/null +++ b/docs/DependencySyncProbeFailedDetails.md @@ -0,0 +1,31 @@ +# DependencySyncProbeFailedDetails + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**detail_type** | **str** | The type of detail for discriminator purposes. | +**resource_key** | **str** | The resource key identifying the dependency that failed (e.g. \"git:my-repo/main\"). | +**error** | **str** | The error message from the failed probe. | + +## Example + +```python +from flightctl.models.dependency_sync_probe_failed_details import DependencySyncProbeFailedDetails + +# TODO update the JSON string below +json = "{}" +# create an instance of DependencySyncProbeFailedDetails from a JSON string +dependency_sync_probe_failed_details_instance = DependencySyncProbeFailedDetails.from_json(json) +# print the JSON string representation of the object +print(DependencySyncProbeFailedDetails.to_json()) + +# convert the object into a dict +dependency_sync_probe_failed_details_dict = dependency_sync_probe_failed_details_instance.to_dict() +# create an instance of DependencySyncProbeFailedDetails from a dict +dependency_sync_probe_failed_details_from_dict = DependencySyncProbeFailedDetails.from_dict(dependency_sync_probe_failed_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/DependencySyncStatus.md b/docs/DependencySyncStatus.md new file mode 100644 index 0000000..0123d42 --- /dev/null +++ b/docs/DependencySyncStatus.md @@ -0,0 +1,30 @@ +# DependencySyncStatus + +DependencySyncStatus represents the synchronization fingerprints for external dependencies of a device, captured at render time. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**config_refs** | [**List[DependencySyncConfigRefStatus]**](DependencySyncConfigRefStatus.md) | Per-config-provider fingerprint and last update time, set when the device renders. | [optional] + +## Example + +```python +from flightctl.models.dependency_sync_status import DependencySyncStatus + +# TODO update the JSON string below +json = "{}" +# create an instance of DependencySyncStatus from a JSON string +dependency_sync_status_instance = DependencySyncStatus.from_json(json) +# print the JSON string representation of the object +print(DependencySyncStatus.to_json()) + +# convert the object into a dict +dependency_sync_status_dict = dependency_sync_status_instance.to_dict() +# create an instance of DependencySyncStatus from a dict +dependency_sync_status_from_dict = DependencySyncStatus.from_dict(dependency_sync_status_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/DeviceApi.md b/docs/DeviceApi.md index dcd999d..e867682 100644 --- a/docs/DeviceApi.md +++ b/docs/DeviceApi.md @@ -158,6 +158,7 @@ No authorization required **401** | Unauthorized | - | **403** | Forbidden | - | **404** | Not Found | - | +**409** | Conflict | - | **429** | Too Many Requests | - | **503** | Service Unavailable | - | @@ -225,6 +226,7 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | +**400** | Bad Request | - | **401** | Unauthorized | - | **403** | Forbidden | - | **404** | Not Found | - | @@ -295,6 +297,7 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | +**400** | Bad Request | - | **401** | Unauthorized | - | **403** | Forbidden | - | **404** | Not Found | - | @@ -366,6 +369,7 @@ No authorization required |-------------|-------------|------------------| **200** | OK | - | **204** | No Content | - | +**400** | Bad Request | - | **401** | Unauthorized | - | **403** | Forbidden | - | **404** | Not Found | - | @@ -436,6 +440,7 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | +**400** | Bad Request | - | **401** | Unauthorized | - | **403** | Forbidden | - | **404** | Not Found | - | @@ -509,6 +514,7 @@ No authorization required |-------------|-------------|------------------| **200** | OK | - | **204** | No Content | - | +**400** | Bad Request | - | **401** | Unauthorized | - | **403** | Forbidden | - | **404** | Not Found | - | @@ -519,7 +525,7 @@ 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) # **list_devices** -> DeviceList list_devices(var_continue=var_continue, label_selector=label_selector, field_selector=field_selector, limit=limit, summary_only=summary_only) +> DeviceList list_devices(var_continue=var_continue, label_selector=label_selector, field_selector=field_selector, limit=limit, summary_only=summary_only, cve_id=cve_id) List Device resources. @@ -548,9 +554,10 @@ with flightctl.ApiClient(configuration) as api_client: field_selector = 'field_selector_example' # str | A selector to restrict the list of returned objects by their fields, supporting operators like '=', '==', and '!=' (e.g., \"key1=value1,key2!=value2\"). (optional) limit = 56 # int | The maximum number of results returned in the list response. The server will set the 'continue' field in the list response if more results exist. The continue value may then be specified as parameter in a subsequent query. (optional) summary_only = True # bool | A boolean flag to include only a summary of the devices. When set to true, the response will contain only the summary information. Only the 'owner' and 'labelSelector' parameters are supported when 'summaryOnly' is true. (optional) + cve_id = 'cve_id_example' # str | 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). (optional) try: - api_response = api_instance.list_devices(var_continue=var_continue, label_selector=label_selector, field_selector=field_selector, limit=limit, summary_only=summary_only) + api_response = api_instance.list_devices(var_continue=var_continue, label_selector=label_selector, field_selector=field_selector, limit=limit, summary_only=summary_only, cve_id=cve_id) print("The response of DeviceApi->list_devices:\n") pprint(api_response) except Exception as e: @@ -569,6 +576,7 @@ Name | Type | Description | Notes **field_selector** | **str**| A selector to restrict the list of returned objects by their fields, supporting operators like '=', '==', and '!=' (e.g., \"key1=value1,key2!=value2\"). | [optional] **limit** | **int**| The maximum number of results returned in the list response. The server will set the 'continue' field in the list response if more results exist. The continue value may then be specified as parameter in a subsequent query. | [optional] **summary_only** | **bool**| A boolean flag to include only a summary of the devices. When set to true, the response will contain only the summary information. Only the 'owner' and 'labelSelector' parameters are supported when 'summaryOnly' is true. | [optional] + **cve_id** | **str**| 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). | [optional] ### Return type diff --git a/docs/DeviceStatus.md b/docs/DeviceStatus.md index 1302d12..f3bf395 100644 --- a/docs/DeviceStatus.md +++ b/docs/DeviceStatus.md @@ -19,6 +19,7 @@ Name | Type | Description | Notes **summary** | [**DeviceSummaryStatus**](DeviceSummaryStatus.md) | | **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] ## Example diff --git a/docs/DeviceVulnerabilityCveDetails.md b/docs/DeviceVulnerabilityCveDetails.md new file mode 100644 index 0000000..cc49c55 --- /dev/null +++ b/docs/DeviceVulnerabilityCveDetails.md @@ -0,0 +1,33 @@ +# DeviceVulnerabilityCveDetails + +Structured details for per-device CVE vulnerability events. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**detail_type** | **str** | The type of detail for discriminator purposes. | +**cve_id** | **str** | CVE identifier (e.g. CVE-2024-1234). MITRE-style CVE-YYYY-sequence identifier, matching device list filter validation. | +**first_image_ref** | **str** | Human-readable OS image reference when the CVE was first detected on this device (historical/audit field). | [optional] +**first_image_digest** | **str** | Image digest when the CVE was first detected on this device (historical/audit field, e.g. sha256:...). | [optional] + +## Example + +```python +from flightctl.models.device_vulnerability_cve_details import DeviceVulnerabilityCveDetails + +# TODO update the JSON string below +json = "{}" +# create an instance of DeviceVulnerabilityCveDetails from a JSON string +device_vulnerability_cve_details_instance = DeviceVulnerabilityCveDetails.from_json(json) +# print the JSON string representation of the object +print(DeviceVulnerabilityCveDetails.to_json()) + +# convert the object into a dict +device_vulnerability_cve_details_dict = device_vulnerability_cve_details_instance.to_dict() +# create an instance of DeviceVulnerabilityCveDetails from a dict +device_vulnerability_cve_details_from_dict = DeviceVulnerabilityCveDetails.from_dict(device_vulnerability_cve_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/EnrollmentRequestApproval.md b/docs/EnrollmentRequestApproval.md index a5a0704..1f9680f 100644 --- a/docs/EnrollmentRequestApproval.md +++ b/docs/EnrollmentRequestApproval.md @@ -6,7 +6,8 @@ EnrollmentRequestApproval contains information about the approval of a device en Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**labels** | **Dict[str, str]** | A set of labels to apply to the device. | [optional] +**labels** | **Dict[str, str]** | 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. | [optional] +**replace_labels** | **bool** | 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. | [optional] [default to False] **approved** | **bool** | Indicates whether the request has been approved. | ## Example diff --git a/docs/EnrollmentRequestApprovalStatus.md b/docs/EnrollmentRequestApprovalStatus.md index d8c19ae..c6102e9 100644 --- a/docs/EnrollmentRequestApprovalStatus.md +++ b/docs/EnrollmentRequestApprovalStatus.md @@ -6,7 +6,8 @@ EnrollmentRequestApprovalStatus represents information about the status of a dev Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**labels** | **Dict[str, str]** | A set of labels to apply to the device. | [optional] +**labels** | **Dict[str, str]** | 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. | [optional] +**replace_labels** | **bool** | 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. | [optional] [default to False] **approved** | **bool** | Indicates whether the request has been approved. | **approved_by** | **str** | The name of the approver. | **approved_at** | **datetime** | The time at which the request was approved. | diff --git a/docs/EnrollmentrequestApi.md b/docs/EnrollmentrequestApi.md index e0355db..5ada52d 100644 --- a/docs/EnrollmentrequestApi.md +++ b/docs/EnrollmentrequestApi.md @@ -224,6 +224,7 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | +**400** | Bad Request | - | **401** | Unauthorized | - | **403** | Forbidden | - | **404** | Not Found | - | @@ -366,6 +367,7 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | +**400** | Bad Request | - | **401** | Unauthorized | - | **403** | Forbidden | - | **404** | Not Found | - | @@ -436,6 +438,7 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | +**400** | Bad Request | - | **401** | Unauthorized | - | **403** | Forbidden | - | **404** | Not Found | - | @@ -809,6 +812,7 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | +**400** | Bad Request | - | **401** | Unauthorized | - | **403** | Forbidden | - | **404** | Not Found | - | diff --git a/docs/EventDetails.md b/docs/EventDetails.md index 42eafe2..bd78b7e 100644 --- a/docs/EventDetails.md +++ b/docs/EventDetails.md @@ -30,6 +30,12 @@ Name | Type | Description | Notes **failed** | **int** | The number of failed devices in the batch. | **timed_out** | **int** | The number of timed out devices in the batch. | **fleet_name** | **str** | The name of the fleet that the device is being selected for. | +**cve_id** | **str** | CVE identifier (e.g. CVE-2024-1234). MITRE-style CVE-YYYY-sequence identifier, matching device list filter validation. | +**first_image_ref** | **str** | Human-readable OS image reference when the CVE was first detected on this device (historical/audit field). | [optional] +**first_image_digest** | **str** | Image digest when the CVE was first detected on this device (historical/audit field, e.g. sha256:...). | [optional] +**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. | ## Example diff --git a/docs/FleetApi.md b/docs/FleetApi.md index a34539d..9bd4b9c 100644 --- a/docs/FleetApi.md +++ b/docs/FleetApi.md @@ -151,6 +151,7 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | +**400** | Bad Request | - | **401** | Unauthorized | - | **403** | Forbidden | - | **404** | Not Found | - | @@ -223,6 +224,7 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | +**400** | Bad Request | - | **401** | Unauthorized | - | **403** | Forbidden | - | **404** | Not Found | - | @@ -295,6 +297,7 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | +**400** | Bad Request | - | **401** | Unauthorized | - | **403** | Forbidden | - | **404** | Not Found | - | @@ -365,6 +368,7 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | +**400** | Bad Request | - | **401** | Unauthorized | - | **403** | Forbidden | - | **404** | Not Found | - | @@ -437,6 +441,7 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | +**400** | Bad Request | - | **401** | Unauthorized | - | **403** | Forbidden | - | **404** | Not Found | - | @@ -889,6 +894,7 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | +**400** | Bad Request | - | **401** | Unauthorized | - | **403** | Forbidden | - | **404** | Not Found | - | diff --git a/docs/K8sProviderSpec.md b/docs/K8sProviderSpec.md index 2683d3f..b72e091 100644 --- a/docs/K8sProviderSpec.md +++ b/docs/K8sProviderSpec.md @@ -11,9 +11,10 @@ Name | Type | Description | Notes **api_url** | **str** | The internal Kubernetes API URL. | **rbac_ns** | **str** | The RBAC namespace for permissions. | [optional] **enabled** | **bool** | Whether this K8s provider is enabled. | [optional] [default to True] -**organization_assignment** | [**AuthOrganizationAssignment**](AuthOrganizationAssignment.md) | | -**role_assignment** | [**AuthRoleAssignment**](AuthRoleAssignment.md) | | +**organization_assignment** | [**AuthOrganizationAssignment**](AuthOrganizationAssignment.md) | | [optional] +**role_assignment** | [**AuthRoleAssignment**](AuthRoleAssignment.md) | | [optional] **role_suffix** | **str** | 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-<namespace>). | [optional] +**organization_name_prefix** | **str** | Optional prefix for the organization name. The default org name is exposed as prefix + 'default' when set. | [optional] ## Example diff --git a/docs/OciRepoSpec.md b/docs/OciRepoSpec.md index 586fe20..e098c69 100644 --- a/docs/OciRepoSpec.md +++ b/docs/OciRepoSpec.md @@ -13,6 +13,7 @@ Name | Type | Description | Notes **oci_auth** | [**DockerAuth**](DockerAuth.md) | | [optional] **ca_crt** | **str** | Base64 encoded root CA. | [optional] **skip_server_verification** | **bool** | Skip remote server verification. | [optional] +**base_images** | [**List[BaseImageEntry]**](BaseImageEntry.md) | Curated list of trusted base images available in this registry. When present, the Image Builder source picker surfaces these entries as selectable options. | [optional] ## Example diff --git a/docs/OpenShiftProviderSpec.md b/docs/OpenShiftProviderSpec.md index a215e83..9e3b440 100644 --- a/docs/OpenShiftProviderSpec.md +++ b/docs/OpenShiftProviderSpec.md @@ -18,6 +18,7 @@ Name | Type | Description | Notes **cluster_control_plane_url** | **str** | The OpenShift cluster control plane URL. | [optional] **project_label_filter** | **str** | 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. | [optional] **role_suffix** | **str** | 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-<namespace>). | [optional] +**organization_name_prefix** | **str** | Optional prefix for organization (project) names. Incoming names are exposed as prefix + name (e.g. 'ocp-' + project). | [optional] ## Example diff --git a/docs/RepositoryApi.md b/docs/RepositoryApi.md index 9125310..dad86ce 100644 --- a/docs/RepositoryApi.md +++ b/docs/RepositoryApi.md @@ -4,6 +4,8 @@ All URIs are relative to */api/v1* Method | HTTP request | Description ------------- | ------------- | ------------- +[**check_repository_oci_image**](RepositoryApi.md#check_repository_oci_image) | **POST** /repositories/{name}/check-oci-image | +[**check_repository_oci_tag**](RepositoryApi.md#check_repository_oci_tag) | **POST** /repositories/{name}/check-oci-tag | [**create_repository**](RepositoryApi.md#create_repository) | **POST** /repositories | [**delete_repository**](RepositoryApi.md#delete_repository) | **DELETE** /repositories/{name} | [**get_repository**](RepositoryApi.md#get_repository) | **GET** /repositories/{name} | @@ -12,6 +14,156 @@ Method | HTTP request | Description [**replace_repository**](RepositoryApi.md#replace_repository) | **PUT** /repositories/{name} | +# **check_repository_oci_image** +> CheckRepositoryOciResult check_repository_oci_image(name, check_repository_oci_image_request) + +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. + + +### Example + + +```python +import flightctl +from flightctl.models.check_repository_oci_image_request import CheckRepositoryOciImageRequest +from flightctl.models.check_repository_oci_result import CheckRepositoryOciResult +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.RepositoryApi(api_client) + name = 'name_example' # str | The name of the Repository resource to use for registry connection. + check_repository_oci_image_request = flightctl.CheckRepositoryOciImageRequest() # CheckRepositoryOciImageRequest | + + try: + api_response = api_instance.check_repository_oci_image(name, check_repository_oci_image_request) + print("The response of RepositoryApi->check_repository_oci_image:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling RepositoryApi->check_repository_oci_image: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **str**| The name of the Repository resource to use for registry connection. | + **check_repository_oci_image_request** | [**CheckRepositoryOciImageRequest**](CheckRepositoryOciImageRequest.md)| | + +### Return type + +[**CheckRepositoryOciResult**](CheckRepositoryOciResult.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found - Repository resource does not exist | - | +**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) + +# **check_repository_oci_tag** +> CheckRepositoryOciResult check_repository_oci_tag(name, check_repository_oci_tag_request) + +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. + + +### Example + + +```python +import flightctl +from flightctl.models.check_repository_oci_result import CheckRepositoryOciResult +from flightctl.models.check_repository_oci_tag_request import CheckRepositoryOciTagRequest +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.RepositoryApi(api_client) + name = 'name_example' # str | The name of the Repository resource to use for registry connection. + check_repository_oci_tag_request = flightctl.CheckRepositoryOciTagRequest() # CheckRepositoryOciTagRequest | + + try: + api_response = api_instance.check_repository_oci_tag(name, check_repository_oci_tag_request) + print("The response of RepositoryApi->check_repository_oci_tag:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling RepositoryApi->check_repository_oci_tag: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **str**| The name of the Repository resource to use for registry connection. | + **check_repository_oci_tag_request** | [**CheckRepositoryOciTagRequest**](CheckRepositoryOciTagRequest.md)| | + +### Return type + +[**CheckRepositoryOciResult**](CheckRepositoryOciResult.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found - Repository resource does not exist | - | +**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) + # **create_repository** > Repository create_repository(repository) @@ -145,6 +297,7 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | +**400** | Bad Request | - | **401** | Unauthorized | - | **403** | Forbidden | - | **404** | Not Found | - | @@ -215,6 +368,7 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | +**400** | Bad Request | - | **401** | Unauthorized | - | **403** | Forbidden | - | **404** | Not Found | - | diff --git a/docs/RepositorySpec.md b/docs/RepositorySpec.md index 5de54c2..32c6991 100644 --- a/docs/RepositorySpec.md +++ b/docs/RepositorySpec.md @@ -17,6 +17,7 @@ Name | Type | Description | Notes **oci_auth** | [**DockerAuth**](DockerAuth.md) | | [optional] **ca_crt** | **str** | Base64 encoded root CA. | [optional] **skip_server_verification** | **bool** | Skip remote server verification. | [optional] +**base_images** | [**List[BaseImageEntry]**](BaseImageEntry.md) | Curated list of trusted base images available in this registry. When present, the Image Builder source picker surfaces these entries as selectable options. | [optional] ## Example diff --git a/docs/ResourcesyncApi.md b/docs/ResourcesyncApi.md index f30d95c..64c42dc 100644 --- a/docs/ResourcesyncApi.md +++ b/docs/ResourcesyncApi.md @@ -145,6 +145,7 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | +**400** | Bad Request | - | **401** | Unauthorized | - | **403** | Forbidden | - | **404** | Not Found | - | @@ -215,6 +216,7 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | +**400** | Bad Request | - | **401** | Unauthorized | - | **403** | Forbidden | - | **404** | Not Found | - | diff --git a/flightctl/api/authprovider_api.py b/flightctl/api/authprovider_api.py index 651e8e5..0e913a8 100644 --- a/flightctl/api/authprovider_api.py +++ b/flightctl/api/authprovider_api.py @@ -17,7 +17,7 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt, StrictStr +from pydantic import Field, StrictStr from typing import List, Optional from typing_extensions import Annotated from flightctl.models.auth_provider import AuthProvider @@ -389,6 +389,7 @@ def delete_auth_provider( _response_types_map: Dict[str, Optional[str]] = { '200': "Status", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -461,6 +462,7 @@ def delete_auth_provider_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "Status", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -533,6 +535,7 @@ def delete_auth_provider_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "Status", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -664,6 +667,7 @@ def get_auth_provider( _response_types_map: Dict[str, Optional[str]] = { '200': "AuthProvider", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -736,6 +740,7 @@ def get_auth_provider_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "AuthProvider", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -808,6 +813,7 @@ def get_auth_provider_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "AuthProvider", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -890,7 +896,7 @@ def list_auth_providers( 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[StrictInt], 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, + 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)], @@ -974,7 +980,7 @@ def list_auth_providers_with_http_info( 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[StrictInt], 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, + 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)], @@ -1058,7 +1064,7 @@ def list_auth_providers_without_preload_content( 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[StrictInt], 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, + 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)], diff --git a/flightctl/api/certificatesigningrequest_api.py b/flightctl/api/certificatesigningrequest_api.py index bff68e3..d8aa56e 100644 --- a/flightctl/api/certificatesigningrequest_api.py +++ b/flightctl/api/certificatesigningrequest_api.py @@ -17,7 +17,7 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt, StrictStr +from pydantic import Field, StrictStr from typing import List, Optional from typing_extensions import Annotated from flightctl.models.certificate_signing_request import CertificateSigningRequest @@ -389,6 +389,7 @@ def delete_certificate_signing_request( _response_types_map: Dict[str, Optional[str]] = { '200': "Status", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -461,6 +462,7 @@ def delete_certificate_signing_request_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "Status", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -533,6 +535,7 @@ def delete_certificate_signing_request_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "Status", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -664,6 +667,7 @@ def get_certificate_signing_request( _response_types_map: Dict[str, Optional[str]] = { '200': "CertificateSigningRequest", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -736,6 +740,7 @@ def get_certificate_signing_request_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "CertificateSigningRequest", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -808,6 +813,7 @@ def get_certificate_signing_request_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "CertificateSigningRequest", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -890,7 +896,7 @@ def list_certificate_signing_requests( 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[StrictInt], 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, + 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)], @@ -974,7 +980,7 @@ def list_certificate_signing_requests_with_http_info( 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[StrictInt], 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, + 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)], @@ -1058,7 +1064,7 @@ def list_certificate_signing_requests_without_preload_content( 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[StrictInt], 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, + 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)], diff --git a/flightctl/api/device_api.py b/flightctl/api/device_api.py index d1b5754..43cecd3 100644 --- a/flightctl/api/device_api.py +++ b/flightctl/api/device_api.py @@ -17,7 +17,7 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictBool, StrictInt, StrictStr +from pydantic import Field, StrictBool, StrictStr, field_validator from typing import List, Optional from typing_extensions import Annotated from flightctl.models.device import Device @@ -399,6 +399,7 @@ def decommission_device( '401': "Status", '403': "Status", '404': "Status", + '409': "Status", '429': "Status", '503': "Status", } @@ -476,6 +477,7 @@ def decommission_device_with_http_info( '401': "Status", '403': "Status", '404': "Status", + '409': "Status", '429': "Status", '503': "Status", } @@ -553,6 +555,7 @@ def decommission_device_without_preload_content( '401': "Status", '403': "Status", '404': "Status", + '409': "Status", '429': "Status", '503': "Status", } @@ -697,6 +700,7 @@ def delete_device( _response_types_map: Dict[str, Optional[str]] = { '200': "Status", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -769,6 +773,7 @@ def delete_device_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "Status", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -841,6 +846,7 @@ def delete_device_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "Status", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -972,6 +978,7 @@ def get_device( _response_types_map: Dict[str, Optional[str]] = { '200': "Device", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -1044,6 +1051,7 @@ def get_device_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "Device", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -1116,6 +1124,7 @@ def get_device_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "Device", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -1248,6 +1257,7 @@ def get_device_last_seen( _response_types_map: Dict[str, Optional[str]] = { '200': "DeviceLastSeen", '204': None, + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -1321,6 +1331,7 @@ 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", @@ -1394,6 +1405,7 @@ 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", @@ -1525,6 +1537,7 @@ def get_device_status( _response_types_map: Dict[str, Optional[str]] = { '200': "Device", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -1597,6 +1610,7 @@ def get_device_status_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "Device", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -1669,6 +1683,7 @@ def get_device_status_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "Device", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -1805,6 +1820,7 @@ def get_rendered_device( _response_types_map: Dict[str, Optional[str]] = { '200': "Device", '204': None, + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -1883,6 +1899,7 @@ def get_rendered_device_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "Device", '204': None, + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -1961,6 +1978,7 @@ def get_rendered_device_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "Device", '204': None, + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -2049,8 +2067,9 @@ def list_devices( 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[StrictInt], 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, + 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)], @@ -2078,6 +2097,8 @@ def list_devices( :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 @@ -2106,6 +2127,7 @@ def list_devices( field_selector=field_selector, limit=limit, summary_only=summary_only, + cve_id=cve_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2137,8 +2159,9 @@ def list_devices_with_http_info( 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[StrictInt], 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, + 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)], @@ -2166,6 +2189,8 @@ def list_devices_with_http_info( :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 @@ -2194,6 +2219,7 @@ def list_devices_with_http_info( field_selector=field_selector, limit=limit, summary_only=summary_only, + cve_id=cve_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2225,8 +2251,9 @@ def list_devices_without_preload_content( 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[StrictInt], 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, + 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)], @@ -2254,6 +2281,8 @@ def list_devices_without_preload_content( :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 @@ -2282,6 +2311,7 @@ def list_devices_without_preload_content( field_selector=field_selector, limit=limit, summary_only=summary_only, + cve_id=cve_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2310,6 +2340,7 @@ def _list_devices_serialize( field_selector, limit, summary_only, + cve_id, _request_auth, _content_type, _headers, @@ -2352,6 +2383,10 @@ def _list_devices_serialize( _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 diff --git a/flightctl/api/enrollmentrequest_api.py b/flightctl/api/enrollmentrequest_api.py index b3281ea..0fe834b 100644 --- a/flightctl/api/enrollmentrequest_api.py +++ b/flightctl/api/enrollmentrequest_api.py @@ -17,7 +17,7 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt, StrictStr +from pydantic import Field, StrictStr from typing import List, Optional from typing_extensions import Annotated from flightctl.models.enrollment_config import EnrollmentConfig @@ -698,6 +698,7 @@ def delete_enrollment_request( _response_types_map: Dict[str, Optional[str]] = { '200': "Status", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -771,6 +772,7 @@ def delete_enrollment_request_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "Status", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -844,6 +846,7 @@ def delete_enrollment_request_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "Status", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -1256,6 +1259,7 @@ def get_enrollment_request( _response_types_map: Dict[str, Optional[str]] = { '200': "EnrollmentRequest", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -1328,6 +1332,7 @@ def get_enrollment_request_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "EnrollmentRequest", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -1400,6 +1405,7 @@ def get_enrollment_request_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "EnrollmentRequest", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -1531,6 +1537,7 @@ def get_enrollment_request_status( _response_types_map: Dict[str, Optional[str]] = { '200': "EnrollmentRequest", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -1603,6 +1610,7 @@ def get_enrollment_request_status_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "EnrollmentRequest", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -1675,6 +1683,7 @@ def get_enrollment_request_status_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "EnrollmentRequest", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -1757,7 +1766,7 @@ def list_enrollment_requests( 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[StrictInt], 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, + 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)], @@ -1841,7 +1850,7 @@ def list_enrollment_requests_with_http_info( 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[StrictInt], 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, + 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)], @@ -1925,7 +1934,7 @@ def list_enrollment_requests_without_preload_content( 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[StrictInt], 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, + 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)], @@ -3070,6 +3079,7 @@ def replace_enrollment_request_status( _response_types_map: Dict[str, Optional[str]] = { '200': "EnrollmentRequest", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -3146,6 +3156,7 @@ def replace_enrollment_request_status_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "EnrollmentRequest", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -3222,6 +3233,7 @@ def replace_enrollment_request_status_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "EnrollmentRequest", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", diff --git a/flightctl/api/event_api.py b/flightctl/api/event_api.py index 30e37ed..65892ca 100644 --- a/flightctl/api/event_api.py +++ b/flightctl/api/event_api.py @@ -17,7 +17,7 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt, StrictStr, field_validator +from pydantic import Field, StrictStr, field_validator from typing import Optional from typing_extensions import Annotated from flightctl.models.event_list import EventList @@ -45,7 +45,7 @@ def list_events( self, 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, order: Annotated[Optional[StrictStr], Field(description="Sort order for the results by timestamp. Defaults to 'desc' (newest first).")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The maximum number of events to return in the response.")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=0)]], Field(description="The maximum number of events to return in the response.")] = None, 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, _request_timeout: Union[ None, @@ -129,7 +129,7 @@ def list_events_with_http_info( self, 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, order: Annotated[Optional[StrictStr], Field(description="Sort order for the results by timestamp. Defaults to 'desc' (newest first).")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The maximum number of events to return in the response.")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=0)]], Field(description="The maximum number of events to return in the response.")] = None, 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, _request_timeout: Union[ None, @@ -213,7 +213,7 @@ def list_events_without_preload_content( self, 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, order: Annotated[Optional[StrictStr], Field(description="Sort order for the results by timestamp. Defaults to 'desc' (newest first).")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The maximum number of events to return in the response.")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=0)]], Field(description="The maximum number of events to return in the response.")] = None, 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, _request_timeout: Union[ None, diff --git a/flightctl/api/fleet_api.py b/flightctl/api/fleet_api.py index d9b6587..bc0dbd8 100644 --- a/flightctl/api/fleet_api.py +++ b/flightctl/api/fleet_api.py @@ -17,7 +17,7 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictBool, StrictInt, StrictStr +from pydantic import Field, StrictBool, StrictStr from typing import List, Optional from typing_extensions import Annotated from flightctl.models.fleet import Fleet @@ -391,6 +391,7 @@ def delete_fleet( _response_types_map: Dict[str, Optional[str]] = { '200': "Status", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -463,6 +464,7 @@ def delete_fleet_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "Status", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -535,6 +537,7 @@ def delete_fleet_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "Status", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -670,6 +673,7 @@ def delete_template_version( _response_types_map: Dict[str, Optional[str]] = { '200': "Status", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -746,6 +750,7 @@ def delete_template_version_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "Status", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -822,6 +827,7 @@ def delete_template_version_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "Status", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -960,6 +966,7 @@ def get_fleet( _response_types_map: Dict[str, Optional[str]] = { '200': "Fleet", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -1036,6 +1043,7 @@ def get_fleet_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "Fleet", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -1112,6 +1120,7 @@ def get_fleet_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "Fleet", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -1248,6 +1257,7 @@ def get_fleet_status( _response_types_map: Dict[str, Optional[str]] = { '200': "Fleet", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -1320,6 +1330,7 @@ def get_fleet_status_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "Fleet", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -1392,6 +1403,7 @@ def get_fleet_status_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "Fleet", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -1527,6 +1539,7 @@ def get_template_version( _response_types_map: Dict[str, Optional[str]] = { '200': "TemplateVersion", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -1603,6 +1616,7 @@ def get_template_version_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "TemplateVersion", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -1679,6 +1693,7 @@ def get_template_version_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "TemplateVersion", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -1764,7 +1779,7 @@ def list_fleets( 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[StrictInt], 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, + 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, add_devices_summary: Annotated[Optional[StrictBool], Field(description="Include a summary of the devices in the fleet.")] = None, _request_timeout: Union[ None, @@ -1852,7 +1867,7 @@ def list_fleets_with_http_info( 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[StrictInt], 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, + 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, add_devices_summary: Annotated[Optional[StrictBool], Field(description="Include a summary of the devices in the fleet.")] = None, _request_timeout: Union[ None, @@ -1940,7 +1955,7 @@ def list_fleets_without_preload_content( 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[StrictInt], 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, + 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, add_devices_summary: Annotated[Optional[StrictBool], Field(description="Include a summary of the devices in the fleet.")] = None, _request_timeout: Union[ None, @@ -2110,7 +2125,7 @@ def list_template_versions( 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[StrictInt], 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, + 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)], @@ -2198,7 +2213,7 @@ def list_template_versions_with_http_info( 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[StrictInt], 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, + 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)], @@ -2286,7 +2301,7 @@ def list_template_versions_without_preload_content( 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[StrictInt], 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, + 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)], @@ -3434,6 +3449,7 @@ def replace_fleet_status( _response_types_map: Dict[str, Optional[str]] = { '200': "Fleet", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -3510,6 +3526,7 @@ def replace_fleet_status_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "Fleet", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -3586,6 +3603,7 @@ def replace_fleet_status_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "Fleet", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", diff --git a/flightctl/api/label_api.py b/flightctl/api/label_api.py index 08b4ac3..6071ca6 100644 --- a/flightctl/api/label_api.py +++ b/flightctl/api/label_api.py @@ -17,7 +17,7 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt, StrictStr, field_validator +from pydantic import Field, StrictStr, field_validator from typing import List, Optional from typing_extensions import Annotated @@ -45,7 +45,7 @@ def list_labels( kind: Annotated[StrictStr, Field(description="The type of resource to retrieve labels from.")], label_selector: Annotated[Optional[StrictStr], Field(description="A filter to retrieve labels only from resources that match the given label selector.")] = None, field_selector: Annotated[Optional[StrictStr], Field(description="A filter to retrieve labels only from resources that match the given field selector.")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The maximum number of distinct labels to return in the response.")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=0)]], Field(description="The maximum number of distinct labels to return in the response.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -129,7 +129,7 @@ def list_labels_with_http_info( kind: Annotated[StrictStr, Field(description="The type of resource to retrieve labels from.")], label_selector: Annotated[Optional[StrictStr], Field(description="A filter to retrieve labels only from resources that match the given label selector.")] = None, field_selector: Annotated[Optional[StrictStr], Field(description="A filter to retrieve labels only from resources that match the given field selector.")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The maximum number of distinct labels to return in the response.")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=0)]], Field(description="The maximum number of distinct labels to return in the response.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -213,7 +213,7 @@ def list_labels_without_preload_content( kind: Annotated[StrictStr, Field(description="The type of resource to retrieve labels from.")], label_selector: Annotated[Optional[StrictStr], Field(description="A filter to retrieve labels only from resources that match the given label selector.")] = None, field_selector: Annotated[Optional[StrictStr], Field(description="A filter to retrieve labels only from resources that match the given field selector.")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The maximum number of distinct labels to return in the response.")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=0)]], Field(description="The maximum number of distinct labels to return in the response.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], diff --git a/flightctl/api/repository_api.py b/flightctl/api/repository_api.py index 6b6cc1b..46bcc4d 100644 --- a/flightctl/api/repository_api.py +++ b/flightctl/api/repository_api.py @@ -17,9 +17,12 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt, StrictStr +from pydantic import Field, StrictStr from typing import List, Optional from typing_extensions import Annotated +from flightctl.models.check_repository_oci_image_request import CheckRepositoryOciImageRequest +from flightctl.models.check_repository_oci_result import CheckRepositoryOciResult +from flightctl.models.check_repository_oci_tag_request import CheckRepositoryOciTagRequest from flightctl.models.patch_request_inner import PatchRequestInner from flightctl.models.repository import Repository from flightctl.models.repository_list import RepositoryList @@ -43,6 +46,618 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client + @validate_call + def check_repository_oci_image( + self, + name: Annotated[StrictStr, Field(description="The name of the Repository resource to use for registry connection.")], + check_repository_oci_image_request: CheckRepositoryOciImageRequest, + _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, + ) -> CheckRepositoryOciResult: + """check_repository_oci_image + + 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. + + :param name: The name of the Repository resource to use for registry connection. (required) + :type name: str + :param check_repository_oci_image_request: (required) + :type check_repository_oci_image_request: CheckRepositoryOciImageRequest + :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._check_repository_oci_image_serialize( + name=name, + check_repository_oci_image_request=check_repository_oci_image_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CheckRepositoryOciResult", + '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 check_repository_oci_image_with_http_info( + self, + name: Annotated[StrictStr, Field(description="The name of the Repository resource to use for registry connection.")], + check_repository_oci_image_request: CheckRepositoryOciImageRequest, + _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[CheckRepositoryOciResult]: + """check_repository_oci_image + + 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. + + :param name: The name of the Repository resource to use for registry connection. (required) + :type name: str + :param check_repository_oci_image_request: (required) + :type check_repository_oci_image_request: CheckRepositoryOciImageRequest + :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._check_repository_oci_image_serialize( + name=name, + check_repository_oci_image_request=check_repository_oci_image_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CheckRepositoryOciResult", + '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 check_repository_oci_image_without_preload_content( + self, + name: Annotated[StrictStr, Field(description="The name of the Repository resource to use for registry connection.")], + check_repository_oci_image_request: CheckRepositoryOciImageRequest, + _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: + """check_repository_oci_image + + 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. + + :param name: The name of the Repository resource to use for registry connection. (required) + :type name: str + :param check_repository_oci_image_request: (required) + :type check_repository_oci_image_request: CheckRepositoryOciImageRequest + :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._check_repository_oci_image_serialize( + name=name, + check_repository_oci_image_request=check_repository_oci_image_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CheckRepositoryOciResult", + '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 _check_repository_oci_image_serialize( + self, + name, + check_repository_oci_image_request, + _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 + # process the header parameters + # process the form parameters + # process the body parameter + if check_repository_oci_image_request is not None: + _body_params = check_repository_oci_image_request + + + # 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' + ] + ) + ) + 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='POST', + resource_path='/repositories/{name}/check-oci-image', + 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 check_repository_oci_tag( + self, + name: Annotated[StrictStr, Field(description="The name of the Repository resource to use for registry connection.")], + check_repository_oci_tag_request: CheckRepositoryOciTagRequest, + _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, + ) -> CheckRepositoryOciResult: + """check_repository_oci_tag + + 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. + + :param name: The name of the Repository resource to use for registry connection. (required) + :type name: str + :param check_repository_oci_tag_request: (required) + :type check_repository_oci_tag_request: CheckRepositoryOciTagRequest + :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._check_repository_oci_tag_serialize( + name=name, + check_repository_oci_tag_request=check_repository_oci_tag_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CheckRepositoryOciResult", + '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 check_repository_oci_tag_with_http_info( + self, + name: Annotated[StrictStr, Field(description="The name of the Repository resource to use for registry connection.")], + check_repository_oci_tag_request: CheckRepositoryOciTagRequest, + _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[CheckRepositoryOciResult]: + """check_repository_oci_tag + + 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. + + :param name: The name of the Repository resource to use for registry connection. (required) + :type name: str + :param check_repository_oci_tag_request: (required) + :type check_repository_oci_tag_request: CheckRepositoryOciTagRequest + :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._check_repository_oci_tag_serialize( + name=name, + check_repository_oci_tag_request=check_repository_oci_tag_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CheckRepositoryOciResult", + '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 check_repository_oci_tag_without_preload_content( + self, + name: Annotated[StrictStr, Field(description="The name of the Repository resource to use for registry connection.")], + check_repository_oci_tag_request: CheckRepositoryOciTagRequest, + _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: + """check_repository_oci_tag + + 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. + + :param name: The name of the Repository resource to use for registry connection. (required) + :type name: str + :param check_repository_oci_tag_request: (required) + :type check_repository_oci_tag_request: CheckRepositoryOciTagRequest + :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._check_repository_oci_tag_serialize( + name=name, + check_repository_oci_tag_request=check_repository_oci_tag_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CheckRepositoryOciResult", + '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 _check_repository_oci_tag_serialize( + self, + name, + check_repository_oci_tag_request, + _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 + # process the header parameters + # process the form parameters + # process the body parameter + if check_repository_oci_tag_request is not None: + _body_params = check_repository_oci_tag_request + + + # 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' + ] + ) + ) + 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='POST', + resource_path='/repositories/{name}/check-oci-tag', + 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 create_repository( self, @@ -389,6 +1004,7 @@ def delete_repository( _response_types_map: Dict[str, Optional[str]] = { '200': "Status", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -461,6 +1077,7 @@ def delete_repository_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "Status", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -533,6 +1150,7 @@ def delete_repository_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "Status", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -664,6 +1282,7 @@ def get_repository( _response_types_map: Dict[str, Optional[str]] = { '200': "Repository", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -736,6 +1355,7 @@ def get_repository_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "Repository", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -808,6 +1428,7 @@ def get_repository_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "Repository", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -890,7 +1511,7 @@ def list_repositories( 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[StrictInt], 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, + 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)], @@ -974,7 +1595,7 @@ def list_repositories_with_http_info( 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[StrictInt], 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, + 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)], @@ -1058,7 +1679,7 @@ def list_repositories_without_preload_content( 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[StrictInt], 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, + 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)], diff --git a/flightctl/api/resourcesync_api.py b/flightctl/api/resourcesync_api.py index 01d308e..cca7a7d 100644 --- a/flightctl/api/resourcesync_api.py +++ b/flightctl/api/resourcesync_api.py @@ -17,7 +17,7 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt, StrictStr +from pydantic import Field, StrictStr from typing import List, Optional from typing_extensions import Annotated from flightctl.models.patch_request_inner import PatchRequestInner @@ -389,6 +389,7 @@ def delete_resource_sync( _response_types_map: Dict[str, Optional[str]] = { '200': "Status", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -461,6 +462,7 @@ def delete_resource_sync_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "Status", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -533,6 +535,7 @@ def delete_resource_sync_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "Status", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -664,6 +667,7 @@ def get_resource_sync( _response_types_map: Dict[str, Optional[str]] = { '200': "ResourceSync", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -736,6 +740,7 @@ def get_resource_sync_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "ResourceSync", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -808,6 +813,7 @@ def get_resource_sync_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "ResourceSync", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -890,7 +896,7 @@ def list_resource_syncs( 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[StrictInt], 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, + 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)], @@ -974,7 +980,7 @@ def list_resource_syncs_with_http_info( 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[StrictInt], 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, + 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)], @@ -1058,7 +1064,7 @@ def list_resource_syncs_without_preload_content( 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[StrictInt], 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, + 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)], diff --git a/flightctl/api_client.py b/flightctl/api_client.py index 682d7b1..cccd03d 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.1.0/python' + self.user_agent = 'OpenAPI-Generator/1.2.0/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/flightctl/configuration.py b/flightctl/configuration.py index aeda262..69a3a6f 100644 --- a/flightctl/configuration.py +++ b/flightctl/configuration.py @@ -215,7 +215,7 @@ def __init__( ) -> None: """Constructor """ - self._base_path = "/api/v1" if host is None else host.rstrip("/") + "/api/v1" + self._base_path = "/api/v1" if host is None else host """Default Base url """ self.server_index = 0 if server_index is None and host is None else server_index @@ -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.1.0".\ + "SDK Package Version: 1.2.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 70ef703..72fb39d 100644 --- a/flightctl/imagebuilder/__init__.py +++ b/flightctl/imagebuilder/__init__.py @@ -15,12 +15,13 @@ """ # noqa: E501 -__version__ = "1.1.0" +__version__ = "1.2.0" # Define package exports __all__ = [ "ImagebuildApi", "ImageexportApi", + "ImagepromotionApi", "ApiResponse", "ApiClient", "Configuration", @@ -31,10 +32,12 @@ "ApiAttributeError", "ApiException", "ApiVersion", + "ArtifactPromotionStatus", "BindingType", "ConditionBase", "ConditionStatus", "EarlyBinding", + "ExistingCatalogItemTarget", "ExportFormatType", "ImageBuild", "ImageBuildBinding", @@ -43,6 +46,7 @@ "ImageBuildConditionType", "ImageBuildDestination", "ImageBuildList", + "ImageBuildNewVersionRequest", "ImageBuildRefSource", "ImageBuildSource", "ImageBuildSpec", @@ -57,9 +61,22 @@ "ImageExportSourceType", "ImageExportSpec", "ImageExportStatus", + "ImagePromotion", + "ImagePromotionCondition", + "ImagePromotionConditionReason", + "ImagePromotionConditionType", + "ImagePromotionList", + "ImagePromotionSource", + "ImagePromotionSpec", + "ImagePromotionStatus", + "ImagePromotionTarget", + "ImagePromotionTargetBase", + "ImagePromotionTargetType", "LateBinding", "ListMeta", + "NewCatalogItemTarget", "ObjectMeta", + "PatchRequestInner", "ResourceKind", "Status", ] @@ -67,6 +84,7 @@ # import apis into sdk package from flightctl.imagebuilder.api.imagebuild_api import ImagebuildApi as ImagebuildApi from flightctl.imagebuilder.api.imageexport_api import ImageexportApi as ImageexportApi +from flightctl.imagebuilder.api.imagepromotion_api import ImagepromotionApi as ImagepromotionApi # import ApiClient from flightctl.imagebuilder.api_response import ApiResponse as ApiResponse @@ -81,10 +99,12 @@ # import models into sdk package from flightctl.imagebuilder.models.api_version import ApiVersion as ApiVersion +from flightctl.imagebuilder.models.artifact_promotion_status import ArtifactPromotionStatus as ArtifactPromotionStatus from flightctl.imagebuilder.models.binding_type import BindingType as BindingType from flightctl.imagebuilder.models.condition_base import ConditionBase as ConditionBase from flightctl.imagebuilder.models.condition_status import ConditionStatus as ConditionStatus from flightctl.imagebuilder.models.early_binding import EarlyBinding as EarlyBinding +from flightctl.imagebuilder.models.existing_catalog_item_target import ExistingCatalogItemTarget as ExistingCatalogItemTarget from flightctl.imagebuilder.models.export_format_type import ExportFormatType as ExportFormatType from flightctl.imagebuilder.models.image_build import ImageBuild as ImageBuild from flightctl.imagebuilder.models.image_build_binding import ImageBuildBinding as ImageBuildBinding @@ -93,6 +113,7 @@ from flightctl.imagebuilder.models.image_build_condition_type import ImageBuildConditionType as ImageBuildConditionType from flightctl.imagebuilder.models.image_build_destination import ImageBuildDestination as ImageBuildDestination from flightctl.imagebuilder.models.image_build_list import ImageBuildList as ImageBuildList +from flightctl.imagebuilder.models.image_build_new_version_request import ImageBuildNewVersionRequest as ImageBuildNewVersionRequest from flightctl.imagebuilder.models.image_build_ref_source import ImageBuildRefSource as ImageBuildRefSource from flightctl.imagebuilder.models.image_build_source import ImageBuildSource as ImageBuildSource from flightctl.imagebuilder.models.image_build_spec import ImageBuildSpec as ImageBuildSpec @@ -107,9 +128,22 @@ from flightctl.imagebuilder.models.image_export_source_type import ImageExportSourceType as ImageExportSourceType from flightctl.imagebuilder.models.image_export_spec import ImageExportSpec as ImageExportSpec from flightctl.imagebuilder.models.image_export_status import ImageExportStatus as ImageExportStatus +from flightctl.imagebuilder.models.image_promotion import ImagePromotion as ImagePromotion +from flightctl.imagebuilder.models.image_promotion_condition import ImagePromotionCondition as ImagePromotionCondition +from flightctl.imagebuilder.models.image_promotion_condition_reason import ImagePromotionConditionReason as ImagePromotionConditionReason +from flightctl.imagebuilder.models.image_promotion_condition_type import ImagePromotionConditionType as ImagePromotionConditionType +from flightctl.imagebuilder.models.image_promotion_list import ImagePromotionList as ImagePromotionList +from flightctl.imagebuilder.models.image_promotion_source import ImagePromotionSource as ImagePromotionSource +from flightctl.imagebuilder.models.image_promotion_spec import ImagePromotionSpec as ImagePromotionSpec +from flightctl.imagebuilder.models.image_promotion_status import ImagePromotionStatus as ImagePromotionStatus +from flightctl.imagebuilder.models.image_promotion_target import ImagePromotionTarget as ImagePromotionTarget +from flightctl.imagebuilder.models.image_promotion_target_base import ImagePromotionTargetBase as ImagePromotionTargetBase +from flightctl.imagebuilder.models.image_promotion_target_type import ImagePromotionTargetType as ImagePromotionTargetType from flightctl.imagebuilder.models.late_binding import LateBinding as LateBinding from flightctl.imagebuilder.models.list_meta import ListMeta as ListMeta +from flightctl.imagebuilder.models.new_catalog_item_target import NewCatalogItemTarget as NewCatalogItemTarget from flightctl.imagebuilder.models.object_meta import ObjectMeta as ObjectMeta +from flightctl.imagebuilder.models.patch_request_inner import PatchRequestInner as PatchRequestInner from flightctl.imagebuilder.models.resource_kind import ResourceKind as ResourceKind from flightctl.imagebuilder.models.status import Status as Status diff --git a/flightctl/imagebuilder/api/__init__.py b/flightctl/imagebuilder/api/__init__.py index 87e020c..3771660 100644 --- a/flightctl/imagebuilder/api/__init__.py +++ b/flightctl/imagebuilder/api/__init__.py @@ -3,4 +3,5 @@ # import apis into api package from flightctl.imagebuilder.api.imagebuild_api import ImagebuildApi from flightctl.imagebuilder.api.imageexport_api import ImageexportApi +from flightctl.imagebuilder.api.imagepromotion_api import ImagepromotionApi diff --git a/flightctl/imagebuilder/api/imagebuild_api.py b/flightctl/imagebuilder/api/imagebuild_api.py index 0930bd3..7f9ac0b 100644 --- a/flightctl/imagebuilder/api/imagebuild_api.py +++ b/flightctl/imagebuilder/api/imagebuild_api.py @@ -17,11 +17,13 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictBool, StrictInt, StrictStr +from pydantic import Field, StrictBool, StrictStr from typing import Optional from typing_extensions import Annotated from flightctl.imagebuilder.models.image_build import ImageBuild from flightctl.imagebuilder.models.image_build_list import ImageBuildList +from flightctl.imagebuilder.models.image_build_new_version_request import ImageBuildNewVersionRequest +from flightctl.imagebuilder.models.status import Status from flightctl.imagebuilder.api_client import ApiClient, RequestSerialized from flightctl.imagebuilder.api_response import ApiResponse @@ -613,6 +615,315 @@ def _create_image_build_serialize( + @validate_call + def create_image_build_new_version( + self, + name: Annotated[StrictStr, Field(description="The name of the parent ImageBuild resource.")], + image_build_new_version_request: ImageBuildNewVersionRequest, + _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, + ) -> ImageBuild: + """create_image_build_new_version + + 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. + + :param name: The name of the parent ImageBuild resource. (required) + :type name: str + :param image_build_new_version_request: (required) + :type image_build_new_version_request: ImageBuildNewVersionRequest + :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._create_image_build_new_version_serialize( + name=name, + image_build_new_version_request=image_build_new_version_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "ImageBuild", + '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 create_image_build_new_version_with_http_info( + self, + name: Annotated[StrictStr, Field(description="The name of the parent ImageBuild resource.")], + image_build_new_version_request: ImageBuildNewVersionRequest, + _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[ImageBuild]: + """create_image_build_new_version + + 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. + + :param name: The name of the parent ImageBuild resource. (required) + :type name: str + :param image_build_new_version_request: (required) + :type image_build_new_version_request: ImageBuildNewVersionRequest + :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._create_image_build_new_version_serialize( + name=name, + image_build_new_version_request=image_build_new_version_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "ImageBuild", + '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 create_image_build_new_version_without_preload_content( + self, + name: Annotated[StrictStr, Field(description="The name of the parent ImageBuild resource.")], + image_build_new_version_request: ImageBuildNewVersionRequest, + _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: + """create_image_build_new_version + + 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. + + :param name: The name of the parent ImageBuild resource. (required) + :type name: str + :param image_build_new_version_request: (required) + :type image_build_new_version_request: ImageBuildNewVersionRequest + :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._create_image_build_new_version_serialize( + name=name, + image_build_new_version_request=image_build_new_version_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "ImageBuild", + '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 _create_image_build_new_version_serialize( + self, + name, + image_build_new_version_request, + _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 + # process the header parameters + # process the form parameters + # process the body parameter + if image_build_new_version_request is not None: + _body_params = image_build_new_version_request + + + # 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' + ] + ) + ) + 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='POST', + resource_path='/api/v1/imagebuilds/{name}/newversion', + 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 delete_image_build( self, @@ -629,7 +940,7 @@ def delete_image_build( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ImageBuild: + ) -> Status: """delete_image_build Delete an ImageBuild resource. @@ -667,7 +978,8 @@ def delete_image_build( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ImageBuild", + '200': "Status", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -701,7 +1013,7 @@ def delete_image_build_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[ImageBuild]: + ) -> ApiResponse[Status]: """delete_image_build Delete an ImageBuild resource. @@ -739,7 +1051,8 @@ def delete_image_build_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ImageBuild", + '200': "Status", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -811,7 +1124,8 @@ def delete_image_build_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ImageBuild", + '200': "Status", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -947,6 +1261,7 @@ def get_image_build( _response_types_map: Dict[str, Optional[str]] = { '200': "ImageBuild", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -1023,6 +1338,7 @@ def get_image_build_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "ImageBuild", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -1099,6 +1415,7 @@ def get_image_build_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "ImageBuild", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -1239,6 +1556,7 @@ def get_image_build_log( _response_types_map: Dict[str, Optional[str]] = { '200': "str", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -1315,6 +1633,7 @@ def get_image_build_log_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "str", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -1391,6 +1710,7 @@ def get_image_build_log_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "str", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -1479,7 +1799,7 @@ def list_image_builds( self, label_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their labels.")] = None, field_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their fields.")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The maximum number of results returned in the 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.")] = None, var_continue: Annotated[Optional[StrictStr], Field(description="An optional parameter to query more results from the server.")] = None, with_exports: Annotated[Optional[StrictBool], Field(description="If true, includes related ImageExport resources in each ImageBuild in the response.")] = None, _request_timeout: Union[ @@ -1567,7 +1887,7 @@ def list_image_builds_with_http_info( self, label_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their labels.")] = None, field_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their fields.")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The maximum number of results returned in the 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.")] = None, var_continue: Annotated[Optional[StrictStr], Field(description="An optional parameter to query more results from the server.")] = None, with_exports: Annotated[Optional[StrictBool], Field(description="If true, includes related ImageExport resources in each ImageBuild in the response.")] = None, _request_timeout: Union[ @@ -1655,7 +1975,7 @@ def list_image_builds_without_preload_content( self, label_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their labels.")] = None, field_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their fields.")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The maximum number of results returned in the 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.")] = None, var_continue: Annotated[Optional[StrictStr], Field(description="An optional parameter to query more results from the server.")] = None, with_exports: Annotated[Optional[StrictBool], Field(description="If true, includes related ImageExport resources in each ImageBuild in the response.")] = None, _request_timeout: Union[ diff --git a/flightctl/imagebuilder/api/imageexport_api.py b/flightctl/imagebuilder/api/imageexport_api.py index e78482a..7842ca1 100644 --- a/flightctl/imagebuilder/api/imageexport_api.py +++ b/flightctl/imagebuilder/api/imageexport_api.py @@ -17,11 +17,12 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictBool, StrictBytes, StrictInt, StrictStr +from pydantic import Field, StrictBool, StrictBytes, StrictStr from typing import Optional, Tuple, Union from typing_extensions import Annotated from flightctl.imagebuilder.models.image_export import ImageExport from flightctl.imagebuilder.models.image_export_list import ImageExportList +from flightctl.imagebuilder.models.status import Status from flightctl.imagebuilder.api_client import ApiClient, RequestSerialized from flightctl.imagebuilder.api_response import ApiResponse @@ -629,7 +630,7 @@ def delete_image_export( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ImageExport: + ) -> Status: """delete_image_export Delete an ImageExport resource. @@ -667,7 +668,8 @@ def delete_image_export( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ImageExport", + '200': "Status", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -701,7 +703,7 @@ def delete_image_export_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[ImageExport]: + ) -> ApiResponse[Status]: """delete_image_export Delete an ImageExport resource. @@ -739,7 +741,8 @@ def delete_image_export_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ImageExport", + '200': "Status", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -811,7 +814,8 @@ def delete_image_export_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ImageExport", + '200': "Status", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -1231,6 +1235,7 @@ def get_image_export( _response_types_map: Dict[str, Optional[str]] = { '200': "ImageExport", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -1303,6 +1308,7 @@ def get_image_export_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "ImageExport", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -1375,6 +1381,7 @@ def get_image_export_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "ImageExport", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -1510,6 +1517,7 @@ def get_image_export_log( _response_types_map: Dict[str, Optional[str]] = { '200': "str", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -1586,6 +1594,7 @@ def get_image_export_log_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "str", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -1662,6 +1671,7 @@ def get_image_export_log_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "str", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -1750,7 +1760,7 @@ def list_image_exports( self, label_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their labels.")] = None, field_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their fields.")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The maximum number of results returned in the 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.")] = None, var_continue: Annotated[Optional[StrictStr], Field(description="An optional parameter to query more results from the server.")] = None, _request_timeout: Union[ None, @@ -1834,7 +1844,7 @@ def list_image_exports_with_http_info( self, label_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their labels.")] = None, field_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their fields.")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The maximum number of results returned in the 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.")] = None, var_continue: Annotated[Optional[StrictStr], Field(description="An optional parameter to query more results from the server.")] = None, _request_timeout: Union[ None, @@ -1918,7 +1928,7 @@ def list_image_exports_without_preload_content( self, label_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their labels.")] = None, field_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their fields.")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The maximum number of results returned in the 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.")] = None, var_continue: Annotated[Optional[StrictStr], Field(description="An optional parameter to query more results from the server.")] = None, _request_timeout: Union[ None, diff --git a/flightctl/imagebuilder/api/imagepromotion_api.py b/flightctl/imagebuilder/api/imagepromotion_api.py new file mode 100644 index 0000000..6984e65 --- /dev/null +++ b/flightctl/imagebuilder/api/imagepromotion_api.py @@ -0,0 +1,1843 @@ +# coding: utf-8 + +""" + Flight Control Image Builder API + + Image Builder service for Flight Control. This service manages image build resources for building and pushing container images. + + 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 warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from flightctl.imagebuilder.models.image_promotion import ImagePromotion +from flightctl.imagebuilder.models.image_promotion_list import ImagePromotionList +from flightctl.imagebuilder.models.patch_request_inner import PatchRequestInner +from flightctl.imagebuilder.models.status import Status + +from flightctl.imagebuilder.api_client import ApiClient, RequestSerialized +from flightctl.imagebuilder.api_response import ApiResponse +from flightctl.imagebuilder.rest import RESTResponseType + + +class ImagepromotionApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def create_image_promotion( + self, + image_promotion: ImagePromotion, + _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, + ) -> ImagePromotion: + """create_image_promotion + + Create an ImagePromotion resource to publish a completed image build to the software catalog. + + :param image_promotion: (required) + :type image_promotion: ImagePromotion + :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._create_image_promotion_serialize( + image_promotion=image_promotion, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "ImagePromotion", + '400': "Status", + '401': "Status", + '403': "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 create_image_promotion_with_http_info( + self, + image_promotion: ImagePromotion, + _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[ImagePromotion]: + """create_image_promotion + + Create an ImagePromotion resource to publish a completed image build to the software catalog. + + :param image_promotion: (required) + :type image_promotion: ImagePromotion + :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._create_image_promotion_serialize( + image_promotion=image_promotion, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "ImagePromotion", + '400': "Status", + '401': "Status", + '403': "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 create_image_promotion_without_preload_content( + self, + image_promotion: ImagePromotion, + _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: + """create_image_promotion + + Create an ImagePromotion resource to publish a completed image build to the software catalog. + + :param image_promotion: (required) + :type image_promotion: ImagePromotion + :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._create_image_promotion_serialize( + image_promotion=image_promotion, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "ImagePromotion", + '400': "Status", + '401': "Status", + '403': "Status", + '409': "Status", + '429': "Status", + '503': "Status", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_image_promotion_serialize( + self, + image_promotion, + _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 + # process the header parameters + # process the form parameters + # process the body parameter + if image_promotion is not None: + _body_params = image_promotion + + + # 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' + ] + ) + ) + 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='POST', + resource_path='/api/v1/imagepromotions', + 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 delete_image_promotion( + self, + name: Annotated[StrictStr, Field(description="The name of the ImagePromotion resource.")], + _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, + ) -> Status: + """delete_image_promotion + + Delete an ImagePromotion resource. + + :param name: The name of the ImagePromotion resource. (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 + (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._delete_image_promotion_serialize( + name=name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Status", + '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 delete_image_promotion_with_http_info( + self, + name: Annotated[StrictStr, Field(description="The name of the ImagePromotion resource.")], + _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[Status]: + """delete_image_promotion + + Delete an ImagePromotion resource. + + :param name: The name of the ImagePromotion resource. (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 + (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._delete_image_promotion_serialize( + name=name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Status", + '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 delete_image_promotion_without_preload_content( + self, + name: Annotated[StrictStr, Field(description="The name of the ImagePromotion resource.")], + _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: + """delete_image_promotion + + Delete an ImagePromotion resource. + + :param name: The name of the ImagePromotion resource. (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 + (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._delete_image_promotion_serialize( + name=name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Status", + '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 _delete_image_promotion_serialize( + self, + name, + _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 + # 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='DELETE', + resource_path='/api/v1/imagepromotions/{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 get_image_promotion( + self, + name: Annotated[StrictStr, Field(description="The name of the ImagePromotion resource.")], + _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, + ) -> ImagePromotion: + """get_image_promotion + + Get an ImagePromotion resource. + + :param name: The name of the ImagePromotion resource. (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 + (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_image_promotion_serialize( + name=name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ImagePromotion", + '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 get_image_promotion_with_http_info( + self, + name: Annotated[StrictStr, Field(description="The name of the ImagePromotion resource.")], + _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[ImagePromotion]: + """get_image_promotion + + Get an ImagePromotion resource. + + :param name: The name of the ImagePromotion resource. (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 + (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_image_promotion_serialize( + name=name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ImagePromotion", + '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 get_image_promotion_without_preload_content( + self, + name: Annotated[StrictStr, Field(description="The name of the ImagePromotion resource.")], + _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_image_promotion + + Get an ImagePromotion resource. + + :param name: The name of the ImagePromotion resource. (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 + (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_image_promotion_serialize( + name=name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ImagePromotion", + '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 _get_image_promotion_serialize( + self, + name, + _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 + # 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='/api/v1/imagepromotions/{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 list_image_promotions( + self, + label_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their labels.")] = None, + field_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their fields.")] = 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.")] = None, + var_continue: Annotated[Optional[StrictStr], Field(description="An optional parameter to query more results from the server.")] = 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, + ) -> ImagePromotionList: + """list_image_promotions + + List ImagePromotion resources. + + :param label_selector: A selector to restrict the list of returned objects by their labels. + :type label_selector: str + :param field_selector: A selector to restrict the list of returned objects by their fields. + :type field_selector: str + :param limit: The maximum number of results returned in the list response. + :type limit: int + :param var_continue: An optional parameter to query more results from the server. + :type var_continue: 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_image_promotions_serialize( + label_selector=label_selector, + field_selector=field_selector, + limit=limit, + var_continue=var_continue, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ImagePromotionList", + '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_image_promotions_with_http_info( + self, + label_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their labels.")] = None, + field_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their fields.")] = 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.")] = None, + var_continue: Annotated[Optional[StrictStr], Field(description="An optional parameter to query more results from the server.")] = 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[ImagePromotionList]: + """list_image_promotions + + List ImagePromotion resources. + + :param label_selector: A selector to restrict the list of returned objects by their labels. + :type label_selector: str + :param field_selector: A selector to restrict the list of returned objects by their fields. + :type field_selector: str + :param limit: The maximum number of results returned in the list response. + :type limit: int + :param var_continue: An optional parameter to query more results from the server. + :type var_continue: 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_image_promotions_serialize( + label_selector=label_selector, + field_selector=field_selector, + limit=limit, + var_continue=var_continue, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ImagePromotionList", + '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_image_promotions_without_preload_content( + self, + label_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their labels.")] = None, + field_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their fields.")] = 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.")] = None, + var_continue: Annotated[Optional[StrictStr], Field(description="An optional parameter to query more results from the server.")] = 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_image_promotions + + List ImagePromotion resources. + + :param label_selector: A selector to restrict the list of returned objects by their labels. + :type label_selector: str + :param field_selector: A selector to restrict the list of returned objects by their fields. + :type field_selector: str + :param limit: The maximum number of results returned in the list response. + :type limit: int + :param var_continue: An optional parameter to query more results from the server. + :type var_continue: 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_image_promotions_serialize( + label_selector=label_selector, + field_selector=field_selector, + limit=limit, + var_continue=var_continue, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ImagePromotionList", + '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_image_promotions_serialize( + self, + label_selector, + field_selector, + limit, + var_continue, + _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 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 var_continue is not None: + + _query_params.append(('continue', var_continue)) + + # 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='/api/v1/imagepromotions', + 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_image_promotion( + self, + name: Annotated[StrictStr, Field(description="The name of the ImagePromotion resource.")], + 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, + ) -> ImagePromotion: + """patch_image_promotion + + 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. + + :param name: The name of the ImagePromotion resource. (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_image_promotion_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': "ImagePromotion", + '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_image_promotion_with_http_info( + self, + name: Annotated[StrictStr, Field(description="The name of the ImagePromotion resource.")], + 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[ImagePromotion]: + """patch_image_promotion + + 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. + + :param name: The name of the ImagePromotion resource. (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_image_promotion_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': "ImagePromotion", + '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_image_promotion_without_preload_content( + self, + name: Annotated[StrictStr, Field(description="The name of the ImagePromotion resource.")], + 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_image_promotion + + 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. + + :param name: The name of the ImagePromotion resource. (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_image_promotion_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': "ImagePromotion", + '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_image_promotion_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='/api/v1/imagepromotions/{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 replace_image_promotion( + self, + name: Annotated[StrictStr, Field(description="The name of the ImagePromotion resource.")], + image_promotion: ImagePromotion, + _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, + ) -> ImagePromotion: + """replace_image_promotion + + 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. + + :param name: The name of the ImagePromotion resource. (required) + :type name: str + :param image_promotion: (required) + :type image_promotion: ImagePromotion + :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_image_promotion_serialize( + name=name, + image_promotion=image_promotion, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ImagePromotion", + '201': "ImagePromotion", + '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_image_promotion_with_http_info( + self, + name: Annotated[StrictStr, Field(description="The name of the ImagePromotion resource.")], + image_promotion: ImagePromotion, + _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[ImagePromotion]: + """replace_image_promotion + + 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. + + :param name: The name of the ImagePromotion resource. (required) + :type name: str + :param image_promotion: (required) + :type image_promotion: ImagePromotion + :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_image_promotion_serialize( + name=name, + image_promotion=image_promotion, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ImagePromotion", + '201': "ImagePromotion", + '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_image_promotion_without_preload_content( + self, + name: Annotated[StrictStr, Field(description="The name of the ImagePromotion resource.")], + image_promotion: ImagePromotion, + _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_image_promotion + + 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. + + :param name: The name of the ImagePromotion resource. (required) + :type name: str + :param image_promotion: (required) + :type image_promotion: ImagePromotion + :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_image_promotion_serialize( + name=name, + image_promotion=image_promotion, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ImagePromotion", + '201': "ImagePromotion", + '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_image_promotion_serialize( + self, + name, + image_promotion, + _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 + # process the header parameters + # process the form parameters + # process the body parameter + if image_promotion is not None: + _body_params = image_promotion + + + # 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' + ] + ) + ) + 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='/api/v1/imagepromotions/{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 + ) + + diff --git a/flightctl/imagebuilder/api_client.py b/flightctl/imagebuilder/api_client.py index 1b79099..2055997 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.1.0/python' + self.user_agent = 'OpenAPI-Generator/1.2.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 6fd6cfd..2000ca7 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.1.0".\ + "SDK Package Version: 1.2.0".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self) -> List[HostSetting]: diff --git a/flightctl/imagebuilder/docs/ArtifactPromotionStatus.md b/flightctl/imagebuilder/docs/ArtifactPromotionStatus.md new file mode 100644 index 0000000..fe00209 --- /dev/null +++ b/flightctl/imagebuilder/docs/ArtifactPromotionStatus.md @@ -0,0 +1,32 @@ +# ArtifactPromotionStatus + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**format** | **str** | Artifact format. \"container\" for the ImageBuild artifact; one of the exportFormats values for additional artifacts. | +**ready** | **bool** | True when at least one successful artifact of this format is available. | +**published** | **bool** | 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. | +**resolved_export** | **str** | 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. | [optional] + +## Example + +```python +from flightctl.imagebuilder.models.artifact_promotion_status import ArtifactPromotionStatus + +# TODO update the JSON string below +json = "{}" +# create an instance of ArtifactPromotionStatus from a JSON string +artifact_promotion_status_instance = ArtifactPromotionStatus.from_json(json) +# print the JSON string representation of the object +print(ArtifactPromotionStatus.to_json()) + +# convert the object into a dict +artifact_promotion_status_dict = artifact_promotion_status_instance.to_dict() +# create an instance of ArtifactPromotionStatus from a dict +artifact_promotion_status_from_dict = ArtifactPromotionStatus.from_dict(artifact_promotion_status_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/imagebuilder/docs/ExistingCatalogItemTarget.md b/flightctl/imagebuilder/docs/ExistingCatalogItemTarget.md new file mode 100644 index 0000000..d1023a2 --- /dev/null +++ b/flightctl/imagebuilder/docs/ExistingCatalogItemTarget.md @@ -0,0 +1,37 @@ +# ExistingCatalogItemTarget + +Publish target that appends a version to an existing CatalogItem. Rejected immediately if the CatalogItem does not exist. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | Discriminator for the target type. | +**catalog_name** | **str** | Name of the parent Catalog resource. | +**catalog_item_name** | **str** | Name of the CatalogItem to update. | +**version** | **str** | Semver version string for the new CatalogItem version entry. | +**readme** | **str** | Optional version-level readme for this version entry. Markdown is supported. | [optional] +**replaces** | **str** | The single version this one replaces, defining the primary upgrade edge. | [optional] +**skips** | **List[str]** | Additional versions that can upgrade directly to this one. | [optional] +**skip_range** | **str** | Semver range of versions that can upgrade directly to this one (e.g. \">=1.0.0 <1.3.0\"). | [optional] + +## Example + +```python +from flightctl.imagebuilder.models.existing_catalog_item_target import ExistingCatalogItemTarget + +# TODO update the JSON string below +json = "{}" +# create an instance of ExistingCatalogItemTarget from a JSON string +existing_catalog_item_target_instance = ExistingCatalogItemTarget.from_json(json) +# print the JSON string representation of the object +print(ExistingCatalogItemTarget.to_json()) + +# convert the object into a dict +existing_catalog_item_target_dict = existing_catalog_item_target_instance.to_dict() +# create an instance of ExistingCatalogItemTarget from a dict +existing_catalog_item_target_from_dict = ExistingCatalogItemTarget.from_dict(existing_catalog_item_target_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/imagebuilder/docs/ImageBuildConditionReason.md b/flightctl/imagebuilder/docs/ImageBuildConditionReason.md index b9fd95c..4380e19 100644 --- a/flightctl/imagebuilder/docs/ImageBuildConditionReason.md +++ b/flightctl/imagebuilder/docs/ImageBuildConditionReason.md @@ -10,6 +10,8 @@ Reason for the ImageBuild Ready condition. * `ImageBuildConditionReasonPushing` (value: `'Pushing'`) +* `ImageBuildConditionReasonGeneratingSBOM` (value: `'GeneratingSBOM'`) + * `ImageBuildConditionReasonCompleted` (value: `'Completed'`) * `ImageBuildConditionReasonFailed` (value: `'Failed'`) diff --git a/flightctl/imagebuilder/docs/ImageBuildNewVersionRequest.md b/flightctl/imagebuilder/docs/ImageBuildNewVersionRequest.md new file mode 100644 index 0000000..891057d --- /dev/null +++ b/flightctl/imagebuilder/docs/ImageBuildNewVersionRequest.md @@ -0,0 +1,32 @@ +# ImageBuildNewVersionRequest + +Request body for the newversion subresource endpoint. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Name for the new ImageBuild resource. | +**source_image_tag** | **str** | Override for spec.source.imageTag. If omitted, the parent's tag is used. | [optional] +**destination_image_tag** | **str** | Override for spec.destination.imageTag. If omitted, the parent's tag is used. | [optional] + +## Example + +```python +from flightctl.imagebuilder.models.image_build_new_version_request import ImageBuildNewVersionRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of ImageBuildNewVersionRequest from a JSON string +image_build_new_version_request_instance = ImageBuildNewVersionRequest.from_json(json) +# print the JSON string representation of the object +print(ImageBuildNewVersionRequest.to_json()) + +# convert the object into a dict +image_build_new_version_request_dict = image_build_new_version_request_instance.to_dict() +# create an instance of ImageBuildNewVersionRequest from a dict +image_build_new_version_request_from_dict = ImageBuildNewVersionRequest.from_dict(image_build_new_version_request_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/imagebuilder/docs/ImagePromotion.md b/flightctl/imagebuilder/docs/ImagePromotion.md new file mode 100644 index 0000000..db8d676 --- /dev/null +++ b/flightctl/imagebuilder/docs/ImagePromotion.md @@ -0,0 +1,34 @@ +# ImagePromotion + +ImagePromotion tracks a single publish attempt from an ImageBuild to a CatalogItem. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | [**ApiVersion**](ApiVersion.md) | | +**kind** | **str** | Kind is a string value representing the REST resource this object represents. | +**metadata** | [**ObjectMeta**](ObjectMeta.md) | | +**spec** | [**ImagePromotionSpec**](ImagePromotionSpec.md) | | +**status** | [**ImagePromotionStatus**](ImagePromotionStatus.md) | | [optional] + +## Example + +```python +from flightctl.imagebuilder.models.image_promotion import ImagePromotion + +# TODO update the JSON string below +json = "{}" +# create an instance of ImagePromotion from a JSON string +image_promotion_instance = ImagePromotion.from_json(json) +# print the JSON string representation of the object +print(ImagePromotion.to_json()) + +# convert the object into a dict +image_promotion_dict = image_promotion_instance.to_dict() +# create an instance of ImagePromotion from a dict +image_promotion_from_dict = ImagePromotion.from_dict(image_promotion_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/imagebuilder/docs/ImagePromotionCondition.md b/flightctl/imagebuilder/docs/ImagePromotionCondition.md new file mode 100644 index 0000000..f6455bc --- /dev/null +++ b/flightctl/imagebuilder/docs/ImagePromotionCondition.md @@ -0,0 +1,35 @@ +# ImagePromotionCondition + +Condition for ImagePromotion resources. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | [**ConditionStatus**](ConditionStatus.md) | | +**observed_generation** | **int** | The .metadata.generation that the condition was set based upon. | [optional] +**last_transition_time** | **datetime** | The last time the condition transitioned from one status to another. | +**message** | **str** | Human readable message indicating details about last transition. | +**reason** | **str** | A (brief) reason for the condition's last transition. | +**type** | [**ImagePromotionConditionType**](ImagePromotionConditionType.md) | | + +## Example + +```python +from flightctl.imagebuilder.models.image_promotion_condition import ImagePromotionCondition + +# TODO update the JSON string below +json = "{}" +# create an instance of ImagePromotionCondition from a JSON string +image_promotion_condition_instance = ImagePromotionCondition.from_json(json) +# print the JSON string representation of the object +print(ImagePromotionCondition.to_json()) + +# convert the object into a dict +image_promotion_condition_dict = image_promotion_condition_instance.to_dict() +# create an instance of ImagePromotionCondition from a dict +image_promotion_condition_from_dict = ImagePromotionCondition.from_dict(image_promotion_condition_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/imagebuilder/docs/ImagePromotionConditionReason.md b/flightctl/imagebuilder/docs/ImagePromotionConditionReason.md new file mode 100644 index 0000000..aa0814c --- /dev/null +++ b/flightctl/imagebuilder/docs/ImagePromotionConditionReason.md @@ -0,0 +1,23 @@ +# ImagePromotionConditionReason + +Reason for the ImagePromotion Ready condition. + +## Enum + +* `ImagePromotionConditionReasonWaitingForArtifacts` (value: `'WaitingForArtifacts'`) + +* `ImagePromotionConditionReasonPublishing` (value: `'Publishing'`) + +* `ImagePromotionConditionReasonCompleted` (value: `'Completed'`) + +* `ImagePromotionConditionReasonFailed` (value: `'Failed'`) + +* `ImagePromotionConditionReasonBuildFailed` (value: `'BuildFailed'`) + +* `ImagePromotionConditionReasonBuildCanceled` (value: `'BuildCanceled'`) + +* `ImagePromotionConditionReasonAmendmentFailed` (value: `'AmendmentFailed'`) + +[[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/imagebuilder/docs/ImagePromotionConditionType.md b/flightctl/imagebuilder/docs/ImagePromotionConditionType.md new file mode 100644 index 0000000..5ac8818 --- /dev/null +++ b/flightctl/imagebuilder/docs/ImagePromotionConditionType.md @@ -0,0 +1,11 @@ +# ImagePromotionConditionType + +Type of ImagePromotion condition. + +## Enum + +* `ImagePromotionConditionTypeReady` (value: `'Ready'`) + +[[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/imagebuilder/docs/ImagePromotionList.md b/flightctl/imagebuilder/docs/ImagePromotionList.md new file mode 100644 index 0000000..da9e8ab --- /dev/null +++ b/flightctl/imagebuilder/docs/ImagePromotionList.md @@ -0,0 +1,33 @@ +# ImagePromotionList + +ImagePromotionList is a list of ImagePromotion resources. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | [**ApiVersion**](ApiVersion.md) | | +**kind** | **str** | Kind is a string value representing the REST resource this object represents. | +**metadata** | [**ListMeta**](ListMeta.md) | | +**items** | [**List[ImagePromotion]**](ImagePromotion.md) | List of ImagePromotion resources. | + +## Example + +```python +from flightctl.imagebuilder.models.image_promotion_list import ImagePromotionList + +# TODO update the JSON string below +json = "{}" +# create an instance of ImagePromotionList from a JSON string +image_promotion_list_instance = ImagePromotionList.from_json(json) +# print the JSON string representation of the object +print(ImagePromotionList.to_json()) + +# convert the object into a dict +image_promotion_list_dict = image_promotion_list_instance.to_dict() +# create an instance of ImagePromotionList from a dict +image_promotion_list_from_dict = ImagePromotionList.from_dict(image_promotion_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/imagebuilder/docs/ImagePromotionSource.md b/flightctl/imagebuilder/docs/ImagePromotionSource.md new file mode 100644 index 0000000..3f6af14 --- /dev/null +++ b/flightctl/imagebuilder/docs/ImagePromotionSource.md @@ -0,0 +1,31 @@ +# ImagePromotionSource + +Identifies the artifact(s) to publish. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**image_build_ref** | **str** | 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. | +**export_formats** | [**List[ExportFormatType]**](ExportFormatType.md) | 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. | [optional] + +## Example + +```python +from flightctl.imagebuilder.models.image_promotion_source import ImagePromotionSource + +# TODO update the JSON string below +json = "{}" +# create an instance of ImagePromotionSource from a JSON string +image_promotion_source_instance = ImagePromotionSource.from_json(json) +# print the JSON string representation of the object +print(ImagePromotionSource.to_json()) + +# convert the object into a dict +image_promotion_source_dict = image_promotion_source_instance.to_dict() +# create an instance of ImagePromotionSource from a dict +image_promotion_source_from_dict = ImagePromotionSource.from_dict(image_promotion_source_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/imagebuilder/docs/ImagePromotionSpec.md b/flightctl/imagebuilder/docs/ImagePromotionSpec.md new file mode 100644 index 0000000..70a1a50 --- /dev/null +++ b/flightctl/imagebuilder/docs/ImagePromotionSpec.md @@ -0,0 +1,31 @@ +# ImagePromotionSpec + +Desired state of an ImagePromotion resource. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**source** | [**ImagePromotionSource**](ImagePromotionSource.md) | | +**target** | [**ImagePromotionTarget**](ImagePromotionTarget.md) | | + +## Example + +```python +from flightctl.imagebuilder.models.image_promotion_spec import ImagePromotionSpec + +# TODO update the JSON string below +json = "{}" +# create an instance of ImagePromotionSpec from a JSON string +image_promotion_spec_instance = ImagePromotionSpec.from_json(json) +# print the JSON string representation of the object +print(ImagePromotionSpec.to_json()) + +# convert the object into a dict +image_promotion_spec_dict = image_promotion_spec_instance.to_dict() +# create an instance of ImagePromotionSpec from a dict +image_promotion_spec_from_dict = ImagePromotionSpec.from_dict(image_promotion_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/flightctl/imagebuilder/docs/ImagePromotionStatus.md b/flightctl/imagebuilder/docs/ImagePromotionStatus.md new file mode 100644 index 0000000..c93deb5 --- /dev/null +++ b/flightctl/imagebuilder/docs/ImagePromotionStatus.md @@ -0,0 +1,33 @@ +# ImagePromotionStatus + +Observed state of an ImagePromotion resource. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**conditions** | [**List[ImagePromotionCondition]**](ImagePromotionCondition.md) | Conditions describing the current state of the promotion lifecycle. | [optional] +**published_at** | **datetime** | Timestamp of the initial successful promotion. Set once when the promotion first reaches Completed state. Not updated by subsequent amendments. | [optional] +**last_amended_at** | **datetime** | 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. | [optional] +**artifact_statuses** | [**List[ArtifactPromotionStatus]**](ArtifactPromotionStatus.md) | 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. | [optional] + +## Example + +```python +from flightctl.imagebuilder.models.image_promotion_status import ImagePromotionStatus + +# TODO update the JSON string below +json = "{}" +# create an instance of ImagePromotionStatus from a JSON string +image_promotion_status_instance = ImagePromotionStatus.from_json(json) +# print the JSON string representation of the object +print(ImagePromotionStatus.to_json()) + +# convert the object into a dict +image_promotion_status_dict = image_promotion_status_instance.to_dict() +# create an instance of ImagePromotionStatus from a dict +image_promotion_status_from_dict = ImagePromotionStatus.from_dict(image_promotion_status_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/imagebuilder/docs/ImagePromotionTarget.md b/flightctl/imagebuilder/docs/ImagePromotionTarget.md new file mode 100644 index 0000000..7bf9be8 --- /dev/null +++ b/flightctl/imagebuilder/docs/ImagePromotionTarget.md @@ -0,0 +1,38 @@ +# ImagePromotionTarget + +Specifies where and how to publish the artifact(s). The type field is the discriminator. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | Discriminator for the target type. | +**catalog_name** | **str** | Name of the parent Catalog resource. | +**catalog_item_name** | **str** | Name of the CatalogItem to update. | +**version** | **str** | Semver version string for the new CatalogItem version entry. | +**readme** | **str** | Optional version-level readme for this version entry. Markdown is supported. | [optional] +**display_name** | **str** | Optional human-readable display name for the new CatalogItem. | [optional] +**replaces** | **str** | The single version this one replaces, defining the primary upgrade edge. | [optional] +**skips** | **List[str]** | Additional versions that can upgrade directly to this one. | [optional] +**skip_range** | **str** | Semver range of versions that can upgrade directly to this one (e.g. \">=1.0.0 <1.3.0\"). | [optional] + +## Example + +```python +from flightctl.imagebuilder.models.image_promotion_target import ImagePromotionTarget + +# TODO update the JSON string below +json = "{}" +# create an instance of ImagePromotionTarget from a JSON string +image_promotion_target_instance = ImagePromotionTarget.from_json(json) +# print the JSON string representation of the object +print(ImagePromotionTarget.to_json()) + +# convert the object into a dict +image_promotion_target_dict = image_promotion_target_instance.to_dict() +# create an instance of ImagePromotionTarget from a dict +image_promotion_target_from_dict = ImagePromotionTarget.from_dict(image_promotion_target_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/imagebuilder/docs/ImagePromotionTargetBase.md b/flightctl/imagebuilder/docs/ImagePromotionTargetBase.md new file mode 100644 index 0000000..8642504 --- /dev/null +++ b/flightctl/imagebuilder/docs/ImagePromotionTargetBase.md @@ -0,0 +1,33 @@ +# ImagePromotionTargetBase + +Common fields shared by all ImagePromotionTarget variants. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | Discriminator for the target type. | +**catalog_name** | **str** | Name of the parent Catalog resource. | +**catalog_item_name** | **str** | Name of the CatalogItem to create or update. | +**version** | **str** | Semver version string for the new CatalogItem version entry. | + +## Example + +```python +from flightctl.imagebuilder.models.image_promotion_target_base import ImagePromotionTargetBase + +# TODO update the JSON string below +json = "{}" +# create an instance of ImagePromotionTargetBase from a JSON string +image_promotion_target_base_instance = ImagePromotionTargetBase.from_json(json) +# print the JSON string representation of the object +print(ImagePromotionTargetBase.to_json()) + +# convert the object into a dict +image_promotion_target_base_dict = image_promotion_target_base_instance.to_dict() +# create an instance of ImagePromotionTargetBase from a dict +image_promotion_target_base_from_dict = ImagePromotionTargetBase.from_dict(image_promotion_target_base_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/imagebuilder/docs/ImagePromotionTargetType.md b/flightctl/imagebuilder/docs/ImagePromotionTargetType.md new file mode 100644 index 0000000..d09cb67 --- /dev/null +++ b/flightctl/imagebuilder/docs/ImagePromotionTargetType.md @@ -0,0 +1,13 @@ +# ImagePromotionTargetType + +Discriminator for the promotion target type. + +## Enum + +* `ImagePromotionTargetTypeNewCatalogItem` (value: `'NewCatalogItem'`) + +* `ImagePromotionTargetTypeExistingCatalogItem` (value: `'ExistingCatalogItem'`) + +[[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/imagebuilder/docs/ImagebuildApi.md b/flightctl/imagebuilder/docs/ImagebuildApi.md index 96f0645..64c0cb7 100644 --- a/flightctl/imagebuilder/docs/ImagebuildApi.md +++ b/flightctl/imagebuilder/docs/ImagebuildApi.md @@ -6,6 +6,7 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**cancel_image_build**](ImagebuildApi.md#cancel_image_build) | **POST** /api/v1/imagebuilds/{name}/cancel | [**create_image_build**](ImagebuildApi.md#create_image_build) | **POST** /api/v1/imagebuilds | +[**create_image_build_new_version**](ImagebuildApi.md#create_image_build_new_version) | **POST** /api/v1/imagebuilds/{name}/newversion | [**delete_image_build**](ImagebuildApi.md#delete_image_build) | **DELETE** /api/v1/imagebuilds/{name} | [**get_image_build**](ImagebuildApi.md#get_image_build) | **GET** /api/v1/imagebuilds/{name} | [**get_image_build_log**](ImagebuildApi.md#get_image_build_log) | **GET** /api/v1/imagebuilds/{name}/log | @@ -155,8 +156,83 @@ 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) +# **create_image_build_new_version** +> ImageBuild create_image_build_new_version(name, image_build_new_version_request) + +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. + +### Example + + +```python +import flightctl.imagebuilder +from flightctl.imagebuilder.models.image_build import ImageBuild +from flightctl.imagebuilder.models.image_build_new_version_request import ImageBuildNewVersionRequest +from flightctl.imagebuilder.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = flightctl.imagebuilder.Configuration( + host = "http://localhost" +) + + +# Enter a context with an instance of the API client +with flightctl.imagebuilder.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = flightctl.imagebuilder.ImagebuildApi(api_client) + name = 'name_example' # str | The name of the parent ImageBuild resource. + image_build_new_version_request = flightctl.imagebuilder.ImageBuildNewVersionRequest() # ImageBuildNewVersionRequest | + + try: + api_response = api_instance.create_image_build_new_version(name, image_build_new_version_request) + print("The response of ImagebuildApi->create_image_build_new_version:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ImagebuildApi->create_image_build_new_version: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **str**| The name of the parent ImageBuild resource. | + **image_build_new_version_request** | [**ImageBuildNewVersionRequest**](ImageBuildNewVersionRequest.md)| | + +### Return type + +[**ImageBuild**](ImageBuild.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found - parent ImageBuild does not exist | - | +**409** | Conflict - ImageBuild with given name already exists | - | +**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) + # **delete_image_build** -> ImageBuild delete_image_build(name) +> Status delete_image_build(name) Delete an ImageBuild resource. @@ -165,7 +241,7 @@ Delete an ImageBuild resource. ```python import flightctl.imagebuilder -from flightctl.imagebuilder.models.image_build import ImageBuild +from flightctl.imagebuilder.models.status import Status from flightctl.imagebuilder.rest import ApiException from pprint import pprint @@ -201,7 +277,7 @@ Name | Type | Description | Notes ### Return type -[**ImageBuild**](ImageBuild.md) +[**Status**](Status.md) ### Authorization @@ -217,6 +293,7 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | +**400** | Bad Request. | - | **401** | Unauthorized | - | **403** | Forbidden | - | **404** | Not Found | - | @@ -289,6 +366,7 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | +**400** | Bad Request. | - | **401** | Unauthorized | - | **403** | Forbidden | - | **404** | Not Found | - | @@ -360,6 +438,7 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | +**400** | Bad Request. | - | **401** | Unauthorized | - | **403** | Forbidden | - | **404** | Not Found | - | diff --git a/flightctl/imagebuilder/docs/ImageexportApi.md b/flightctl/imagebuilder/docs/ImageexportApi.md index 07a4108..6e4e082 100644 --- a/flightctl/imagebuilder/docs/ImageexportApi.md +++ b/flightctl/imagebuilder/docs/ImageexportApi.md @@ -157,7 +157,7 @@ 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) # **delete_image_export** -> ImageExport delete_image_export(name) +> Status delete_image_export(name) Delete an ImageExport resource. @@ -166,7 +166,7 @@ Delete an ImageExport resource. ```python import flightctl.imagebuilder -from flightctl.imagebuilder.models.image_export import ImageExport +from flightctl.imagebuilder.models.status import Status from flightctl.imagebuilder.rest import ApiException from pprint import pprint @@ -202,7 +202,7 @@ Name | Type | Description | Notes ### Return type -[**ImageExport**](ImageExport.md) +[**Status**](Status.md) ### Authorization @@ -218,6 +218,7 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | +**400** | Bad Request. | - | **401** | Unauthorized | - | **403** | Forbidden | - | **404** | Not Found | - | @@ -361,6 +362,7 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | +**400** | Bad Request. | - | **401** | Unauthorized | - | **403** | Forbidden | - | **404** | Not Found | - | @@ -432,6 +434,7 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | +**400** | Bad Request. | - | **401** | Unauthorized | - | **403** | Forbidden | - | **404** | Not Found | - | diff --git a/flightctl/imagebuilder/docs/ImagepromotionApi.md b/flightctl/imagebuilder/docs/ImagepromotionApi.md new file mode 100644 index 0000000..3bfc97c --- /dev/null +++ b/flightctl/imagebuilder/docs/ImagepromotionApi.md @@ -0,0 +1,456 @@ +# flightctl.imagebuilder.ImagepromotionApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_image_promotion**](ImagepromotionApi.md#create_image_promotion) | **POST** /api/v1/imagepromotions | +[**delete_image_promotion**](ImagepromotionApi.md#delete_image_promotion) | **DELETE** /api/v1/imagepromotions/{name} | +[**get_image_promotion**](ImagepromotionApi.md#get_image_promotion) | **GET** /api/v1/imagepromotions/{name} | +[**list_image_promotions**](ImagepromotionApi.md#list_image_promotions) | **GET** /api/v1/imagepromotions | +[**patch_image_promotion**](ImagepromotionApi.md#patch_image_promotion) | **PATCH** /api/v1/imagepromotions/{name} | +[**replace_image_promotion**](ImagepromotionApi.md#replace_image_promotion) | **PUT** /api/v1/imagepromotions/{name} | + + +# **create_image_promotion** +> ImagePromotion create_image_promotion(image_promotion) + +Create an ImagePromotion resource to publish a completed image build to the software catalog. + +### Example + + +```python +import flightctl.imagebuilder +from flightctl.imagebuilder.models.image_promotion import ImagePromotion +from flightctl.imagebuilder.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = flightctl.imagebuilder.Configuration( + host = "http://localhost" +) + + +# Enter a context with an instance of the API client +with flightctl.imagebuilder.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = flightctl.imagebuilder.ImagepromotionApi(api_client) + image_promotion = flightctl.imagebuilder.ImagePromotion() # ImagePromotion | + + try: + api_response = api_instance.create_image_promotion(image_promotion) + print("The response of ImagepromotionApi->create_image_promotion:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ImagepromotionApi->create_image_promotion: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **image_promotion** | [**ImagePromotion**](ImagePromotion.md)| | + +### Return type + +[**ImagePromotion**](ImagePromotion.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**409** | Conflict - an ImagePromotion with the given name already exists. | - | +**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) + +# **delete_image_promotion** +> Status delete_image_promotion(name) + +Delete an ImagePromotion resource. + +### Example + + +```python +import flightctl.imagebuilder +from flightctl.imagebuilder.models.status import Status +from flightctl.imagebuilder.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = flightctl.imagebuilder.Configuration( + host = "http://localhost" +) + + +# Enter a context with an instance of the API client +with flightctl.imagebuilder.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = flightctl.imagebuilder.ImagepromotionApi(api_client) + name = 'name_example' # str | The name of the ImagePromotion resource. + + try: + api_response = api_instance.delete_image_promotion(name) + print("The response of ImagepromotionApi->delete_image_promotion:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ImagepromotionApi->delete_image_promotion: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **str**| The name of the ImagePromotion resource. | + +### Return type + +[**Status**](Status.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) + +# **get_image_promotion** +> ImagePromotion get_image_promotion(name) + +Get an ImagePromotion resource. + +### Example + + +```python +import flightctl.imagebuilder +from flightctl.imagebuilder.models.image_promotion import ImagePromotion +from flightctl.imagebuilder.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = flightctl.imagebuilder.Configuration( + host = "http://localhost" +) + + +# Enter a context with an instance of the API client +with flightctl.imagebuilder.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = flightctl.imagebuilder.ImagepromotionApi(api_client) + name = 'name_example' # str | The name of the ImagePromotion resource. + + try: + api_response = api_instance.get_image_promotion(name) + print("The response of ImagepromotionApi->get_image_promotion:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ImagepromotionApi->get_image_promotion: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **str**| The name of the ImagePromotion resource. | + +### Return type + +[**ImagePromotion**](ImagePromotion.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 | - | +**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) + +# **list_image_promotions** +> ImagePromotionList list_image_promotions(label_selector=label_selector, field_selector=field_selector, limit=limit, var_continue=var_continue) + +List ImagePromotion resources. + +### Example + + +```python +import flightctl.imagebuilder +from flightctl.imagebuilder.models.image_promotion_list import ImagePromotionList +from flightctl.imagebuilder.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = flightctl.imagebuilder.Configuration( + host = "http://localhost" +) + + +# Enter a context with an instance of the API client +with flightctl.imagebuilder.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = flightctl.imagebuilder.ImagepromotionApi(api_client) + label_selector = 'label_selector_example' # str | A selector to restrict the list of returned objects by their labels. (optional) + field_selector = 'field_selector_example' # str | A selector to restrict the list of returned objects by their fields. (optional) + limit = 56 # int | The maximum number of results returned in the list response. (optional) + var_continue = 'var_continue_example' # str | An optional parameter to query more results from the server. (optional) + + try: + api_response = api_instance.list_image_promotions(label_selector=label_selector, field_selector=field_selector, limit=limit, var_continue=var_continue) + print("The response of ImagepromotionApi->list_image_promotions:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ImagepromotionApi->list_image_promotions: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **label_selector** | **str**| A selector to restrict the list of returned objects by their labels. | [optional] + **field_selector** | **str**| A selector to restrict the list of returned objects by their fields. | [optional] + **limit** | **int**| The maximum number of results returned in the list response. | [optional] + **var_continue** | **str**| An optional parameter to query more results from the server. | [optional] + +### Return type + +[**ImagePromotionList**](ImagePromotionList.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 | - | +**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) + +# **patch_image_promotion** +> ImagePromotion patch_image_promotion(name, patch_request_inner) + +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. + + +### Example + + +```python +import flightctl.imagebuilder +from flightctl.imagebuilder.models.image_promotion import ImagePromotion +from flightctl.imagebuilder.models.patch_request_inner import PatchRequestInner +from flightctl.imagebuilder.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = flightctl.imagebuilder.Configuration( + host = "http://localhost" +) + + +# Enter a context with an instance of the API client +with flightctl.imagebuilder.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = flightctl.imagebuilder.ImagepromotionApi(api_client) + name = 'name_example' # str | The name of the ImagePromotion resource. + patch_request_inner = [flightctl.imagebuilder.PatchRequestInner()] # List[PatchRequestInner] | + + try: + api_response = api_instance.patch_image_promotion(name, patch_request_inner) + print("The response of ImagepromotionApi->patch_image_promotion:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ImagepromotionApi->patch_image_promotion: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **str**| The name of the ImagePromotion resource. | + **patch_request_inner** | [**List[PatchRequestInner]**](PatchRequestInner.md)| | + +### Return type + +[**ImagePromotion**](ImagePromotion.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json-patch+json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**409** | Conflict | - | +**429** | Too Many Requests | - | +**503** | Service Unavailable | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **replace_image_promotion** +> ImagePromotion replace_image_promotion(name, image_promotion) + +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. + + +### Example + + +```python +import flightctl.imagebuilder +from flightctl.imagebuilder.models.image_promotion import ImagePromotion +from flightctl.imagebuilder.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = flightctl.imagebuilder.Configuration( + host = "http://localhost" +) + + +# Enter a context with an instance of the API client +with flightctl.imagebuilder.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = flightctl.imagebuilder.ImagepromotionApi(api_client) + name = 'name_example' # str | The name of the ImagePromotion resource. + image_promotion = flightctl.imagebuilder.ImagePromotion() # ImagePromotion | + + try: + api_response = api_instance.replace_image_promotion(name, image_promotion) + print("The response of ImagepromotionApi->replace_image_promotion:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ImagepromotionApi->replace_image_promotion: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **str**| The name of the ImagePromotion resource. | + **image_promotion** | [**ImagePromotion**](ImagePromotion.md)| | + +### Return type + +[**ImagePromotion**](ImagePromotion.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**201** | Created | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**409** | Conflict - concurrent update 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/flightctl/imagebuilder/docs/NewCatalogItemTarget.md b/flightctl/imagebuilder/docs/NewCatalogItemTarget.md new file mode 100644 index 0000000..bb903b9 --- /dev/null +++ b/flightctl/imagebuilder/docs/NewCatalogItemTarget.md @@ -0,0 +1,35 @@ +# NewCatalogItemTarget + +Publish target that creates a new CatalogItem. Rejected immediately if a CatalogItem with the given catalogItemName already exists. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | Discriminator for the target type. | +**catalog_name** | **str** | Name of the parent Catalog resource. | +**catalog_item_name** | **str** | Name of the CatalogItem to create. | +**version** | **str** | Semver version string for the new CatalogItem version entry. | +**readme** | **str** | Optional item-level readme for the new CatalogItem. Markdown is supported. | [optional] +**display_name** | **str** | Optional human-readable display name for the new CatalogItem. | [optional] + +## Example + +```python +from flightctl.imagebuilder.models.new_catalog_item_target import NewCatalogItemTarget + +# TODO update the JSON string below +json = "{}" +# create an instance of NewCatalogItemTarget from a JSON string +new_catalog_item_target_instance = NewCatalogItemTarget.from_json(json) +# print the JSON string representation of the object +print(NewCatalogItemTarget.to_json()) + +# convert the object into a dict +new_catalog_item_target_dict = new_catalog_item_target_instance.to_dict() +# create an instance of NewCatalogItemTarget from a dict +new_catalog_item_target_from_dict = NewCatalogItemTarget.from_dict(new_catalog_item_target_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/imagebuilder/docs/PatchRequestInner.md b/flightctl/imagebuilder/docs/PatchRequestInner.md new file mode 100644 index 0000000..a552c83 --- /dev/null +++ b/flightctl/imagebuilder/docs/PatchRequestInner.md @@ -0,0 +1,31 @@ +# PatchRequestInner + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**path** | **str** | A JSON Pointer path. | +**value** | **object** | The value to add or replace. | [optional] +**op** | **str** | The operation to perform. | + +## Example + +```python +from flightctl.imagebuilder.models.patch_request_inner import PatchRequestInner + +# TODO update the JSON string below +json = "{}" +# create an instance of PatchRequestInner from a JSON string +patch_request_inner_instance = PatchRequestInner.from_json(json) +# print the JSON string representation of the object +print(PatchRequestInner.to_json()) + +# convert the object into a dict +patch_request_inner_dict = patch_request_inner_instance.to_dict() +# create an instance of PatchRequestInner from a dict +patch_request_inner_from_dict = PatchRequestInner.from_dict(patch_request_inner_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/imagebuilder/docs/ResourceKind.md b/flightctl/imagebuilder/docs/ResourceKind.md index a977434..935e7ea 100644 --- a/flightctl/imagebuilder/docs/ResourceKind.md +++ b/flightctl/imagebuilder/docs/ResourceKind.md @@ -8,6 +8,8 @@ Resource types exposed via the ImageBuilder API. * `IMAGEEXPORT` (value: `'ImageExport'`) +* `IMAGEPROMOTION` (value: `'ImagePromotion'`) + [[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/imagebuilder/models/__init__.py b/flightctl/imagebuilder/models/__init__.py index 0af8a54..c3860cb 100644 --- a/flightctl/imagebuilder/models/__init__.py +++ b/flightctl/imagebuilder/models/__init__.py @@ -15,10 +15,12 @@ # import models into model package from flightctl.imagebuilder.models.api_version import ApiVersion +from flightctl.imagebuilder.models.artifact_promotion_status import ArtifactPromotionStatus from flightctl.imagebuilder.models.binding_type import BindingType from flightctl.imagebuilder.models.condition_base import ConditionBase from flightctl.imagebuilder.models.condition_status import ConditionStatus from flightctl.imagebuilder.models.early_binding import EarlyBinding +from flightctl.imagebuilder.models.existing_catalog_item_target import ExistingCatalogItemTarget from flightctl.imagebuilder.models.export_format_type import ExportFormatType from flightctl.imagebuilder.models.image_build import ImageBuild from flightctl.imagebuilder.models.image_build_binding import ImageBuildBinding @@ -27,6 +29,7 @@ from flightctl.imagebuilder.models.image_build_condition_type import ImageBuildConditionType from flightctl.imagebuilder.models.image_build_destination import ImageBuildDestination from flightctl.imagebuilder.models.image_build_list import ImageBuildList +from flightctl.imagebuilder.models.image_build_new_version_request import ImageBuildNewVersionRequest from flightctl.imagebuilder.models.image_build_ref_source import ImageBuildRefSource from flightctl.imagebuilder.models.image_build_source import ImageBuildSource from flightctl.imagebuilder.models.image_build_spec import ImageBuildSpec @@ -41,9 +44,22 @@ from flightctl.imagebuilder.models.image_export_source_type import ImageExportSourceType from flightctl.imagebuilder.models.image_export_spec import ImageExportSpec from flightctl.imagebuilder.models.image_export_status import ImageExportStatus +from flightctl.imagebuilder.models.image_promotion import ImagePromotion +from flightctl.imagebuilder.models.image_promotion_condition import ImagePromotionCondition +from flightctl.imagebuilder.models.image_promotion_condition_reason import ImagePromotionConditionReason +from flightctl.imagebuilder.models.image_promotion_condition_type import ImagePromotionConditionType +from flightctl.imagebuilder.models.image_promotion_list import ImagePromotionList +from flightctl.imagebuilder.models.image_promotion_source import ImagePromotionSource +from flightctl.imagebuilder.models.image_promotion_spec import ImagePromotionSpec +from flightctl.imagebuilder.models.image_promotion_status import ImagePromotionStatus +from flightctl.imagebuilder.models.image_promotion_target import ImagePromotionTarget +from flightctl.imagebuilder.models.image_promotion_target_base import ImagePromotionTargetBase +from flightctl.imagebuilder.models.image_promotion_target_type import ImagePromotionTargetType from flightctl.imagebuilder.models.late_binding import LateBinding from flightctl.imagebuilder.models.list_meta import ListMeta +from flightctl.imagebuilder.models.new_catalog_item_target import NewCatalogItemTarget from flightctl.imagebuilder.models.object_meta import ObjectMeta +from flightctl.imagebuilder.models.patch_request_inner import PatchRequestInner from flightctl.imagebuilder.models.resource_kind import ResourceKind from flightctl.imagebuilder.models.status import Status diff --git a/flightctl/imagebuilder/models/artifact_promotion_status.py b/flightctl/imagebuilder/models/artifact_promotion_status.py new file mode 100644 index 0000000..e6d7a85 --- /dev/null +++ b/flightctl/imagebuilder/models/artifact_promotion_status.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Flight Control Image Builder API + + Image Builder service for Flight Control. This service manages image build resources for building and pushing container images. + + 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, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ArtifactPromotionStatus(BaseModel): + """ + ArtifactPromotionStatus + """ # noqa: E501 + format: StrictStr = Field(description="Artifact format. \"container\" for the ImageBuild artifact; one of the exportFormats values for additional artifacts.") + ready: StrictBool = Field(description="True when at least one successful artifact of this format is available.") + published: StrictBool = Field(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.") + resolved_export: Optional[StrictStr] = Field(default=None, 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.", alias="resolvedExport") + __properties: ClassVar[List[str]] = ["format", "ready", "published", "resolvedExport"] + + 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 ArtifactPromotionStatus 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 ArtifactPromotionStatus from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "format": obj.get("format"), + "ready": obj.get("ready"), + "published": obj.get("published"), + "resolvedExport": obj.get("resolvedExport") + }) + return _obj + + diff --git a/flightctl/imagebuilder/models/existing_catalog_item_target.py b/flightctl/imagebuilder/models/existing_catalog_item_target.py new file mode 100644 index 0000000..dc10362 --- /dev/null +++ b/flightctl/imagebuilder/models/existing_catalog_item_target.py @@ -0,0 +1,109 @@ +# coding: utf-8 + +""" + Flight Control Image Builder API + + Image Builder service for Flight Control. This service manages image build resources for building and pushing container images. + + 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, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ExistingCatalogItemTarget(BaseModel): + """ + Publish target that appends a version to an existing CatalogItem. Rejected immediately if the CatalogItem does not exist. + """ # noqa: E501 + type: StrictStr = Field(description="Discriminator for the target type.") + catalog_name: StrictStr = Field(description="Name of the parent Catalog resource.", alias="catalogName") + catalog_item_name: StrictStr = Field(description="Name of the CatalogItem to update.", alias="catalogItemName") + version: StrictStr = Field(description="Semver version string for the new CatalogItem version entry.") + readme: Optional[StrictStr] = Field(default=None, description="Optional version-level readme for this version entry. Markdown is supported.") + replaces: Optional[StrictStr] = Field(default=None, description="The single version this one replaces, defining the primary upgrade edge.") + skips: Optional[List[StrictStr]] = Field(default=None, description="Additional versions that can upgrade directly to this one.") + skip_range: Optional[StrictStr] = Field(default=None, description="Semver range of versions that can upgrade directly to this one (e.g. \">=1.0.0 <1.3.0\").", alias="skipRange") + __properties: ClassVar[List[str]] = ["type", "catalogName", "catalogItemName", "version", "readme", "replaces", "skips", "skipRange"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['ExistingCatalogItem']): + raise ValueError("must be one of enum values ('ExistingCatalogItem')") + 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 ExistingCatalogItemTarget 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 ExistingCatalogItemTarget from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type"), + "catalogName": obj.get("catalogName"), + "catalogItemName": obj.get("catalogItemName"), + "version": obj.get("version"), + "readme": obj.get("readme"), + "replaces": obj.get("replaces"), + "skips": obj.get("skips"), + "skipRange": obj.get("skipRange") + }) + return _obj + + diff --git a/flightctl/imagebuilder/models/image_build_condition_reason.py b/flightctl/imagebuilder/models/image_build_condition_reason.py index bb1b3e8..e41da32 100644 --- a/flightctl/imagebuilder/models/image_build_condition_reason.py +++ b/flightctl/imagebuilder/models/image_build_condition_reason.py @@ -30,6 +30,7 @@ class ImageBuildConditionReason(str, Enum): ImageBuildConditionReasonPending = 'Pending' ImageBuildConditionReasonBuilding = 'Building' ImageBuildConditionReasonPushing = 'Pushing' + ImageBuildConditionReasonGeneratingSBOM = 'GeneratingSBOM' ImageBuildConditionReasonCompleted = 'Completed' ImageBuildConditionReasonFailed = 'Failed' ImageBuildConditionReasonCanceling = 'Canceling' diff --git a/flightctl/imagebuilder/models/image_build_destination.py b/flightctl/imagebuilder/models/image_build_destination.py index 71b2197..a54c352 100644 --- a/flightctl/imagebuilder/models/image_build_destination.py +++ b/flightctl/imagebuilder/models/image_build_destination.py @@ -18,8 +18,9 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, field_validator from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated from typing import Optional, Set from typing_extensions import Self @@ -27,11 +28,18 @@ class ImageBuildDestination(BaseModel): """ ImageBuildDestination specifies the destination for the built image. """ # noqa: E501 - repository: StrictStr = Field(description="The name of the Repository resource of type OCI to push the built image to.") - image_name: StrictStr = Field(description="The name of the output image.", alias="imageName") - image_tag: StrictStr = Field(description="The tag of the output image.", alias="imageTag") + repository: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of the Repository resource of type OCI to push the built image to.") + image_name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="The name of the output image.", alias="imageName") + image_tag: Annotated[str, Field(min_length=1, strict=True, max_length=128)] = Field(description="The tag of the output image.", alias="imageTag") __properties: ClassVar[List[str]] = ["repository", "imageName", "imageTag"] + @field_validator('image_tag') + def image_tag_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^[\w][\w.-]{0,127}$", value): + raise ValueError(r"must validate the regular expression /^[\w][\w.-]{0,127}$/") + return value + model_config = ConfigDict( populate_by_name=True, validate_assignment=True, diff --git a/flightctl/imagebuilder/models/image_build_new_version_request.py b/flightctl/imagebuilder/models/image_build_new_version_request.py new file mode 100644 index 0000000..e4d905f --- /dev/null +++ b/flightctl/imagebuilder/models/image_build_new_version_request.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + Flight Control Image Builder API + + Image Builder service for Flight Control. This service manages image build resources for building and pushing container images. + + 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, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class ImageBuildNewVersionRequest(BaseModel): + """ + Request body for the newversion subresource endpoint. + """ # noqa: E501 + name: Annotated[str, Field(min_length=1, strict=True, max_length=253)] = Field(description="Name for the new ImageBuild resource.") + source_image_tag: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]] = Field(default=None, description="Override for spec.source.imageTag. If omitted, the parent's tag is used.", alias="sourceImageTag") + destination_image_tag: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]] = Field(default=None, description="Override for spec.destination.imageTag. If omitted, the parent's tag is used.", alias="destinationImageTag") + __properties: ClassVar[List[str]] = ["name", "sourceImageTag", "destinationImageTag"] + + @field_validator('source_image_tag') + def source_image_tag_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^[\w][\w.-]{0,127}$", value): + raise ValueError(r"must validate the regular expression /^[\w][\w.-]{0,127}$/") + return value + + @field_validator('destination_image_tag') + def destination_image_tag_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^[\w][\w.-]{0,127}$", value): + raise ValueError(r"must validate the regular expression /^[\w][\w.-]{0,127}$/") + 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 ImageBuildNewVersionRequest 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 ImageBuildNewVersionRequest 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"), + "sourceImageTag": obj.get("sourceImageTag"), + "destinationImageTag": obj.get("destinationImageTag") + }) + return _obj + + diff --git a/flightctl/imagebuilder/models/image_build_ref_source.py b/flightctl/imagebuilder/models/image_build_ref_source.py index de91475..33ac455 100644 --- a/flightctl/imagebuilder/models/image_build_ref_source.py +++ b/flightctl/imagebuilder/models/image_build_ref_source.py @@ -20,6 +20,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated from typing import Optional, Set from typing_extensions import Self @@ -28,7 +29,7 @@ class ImageBuildRefSource(BaseModel): ImageBuildRefSource specifies a source image from an ImageBuild resource. """ # noqa: E501 type: StrictStr = Field(description="The type of source.") - image_build_ref: StrictStr = Field(description="The name of the ImageBuild resource to use as source.", alias="imageBuildRef") + image_build_ref: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of the ImageBuild resource to use as source.", alias="imageBuildRef") __properties: ClassVar[List[str]] = ["type", "imageBuildRef"] @field_validator('type') diff --git a/flightctl/imagebuilder/models/image_build_source.py b/flightctl/imagebuilder/models/image_build_source.py index 15c71bb..7b60b2a 100644 --- a/flightctl/imagebuilder/models/image_build_source.py +++ b/flightctl/imagebuilder/models/image_build_source.py @@ -18,8 +18,9 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, field_validator from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated from typing import Optional, Set from typing_extensions import Self @@ -27,11 +28,18 @@ class ImageBuildSource(BaseModel): """ ImageBuildSource specifies the source image for the build. """ # noqa: E501 - repository: StrictStr = Field(description="The name of the Repository resource of type OCI containing the source image.") - image_name: StrictStr = Field(description="The name of the source image.", alias="imageName") - image_tag: StrictStr = Field(description="The tag of the source image.", alias="imageTag") + repository: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of the Repository resource of type OCI containing the source image.") + image_name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="The name of the source image.", alias="imageName") + image_tag: Annotated[str, Field(min_length=1, strict=True, max_length=128)] = Field(description="The tag of the source image.", alias="imageTag") __properties: ClassVar[List[str]] = ["repository", "imageName", "imageTag"] + @field_validator('image_tag') + def image_tag_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^[\w][\w.-]{0,127}$", value): + raise ValueError(r"must validate the regular expression /^[\w][\w.-]{0,127}$/") + return value + model_config = ConfigDict( populate_by_name=True, validate_assignment=True, diff --git a/flightctl/imagebuilder/models/image_promotion.py b/flightctl/imagebuilder/models/image_promotion.py new file mode 100644 index 0000000..38c87fa --- /dev/null +++ b/flightctl/imagebuilder/models/image_promotion.py @@ -0,0 +1,109 @@ +# coding: utf-8 + +""" + Flight Control Image Builder API + + Image Builder service for Flight Control. This service manages image build resources for building and pushing container images. + + 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.imagebuilder.models.api_version import ApiVersion +from flightctl.imagebuilder.models.image_promotion_spec import ImagePromotionSpec +from flightctl.imagebuilder.models.image_promotion_status import ImagePromotionStatus +from flightctl.imagebuilder.models.object_meta import ObjectMeta +from typing import Optional, Set +from typing_extensions import Self + +class ImagePromotion(BaseModel): + """ + ImagePromotion tracks a single publish attempt from an ImageBuild to a CatalogItem. + """ # noqa: E501 + api_version: ApiVersion = Field(alias="apiVersion") + kind: StrictStr = Field(description="Kind is a string value representing the REST resource this object represents.") + metadata: ObjectMeta + spec: ImagePromotionSpec + status: Optional[ImagePromotionStatus] = None + __properties: ClassVar[List[str]] = ["apiVersion", "kind", "metadata", "spec", "status"] + + 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 ImagePromotion 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 spec + if self.spec: + _dict['spec'] = self.spec.to_dict() + # override the default output from pydantic by calling `to_dict()` of status + if self.status: + _dict['status'] = self.status.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ImagePromotion 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": ObjectMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "spec": ImagePromotionSpec.from_dict(obj["spec"]) if obj.get("spec") is not None else None, + "status": ImagePromotionStatus.from_dict(obj["status"]) if obj.get("status") is not None else None + }) + return _obj + + diff --git a/flightctl/imagebuilder/models/image_promotion_condition.py b/flightctl/imagebuilder/models/image_promotion_condition.py new file mode 100644 index 0000000..a0b4b50 --- /dev/null +++ b/flightctl/imagebuilder/models/image_promotion_condition.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Flight Control Image Builder API + + Image Builder service for Flight Control. This service manages image build resources for building and pushing container images. + + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from flightctl.imagebuilder.models.condition_status import ConditionStatus +from flightctl.imagebuilder.models.image_promotion_condition_type import ImagePromotionConditionType +from typing import Optional, Set +from typing_extensions import Self + +class ImagePromotionCondition(BaseModel): + """ + Condition for ImagePromotion resources. + """ # noqa: E501 + status: ConditionStatus + observed_generation: Optional[StrictInt] = Field(default=None, description="The .metadata.generation that the condition was set based upon.", alias="observedGeneration") + last_transition_time: datetime = Field(description="The last time the condition transitioned from one status to another.", alias="lastTransitionTime") + message: StrictStr = Field(description="Human readable message indicating details about last transition.") + reason: StrictStr = Field(description="A (brief) reason for the condition's last transition.") + type: ImagePromotionConditionType + __properties: ClassVar[List[str]] = ["status", "observedGeneration", "lastTransitionTime", "message", "reason", "type"] + + 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 ImagePromotionCondition 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 ImagePromotionCondition from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "status": obj.get("status"), + "observedGeneration": obj.get("observedGeneration"), + "lastTransitionTime": obj.get("lastTransitionTime"), + "message": obj.get("message"), + "reason": obj.get("reason"), + "type": obj.get("type") + }) + return _obj + + diff --git a/flightctl/imagebuilder/models/image_promotion_condition_reason.py b/flightctl/imagebuilder/models/image_promotion_condition_reason.py new file mode 100644 index 0000000..97b1721 --- /dev/null +++ b/flightctl/imagebuilder/models/image_promotion_condition_reason.py @@ -0,0 +1,43 @@ +# coding: utf-8 + +""" + Flight Control Image Builder API + + Image Builder service for Flight Control. This service manages image build resources for building and pushing container images. + + 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 json +from enum import Enum +from typing_extensions import Self + + +class ImagePromotionConditionReason(str, Enum): + """ + Reason for the ImagePromotion Ready condition. + """ + + """ + allowed enum values + """ + ImagePromotionConditionReasonWaitingForArtifacts = 'WaitingForArtifacts' + ImagePromotionConditionReasonPublishing = 'Publishing' + ImagePromotionConditionReasonCompleted = 'Completed' + ImagePromotionConditionReasonFailed = 'Failed' + ImagePromotionConditionReasonBuildFailed = 'BuildFailed' + ImagePromotionConditionReasonBuildCanceled = 'BuildCanceled' + ImagePromotionConditionReasonAmendmentFailed = 'AmendmentFailed' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ImagePromotionConditionReason from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/flightctl/imagebuilder/models/image_promotion_condition_type.py b/flightctl/imagebuilder/models/image_promotion_condition_type.py new file mode 100644 index 0000000..54cd2b2 --- /dev/null +++ b/flightctl/imagebuilder/models/image_promotion_condition_type.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + Flight Control Image Builder API + + Image Builder service for Flight Control. This service manages image build resources for building and pushing container images. + + 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 json +from enum import Enum +from typing_extensions import Self + + +class ImagePromotionConditionType(str, Enum): + """ + Type of ImagePromotion condition. + """ + + """ + allowed enum values + """ + ImagePromotionConditionTypeReady = 'Ready' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ImagePromotionConditionType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/flightctl/imagebuilder/models/image_promotion_list.py b/flightctl/imagebuilder/models/image_promotion_list.py new file mode 100644 index 0000000..b743ec8 --- /dev/null +++ b/flightctl/imagebuilder/models/image_promotion_list.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Flight Control Image Builder API + + Image Builder service for Flight Control. This service manages image build resources for building and pushing container images. + + 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.imagebuilder.models.api_version import ApiVersion +from flightctl.imagebuilder.models.image_promotion import ImagePromotion +from flightctl.imagebuilder.models.list_meta import ListMeta +from typing import Optional, Set +from typing_extensions import Self + +class ImagePromotionList(BaseModel): + """ + ImagePromotionList is a list of ImagePromotion resources. + """ # noqa: E501 + api_version: ApiVersion = Field(alias="apiVersion") + kind: StrictStr = Field(description="Kind is a string value representing the REST resource this object represents.") + metadata: ListMeta + items: List[ImagePromotion] = Field(description="List of ImagePromotion resources.") + __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 ImagePromotionList 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 ImagePromotionList 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": [ImagePromotion.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + }) + return _obj + + diff --git a/flightctl/imagebuilder/models/image_promotion_source.py b/flightctl/imagebuilder/models/image_promotion_source.py new file mode 100644 index 0000000..97b54d4 --- /dev/null +++ b/flightctl/imagebuilder/models/image_promotion_source.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Flight Control Image Builder API + + Image Builder service for Flight Control. This service manages image build resources for building and pushing container images. + + 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 +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from flightctl.imagebuilder.models.export_format_type import ExportFormatType +from typing import Optional, Set +from typing_extensions import Self + +class ImagePromotionSource(BaseModel): + """ + Identifies the artifact(s) to publish. + """ # noqa: E501 + image_build_ref: Annotated[str, Field(min_length=1, strict=True)] = Field(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.", alias="imageBuildRef") + export_formats: Optional[List[ExportFormatType]] = Field(default=None, 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.", alias="exportFormats") + __properties: ClassVar[List[str]] = ["imageBuildRef", "exportFormats"] + + 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 ImagePromotionSource 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 ImagePromotionSource from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "imageBuildRef": obj.get("imageBuildRef"), + "exportFormats": obj.get("exportFormats") + }) + return _obj + + diff --git a/flightctl/imagebuilder/models/image_promotion_spec.py b/flightctl/imagebuilder/models/image_promotion_spec.py new file mode 100644 index 0000000..42224f1 --- /dev/null +++ b/flightctl/imagebuilder/models/image_promotion_spec.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Flight Control Image Builder API + + Image Builder service for Flight Control. This service manages image build resources for building and pushing container images. + + 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 +from typing import Any, ClassVar, Dict, List +from flightctl.imagebuilder.models.image_promotion_source import ImagePromotionSource +from flightctl.imagebuilder.models.image_promotion_target import ImagePromotionTarget +from typing import Optional, Set +from typing_extensions import Self + +class ImagePromotionSpec(BaseModel): + """ + Desired state of an ImagePromotion resource. + """ # noqa: E501 + source: ImagePromotionSource + target: ImagePromotionTarget + __properties: ClassVar[List[str]] = ["source", "target"] + + 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 ImagePromotionSpec 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 source + if self.source: + _dict['source'] = self.source.to_dict() + # override the default output from pydantic by calling `to_dict()` of target + if self.target: + _dict['target'] = self.target.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ImagePromotionSpec from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "source": ImagePromotionSource.from_dict(obj["source"]) if obj.get("source") is not None else None, + "target": ImagePromotionTarget.from_dict(obj["target"]) if obj.get("target") is not None else None + }) + return _obj + + diff --git a/flightctl/imagebuilder/models/image_promotion_status.py b/flightctl/imagebuilder/models/image_promotion_status.py new file mode 100644 index 0000000..bb86877 --- /dev/null +++ b/flightctl/imagebuilder/models/image_promotion_status.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + Flight Control Image Builder API + + Image Builder service for Flight Control. This service manages image build resources for building and pushing container images. + + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from flightctl.imagebuilder.models.artifact_promotion_status import ArtifactPromotionStatus +from flightctl.imagebuilder.models.image_promotion_condition import ImagePromotionCondition +from typing import Optional, Set +from typing_extensions import Self + +class ImagePromotionStatus(BaseModel): + """ + Observed state of an ImagePromotion resource. + """ # noqa: E501 + conditions: Optional[List[ImagePromotionCondition]] = Field(default=None, description="Conditions describing the current state of the promotion lifecycle.") + published_at: Optional[datetime] = Field(default=None, description="Timestamp of the initial successful promotion. Set once when the promotion first reaches Completed state. Not updated by subsequent amendments.", alias="publishedAt") + last_amended_at: Optional[datetime] = Field(default=None, 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.", alias="lastAmendedAt") + artifact_statuses: Optional[List[ArtifactPromotionStatus]] = Field(default=None, 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.", alias="artifactStatuses") + __properties: ClassVar[List[str]] = ["conditions", "publishedAt", "lastAmendedAt", "artifactStatuses"] + + 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 ImagePromotionStatus 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 each item in conditions (list) + _items = [] + if self.conditions: + for _item_conditions in self.conditions: + if _item_conditions: + _items.append(_item_conditions.to_dict()) + _dict['conditions'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in artifact_statuses (list) + _items = [] + if self.artifact_statuses: + for _item_artifact_statuses in self.artifact_statuses: + if _item_artifact_statuses: + _items.append(_item_artifact_statuses.to_dict()) + _dict['artifactStatuses'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ImagePromotionStatus from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "conditions": [ImagePromotionCondition.from_dict(_item) for _item in obj["conditions"]] if obj.get("conditions") is not None else None, + "publishedAt": obj.get("publishedAt"), + "lastAmendedAt": obj.get("lastAmendedAt"), + "artifactStatuses": [ArtifactPromotionStatus.from_dict(_item) for _item in obj["artifactStatuses"]] if obj.get("artifactStatuses") is not None else None + }) + return _obj + + diff --git a/flightctl/imagebuilder/models/image_promotion_target.py b/flightctl/imagebuilder/models/image_promotion_target.py new file mode 100644 index 0000000..62d7d3f --- /dev/null +++ b/flightctl/imagebuilder/models/image_promotion_target.py @@ -0,0 +1,156 @@ +# coding: utf-8 + +""" + Flight Control Image Builder API + + Image Builder service for Flight Control. This service manages image build resources for building and pushing container images. + + 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 json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from flightctl.imagebuilder.models.existing_catalog_item_target import ExistingCatalogItemTarget +from flightctl.imagebuilder.models.new_catalog_item_target import NewCatalogItemTarget +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +IMAGEPROMOTIONTARGET_ONE_OF_SCHEMAS = ["ExistingCatalogItemTarget", "NewCatalogItemTarget"] + +class ImagePromotionTarget(BaseModel): + """ + Specifies where and how to publish the artifact(s). The type field is the discriminator. + """ + # data type: NewCatalogItemTarget + oneof_schema_1_validator: Optional[NewCatalogItemTarget] = None + # data type: ExistingCatalogItemTarget + oneof_schema_2_validator: Optional[ExistingCatalogItemTarget] = None + actual_instance: Optional[Union[ExistingCatalogItemTarget, NewCatalogItemTarget]] = None + one_of_schemas: Set[str] = { "ExistingCatalogItemTarget", "NewCatalogItemTarget" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + discriminator_value_class_map: Dict[str, str] = { + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = ImagePromotionTarget.model_construct() + error_messages = [] + match = 0 + # validate data type: NewCatalogItemTarget + if not isinstance(v, NewCatalogItemTarget): + error_messages.append(f"Error! Input type `{type(v)}` is not `NewCatalogItemTarget`") + else: + match += 1 + # validate data type: ExistingCatalogItemTarget + if not isinstance(v, ExistingCatalogItemTarget): + error_messages.append(f"Error! Input type `{type(v)}` is not `ExistingCatalogItemTarget`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in ImagePromotionTarget with oneOf schemas: ExistingCatalogItemTarget, NewCatalogItemTarget. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in ImagePromotionTarget with oneOf schemas: ExistingCatalogItemTarget, NewCatalogItemTarget. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # use oneOf discriminator to lookup the data type + _data_type = json.loads(json_str).get("type") + if not _data_type: + raise ValueError("Failed to lookup data type from the field `type` in the input.") + + # check if data type is `ExistingCatalogItemTarget` + if _data_type == "ExistingCatalogItem": + instance.actual_instance = ExistingCatalogItemTarget.from_json(json_str) + return instance + + # check if data type is `NewCatalogItemTarget` + if _data_type == "NewCatalogItem": + instance.actual_instance = NewCatalogItemTarget.from_json(json_str) + return instance + + # deserialize data into NewCatalogItemTarget + try: + instance.actual_instance = NewCatalogItemTarget.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into ExistingCatalogItemTarget + try: + instance.actual_instance = ExistingCatalogItemTarget.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 ImagePromotionTarget with oneOf schemas: ExistingCatalogItemTarget, NewCatalogItemTarget. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into ImagePromotionTarget with oneOf schemas: ExistingCatalogItemTarget, NewCatalogItemTarget. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], ExistingCatalogItemTarget, NewCatalogItemTarget]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/flightctl/imagebuilder/models/image_promotion_target_base.py b/flightctl/imagebuilder/models/image_promotion_target_base.py new file mode 100644 index 0000000..16207db --- /dev/null +++ b/flightctl/imagebuilder/models/image_promotion_target_base.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Flight Control Image Builder API + + Image Builder service for Flight Control. This service manages image build resources for building and pushing container images. + + 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 typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class ImagePromotionTargetBase(BaseModel): + """ + Common fields shared by all ImagePromotionTarget variants. + """ # noqa: E501 + type: StrictStr = Field(description="Discriminator for the target type.") + catalog_name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Name of the parent Catalog resource.", alias="catalogName") + catalog_item_name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Name of the CatalogItem to create or update.", alias="catalogItemName") + version: StrictStr = Field(description="Semver version string for the new CatalogItem version entry.") + __properties: ClassVar[List[str]] = ["type", "catalogName", "catalogItemName", "version"] + + 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 ImagePromotionTargetBase 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 ImagePromotionTargetBase from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type"), + "catalogName": obj.get("catalogName"), + "catalogItemName": obj.get("catalogItemName"), + "version": obj.get("version") + }) + return _obj + + diff --git a/flightctl/imagebuilder/models/image_promotion_target_type.py b/flightctl/imagebuilder/models/image_promotion_target_type.py new file mode 100644 index 0000000..ff7197f --- /dev/null +++ b/flightctl/imagebuilder/models/image_promotion_target_type.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Flight Control Image Builder API + + Image Builder service for Flight Control. This service manages image build resources for building and pushing container images. + + 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 json +from enum import Enum +from typing_extensions import Self + + +class ImagePromotionTargetType(str, Enum): + """ + Discriminator for the promotion target type. + """ + + """ + allowed enum values + """ + ImagePromotionTargetTypeNewCatalogItem = 'NewCatalogItem' + ImagePromotionTargetTypeExistingCatalogItem = 'ExistingCatalogItem' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ImagePromotionTargetType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/flightctl/imagebuilder/models/new_catalog_item_target.py b/flightctl/imagebuilder/models/new_catalog_item_target.py new file mode 100644 index 0000000..77ae8d8 --- /dev/null +++ b/flightctl/imagebuilder/models/new_catalog_item_target.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + Flight Control Image Builder API + + Image Builder service for Flight Control. This service manages image build resources for building and pushing container images. + + 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, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class NewCatalogItemTarget(BaseModel): + """ + Publish target that creates a new CatalogItem. Rejected immediately if a CatalogItem with the given catalogItemName already exists. + """ # noqa: E501 + type: StrictStr = Field(description="Discriminator for the target type.") + catalog_name: StrictStr = Field(description="Name of the parent Catalog resource.", alias="catalogName") + catalog_item_name: StrictStr = Field(description="Name of the CatalogItem to create.", alias="catalogItemName") + version: StrictStr = Field(description="Semver version string for the new CatalogItem version entry.") + readme: Optional[StrictStr] = Field(default=None, description="Optional item-level readme for the new CatalogItem. Markdown is supported.") + display_name: Optional[StrictStr] = Field(default=None, description="Optional human-readable display name for the new CatalogItem.", alias="displayName") + __properties: ClassVar[List[str]] = ["type", "catalogName", "catalogItemName", "version", "readme", "displayName"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['NewCatalogItem']): + raise ValueError("must be one of enum values ('NewCatalogItem')") + 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 NewCatalogItemTarget 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 NewCatalogItemTarget from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type"), + "catalogName": obj.get("catalogName"), + "catalogItemName": obj.get("catalogItemName"), + "version": obj.get("version"), + "readme": obj.get("readme"), + "displayName": obj.get("displayName") + }) + return _obj + + diff --git a/flightctl/imagebuilder/models/object_meta.py b/flightctl/imagebuilder/models/object_meta.py index d07f1d6..8e4afcd 100644 --- a/flightctl/imagebuilder/models/object_meta.py +++ b/flightctl/imagebuilder/models/object_meta.py @@ -21,6 +21,7 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from typing import Optional, Set from typing_extensions import Self @@ -30,8 +31,8 @@ class ObjectMeta(BaseModel): """ # noqa: E501 creation_timestamp: Optional[datetime] = Field(default=None, description="The time the object was created.", alias="creationTimestamp") deletion_timestamp: Optional[datetime] = Field(default=None, description="The time the object will be deleted.", alias="deletionTimestamp") - name: Optional[StrictStr] = Field(default=None, description="The name of the object.") - labels: Optional[Dict[str, StrictStr]] = Field(default=None, description="Map of string keys and values that can be used to organize and categorize (scope and select) objects.") + name: Optional[Annotated[str, Field(strict=True, max_length=253)]] = Field(default=None, description="The name of the object.") + labels: Optional[Dict[str, Annotated[str, Field(strict=True, max_length=63)]]] = Field(default=None, description="Map of string keys and values that can be used to organize and categorize (scope and select) objects.") generation: Optional[StrictInt] = Field(default=None, description="A sequence number representing a specific generation of the desired state. Populated by the system. Read-only.") owner: Optional[StrictStr] = Field(default=None, description="A resource that owns this resource, in \"kind/name\" format.") annotations: Optional[Dict[str, StrictStr]] = Field(default=None, description="Properties set by the service.") diff --git a/flightctl/imagebuilder/models/patch_request_inner.py b/flightctl/imagebuilder/models/patch_request_inner.py new file mode 100644 index 0000000..65d9682 --- /dev/null +++ b/flightctl/imagebuilder/models/patch_request_inner.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Flight Control Image Builder API + + Image Builder service for Flight Control. This service manages image build resources for building and pushing container images. + + 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, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class PatchRequestInner(BaseModel): + """ + PatchRequestInner + """ # noqa: E501 + path: StrictStr = Field(description="A JSON Pointer path.") + value: Optional[Any] = Field(default=None, description="The value to add or replace.") + op: StrictStr = Field(description="The operation to perform.") + __properties: ClassVar[List[str]] = ["path", "value", "op"] + + @field_validator('op') + def op_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['add', 'replace', 'remove', 'test']): + raise ValueError("must be one of enum values ('add', 'replace', 'remove', 'test')") + 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 PatchRequestInner 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, + ) + # set to None if value (nullable) is None + # and model_fields_set contains the field + if self.value is None and "value" in self.model_fields_set: + _dict['value'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PatchRequestInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "path": obj.get("path"), + "value": obj.get("value"), + "op": obj.get("op") + }) + return _obj + + diff --git a/flightctl/imagebuilder/models/resource_kind.py b/flightctl/imagebuilder/models/resource_kind.py index d91ee88..ef77202 100644 --- a/flightctl/imagebuilder/models/resource_kind.py +++ b/flightctl/imagebuilder/models/resource_kind.py @@ -29,6 +29,7 @@ class ResourceKind(str, Enum): """ IMAGEBUILD = 'ImageBuild' IMAGEEXPORT = 'ImageExport' + IMAGEPROMOTION = 'ImagePromotion' @classmethod def from_json(cls, json_str: str) -> Self: diff --git a/flightctl/imagebuilder/test/test_artifact_promotion_status.py b/flightctl/imagebuilder/test/test_artifact_promotion_status.py new file mode 100644 index 0000000..0a934e9 --- /dev/null +++ b/flightctl/imagebuilder/test/test_artifact_promotion_status.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Flight Control Image Builder API + + Image Builder service for Flight Control. This service manages image build resources for building and pushing container images. + + 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.imagebuilder.models.artifact_promotion_status import ArtifactPromotionStatus + +class TestArtifactPromotionStatus(unittest.TestCase): + """ArtifactPromotionStatus unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ArtifactPromotionStatus: + """Test ArtifactPromotionStatus + 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 `ArtifactPromotionStatus` + """ + model = ArtifactPromotionStatus() + if include_optional: + return ArtifactPromotionStatus( + format = '', + ready = True, + published = True, + resolved_export = '' + ) + else: + return ArtifactPromotionStatus( + format = '', + ready = True, + published = True, + ) + """ + + def testArtifactPromotionStatus(self): + """Test ArtifactPromotionStatus""" + # 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/imagebuilder/test/test_existing_catalog_item_target.py b/flightctl/imagebuilder/test/test_existing_catalog_item_target.py new file mode 100644 index 0000000..c354ed0 --- /dev/null +++ b/flightctl/imagebuilder/test/test_existing_catalog_item_target.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +""" + Flight Control Image Builder API + + Image Builder service for Flight Control. This service manages image build resources for building and pushing container images. + + 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.imagebuilder.models.existing_catalog_item_target import ExistingCatalogItemTarget + +class TestExistingCatalogItemTarget(unittest.TestCase): + """ExistingCatalogItemTarget unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ExistingCatalogItemTarget: + """Test ExistingCatalogItemTarget + 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 `ExistingCatalogItemTarget` + """ + model = ExistingCatalogItemTarget() + if include_optional: + return ExistingCatalogItemTarget( + type = 'ExistingCatalogItem', + catalog_name = '', + catalog_item_name = '', + version = '', + readme = '', + replaces = '', + skips = [ + '' + ], + skip_range = '' + ) + else: + return ExistingCatalogItemTarget( + type = 'ExistingCatalogItem', + catalog_name = '', + catalog_item_name = '', + version = '', + ) + """ + + def testExistingCatalogItemTarget(self): + """Test ExistingCatalogItemTarget""" + # 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/imagebuilder/test/test_image_build_new_version_request.py b/flightctl/imagebuilder/test/test_image_build_new_version_request.py new file mode 100644 index 0000000..d014f17 --- /dev/null +++ b/flightctl/imagebuilder/test/test_image_build_new_version_request.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Flight Control Image Builder API + + Image Builder service for Flight Control. This service manages image build resources for building and pushing container images. + + 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.imagebuilder.models.image_build_new_version_request import ImageBuildNewVersionRequest + +class TestImageBuildNewVersionRequest(unittest.TestCase): + """ImageBuildNewVersionRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ImageBuildNewVersionRequest: + """Test ImageBuildNewVersionRequest + 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 `ImageBuildNewVersionRequest` + """ + model = ImageBuildNewVersionRequest() + if include_optional: + return ImageBuildNewVersionRequest( + name = '0', + source_image_tag = 'e6bUUGjjNSwg0_bs9ZayIMrKdgNvb6gvxmPb9GcsM61ate1RA89q3w1l4eH4XxEz.5awxoFZxHzs6ED.kjUSnTINkYPUndNl8pmPg5K897Fu1JEFj9R1_dz9rEoBi0L0', + destination_image_tag = 'e6bUUGjjNSwg0_bs9ZayIMrKdgNvb6gvxmPb9GcsM61ate1RA89q3w1l4eH4XxEz.5awxoFZxHzs6ED.kjUSnTINkYPUndNl8pmPg5K897Fu1JEFj9R1_dz9rEoBi0L0' + ) + else: + return ImageBuildNewVersionRequest( + name = '0', + ) + """ + + def testImageBuildNewVersionRequest(self): + """Test ImageBuildNewVersionRequest""" + # 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/imagebuilder/test/test_image_promotion.py b/flightctl/imagebuilder/test/test_image_promotion.py new file mode 100644 index 0000000..c7023bf --- /dev/null +++ b/flightctl/imagebuilder/test/test_image_promotion.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Flight Control Image Builder API + + Image Builder service for Flight Control. This service manages image build resources for building and pushing container images. + + 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.imagebuilder.models.image_promotion import ImagePromotion + +class TestImagePromotion(unittest.TestCase): + """ImagePromotion unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ImagePromotion: + """Test ImagePromotion + 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 `ImagePromotion` + """ + model = ImagePromotion() + if include_optional: + return ImagePromotion( + api_version = 'v1alpha1', + kind = '', + metadata = flightctl.imagebuilder.models.object_meta.ObjectMeta( + creation_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + deletion_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + name = '', + labels = { + 'key' : '' + }, + generation = 56, + owner = '', + annotations = { + 'key' : '' + }, + resource_version = '', ), + spec = flightctl.imagebuilder.models.image_promotion_spec.ImagePromotionSpec( + source = flightctl.imagebuilder.models.image_promotion_source.ImagePromotionSource( + image_build_ref = '0', + export_formats = [ + 'vmdk' + ], ), + target = null, ), + status = flightctl.imagebuilder.models.image_promotion_status.ImagePromotionStatus( + conditions = [ + null + ], + published_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + last_amended_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + artifact_statuses = [ + flightctl.imagebuilder.models.artifact_promotion_status.ArtifactPromotionStatus( + format = '', + ready = True, + published = True, + resolved_export = '', ) + ], ) + ) + else: + return ImagePromotion( + api_version = 'v1alpha1', + kind = '', + metadata = flightctl.imagebuilder.models.object_meta.ObjectMeta( + creation_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + deletion_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + name = '', + labels = { + 'key' : '' + }, + generation = 56, + owner = '', + annotations = { + 'key' : '' + }, + resource_version = '', ), + spec = flightctl.imagebuilder.models.image_promotion_spec.ImagePromotionSpec( + source = flightctl.imagebuilder.models.image_promotion_source.ImagePromotionSource( + image_build_ref = '0', + export_formats = [ + 'vmdk' + ], ), + target = null, ), + ) + """ + + def testImagePromotion(self): + """Test ImagePromotion""" + # 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/imagebuilder/test/test_image_promotion_condition.py b/flightctl/imagebuilder/test/test_image_promotion_condition.py new file mode 100644 index 0000000..31a2e5e --- /dev/null +++ b/flightctl/imagebuilder/test/test_image_promotion_condition.py @@ -0,0 +1,62 @@ +# coding: utf-8 + +""" + Flight Control Image Builder API + + Image Builder service for Flight Control. This service manages image build resources for building and pushing container images. + + 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.imagebuilder.models.image_promotion_condition import ImagePromotionCondition + +class TestImagePromotionCondition(unittest.TestCase): + """ImagePromotionCondition unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ImagePromotionCondition: + """Test ImagePromotionCondition + 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 `ImagePromotionCondition` + """ + model = ImagePromotionCondition() + if include_optional: + return ImagePromotionCondition( + status = 'True', + observed_generation = 56, + last_transition_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + message = '', + reason = '', + type = 'Ready' + ) + else: + return ImagePromotionCondition( + status = 'True', + last_transition_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + message = '', + reason = '', + type = 'Ready', + ) + """ + + def testImagePromotionCondition(self): + """Test ImagePromotionCondition""" + # 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/imagebuilder/test/test_image_promotion_condition_reason.py b/flightctl/imagebuilder/test/test_image_promotion_condition_reason.py new file mode 100644 index 0000000..5f717f6 --- /dev/null +++ b/flightctl/imagebuilder/test/test_image_promotion_condition_reason.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Flight Control Image Builder API + + Image Builder service for Flight Control. This service manages image build resources for building and pushing container images. + + 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.imagebuilder.models.image_promotion_condition_reason import ImagePromotionConditionReason + +class TestImagePromotionConditionReason(unittest.TestCase): + """ImagePromotionConditionReason unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testImagePromotionConditionReason(self): + """Test ImagePromotionConditionReason""" + # inst = ImagePromotionConditionReason() + +if __name__ == '__main__': + unittest.main() diff --git a/flightctl/imagebuilder/test/test_image_promotion_condition_type.py b/flightctl/imagebuilder/test/test_image_promotion_condition_type.py new file mode 100644 index 0000000..a8c8966 --- /dev/null +++ b/flightctl/imagebuilder/test/test_image_promotion_condition_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Flight Control Image Builder API + + Image Builder service for Flight Control. This service manages image build resources for building and pushing container images. + + 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.imagebuilder.models.image_promotion_condition_type import ImagePromotionConditionType + +class TestImagePromotionConditionType(unittest.TestCase): + """ImagePromotionConditionType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testImagePromotionConditionType(self): + """Test ImagePromotionConditionType""" + # inst = ImagePromotionConditionType() + +if __name__ == '__main__': + unittest.main() diff --git a/flightctl/imagebuilder/test/test_image_promotion_list.py b/flightctl/imagebuilder/test/test_image_promotion_list.py new file mode 100644 index 0000000..dc555dc --- /dev/null +++ b/flightctl/imagebuilder/test/test_image_promotion_list.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + Flight Control Image Builder API + + Image Builder service for Flight Control. This service manages image build resources for building and pushing container images. + + 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.imagebuilder.models.image_promotion_list import ImagePromotionList + +class TestImagePromotionList(unittest.TestCase): + """ImagePromotionList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ImagePromotionList: + """Test ImagePromotionList + 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 `ImagePromotionList` + """ + model = ImagePromotionList() + if include_optional: + return ImagePromotionList( + api_version = 'v1alpha1', + kind = '', + metadata = flightctl.imagebuilder.models.list_meta.ListMeta( + continue = '', + remaining_item_count = 56, ), + items = [ + flightctl.imagebuilder.models.image_promotion.ImagePromotion( + api_version = 'v1alpha1', + kind = '', + metadata = flightctl.imagebuilder.models.object_meta.ObjectMeta( + creation_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + deletion_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + name = '', + labels = { + 'key' : '' + }, + generation = 56, + owner = '', + annotations = { + 'key' : '' + }, + resource_version = '', ), + spec = flightctl.imagebuilder.models.image_promotion_spec.ImagePromotionSpec( + source = flightctl.imagebuilder.models.image_promotion_source.ImagePromotionSource( + image_build_ref = '0', + export_formats = [ + 'vmdk' + ], ), + target = null, ), + status = flightctl.imagebuilder.models.image_promotion_status.ImagePromotionStatus( + conditions = [ + null + ], + published_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + last_amended_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + artifact_statuses = [ + flightctl.imagebuilder.models.artifact_promotion_status.ArtifactPromotionStatus( + format = '', + ready = True, + published = True, + resolved_export = '', ) + ], ), ) + ] + ) + else: + return ImagePromotionList( + api_version = 'v1alpha1', + kind = '', + metadata = flightctl.imagebuilder.models.list_meta.ListMeta( + continue = '', + remaining_item_count = 56, ), + items = [ + flightctl.imagebuilder.models.image_promotion.ImagePromotion( + api_version = 'v1alpha1', + kind = '', + metadata = flightctl.imagebuilder.models.object_meta.ObjectMeta( + creation_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + deletion_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + name = '', + labels = { + 'key' : '' + }, + generation = 56, + owner = '', + annotations = { + 'key' : '' + }, + resource_version = '', ), + spec = flightctl.imagebuilder.models.image_promotion_spec.ImagePromotionSpec( + source = flightctl.imagebuilder.models.image_promotion_source.ImagePromotionSource( + image_build_ref = '0', + export_formats = [ + 'vmdk' + ], ), + target = null, ), + status = flightctl.imagebuilder.models.image_promotion_status.ImagePromotionStatus( + conditions = [ + null + ], + published_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + last_amended_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + artifact_statuses = [ + flightctl.imagebuilder.models.artifact_promotion_status.ArtifactPromotionStatus( + format = '', + ready = True, + published = True, + resolved_export = '', ) + ], ), ) + ], + ) + """ + + def testImagePromotionList(self): + """Test ImagePromotionList""" + # 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/imagebuilder/test/test_image_promotion_source.py b/flightctl/imagebuilder/test/test_image_promotion_source.py new file mode 100644 index 0000000..967fb55 --- /dev/null +++ b/flightctl/imagebuilder/test/test_image_promotion_source.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Flight Control Image Builder API + + Image Builder service for Flight Control. This service manages image build resources for building and pushing container images. + + 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.imagebuilder.models.image_promotion_source import ImagePromotionSource + +class TestImagePromotionSource(unittest.TestCase): + """ImagePromotionSource unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ImagePromotionSource: + """Test ImagePromotionSource + 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 `ImagePromotionSource` + """ + model = ImagePromotionSource() + if include_optional: + return ImagePromotionSource( + image_build_ref = '0', + export_formats = [ + 'vmdk' + ] + ) + else: + return ImagePromotionSource( + image_build_ref = '0', + ) + """ + + def testImagePromotionSource(self): + """Test ImagePromotionSource""" + # 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/imagebuilder/test/test_image_promotion_spec.py b/flightctl/imagebuilder/test/test_image_promotion_spec.py new file mode 100644 index 0000000..1bc38df --- /dev/null +++ b/flightctl/imagebuilder/test/test_image_promotion_spec.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +""" + Flight Control Image Builder API + + Image Builder service for Flight Control. This service manages image build resources for building and pushing container images. + + 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.imagebuilder.models.image_promotion_spec import ImagePromotionSpec + +class TestImagePromotionSpec(unittest.TestCase): + """ImagePromotionSpec unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ImagePromotionSpec: + """Test ImagePromotionSpec + 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 `ImagePromotionSpec` + """ + model = ImagePromotionSpec() + if include_optional: + return ImagePromotionSpec( + source = flightctl.imagebuilder.models.image_promotion_source.ImagePromotionSource( + image_build_ref = '0', + export_formats = [ + 'vmdk' + ], ), + target = None + ) + else: + return ImagePromotionSpec( + source = flightctl.imagebuilder.models.image_promotion_source.ImagePromotionSource( + image_build_ref = '0', + export_formats = [ + 'vmdk' + ], ), + target = None, + ) + """ + + def testImagePromotionSpec(self): + """Test ImagePromotionSpec""" + # 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/imagebuilder/test/test_image_promotion_status.py b/flightctl/imagebuilder/test/test_image_promotion_status.py new file mode 100644 index 0000000..da24f00 --- /dev/null +++ b/flightctl/imagebuilder/test/test_image_promotion_status.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +""" + Flight Control Image Builder API + + Image Builder service for Flight Control. This service manages image build resources for building and pushing container images. + + 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.imagebuilder.models.image_promotion_status import ImagePromotionStatus + +class TestImagePromotionStatus(unittest.TestCase): + """ImagePromotionStatus unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ImagePromotionStatus: + """Test ImagePromotionStatus + 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 `ImagePromotionStatus` + """ + model = ImagePromotionStatus() + if include_optional: + return ImagePromotionStatus( + conditions = [ + null + ], + published_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + last_amended_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + artifact_statuses = [ + flightctl.imagebuilder.models.artifact_promotion_status.ArtifactPromotionStatus( + format = '', + ready = True, + published = True, + resolved_export = '', ) + ] + ) + else: + return ImagePromotionStatus( + ) + """ + + def testImagePromotionStatus(self): + """Test ImagePromotionStatus""" + # 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/imagebuilder/test/test_image_promotion_target.py b/flightctl/imagebuilder/test/test_image_promotion_target.py new file mode 100644 index 0000000..7b5475f --- /dev/null +++ b/flightctl/imagebuilder/test/test_image_promotion_target.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + Flight Control Image Builder API + + Image Builder service for Flight Control. This service manages image build resources for building and pushing container images. + + 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.imagebuilder.models.image_promotion_target import ImagePromotionTarget + +class TestImagePromotionTarget(unittest.TestCase): + """ImagePromotionTarget unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ImagePromotionTarget: + """Test ImagePromotionTarget + 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 `ImagePromotionTarget` + """ + model = ImagePromotionTarget() + if include_optional: + return ImagePromotionTarget( + type = 'NewCatalogItem', + catalog_name = '', + catalog_item_name = '', + version = '', + readme = '', + display_name = '', + replaces = '', + skips = [ + '' + ], + skip_range = '' + ) + else: + return ImagePromotionTarget( + type = 'NewCatalogItem', + catalog_name = '', + catalog_item_name = '', + version = '', + ) + """ + + def testImagePromotionTarget(self): + """Test ImagePromotionTarget""" + # 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/imagebuilder/test/test_image_promotion_target_base.py b/flightctl/imagebuilder/test/test_image_promotion_target_base.py new file mode 100644 index 0000000..ca54cb6 --- /dev/null +++ b/flightctl/imagebuilder/test/test_image_promotion_target_base.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + Flight Control Image Builder API + + Image Builder service for Flight Control. This service manages image build resources for building and pushing container images. + + 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.imagebuilder.models.image_promotion_target_base import ImagePromotionTargetBase + +class TestImagePromotionTargetBase(unittest.TestCase): + """ImagePromotionTargetBase unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ImagePromotionTargetBase: + """Test ImagePromotionTargetBase + 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 `ImagePromotionTargetBase` + """ + model = ImagePromotionTargetBase() + if include_optional: + return ImagePromotionTargetBase( + type = '', + catalog_name = '0', + catalog_item_name = '0', + version = '' + ) + else: + return ImagePromotionTargetBase( + type = '', + catalog_name = '0', + catalog_item_name = '0', + version = '', + ) + """ + + def testImagePromotionTargetBase(self): + """Test ImagePromotionTargetBase""" + # 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/imagebuilder/test/test_image_promotion_target_type.py b/flightctl/imagebuilder/test/test_image_promotion_target_type.py new file mode 100644 index 0000000..30744be --- /dev/null +++ b/flightctl/imagebuilder/test/test_image_promotion_target_type.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Flight Control Image Builder API + + Image Builder service for Flight Control. This service manages image build resources for building and pushing container images. + + 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.imagebuilder.models.image_promotion_target_type import ImagePromotionTargetType + +class TestImagePromotionTargetType(unittest.TestCase): + """ImagePromotionTargetType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testImagePromotionTargetType(self): + """Test ImagePromotionTargetType""" + # inst = ImagePromotionTargetType() + +if __name__ == '__main__': + unittest.main() diff --git a/flightctl/imagebuilder/test/test_imagepromotion_api.py b/flightctl/imagebuilder/test/test_imagepromotion_api.py new file mode 100644 index 0000000..ba819a4 --- /dev/null +++ b/flightctl/imagebuilder/test/test_imagepromotion_api.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + Flight Control Image Builder API + + Image Builder service for Flight Control. This service manages image build resources for building and pushing container images. + + 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.imagebuilder.api.imagepromotion_api import ImagepromotionApi + + +class TestImagepromotionApi(unittest.TestCase): + """ImagepromotionApi unit test stubs""" + + def setUp(self) -> None: + self.api = ImagepromotionApi() + + def tearDown(self) -> None: + pass + + def test_create_image_promotion(self) -> None: + """Test case for create_image_promotion + + """ + pass + + def test_delete_image_promotion(self) -> None: + """Test case for delete_image_promotion + + """ + pass + + def test_get_image_promotion(self) -> None: + """Test case for get_image_promotion + + """ + pass + + def test_list_image_promotions(self) -> None: + """Test case for list_image_promotions + + """ + pass + + def test_patch_image_promotion(self) -> None: + """Test case for patch_image_promotion + + """ + pass + + def test_replace_image_promotion(self) -> None: + """Test case for replace_image_promotion + + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/flightctl/imagebuilder/test/test_new_catalog_item_target.py b/flightctl/imagebuilder/test/test_new_catalog_item_target.py new file mode 100644 index 0000000..715955d --- /dev/null +++ b/flightctl/imagebuilder/test/test_new_catalog_item_target.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + Flight Control Image Builder API + + Image Builder service for Flight Control. This service manages image build resources for building and pushing container images. + + 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.imagebuilder.models.new_catalog_item_target import NewCatalogItemTarget + +class TestNewCatalogItemTarget(unittest.TestCase): + """NewCatalogItemTarget unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> NewCatalogItemTarget: + """Test NewCatalogItemTarget + 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 `NewCatalogItemTarget` + """ + model = NewCatalogItemTarget() + if include_optional: + return NewCatalogItemTarget( + type = 'NewCatalogItem', + catalog_name = '', + catalog_item_name = '', + version = '', + readme = '', + display_name = '' + ) + else: + return NewCatalogItemTarget( + type = 'NewCatalogItem', + catalog_name = '', + catalog_item_name = '', + version = '', + ) + """ + + def testNewCatalogItemTarget(self): + """Test NewCatalogItemTarget""" + # 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/imagebuilder/test/test_patch_request_inner.py b/flightctl/imagebuilder/test/test_patch_request_inner.py new file mode 100644 index 0000000..2f3ee70 --- /dev/null +++ b/flightctl/imagebuilder/test/test_patch_request_inner.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Flight Control Image Builder API + + Image Builder service for Flight Control. This service manages image build resources for building and pushing container images. + + 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.imagebuilder.models.patch_request_inner import PatchRequestInner + +class TestPatchRequestInner(unittest.TestCase): + """PatchRequestInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PatchRequestInner: + """Test PatchRequestInner + 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 `PatchRequestInner` + """ + model = PatchRequestInner() + if include_optional: + return PatchRequestInner( + path = '', + value = None, + op = 'add' + ) + else: + return PatchRequestInner( + path = '', + op = 'add', + ) + """ + + def testPatchRequestInner(self): + """Test PatchRequestInner""" + # 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/imagebuilder_README.md b/flightctl/imagebuilder_README.md index f6b9000..5356913 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.1.0 +- Package version: 1.2.0 - Generator version: 7.17.0 - Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit [https://flightctl.io](https://flightctl.io) @@ -66,6 +66,7 @@ Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *ImagebuildApi* | [**cancel_image_build**](flightctl/imagebuilder/docs/ImagebuildApi.md#cancel_image_build) | **POST** /api/v1/imagebuilds/{name}/cancel | *ImagebuildApi* | [**create_image_build**](flightctl/imagebuilder/docs/ImagebuildApi.md#create_image_build) | **POST** /api/v1/imagebuilds | +*ImagebuildApi* | [**create_image_build_new_version**](flightctl/imagebuilder/docs/ImagebuildApi.md#create_image_build_new_version) | **POST** /api/v1/imagebuilds/{name}/newversion | *ImagebuildApi* | [**delete_image_build**](flightctl/imagebuilder/docs/ImagebuildApi.md#delete_image_build) | **DELETE** /api/v1/imagebuilds/{name} | *ImagebuildApi* | [**get_image_build**](flightctl/imagebuilder/docs/ImagebuildApi.md#get_image_build) | **GET** /api/v1/imagebuilds/{name} | *ImagebuildApi* | [**get_image_build_log**](flightctl/imagebuilder/docs/ImagebuildApi.md#get_image_build_log) | **GET** /api/v1/imagebuilds/{name}/log | @@ -77,15 +78,23 @@ Class | Method | HTTP request | Description *ImageexportApi* | [**get_image_export**](flightctl/imagebuilder/docs/ImageexportApi.md#get_image_export) | **GET** /api/v1/imageexports/{name} | *ImageexportApi* | [**get_image_export_log**](flightctl/imagebuilder/docs/ImageexportApi.md#get_image_export_log) | **GET** /api/v1/imageexports/{name}/log | *ImageexportApi* | [**list_image_exports**](flightctl/imagebuilder/docs/ImageexportApi.md#list_image_exports) | **GET** /api/v1/imageexports | +*ImagepromotionApi* | [**create_image_promotion**](flightctl/imagebuilder/docs/ImagepromotionApi.md#create_image_promotion) | **POST** /api/v1/imagepromotions | +*ImagepromotionApi* | [**delete_image_promotion**](flightctl/imagebuilder/docs/ImagepromotionApi.md#delete_image_promotion) | **DELETE** /api/v1/imagepromotions/{name} | +*ImagepromotionApi* | [**get_image_promotion**](flightctl/imagebuilder/docs/ImagepromotionApi.md#get_image_promotion) | **GET** /api/v1/imagepromotions/{name} | +*ImagepromotionApi* | [**list_image_promotions**](flightctl/imagebuilder/docs/ImagepromotionApi.md#list_image_promotions) | **GET** /api/v1/imagepromotions | +*ImagepromotionApi* | [**patch_image_promotion**](flightctl/imagebuilder/docs/ImagepromotionApi.md#patch_image_promotion) | **PATCH** /api/v1/imagepromotions/{name} | +*ImagepromotionApi* | [**replace_image_promotion**](flightctl/imagebuilder/docs/ImagepromotionApi.md#replace_image_promotion) | **PUT** /api/v1/imagepromotions/{name} | ## Documentation For Models - [ApiVersion](flightctl/imagebuilder/docs/ApiVersion.md) + - [ArtifactPromotionStatus](flightctl/imagebuilder/docs/ArtifactPromotionStatus.md) - [BindingType](flightctl/imagebuilder/docs/BindingType.md) - [ConditionBase](flightctl/imagebuilder/docs/ConditionBase.md) - [ConditionStatus](flightctl/imagebuilder/docs/ConditionStatus.md) - [EarlyBinding](flightctl/imagebuilder/docs/EarlyBinding.md) + - [ExistingCatalogItemTarget](flightctl/imagebuilder/docs/ExistingCatalogItemTarget.md) - [ExportFormatType](flightctl/imagebuilder/docs/ExportFormatType.md) - [ImageBuild](flightctl/imagebuilder/docs/ImageBuild.md) - [ImageBuildBinding](flightctl/imagebuilder/docs/ImageBuildBinding.md) @@ -94,6 +103,7 @@ Class | Method | HTTP request | Description - [ImageBuildConditionType](flightctl/imagebuilder/docs/ImageBuildConditionType.md) - [ImageBuildDestination](flightctl/imagebuilder/docs/ImageBuildDestination.md) - [ImageBuildList](flightctl/imagebuilder/docs/ImageBuildList.md) + - [ImageBuildNewVersionRequest](flightctl/imagebuilder/docs/ImageBuildNewVersionRequest.md) - [ImageBuildRefSource](flightctl/imagebuilder/docs/ImageBuildRefSource.md) - [ImageBuildSource](flightctl/imagebuilder/docs/ImageBuildSource.md) - [ImageBuildSpec](flightctl/imagebuilder/docs/ImageBuildSpec.md) @@ -108,9 +118,22 @@ Class | Method | HTTP request | Description - [ImageExportSourceType](flightctl/imagebuilder/docs/ImageExportSourceType.md) - [ImageExportSpec](flightctl/imagebuilder/docs/ImageExportSpec.md) - [ImageExportStatus](flightctl/imagebuilder/docs/ImageExportStatus.md) + - [ImagePromotion](flightctl/imagebuilder/docs/ImagePromotion.md) + - [ImagePromotionCondition](flightctl/imagebuilder/docs/ImagePromotionCondition.md) + - [ImagePromotionConditionReason](flightctl/imagebuilder/docs/ImagePromotionConditionReason.md) + - [ImagePromotionConditionType](flightctl/imagebuilder/docs/ImagePromotionConditionType.md) + - [ImagePromotionList](flightctl/imagebuilder/docs/ImagePromotionList.md) + - [ImagePromotionSource](flightctl/imagebuilder/docs/ImagePromotionSource.md) + - [ImagePromotionSpec](flightctl/imagebuilder/docs/ImagePromotionSpec.md) + - [ImagePromotionStatus](flightctl/imagebuilder/docs/ImagePromotionStatus.md) + - [ImagePromotionTarget](flightctl/imagebuilder/docs/ImagePromotionTarget.md) + - [ImagePromotionTargetBase](flightctl/imagebuilder/docs/ImagePromotionTargetBase.md) + - [ImagePromotionTargetType](flightctl/imagebuilder/docs/ImagePromotionTargetType.md) - [LateBinding](flightctl/imagebuilder/docs/LateBinding.md) - [ListMeta](flightctl/imagebuilder/docs/ListMeta.md) + - [NewCatalogItemTarget](flightctl/imagebuilder/docs/NewCatalogItemTarget.md) - [ObjectMeta](flightctl/imagebuilder/docs/ObjectMeta.md) + - [PatchRequestInner](flightctl/imagebuilder/docs/PatchRequestInner.md) - [ResourceKind](flightctl/imagebuilder/docs/ResourceKind.md) - [Status](flightctl/imagebuilder/docs/Status.md) diff --git a/flightctl/models/__init__.py b/flightctl/models/__init__.py index fd20ef3..7ce6a9f 100644 --- a/flightctl/models/__init__.py +++ b/flightctl/models/__init__.py @@ -42,6 +42,7 @@ from flightctl.models.auth_role_assignment import AuthRoleAssignment from flightctl.models.auth_static_organization_assignment import AuthStaticOrganizationAssignment from flightctl.models.auth_static_role_assignment import AuthStaticRoleAssignment +from flightctl.models.base_image_entry import BaseImageEntry from flightctl.models.batch import Batch from flightctl.models.batch_limit import BatchLimit from flightctl.models.batch_sequence import BatchSequence @@ -49,6 +50,9 @@ from flightctl.models.certificate_signing_request_list import CertificateSigningRequestList from flightctl.models.certificate_signing_request_spec import CertificateSigningRequestSpec from flightctl.models.certificate_signing_request_status import CertificateSigningRequestStatus +from flightctl.models.check_repository_oci_image_request import CheckRepositoryOciImageRequest +from flightctl.models.check_repository_oci_result import CheckRepositoryOciResult +from flightctl.models.check_repository_oci_tag_request import CheckRepositoryOciTagRequest from flightctl.models.compose_application import ComposeApplication from flightctl.models.condition import Condition from flightctl.models.condition_base import ConditionBase @@ -58,6 +62,10 @@ from flightctl.models.container_application import ContainerApplication from flightctl.models.container_application_properties import ContainerApplicationProperties from flightctl.models.cpu_resource_monitor_spec import CpuResourceMonitorSpec +from flightctl.models.dependency_change_detected_details import DependencyChangeDetectedDetails +from flightctl.models.dependency_sync_config_ref_status import DependencySyncConfigRefStatus +from flightctl.models.dependency_sync_probe_failed_details import DependencySyncProbeFailedDetails +from flightctl.models.dependency_sync_status import DependencySyncStatus from flightctl.models.device import Device from flightctl.models.device_application_status import DeviceApplicationStatus from flightctl.models.device_applications_summary_status import DeviceApplicationsSummaryStatus @@ -92,6 +100,7 @@ from flightctl.models.device_update_policy_spec import DeviceUpdatePolicySpec from flightctl.models.device_updated_status import DeviceUpdatedStatus 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.disk_resource_monitor_spec import DiskResourceMonitorSpec from flightctl.models.disruption_budget import DisruptionBudget diff --git a/flightctl/models/aap_provider_spec.py b/flightctl/models/aap_provider_spec.py index d5c6b0d..9238c0b 100644 --- a/flightctl/models/aap_provider_spec.py +++ b/flightctl/models/aap_provider_spec.py @@ -36,7 +36,8 @@ class AapProviderSpec(BaseModel): client_secret: StrictStr = Field(description="The OAuth2 client secret.", alias="clientSecret") enabled: Optional[StrictBool] = Field(default=True, description="Whether this AAP provider is enabled.") scopes: List[StrictStr] = Field(description="List of OAuth2 scopes to request.") - __properties: ClassVar[List[str]] = ["providerType", "displayName", "apiUrl", "authorizationUrl", "tokenUrl", "clientId", "clientSecret", "enabled", "scopes"] + organization_name_prefix: Optional[StrictStr] = Field(default=None, description="Optional prefix for AAP organization names. Incoming names are exposed as prefix + name.", alias="organizationNamePrefix") + __properties: ClassVar[List[str]] = ["providerType", "displayName", "apiUrl", "authorizationUrl", "tokenUrl", "clientId", "clientSecret", "enabled", "scopes", "organizationNamePrefix"] @field_validator('provider_type') def provider_type_validate_enum(cls, value): @@ -104,7 +105,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "clientId": obj.get("clientId"), "clientSecret": obj.get("clientSecret"), "enabled": obj.get("enabled") if obj.get("enabled") is not None else True, - "scopes": obj.get("scopes") + "scopes": obj.get("scopes"), + "organizationNamePrefix": obj.get("organizationNamePrefix") }) return _obj diff --git a/flightctl/models/base_image_entry.py b/flightctl/models/base_image_entry.py new file mode 100644 index 0000000..2231117 --- /dev/null +++ b/flightctl/models/base_image_entry.py @@ -0,0 +1,93 @@ +# 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, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class BaseImageEntry(BaseModel): + """ + A curated base image entry available in an OCI registry. + """ # noqa: E501 + display_name: Optional[StrictStr] = Field(default=None, description="Human-readable label shown in the UI (e.g., \"CentOS\").", alias="displayName") + image_name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="Image path within the registry (e.g., \"centos-bootc/centos-bootc\").", alias="imageName") + tags: Annotated[List[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(min_length=1)] = Field(description="Selectable tags for this image (e.g., [\"stream9\", \"stream10\"]).") + __properties: ClassVar[List[str]] = ["displayName", "imageName", "tags"] + + 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 BaseImageEntry 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 BaseImageEntry from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "displayName": obj.get("displayName"), + "imageName": obj.get("imageName"), + "tags": obj.get("tags") + }) + return _obj + + diff --git a/flightctl/models/certificate_signing_request_spec.py b/flightctl/models/certificate_signing_request_spec.py index ec20bcc..60f769c 100644 --- a/flightctl/models/certificate_signing_request_spec.py +++ b/flightctl/models/certificate_signing_request_spec.py @@ -20,6 +20,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated from typing import Optional, Set from typing_extensions import Self @@ -30,7 +31,7 @@ class CertificateSigningRequestSpec(BaseModel): expiration_seconds: Optional[StrictInt] = Field(default=None, description="Requested duration of validity for the certificate.", alias="expirationSeconds") extra: Optional[Dict[str, List[StrictStr]]] = Field(default=None, description="Extra attributes of the user that created the CSR, populated by the API server on creation and immutable.") request: Union[StrictBytes, StrictStr] = Field(description="The base64-encoded PEM-encoded PKCS#10 CSR. Matches the spec.request field in a kubernetes CertificateSigningRequest resource.") - signer_name: StrictStr = Field(description="Indicates the requested signer, and is a qualified name.", alias="signerName") + signer_name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Indicates the requested signer, and is a qualified name.", alias="signerName") uid: Optional[StrictStr] = Field(default=None, description="UID of the user that created the CSR, populated by the API server on creation and immutable.") usages: Optional[List[StrictStr]] = Field(default=None, description="Usages specifies a set of key usages requested in the issued certificate.") username: Optional[StrictStr] = Field(default=None, description="Name of the user that created the CSR, populated by the API server on creation and immutable.") diff --git a/flightctl/models/check_repository_oci_image_request.py b/flightctl/models/check_repository_oci_image_request.py new file mode 100644 index 0000000..7392207 --- /dev/null +++ b/flightctl/models/check_repository_oci_image_request.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 +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class CheckRepositoryOciImageRequest(BaseModel): + """ + Request to check if a specific OCI image is accessible in a registry. + """ # noqa: E501 + image_name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(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\").", alias="imageName") + __properties: ClassVar[List[str]] = ["imageName"] + + 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 CheckRepositoryOciImageRequest 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 CheckRepositoryOciImageRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "imageName": obj.get("imageName") + }) + return _obj + + diff --git a/flightctl/models/check_repository_oci_result.py b/flightctl/models/check_repository_oci_result.py new file mode 100644 index 0000000..c59b8f3 --- /dev/null +++ b/flightctl/models/check_repository_oci_result.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, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class CheckRepositoryOciResult(BaseModel): + """ + Result of an OCI registry check (tag existence or image accessibility). + """ # noqa: E501 + accessible: StrictBool = Field(description="Whether the image or tag is accessible in the registry.") + error_code: Optional[StrictInt] = Field(default=None, 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).", alias="errorCode") + error_message: Optional[StrictStr] = Field(default=None, description="Error message describing why the image or tag is not accessible.", alias="errorMessage") + __properties: ClassVar[List[str]] = ["accessible", "errorCode", "errorMessage"] + + 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 CheckRepositoryOciResult 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 CheckRepositoryOciResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "accessible": obj.get("accessible"), + "errorCode": obj.get("errorCode"), + "errorMessage": obj.get("errorMessage") + }) + return _obj + + diff --git a/flightctl/models/check_repository_oci_tag_request.py b/flightctl/models/check_repository_oci_tag_request.py new file mode 100644 index 0000000..8148ab9 --- /dev/null +++ b/flightctl/models/check_repository_oci_tag_request.py @@ -0,0 +1,98 @@ +# 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, field_validator +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class CheckRepositoryOciTagRequest(BaseModel): + """ + Request to check if a specific image tag exists in an OCI registry. + """ # noqa: E501 + image_name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(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\").", alias="imageName") + tag: Annotated[str, Field(min_length=1, strict=True, max_length=128)] = Field(description="The image tag to check for existence (e.g. \"9.5\").") + __properties: ClassVar[List[str]] = ["imageName", "tag"] + + @field_validator('tag') + def tag_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^[\w][\w.-]{0,127}$", value): + raise ValueError(r"must validate the regular expression /^[\w][\w.-]{0,127}$/") + 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 CheckRepositoryOciTagRequest 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 CheckRepositoryOciTagRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "imageName": obj.get("imageName"), + "tag": obj.get("tag") + }) + return _obj + + diff --git a/flightctl/models/dependency_change_detected_details.py b/flightctl/models/dependency_change_detected_details.py new file mode 100644 index 0000000..571c763 --- /dev/null +++ b/flightctl/models/dependency_change_detected_details.py @@ -0,0 +1,99 @@ +# 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 DependencyChangeDetectedDetails(BaseModel): + """ + DependencyChangeDetectedDetails + """ # noqa: E501 + detail_type: StrictStr = Field(description="The type of detail for discriminator purposes.", alias="detailType") + resource_key: StrictStr = Field(description="The resource key identifying the dependency that changed (e.g. \"git:my-repo/main\").", alias="resourceKey") + fingerprint: StrictStr = Field(description="The new fingerprint (e.g. commit SHA) of the changed dependency.") + __properties: ClassVar[List[str]] = ["detailType", "resourceKey", "fingerprint"] + + @field_validator('detail_type') + def detail_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['DependencyChangeDetected']): + raise ValueError("must be one of enum values ('DependencyChangeDetected')") + 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 DependencyChangeDetectedDetails 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 DependencyChangeDetectedDetails 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"), + "resourceKey": obj.get("resourceKey"), + "fingerprint": obj.get("fingerprint") + }) + return _obj + + diff --git a/flightctl/models/dependency_sync_config_ref_status.py b/flightctl/models/dependency_sync_config_ref_status.py new file mode 100644 index 0000000..d9bf500 --- /dev/null +++ b/flightctl/models/dependency_sync_config_ref_status.py @@ -0,0 +1,93 @@ +# 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 datetime import datetime +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 DependencySyncConfigRefStatus(BaseModel): + """ + DependencySyncConfigRefStatus represents the rendered fingerprint for a single config provider's external dependency. + """ # noqa: E501 + config_provider_name: StrictStr = Field(description="The name of the config provider (e.g. the git or HTTP config source name).", alias="configProviderName") + fingerprint: Optional[StrictStr] = Field(default=None, description="The fingerprint of the rendered content (e.g. git commit SHA, sha256 of HTTP body, K8s secret ResourceVersion).") + last_updated_at: Optional[datetime] = Field(default=None, description="The last time the fingerprint changed (i.e. the dependency content was updated).", alias="lastUpdatedAt") + __properties: ClassVar[List[str]] = ["configProviderName", "fingerprint", "lastUpdatedAt"] + + 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 DependencySyncConfigRefStatus 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 DependencySyncConfigRefStatus from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "configProviderName": obj.get("configProviderName"), + "fingerprint": obj.get("fingerprint"), + "lastUpdatedAt": obj.get("lastUpdatedAt") + }) + return _obj + + diff --git a/flightctl/models/dependency_sync_probe_failed_details.py b/flightctl/models/dependency_sync_probe_failed_details.py new file mode 100644 index 0000000..cef6220 --- /dev/null +++ b/flightctl/models/dependency_sync_probe_failed_details.py @@ -0,0 +1,99 @@ +# 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 DependencySyncProbeFailedDetails(BaseModel): + """ + DependencySyncProbeFailedDetails + """ # noqa: E501 + detail_type: StrictStr = Field(description="The type of detail for discriminator purposes.", alias="detailType") + resource_key: StrictStr = Field(description="The resource key identifying the dependency that failed (e.g. \"git:my-repo/main\").", alias="resourceKey") + error: StrictStr = Field(description="The error message from the failed probe.") + __properties: ClassVar[List[str]] = ["detailType", "resourceKey", "error"] + + @field_validator('detail_type') + def detail_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['DependencySyncProbeFailed']): + raise ValueError("must be one of enum values ('DependencySyncProbeFailed')") + 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 DependencySyncProbeFailedDetails 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 DependencySyncProbeFailedDetails 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"), + "resourceKey": obj.get("resourceKey"), + "error": obj.get("error") + }) + return _obj + + diff --git a/flightctl/models/dependency_sync_status.py b/flightctl/models/dependency_sync_status.py new file mode 100644 index 0000000..2026c15 --- /dev/null +++ b/flightctl/models/dependency_sync_status.py @@ -0,0 +1,96 @@ +# 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.dependency_sync_config_ref_status import DependencySyncConfigRefStatus +from typing import Optional, Set +from typing_extensions import Self + +class DependencySyncStatus(BaseModel): + """ + DependencySyncStatus represents the synchronization fingerprints for external dependencies of a device, captured at render time. + """ # noqa: E501 + config_refs: Optional[List[DependencySyncConfigRefStatus]] = Field(default=None, description="Per-config-provider fingerprint and last update time, set when the device renders.", alias="configRefs") + __properties: ClassVar[List[str]] = ["configRefs"] + + 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 DependencySyncStatus 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 each item in config_refs (list) + _items = [] + if self.config_refs: + for _item_config_refs in self.config_refs: + if _item_config_refs: + _items.append(_item_config_refs.to_dict()) + _dict['configRefs'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DependencySyncStatus from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "configRefs": [DependencySyncConfigRefStatus.from_dict(_item) for _item in obj["configRefs"]] if obj.get("configRefs") is not None else None + }) + return _obj + + diff --git a/flightctl/models/device_spec.py b/flightctl/models/device_spec.py index da07f1f..3e27a39 100644 --- a/flightctl/models/device_spec.py +++ b/flightctl/models/device_spec.py @@ -91,7 +91,7 @@ def to_dict(self) -> Dict[str, Any]: if self.os: _dict['os'] = self.os.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in config (list) - _items: list[Any] = [] + _items = [] if self.config: for _item_config in self.config: if _item_config: diff --git a/flightctl/models/device_status.py b/flightctl/models/device_status.py index 9d23dd5..7a6e8e6 100644 --- a/flightctl/models/device_status.py +++ b/flightctl/models/device_status.py @@ -22,6 +22,7 @@ from pydantic import BaseModel, ConfigDict, Field from typing import Any, ClassVar, Dict, List, Optional from flightctl.models.condition import Condition +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_config_status import DeviceConfigStatus @@ -53,7 +54,8 @@ class DeviceStatus(BaseModel): summary: DeviceSummaryStatus 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 - __properties: ClassVar[List[str]] = ["conditions", "systemInfo", "systemd", "applications", "applicationsSummary", "resources", "integrity", "config", "os", "updated", "summary", "lastSeen", "lifecycle"] + 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"] model_config = ConfigDict( populate_by_name=True, @@ -142,6 +144,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of lifecycle if self.lifecycle: _dict['lifecycle'] = self.lifecycle.to_dict() + # override the default output from pydantic by calling `to_dict()` of dependency_sync + if self.dependency_sync: + _dict['dependencySync'] = self.dependency_sync.to_dict() return _dict @classmethod @@ -166,7 +171,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "updated": DeviceUpdatedStatus.from_dict(obj["updated"]) if obj.get("updated") is not None else None, "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 + "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 }) return _obj diff --git a/flightctl/models/device_vulnerability_cve_details.py b/flightctl/models/device_vulnerability_cve_details.py new file mode 100644 index 0000000..887c5c4 --- /dev/null +++ b/flightctl/models/device_vulnerability_cve_details.py @@ -0,0 +1,109 @@ +# 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, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class DeviceVulnerabilityCveDetails(BaseModel): + """ + Structured details for per-device CVE vulnerability events. + """ # noqa: E501 + detail_type: StrictStr = Field(description="The type of detail for discriminator purposes.", alias="detailType") + cve_id: Annotated[str, Field(strict=True, max_length=64)] = Field(description="CVE identifier (e.g. CVE-2024-1234). MITRE-style CVE-YYYY-sequence identifier, matching device list filter validation.", alias="cveId") + first_image_ref: Optional[StrictStr] = Field(default=None, description="Human-readable OS image reference when the CVE was first detected on this device (historical/audit field).", alias="firstImageRef") + first_image_digest: Optional[StrictStr] = Field(default=None, description="Image digest when the CVE was first detected on this device (historical/audit field, e.g. sha256:...).", alias="firstImageDigest") + __properties: ClassVar[List[str]] = ["detailType", "cveId", "firstImageRef", "firstImageDigest"] + + @field_validator('detail_type') + def detail_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['DeviceVulnerabilityCVE']): + raise ValueError("must be one of enum values ('DeviceVulnerabilityCVE')") + return value + + @field_validator('cve_id') + def cve_id_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^CVE-[0-9]{4}-[0-9]{4,}$", value): + raise ValueError(r"must validate the regular expression /^CVE-[0-9]{4}-[0-9]{4,}$/") + 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 DeviceVulnerabilityCveDetails 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 DeviceVulnerabilityCveDetails 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"), + "cveId": obj.get("cveId"), + "firstImageRef": obj.get("firstImageRef"), + "firstImageDigest": obj.get("firstImageDigest") + }) + return _obj + + diff --git a/flightctl/models/enrollment_request_approval.py b/flightctl/models/enrollment_request_approval.py index c8759db..d32d40e 100644 --- a/flightctl/models/enrollment_request_approval.py +++ b/flightctl/models/enrollment_request_approval.py @@ -27,9 +27,10 @@ class EnrollmentRequestApproval(BaseModel): """ EnrollmentRequestApproval contains information about the approval of a device enrollment request. """ # noqa: E501 - labels: Optional[Dict[str, StrictStr]] = Field(default=None, description="A set of labels to apply to the device.") + labels: Optional[Dict[str, StrictStr]] = Field(default=None, 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.") + replace_labels: Optional[StrictBool] = Field(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.", alias="replaceLabels") approved: StrictBool = Field(description="Indicates whether the request has been approved.") - __properties: ClassVar[List[str]] = ["labels", "approved"] + __properties: ClassVar[List[str]] = ["labels", "replaceLabels", "approved"] model_config = ConfigDict( populate_by_name=True, @@ -83,6 +84,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "labels": obj.get("labels"), + "replaceLabels": obj.get("replaceLabels") if obj.get("replaceLabels") is not None else False, "approved": obj.get("approved") }) return _obj diff --git a/flightctl/models/enrollment_request_approval_status.py b/flightctl/models/enrollment_request_approval_status.py index 432db68..c9859b4 100644 --- a/flightctl/models/enrollment_request_approval_status.py +++ b/flightctl/models/enrollment_request_approval_status.py @@ -28,11 +28,12 @@ class EnrollmentRequestApprovalStatus(BaseModel): """ EnrollmentRequestApprovalStatus represents information about the status of a device enrollment request approval. """ # noqa: E501 - labels: Optional[Dict[str, StrictStr]] = Field(default=None, description="A set of labels to apply to the device.") + labels: Optional[Dict[str, StrictStr]] = Field(default=None, 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.") + replace_labels: Optional[StrictBool] = Field(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.", alias="replaceLabels") approved: StrictBool = Field(description="Indicates whether the request has been approved.") approved_by: StrictStr = Field(description="The name of the approver.", alias="approvedBy") approved_at: datetime = Field(description="The time at which the request was approved.", alias="approvedAt") - __properties: ClassVar[List[str]] = ["labels", "approved", "approvedBy", "approvedAt"] + __properties: ClassVar[List[str]] = ["labels", "replaceLabels", "approved", "approvedBy", "approvedAt"] model_config = ConfigDict( populate_by_name=True, @@ -86,6 +87,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "labels": obj.get("labels"), + "replaceLabels": obj.get("replaceLabels") if obj.get("replaceLabels") is not None else False, "approved": obj.get("approved"), "approvedBy": obj.get("approvedBy"), "approvedAt": obj.get("approvedAt") diff --git a/flightctl/models/event.py b/flightctl/models/event.py index ad4267e..c4c48d3 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', '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', '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', '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', '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']): + 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')") return value @field_validator('type') diff --git a/flightctl/models/event_details.py b/flightctl/models/event_details.py index afdf9c1..a1d90b3 100644 --- a/flightctl/models/event_details.py +++ b/flightctl/models/event_details.py @@ -18,9 +18,12 @@ import pprint from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator from typing import Any, List, Optional +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 from flightctl.models.device_multiple_owners_resolved_details import DeviceMultipleOwnersResolvedDetails from flightctl.models.device_ownership_changed_details import DeviceOwnershipChangedDetails +from flightctl.models.device_vulnerability_cve_details import DeviceVulnerabilityCveDetails from flightctl.models.fleet_rollout_batch_completed_details import FleetRolloutBatchCompletedDetails from flightctl.models.fleet_rollout_batch_dispatched_details import FleetRolloutBatchDispatchedDetails from flightctl.models.fleet_rollout_completed_details import FleetRolloutCompletedDetails @@ -34,7 +37,7 @@ from typing import Union, List, Set, Optional, Dict from typing_extensions import Literal, Self -EVENTDETAILS_ONE_OF_SCHEMAS = ["DeviceMultipleOwnersDetectedDetails", "DeviceMultipleOwnersResolvedDetails", "DeviceOwnershipChangedDetails", "FleetRolloutBatchCompletedDetails", "FleetRolloutBatchDispatchedDetails", "FleetRolloutCompletedDetails", "FleetRolloutDeviceSelectedDetails", "FleetRolloutFailedDetails", "FleetRolloutStartedDetails", "InternalTaskFailedDetails", "InternalTaskPermanentlyFailedDetails", "ReferencedRepositoryUpdatedDetails", "ResourceSyncCompletedDetails", "ResourceUpdatedDetails"] +EVENTDETAILS_ONE_OF_SCHEMAS = ["DependencyChangeDetectedDetails", "DependencySyncProbeFailedDetails", "DeviceMultipleOwnersDetectedDetails", "DeviceMultipleOwnersResolvedDetails", "DeviceOwnershipChangedDetails", "DeviceVulnerabilityCveDetails", "FleetRolloutBatchCompletedDetails", "FleetRolloutBatchDispatchedDetails", "FleetRolloutCompletedDetails", "FleetRolloutDeviceSelectedDetails", "FleetRolloutFailedDetails", "FleetRolloutStartedDetails", "InternalTaskFailedDetails", "InternalTaskPermanentlyFailedDetails", "ReferencedRepositoryUpdatedDetails", "ResourceSyncCompletedDetails", "ResourceUpdatedDetails"] class EventDetails(BaseModel): """ @@ -68,8 +71,14 @@ class EventDetails(BaseModel): oneof_schema_13_validator: Optional[FleetRolloutBatchCompletedDetails] = None # data type: FleetRolloutDeviceSelectedDetails oneof_schema_14_validator: Optional[FleetRolloutDeviceSelectedDetails] = None - actual_instance: Optional[Union[DeviceMultipleOwnersDetectedDetails, DeviceMultipleOwnersResolvedDetails, DeviceOwnershipChangedDetails, FleetRolloutBatchCompletedDetails, FleetRolloutBatchDispatchedDetails, FleetRolloutCompletedDetails, FleetRolloutDeviceSelectedDetails, FleetRolloutFailedDetails, FleetRolloutStartedDetails, InternalTaskFailedDetails, InternalTaskPermanentlyFailedDetails, ReferencedRepositoryUpdatedDetails, ResourceSyncCompletedDetails, ResourceUpdatedDetails]] = None - one_of_schemas: Set[str] = { "DeviceMultipleOwnersDetectedDetails", "DeviceMultipleOwnersResolvedDetails", "DeviceOwnershipChangedDetails", "FleetRolloutBatchCompletedDetails", "FleetRolloutBatchDispatchedDetails", "FleetRolloutCompletedDetails", "FleetRolloutDeviceSelectedDetails", "FleetRolloutFailedDetails", "FleetRolloutStartedDetails", "InternalTaskFailedDetails", "InternalTaskPermanentlyFailedDetails", "ReferencedRepositoryUpdatedDetails", "ResourceSyncCompletedDetails", "ResourceUpdatedDetails" } + # data type: DeviceVulnerabilityCveDetails + oneof_schema_15_validator: Optional[DeviceVulnerabilityCveDetails] = None + # data type: DependencyChangeDetectedDetails + 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" } model_config = ConfigDict( validate_assignment=True, @@ -165,12 +174,27 @@ def actual_instance_must_validate_oneof(cls, v): error_messages.append(f"Error! Input type `{type(v)}` is not `FleetRolloutDeviceSelectedDetails`") else: match += 1 + # validate data type: DeviceVulnerabilityCveDetails + if not isinstance(v, DeviceVulnerabilityCveDetails): + error_messages.append(f"Error! Input type `{type(v)}` is not `DeviceVulnerabilityCveDetails`") + else: + match += 1 + # validate data type: DependencyChangeDetectedDetails + if not isinstance(v, DependencyChangeDetectedDetails): + error_messages.append(f"Error! Input type `{type(v)}` is not `DependencyChangeDetectedDetails`") + else: + match += 1 + # validate data type: DependencySyncProbeFailedDetails + if not isinstance(v, DependencySyncProbeFailedDetails): + error_messages.append(f"Error! Input type `{type(v)}` is not `DependencySyncProbeFailedDetails`") + else: + match += 1 if match > 1: # more than 1 match - raise ValueError("Multiple matches found when setting `actual_instance` in EventDetails with oneOf schemas: DeviceMultipleOwnersDetectedDetails, DeviceMultipleOwnersResolvedDetails, DeviceOwnershipChangedDetails, 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: 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: DeviceMultipleOwnersDetectedDetails, DeviceMultipleOwnersResolvedDetails, DeviceOwnershipChangedDetails, 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: DependencyChangeDetectedDetails, DependencySyncProbeFailedDetails, DeviceMultipleOwnersDetectedDetails, DeviceMultipleOwnersResolvedDetails, DeviceOwnershipChangedDetails, DeviceVulnerabilityCveDetails, FleetRolloutBatchCompletedDetails, FleetRolloutBatchDispatchedDetails, FleetRolloutCompletedDetails, FleetRolloutDeviceSelectedDetails, FleetRolloutFailedDetails, FleetRolloutStartedDetails, InternalTaskFailedDetails, InternalTaskPermanentlyFailedDetails, ReferencedRepositoryUpdatedDetails, ResourceSyncCompletedDetails, ResourceUpdatedDetails. Details: " + ", ".join(error_messages)) else: return v @@ -190,6 +214,16 @@ 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 `DependencyChangeDetectedDetails` + if _data_type == "DependencyChangeDetected": + instance.actual_instance = DependencyChangeDetectedDetails.from_json(json_str) + return instance + + # check if data type is `DependencySyncProbeFailedDetails` + if _data_type == "DependencySyncProbeFailed": + instance.actual_instance = DependencySyncProbeFailedDetails.from_json(json_str) + return instance + # check if data type is `DeviceMultipleOwnersDetectedDetails` if _data_type == "DeviceMultipleOwnersDetected": instance.actual_instance = DeviceMultipleOwnersDetectedDetails.from_json(json_str) @@ -205,6 +239,11 @@ def from_json(cls, json_str: str) -> Self: instance.actual_instance = DeviceOwnershipChangedDetails.from_json(json_str) return instance + # check if data type is `DeviceVulnerabilityCveDetails` + if _data_type == "DeviceVulnerabilityCVE": + instance.actual_instance = DeviceVulnerabilityCveDetails.from_json(json_str) + return instance + # check if data type is `FleetRolloutBatchCompletedDetails` if _data_type == "FleetRolloutBatchCompleted": instance.actual_instance = FleetRolloutBatchCompletedDetails.from_json(json_str) @@ -344,13 +383,31 @@ def from_json(cls, json_str: str) -> Self: match += 1 except (ValidationError, ValueError) as e: error_messages.append(str(e)) + # deserialize data into DeviceVulnerabilityCveDetails + try: + instance.actual_instance = DeviceVulnerabilityCveDetails.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into DependencyChangeDetectedDetails + try: + instance.actual_instance = DependencyChangeDetectedDetails.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into DependencySyncProbeFailedDetails + try: + instance.actual_instance = DependencySyncProbeFailedDetails.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: DeviceMultipleOwnersDetectedDetails, DeviceMultipleOwnersResolvedDetails, DeviceOwnershipChangedDetails, 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: 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: DeviceMultipleOwnersDetectedDetails, DeviceMultipleOwnersResolvedDetails, DeviceOwnershipChangedDetails, 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: DependencyChangeDetectedDetails, DependencySyncProbeFailedDetails, DeviceMultipleOwnersDetectedDetails, DeviceMultipleOwnersResolvedDetails, DeviceOwnershipChangedDetails, DeviceVulnerabilityCveDetails, FleetRolloutBatchCompletedDetails, FleetRolloutBatchDispatchedDetails, FleetRolloutCompletedDetails, FleetRolloutDeviceSelectedDetails, FleetRolloutFailedDetails, FleetRolloutStartedDetails, InternalTaskFailedDetails, InternalTaskPermanentlyFailedDetails, ReferencedRepositoryUpdatedDetails, ResourceSyncCompletedDetails, ResourceUpdatedDetails. Details: " + ", ".join(error_messages)) else: return instance @@ -364,7 +421,7 @@ def to_json(self) -> str: else: return json.dumps(self.actual_instance) - def to_dict(self) -> Optional[Union[Dict[str, Any], DeviceMultipleOwnersDetectedDetails, DeviceMultipleOwnersResolvedDetails, DeviceOwnershipChangedDetails, FleetRolloutBatchCompletedDetails, FleetRolloutBatchDispatchedDetails, FleetRolloutCompletedDetails, FleetRolloutDeviceSelectedDetails, FleetRolloutFailedDetails, FleetRolloutStartedDetails, InternalTaskFailedDetails, InternalTaskPermanentlyFailedDetails, ReferencedRepositoryUpdatedDetails, ResourceSyncCompletedDetails, ResourceUpdatedDetails]]: + 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]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None diff --git a/flightctl/models/git_repo_spec.py b/flightctl/models/git_repo_spec.py index 0cdeabc..6822cd4 100644 --- a/flightctl/models/git_repo_spec.py +++ b/flightctl/models/git_repo_spec.py @@ -20,6 +20,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from flightctl.models.http_config import HttpConfig from flightctl.models.ssh_config import SshConfig from typing import Optional, Set @@ -29,7 +30,7 @@ class GitRepoSpec(BaseModel): """ Git repository specification. Supports no auth (public repos), HTTP/HTTPS auth, or SSH auth. """ # noqa: E501 - url: StrictStr = Field(description="The Git repository URL to clone from.") + url: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The Git repository URL to clone from.") type: StrictStr = Field(description="The repository type discriminator.") http_config: Optional[HttpConfig] = Field(default=None, alias="httpConfig") ssh_config: Optional[SshConfig] = Field(default=None, alias="sshConfig") diff --git a/flightctl/models/http_repo_spec.py b/flightctl/models/http_repo_spec.py index f26b909..ce9aa5e 100644 --- a/flightctl/models/http_repo_spec.py +++ b/flightctl/models/http_repo_spec.py @@ -20,6 +20,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from flightctl.models.http_config import HttpConfig from typing import Optional, Set from typing_extensions import Self @@ -28,7 +29,7 @@ class HttpRepoSpec(BaseModel): """ HTTP endpoint specification for fetching configuration. """ # noqa: E501 - url: StrictStr = Field(description="The HTTP URL to call.") + url: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The HTTP URL to call.") type: StrictStr = Field(description="The repository type discriminator.") http_config: Optional[HttpConfig] = Field(default=None, alias="httpConfig") validation_suffix: Optional[StrictStr] = Field(default=None, 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.", alias="validationSuffix") diff --git a/flightctl/models/k8s_provider_spec.py b/flightctl/models/k8s_provider_spec.py index ae086ee..35de0de 100644 --- a/flightctl/models/k8s_provider_spec.py +++ b/flightctl/models/k8s_provider_spec.py @@ -34,10 +34,11 @@ class K8sProviderSpec(BaseModel): api_url: StrictStr = Field(description="The internal Kubernetes API URL.", alias="apiUrl") rbac_ns: Optional[StrictStr] = Field(default=None, description="The RBAC namespace for permissions.", alias="rbacNs") enabled: Optional[StrictBool] = Field(default=True, description="Whether this K8s provider is enabled.") - organization_assignment: AuthOrganizationAssignment = Field(alias="organizationAssignment") - role_assignment: AuthRoleAssignment = Field(alias="roleAssignment") + organization_assignment: Optional[AuthOrganizationAssignment] = Field(default=None, alias="organizationAssignment") + role_assignment: Optional[AuthRoleAssignment] = Field(default=None, alias="roleAssignment") role_suffix: Optional[StrictStr] = Field(default=None, 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-).", alias="roleSuffix") - __properties: ClassVar[List[str]] = ["providerType", "displayName", "apiUrl", "rbacNs", "enabled", "organizationAssignment", "roleAssignment", "roleSuffix"] + organization_name_prefix: Optional[StrictStr] = Field(default=None, description="Optional prefix for the organization name. The default org name is exposed as prefix + 'default' when set.", alias="organizationNamePrefix") + __properties: ClassVar[List[str]] = ["providerType", "displayName", "apiUrl", "rbacNs", "enabled", "organizationAssignment", "roleAssignment", "roleSuffix", "organizationNamePrefix"] @field_validator('provider_type') def provider_type_validate_enum(cls, value): @@ -110,7 +111,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "enabled": obj.get("enabled") if obj.get("enabled") is not None else True, "organizationAssignment": AuthOrganizationAssignment.from_dict(obj["organizationAssignment"]) if obj.get("organizationAssignment") is not None else None, "roleAssignment": AuthRoleAssignment.from_dict(obj["roleAssignment"]) if obj.get("roleAssignment") is not None else None, - "roleSuffix": obj.get("roleSuffix") + "roleSuffix": obj.get("roleSuffix"), + "organizationNamePrefix": obj.get("organizationNamePrefix") }) return _obj diff --git a/flightctl/models/object_meta.py b/flightctl/models/object_meta.py index 98b6039..e12ab7a 100644 --- a/flightctl/models/object_meta.py +++ b/flightctl/models/object_meta.py @@ -21,6 +21,7 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from typing import Optional, Set from typing_extensions import Self @@ -30,8 +31,8 @@ class ObjectMeta(BaseModel): """ # noqa: E501 creation_timestamp: Optional[datetime] = Field(default=None, description="The time the object was created.", alias="creationTimestamp") deletion_timestamp: Optional[datetime] = Field(default=None, description="The time the object will be deleted.", alias="deletionTimestamp") - name: Optional[StrictStr] = Field(default=None, description="The name of the object.") - labels: Optional[Dict[str, StrictStr]] = Field(default=None, description="Map of string keys and values that can be used to organize and categorize (scope and select) objects.") + name: Optional[Annotated[str, Field(strict=True, max_length=253)]] = Field(default=None, description="The name of the object.") + labels: Optional[Dict[str, Annotated[str, Field(strict=True, max_length=63)]]] = Field(default=None, description="Map of string keys and values that can be used to organize and categorize (scope and select) objects.") generation: Optional[StrictInt] = Field(default=None, description="A sequence number representing a specific generation of the desired state. Populated by the system. Read-only.") owner: Optional[StrictStr] = Field(default=None, description="A resource that owns this resource, in \"kind/name\" format.") annotations: Optional[Dict[str, StrictStr]] = Field(default=None, description="Properties set by the service.") diff --git a/flightctl/models/oci_repo_spec.py b/flightctl/models/oci_repo_spec.py index 073e46c..2c32911 100644 --- a/flightctl/models/oci_repo_spec.py +++ b/flightctl/models/oci_repo_spec.py @@ -20,6 +20,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional +from flightctl.models.base_image_entry import BaseImageEntry from flightctl.models.docker_auth import DockerAuth from typing import Optional, Set from typing_extensions import Self @@ -35,7 +36,8 @@ class OciRepoSpec(BaseModel): oci_auth: Optional[DockerAuth] = Field(default=None, alias="ociAuth") ca_crt: Optional[StrictStr] = Field(default=None, description="Base64 encoded root CA.", alias="ca.crt") skip_server_verification: Optional[StrictBool] = Field(default=None, description="Skip remote server verification.", alias="skipServerVerification") - __properties: ClassVar[List[str]] = ["registry", "scheme", "type", "accessMode", "ociAuth", "ca.crt", "skipServerVerification"] + base_images: Optional[List[BaseImageEntry]] = Field(default=None, description="Curated list of trusted base images available in this registry. When present, the Image Builder source picker surfaces these entries as selectable options.", alias="baseImages") + __properties: ClassVar[List[str]] = ["registry", "scheme", "type", "accessMode", "ociAuth", "ca.crt", "skipServerVerification", "baseImages"] @field_validator('scheme') def scheme_validate_enum(cls, value): @@ -106,6 +108,13 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of oci_auth if self.oci_auth: _dict['ociAuth'] = self.oci_auth.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in base_images (list) + _items = [] + if self.base_images: + for _item_base_images in self.base_images: + if _item_base_images: + _items.append(_item_base_images.to_dict()) + _dict['baseImages'] = _items return _dict @classmethod @@ -124,7 +133,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "accessMode": obj.get("accessMode") if obj.get("accessMode") is not None else 'Read', "ociAuth": DockerAuth.from_dict(obj["ociAuth"]) if obj.get("ociAuth") is not None else None, "ca.crt": obj.get("ca.crt"), - "skipServerVerification": obj.get("skipServerVerification") + "skipServerVerification": obj.get("skipServerVerification"), + "baseImages": [BaseImageEntry.from_dict(_item) for _item in obj["baseImages"]] if obj.get("baseImages") is not None else None }) return _obj diff --git a/flightctl/models/open_shift_provider_spec.py b/flightctl/models/open_shift_provider_spec.py index f527a0f..105341a 100644 --- a/flightctl/models/open_shift_provider_spec.py +++ b/flightctl/models/open_shift_provider_spec.py @@ -39,7 +39,8 @@ class OpenShiftProviderSpec(BaseModel): cluster_control_plane_url: Optional[StrictStr] = Field(default=None, description="The OpenShift cluster control plane URL.", alias="clusterControlPlaneUrl") project_label_filter: Optional[StrictStr] = Field(default=None, 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.", alias="projectLabelFilter") role_suffix: Optional[StrictStr] = Field(default=None, 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-).", alias="roleSuffix") - __properties: ClassVar[List[str]] = ["providerType", "displayName", "issuer", "authorizationUrl", "tokenUrl", "clientId", "clientSecret", "enabled", "scopes", "clusterControlPlaneUrl", "projectLabelFilter", "roleSuffix"] + organization_name_prefix: Optional[StrictStr] = Field(default=None, description="Optional prefix for organization (project) names. Incoming names are exposed as prefix + name (e.g. 'ocp-' + project).", alias="organizationNamePrefix") + __properties: ClassVar[List[str]] = ["providerType", "displayName", "issuer", "authorizationUrl", "tokenUrl", "clientId", "clientSecret", "enabled", "scopes", "clusterControlPlaneUrl", "projectLabelFilter", "roleSuffix", "organizationNamePrefix"] @field_validator('provider_type') def provider_type_validate_enum(cls, value): @@ -110,7 +111,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "scopes": obj.get("scopes"), "clusterControlPlaneUrl": obj.get("clusterControlPlaneUrl"), "projectLabelFilter": obj.get("projectLabelFilter"), - "roleSuffix": obj.get("roleSuffix") + "roleSuffix": obj.get("roleSuffix"), + "organizationNamePrefix": obj.get("organizationNamePrefix") }) return _obj diff --git a/flightctl/models/resource_sync_spec.py b/flightctl/models/resource_sync_spec.py index f63c243..d87933b 100644 --- a/flightctl/models/resource_sync_spec.py +++ b/flightctl/models/resource_sync_spec.py @@ -18,8 +18,9 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from flightctl.models.resource_sync_type import ResourceSyncType from typing import Optional, Set from typing_extensions import Self @@ -29,9 +30,9 @@ class ResourceSyncSpec(BaseModel): ResourceSyncSpec describes the file(s) to sync from a repository. """ # noqa: E501 type: Optional[ResourceSyncType] = ResourceSyncType.ResourceSyncTypeFleet - repository: StrictStr = Field(description="The name of the repository resource to use as the sync source.") - target_revision: StrictStr = Field(description="The desired revision in the repository.", alias="targetRevision") - path: StrictStr = 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.") + 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.") __properties: ClassVar[List[str]] = ["type", "repository", "targetRevision", "path"] model_config = ConfigDict( diff --git a/flightctl/models/template_version_status.py b/flightctl/models/template_version_status.py index 27526f5..a8fb9b2 100644 --- a/flightctl/models/template_version_status.py +++ b/flightctl/models/template_version_status.py @@ -95,7 +95,7 @@ def to_dict(self) -> Dict[str, Any]: if self.os: _dict['os'] = self.os.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in config (list) - _items: list[Any] = [] + _items = [] if self.config: for _item_config in self.config: if _item_config: diff --git a/flightctl/models/token_request.py b/flightctl/models/token_request.py index b96ad34..1fa40c8 100644 --- a/flightctl/models/token_request.py +++ b/flightctl/models/token_request.py @@ -20,6 +20,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from typing import Optional, Set from typing_extensions import Self @@ -28,7 +29,7 @@ class TokenRequest(BaseModel): OAuth2 token request """ # noqa: E501 grant_type: StrictStr = Field(description="OAuth2 grant type.") - client_id: StrictStr = Field(description="OAuth2 client identifier.") + client_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="OAuth2 client identifier.") refresh_token: Optional[StrictStr] = Field(default=None, description="Refresh token for refresh_token grant.") code: Optional[StrictStr] = Field(default=None, description="Authorization code for authorization_code grant.") scope: Optional[StrictStr] = Field(default=None, description="OAuth2 scope.") diff --git a/flightctl/v1alpha1/__init__.py b/flightctl/v1alpha1/__init__.py index 0e63453..41513a8 100644 --- a/flightctl/v1alpha1/__init__.py +++ b/flightctl/v1alpha1/__init__.py @@ -15,11 +15,12 @@ """ # noqa: E501 -__version__ = "1.1.0" +__version__ = "1.2.0" # Define package exports __all__ = [ "CatalogApi", + "VulnerabilityApi", "ApiResponse", "ApiClient", "Configuration", @@ -29,6 +30,7 @@ "ApiKeyError", "ApiAttributeError", "ApiException", + "AffectedFleet", "ApiVersion", "Catalog", "CatalogItem", @@ -49,16 +51,29 @@ "ConditionBase", "ConditionStatus", "ConditionType", + "CveCountsBySeverity", + "DeviceCountsBySeverity", + "DeviceVulnerabilitySummaryResponse", + "FleetVulnerabilitySummary", + "FleetVulnerabilitySummaryResponse", "ListMeta", "ObjectMeta", "PatchRequestInner", - "SchemasApiVersion", - "SchemasStatus", "Status", + "Vulnerability", + "VulnerabilityGroup", + "VulnerabilityGroupItem", + "VulnerabilityGroupList", + "VulnerabilityImageRef", + "VulnerabilityImpact", + "VulnerabilityList", + "VulnerabilitySeveritySummary", + "VulnerabilitySummaryResponse", ] # import apis into sdk package from flightctl.v1alpha1.api.catalog_api import CatalogApi as CatalogApi +from flightctl.v1alpha1.api.vulnerability_api import VulnerabilityApi as VulnerabilityApi # import ApiClient from flightctl.v1alpha1.api_response import ApiResponse as ApiResponse @@ -72,6 +87,7 @@ from flightctl.v1alpha1.exceptions import ApiException as ApiException # import models into sdk package +from flightctl.v1alpha1.models.affected_fleet import AffectedFleet as AffectedFleet from flightctl.v1alpha1.models.api_version import ApiVersion as ApiVersion from flightctl.v1alpha1.models.catalog import Catalog as Catalog from flightctl.v1alpha1.models.catalog_item import CatalogItem as CatalogItem @@ -92,10 +108,22 @@ from flightctl.v1alpha1.models.condition_base import ConditionBase as ConditionBase from flightctl.v1alpha1.models.condition_status import ConditionStatus as ConditionStatus from flightctl.v1alpha1.models.condition_type import ConditionType as ConditionType +from flightctl.v1alpha1.models.cve_counts_by_severity import CveCountsBySeverity as CveCountsBySeverity +from flightctl.v1alpha1.models.device_counts_by_severity import DeviceCountsBySeverity as DeviceCountsBySeverity +from flightctl.v1alpha1.models.device_vulnerability_summary_response import DeviceVulnerabilitySummaryResponse as DeviceVulnerabilitySummaryResponse +from flightctl.v1alpha1.models.fleet_vulnerability_summary import FleetVulnerabilitySummary as FleetVulnerabilitySummary +from flightctl.v1alpha1.models.fleet_vulnerability_summary_response import FleetVulnerabilitySummaryResponse as FleetVulnerabilitySummaryResponse from flightctl.v1alpha1.models.list_meta import ListMeta as ListMeta from flightctl.v1alpha1.models.object_meta import ObjectMeta as ObjectMeta from flightctl.v1alpha1.models.patch_request_inner import PatchRequestInner as PatchRequestInner -from flightctl.v1alpha1.models.schemas_api_version import SchemasApiVersion as SchemasApiVersion -from flightctl.v1alpha1.models.schemas_status import SchemasStatus as SchemasStatus from flightctl.v1alpha1.models.status import Status as Status +from flightctl.v1alpha1.models.vulnerability import Vulnerability as Vulnerability +from flightctl.v1alpha1.models.vulnerability_group import VulnerabilityGroup as VulnerabilityGroup +from flightctl.v1alpha1.models.vulnerability_group_item import VulnerabilityGroupItem as VulnerabilityGroupItem +from flightctl.v1alpha1.models.vulnerability_group_list import VulnerabilityGroupList as VulnerabilityGroupList +from flightctl.v1alpha1.models.vulnerability_image_ref import VulnerabilityImageRef as VulnerabilityImageRef +from flightctl.v1alpha1.models.vulnerability_impact import VulnerabilityImpact as VulnerabilityImpact +from flightctl.v1alpha1.models.vulnerability_list import VulnerabilityList as VulnerabilityList +from flightctl.v1alpha1.models.vulnerability_severity_summary import VulnerabilitySeveritySummary as VulnerabilitySeveritySummary +from flightctl.v1alpha1.models.vulnerability_summary_response import VulnerabilitySummaryResponse as VulnerabilitySummaryResponse diff --git a/flightctl/v1alpha1/api/__init__.py b/flightctl/v1alpha1/api/__init__.py index 9b6d9cd..86f29f4 100644 --- a/flightctl/v1alpha1/api/__init__.py +++ b/flightctl/v1alpha1/api/__init__.py @@ -2,4 +2,5 @@ # import apis into api package from flightctl.v1alpha1.api.catalog_api import CatalogApi +from flightctl.v1alpha1.api.vulnerability_api import VulnerabilityApi diff --git a/flightctl/v1alpha1/api/catalog_api.py b/flightctl/v1alpha1/api/catalog_api.py index f37a3d7..7ba81ad 100644 --- a/flightctl/v1alpha1/api/catalog_api.py +++ b/flightctl/v1alpha1/api/catalog_api.py @@ -17,7 +17,7 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt, StrictStr +from pydantic import Field, StrictStr from typing import List, Optional from typing_extensions import Annotated from flightctl.v1alpha1.models.catalog import Catalog @@ -697,9 +697,11 @@ def delete_catalog( _response_types_map: Dict[str, Optional[str]] = { '200': "Status", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", + '409': "Status", '429': "Status", '503': "Status", } @@ -769,9 +771,11 @@ def delete_catalog_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "Status", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", + '409': "Status", '429': "Status", '503': "Status", } @@ -841,9 +845,11 @@ def delete_catalog_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "Status", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", + '409': "Status", '429': "Status", '503': "Status", } @@ -976,6 +982,7 @@ def delete_catalog_item( _response_types_map: Dict[str, Optional[str]] = { '200': "Status", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -1051,6 +1058,7 @@ def delete_catalog_item_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "Status", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -1126,6 +1134,7 @@ def delete_catalog_item_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "Status", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -1259,6 +1268,7 @@ def get_catalog( _response_types_map: Dict[str, Optional[str]] = { '200': "Catalog", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -1331,6 +1341,7 @@ def get_catalog_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "Catalog", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -1403,6 +1414,7 @@ def get_catalog_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "Catalog", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -1538,6 +1550,7 @@ def get_catalog_item( _response_types_map: Dict[str, Optional[str]] = { '200': "CatalogItem", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -1613,6 +1626,7 @@ def get_catalog_item_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "CatalogItem", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -1688,6 +1702,7 @@ def get_catalog_item_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "CatalogItem", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -1821,6 +1836,7 @@ def get_catalog_status( _response_types_map: Dict[str, Optional[str]] = { '200': "Catalog", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -1893,6 +1909,7 @@ def get_catalog_status_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "Catalog", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -1965,6 +1982,7 @@ def get_catalog_status_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "Catalog", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -2047,7 +2065,7 @@ def list_all_catalog_items( 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, 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[StrictInt], 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, + 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)], @@ -2108,11 +2126,11 @@ def list_all_catalog_items( _response_types_map: Dict[str, Optional[str]] = { '200': "CatalogItemList", - '400': "SchemasStatus", - '401': "SchemasStatus", - '403': "SchemasStatus", - '429': "SchemasStatus", - '503': "SchemasStatus", + '400': "Status", + '401': "Status", + '403': "Status", + '429': "Status", + '503': "Status", } response_data = self.api_client.call_api( *_param, @@ -2131,7 +2149,7 @@ def list_all_catalog_items_with_http_info( 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, 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[StrictInt], 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, + 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)], @@ -2192,11 +2210,11 @@ def list_all_catalog_items_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "CatalogItemList", - '400': "SchemasStatus", - '401': "SchemasStatus", - '403': "SchemasStatus", - '429': "SchemasStatus", - '503': "SchemasStatus", + '400': "Status", + '401': "Status", + '403': "Status", + '429': "Status", + '503': "Status", } response_data = self.api_client.call_api( *_param, @@ -2215,7 +2233,7 @@ def list_all_catalog_items_without_preload_content( 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, 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[StrictInt], 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, + 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)], @@ -2276,11 +2294,11 @@ def list_all_catalog_items_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "CatalogItemList", - '400': "SchemasStatus", - '401': "SchemasStatus", - '403': "SchemasStatus", - '429': "SchemasStatus", - '503': "SchemasStatus", + '400': "Status", + '401': "Status", + '403': "Status", + '429': "Status", + '503': "Status", } response_data = self.api_client.call_api( *_param, @@ -2375,7 +2393,7 @@ def list_catalog_items( catalog: Annotated[StrictStr, Field(description="The name of the Catalog resource.")], var_continue: Annotated[Optional[StrictStr], Field(description="An optional parameter to query more results from the server.")] = None, label_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their labels.")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The maximum number of results returned in the 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.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2460,7 +2478,7 @@ def list_catalog_items_with_http_info( catalog: Annotated[StrictStr, Field(description="The name of the Catalog resource.")], var_continue: Annotated[Optional[StrictStr], Field(description="An optional parameter to query more results from the server.")] = None, label_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their labels.")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The maximum number of results returned in the 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.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2545,7 +2563,7 @@ def list_catalog_items_without_preload_content( catalog: Annotated[StrictStr, Field(description="The name of the Catalog resource.")], var_continue: Annotated[Optional[StrictStr], Field(description="An optional parameter to query more results from the server.")] = None, label_selector: Annotated[Optional[StrictStr], Field(description="A selector to restrict the list of returned objects by their labels.")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The maximum number of results returned in the 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.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2704,7 +2722,7 @@ def list_catalogs( 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[StrictInt], 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, + 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)], @@ -2788,7 +2806,7 @@ def list_catalogs_with_http_info( 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[StrictInt], 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, + 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)], @@ -2872,7 +2890,7 @@ def list_catalogs_without_preload_content( 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[StrictInt], 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, + 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)], @@ -4660,6 +4678,7 @@ def replace_catalog_status( _response_types_map: Dict[str, Optional[str]] = { '200': "Catalog", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -4737,6 +4756,7 @@ def replace_catalog_status_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "Catalog", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", @@ -4814,6 +4834,7 @@ def replace_catalog_status_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "Catalog", + '400': "Status", '401': "Status", '403': "Status", '404': "Status", diff --git a/flightctl/v1alpha1/api/vulnerability_api.py b/flightctl/v1alpha1/api/vulnerability_api.py new file mode 100644 index 0000000..42ef8cc --- /dev/null +++ b/flightctl/v1alpha1/api/vulnerability_api.py @@ -0,0 +1,2329 @@ +# 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 warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr, field_validator +from typing import Optional +from typing_extensions import Annotated +from flightctl.v1alpha1.models.device_vulnerability_summary_response import DeviceVulnerabilitySummaryResponse +from flightctl.v1alpha1.models.fleet_vulnerability_summary_response import FleetVulnerabilitySummaryResponse +from flightctl.v1alpha1.models.vulnerability_group_list import VulnerabilityGroupList +from flightctl.v1alpha1.models.vulnerability_impact import VulnerabilityImpact +from flightctl.v1alpha1.models.vulnerability_list import VulnerabilityList +from flightctl.v1alpha1.models.vulnerability_summary_response import VulnerabilitySummaryResponse + +from flightctl.v1alpha1.api_client import ApiClient, RequestSerialized +from flightctl.v1alpha1.api_response import ApiResponse +from flightctl.v1alpha1.rest import RESTResponseType + + +class VulnerabilityApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def get_device_vulnerabilities( + self, + name: Annotated[StrictStr, Field(description="The metadata.name of the Device 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, + 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, + sort_by: Annotated[Optional[StrictStr], Field(description="Field to sort vulnerability list results by.")] = None, + order: Annotated[Optional[StrictStr], Field(description="Sort order for the results.")] = 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, + ) -> VulnerabilityList: + """get_device_vulnerabilities + + List vulnerabilities affecting a single device by device metadata name. + + :param name: The metadata.name of the Device 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 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 sort_by: Field to sort vulnerability list results by. + :type sort_by: str + :param order: Sort order for the results. + :type order: 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_device_vulnerabilities_serialize( + name=name, + var_continue=var_continue, + field_selector=field_selector, + sort_by=sort_by, + order=order, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VulnerabilityList", + '400': "Status", + '401': "Status", + '403': "Status", + '404': "Status", + '429': "Status", + '501': "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_device_vulnerabilities_with_http_info( + self, + name: Annotated[StrictStr, Field(description="The metadata.name of the Device 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, + 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, + sort_by: Annotated[Optional[StrictStr], Field(description="Field to sort vulnerability list results by.")] = None, + order: Annotated[Optional[StrictStr], Field(description="Sort order for the results.")] = 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[VulnerabilityList]: + """get_device_vulnerabilities + + List vulnerabilities affecting a single device by device metadata name. + + :param name: The metadata.name of the Device 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 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 sort_by: Field to sort vulnerability list results by. + :type sort_by: str + :param order: Sort order for the results. + :type order: 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_device_vulnerabilities_serialize( + name=name, + var_continue=var_continue, + field_selector=field_selector, + sort_by=sort_by, + order=order, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VulnerabilityList", + '400': "Status", + '401': "Status", + '403': "Status", + '404': "Status", + '429': "Status", + '501': "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_device_vulnerabilities_without_preload_content( + self, + name: Annotated[StrictStr, Field(description="The metadata.name of the Device 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, + 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, + sort_by: Annotated[Optional[StrictStr], Field(description="Field to sort vulnerability list results by.")] = None, + order: Annotated[Optional[StrictStr], Field(description="Sort order for the results.")] = 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_device_vulnerabilities + + List vulnerabilities affecting a single device by device metadata name. + + :param name: The metadata.name of the Device 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 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 sort_by: Field to sort vulnerability list results by. + :type sort_by: str + :param order: Sort order for the results. + :type order: 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_device_vulnerabilities_serialize( + name=name, + var_continue=var_continue, + field_selector=field_selector, + sort_by=sort_by, + order=order, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VulnerabilityList", + '400': "Status", + '401': "Status", + '403': "Status", + '404': "Status", + '429': "Status", + '501': "Status", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_device_vulnerabilities_serialize( + self, + name, + var_continue, + field_selector, + sort_by, + order, + 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 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 field_selector is not None: + + _query_params.append(('fieldSelector', field_selector)) + + if sort_by is not None: + + _query_params.append(('sortBy', sort_by)) + + if order is not None: + + _query_params.append(('order', order)) + + 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='/vulnerabilities/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 get_device_vulnerability_summary( + self, + name: Annotated[StrictStr, Field(description="The metadata.name of the Device resource.")], + 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, + _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, + ) -> DeviceVulnerabilitySummaryResponse: + """get_device_vulnerability_summary + + Return the severity summary for a single device without fetching the full CVE list. + + :param name: The metadata.name of the Device resource. (required) + :type name: 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 _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_device_vulnerability_summary_serialize( + name=name, + field_selector=field_selector, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DeviceVulnerabilitySummaryResponse", + '400': "Status", + '401': "Status", + '403': "Status", + '404': "Status", + '429': "Status", + '501': "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_device_vulnerability_summary_with_http_info( + self, + name: Annotated[StrictStr, Field(description="The metadata.name of the Device resource.")], + 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, + _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[DeviceVulnerabilitySummaryResponse]: + """get_device_vulnerability_summary + + Return the severity summary for a single device without fetching the full CVE list. + + :param name: The metadata.name of the Device resource. (required) + :type name: 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 _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_device_vulnerability_summary_serialize( + name=name, + field_selector=field_selector, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DeviceVulnerabilitySummaryResponse", + '400': "Status", + '401': "Status", + '403': "Status", + '404': "Status", + '429': "Status", + '501': "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_device_vulnerability_summary_without_preload_content( + self, + name: Annotated[StrictStr, Field(description="The metadata.name of the Device resource.")], + 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, + _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_device_vulnerability_summary + + Return the severity summary for a single device without fetching the full CVE list. + + :param name: The metadata.name of the Device resource. (required) + :type name: 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 _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_device_vulnerability_summary_serialize( + name=name, + field_selector=field_selector, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DeviceVulnerabilitySummaryResponse", + '400': "Status", + '401': "Status", + '403': "Status", + '404': "Status", + '429': "Status", + '501': "Status", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_device_vulnerability_summary_serialize( + self, + name, + field_selector, + _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 field_selector is not None: + + _query_params.append(('fieldSelector', field_selector)) + + # 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='/vulnerabilities/devices/{name}/summary', + 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_fleet_vulnerabilities( + self, + name: Annotated[StrictStr, Field(description="The metadata.name of the Fleet 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, + 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, + sort_by: Annotated[Optional[StrictStr], Field(description="Field to sort vulnerability list results by.")] = None, + order: Annotated[Optional[StrictStr], Field(description="Sort order for the results.")] = 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, + ) -> VulnerabilityGroupList: + """get_fleet_vulnerabilities + + List vulnerabilities aggregated for a fleet by fleet metadata name. + + :param name: The metadata.name of the Fleet 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 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 sort_by: Field to sort vulnerability list results by. + :type sort_by: str + :param order: Sort order for the results. + :type order: 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_fleet_vulnerabilities_serialize( + name=name, + var_continue=var_continue, + field_selector=field_selector, + sort_by=sort_by, + order=order, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VulnerabilityGroupList", + '400': "Status", + '401': "Status", + '403': "Status", + '404': "Status", + '429': "Status", + '501': "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_fleet_vulnerabilities_with_http_info( + self, + name: Annotated[StrictStr, Field(description="The metadata.name of the Fleet 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, + 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, + sort_by: Annotated[Optional[StrictStr], Field(description="Field to sort vulnerability list results by.")] = None, + order: Annotated[Optional[StrictStr], Field(description="Sort order for the results.")] = 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[VulnerabilityGroupList]: + """get_fleet_vulnerabilities + + List vulnerabilities aggregated for a fleet by fleet metadata name. + + :param name: The metadata.name of the Fleet 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 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 sort_by: Field to sort vulnerability list results by. + :type sort_by: str + :param order: Sort order for the results. + :type order: 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_fleet_vulnerabilities_serialize( + name=name, + var_continue=var_continue, + field_selector=field_selector, + sort_by=sort_by, + order=order, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VulnerabilityGroupList", + '400': "Status", + '401': "Status", + '403': "Status", + '404': "Status", + '429': "Status", + '501': "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_fleet_vulnerabilities_without_preload_content( + self, + name: Annotated[StrictStr, Field(description="The metadata.name of the Fleet 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, + 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, + sort_by: Annotated[Optional[StrictStr], Field(description="Field to sort vulnerability list results by.")] = None, + order: Annotated[Optional[StrictStr], Field(description="Sort order for the results.")] = 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_fleet_vulnerabilities + + List vulnerabilities aggregated for a fleet by fleet metadata name. + + :param name: The metadata.name of the Fleet 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 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 sort_by: Field to sort vulnerability list results by. + :type sort_by: str + :param order: Sort order for the results. + :type order: 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_fleet_vulnerabilities_serialize( + name=name, + var_continue=var_continue, + field_selector=field_selector, + sort_by=sort_by, + order=order, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VulnerabilityGroupList", + '400': "Status", + '401': "Status", + '403': "Status", + '404': "Status", + '429': "Status", + '501': "Status", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_fleet_vulnerabilities_serialize( + self, + name, + var_continue, + field_selector, + sort_by, + order, + 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 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 field_selector is not None: + + _query_params.append(('fieldSelector', field_selector)) + + if sort_by is not None: + + _query_params.append(('sortBy', sort_by)) + + if order is not None: + + _query_params.append(('order', order)) + + 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='/vulnerabilities/fleets/{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 get_fleet_vulnerability_summary( + self, + name: Annotated[StrictStr, Field(description="The metadata.name of the Fleet resource.")], + 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, + _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, + ) -> FleetVulnerabilitySummaryResponse: + """get_fleet_vulnerability_summary + + Return the severity summary for a single fleet without fetching the full CVE list. + + :param name: The metadata.name of the Fleet resource. (required) + :type name: 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 _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_fleet_vulnerability_summary_serialize( + name=name, + field_selector=field_selector, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FleetVulnerabilitySummaryResponse", + '400': "Status", + '401': "Status", + '403': "Status", + '404': "Status", + '429': "Status", + '501': "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_fleet_vulnerability_summary_with_http_info( + self, + name: Annotated[StrictStr, Field(description="The metadata.name of the Fleet resource.")], + 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, + _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[FleetVulnerabilitySummaryResponse]: + """get_fleet_vulnerability_summary + + Return the severity summary for a single fleet without fetching the full CVE list. + + :param name: The metadata.name of the Fleet resource. (required) + :type name: 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 _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_fleet_vulnerability_summary_serialize( + name=name, + field_selector=field_selector, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FleetVulnerabilitySummaryResponse", + '400': "Status", + '401': "Status", + '403': "Status", + '404': "Status", + '429': "Status", + '501': "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_fleet_vulnerability_summary_without_preload_content( + self, + name: Annotated[StrictStr, Field(description="The metadata.name of the Fleet resource.")], + 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, + _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_fleet_vulnerability_summary + + Return the severity summary for a single fleet without fetching the full CVE list. + + :param name: The metadata.name of the Fleet resource. (required) + :type name: 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 _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_fleet_vulnerability_summary_serialize( + name=name, + field_selector=field_selector, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FleetVulnerabilitySummaryResponse", + '400': "Status", + '401': "Status", + '403': "Status", + '404': "Status", + '429': "Status", + '501': "Status", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_fleet_vulnerability_summary_serialize( + self, + name, + field_selector, + _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 field_selector is not None: + + _query_params.append(('fieldSelector', field_selector)) + + # 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='/vulnerabilities/fleets/{name}/summary', + 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_vulnerability_impact( + self, + cve_id: Annotated[StrictStr, Field(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.")], + 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, + field_selector: Annotated[Optional[StrictStr], Field(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.")] = None, + sort_by: Annotated[Optional[StrictStr], Field(description="Field to sort blast radius rows by.")] = None, + order: Annotated[Optional[StrictStr], Field(description="Sort order for the results.")] = 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, + ) -> VulnerabilityImpact: + """get_vulnerability_impact + + Return per-fleet and fleetless blast radius for a CVE identifier. + + :param cve_id: 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) + :type cve_id: 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 field_selector: 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. + :type field_selector: str + :param sort_by: Field to sort blast radius rows by. + :type sort_by: str + :param order: Sort order for the results. + :type order: 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_vulnerability_impact_serialize( + cve_id=cve_id, + var_continue=var_continue, + field_selector=field_selector, + sort_by=sort_by, + order=order, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VulnerabilityImpact", + '400': "Status", + '401': "Status", + '403': "Status", + '429': "Status", + '501': "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_vulnerability_impact_with_http_info( + self, + cve_id: Annotated[StrictStr, Field(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.")], + 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, + field_selector: Annotated[Optional[StrictStr], Field(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.")] = None, + sort_by: Annotated[Optional[StrictStr], Field(description="Field to sort blast radius rows by.")] = None, + order: Annotated[Optional[StrictStr], Field(description="Sort order for the results.")] = 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[VulnerabilityImpact]: + """get_vulnerability_impact + + Return per-fleet and fleetless blast radius for a CVE identifier. + + :param cve_id: 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) + :type cve_id: 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 field_selector: 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. + :type field_selector: str + :param sort_by: Field to sort blast radius rows by. + :type sort_by: str + :param order: Sort order for the results. + :type order: 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_vulnerability_impact_serialize( + cve_id=cve_id, + var_continue=var_continue, + field_selector=field_selector, + sort_by=sort_by, + order=order, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VulnerabilityImpact", + '400': "Status", + '401': "Status", + '403': "Status", + '429': "Status", + '501': "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_vulnerability_impact_without_preload_content( + self, + cve_id: Annotated[StrictStr, Field(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.")], + 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, + field_selector: Annotated[Optional[StrictStr], Field(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.")] = None, + sort_by: Annotated[Optional[StrictStr], Field(description="Field to sort blast radius rows by.")] = None, + order: Annotated[Optional[StrictStr], Field(description="Sort order for the results.")] = 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_vulnerability_impact + + Return per-fleet and fleetless blast radius for a CVE identifier. + + :param cve_id: 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) + :type cve_id: 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 field_selector: 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. + :type field_selector: str + :param sort_by: Field to sort blast radius rows by. + :type sort_by: str + :param order: Sort order for the results. + :type order: 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_vulnerability_impact_serialize( + cve_id=cve_id, + var_continue=var_continue, + field_selector=field_selector, + sort_by=sort_by, + order=order, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VulnerabilityImpact", + '400': "Status", + '401': "Status", + '403': "Status", + '429': "Status", + '501': "Status", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_vulnerability_impact_serialize( + self, + cve_id, + var_continue, + field_selector, + sort_by, + order, + 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 cve_id is not None: + _path_params['cveId'] = cve_id + # process the query parameters + if var_continue is not None: + + _query_params.append(('continue', var_continue)) + + if field_selector is not None: + + _query_params.append(('fieldSelector', field_selector)) + + if sort_by is not None: + + _query_params.append(('sortBy', sort_by)) + + if order is not None: + + _query_params.append(('order', order)) + + 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='/vulnerabilities/cves/{cveId}/impact', + 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_vulnerability_summary( + self, + _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, + ) -> VulnerabilitySummaryResponse: + """get_vulnerability_summary + + Return organization-wide CVE counts by severity. + + :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_vulnerability_summary_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VulnerabilitySummaryResponse", + '400': "Status", + '401': "Status", + '403': "Status", + '429': "Status", + '501': "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_vulnerability_summary_with_http_info( + self, + _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[VulnerabilitySummaryResponse]: + """get_vulnerability_summary + + Return organization-wide CVE counts by severity. + + :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_vulnerability_summary_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VulnerabilitySummaryResponse", + '400': "Status", + '401': "Status", + '403': "Status", + '429': "Status", + '501': "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_vulnerability_summary_without_preload_content( + self, + _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_vulnerability_summary + + Return organization-wide CVE counts by severity. + + :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_vulnerability_summary_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VulnerabilitySummaryResponse", + '400': "Status", + '401': "Status", + '403': "Status", + '429': "Status", + '501': "Status", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_vulnerability_summary_serialize( + self, + _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 + # 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='/vulnerabilities/summary', + 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_vulnerabilities( + self, + 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, + 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, + sort_by: Annotated[Optional[StrictStr], Field(description="Field to sort vulnerability list results by.")] = None, + order: Annotated[Optional[StrictStr], Field(description="Sort order for the results.")] = 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, + ) -> VulnerabilityGroupList: + """list_vulnerabilities + + List distinct vulnerabilities across the organization with affected device counts. + + :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 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 sort_by: Field to sort vulnerability list results by. + :type sort_by: str + :param order: Sort order for the results. + :type order: 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._list_vulnerabilities_serialize( + var_continue=var_continue, + field_selector=field_selector, + sort_by=sort_by, + order=order, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VulnerabilityGroupList", + '400': "Status", + '401': "Status", + '403': "Status", + '429': "Status", + '501': "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_vulnerabilities_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 parameter must match the value of the 'continue' field in the previous list response.")] = 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, + sort_by: Annotated[Optional[StrictStr], Field(description="Field to sort vulnerability list results by.")] = None, + order: Annotated[Optional[StrictStr], Field(description="Sort order for the results.")] = 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[VulnerabilityGroupList]: + """list_vulnerabilities + + List distinct vulnerabilities across the organization with affected device counts. + + :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 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 sort_by: Field to sort vulnerability list results by. + :type sort_by: str + :param order: Sort order for the results. + :type order: 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._list_vulnerabilities_serialize( + var_continue=var_continue, + field_selector=field_selector, + sort_by=sort_by, + order=order, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VulnerabilityGroupList", + '400': "Status", + '401': "Status", + '403': "Status", + '429': "Status", + '501': "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_vulnerabilities_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 parameter must match the value of the 'continue' field in the previous list response.")] = 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, + sort_by: Annotated[Optional[StrictStr], Field(description="Field to sort vulnerability list results by.")] = None, + order: Annotated[Optional[StrictStr], Field(description="Sort order for the results.")] = 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: + """list_vulnerabilities + + List distinct vulnerabilities across the organization with affected device counts. + + :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 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 sort_by: Field to sort vulnerability list results by. + :type sort_by: str + :param order: Sort order for the results. + :type order: 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._list_vulnerabilities_serialize( + var_continue=var_continue, + field_selector=field_selector, + sort_by=sort_by, + order=order, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VulnerabilityGroupList", + '400': "Status", + '401': "Status", + '403': "Status", + '429': "Status", + '501': "Status", + '503': "Status", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_vulnerabilities_serialize( + self, + var_continue, + field_selector, + sort_by, + order, + 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 + # process the query parameters + if var_continue is not None: + + _query_params.append(('continue', var_continue)) + + if field_selector is not None: + + _query_params.append(('fieldSelector', field_selector)) + + if sort_by is not None: + + _query_params.append(('sortBy', sort_by)) + + if order is not None: + + _query_params.append(('order', order)) + + 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='/vulnerabilities', + 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/v1alpha1/api_client.py b/flightctl/v1alpha1/api_client.py index 4d63bb8..492b1cf 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.1.0/python' + self.user_agent = 'OpenAPI-Generator/1.2.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 9d4348d..8cdf57e 100644 --- a/flightctl/v1alpha1/configuration.py +++ b/flightctl/v1alpha1/configuration.py @@ -215,7 +215,7 @@ def __init__( ) -> None: """Constructor """ - self._base_path = "/api/v1" if host is None else host.rstrip("/") + "/api/v1" + self._base_path = "/api/v1" if host is None else host """Default Base url """ self.server_index = 0 if server_index is None and host is None else server_index @@ -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.1.0".\ + "SDK Package Version: 1.2.0".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self) -> List[HostSetting]: diff --git a/flightctl/v1alpha1/docs/AffectedFleet.md b/flightctl/v1alpha1/docs/AffectedFleet.md new file mode 100644 index 0000000..12e0f92 --- /dev/null +++ b/flightctl/v1alpha1/docs/AffectedFleet.md @@ -0,0 +1,33 @@ +# AffectedFleet + +One fleet or the fleetless aggregate with device and image counts for a CVE. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fleet_name** | **str** | Fleet metadata.name, empty for the fleetless aggregate. | +**fleetless** | **bool** | True when this row represents devices not owned by a fleet. | +**affected_devices** | **int** | Devices in this fleet or fleetless group affected by the CVE. | +**findings** | [**List[VulnerabilityGroupItem]**](VulnerabilityGroupItem.md) | Per-digest findings within this fleet or fleetless group. | + +## Example + +```python +from flightctl.v1alpha1.models.affected_fleet import AffectedFleet + +# TODO update the JSON string below +json = "{}" +# create an instance of AffectedFleet from a JSON string +affected_fleet_instance = AffectedFleet.from_json(json) +# print the JSON string representation of the object +print(AffectedFleet.to_json()) + +# convert the object into a dict +affected_fleet_dict = affected_fleet_instance.to_dict() +# create an instance of AffectedFleet from a dict +affected_fleet_from_dict = AffectedFleet.from_dict(affected_fleet_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/ApiVersion.md b/flightctl/v1alpha1/docs/ApiVersion.md index 1cdff2f..c193c90 100644 --- a/flightctl/v1alpha1/docs/ApiVersion.md +++ b/flightctl/v1alpha1/docs/ApiVersion.md @@ -4,9 +4,9 @@ APIVersion defines the versioned schema of this representation of an object. Ser ## Enum -* `V1ALPHA1` (value: `'v1alpha1'`) +* `ApiVersionV1alpha1` (value: `'v1alpha1'`) -* `FLIGHTCTL_DOT_IO_SLASH_V1ALPHA1` (value: `'flightctl.io/v1alpha1'`) +* `ApiVersionFlightctlIoV1alpha1` (value: `'flightctl.io/v1alpha1'`) [[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/CatalogApi.md b/flightctl/v1alpha1/docs/CatalogApi.md index ac3add7..300b427 100644 --- a/flightctl/v1alpha1/docs/CatalogApi.md +++ b/flightctl/v1alpha1/docs/CatalogApi.md @@ -118,7 +118,7 @@ configuration = flightctl.v1alpha1.Configuration( with flightctl.v1alpha1.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = flightctl.v1alpha1.CatalogApi(api_client) - catalog = 'catalog_example' # str | The name of the Catalog resource. + catalog = 'edge-apps' # str | The name of the Catalog resource. catalog_item = flightctl.v1alpha1.CatalogItem() # CatalogItem | The CatalogItem resource to create. try: @@ -228,9 +228,11 @@ No authorization required | 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 | - | @@ -261,7 +263,7 @@ configuration = flightctl.v1alpha1.Configuration( with flightctl.v1alpha1.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = flightctl.v1alpha1.CatalogApi(api_client) - catalog = 'catalog_example' # str | The name of the Catalog resource. + catalog = 'edge-apps' # str | The name of the Catalog resource. name = 'name_example' # str | The name of the CatalogItem resource. try: @@ -300,6 +302,7 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | +**400** | Bad Request | - | **401** | Unauthorized | - | **403** | Forbidden | - | **404** | Not Found | - | @@ -369,6 +372,7 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | +**400** | Bad Request | - | **401** | Unauthorized | - | **403** | Forbidden | - | **404** | Not Found | - | @@ -402,7 +406,7 @@ configuration = flightctl.v1alpha1.Configuration( with flightctl.v1alpha1.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = flightctl.v1alpha1.CatalogApi(api_client) - catalog = 'catalog_example' # str | The name of the Catalog resource. + catalog = 'edge-apps' # str | The name of the Catalog resource. name = 'name_example' # str | The name of the CatalogItem resource. try: @@ -441,6 +445,7 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | +**400** | Bad Request | - | **401** | Unauthorized | - | **403** | Forbidden | - | **404** | Not Found | - | @@ -510,6 +515,7 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | +**400** | Bad Request | - | **401** | Unauthorized | - | **403** | Forbidden | - | **404** | Not Found | - | @@ -619,7 +625,7 @@ configuration = flightctl.v1alpha1.Configuration( with flightctl.v1alpha1.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = flightctl.v1alpha1.CatalogApi(api_client) - catalog = 'catalog_example' # str | The name of the Catalog resource. + catalog = 'edge-apps' # str | The name of the Catalog resource. var_continue = 'var_continue_example' # str | An optional parameter to query more results from the server. (optional) label_selector = 'label_selector_example' # str | A selector to restrict the list of returned objects by their labels. (optional) limit = 56 # int | The maximum number of results returned in the list response. (optional) @@ -848,7 +854,7 @@ configuration = flightctl.v1alpha1.Configuration( with flightctl.v1alpha1.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = flightctl.v1alpha1.CatalogApi(api_client) - catalog = 'catalog_example' # str | The name of the Catalog resource. + catalog = 'edge-apps' # str | The name of the Catalog resource. name = 'name_example' # str | The name of the CatalogItem resource to patch. patch_request_inner = [flightctl.v1alpha1.PatchRequestInner()] # List[PatchRequestInner] | @@ -1072,7 +1078,7 @@ configuration = flightctl.v1alpha1.Configuration( with flightctl.v1alpha1.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = flightctl.v1alpha1.CatalogApi(api_client) - catalog = 'catalog_example' # str | The name of the Catalog resource. + catalog = 'edge-apps' # str | The name of the Catalog resource. name = 'name_example' # str | The name of the CatalogItem resource. catalog_item = flightctl.v1alpha1.CatalogItem() # CatalogItem | The CatalogItem resource to replace. @@ -1187,6 +1193,7 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | +**400** | Bad Request | - | **401** | Unauthorized | - | **403** | Forbidden | - | **404** | Not Found | - | diff --git a/flightctl/v1alpha1/docs/CatalogItemArtifactType.md b/flightctl/v1alpha1/docs/CatalogItemArtifactType.md index 85db6bf..d5a71b5 100644 --- a/flightctl/v1alpha1/docs/CatalogItemArtifactType.md +++ b/flightctl/v1alpha1/docs/CatalogItemArtifactType.md @@ -22,6 +22,8 @@ Artifact format discriminator. Must be unique within the artifacts list. Include * `CatalogItemArtifactTypeGce` (value: `'gce'`) +* `CatalogItemArtifactTypeQcow2DiskContainer` (value: `'qcow2-disk-container'`) + [[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/CatalogItemVersion.md b/flightctl/v1alpha1/docs/CatalogItemVersion.md index 74224e2..386f113 100644 --- a/flightctl/v1alpha1/docs/CatalogItemVersion.md +++ b/flightctl/v1alpha1/docs/CatalogItemVersion.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **config** | **Dict[str, object]** | Configuration values (envVars, ports, volumes, resources, etc.). | [optional] **config_schema** | **Dict[str, object]** | JSON Schema defining configurable parameters and their validation. | [optional] **readme** | **str** | Detailed documentation, preferably in markdown format. | [optional] -**version** | **str** | Semantic version identifier (e.g., 1.2.3, v2.0.0-rc1). Required for version ordering and upgrade graph. | +**version** | **str** | Semantic version identifier (e.g., 1.2.3, 2.0.0-rc1). Required for version ordering and upgrade graph. | **references** | **Dict[str, str]** | 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. | **channels** | **List[str]** | Channels this version belongs to. | **replaces** | **str** | The single version this one replaces, defining the primary upgrade edge. | [optional] diff --git a/flightctl/v1alpha1/docs/CveCountsBySeverity.md b/flightctl/v1alpha1/docs/CveCountsBySeverity.md new file mode 100644 index 0000000..697b811 --- /dev/null +++ b/flightctl/v1alpha1/docs/CveCountsBySeverity.md @@ -0,0 +1,36 @@ +# CveCountsBySeverity + +Counts of distinct CVEs in the organization by highest severity. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total** | **int** | Total distinct CVEs across the organization. | +**critical** | **int** | Count of distinct Critical CVEs. | +**high** | **int** | Count of distinct High CVEs. | +**medium** | **int** | Count of distinct Medium CVEs. | +**low** | **int** | Count of distinct Low CVEs. | +**var_none** | **int** | Count of distinct CVEs with no exploitable impact (CVSS score 0). | +**unknown** | **int** | Count of distinct CVEs with unknown or unscored severity. | + +## Example + +```python +from flightctl.v1alpha1.models.cve_counts_by_severity import CveCountsBySeverity + +# TODO update the JSON string below +json = "{}" +# create an instance of CveCountsBySeverity from a JSON string +cve_counts_by_severity_instance = CveCountsBySeverity.from_json(json) +# print the JSON string representation of the object +print(CveCountsBySeverity.to_json()) + +# convert the object into a dict +cve_counts_by_severity_dict = cve_counts_by_severity_instance.to_dict() +# create an instance of CveCountsBySeverity from a dict +cve_counts_by_severity_from_dict = CveCountsBySeverity.from_dict(cve_counts_by_severity_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/DeviceCountsBySeverity.md b/flightctl/v1alpha1/docs/DeviceCountsBySeverity.md new file mode 100644 index 0000000..b287edf --- /dev/null +++ b/flightctl/v1alpha1/docs/DeviceCountsBySeverity.md @@ -0,0 +1,36 @@ +# DeviceCountsBySeverity + +Counts of distinct devices affected in the organization, grouped by vulnerability severity. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total** | **int** | Number of distinct devices with at least one vulnerability finding in the organization. | +**critical** | **int** | Number of devices whose highest severity finding is critical. | +**high** | **int** | Number of devices whose highest severity finding is high. | +**medium** | **int** | Number of devices whose highest severity finding is medium. | +**low** | **int** | Number of devices whose highest severity finding is low. | +**var_none** | **int** | Number of devices whose highest severity finding is none. | +**unknown** | **int** | Number of devices whose highest severity finding is unknown. | + +## Example + +```python +from flightctl.v1alpha1.models.device_counts_by_severity import DeviceCountsBySeverity + +# TODO update the JSON string below +json = "{}" +# create an instance of DeviceCountsBySeverity from a JSON string +device_counts_by_severity_instance = DeviceCountsBySeverity.from_json(json) +# print the JSON string representation of the object +print(DeviceCountsBySeverity.to_json()) + +# convert the object into a dict +device_counts_by_severity_dict = device_counts_by_severity_instance.to_dict() +# create an instance of DeviceCountsBySeverity from a dict +device_counts_by_severity_from_dict = DeviceCountsBySeverity.from_dict(device_counts_by_severity_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/DeviceVulnerabilitySummaryResponse.md b/flightctl/v1alpha1/docs/DeviceVulnerabilitySummaryResponse.md new file mode 100644 index 0000000..d76400f --- /dev/null +++ b/flightctl/v1alpha1/docs/DeviceVulnerabilitySummaryResponse.md @@ -0,0 +1,34 @@ +# DeviceVulnerabilitySummaryResponse + +Severity summary for a single device. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | [**ApiVersion**](ApiVersion.md) | | +**kind** | **str** | Resource kind; always DeviceVulnerabilitySummary. | +**image** | **str** | Image reference from device status. Absent when the device has no rendered OS image. | [optional] +**image_digest** | **str** | Image digest from device status. Absent when the device has no rendered OS image. | [optional] +**summary** | [**VulnerabilitySeveritySummary**](VulnerabilitySeveritySummary.md) | | + +## Example + +```python +from flightctl.v1alpha1.models.device_vulnerability_summary_response import DeviceVulnerabilitySummaryResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of DeviceVulnerabilitySummaryResponse from a JSON string +device_vulnerability_summary_response_instance = DeviceVulnerabilitySummaryResponse.from_json(json) +# print the JSON string representation of the object +print(DeviceVulnerabilitySummaryResponse.to_json()) + +# convert the object into a dict +device_vulnerability_summary_response_dict = device_vulnerability_summary_response_instance.to_dict() +# create an instance of DeviceVulnerabilitySummaryResponse from a dict +device_vulnerability_summary_response_from_dict = DeviceVulnerabilitySummaryResponse.from_dict(device_vulnerability_summary_response_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/FleetVulnerabilitySummary.md b/flightctl/v1alpha1/docs/FleetVulnerabilitySummary.md new file mode 100644 index 0000000..b0ca6a1 --- /dev/null +++ b/flightctl/v1alpha1/docs/FleetVulnerabilitySummary.md @@ -0,0 +1,37 @@ +# FleetVulnerabilitySummary + +Fleet vulnerability totals including unique digest count. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total** | **int** | Total vulnerabilities across all severities for the full result set. | +**critical** | **int** | Count of Critical severity findings in the full result set. | +**high** | **int** | Count of High severity findings in the full result set. | +**medium** | **int** | Count of Medium severity findings in the full result set. | +**low** | **int** | Count of Low severity findings in the full result set. | +**var_none** | **int** | Count of findings with no exploitable impact (CVSS score 0). | +**unknown** | **int** | Count of findings with unknown or unscored severity. | +**unique_digests** | **int** | Distinct image digests observed in the fleet. | + +## Example + +```python +from flightctl.v1alpha1.models.fleet_vulnerability_summary import FleetVulnerabilitySummary + +# TODO update the JSON string below +json = "{}" +# create an instance of FleetVulnerabilitySummary from a JSON string +fleet_vulnerability_summary_instance = FleetVulnerabilitySummary.from_json(json) +# print the JSON string representation of the object +print(FleetVulnerabilitySummary.to_json()) + +# convert the object into a dict +fleet_vulnerability_summary_dict = fleet_vulnerability_summary_instance.to_dict() +# create an instance of FleetVulnerabilitySummary from a dict +fleet_vulnerability_summary_from_dict = FleetVulnerabilitySummary.from_dict(fleet_vulnerability_summary_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/FleetVulnerabilitySummaryResponse.md b/flightctl/v1alpha1/docs/FleetVulnerabilitySummaryResponse.md new file mode 100644 index 0000000..364fc8f --- /dev/null +++ b/flightctl/v1alpha1/docs/FleetVulnerabilitySummaryResponse.md @@ -0,0 +1,32 @@ +# FleetVulnerabilitySummaryResponse + +Severity summary for a single fleet. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | [**ApiVersion**](ApiVersion.md) | | +**kind** | **str** | Resource kind; always FleetVulnerabilitySummary. | +**summary** | [**FleetVulnerabilitySummary**](FleetVulnerabilitySummary.md) | | + +## Example + +```python +from flightctl.v1alpha1.models.fleet_vulnerability_summary_response import FleetVulnerabilitySummaryResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of FleetVulnerabilitySummaryResponse from a JSON string +fleet_vulnerability_summary_response_instance = FleetVulnerabilitySummaryResponse.from_json(json) +# print the JSON string representation of the object +print(FleetVulnerabilitySummaryResponse.to_json()) + +# convert the object into a dict +fleet_vulnerability_summary_response_dict = fleet_vulnerability_summary_response_instance.to_dict() +# create an instance of FleetVulnerabilitySummaryResponse from a dict +fleet_vulnerability_summary_response_from_dict = FleetVulnerabilitySummaryResponse.from_dict(fleet_vulnerability_summary_response_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/Vulnerability.md b/flightctl/v1alpha1/docs/Vulnerability.md new file mode 100644 index 0000000..0a00a2d --- /dev/null +++ b/flightctl/v1alpha1/docs/Vulnerability.md @@ -0,0 +1,42 @@ +# Vulnerability + +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. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | [**ApiVersion**](ApiVersion.md) | | +**kind** | **str** | Kind is a string value representing the REST resource this object represents. Always Vulnerability. | +**cve_id** | **str** | CVE identifier (e.g. CVE-2024-1234). | +**advisory_id** | **str** | Vendor advisory identifier when available. | [optional] +**issuer** | **str** | Name of the advisory issuer (e.g. Red Hat, NVD) when known. | [optional] +**link** | **str** | URL to the CVE details page. Points to Red Hat Security portal for Red Hat advisories, otherwise to NVD. | [optional] +**severity** | **str** | Normalized severity label. | +**cvss_score** | **float** | CVSS base score when available. | [optional] +**description** | **str** | Short summary of the vulnerability. | [optional] +**published_at** | **datetime** | Advisory publish time when known. | [optional] +**image** | **str** | Image reference (name or URL) from the device context. | [optional] +**image_digest** | **str** | Immutable image digest from the device context. | [optional] +**affected_devices** | **int** | 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. | [optional] + +## Example + +```python +from flightctl.v1alpha1.models.vulnerability import Vulnerability + +# TODO update the JSON string below +json = "{}" +# create an instance of Vulnerability from a JSON string +vulnerability_instance = Vulnerability.from_json(json) +# print the JSON string representation of the object +print(Vulnerability.to_json()) + +# convert the object into a dict +vulnerability_dict = vulnerability_instance.to_dict() +# create an instance of Vulnerability from a dict +vulnerability_from_dict = Vulnerability.from_dict(vulnerability_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/VulnerabilityApi.md b/flightctl/v1alpha1/docs/VulnerabilityApi.md new file mode 100644 index 0000000..6c3e201 --- /dev/null +++ b/flightctl/v1alpha1/docs/VulnerabilityApi.md @@ -0,0 +1,548 @@ +# flightctl.v1alpha1.VulnerabilityApi + +All URIs are relative to */api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_device_vulnerabilities**](VulnerabilityApi.md#get_device_vulnerabilities) | **GET** /vulnerabilities/devices/{name} | +[**get_device_vulnerability_summary**](VulnerabilityApi.md#get_device_vulnerability_summary) | **GET** /vulnerabilities/devices/{name}/summary | +[**get_fleet_vulnerabilities**](VulnerabilityApi.md#get_fleet_vulnerabilities) | **GET** /vulnerabilities/fleets/{name} | +[**get_fleet_vulnerability_summary**](VulnerabilityApi.md#get_fleet_vulnerability_summary) | **GET** /vulnerabilities/fleets/{name}/summary | +[**get_vulnerability_impact**](VulnerabilityApi.md#get_vulnerability_impact) | **GET** /vulnerabilities/cves/{cveId}/impact | +[**get_vulnerability_summary**](VulnerabilityApi.md#get_vulnerability_summary) | **GET** /vulnerabilities/summary | +[**list_vulnerabilities**](VulnerabilityApi.md#list_vulnerabilities) | **GET** /vulnerabilities | + + +# **get_device_vulnerabilities** +> VulnerabilityList get_device_vulnerabilities(name, var_continue=var_continue, field_selector=field_selector, sort_by=sort_by, order=order, limit=limit) + +List vulnerabilities affecting a single device by device metadata name. + +### Example + + +```python +import flightctl.v1alpha1 +from flightctl.v1alpha1.models.vulnerability_list import VulnerabilityList +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.VulnerabilityApi(api_client) + name = 'name_example' # str | The metadata.name of the Device 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) + field_selector = 'field_selector_example' # str | A selector to restrict the list of returned objects by their fields, supporting operators like '=', '==', and '!=' (e.g., \"key1=value1,key2!=value2\"). (optional) + sort_by = severity # str | Field to sort vulnerability list results by. (optional) (default to severity) + order = desc # str | Sort order for the results. (optional) (default to desc) + 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_device_vulnerabilities(name, var_continue=var_continue, field_selector=field_selector, sort_by=sort_by, order=order, limit=limit) + print("The response of VulnerabilityApi->get_device_vulnerabilities:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling VulnerabilityApi->get_device_vulnerabilities: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **str**| The metadata.name of the Device 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] + **field_selector** | **str**| A selector to restrict the list of returned objects by their fields, supporting operators like '=', '==', and '!=' (e.g., \"key1=value1,key2!=value2\"). | [optional] + **sort_by** | **str**| Field to sort vulnerability list results by. | [optional] [default to severity] + **order** | **str**| Sort order for the results. | [optional] [default to desc] + **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 + +[**VulnerabilityList**](VulnerabilityList.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. | - | +**429** | Too Many Requests. | - | +**501** | Not Implemented (vulnerability feature is not enabled on this server). | - | + +[[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_vulnerability_summary** +> DeviceVulnerabilitySummaryResponse get_device_vulnerability_summary(name, field_selector=field_selector) + +Return the severity summary for a single device without fetching the full CVE list. + +### Example + + +```python +import flightctl.v1alpha1 +from flightctl.v1alpha1.models.device_vulnerability_summary_response import DeviceVulnerabilitySummaryResponse +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.VulnerabilityApi(api_client) + name = 'name_example' # str | The metadata.name of the Device resource. + field_selector = 'field_selector_example' # str | A selector to restrict the list of returned objects by their fields, supporting operators like '=', '==', and '!=' (e.g., \"key1=value1,key2!=value2\"). (optional) + + try: + api_response = api_instance.get_device_vulnerability_summary(name, field_selector=field_selector) + print("The response of VulnerabilityApi->get_device_vulnerability_summary:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling VulnerabilityApi->get_device_vulnerability_summary: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **str**| The metadata.name of the Device resource. | + **field_selector** | **str**| A selector to restrict the list of returned objects by their fields, supporting operators like '=', '==', and '!=' (e.g., \"key1=value1,key2!=value2\"). | [optional] + +### Return type + +[**DeviceVulnerabilitySummaryResponse**](DeviceVulnerabilitySummaryResponse.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. | - | +**429** | Too Many Requests. | - | +**501** | Not Implemented (vulnerability feature is not enabled on this server). | - | + +[[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_fleet_vulnerabilities** +> VulnerabilityGroupList get_fleet_vulnerabilities(name, var_continue=var_continue, field_selector=field_selector, sort_by=sort_by, order=order, limit=limit) + +List vulnerabilities aggregated for a fleet by fleet metadata name. + +### Example + + +```python +import flightctl.v1alpha1 +from flightctl.v1alpha1.models.vulnerability_group_list import VulnerabilityGroupList +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.VulnerabilityApi(api_client) + name = 'name_example' # str | The metadata.name of the Fleet 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) + field_selector = 'field_selector_example' # str | A selector to restrict the list of returned objects by their fields, supporting operators like '=', '==', and '!=' (e.g., \"key1=value1,key2!=value2\"). (optional) + sort_by = severity # str | Field to sort vulnerability list results by. (optional) (default to severity) + order = desc # str | Sort order for the results. (optional) (default to desc) + 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_fleet_vulnerabilities(name, var_continue=var_continue, field_selector=field_selector, sort_by=sort_by, order=order, limit=limit) + print("The response of VulnerabilityApi->get_fleet_vulnerabilities:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling VulnerabilityApi->get_fleet_vulnerabilities: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **str**| The metadata.name of the Fleet 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] + **field_selector** | **str**| A selector to restrict the list of returned objects by their fields, supporting operators like '=', '==', and '!=' (e.g., \"key1=value1,key2!=value2\"). | [optional] + **sort_by** | **str**| Field to sort vulnerability list results by. | [optional] [default to severity] + **order** | **str**| Sort order for the results. | [optional] [default to desc] + **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 + +[**VulnerabilityGroupList**](VulnerabilityGroupList.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. | - | +**429** | Too Many Requests. | - | +**501** | Not Implemented (vulnerability feature is not enabled on this server). | - | + +[[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_fleet_vulnerability_summary** +> FleetVulnerabilitySummaryResponse get_fleet_vulnerability_summary(name, field_selector=field_selector) + +Return the severity summary for a single fleet without fetching the full CVE list. + +### Example + + +```python +import flightctl.v1alpha1 +from flightctl.v1alpha1.models.fleet_vulnerability_summary_response import FleetVulnerabilitySummaryResponse +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.VulnerabilityApi(api_client) + name = 'name_example' # str | The metadata.name of the Fleet resource. + field_selector = 'field_selector_example' # str | A selector to restrict the list of returned objects by their fields, supporting operators like '=', '==', and '!=' (e.g., \"key1=value1,key2!=value2\"). (optional) + + try: + api_response = api_instance.get_fleet_vulnerability_summary(name, field_selector=field_selector) + print("The response of VulnerabilityApi->get_fleet_vulnerability_summary:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling VulnerabilityApi->get_fleet_vulnerability_summary: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **str**| The metadata.name of the Fleet resource. | + **field_selector** | **str**| A selector to restrict the list of returned objects by their fields, supporting operators like '=', '==', and '!=' (e.g., \"key1=value1,key2!=value2\"). | [optional] + +### Return type + +[**FleetVulnerabilitySummaryResponse**](FleetVulnerabilitySummaryResponse.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. | - | +**429** | Too Many Requests. | - | +**501** | Not Implemented (vulnerability feature is not enabled on this server). | - | + +[[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_vulnerability_impact** +> VulnerabilityImpact get_vulnerability_impact(cve_id, var_continue=var_continue, field_selector=field_selector, sort_by=sort_by, order=order, limit=limit) + +Return per-fleet and fleetless blast radius for a CVE identifier. + +### Example + + +```python +import flightctl.v1alpha1 +from flightctl.v1alpha1.models.vulnerability_impact import VulnerabilityImpact +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.VulnerabilityApi(api_client) + cve_id = 'cve_id_example' # str | 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. + 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) + field_selector = 'field_selector_example' # str | 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. (optional) + sort_by = affectedDevices # str | Field to sort blast radius rows by. (optional) (default to affectedDevices) + order = desc # str | Sort order for the results. (optional) (default to desc) + 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_vulnerability_impact(cve_id, var_continue=var_continue, field_selector=field_selector, sort_by=sort_by, order=order, limit=limit) + print("The response of VulnerabilityApi->get_vulnerability_impact:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling VulnerabilityApi->get_vulnerability_impact: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **cve_id** | **str**| 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. | + **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] + **field_selector** | **str**| 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. | [optional] + **sort_by** | **str**| Field to sort blast radius rows by. | [optional] [default to affectedDevices] + **order** | **str**| Sort order for the results. | [optional] [default to desc] + **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 + +[**VulnerabilityImpact**](VulnerabilityImpact.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. | - | +**429** | Too Many Requests. | - | +**501** | Not Implemented (vulnerability feature is not enabled on this server). | - | + +[[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_vulnerability_summary** +> VulnerabilitySummaryResponse get_vulnerability_summary() + +Return organization-wide CVE counts by severity. + +### Example + + +```python +import flightctl.v1alpha1 +from flightctl.v1alpha1.models.vulnerability_summary_response import VulnerabilitySummaryResponse +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.VulnerabilityApi(api_client) + + try: + api_response = api_instance.get_vulnerability_summary() + print("The response of VulnerabilityApi->get_vulnerability_summary:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling VulnerabilityApi->get_vulnerability_summary: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**VulnerabilitySummaryResponse**](VulnerabilitySummaryResponse.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. | - | +**429** | Too Many Requests. | - | +**501** | Not Implemented (vulnerability feature is not enabled on this server). | - | + +[[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) + +# **list_vulnerabilities** +> VulnerabilityGroupList list_vulnerabilities(var_continue=var_continue, field_selector=field_selector, sort_by=sort_by, order=order, limit=limit) + +List distinct vulnerabilities across the organization with affected device counts. + +### Example + + +```python +import flightctl.v1alpha1 +from flightctl.v1alpha1.models.vulnerability_group_list import VulnerabilityGroupList +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.VulnerabilityApi(api_client) + 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) + field_selector = 'field_selector_example' # str | A selector to restrict the list of returned objects by their fields, supporting operators like '=', '==', and '!=' (e.g., \"key1=value1,key2!=value2\"). (optional) + sort_by = severity # str | Field to sort vulnerability list results by. (optional) (default to severity) + order = desc # str | Sort order for the results. (optional) (default to desc) + 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.list_vulnerabilities(var_continue=var_continue, field_selector=field_selector, sort_by=sort_by, order=order, limit=limit) + print("The response of VulnerabilityApi->list_vulnerabilities:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling VulnerabilityApi->list_vulnerabilities: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **var_continue** | **str**| An optional parameter to query more results from the server. The value of the parameter must match the value of the 'continue' field in the previous list response. | [optional] + **field_selector** | **str**| A selector to restrict the list of returned objects by their fields, supporting operators like '=', '==', and '!=' (e.g., \"key1=value1,key2!=value2\"). | [optional] + **sort_by** | **str**| Field to sort vulnerability list results by. | [optional] [default to severity] + **order** | **str**| Sort order for the results. | [optional] [default to desc] + **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 + +[**VulnerabilityGroupList**](VulnerabilityGroupList.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. | - | +**429** | Too Many Requests. | - | +**501** | Not Implemented (vulnerability feature is not enabled on this server). | - | +**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/flightctl/v1alpha1/docs/VulnerabilityGroup.md b/flightctl/v1alpha1/docs/VulnerabilityGroup.md new file mode 100644 index 0000000..88a15a5 --- /dev/null +++ b/flightctl/v1alpha1/docs/VulnerabilityGroup.md @@ -0,0 +1,37 @@ +# VulnerabilityGroup + +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. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | [**ApiVersion**](ApiVersion.md) | | +**kind** | **str** | Kind is a string value representing the REST resource. Always VulnerabilityGroup. | +**cve_id** | **str** | CVE identifier (e.g. CVE-2024-1234). | +**severity** | **str** | Worst severity across all findings in this group. | +**max_cvss_score** | **float** | Highest CVSS base score across all findings. | [optional] +**max_published_at** | **datetime** | Latest advisory publish time across all findings. | [optional] +**affected_devices** | **int** | Total distinct devices affected by this CVE within scope. | [optional] +**findings** | [**List[VulnerabilityGroupItem]**](VulnerabilityGroupItem.md) | Per-digest findings for this CVE within the query scope. | + +## Example + +```python +from flightctl.v1alpha1.models.vulnerability_group import VulnerabilityGroup + +# TODO update the JSON string below +json = "{}" +# create an instance of VulnerabilityGroup from a JSON string +vulnerability_group_instance = VulnerabilityGroup.from_json(json) +# print the JSON string representation of the object +print(VulnerabilityGroup.to_json()) + +# convert the object into a dict +vulnerability_group_dict = vulnerability_group_instance.to_dict() +# create an instance of VulnerabilityGroup from a dict +vulnerability_group_from_dict = VulnerabilityGroup.from_dict(vulnerability_group_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/VulnerabilityGroupItem.md b/flightctl/v1alpha1/docs/VulnerabilityGroupItem.md new file mode 100644 index 0000000..297214f --- /dev/null +++ b/flightctl/v1alpha1/docs/VulnerabilityGroupItem.md @@ -0,0 +1,40 @@ +# VulnerabilityGroupItem + +A single CVE finding for a specific image digest, including all image refs that resolve to that digest. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**image_digest** | **str** | Immutable image digest. | +**image_refs** | **List[str]** | Image references observed for this digest within the query scope. | +**severity** | **str** | Severity of this CVE for this digest. | +**cvss_score** | **float** | CVSS base score when available. | [optional] +**advisory_id** | **str** | Vendor advisory identifier when available. | [optional] +**issuer** | **str** | Name of the advisory issuer (e.g. Red Hat, NVD) when known. | [optional] +**link** | **str** | URL to the CVE details page. Points to Red Hat Security portal for Red Hat advisories, otherwise to NVD. | [optional] +**description** | **str** | Short summary of the vulnerability. | [optional] +**published_at** | **datetime** | Advisory publish time when known. | [optional] +**affected_devices** | **int** | Number of devices in scope running this digest. | [optional] +**first_seen_at** | **datetime** | When this CVE was first observed in this digest. | [optional] + +## Example + +```python +from flightctl.v1alpha1.models.vulnerability_group_item import VulnerabilityGroupItem + +# TODO update the JSON string below +json = "{}" +# create an instance of VulnerabilityGroupItem from a JSON string +vulnerability_group_item_instance = VulnerabilityGroupItem.from_json(json) +# print the JSON string representation of the object +print(VulnerabilityGroupItem.to_json()) + +# convert the object into a dict +vulnerability_group_item_dict = vulnerability_group_item_instance.to_dict() +# create an instance of VulnerabilityGroupItem from a dict +vulnerability_group_item_from_dict = VulnerabilityGroupItem.from_dict(vulnerability_group_item_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/VulnerabilityGroupList.md b/flightctl/v1alpha1/docs/VulnerabilityGroupList.md new file mode 100644 index 0000000..60191da --- /dev/null +++ b/flightctl/v1alpha1/docs/VulnerabilityGroupList.md @@ -0,0 +1,33 @@ +# VulnerabilityGroupList + +Paginated list of VulnerabilityGroup resources (fleet-scoped or organization-wide). + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | [**ApiVersion**](ApiVersion.md) | | +**kind** | **str** | Kind is a string value representing the REST resource. Always VulnerabilityGroupList. | +**metadata** | [**ListMeta**](ListMeta.md) | | +**items** | [**List[VulnerabilityGroup]**](VulnerabilityGroup.md) | Paginated VulnerabilityGroup resources for this page. | + +## Example + +```python +from flightctl.v1alpha1.models.vulnerability_group_list import VulnerabilityGroupList + +# TODO update the JSON string below +json = "{}" +# create an instance of VulnerabilityGroupList from a JSON string +vulnerability_group_list_instance = VulnerabilityGroupList.from_json(json) +# print the JSON string representation of the object +print(VulnerabilityGroupList.to_json()) + +# convert the object into a dict +vulnerability_group_list_dict = vulnerability_group_list_instance.to_dict() +# create an instance of VulnerabilityGroupList from a dict +vulnerability_group_list_from_dict = VulnerabilityGroupList.from_dict(vulnerability_group_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/docs/VulnerabilityImageRef.md b/flightctl/v1alpha1/docs/VulnerabilityImageRef.md new file mode 100644 index 0000000..52a7e2f --- /dev/null +++ b/flightctl/v1alpha1/docs/VulnerabilityImageRef.md @@ -0,0 +1,32 @@ +# VulnerabilityImageRef + +Reference to an OS or workload image by name and digest. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**image** | **str** | Image reference (name or URL). | +**image_digest** | **str** | Immutable image digest. | +**affected_devices** | **int** | Devices running this exact image digest within the parent scope (fleet or blast radius row). | [optional] + +## Example + +```python +from flightctl.v1alpha1.models.vulnerability_image_ref import VulnerabilityImageRef + +# TODO update the JSON string below +json = "{}" +# create an instance of VulnerabilityImageRef from a JSON string +vulnerability_image_ref_instance = VulnerabilityImageRef.from_json(json) +# print the JSON string representation of the object +print(VulnerabilityImageRef.to_json()) + +# convert the object into a dict +vulnerability_image_ref_dict = vulnerability_image_ref_instance.to_dict() +# create an instance of VulnerabilityImageRef from a dict +vulnerability_image_ref_from_dict = VulnerabilityImageRef.from_dict(vulnerability_image_ref_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/VulnerabilityImpact.md b/flightctl/v1alpha1/docs/VulnerabilityImpact.md new file mode 100644 index 0000000..b019bb1 --- /dev/null +++ b/flightctl/v1alpha1/docs/VulnerabilityImpact.md @@ -0,0 +1,39 @@ +# VulnerabilityImpact + +Blast radius for a single CVE across fleets and fleetless devices. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | [**ApiVersion**](ApiVersion.md) | | +**kind** | **str** | Resource kind; always VulnerabilityImpact. | +**metadata** | [**ListMeta**](ListMeta.md) | | +**cve_id** | **str** | CVE identifier for this blast radius response. | +**issuer** | **str** | Name of the advisory issuer (e.g. Red Hat, NVD) when known. | [optional] +**link** | **str** | URL to the CVE details page. Points to Red Hat Security portal for Red Hat advisories, otherwise to NVD. | [optional] +**severity** | **str** | Worst severity for this CVE in the fleet or fleetless group. | +**max_cvss_score** | **float** | Highest CVSS base score for this CVE in the fleet or fleetless group. | [optional] +**max_published_at** | **datetime** | When this CVE was first observed in the fleet or fleetless group. | [optional] +**items** | [**List[AffectedFleet]**](AffectedFleet.md) | Per-fleet or fleetless rows with device and image counts. | + +## Example + +```python +from flightctl.v1alpha1.models.vulnerability_impact import VulnerabilityImpact + +# TODO update the JSON string below +json = "{}" +# create an instance of VulnerabilityImpact from a JSON string +vulnerability_impact_instance = VulnerabilityImpact.from_json(json) +# print the JSON string representation of the object +print(VulnerabilityImpact.to_json()) + +# convert the object into a dict +vulnerability_impact_dict = vulnerability_impact_instance.to_dict() +# create an instance of VulnerabilityImpact from a dict +vulnerability_impact_from_dict = VulnerabilityImpact.from_dict(vulnerability_impact_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/VulnerabilityList.md b/flightctl/v1alpha1/docs/VulnerabilityList.md new file mode 100644 index 0000000..972f094 --- /dev/null +++ b/flightctl/v1alpha1/docs/VulnerabilityList.md @@ -0,0 +1,33 @@ +# VulnerabilityList + +Paginated list of Vulnerability resources. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | [**ApiVersion**](ApiVersion.md) | | +**kind** | **str** | Kind is a string value representing the REST resource this object represents. Always VulnerabilityList. | +**metadata** | [**ListMeta**](ListMeta.md) | | +**items** | [**List[Vulnerability]**](Vulnerability.md) | Paginated Vulnerability resources for this page. | + +## Example + +```python +from flightctl.v1alpha1.models.vulnerability_list import VulnerabilityList + +# TODO update the JSON string below +json = "{}" +# create an instance of VulnerabilityList from a JSON string +vulnerability_list_instance = VulnerabilityList.from_json(json) +# print the JSON string representation of the object +print(VulnerabilityList.to_json()) + +# convert the object into a dict +vulnerability_list_dict = vulnerability_list_instance.to_dict() +# create an instance of VulnerabilityList from a dict +vulnerability_list_from_dict = VulnerabilityList.from_dict(vulnerability_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/docs/VulnerabilitySeveritySummary.md b/flightctl/v1alpha1/docs/VulnerabilitySeveritySummary.md new file mode 100644 index 0000000..32ea366 --- /dev/null +++ b/flightctl/v1alpha1/docs/VulnerabilitySeveritySummary.md @@ -0,0 +1,36 @@ +# VulnerabilitySeveritySummary + +Total vulnerability counts by severity for the full result set (not only the current page). + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total** | **int** | Total vulnerabilities across all severities for the full result set. | +**critical** | **int** | Count of Critical severity findings in the full result set. | +**high** | **int** | Count of High severity findings in the full result set. | +**medium** | **int** | Count of Medium severity findings in the full result set. | +**low** | **int** | Count of Low severity findings in the full result set. | +**var_none** | **int** | Count of findings with no exploitable impact (CVSS score 0). | +**unknown** | **int** | Count of findings with unknown or unscored severity. | + +## Example + +```python +from flightctl.v1alpha1.models.vulnerability_severity_summary import VulnerabilitySeveritySummary + +# TODO update the JSON string below +json = "{}" +# create an instance of VulnerabilitySeveritySummary from a JSON string +vulnerability_severity_summary_instance = VulnerabilitySeveritySummary.from_json(json) +# print the JSON string representation of the object +print(VulnerabilitySeveritySummary.to_json()) + +# convert the object into a dict +vulnerability_severity_summary_dict = vulnerability_severity_summary_instance.to_dict() +# create an instance of VulnerabilitySeveritySummary from a dict +vulnerability_severity_summary_from_dict = VulnerabilitySeveritySummary.from_dict(vulnerability_severity_summary_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/VulnerabilitySummaryResponse.md b/flightctl/v1alpha1/docs/VulnerabilitySummaryResponse.md new file mode 100644 index 0000000..6eb03a3 --- /dev/null +++ b/flightctl/v1alpha1/docs/VulnerabilitySummaryResponse.md @@ -0,0 +1,32 @@ +# VulnerabilitySummaryResponse + +Estate-wide vulnerability summary counts. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_version** | [**ApiVersion**](ApiVersion.md) | | +**kind** | **str** | Resource kind; always VulnerabilitySummary. | +**cves_by_severity** | [**CveCountsBySeverity**](CveCountsBySeverity.md) | | + +## Example + +```python +from flightctl.v1alpha1.models.vulnerability_summary_response import VulnerabilitySummaryResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of VulnerabilitySummaryResponse from a JSON string +vulnerability_summary_response_instance = VulnerabilitySummaryResponse.from_json(json) +# print the JSON string representation of the object +print(VulnerabilitySummaryResponse.to_json()) + +# convert the object into a dict +vulnerability_summary_response_dict = vulnerability_summary_response_instance.to_dict() +# create an instance of VulnerabilitySummaryResponse from a dict +vulnerability_summary_response_from_dict = VulnerabilitySummaryResponse.from_dict(vulnerability_summary_response_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 fcb2ed1..893bf8b 100644 --- a/flightctl/v1alpha1/models/__init__.py +++ b/flightctl/v1alpha1/models/__init__.py @@ -14,6 +14,7 @@ """ # noqa: E501 # import models into model package +from flightctl.v1alpha1.models.affected_fleet import AffectedFleet from flightctl.v1alpha1.models.api_version import ApiVersion from flightctl.v1alpha1.models.catalog import Catalog from flightctl.v1alpha1.models.catalog_item import CatalogItem @@ -34,10 +35,22 @@ from flightctl.v1alpha1.models.condition_base import ConditionBase from flightctl.v1alpha1.models.condition_status import ConditionStatus from flightctl.v1alpha1.models.condition_type import ConditionType +from flightctl.v1alpha1.models.cve_counts_by_severity import CveCountsBySeverity +from flightctl.v1alpha1.models.device_counts_by_severity import DeviceCountsBySeverity +from flightctl.v1alpha1.models.device_vulnerability_summary_response import DeviceVulnerabilitySummaryResponse +from flightctl.v1alpha1.models.fleet_vulnerability_summary import FleetVulnerabilitySummary +from flightctl.v1alpha1.models.fleet_vulnerability_summary_response import FleetVulnerabilitySummaryResponse from flightctl.v1alpha1.models.list_meta import ListMeta from flightctl.v1alpha1.models.object_meta import ObjectMeta from flightctl.v1alpha1.models.patch_request_inner import PatchRequestInner -from flightctl.v1alpha1.models.schemas_api_version import SchemasApiVersion -from flightctl.v1alpha1.models.schemas_status import SchemasStatus from flightctl.v1alpha1.models.status import Status +from flightctl.v1alpha1.models.vulnerability import Vulnerability +from flightctl.v1alpha1.models.vulnerability_group import VulnerabilityGroup +from flightctl.v1alpha1.models.vulnerability_group_item import VulnerabilityGroupItem +from flightctl.v1alpha1.models.vulnerability_group_list import VulnerabilityGroupList +from flightctl.v1alpha1.models.vulnerability_image_ref import VulnerabilityImageRef +from flightctl.v1alpha1.models.vulnerability_impact import VulnerabilityImpact +from flightctl.v1alpha1.models.vulnerability_list import VulnerabilityList +from flightctl.v1alpha1.models.vulnerability_severity_summary import VulnerabilitySeveritySummary +from flightctl.v1alpha1.models.vulnerability_summary_response import VulnerabilitySummaryResponse diff --git a/flightctl/v1alpha1/models/affected_fleet.py b/flightctl/v1alpha1/models/affected_fleet.py new file mode 100644 index 0000000..d2e36e0 --- /dev/null +++ b/flightctl/v1alpha1/models/affected_fleet.py @@ -0,0 +1,102 @@ +# 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, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from flightctl.v1alpha1.models.vulnerability_group_item import VulnerabilityGroupItem +from typing import Optional, Set +from typing_extensions import Self + +class AffectedFleet(BaseModel): + """ + One fleet or the fleetless aggregate with device and image counts for a CVE. + """ # noqa: E501 + fleet_name: StrictStr = Field(description="Fleet metadata.name, empty for the fleetless aggregate.", alias="fleetName") + fleetless: StrictBool = Field(description="True when this row represents devices not owned by a fleet.") + affected_devices: StrictInt = Field(description="Devices in this fleet or fleetless group affected by the CVE.", alias="affectedDevices") + findings: List[VulnerabilityGroupItem] = Field(description="Per-digest findings within this fleet or fleetless group.") + __properties: ClassVar[List[str]] = ["fleetName", "fleetless", "affectedDevices", "findings"] + + 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 AffectedFleet 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 each item in findings (list) + _items = [] + if self.findings: + for _item_findings in self.findings: + if _item_findings: + _items.append(_item_findings.to_dict()) + _dict['findings'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AffectedFleet from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "fleetName": obj.get("fleetName"), + "fleetless": obj.get("fleetless"), + "affectedDevices": obj.get("affectedDevices"), + "findings": [VulnerabilityGroupItem.from_dict(_item) for _item in obj["findings"]] if obj.get("findings") is not None else None + }) + return _obj + + diff --git a/flightctl/v1alpha1/models/api_version.py b/flightctl/v1alpha1/models/api_version.py index de2e48f..716db67 100644 --- a/flightctl/v1alpha1/models/api_version.py +++ b/flightctl/v1alpha1/models/api_version.py @@ -27,8 +27,8 @@ class ApiVersion(str, Enum): """ allowed enum values """ - V1ALPHA1 = 'v1alpha1' - FLIGHTCTL_DOT_IO_SLASH_V1ALPHA1 = 'flightctl.io/v1alpha1' + ApiVersionV1alpha1 = 'v1alpha1' + ApiVersionFlightctlIoV1alpha1 = 'flightctl.io/v1alpha1' @classmethod def from_json(cls, json_str: str) -> Self: diff --git a/flightctl/v1alpha1/models/catalog_item_artifact_type.py b/flightctl/v1alpha1/models/catalog_item_artifact_type.py index 17dbc48..b0aefcc 100644 --- a/flightctl/v1alpha1/models/catalog_item_artifact_type.py +++ b/flightctl/v1alpha1/models/catalog_item_artifact_type.py @@ -36,6 +36,7 @@ class CatalogItemArtifactType(str, Enum): CatalogItemArtifactTypeVhd = 'vhd' CatalogItemArtifactTypeRaw = 'raw' CatalogItemArtifactTypeGce = 'gce' + CatalogItemArtifactTypeQcow2DiskContainer = 'qcow2-disk-container' @classmethod def from_json(cls, json_str: str) -> Self: diff --git a/flightctl/v1alpha1/models/catalog_item_meta.py b/flightctl/v1alpha1/models/catalog_item_meta.py index bc1b449..bc8011b 100644 --- a/flightctl/v1alpha1/models/catalog_item_meta.py +++ b/flightctl/v1alpha1/models/catalog_item_meta.py @@ -21,6 +21,7 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from typing import Optional, Set from typing_extensions import Self @@ -30,8 +31,8 @@ class CatalogItemMeta(BaseModel): """ # noqa: E501 creation_timestamp: Optional[datetime] = Field(default=None, description="The time the object was created.", alias="creationTimestamp") deletion_timestamp: Optional[datetime] = Field(default=None, description="The time the object will be deleted.", alias="deletionTimestamp") - name: Optional[StrictStr] = Field(default=None, description="The name of the object.") - labels: Optional[Dict[str, StrictStr]] = Field(default=None, description="Map of string keys and values that can be used to organize and categorize (scope and select) objects.") + name: Optional[Annotated[str, Field(strict=True, max_length=253)]] = Field(default=None, description="The name of the object.") + labels: Optional[Dict[str, Annotated[str, Field(strict=True, max_length=63)]]] = Field(default=None, description="Map of string keys and values that can be used to organize and categorize (scope and select) objects.") generation: Optional[StrictInt] = Field(default=None, description="A sequence number representing a specific generation of the desired state. Populated by the system. Read-only.") owner: Optional[StrictStr] = Field(default=None, description="A resource that owns this resource, in \"kind/name\" format.") annotations: Optional[Dict[str, StrictStr]] = Field(default=None, description="Properties set by the service.") diff --git a/flightctl/v1alpha1/models/catalog_item_version.py b/flightctl/v1alpha1/models/catalog_item_version.py index 4af8fc3..c24fec6 100644 --- a/flightctl/v1alpha1/models/catalog_item_version.py +++ b/flightctl/v1alpha1/models/catalog_item_version.py @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated from flightctl.v1alpha1.models.catalog_item_deprecation import CatalogItemDeprecation @@ -32,15 +32,42 @@ class CatalogItemVersion(BaseModel): config: Optional[Dict[str, Any]] = Field(default=None, description="Configuration values (envVars, ports, volumes, resources, etc.).") config_schema: Optional[Dict[str, Any]] = Field(default=None, description="JSON Schema defining configurable parameters and their validation.", alias="configSchema") readme: Optional[StrictStr] = Field(default=None, description="Detailed documentation, preferably in markdown format.") - version: StrictStr = Field(description="Semantic version identifier (e.g., 1.2.3, v2.0.0-rc1). Required for version ordering and upgrade graph.") + version: Annotated[str, Field(strict=True)] = Field(description="Semantic version identifier (e.g., 1.2.3, 2.0.0-rc1). Required for version ordering and upgrade graph.") references: Dict[str, Annotated[str, Field(min_length=1, strict=True)]] = Field(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.") - channels: List[StrictStr] = Field(description="Channels this version belongs to.") - replaces: Optional[StrictStr] = Field(default=None, description="The single version this one replaces, defining the primary upgrade edge.") - skips: Optional[List[StrictStr]] = Field(default=None, description="Additional versions that can upgrade directly to this one. Use when stable channel skips intermediate fast-only versions.") - skip_range: Optional[StrictStr] = Field(default=None, description="Semver range of versions that can upgrade directly to this one. Use for z-stream updates or hotfixes.", alias="skipRange") + channels: Annotated[List[StrictStr], Field(min_length=1)] = Field(description="Channels this version belongs to.") + replaces: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="The single version this one replaces, defining the primary upgrade edge.") + skips: Optional[List[Annotated[str, Field(strict=True)]]] = Field(default=None, description="Additional versions that can upgrade directly to this one. Use when stable channel skips intermediate fast-only versions.") + skip_range: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="Semver range of versions that can upgrade directly to this one. Use for z-stream updates or hotfixes.", alias="skipRange") deprecation: Optional[CatalogItemDeprecation] = None __properties: ClassVar[List[str]] = ["config", "configSchema", "readme", "version", "references", "channels", "replaces", "skips", "skipRange", "deprecation"] + @field_validator('version') + def version_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^(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-]+)*))?$", value): + raise ValueError(r"must validate the regular expression /^(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-]+)*))?$/") + return value + + @field_validator('replaces') + def replaces_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^(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-]+)*))?$", value): + raise ValueError(r"must validate the regular expression /^(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-]+)*))?$/") + return value + + @field_validator('skip_range') + def skip_range_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^[>=<~^]*[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.-]+)?)*$", value): + raise ValueError(r"must validate the regular expression /^[>=<~^]*[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.-]+)?)*$/") + return value + model_config = ConfigDict( populate_by_name=True, validate_assignment=True, diff --git a/flightctl/v1alpha1/models/cve_counts_by_severity.py b/flightctl/v1alpha1/models/cve_counts_by_severity.py new file mode 100644 index 0000000..a7db6af --- /dev/null +++ b/flightctl/v1alpha1/models/cve_counts_by_severity.py @@ -0,0 +1,100 @@ +# 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, StrictInt +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class CveCountsBySeverity(BaseModel): + """ + Counts of distinct CVEs in the organization by highest severity. + """ # noqa: E501 + total: StrictInt = Field(description="Total distinct CVEs across the organization.") + critical: StrictInt = Field(description="Count of distinct Critical CVEs.") + high: StrictInt = Field(description="Count of distinct High CVEs.") + medium: StrictInt = Field(description="Count of distinct Medium CVEs.") + low: StrictInt = Field(description="Count of distinct Low CVEs.") + var_none: StrictInt = Field(description="Count of distinct CVEs with no exploitable impact (CVSS score 0).", alias="none") + unknown: StrictInt = Field(description="Count of distinct CVEs with unknown or unscored severity.") + __properties: ClassVar[List[str]] = ["total", "critical", "high", "medium", "low", "none", "unknown"] + + 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 CveCountsBySeverity 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 CveCountsBySeverity from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "total": obj.get("total"), + "critical": obj.get("critical"), + "high": obj.get("high"), + "medium": obj.get("medium"), + "low": obj.get("low"), + "none": obj.get("none"), + "unknown": obj.get("unknown") + }) + return _obj + + diff --git a/flightctl/v1alpha1/models/device_counts_by_severity.py b/flightctl/v1alpha1/models/device_counts_by_severity.py new file mode 100644 index 0000000..6fc98dc --- /dev/null +++ b/flightctl/v1alpha1/models/device_counts_by_severity.py @@ -0,0 +1,100 @@ +# 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, StrictInt +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class DeviceCountsBySeverity(BaseModel): + """ + Counts of distinct devices affected in the organization, grouped by vulnerability severity. + """ # noqa: E501 + total: StrictInt = Field(description="Number of distinct devices with at least one vulnerability finding in the organization.") + critical: StrictInt = Field(description="Number of devices whose highest severity finding is critical.") + high: StrictInt = Field(description="Number of devices whose highest severity finding is high.") + medium: StrictInt = Field(description="Number of devices whose highest severity finding is medium.") + low: StrictInt = Field(description="Number of devices whose highest severity finding is low.") + var_none: StrictInt = Field(description="Number of devices whose highest severity finding is none.", alias="none") + unknown: StrictInt = Field(description="Number of devices whose highest severity finding is unknown.") + __properties: ClassVar[List[str]] = ["total", "critical", "high", "medium", "low", "none", "unknown"] + + 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 DeviceCountsBySeverity 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 DeviceCountsBySeverity from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "total": obj.get("total"), + "critical": obj.get("critical"), + "high": obj.get("high"), + "medium": obj.get("medium"), + "low": obj.get("low"), + "none": obj.get("none"), + "unknown": obj.get("unknown") + }) + return _obj + + diff --git a/flightctl/v1alpha1/models/device_vulnerability_summary_response.py b/flightctl/v1alpha1/models/device_vulnerability_summary_response.py new file mode 100644 index 0000000..ef2e471 --- /dev/null +++ b/flightctl/v1alpha1/models/device_vulnerability_summary_response.py @@ -0,0 +1,101 @@ +# 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.vulnerability_severity_summary import VulnerabilitySeveritySummary +from typing import Optional, Set +from typing_extensions import Self + +class DeviceVulnerabilitySummaryResponse(BaseModel): + """ + Severity summary for a single device. + """ # noqa: E501 + api_version: ApiVersion = Field(alias="apiVersion") + kind: StrictStr = Field(description="Resource kind; always DeviceVulnerabilitySummary.") + image: Optional[StrictStr] = Field(default=None, description="Image reference from device status. Absent when the device has no rendered OS image.") + image_digest: Optional[StrictStr] = Field(default=None, description="Image digest from device status. Absent when the device has no rendered OS image.", alias="imageDigest") + summary: VulnerabilitySeveritySummary + __properties: ClassVar[List[str]] = ["apiVersion", "kind", "image", "imageDigest", "summary"] + + 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 DeviceVulnerabilitySummaryResponse 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 summary + if self.summary: + _dict['summary'] = self.summary.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DeviceVulnerabilitySummaryResponse 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"), + "image": obj.get("image"), + "imageDigest": obj.get("imageDigest"), + "summary": VulnerabilitySeveritySummary.from_dict(obj["summary"]) if obj.get("summary") is not None else None + }) + return _obj + + diff --git a/flightctl/v1alpha1/models/fleet_vulnerability_summary.py b/flightctl/v1alpha1/models/fleet_vulnerability_summary.py new file mode 100644 index 0000000..f15e228 --- /dev/null +++ b/flightctl/v1alpha1/models/fleet_vulnerability_summary.py @@ -0,0 +1,102 @@ +# 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, StrictInt +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class FleetVulnerabilitySummary(BaseModel): + """ + Fleet vulnerability totals including unique digest count. + """ # noqa: E501 + total: StrictInt = Field(description="Total vulnerabilities across all severities for the full result set.") + critical: StrictInt = Field(description="Count of Critical severity findings in the full result set.") + high: StrictInt = Field(description="Count of High severity findings in the full result set.") + medium: StrictInt = Field(description="Count of Medium severity findings in the full result set.") + low: StrictInt = Field(description="Count of Low severity findings in the full result set.") + var_none: StrictInt = Field(description="Count of findings with no exploitable impact (CVSS score 0).", alias="none") + unknown: StrictInt = Field(description="Count of findings with unknown or unscored severity.") + unique_digests: StrictInt = Field(description="Distinct image digests observed in the fleet.", alias="uniqueDigests") + __properties: ClassVar[List[str]] = ["total", "critical", "high", "medium", "low", "none", "unknown", "uniqueDigests"] + + 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 FleetVulnerabilitySummary 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 FleetVulnerabilitySummary from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "total": obj.get("total"), + "critical": obj.get("critical"), + "high": obj.get("high"), + "medium": obj.get("medium"), + "low": obj.get("low"), + "none": obj.get("none"), + "unknown": obj.get("unknown"), + "uniqueDigests": obj.get("uniqueDigests") + }) + return _obj + + diff --git a/flightctl/v1alpha1/models/fleet_vulnerability_summary_response.py b/flightctl/v1alpha1/models/fleet_vulnerability_summary_response.py new file mode 100644 index 0000000..c66b974 --- /dev/null +++ b/flightctl/v1alpha1/models/fleet_vulnerability_summary_response.py @@ -0,0 +1,97 @@ +# 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.fleet_vulnerability_summary import FleetVulnerabilitySummary +from typing import Optional, Set +from typing_extensions import Self + +class FleetVulnerabilitySummaryResponse(BaseModel): + """ + Severity summary for a single fleet. + """ # noqa: E501 + api_version: ApiVersion = Field(alias="apiVersion") + kind: StrictStr = Field(description="Resource kind; always FleetVulnerabilitySummary.") + summary: FleetVulnerabilitySummary + __properties: ClassVar[List[str]] = ["apiVersion", "kind", "summary"] + + 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 FleetVulnerabilitySummaryResponse 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 summary + if self.summary: + _dict['summary'] = self.summary.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FleetVulnerabilitySummaryResponse 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"), + "summary": FleetVulnerabilitySummary.from_dict(obj["summary"]) if obj.get("summary") is not None else None + }) + return _obj + + diff --git a/flightctl/v1alpha1/models/object_meta.py b/flightctl/v1alpha1/models/object_meta.py index a8ba3c8..86d3246 100644 --- a/flightctl/v1alpha1/models/object_meta.py +++ b/flightctl/v1alpha1/models/object_meta.py @@ -21,6 +21,7 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from typing import Optional, Set from typing_extensions import Self @@ -30,8 +31,8 @@ class ObjectMeta(BaseModel): """ # noqa: E501 creation_timestamp: Optional[datetime] = Field(default=None, description="The time the object was created.", alias="creationTimestamp") deletion_timestamp: Optional[datetime] = Field(default=None, description="The time the object will be deleted.", alias="deletionTimestamp") - name: Optional[StrictStr] = Field(default=None, description="The name of the object.") - labels: Optional[Dict[str, StrictStr]] = Field(default=None, description="Map of string keys and values that can be used to organize and categorize (scope and select) objects.") + name: Optional[Annotated[str, Field(strict=True, max_length=253)]] = Field(default=None, description="The name of the object.") + labels: Optional[Dict[str, Annotated[str, Field(strict=True, max_length=63)]]] = Field(default=None, description="Map of string keys and values that can be used to organize and categorize (scope and select) objects.") generation: Optional[StrictInt] = Field(default=None, description="A sequence number representing a specific generation of the desired state. Populated by the system. Read-only.") owner: Optional[StrictStr] = Field(default=None, description="A resource that owns this resource, in \"kind/name\" format.") annotations: Optional[Dict[str, StrictStr]] = Field(default=None, description="Properties set by the service.") diff --git a/flightctl/v1alpha1/models/vulnerability.py b/flightctl/v1alpha1/models/vulnerability.py new file mode 100644 index 0000000..ae5a860 --- /dev/null +++ b/flightctl/v1alpha1/models/vulnerability.py @@ -0,0 +1,121 @@ +# 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from flightctl.v1alpha1.models.api_version import ApiVersion +from typing import Optional, Set +from typing_extensions import Self + +class Vulnerability(BaseModel): + """ + 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. + """ # noqa: E501 + api_version: ApiVersion = Field(alias="apiVersion") + kind: StrictStr = Field(description="Kind is a string value representing the REST resource this object represents. Always Vulnerability.") + cve_id: StrictStr = Field(description="CVE identifier (e.g. CVE-2024-1234).", alias="cveId") + advisory_id: Optional[StrictStr] = Field(default=None, description="Vendor advisory identifier when available.", alias="advisoryId") + issuer: Optional[StrictStr] = Field(default=None, description="Name of the advisory issuer (e.g. Red Hat, NVD) when known.") + link: Optional[StrictStr] = Field(default=None, description="URL to the CVE details page. Points to Red Hat Security portal for Red Hat advisories, otherwise to NVD.") + severity: StrictStr = Field(description="Normalized severity label.") + cvss_score: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="CVSS base score when available.", alias="cvssScore") + description: Optional[StrictStr] = Field(default=None, description="Short summary of the vulnerability.") + published_at: Optional[datetime] = Field(default=None, description="Advisory publish time when known.", alias="publishedAt") + image: Optional[StrictStr] = Field(default=None, description="Image reference (name or URL) from the device context.") + image_digest: Optional[StrictStr] = Field(default=None, description="Immutable image digest from the device context.", alias="imageDigest") + affected_devices: Optional[StrictInt] = Field(default=None, 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.", alias="affectedDevices") + __properties: ClassVar[List[str]] = ["apiVersion", "kind", "cveId", "advisoryId", "issuer", "link", "severity", "cvssScore", "description", "publishedAt", "image", "imageDigest", "affectedDevices"] + + @field_validator('severity') + def severity_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['Critical', 'High', 'Medium', 'Low', 'None', 'Unknown']): + raise ValueError("must be one of enum values ('Critical', 'High', 'Medium', 'Low', 'None', 'Unknown')") + 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 Vulnerability 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 Vulnerability 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"), + "cveId": obj.get("cveId"), + "advisoryId": obj.get("advisoryId"), + "issuer": obj.get("issuer"), + "link": obj.get("link"), + "severity": obj.get("severity"), + "cvssScore": obj.get("cvssScore"), + "description": obj.get("description"), + "publishedAt": obj.get("publishedAt"), + "image": obj.get("image"), + "imageDigest": obj.get("imageDigest"), + "affectedDevices": obj.get("affectedDevices") + }) + return _obj + + diff --git a/flightctl/v1alpha1/models/vulnerability_group.py b/flightctl/v1alpha1/models/vulnerability_group.py new file mode 100644 index 0000000..3c4ba8a --- /dev/null +++ b/flightctl/v1alpha1/models/vulnerability_group.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. 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from flightctl.v1alpha1.models.api_version import ApiVersion +from flightctl.v1alpha1.models.vulnerability_group_item import VulnerabilityGroupItem +from typing import Optional, Set +from typing_extensions import Self + +class VulnerabilityGroup(BaseModel): + """ + 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. + """ # noqa: E501 + api_version: ApiVersion = Field(alias="apiVersion") + kind: StrictStr = Field(description="Kind is a string value representing the REST resource. Always VulnerabilityGroup.") + cve_id: StrictStr = Field(description="CVE identifier (e.g. CVE-2024-1234).", alias="cveId") + severity: StrictStr = Field(description="Worst severity across all findings in this group.") + max_cvss_score: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Highest CVSS base score across all findings.", alias="maxCvssScore") + max_published_at: Optional[datetime] = Field(default=None, description="Latest advisory publish time across all findings.", alias="maxPublishedAt") + affected_devices: Optional[StrictInt] = Field(default=None, description="Total distinct devices affected by this CVE within scope.", alias="affectedDevices") + findings: List[VulnerabilityGroupItem] = Field(description="Per-digest findings for this CVE within the query scope.") + __properties: ClassVar[List[str]] = ["apiVersion", "kind", "cveId", "severity", "maxCvssScore", "maxPublishedAt", "affectedDevices", "findings"] + + @field_validator('severity') + def severity_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['Critical', 'High', 'Medium', 'Low', 'None', 'Unknown']): + raise ValueError("must be one of enum values ('Critical', 'High', 'Medium', 'Low', 'None', 'Unknown')") + 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 VulnerabilityGroup 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 each item in findings (list) + _items = [] + if self.findings: + for _item_findings in self.findings: + if _item_findings: + _items.append(_item_findings.to_dict()) + _dict['findings'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of VulnerabilityGroup 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"), + "cveId": obj.get("cveId"), + "severity": obj.get("severity"), + "maxCvssScore": obj.get("maxCvssScore"), + "maxPublishedAt": obj.get("maxPublishedAt"), + "affectedDevices": obj.get("affectedDevices"), + "findings": [VulnerabilityGroupItem.from_dict(_item) for _item in obj["findings"]] if obj.get("findings") is not None else None + }) + return _obj + + diff --git a/flightctl/v1alpha1/models/vulnerability_group_item.py b/flightctl/v1alpha1/models/vulnerability_group_item.py new file mode 100644 index 0000000..17b630a --- /dev/null +++ b/flightctl/v1alpha1/models/vulnerability_group_item.py @@ -0,0 +1,116 @@ +# 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self + +class VulnerabilityGroupItem(BaseModel): + """ + A single CVE finding for a specific image digest, including all image refs that resolve to that digest. + """ # noqa: E501 + image_digest: StrictStr = Field(description="Immutable image digest.", alias="imageDigest") + image_refs: List[StrictStr] = Field(description="Image references observed for this digest within the query scope.", alias="imageRefs") + severity: StrictStr = Field(description="Severity of this CVE for this digest.") + cvss_score: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="CVSS base score when available.", alias="cvssScore") + advisory_id: Optional[StrictStr] = Field(default=None, description="Vendor advisory identifier when available.", alias="advisoryId") + issuer: Optional[StrictStr] = Field(default=None, description="Name of the advisory issuer (e.g. Red Hat, NVD) when known.") + link: Optional[StrictStr] = Field(default=None, description="URL to the CVE details page. Points to Red Hat Security portal for Red Hat advisories, otherwise to NVD.") + description: Optional[StrictStr] = Field(default=None, description="Short summary of the vulnerability.") + published_at: Optional[datetime] = Field(default=None, description="Advisory publish time when known.", alias="publishedAt") + affected_devices: Optional[StrictInt] = Field(default=None, description="Number of devices in scope running this digest.", alias="affectedDevices") + first_seen_at: Optional[datetime] = Field(default=None, description="When this CVE was first observed in this digest.", alias="firstSeenAt") + __properties: ClassVar[List[str]] = ["imageDigest", "imageRefs", "severity", "cvssScore", "advisoryId", "issuer", "link", "description", "publishedAt", "affectedDevices", "firstSeenAt"] + + @field_validator('severity') + def severity_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['Critical', 'High', 'Medium', 'Low', 'None', 'Unknown']): + raise ValueError("must be one of enum values ('Critical', 'High', 'Medium', 'Low', 'None', 'Unknown')") + 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 VulnerabilityGroupItem 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 VulnerabilityGroupItem from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "imageDigest": obj.get("imageDigest"), + "imageRefs": obj.get("imageRefs"), + "severity": obj.get("severity"), + "cvssScore": obj.get("cvssScore"), + "advisoryId": obj.get("advisoryId"), + "issuer": obj.get("issuer"), + "link": obj.get("link"), + "description": obj.get("description"), + "publishedAt": obj.get("publishedAt"), + "affectedDevices": obj.get("affectedDevices"), + "firstSeenAt": obj.get("firstSeenAt") + }) + return _obj + + diff --git a/flightctl/v1alpha1/models/vulnerability_group_list.py b/flightctl/v1alpha1/models/vulnerability_group_list.py new file mode 100644 index 0000000..efd0b58 --- /dev/null +++ b/flightctl/v1alpha1/models/vulnerability_group_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.list_meta import ListMeta +from flightctl.v1alpha1.models.vulnerability_group import VulnerabilityGroup +from typing import Optional, Set +from typing_extensions import Self + +class VulnerabilityGroupList(BaseModel): + """ + Paginated list of VulnerabilityGroup resources (fleet-scoped or organization-wide). + """ # noqa: E501 + api_version: ApiVersion = Field(alias="apiVersion") + kind: StrictStr = Field(description="Kind is a string value representing the REST resource. Always VulnerabilityGroupList.") + metadata: ListMeta + items: List[VulnerabilityGroup] = Field(description="Paginated VulnerabilityGroup resources for this page.") + __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 VulnerabilityGroupList 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 VulnerabilityGroupList 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": [VulnerabilityGroup.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/vulnerability_image_ref.py b/flightctl/v1alpha1/models/vulnerability_image_ref.py new file mode 100644 index 0000000..bdd780e --- /dev/null +++ b/flightctl/v1alpha1/models/vulnerability_image_ref.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. 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, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class VulnerabilityImageRef(BaseModel): + """ + Reference to an OS or workload image by name and digest. + """ # noqa: E501 + image: StrictStr = Field(description="Image reference (name or URL).") + image_digest: StrictStr = Field(description="Immutable image digest.", alias="imageDigest") + affected_devices: Optional[StrictInt] = Field(default=None, description="Devices running this exact image digest within the parent scope (fleet or blast radius row).", alias="affectedDevices") + __properties: ClassVar[List[str]] = ["image", "imageDigest", "affectedDevices"] + + 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 VulnerabilityImageRef 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 VulnerabilityImageRef 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"), + "imageDigest": obj.get("imageDigest"), + "affectedDevices": obj.get("affectedDevices") + }) + return _obj + + diff --git a/flightctl/v1alpha1/models/vulnerability_impact.py b/flightctl/v1alpha1/models/vulnerability_impact.py new file mode 100644 index 0000000..28dd773 --- /dev/null +++ b/flightctl/v1alpha1/models/vulnerability_impact.py @@ -0,0 +1,127 @@ +# 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from flightctl.v1alpha1.models.affected_fleet import AffectedFleet +from flightctl.v1alpha1.models.api_version import ApiVersion +from flightctl.v1alpha1.models.list_meta import ListMeta +from typing import Optional, Set +from typing_extensions import Self + +class VulnerabilityImpact(BaseModel): + """ + Blast radius for a single CVE across fleets and fleetless devices. + """ # noqa: E501 + api_version: ApiVersion = Field(alias="apiVersion") + kind: StrictStr = Field(description="Resource kind; always VulnerabilityImpact.") + metadata: ListMeta + cve_id: StrictStr = Field(description="CVE identifier for this blast radius response.", alias="cveId") + issuer: Optional[StrictStr] = Field(default=None, description="Name of the advisory issuer (e.g. Red Hat, NVD) when known.") + link: Optional[StrictStr] = Field(default=None, description="URL to the CVE details page. Points to Red Hat Security portal for Red Hat advisories, otherwise to NVD.") + severity: StrictStr = Field(description="Worst severity for this CVE in the fleet or fleetless group.") + max_cvss_score: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Highest CVSS base score for this CVE in the fleet or fleetless group.", alias="maxCvssScore") + max_published_at: Optional[datetime] = Field(default=None, description="When this CVE was first observed in the fleet or fleetless group.", alias="maxPublishedAt") + items: List[AffectedFleet] = Field(description="Per-fleet or fleetless rows with device and image counts.") + __properties: ClassVar[List[str]] = ["apiVersion", "kind", "metadata", "cveId", "issuer", "link", "severity", "maxCvssScore", "maxPublishedAt", "items"] + + @field_validator('severity') + def severity_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['Critical', 'High', 'Medium', 'Low', 'None', 'Unknown']): + raise ValueError("must be one of enum values ('Critical', 'High', 'Medium', 'Low', 'None', 'Unknown')") + 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 VulnerabilityImpact 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 VulnerabilityImpact 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, + "cveId": obj.get("cveId"), + "issuer": obj.get("issuer"), + "link": obj.get("link"), + "severity": obj.get("severity"), + "maxCvssScore": obj.get("maxCvssScore"), + "maxPublishedAt": obj.get("maxPublishedAt"), + "items": [AffectedFleet.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/vulnerability_list.py b/flightctl/v1alpha1/models/vulnerability_list.py new file mode 100644 index 0000000..ff287db --- /dev/null +++ b/flightctl/v1alpha1/models/vulnerability_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.list_meta import ListMeta +from flightctl.v1alpha1.models.vulnerability import Vulnerability +from typing import Optional, Set +from typing_extensions import Self + +class VulnerabilityList(BaseModel): + """ + Paginated list of Vulnerability resources. + """ # noqa: E501 + api_version: ApiVersion = Field(alias="apiVersion") + kind: StrictStr = Field(description="Kind is a string value representing the REST resource this object represents. Always VulnerabilityList.") + metadata: ListMeta + items: List[Vulnerability] = Field(description="Paginated Vulnerability resources for this page.") + __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 VulnerabilityList 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 VulnerabilityList 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": [Vulnerability.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/vulnerability_severity_summary.py b/flightctl/v1alpha1/models/vulnerability_severity_summary.py new file mode 100644 index 0000000..fb6fe21 --- /dev/null +++ b/flightctl/v1alpha1/models/vulnerability_severity_summary.py @@ -0,0 +1,100 @@ +# 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, StrictInt +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class VulnerabilitySeveritySummary(BaseModel): + """ + Total vulnerability counts by severity for the full result set (not only the current page). + """ # noqa: E501 + total: StrictInt = Field(description="Total vulnerabilities across all severities for the full result set.") + critical: StrictInt = Field(description="Count of Critical severity findings in the full result set.") + high: StrictInt = Field(description="Count of High severity findings in the full result set.") + medium: StrictInt = Field(description="Count of Medium severity findings in the full result set.") + low: StrictInt = Field(description="Count of Low severity findings in the full result set.") + var_none: StrictInt = Field(description="Count of findings with no exploitable impact (CVSS score 0).", alias="none") + unknown: StrictInt = Field(description="Count of findings with unknown or unscored severity.") + __properties: ClassVar[List[str]] = ["total", "critical", "high", "medium", "low", "none", "unknown"] + + 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 VulnerabilitySeveritySummary 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 VulnerabilitySeveritySummary from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "total": obj.get("total"), + "critical": obj.get("critical"), + "high": obj.get("high"), + "medium": obj.get("medium"), + "low": obj.get("low"), + "none": obj.get("none"), + "unknown": obj.get("unknown") + }) + return _obj + + diff --git a/flightctl/v1alpha1/models/vulnerability_summary_response.py b/flightctl/v1alpha1/models/vulnerability_summary_response.py new file mode 100644 index 0000000..2da5ba4 --- /dev/null +++ b/flightctl/v1alpha1/models/vulnerability_summary_response.py @@ -0,0 +1,97 @@ +# 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.cve_counts_by_severity import CveCountsBySeverity +from typing import Optional, Set +from typing_extensions import Self + +class VulnerabilitySummaryResponse(BaseModel): + """ + Estate-wide vulnerability summary counts. + """ # noqa: E501 + api_version: ApiVersion = Field(alias="apiVersion") + kind: StrictStr = Field(description="Resource kind; always VulnerabilitySummary.") + cves_by_severity: CveCountsBySeverity = Field(alias="cvesBySeverity") + __properties: ClassVar[List[str]] = ["apiVersion", "kind", "cvesBySeverity"] + + 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 VulnerabilitySummaryResponse 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 cves_by_severity + if self.cves_by_severity: + _dict['cvesBySeverity'] = self.cves_by_severity.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of VulnerabilitySummaryResponse 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"), + "cvesBySeverity": CveCountsBySeverity.from_dict(obj["cvesBySeverity"]) if obj.get("cvesBySeverity") is not None else None + }) + return _obj + + diff --git a/flightctl/v1alpha1/test/test_affected_fleet.py b/flightctl/v1alpha1/test/test_affected_fleet.py new file mode 100644 index 0000000..6b409fa --- /dev/null +++ b/flightctl/v1alpha1/test/test_affected_fleet.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. 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.affected_fleet import AffectedFleet + +class TestAffectedFleet(unittest.TestCase): + """AffectedFleet unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AffectedFleet: + """Test AffectedFleet + 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 `AffectedFleet` + """ + model = AffectedFleet() + if include_optional: + return AffectedFleet( + fleet_name = '', + fleetless = True, + affected_devices = 56, + findings = [ + flightctl.v1alpha1.models.vulnerability_group_item.VulnerabilityGroupItem( + image_digest = '', + image_refs = [ + '' + ], + severity = 'Critical', + cvss_score = 1.337, + advisory_id = '', + issuer = '', + link = '', + description = '', + published_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + affected_devices = 56, + first_seen_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ) + ] + ) + else: + return AffectedFleet( + fleet_name = '', + fleetless = True, + affected_devices = 56, + findings = [ + flightctl.v1alpha1.models.vulnerability_group_item.VulnerabilityGroupItem( + image_digest = '', + image_refs = [ + '' + ], + severity = 'Critical', + cvss_score = 1.337, + advisory_id = '', + issuer = '', + link = '', + description = '', + published_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + affected_devices = 56, + first_seen_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ) + ], + ) + """ + + def testAffectedFleet(self): + """Test AffectedFleet""" + # 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_cve_counts_by_severity.py b/flightctl/v1alpha1/test/test_cve_counts_by_severity.py new file mode 100644 index 0000000..be47c75 --- /dev/null +++ b/flightctl/v1alpha1/test/test_cve_counts_by_severity.py @@ -0,0 +1,65 @@ +# 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.cve_counts_by_severity import CveCountsBySeverity + +class TestCveCountsBySeverity(unittest.TestCase): + """CveCountsBySeverity unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CveCountsBySeverity: + """Test CveCountsBySeverity + 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 `CveCountsBySeverity` + """ + model = CveCountsBySeverity() + if include_optional: + return CveCountsBySeverity( + total = 56, + critical = 56, + high = 56, + medium = 56, + low = 56, + var_none = 56, + unknown = 56 + ) + else: + return CveCountsBySeverity( + total = 56, + critical = 56, + high = 56, + medium = 56, + low = 56, + var_none = 56, + unknown = 56, + ) + """ + + def testCveCountsBySeverity(self): + """Test CveCountsBySeverity""" + # 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_device_counts_by_severity.py b/flightctl/v1alpha1/test/test_device_counts_by_severity.py new file mode 100644 index 0000000..302ae26 --- /dev/null +++ b/flightctl/v1alpha1/test/test_device_counts_by_severity.py @@ -0,0 +1,65 @@ +# 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.device_counts_by_severity import DeviceCountsBySeverity + +class TestDeviceCountsBySeverity(unittest.TestCase): + """DeviceCountsBySeverity unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DeviceCountsBySeverity: + """Test DeviceCountsBySeverity + 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 `DeviceCountsBySeverity` + """ + model = DeviceCountsBySeverity() + if include_optional: + return DeviceCountsBySeverity( + total = 56, + critical = 56, + high = 56, + medium = 56, + low = 56, + var_none = 56, + unknown = 56 + ) + else: + return DeviceCountsBySeverity( + total = 56, + critical = 56, + high = 56, + medium = 56, + low = 56, + var_none = 56, + unknown = 56, + ) + """ + + def testDeviceCountsBySeverity(self): + """Test DeviceCountsBySeverity""" + # 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_device_vulnerability_summary_response.py b/flightctl/v1alpha1/test/test_device_vulnerability_summary_response.py new file mode 100644 index 0000000..052191a --- /dev/null +++ b/flightctl/v1alpha1/test/test_device_vulnerability_summary_response.py @@ -0,0 +1,73 @@ +# 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.device_vulnerability_summary_response import DeviceVulnerabilitySummaryResponse + +class TestDeviceVulnerabilitySummaryResponse(unittest.TestCase): + """DeviceVulnerabilitySummaryResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DeviceVulnerabilitySummaryResponse: + """Test DeviceVulnerabilitySummaryResponse + 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 `DeviceVulnerabilitySummaryResponse` + """ + model = DeviceVulnerabilitySummaryResponse() + if include_optional: + return DeviceVulnerabilitySummaryResponse( + api_version = 'v1alpha1', + kind = '', + image = '', + image_digest = '', + summary = flightctl.v1alpha1.models.vulnerability_severity_summary.VulnerabilitySeveritySummary( + total = 56, + critical = 56, + high = 56, + medium = 56, + low = 56, + none = 56, + unknown = 56, ) + ) + else: + return DeviceVulnerabilitySummaryResponse( + api_version = 'v1alpha1', + kind = '', + summary = flightctl.v1alpha1.models.vulnerability_severity_summary.VulnerabilitySeveritySummary( + total = 56, + critical = 56, + high = 56, + medium = 56, + low = 56, + none = 56, + unknown = 56, ), + ) + """ + + def testDeviceVulnerabilitySummaryResponse(self): + """Test DeviceVulnerabilitySummaryResponse""" + # 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_fleet_vulnerability_summary.py b/flightctl/v1alpha1/test/test_fleet_vulnerability_summary.py new file mode 100644 index 0000000..a62195b --- /dev/null +++ b/flightctl/v1alpha1/test/test_fleet_vulnerability_summary.py @@ -0,0 +1,67 @@ +# 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.fleet_vulnerability_summary import FleetVulnerabilitySummary + +class TestFleetVulnerabilitySummary(unittest.TestCase): + """FleetVulnerabilitySummary unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> FleetVulnerabilitySummary: + """Test FleetVulnerabilitySummary + 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 `FleetVulnerabilitySummary` + """ + model = FleetVulnerabilitySummary() + if include_optional: + return FleetVulnerabilitySummary( + total = 56, + critical = 56, + high = 56, + medium = 56, + low = 56, + var_none = 56, + unknown = 56, + unique_digests = 56 + ) + else: + return FleetVulnerabilitySummary( + total = 56, + critical = 56, + high = 56, + medium = 56, + low = 56, + var_none = 56, + unknown = 56, + unique_digests = 56, + ) + """ + + def testFleetVulnerabilitySummary(self): + """Test FleetVulnerabilitySummary""" + # 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_fleet_vulnerability_summary_response.py b/flightctl/v1alpha1/test/test_fleet_vulnerability_summary_response.py new file mode 100644 index 0000000..fa50c0e --- /dev/null +++ b/flightctl/v1alpha1/test/test_fleet_vulnerability_summary_response.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. 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.fleet_vulnerability_summary_response import FleetVulnerabilitySummaryResponse + +class TestFleetVulnerabilitySummaryResponse(unittest.TestCase): + """FleetVulnerabilitySummaryResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> FleetVulnerabilitySummaryResponse: + """Test FleetVulnerabilitySummaryResponse + 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 `FleetVulnerabilitySummaryResponse` + """ + model = FleetVulnerabilitySummaryResponse() + if include_optional: + return FleetVulnerabilitySummaryResponse( + api_version = 'v1alpha1', + kind = '', + summary = None + ) + else: + return FleetVulnerabilitySummaryResponse( + api_version = 'v1alpha1', + kind = '', + summary = None, + ) + """ + + def testFleetVulnerabilitySummaryResponse(self): + """Test FleetVulnerabilitySummaryResponse""" + # 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_vulnerability.py b/flightctl/v1alpha1/test/test_vulnerability.py new file mode 100644 index 0000000..a59e48d --- /dev/null +++ b/flightctl/v1alpha1/test/test_vulnerability.py @@ -0,0 +1,68 @@ +# 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.vulnerability import Vulnerability + +class TestVulnerability(unittest.TestCase): + """Vulnerability unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Vulnerability: + """Test Vulnerability + 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 `Vulnerability` + """ + model = Vulnerability() + if include_optional: + return Vulnerability( + api_version = 'v1alpha1', + kind = '', + cve_id = '', + advisory_id = '', + issuer = '', + link = '', + severity = 'Critical', + cvss_score = 1.337, + description = '', + published_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + image = '', + image_digest = '', + affected_devices = 56 + ) + else: + return Vulnerability( + api_version = 'v1alpha1', + kind = '', + cve_id = '', + severity = 'Critical', + ) + """ + + def testVulnerability(self): + """Test Vulnerability""" + # 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_vulnerability_api.py b/flightctl/v1alpha1/test/test_vulnerability_api.py new file mode 100644 index 0000000..b3f0a06 --- /dev/null +++ b/flightctl/v1alpha1/test/test_vulnerability_api.py @@ -0,0 +1,74 @@ +# 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.api.vulnerability_api import VulnerabilityApi + + +class TestVulnerabilityApi(unittest.TestCase): + """VulnerabilityApi unit test stubs""" + + def setUp(self) -> None: + self.api = VulnerabilityApi() + + def tearDown(self) -> None: + pass + + def test_get_device_vulnerabilities(self) -> None: + """Test case for get_device_vulnerabilities + + """ + pass + + def test_get_device_vulnerability_summary(self) -> None: + """Test case for get_device_vulnerability_summary + + """ + pass + + def test_get_fleet_vulnerabilities(self) -> None: + """Test case for get_fleet_vulnerabilities + + """ + pass + + def test_get_fleet_vulnerability_summary(self) -> None: + """Test case for get_fleet_vulnerability_summary + + """ + pass + + def test_get_vulnerability_impact(self) -> None: + """Test case for get_vulnerability_impact + + """ + pass + + def test_get_vulnerability_summary(self) -> None: + """Test case for get_vulnerability_summary + + """ + pass + + def test_list_vulnerabilities(self) -> None: + """Test case for list_vulnerabilities + + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/flightctl/v1alpha1/test/test_vulnerability_group.py b/flightctl/v1alpha1/test/test_vulnerability_group.py new file mode 100644 index 0000000..3b23ee8 --- /dev/null +++ b/flightctl/v1alpha1/test/test_vulnerability_group.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. 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.vulnerability_group import VulnerabilityGroup + +class TestVulnerabilityGroup(unittest.TestCase): + """VulnerabilityGroup unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VulnerabilityGroup: + """Test VulnerabilityGroup + 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 `VulnerabilityGroup` + """ + model = VulnerabilityGroup() + if include_optional: + return VulnerabilityGroup( + api_version = 'v1alpha1', + kind = '', + cve_id = '', + severity = 'Critical', + max_cvss_score = 1.337, + max_published_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + affected_devices = 56, + findings = [ + flightctl.v1alpha1.models.vulnerability_group_item.VulnerabilityGroupItem( + image_digest = '', + image_refs = [ + '' + ], + severity = 'Critical', + cvss_score = 1.337, + advisory_id = '', + issuer = '', + link = '', + description = '', + published_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + affected_devices = 56, + first_seen_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ) + ] + ) + else: + return VulnerabilityGroup( + api_version = 'v1alpha1', + kind = '', + cve_id = '', + severity = 'Critical', + findings = [ + flightctl.v1alpha1.models.vulnerability_group_item.VulnerabilityGroupItem( + image_digest = '', + image_refs = [ + '' + ], + severity = 'Critical', + cvss_score = 1.337, + advisory_id = '', + issuer = '', + link = '', + description = '', + published_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + affected_devices = 56, + first_seen_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ) + ], + ) + """ + + def testVulnerabilityGroup(self): + """Test VulnerabilityGroup""" + # 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_vulnerability_group_item.py b/flightctl/v1alpha1/test/test_vulnerability_group_item.py new file mode 100644 index 0000000..d07d04c --- /dev/null +++ b/flightctl/v1alpha1/test/test_vulnerability_group_item.py @@ -0,0 +1,69 @@ +# 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.vulnerability_group_item import VulnerabilityGroupItem + +class TestVulnerabilityGroupItem(unittest.TestCase): + """VulnerabilityGroupItem unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VulnerabilityGroupItem: + """Test VulnerabilityGroupItem + 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 `VulnerabilityGroupItem` + """ + model = VulnerabilityGroupItem() + if include_optional: + return VulnerabilityGroupItem( + image_digest = '', + image_refs = [ + '' + ], + severity = 'Critical', + cvss_score = 1.337, + advisory_id = '', + issuer = '', + link = '', + description = '', + published_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + affected_devices = 56, + first_seen_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') + ) + else: + return VulnerabilityGroupItem( + image_digest = '', + image_refs = [ + '' + ], + severity = 'Critical', + ) + """ + + def testVulnerabilityGroupItem(self): + """Test VulnerabilityGroupItem""" + # 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_vulnerability_group_list.py b/flightctl/v1alpha1/test/test_vulnerability_group_list.py new file mode 100644 index 0000000..c01764e --- /dev/null +++ b/flightctl/v1alpha1/test/test_vulnerability_group_list.py @@ -0,0 +1,113 @@ +# 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.vulnerability_group_list import VulnerabilityGroupList + +class TestVulnerabilityGroupList(unittest.TestCase): + """VulnerabilityGroupList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VulnerabilityGroupList: + """Test VulnerabilityGroupList + 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 `VulnerabilityGroupList` + """ + model = VulnerabilityGroupList() + if include_optional: + return VulnerabilityGroupList( + api_version = 'v1alpha1', + kind = '', + metadata = flightctl.v1alpha1.models.list_meta.ListMeta( + continue = '', + remaining_item_count = 56, ), + items = [ + flightctl.v1alpha1.models.vulnerability_group.VulnerabilityGroup( + api_version = 'v1alpha1', + kind = '', + cve_id = '', + severity = 'Critical', + max_cvss_score = 1.337, + max_published_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + affected_devices = 56, + findings = [ + flightctl.v1alpha1.models.vulnerability_group_item.VulnerabilityGroupItem( + image_digest = '', + image_refs = [ + '' + ], + severity = 'Critical', + cvss_score = 1.337, + advisory_id = '', + issuer = '', + link = '', + description = '', + published_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + affected_devices = 56, + first_seen_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ) + ], ) + ] + ) + else: + return VulnerabilityGroupList( + api_version = 'v1alpha1', + kind = '', + metadata = flightctl.v1alpha1.models.list_meta.ListMeta( + continue = '', + remaining_item_count = 56, ), + items = [ + flightctl.v1alpha1.models.vulnerability_group.VulnerabilityGroup( + api_version = 'v1alpha1', + kind = '', + cve_id = '', + severity = 'Critical', + max_cvss_score = 1.337, + max_published_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + affected_devices = 56, + findings = [ + flightctl.v1alpha1.models.vulnerability_group_item.VulnerabilityGroupItem( + image_digest = '', + image_refs = [ + '' + ], + severity = 'Critical', + cvss_score = 1.337, + advisory_id = '', + issuer = '', + link = '', + description = '', + published_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + affected_devices = 56, + first_seen_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ) + ], ) + ], + ) + """ + + def testVulnerabilityGroupList(self): + """Test VulnerabilityGroupList""" + # 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_vulnerability_image_ref.py b/flightctl/v1alpha1/test/test_vulnerability_image_ref.py new file mode 100644 index 0000000..5fa764a --- /dev/null +++ b/flightctl/v1alpha1/test/test_vulnerability_image_ref.py @@ -0,0 +1,56 @@ +# 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.vulnerability_image_ref import VulnerabilityImageRef + +class TestVulnerabilityImageRef(unittest.TestCase): + """VulnerabilityImageRef unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VulnerabilityImageRef: + """Test VulnerabilityImageRef + 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 `VulnerabilityImageRef` + """ + model = VulnerabilityImageRef() + if include_optional: + return VulnerabilityImageRef( + image = '', + image_digest = '', + affected_devices = 56 + ) + else: + return VulnerabilityImageRef( + image = '', + image_digest = '', + ) + """ + + def testVulnerabilityImageRef(self): + """Test VulnerabilityImageRef""" + # 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_vulnerability_impact.py b/flightctl/v1alpha1/test/test_vulnerability_impact.py new file mode 100644 index 0000000..fe05b50 --- /dev/null +++ b/flightctl/v1alpha1/test/test_vulnerability_impact.py @@ -0,0 +1,113 @@ +# 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.vulnerability_impact import VulnerabilityImpact + +class TestVulnerabilityImpact(unittest.TestCase): + """VulnerabilityImpact unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VulnerabilityImpact: + """Test VulnerabilityImpact + 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 `VulnerabilityImpact` + """ + model = VulnerabilityImpact() + if include_optional: + return VulnerabilityImpact( + api_version = 'v1alpha1', + kind = '', + metadata = flightctl.v1alpha1.models.list_meta.ListMeta( + continue = '', + remaining_item_count = 56, ), + cve_id = '', + issuer = '', + link = '', + severity = 'Critical', + max_cvss_score = 1.337, + max_published_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + items = [ + flightctl.v1alpha1.models.affected_fleet.AffectedFleet( + fleet_name = '', + fleetless = True, + affected_devices = 56, + findings = [ + flightctl.v1alpha1.models.vulnerability_group_item.VulnerabilityGroupItem( + image_digest = '', + image_refs = [ + '' + ], + severity = 'Critical', + cvss_score = 1.337, + advisory_id = '', + issuer = '', + link = '', + description = '', + published_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + affected_devices = 56, + first_seen_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ) + ], ) + ] + ) + else: + return VulnerabilityImpact( + api_version = 'v1alpha1', + kind = '', + metadata = flightctl.v1alpha1.models.list_meta.ListMeta( + continue = '', + remaining_item_count = 56, ), + cve_id = '', + severity = 'Critical', + items = [ + flightctl.v1alpha1.models.affected_fleet.AffectedFleet( + fleet_name = '', + fleetless = True, + affected_devices = 56, + findings = [ + flightctl.v1alpha1.models.vulnerability_group_item.VulnerabilityGroupItem( + image_digest = '', + image_refs = [ + '' + ], + severity = 'Critical', + cvss_score = 1.337, + advisory_id = '', + issuer = '', + link = '', + description = '', + published_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + affected_devices = 56, + first_seen_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ) + ], ) + ], + ) + """ + + def testVulnerabilityImpact(self): + """Test VulnerabilityImpact""" + # 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_vulnerability_list.py b/flightctl/v1alpha1/test/test_vulnerability_list.py new file mode 100644 index 0000000..ec6bf97 --- /dev/null +++ b/flightctl/v1alpha1/test/test_vulnerability_list.py @@ -0,0 +1,93 @@ +# 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.vulnerability_list import VulnerabilityList + +class TestVulnerabilityList(unittest.TestCase): + """VulnerabilityList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VulnerabilityList: + """Test VulnerabilityList + 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 `VulnerabilityList` + """ + model = VulnerabilityList() + if include_optional: + return VulnerabilityList( + api_version = 'v1alpha1', + kind = '', + metadata = flightctl.v1alpha1.models.list_meta.ListMeta( + continue = '', + remaining_item_count = 56, ), + items = [ + flightctl.v1alpha1.models.vulnerability.Vulnerability( + api_version = 'v1alpha1', + kind = '', + cve_id = '', + advisory_id = '', + issuer = '', + link = '', + severity = 'Critical', + cvss_score = 1.337, + description = '', + published_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + image = '', + image_digest = '', + affected_devices = 56, ) + ] + ) + else: + return VulnerabilityList( + api_version = 'v1alpha1', + kind = '', + metadata = flightctl.v1alpha1.models.list_meta.ListMeta( + continue = '', + remaining_item_count = 56, ), + items = [ + flightctl.v1alpha1.models.vulnerability.Vulnerability( + api_version = 'v1alpha1', + kind = '', + cve_id = '', + advisory_id = '', + issuer = '', + link = '', + severity = 'Critical', + cvss_score = 1.337, + description = '', + published_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + image = '', + image_digest = '', + affected_devices = 56, ) + ], + ) + """ + + def testVulnerabilityList(self): + """Test VulnerabilityList""" + # 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_vulnerability_severity_summary.py b/flightctl/v1alpha1/test/test_vulnerability_severity_summary.py new file mode 100644 index 0000000..ce12164 --- /dev/null +++ b/flightctl/v1alpha1/test/test_vulnerability_severity_summary.py @@ -0,0 +1,65 @@ +# 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.vulnerability_severity_summary import VulnerabilitySeveritySummary + +class TestVulnerabilitySeveritySummary(unittest.TestCase): + """VulnerabilitySeveritySummary unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VulnerabilitySeveritySummary: + """Test VulnerabilitySeveritySummary + 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 `VulnerabilitySeveritySummary` + """ + model = VulnerabilitySeveritySummary() + if include_optional: + return VulnerabilitySeveritySummary( + total = 56, + critical = 56, + high = 56, + medium = 56, + low = 56, + var_none = 56, + unknown = 56 + ) + else: + return VulnerabilitySeveritySummary( + total = 56, + critical = 56, + high = 56, + medium = 56, + low = 56, + var_none = 56, + unknown = 56, + ) + """ + + def testVulnerabilitySeveritySummary(self): + """Test VulnerabilitySeveritySummary""" + # 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_vulnerability_summary_response.py b/flightctl/v1alpha1/test/test_vulnerability_summary_response.py new file mode 100644 index 0000000..55a233e --- /dev/null +++ b/flightctl/v1alpha1/test/test_vulnerability_summary_response.py @@ -0,0 +1,71 @@ +# 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.vulnerability_summary_response import VulnerabilitySummaryResponse + +class TestVulnerabilitySummaryResponse(unittest.TestCase): + """VulnerabilitySummaryResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VulnerabilitySummaryResponse: + """Test VulnerabilitySummaryResponse + 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 `VulnerabilitySummaryResponse` + """ + model = VulnerabilitySummaryResponse() + if include_optional: + return VulnerabilitySummaryResponse( + api_version = 'v1alpha1', + kind = '', + cves_by_severity = flightctl.v1alpha1.models.cve_counts_by_severity.CveCountsBySeverity( + total = 56, + critical = 56, + high = 56, + medium = 56, + low = 56, + none = 56, + unknown = 56, ) + ) + else: + return VulnerabilitySummaryResponse( + api_version = 'v1alpha1', + kind = '', + cves_by_severity = flightctl.v1alpha1.models.cve_counts_by_severity.CveCountsBySeverity( + total = 56, + critical = 56, + high = 56, + medium = 56, + low = 56, + none = 56, + unknown = 56, ), + ) + """ + + def testVulnerabilitySummaryResponse(self): + """Test VulnerabilitySummaryResponse""" + # 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 dd2497d..bb89a4c 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.1.0 +- Package version: 1.2.0 - Generator version: 7.17.0 - Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit [https://flightctl.io](https://flightctl.io) @@ -80,10 +80,18 @@ Class | Method | HTTP request | Description *CatalogApi* | [**replace_catalog**](flightctl/v1alpha1/docs/CatalogApi.md#replace_catalog) | **PUT** /catalogs/{name} | *CatalogApi* | [**replace_catalog_item**](flightctl/v1alpha1/docs/CatalogApi.md#replace_catalog_item) | **PUT** /catalogs/{catalog}/items/{name} | *CatalogApi* | [**replace_catalog_status**](flightctl/v1alpha1/docs/CatalogApi.md#replace_catalog_status) | **PUT** /catalogs/{name}/status | +*VulnerabilityApi* | [**get_device_vulnerabilities**](flightctl/v1alpha1/docs/VulnerabilityApi.md#get_device_vulnerabilities) | **GET** /vulnerabilities/devices/{name} | +*VulnerabilityApi* | [**get_device_vulnerability_summary**](flightctl/v1alpha1/docs/VulnerabilityApi.md#get_device_vulnerability_summary) | **GET** /vulnerabilities/devices/{name}/summary | +*VulnerabilityApi* | [**get_fleet_vulnerabilities**](flightctl/v1alpha1/docs/VulnerabilityApi.md#get_fleet_vulnerabilities) | **GET** /vulnerabilities/fleets/{name} | +*VulnerabilityApi* | [**get_fleet_vulnerability_summary**](flightctl/v1alpha1/docs/VulnerabilityApi.md#get_fleet_vulnerability_summary) | **GET** /vulnerabilities/fleets/{name}/summary | +*VulnerabilityApi* | [**get_vulnerability_impact**](flightctl/v1alpha1/docs/VulnerabilityApi.md#get_vulnerability_impact) | **GET** /vulnerabilities/cves/{cveId}/impact | +*VulnerabilityApi* | [**get_vulnerability_summary**](flightctl/v1alpha1/docs/VulnerabilityApi.md#get_vulnerability_summary) | **GET** /vulnerabilities/summary | +*VulnerabilityApi* | [**list_vulnerabilities**](flightctl/v1alpha1/docs/VulnerabilityApi.md#list_vulnerabilities) | **GET** /vulnerabilities | ## Documentation For Models + - [AffectedFleet](flightctl/v1alpha1/docs/AffectedFleet.md) - [ApiVersion](flightctl/v1alpha1/docs/ApiVersion.md) - [Catalog](flightctl/v1alpha1/docs/Catalog.md) - [CatalogItem](flightctl/v1alpha1/docs/CatalogItem.md) @@ -104,12 +112,24 @@ Class | Method | HTTP request | Description - [ConditionBase](flightctl/v1alpha1/docs/ConditionBase.md) - [ConditionStatus](flightctl/v1alpha1/docs/ConditionStatus.md) - [ConditionType](flightctl/v1alpha1/docs/ConditionType.md) + - [CveCountsBySeverity](flightctl/v1alpha1/docs/CveCountsBySeverity.md) + - [DeviceCountsBySeverity](flightctl/v1alpha1/docs/DeviceCountsBySeverity.md) + - [DeviceVulnerabilitySummaryResponse](flightctl/v1alpha1/docs/DeviceVulnerabilitySummaryResponse.md) + - [FleetVulnerabilitySummary](flightctl/v1alpha1/docs/FleetVulnerabilitySummary.md) + - [FleetVulnerabilitySummaryResponse](flightctl/v1alpha1/docs/FleetVulnerabilitySummaryResponse.md) - [ListMeta](flightctl/v1alpha1/docs/ListMeta.md) - [ObjectMeta](flightctl/v1alpha1/docs/ObjectMeta.md) - [PatchRequestInner](flightctl/v1alpha1/docs/PatchRequestInner.md) - - [SchemasApiVersion](flightctl/v1alpha1/docs/SchemasApiVersion.md) - - [SchemasStatus](flightctl/v1alpha1/docs/SchemasStatus.md) - [Status](flightctl/v1alpha1/docs/Status.md) + - [Vulnerability](flightctl/v1alpha1/docs/Vulnerability.md) + - [VulnerabilityGroup](flightctl/v1alpha1/docs/VulnerabilityGroup.md) + - [VulnerabilityGroupItem](flightctl/v1alpha1/docs/VulnerabilityGroupItem.md) + - [VulnerabilityGroupList](flightctl/v1alpha1/docs/VulnerabilityGroupList.md) + - [VulnerabilityImageRef](flightctl/v1alpha1/docs/VulnerabilityImageRef.md) + - [VulnerabilityImpact](flightctl/v1alpha1/docs/VulnerabilityImpact.md) + - [VulnerabilityList](flightctl/v1alpha1/docs/VulnerabilityList.md) + - [VulnerabilitySeveritySummary](flightctl/v1alpha1/docs/VulnerabilitySeveritySummary.md) + - [VulnerabilitySummaryResponse](flightctl/v1alpha1/docs/VulnerabilitySummaryResponse.md) diff --git a/pyproject.toml b/pyproject.toml index 1986e3f..3d0174d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] -name = "flightctl-client" -version = "1.1.0" +name = "flightctl" +version = "1.2.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 3512777..cbfb78a 100644 --- a/setup.py +++ b/setup.py @@ -21,8 +21,8 @@ # # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools -NAME = "flightctl-client" -VERSION = "1.1.0" +NAME = "flightctl" +VERSION = "1.2.0" PYTHON_REQUIRES = ">= 3.9" REQUIRES = [ "urllib3 >= 2.1.0, < 3.0.0", diff --git a/test/test_base_image_entry.py b/test/test_base_image_entry.py new file mode 100644 index 0000000..79edcdc --- /dev/null +++ b/test/test_base_image_entry.py @@ -0,0 +1,60 @@ +# 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.base_image_entry import BaseImageEntry + +class TestBaseImageEntry(unittest.TestCase): + """BaseImageEntry unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BaseImageEntry: + """Test BaseImageEntry + 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 `BaseImageEntry` + """ + model = BaseImageEntry() + if include_optional: + return BaseImageEntry( + display_name = '', + image_name = '0', + tags = [ + 'e6bUUGjjNSwg0_bs9ZayIMrKdgNvb6gvxmPb9GcsM61ate1RA89q3w1l4eH4XxEz.5awxoFZxHzs6ED.kjUSnTINkYPUndNl8pmPg5K897Fu1JEFj9R1_dz9rEoBi0L0' + ] + ) + else: + return BaseImageEntry( + image_name = '0', + tags = [ + 'e6bUUGjjNSwg0_bs9ZayIMrKdgNvb6gvxmPb9GcsM61ate1RA89q3w1l4eH4XxEz.5awxoFZxHzs6ED.kjUSnTINkYPUndNl8pmPg5K897Fu1JEFj9R1_dz9rEoBi0L0' + ], + ) + """ + + def testBaseImageEntry(self): + """Test BaseImageEntry""" + # 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_check_repository_oci_image_request.py b/test/test_check_repository_oci_image_request.py new file mode 100644 index 0000000..d9abcaa --- /dev/null +++ b/test/test_check_repository_oci_image_request.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.check_repository_oci_image_request import CheckRepositoryOciImageRequest + +class TestCheckRepositoryOciImageRequest(unittest.TestCase): + """CheckRepositoryOciImageRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CheckRepositoryOciImageRequest: + """Test CheckRepositoryOciImageRequest + 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 `CheckRepositoryOciImageRequest` + """ + model = CheckRepositoryOciImageRequest() + if include_optional: + return CheckRepositoryOciImageRequest( + image_name = '0' + ) + else: + return CheckRepositoryOciImageRequest( + image_name = '0', + ) + """ + + def testCheckRepositoryOciImageRequest(self): + """Test CheckRepositoryOciImageRequest""" + # 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_check_repository_oci_result.py b/test/test_check_repository_oci_result.py new file mode 100644 index 0000000..359c605 --- /dev/null +++ b/test/test_check_repository_oci_result.py @@ -0,0 +1,55 @@ +# 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.check_repository_oci_result import CheckRepositoryOciResult + +class TestCheckRepositoryOciResult(unittest.TestCase): + """CheckRepositoryOciResult unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CheckRepositoryOciResult: + """Test CheckRepositoryOciResult + 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 `CheckRepositoryOciResult` + """ + model = CheckRepositoryOciResult() + if include_optional: + return CheckRepositoryOciResult( + accessible = True, + error_code = 56, + error_message = '' + ) + else: + return CheckRepositoryOciResult( + accessible = True, + ) + """ + + def testCheckRepositoryOciResult(self): + """Test CheckRepositoryOciResult""" + # 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_check_repository_oci_tag_request.py b/test/test_check_repository_oci_tag_request.py new file mode 100644 index 0000000..f5736fd --- /dev/null +++ b/test/test_check_repository_oci_tag_request.py @@ -0,0 +1,55 @@ +# 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.check_repository_oci_tag_request import CheckRepositoryOciTagRequest + +class TestCheckRepositoryOciTagRequest(unittest.TestCase): + """CheckRepositoryOciTagRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CheckRepositoryOciTagRequest: + """Test CheckRepositoryOciTagRequest + 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 `CheckRepositoryOciTagRequest` + """ + model = CheckRepositoryOciTagRequest() + if include_optional: + return CheckRepositoryOciTagRequest( + image_name = '0', + tag = 'e6bUUGjjNSwg0_bs9ZayIMrKdgNvb6gvxmPb9GcsM61ate1RA89q3w1l4eH4XxEz.5awxoFZxHzs6ED.kjUSnTINkYPUndNl8pmPg5K897Fu1JEFj9R1_dz9rEoBi0L0' + ) + else: + return CheckRepositoryOciTagRequest( + image_name = '0', + tag = 'e6bUUGjjNSwg0_bs9ZayIMrKdgNvb6gvxmPb9GcsM61ate1RA89q3w1l4eH4XxEz.5awxoFZxHzs6ED.kjUSnTINkYPUndNl8pmPg5K897Fu1JEFj9R1_dz9rEoBi0L0', + ) + """ + + def testCheckRepositoryOciTagRequest(self): + """Test CheckRepositoryOciTagRequest""" + # 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_dependency_change_detected_details.py b/test/test_dependency_change_detected_details.py new file mode 100644 index 0000000..515053d --- /dev/null +++ b/test/test_dependency_change_detected_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.dependency_change_detected_details import DependencyChangeDetectedDetails + +class TestDependencyChangeDetectedDetails(unittest.TestCase): + """DependencyChangeDetectedDetails unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DependencyChangeDetectedDetails: + """Test DependencyChangeDetectedDetails + 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 `DependencyChangeDetectedDetails` + """ + model = DependencyChangeDetectedDetails() + if include_optional: + return DependencyChangeDetectedDetails( + detail_type = 'DependencyChangeDetected', + resource_key = '', + fingerprint = '' + ) + else: + return DependencyChangeDetectedDetails( + detail_type = 'DependencyChangeDetected', + resource_key = '', + fingerprint = '', + ) + """ + + def testDependencyChangeDetectedDetails(self): + """Test DependencyChangeDetectedDetails""" + # 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_dependency_sync_config_ref_status.py b/test/test_dependency_sync_config_ref_status.py new file mode 100644 index 0000000..124b6d5 --- /dev/null +++ b/test/test_dependency_sync_config_ref_status.py @@ -0,0 +1,55 @@ +# 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.dependency_sync_config_ref_status import DependencySyncConfigRefStatus + +class TestDependencySyncConfigRefStatus(unittest.TestCase): + """DependencySyncConfigRefStatus unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DependencySyncConfigRefStatus: + """Test DependencySyncConfigRefStatus + 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 `DependencySyncConfigRefStatus` + """ + model = DependencySyncConfigRefStatus() + if include_optional: + return DependencySyncConfigRefStatus( + config_provider_name = '', + fingerprint = '', + last_updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') + ) + else: + return DependencySyncConfigRefStatus( + config_provider_name = '', + ) + """ + + def testDependencySyncConfigRefStatus(self): + """Test DependencySyncConfigRefStatus""" + # 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_dependency_sync_probe_failed_details.py b/test/test_dependency_sync_probe_failed_details.py new file mode 100644 index 0000000..dbb1db6 --- /dev/null +++ b/test/test_dependency_sync_probe_failed_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.dependency_sync_probe_failed_details import DependencySyncProbeFailedDetails + +class TestDependencySyncProbeFailedDetails(unittest.TestCase): + """DependencySyncProbeFailedDetails unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DependencySyncProbeFailedDetails: + """Test DependencySyncProbeFailedDetails + 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 `DependencySyncProbeFailedDetails` + """ + model = DependencySyncProbeFailedDetails() + if include_optional: + return DependencySyncProbeFailedDetails( + detail_type = 'DependencySyncProbeFailed', + resource_key = '', + error = '' + ) + else: + return DependencySyncProbeFailedDetails( + detail_type = 'DependencySyncProbeFailed', + resource_key = '', + error = '', + ) + """ + + def testDependencySyncProbeFailedDetails(self): + """Test DependencySyncProbeFailedDetails""" + # 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_dependency_sync_status.py b/test/test_dependency_sync_status.py new file mode 100644 index 0000000..b3e0668 --- /dev/null +++ b/test/test_dependency_sync_status.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.dependency_sync_status import DependencySyncStatus + +class TestDependencySyncStatus(unittest.TestCase): + """DependencySyncStatus unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DependencySyncStatus: + """Test DependencySyncStatus + 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 `DependencySyncStatus` + """ + model = DependencySyncStatus() + if include_optional: + return DependencySyncStatus( + config_refs = [ + flightctl.models.dependency_sync_config_ref_status.DependencySyncConfigRefStatus( + config_provider_name = '', + fingerprint = '', + last_updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ) + ] + ) + else: + return DependencySyncStatus( + ) + """ + + def testDependencySyncStatus(self): + """Test DependencySyncStatus""" + # 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_vulnerability_cve_details.py b/test/test_device_vulnerability_cve_details.py new file mode 100644 index 0000000..00a38e3 --- /dev/null +++ b/test/test_device_vulnerability_cve_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.device_vulnerability_cve_details import DeviceVulnerabilityCveDetails + +class TestDeviceVulnerabilityCveDetails(unittest.TestCase): + """DeviceVulnerabilityCveDetails unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DeviceVulnerabilityCveDetails: + """Test DeviceVulnerabilityCveDetails + 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 `DeviceVulnerabilityCveDetails` + """ + model = DeviceVulnerabilityCveDetails() + if include_optional: + return DeviceVulnerabilityCveDetails( + detail_type = 'DeviceVulnerabilityCVE', + cve_id = 'CVE-0480-2888001528021798096225500850762068629339333975650685139102691291732729478601482026509127275504175770', + first_image_ref = '', + first_image_digest = '' + ) + else: + return DeviceVulnerabilityCveDetails( + detail_type = 'DeviceVulnerabilityCVE', + cve_id = 'CVE-0480-2888001528021798096225500850762068629339333975650685139102691291732729478601482026509127275504175770', + ) + """ + + def testDeviceVulnerabilityCveDetails(self): + """Test DeviceVulnerabilityCveDetails""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main()