From e5f7f2802047dab6740603ac27213d4bd8763d43 Mon Sep 17 00:00:00 2001 From: Joshua Gilman Date: Mon, 4 May 2026 22:49:20 -0700 Subject: [PATCH] feat(incusos): build and inject seed archives --- go.mod | 38 +- go.sum | 80 +- go.work | 2 +- go.work.sum | 292 +++- internal/providers/incusos/imagefile/doc.go | 2 + .../providers/incusos/imagefile/injector.go | 426 ++++++ .../incusos/imagefile/injector_test.go | 308 +++++ internal/providers/incusos/seed_builder.go | 108 ++ .../providers/incusos/seed_builder_test.go | 143 ++ moon.yml | 10 +- .../shared/api/artifacts_go_gen.cue | 76 ++ .../shared/api/batch_go_gen.cue | 157 +++ .../shared/api/certificate_go_gen.cue | 7 + .../shared/api/duration_go_gen.cue | 8 + .../shared/api/event_go_gen.cue | 34 + .../shared/api/instance_go_gen.cue | 60 + .../shared/api/instance_override_go_gen.cue | 50 + .../shared/api/network_go_gen.cue | 96 ++ .../shared/api/os_go_gen.cue | 49 + .../shared/api/properties_go_gen.cue | 148 ++ .../shared/api/queue_go_gen.cue | 98 ++ .../shared/api/server_go_gen.cue | 70 + .../shared/api/source_go_gen.cue | 85 ++ .../shared/api/system_go_gen.cue | 218 +++ .../shared/api/target_go_gen.cue | 74 + .../shared/api/warning_go_gen.cue | 115 ++ .../shared/api/windows_go_gen.cue | 32 + .../shared/api/worker_go_gen.cue | 96 ++ .../shared/api/system/system_go_gen.cue | 223 +++ .../gen/github.com/google/uuid/dce_go_gen.cue | 23 + .../gen/github.com/google/uuid/doc_go_gen.cue | 12 + .../github.com/google/uuid/null_go_gen.cue | 20 + .../github.com/google/uuid/time_go_gen.cue | 15 + .../github.com/google/uuid/uuid_go_gen.cue | 41 + .../google/uuid/version7_go_gen.cue | 7 + .../incus-osd/api/application_go_gen.cue | 24 + .../api/application_incus_go_gen.cue | 28 + .../incus-osd/api/debug_tui_go_gen.cue | 11 + .../lxc/incus-os/incus-osd/api/doc_go_gen.cue | 6 + .../api/seed/applications_go_gen.cue | 16 + .../incus-osd/api/seed/doc_go_gen.cue | 6 + .../incus-osd/api/seed/incus_go_gen.cue | 14 + .../incus-osd/api/seed/install_go_gen.cue | 34 + .../api/seed/migration_manager_go_gen.cue | 26 + .../incus-osd/api/seed/network_go_gen.cue | 13 + .../api/seed/operations_center_go_gen.cue | 27 + .../incus-osd/api/seed/provider_go_gen.cue | 13 + .../incus-osd/api/seed/update_go_gen.cue | 13 + .../incus-osd/api/service_ceph_go_gen.cue | 33 + .../incus-osd/api/service_iscsi_go_gen.cue | 29 + .../incus-osd/api/service_linstor_go_gen.cue | 23 + .../incus-osd/api/service_lvm_go_gen.cue | 60 + .../api/service_multipath_go_gen.cue | 43 + .../incus-osd/api/service_netbird_go_gen.cue | 29 + .../incus-osd/api/service_nvme_go_gen.cue | 30 + .../incus-osd/api/service_ovn_go_gen.cue | 26 + .../api/service_tailscale_go_gen.cue | 67 + .../incus-osd/api/service_usbip_go_gen.cue | 26 + .../incus-osd/api/system_kernel_go_gen.cue | 46 + .../incus-osd/api/system_logging_go_gen.cue | 26 + .../incus-osd/api/system_network_go_gen.cue | 230 ++++ .../incus-osd/api/system_provider_go_gen.cue | 22 + .../incus-osd/api/system_reset_go_gen.cue | 12 + .../incus-osd/api/system_security_go_gen.cue | 43 + .../incus-osd/api/system_storage_go_gen.cue | 163 +++ .../incus-osd/api/system_update_go_gen.cue | 39 + .../incus-os/incus-osd/api/weekday_go_gen.cue | 28 + .../lxc/incus/v7/shared/api/access_go_gen.cue | 31 + .../lxc/incus/v7/shared/api/auth_go_gen.cue | 11 + .../v7/shared/api/certificate_go_gen.cue | 110 ++ .../incus/v7/shared/api/cluster_go_gen.cue | 305 +++++ .../v7/shared/api/cluster_state_go_gen.cue | 32 + .../lxc/incus/v7/shared/api/config_go_gen.cue | 15 + .../incus/v7/shared/api/devices_go_gen.cue | 15 + .../lxc/incus/v7/shared/api/doc_go_gen.cue | 17 + .../lxc/incus/v7/shared/api/event_go_gen.cue | 86 ++ .../v7/shared/api/event_lifecycle_go_gen.cue | 144 ++ .../lxc/incus/v7/shared/api/image_go_gen.cue | 345 +++++ .../lxc/incus/v7/shared/api/init_go_gen.cue | 113 ++ .../v7/shared/api/instance_backup_go_gen.cue | 115 ++ .../v7/shared/api/instance_console_go_gen.cue | 40 + .../v7/shared/api/instance_debug_go_gen.cue | 16 + .../v7/shared/api/instance_exec_go_gen.cue | 60 + .../incus/v7/shared/api/instance_go_gen.cue | 351 +++++ .../shared/api/instance_snapshot_go_gen.cue | 124 ++ .../v7/shared/api/instance_state_go_gen.cue | 262 ++++ .../incus/v7/shared/api/metadata_go_gen.cue | 83 ++ .../incus/v7/shared/api/migration_go_gen.cue | 11 + .../v7/shared/api/network_acl_go_gen.cue | 118 ++ .../shared/api/network_address_set_go_gen.cue | 67 + .../shared/api/network_allocation_go_gen.cue | 29 + .../v7/shared/api/network_forward_go_gen.cue | 86 ++ .../incus/v7/shared/api/network_go_gen.cue | 343 +++++ .../shared/api/network_integration_go_gen.cue | 70 + .../api/network_load_balancer_go_gen.cue | 132 ++ .../v7/shared/api/network_peer_go_gen.cue | 99 ++ .../v7/shared/api/network_zone_go_gen.cue | 120 ++ .../incus/v7/shared/api/operation_go_gen.cue | 68 + .../incus/v7/shared/api/profile_go_gen.cue | 67 + .../incus/v7/shared/api/project_go_gen.cue | 92 ++ .../incus/v7/shared/api/resource_go_gen.cue | 1209 +++++++++++++++++ .../incus/v7/shared/api/response_go_gen.cue | 53 + .../lxc/incus/v7/shared/api/server_go_gen.cue | 220 +++ .../v7/shared/api/status_code_go_gen.cue | 65 + .../api/storage_pool_bucket_backup_go_gen.cue | 56 + .../shared/api/storage_pool_bucket_go_gen.cue | 148 ++ .../v7/shared/api/storage_pool_go_gen.cue | 93 ++ .../api/storage_pool_volume_backup_go_gen.cue | 78 ++ .../api/storage_pool_volume_bitmap_go_gen.cue | 63 + .../shared/api/storage_pool_volume_go_gen.cue | 257 ++++ .../storage_pool_volume_snapshot_go_gen.cue | 91 ++ .../api/storage_pool_volume_state_go_gen.cue | 32 + .../lxc/incus/v7/shared/api/url_go_gen.cue | 10 + .../incus/v7/shared/api/warning_go_gen.cue | 67 + .../oidc/v3/pkg/oidc/authorization_go_gen.cue | 85 ++ .../v3/pkg/oidc/code_challenge_go_gen.cue | 19 + .../pkg/oidc/device_authorization_go_gen.cue | 26 + .../oidc/v3/pkg/oidc/discovery_go_gen.cue | 170 +++ .../zitadel/oidc/v3/pkg/oidc/error_go_gen.cue | 33 + .../oidc/v3/pkg/oidc/introspection_go_gen.cue | 21 + .../oidc/v3/pkg/oidc/jwt_profile_go_gen.cue | 11 + .../oidc/v3/pkg/oidc/keyset_go_gen.cue | 13 + .../oidc/v3/pkg/oidc/revocation_go_gen.cue | 10 + .../oidc/v3/pkg/oidc/session_go_gen.cue | 16 + .../zitadel/oidc/v3/pkg/oidc/token_go_gen.cue | 94 ++ .../oidc/v3/pkg/oidc/token_request_go_gen.cue | 102 ++ .../zitadel/oidc/v3/pkg/oidc/types_go_gen.cue | 51 + .../oidc/v3/pkg/oidc/userinfo_go_gen.cue | 51 + .../oidc/v3/pkg/oidc/verifier_go_gen.cue | 24 + .../golang.org/x/oauth2/deviceauth_go_gen.cue | 14 + .../gen/golang.org/x/oauth2/oauth2_go_gen.cue | 82 ++ .../gen/golang.org/x/oauth2/pkce_go_gen.cue | 9 + .../gen/golang.org/x/oauth2/token_go_gen.cue | 65 + .../golang.org/x/oauth2/transport_go_gen.cue | 21 + schemas/embed.go | 2 +- schemas/embed_test.go | 132 ++ schemas/go.mod | 26 +- schemas/go.sum | 55 +- schemas/providers/incusos/cue_types_gen.go | 32 + schemas/providers/incusos/schema.cue | 165 ++- 140 files changed, 11704 insertions(+), 73 deletions(-) create mode 100644 internal/providers/incusos/imagefile/doc.go create mode 100644 internal/providers/incusos/imagefile/injector.go create mode 100644 internal/providers/incusos/imagefile/injector_test.go create mode 100644 internal/providers/incusos/seed_builder.go create mode 100644 internal/providers/incusos/seed_builder_test.go create mode 100644 schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/artifacts_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/batch_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/certificate_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/duration_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/event_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/instance_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/instance_override_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/network_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/os_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/properties_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/queue_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/server_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/source_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/system_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/target_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/warning_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/windows_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/worker_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/FuturFusion/operations-center/shared/api/system/system_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/google/uuid/dce_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/google/uuid/doc_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/google/uuid/null_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/google/uuid/time_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/google/uuid/uuid_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/google/uuid/version7_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/application_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/application_incus_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/debug_tui_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/doc_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/seed/applications_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/seed/doc_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/seed/incus_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/seed/install_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/seed/migration_manager_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/seed/network_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/seed/operations_center_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/seed/provider_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/seed/update_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/service_ceph_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/service_iscsi_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/service_linstor_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/service_lvm_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/service_multipath_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/service_netbird_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/service_nvme_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/service_ovn_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/service_tailscale_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/service_usbip_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/system_kernel_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/system_logging_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/system_network_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/system_provider_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/system_reset_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/system_security_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/system_storage_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/system_update_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/weekday_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/access_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/auth_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/certificate_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/cluster_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/cluster_state_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/config_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/devices_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/doc_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/event_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/event_lifecycle_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/image_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/init_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/instance_backup_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/instance_console_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/instance_debug_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/instance_exec_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/instance_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/instance_snapshot_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/instance_state_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/metadata_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/migration_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/network_acl_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/network_address_set_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/network_allocation_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/network_forward_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/network_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/network_integration_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/network_load_balancer_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/network_peer_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/network_zone_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/operation_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/profile_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/project_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/resource_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/response_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/server_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/status_code_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/storage_pool_bucket_backup_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/storage_pool_bucket_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/storage_pool_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/storage_pool_volume_backup_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/storage_pool_volume_bitmap_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/storage_pool_volume_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/storage_pool_volume_snapshot_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/storage_pool_volume_state_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/url_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/warning_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/authorization_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/code_challenge_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/device_authorization_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/discovery_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/error_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/introspection_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/jwt_profile_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/keyset_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/revocation_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/session_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/token_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/token_request_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/types_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/userinfo_go_gen.cue create mode 100644 schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/verifier_go_gen.cue create mode 100644 schemas/cue.mod/gen/golang.org/x/oauth2/deviceauth_go_gen.cue create mode 100644 schemas/cue.mod/gen/golang.org/x/oauth2/oauth2_go_gen.cue create mode 100644 schemas/cue.mod/gen/golang.org/x/oauth2/pkce_go_gen.cue create mode 100644 schemas/cue.mod/gen/golang.org/x/oauth2/token_go_gen.cue create mode 100644 schemas/cue.mod/gen/golang.org/x/oauth2/transport_go_gen.cue diff --git a/go.mod b/go.mod index 1513855..71af776 100644 --- a/go.mod +++ b/go.mod @@ -1,21 +1,25 @@ module github.com/meigma/imgcli -go 1.26 +go 1.26.1 require ( charm.land/log/v2 v2.0.0 cuelang.org/go v0.16.1 github.com/charmbracelet/colorprofile v0.4.2 + github.com/lxc/incus-os/incus-osd v0.0.0-20260505023852-d32ba1f13f6f github.com/meigma/imgcli/schemas v0.0.0-20260504225557-fa97d8c3fe0c github.com/spf13/cobra v1.10.2 github.com/spf13/pflag v1.0.10 github.com/spf13/viper v1.21.0 github.com/stretchr/testify v1.11.1 + go.yaml.in/yaml/v4 v4.0.0-rc.4 ) require ( charm.land/lipgloss/v2 v2.0.1 // indirect cuelabs.dev/go/oci/ociregistry v0.0.0-20251212221603-3adeb8663819 // indirect + github.com/FuturFusion/migration-manager v0.6.9 // indirect + github.com/FuturFusion/operations-center v0.5.8 // indirect github.com/charmbracelet/ultraviolet v0.0.0-20251205161215-1948445e3318 // indirect github.com/charmbracelet/x/ansi v0.11.6 // indirect github.com/charmbracelet/x/term v0.2.2 // indirect @@ -24,38 +28,42 @@ require ( github.com/clipperhouse/displaywidth v0.11.0 // indirect github.com/clipperhouse/uax29/v2 v2.7.0 // indirect github.com/cockroachdb/apd/v3 v3.2.1 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/emicklei/proto v1.14.3 // indirect - github.com/fsnotify/fsnotify v1.9.0 // indirect + github.com/fsnotify/fsnotify v1.10.0 // indirect + github.com/go-jose/go-jose/v4 v4.1.4 // indirect github.com/go-logfmt/logfmt v0.6.0 // indirect - github.com/go-viper/mapstructure/v2 v2.4.0 // indirect + github.com/go-viper/mapstructure/v2 v2.5.0 // indirect github.com/google/uuid v1.6.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/lucasb-eyer/go-colorful v1.3.0 // indirect - github.com/mattn/go-runewidth v0.0.19 // indirect + github.com/lucasb-eyer/go-colorful v1.4.0 // indirect + github.com/lxc/incus/v7 v7.0.0 // indirect + github.com/mattn/go-runewidth v0.0.23 // indirect github.com/mitchellh/go-wordwrap v1.0.1 // indirect github.com/muesli/cancelreader v0.2.2 // indirect + github.com/muhlemmer/gu v0.3.1 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.1 // indirect - github.com/pelletier/go-toml/v2 v2.2.4 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/pelletier/go-toml/v2 v2.3.0 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/protocolbuffers/txtpbfmt v0.0.0-20260217160748-a481f6a22f94 // indirect github.com/rivo/uniseg v0.4.7 // indirect github.com/rogpeppe/go-internal v1.14.1 // indirect - github.com/sagikazarmark/locafero v0.11.0 // indirect - github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 // indirect + github.com/sagikazarmark/locafero v0.12.0 // indirect github.com/spf13/afero v1.15.0 // indirect github.com/spf13/cast v1.10.0 // indirect github.com/stretchr/objx v0.5.2 // indirect github.com/subosito/gotenv v1.6.0 // indirect github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect + github.com/zitadel/oidc/v3 v3.47.5 // indirect + github.com/zitadel/schema v1.3.2 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect - golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect - golang.org/x/net v0.52.0 // indirect + golang.org/x/exp v0.0.0-20260410095643-746e56fc9e2f // indirect + golang.org/x/net v0.53.0 // indirect golang.org/x/oauth2 v0.36.0 // indirect golang.org/x/sync v0.20.0 // indirect - golang.org/x/sys v0.42.0 // indirect - golang.org/x/text v0.35.0 // indirect - google.golang.org/protobuf v1.33.0 // indirect + golang.org/x/sys v0.43.0 // indirect + golang.org/x/text v0.36.0 // indirect + google.golang.org/protobuf v1.36.11 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 824e342..7fd3c53 100644 --- a/go.sum +++ b/go.sum @@ -6,6 +6,10 @@ cuelabs.dev/go/oci/ociregistry v0.0.0-20251212221603-3adeb8663819 h1:Zh+Ur3OsoWp cuelabs.dev/go/oci/ociregistry v0.0.0-20251212221603-3adeb8663819/go.mod h1:WjmQxb+W6nVNCgj8nXrF24lIz95AHwnSl36tpjDZSU8= cuelang.org/go v0.16.1 h1:iPN1lHZd2J0hjcr8hfq9PnIGk7VfPkKFfxH4de+m9sE= cuelang.org/go v0.16.1/go.mod h1:/aW3967FeWC5Hc1cDrN4Z4ICVApdMi83wO5L3uF/1hM= +github.com/FuturFusion/migration-manager v0.6.9 h1:qf/EtxaasNhSNgM2yv6R53h4yJbA7Gd/Pjlvc3s642A= +github.com/FuturFusion/migration-manager v0.6.9/go.mod h1:Si7dBSilhF7FIbaYMG+V804C0ESIm7t6pF2x8es3IOk= +github.com/FuturFusion/operations-center v0.5.8 h1:Wf5B3ULMzSqju1u7wVgZbyJWHGd/QYOjNygr//hvPto= +github.com/FuturFusion/operations-center v0.5.8/go.mod h1:jmh2YszsUl3Mi5pyZnzndZZykImGJEUgtK+dzAiFFos= github.com/charmbracelet/colorprofile v0.4.2 h1:BdSNuMjRbotnxHSfxy+PCSa4xAmz7szw70ktAtWRYrY= github.com/charmbracelet/colorprofile v0.4.2/go.mod h1:0rTi81QpwDElInthtrQ6Ni7cG0sDtwAd4C4le060fT8= github.com/charmbracelet/ultraviolet v0.0.0-20251205161215-1948445e3318 h1:OqDqxQZliC7C8adA7KjelW3OjtAxREfeHkNcd66wpeI= @@ -25,20 +29,22 @@ github.com/clipperhouse/uax29/v2 v2.7.0/go.mod h1:EFJ2TJMRUaplDxHKj1qAEhCtQPW2tJ github.com/cockroachdb/apd/v3 v3.2.1 h1:U+8j7t0axsIgvQUqthuNm82HIrYXodOV2iWLWtEaIwg= github.com/cockroachdb/apd/v3 v3.2.1/go.mod h1:klXJcjp+FffLTHlhIG69tezTDvdP065naDsHzKhYSqc= github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/emicklei/proto v1.14.3 h1:zEhlzNkpP8kN6utonKMzlPfIvy82t5Kb9mufaJxSe1Q= github.com/emicklei/proto v1.14.3/go.mod h1:rn1FgRS/FANiZdD2djyH7TMA9jdRDcYQ9IEN9yvjX0A= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= -github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k= -github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= +github.com/fsnotify/fsnotify v1.10.0 h1:Xx/5Ydg9CeBDX/wi4VJqStNtohYjitZhhlHt4h3St1M= +github.com/fsnotify/fsnotify v1.10.0/go.mod h1:TLheqan6HD6GBK6PrDWyDPBaEV8LspOxvPSjC+bVfgo= +github.com/go-jose/go-jose/v4 v4.1.4 h1:moDMcTHmvE6Groj34emNPLs/qtYXRVcd6S7NHbHz3kA= +github.com/go-jose/go-jose/v4 v4.1.4/go.mod h1:x4oUasVrzR7071A4TnHLGSPpNOm2a21K9Kf04k1rs08= github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-quicktest/qt v1.101.0 h1:O1K29Txy5P2OK0dGo59b7b0LR6wKfIhttaAhHUyn7eI= github.com/go-quicktest/qt v1.101.0/go.mod h1:14Bz/f7NwaXPtdYEgzsx46kqSxVwTbzVZsDC26tQJow= -github.com/go-viper/mapstructure/v2 v2.4.0 h1:EBsztssimR/CONLSZZ04E8qAkxNYq4Qp9LvH92wZUgs= -github.com/go-viper/mapstructure/v2 v2.4.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/go-viper/mapstructure/v2 v2.5.0 h1:vM5IJoUAy3d7zRSVtIwQgBj7BiWtMPfmPEgAXnvj1Ro= +github.com/go-viper/mapstructure/v2 v2.5.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= @@ -53,24 +59,30 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0 github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/lucasb-eyer/go-colorful v1.3.0 h1:2/yBRLdWBZKrf7gB40FoiKfAWYQ0lqNcbuQwVHXptag= -github.com/lucasb-eyer/go-colorful v1.3.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= -github.com/mattn/go-runewidth v0.0.19 h1:v++JhqYnZuu5jSKrk9RbgF5v4CGUjqRfBm05byFGLdw= -github.com/mattn/go-runewidth v0.0.19/go.mod h1:XBkDxAl56ILZc9knddidhrOlY5R/pDhgLpndooCuJAs= +github.com/lucasb-eyer/go-colorful v1.4.0 h1:UtrWVfLdarDgc44HcS7pYloGHJUjHV/4FwW4TvVgFr4= +github.com/lucasb-eyer/go-colorful v1.4.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= +github.com/lxc/incus-os/incus-osd v0.0.0-20260505023852-d32ba1f13f6f h1:2wNTDCa/sf8xUOjfDHglPUpj5W4UncvuGKH3w6w/QSU= +github.com/lxc/incus-os/incus-osd v0.0.0-20260505023852-d32ba1f13f6f/go.mod h1:0/gjLA2CMoYq0N93elIlQ6+tBMwtBtE8Rr2BWgQRB/c= +github.com/lxc/incus/v7 v7.0.0 h1:xLz1Q1Xk+yCNL148MFBOSWWrzJVOS1N6PcS0zd8usSc= +github.com/lxc/incus/v7 v7.0.0/go.mod h1:Dxu4id/fVr+OmFPQt9tU3fu4E8LhW89NeFxCtjPLCdo= +github.com/mattn/go-runewidth v0.0.23 h1:7ykA0T0jkPpzSvMS5i9uoNn2Xy3R383f9HDx3RybWcw= +github.com/mattn/go-runewidth v0.0.23/go.mod h1:XBkDxAl56ILZc9knddidhrOlY5R/pDhgLpndooCuJAs= github.com/meigma/imgcli/schemas v0.0.0-20260504225557-fa97d8c3fe0c h1:Uhz9SD1P/JEqDCuAxDL7AKbevYy2CTUP4i+OgFEwkdc= github.com/meigma/imgcli/schemas v0.0.0-20260504225557-fa97d8c3fe0c/go.mod h1:d5JPNaAIyFEh8Evcgqi4ng1hW6K+BLQNIpbiz4XfX/M= github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= github.com/muesli/cancelreader v0.2.2 h1:3I4Kt4BQjOR54NavqnDogx/MIoWBFa0StPA8ELUXHmA= github.com/muesli/cancelreader v0.2.2/go.mod h1:3XuTXfFS2VjM+HTLZY9Ak0l6eUKfijIfMUZ4EgX0QYo= +github.com/muhlemmer/gu v0.3.1 h1:7EAqmFrW7n3hETvuAdmFmn4hS8W+z3LgKtrnow+YzNM= +github.com/muhlemmer/gu v0.3.1/go.mod h1:YHtHR+gxM+bKEIIs7Hmi9sPT3ZDUvTN/i88wQpZkrdM= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.1 h1:y0fUlFfIZhPF1W537XOLg0/fcx6zcHCJwooC2xJA040= github.com/opencontainers/image-spec v1.1.1/go.mod h1:qpqAh3Dmcf36wStyyWU+kCeDgrGnAve2nCC8+7h8Q0M= -github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4= -github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pelletier/go-toml/v2 v2.3.0 h1:k59bC/lIZREW0/iVaQR8nDHxVq8OVlIzYCOJf421CaM= +github.com/pelletier/go-toml/v2 v2.3.0/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/protocolbuffers/txtpbfmt v0.0.0-20260217160748-a481f6a22f94 h1:2PC6Ql3jipz1KvBlqUHjjk6v4aMwE86mfDu1XMH0LR8= github.com/protocolbuffers/txtpbfmt v0.0.0-20260217160748-a481f6a22f94/go.mod h1:JSbkp0BviKovYYt9XunS95M3mLPibE9bGg+Y95DsEEY= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= @@ -78,10 +90,8 @@ github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUc github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/sagikazarmark/locafero v0.11.0 h1:1iurJgmM9G3PA/I+wWYIOw/5SyBtxapeHDcg+AAIFXc= -github.com/sagikazarmark/locafero v0.11.0/go.mod h1:nVIGvgyzw595SUSUE6tvCp3YYTeHs15MvlmU87WwIik= -github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 h1:+jumHNA0Wrelhe64i8F6HNlS8pkoyMv5sreGx2Ry5Rw= -github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8/go.mod h1:3n1Cwaq1E1/1lhQhtRK2ts/ZwZEhjcQeJQ1RuC6Q/8U= +github.com/sagikazarmark/locafero v0.12.0 h1:/NQhBAkUb4+fH1jivKHWusDYFjMOOKU88eegjfxfHb4= +github.com/sagikazarmark/locafero v0.12.0/go.mod h1:sZh36u/YSZ918v0Io+U9ogLYQJ9tLLBmM4eneO6WwsI= github.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I= github.com/spf13/afero v1.15.0/go.mod h1:NC2ByUVxtQs4b3sIUphxK0NioZnmxgyCrfzeuq8lxMg= github.com/spf13/cast v1.10.0 h1:h2x0u2shc1QuLHfxi+cTJvs30+ZAHOGRic8uyGTDWxY= @@ -101,26 +111,32 @@ github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8 github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no= github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM= +github.com/zitadel/oidc/v3 v3.47.5 h1:cR2z0oqa5XZkwpXQiPCUGqKtndrjHgEXb81y3oXocK4= +github.com/zitadel/oidc/v3 v3.47.5/go.mod h1:XxFh0666HRXycyrKmono+3gY0RACpYJLgy4r/+kliKY= +github.com/zitadel/schema v1.3.2 h1:gfJvt7dOMfTmxzhscZ9KkapKo3Nei3B6cAxjav+lyjI= +github.com/zitadel/schema v1.3.2/go.mod h1:IZmdfF9Wu62Zu6tJJTH3UsArevs3Y4smfJIj3L8fzxw= go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= -golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI= -golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo= -golang.org/x/mod v0.34.0 h1:xIHgNUUnW6sYkcM5Jleh05DvLOtwc6RitGHbDk4akRI= -golang.org/x/mod v0.34.0/go.mod h1:ykgH52iCZe79kzLLMhyCUzhMci+nQj+0XkbXpNYtVjY= -golang.org/x/net v0.52.0 h1:He/TN1l0e4mmR3QqHMT2Xab3Aj3L9qjbhRm78/6jrW0= -golang.org/x/net v0.52.0/go.mod h1:R1MAz7uMZxVMualyPXb+VaqGSa3LIaUqk0eEt3w36Sw= +go.yaml.in/yaml/v4 v4.0.0-rc.4 h1:UP4+v6fFrBIb1l934bDl//mmnoIZEDK0idg1+AIvX5U= +go.yaml.in/yaml/v4 v4.0.0-rc.4/go.mod h1:aZqd9kCMsGL7AuUv/m/PvWLdg5sjJsZ4oHDEnfPPfY0= +golang.org/x/exp v0.0.0-20260410095643-746e56fc9e2f h1:W3F4c+6OLc6H2lb//N1q4WpJkhzJCK5J6kUi1NTVXfM= +golang.org/x/exp v0.0.0-20260410095643-746e56fc9e2f/go.mod h1:J1xhfL/vlindoeF/aINzNzt2Bket5bjo9sdOYzOsU80= +golang.org/x/mod v0.35.0 h1:Ww1D637e6Pg+Zb2KrWfHQUnH2dQRLBQyAtpr/haaJeM= +golang.org/x/mod v0.35.0/go.mod h1:+GwiRhIInF8wPm+4AoT6L0FA1QWAad3OMdTRx4tFYlU= +golang.org/x/net v0.53.0 h1:d+qAbo5L0orcWAr0a9JweQpjXF19LMXJE8Ey7hwOdUA= +golang.org/x/net v0.53.0/go.mod h1:JvMuJH7rrdiCfbeHoo3fCQU24Lf5JJwT9W3sJFulfgs= golang.org/x/oauth2 v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs= golang.org/x/oauth2 v0.36.0/go.mod h1:YDBUJMTkDnJS+A4BP4eZBjCqtokkg1hODuPjwiGPO7Q= golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4= golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= -golang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo= -golang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= -golang.org/x/text v0.35.0 h1:JOVx6vVDFokkpaq1AEptVzLTpDe9KGpj5tR4/X+ybL8= -golang.org/x/text v0.35.0/go.mod h1:khi/HExzZJ2pGnjenulevKNX1W67CUy0AsXcNubPGCA= -golang.org/x/tools v0.43.0 h1:12BdW9CeB3Z+J/I/wj34VMl8X+fEXBxVR90JeMX5E7s= -golang.org/x/tools v0.43.0/go.mod h1:uHkMso649BX2cZK6+RpuIPXS3ho2hZo4FVwfoy1vIk0= -google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= -google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +golang.org/x/sys v0.43.0 h1:Rlag2XtaFTxp19wS8MXlJwTvoh8ArU6ezoyFsMyCTNI= +golang.org/x/sys v0.43.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/text v0.36.0 h1:JfKh3XmcRPqZPKevfXVpI1wXPTqbkE5f7JA92a55Yxg= +golang.org/x/text v0.36.0/go.mod h1:NIdBknypM8iqVmPiuco0Dh6P5Jcdk8lJL0CUebqK164= +golang.org/x/tools v0.44.0 h1:UP4ajHPIcuMjT1GqzDWRlalUEoY+uzoZKnhOjbIPD2c= +golang.org/x/tools v0.44.0/go.mod h1:KA0AfVErSdxRZIsOVipbv3rQhVXTnlU6UhKxHd1seDI= +google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= +google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/go.work b/go.work index fef81f0..491cbc6 100644 --- a/go.work +++ b/go.work @@ -1,4 +1,4 @@ -go 1.26 +go 1.26.1 use ( . diff --git a/go.work.sum b/go.work.sum index 4d67ebf..cd764bf 100644 --- a/go.work.sum +++ b/go.work.sum @@ -1,15 +1,305 @@ +cel.dev/expr v0.25.1/go.mod h1:hrXvqGP6G6gyx8UAHSHJ5RGk//1Oj5nXQ2NI02Nrsg4= cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= +dario.cat/mergo v1.0.2/go.mod h1:E/hbnu0NxMFBjpMIE34DRGLWqDy0g5FuKDhCb31ngxA= +filippo.io/edwards25519 v1.2.0/go.mod h1:xzAOLCNug/yB62zG1bQ8uziwrIqIuxhctzJT18Q77mc= +github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8= +github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= +github.com/FuturFusion/vsock v0.0.0-20260219213046-d78a7104f821/go.mod h1:0atKpUm0hXZMv6+9Kf5crGqV9KKtvkPAElG7/9CCFwU= +github.com/LINBIT/golinstor v0.60.0/go.mod h1:TXAMGiskT4fY/koTCOt6qqF60uWobDqUHoB8srNeCnY= +github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= +github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= +github.com/Masterminds/sprig/v3 v3.3.0/go.mod h1:Zy1iXRYNqNLUolqCpL4uhk6SHUMAOSCzdgBfDb35Lz0= +github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= +github.com/Rican7/retry v0.3.1/go.mod h1:CxSDrhAyXmTMeEuRAnArMu1FHu48vtfjLREWqVl7Vw0= +github.com/Yiling-J/theine-go v0.6.2/go.mod h1:08QpMa5JZ2pKN+UJCRrCasWYO1IKCdl54Xa836rpmDU= +github.com/adhocore/gronx v1.19.6/go.mod h1:7oUY1WAU8rEJWmAxXR2DN0JaO4gi9khSgKjiRypqteg= +github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= +github.com/antlr4-go/antlr/v4 v4.13.1/go.mod h1:GKmUxMtwp6ZgGwZSva4eWPC5mS6vUAmOABFgjdkM7Nw= +github.com/apex/log v1.9.0/go.mod h1:m82fZlWIuiWzWP04XCTXmnX0xRkYYbCdYn8jbJeLBEA= +github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmmsvpAG721bKi0joRfFdHIWJ4= +github.com/aws/aws-sdk-go-v2 v1.41.7/go.mod h1:4LAfZOPHNVNQEckOACQx60Y8pSRjIkNZQz1w92xpMJc= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.10/go.mod h1:qqY157uZoqm5OXq/amuaBJyC9hgBCBQnsaWnPe905GY= +github.com/aws/aws-sdk-go-v2/credentials v1.19.16/go.mod h1:6cx7zqDENJDbBIIWX6P8s0h6hqHC8Avbjh9Dseo27ug= +github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.1.20/go.mod h1:hHSAgymEQbdCmEDXvNxhXiKJxJOWRJi84Gp34anL858= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.23/go.mod h1:xYWD6BS9ywC5bS3sz9Xh04whO/hzK2plt2Zkyrp4JuA= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.23/go.mod h1:15DfR2nw+CRHIk0tqNyifu3G1YdAOy68RftkhMDDwYk= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.24/go.mod h1:X5ZJyfwVrWA96GzPmUCWFQaEARPR7gCrpq2E92PJwAE= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.9/go.mod h1:w7wZ/s9qK7c8g4al+UyoF1Sp/Z45UwMGcqIzLWVQHWk= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.9.15/go.mod h1:e3IzZvQ3kAWNykvE0Tr0RDZCMFInMvhku3qNpcIQXhM= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.23/go.mod h1:/CMNUqoj46HpS3MNRDEDIwcgEnrtZlKRaHNaHxIFpNA= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.23/go.mod h1:M8l3mwgx5ToK7wot2sBBce/ojzgnPzZXUV445gTSyE8= +github.com/aws/aws-sdk-go-v2/service/s3 v1.100.1/go.mod h1:L2dcoOgS2VSgbPLvpak2NyUPsO1TBN7M45Z4H7DlRc4= +github.com/aws/smithy-go v1.25.1/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc= github.com/aymanbagabas/go-udiff v0.4.1/go.mod h1:0L9PGwj20lrtmEMeyw4WKJ/TMyDtvAoK9bf2u/mNo3w= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bits-and-blooms/bitset v1.24.4/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= +github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= +github.com/bmatcuk/doublestar/v4 v4.10.0/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= +github.com/breml/newline-after-block v0.0.0-20251225141726-84337171eef7/go.mod h1:zM/p1tEc+HETWeCNzspi+2C5H0D8I7dDClAtmt/fWBA= +github.com/brianvoe/gofakeit/v7 v7.14.0/go.mod h1:QXuPeBw164PJCzCUZVmgpgHJ3Llj49jSLVkKPMtxtxA= +github.com/brunoga/deep v1.3.1/go.mod h1:GDV6dnXqn80ezsLSZ5Wlv1PdKAWAO4L5PnKYtv2dgaI= +github.com/cavaliergopher/cpio v1.0.1/go.mod h1:pBdaqQjnvXxdS/6CvNDwIANIFSP0xRKI16PX4xejRQc= +github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= +github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw= +github.com/cenkalti/hub v1.0.2/go.mod h1:8LAFAZcCasb83vfxatMUnZHRoQcffho2ELpHb+kaTJU= +github.com/cenkalti/rpc2 v1.0.5/go.mod h1:2yfU5b86vOr16+iY1jN3MvT6Kxc9Nf8j5iZWwUf7iaw= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/charmbracelet/x/exp/golden v0.0.0-20250806222409-83e3a29d542f/go.mod h1:IfZAMTHB6XkZSeXUqriemErjAWCCzT0LwjKFYCZyw0I= +github.com/checkpoint-restore/go-criu/v8 v8.2.0/go.mod h1:HVKJ1dK+bowJcFI1MtdL2ECIuY+/AtRMHzD9Lqa4uA4= github.com/clipperhouse/stringish v0.1.1/go.mod h1:v/WhFtE1q0ovMta2+m+UbpZ+2/HEXNWYXQgCt4hdOzA= +github.com/clipperhouse/uax29/v2 v2.2.0/go.mod h1:EFJ2TJMRUaplDxHKj1qAEhCtQPW2tJSwu5BF98AuoVM= +github.com/containerd/errdefs v1.0.0/go.mod h1:+YBYIdtsnF4Iw6nWZhJcqGSg/dwvV7tyJ/kCkyJ2k+M= +github.com/containerd/errdefs/pkg v0.3.0/go.mod h1:NJw6s9HwNuRhnjJhM7pylWwMyAkmCQvQ4GpJHEqRLVk= +github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= +github.com/containerd/platforms v1.0.0-rc.4/go.mod h1:lKlMXyLybmBedS/JJm11uDofzI8L2v0J2ZbYvNsbq1A= +github.com/cowsql/go-cowsql v1.22.0/go.mod h1:+QzPcM7QRPIBI8XhsKJ47iUtxGY53lsYGX51G1WQ/4s= +github.com/cpuguy83/dockercfg v0.3.2/go.mod h1:sugsbF4//dDlL/i+S+rtpIWp+5h0BHJHfjj5/jFyUJc= +github.com/cpuguy83/go-md2man/v2 v2.0.7/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= +github.com/cyphar/filepath-securejoin v0.6.1/go.mod h1:A8hd4EnAeyujCJRrICiOWqjS1AX0a9kM5XL+NwKoYSc= +github.com/dgryski/go-farm v0.0.0-20240924180020-3414d57e47da/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= +github.com/digitalocean/go-smbios v0.0.0-20180907143718-390a4f403a8e/go.mod h1:YTIHhz/QFSYnu/EhlF2SpU2Uk+32abacUYA5ZPljz1A= +github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= +github.com/docker/docker v28.5.2+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/go-connections v0.6.0/go.mod h1:AahvXYshr6JgfUJGdDCs2b5EZG/vmaMAntpSFH5BFKE= +github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/donovanhide/eventsource v0.0.0-20210830082556-c59027999da0/go.mod h1:56wL82FO0bfMU5RvfXoIwSOP2ggqqxT+tAfNEIyxuHw= +github.com/dsnet/golib/memfile v1.0.0/go.mod h1:tXGNW9q3RwvWt1VV2qrRKlSSz0npnh12yftCSCy2T64= +github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= +github.com/dustinkirkland/golang-petname v0.0.0-20260215035315-f0c533e9ce9b/go.mod h1:8AuBTZBRSFqEYBPYULd+NN474/zZBLP+6WeT5S9xlAc= +github.com/eapache/channels v1.1.0/go.mod h1:jMm2qB5Ubtg9zLd+inMZd2/NUvXgzmWXsDaLyQIGfH0= +github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= +github.com/ebitengine/purego v0.10.0/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= +github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= +github.com/envoyproxy/protoc-gen-validate v1.3.0/go.mod h1:HvYl7zwPa5mffgyeTUHA9zHIH36nmrm7oCbo4YKoSWA= +github.com/expr-lang/expr v1.17.8/go.mod h1:8/vRC7+7HBzESEqt5kKpYXxrxkr31SaO8r40VO/1IT4= +github.com/fabien-marty/slog-helpers v0.0.0-20240624063600-773d61849b89/go.mod h1:2V/BsRxp1nJU5awq+f92qcG45r932QPSJniELs4uJ5s= +github.com/fabien-marty/tracerr v0.0.0-20240624051446-7f090eca46ee/go.mod h1:eqKGnFoVPY3Ng/iRRYfMxOum60YwQh7ZzYILKbYI7UY= +github.com/fatih/color v1.19.0/go.mod h1:zNk67I0ZUT1bEGsSGyCZYZNrHuTkJJB+r6Q9VuMi0LE= +github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= +github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/flosch/pongo2/v4 v4.0.2/go.mod h1:B5ObFANs/36VwxxlgKpdchIJHMvHB562PW+BWPhwZD8= +github.com/flosch/pongo2/v6 v6.0.0/go.mod h1:CuDpFm47R0uGGE7z13/tTlt1Y6zdxvr2RLT5LJhsHEU= +github.com/foxboron/go-uefi v0.0.0-20251010190908-d29549a44f29/go.mod h1:sqQZKX1X86EAN4C07n6DcbGC/DCN36BNaX/uNvjzmfk= +github.com/fvbommel/sortorder v1.1.0/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui720w+kxuqRs0= +github.com/fxamacker/cbor/v2 v2.9.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ= +github.com/gabriel-vasile/mimetype v1.4.13/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s= +github.com/gaissmai/bart v0.26.1/go.mod h1:GREWQfTLRWz/c5FTOsIw+KkscuFkIV5t8Rp7Nd1Td5c= +github.com/gdamore/encoding v1.0.1/go.mod h1:0Z0cMFinngz9kS1QfMjCP8TY7em3bZYeeklsSDPivEo= +github.com/gdamore/tcell/v2 v2.13.9/go.mod h1:+Wfe208WDdB7INEtCsNrAN6O2m+wsTPk1RAovjaILlo= +github.com/go-chi/chi/v5 v5.2.5/go.mod h1:X7Gx4mteadT3eDOMTsXzmI4/rwUpOwBHLpAfupzFJP0= +github.com/go-co-op/gocron/v2 v2.21.1/go.mod h1:5lEiCKk1oVJV39Zg7/YG10OnaVrDAV5GGR6O0663k6U= +github.com/go-jose/go-jose/v3 v3.0.4/go.mod h1:5b+7YgP7ZICgJDBdfjZaIt+H/9L9T/YQrVfLAMboGkQ= +github.com/go-json-experiment/json v0.0.0-20250813024750-ebf49471dced/go.mod h1:TiCD2a1pcmjd7YnhGH0f/zKNcCD06B029pHhzV23c2M= +github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= +github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= +github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= +github.com/go-playground/validator/v10 v10.30.2/go.mod h1:mAf2pIOVXjTEBrwUMGKkCWKKPs9NheYGabeB04txQSc= +github.com/gocarina/gocsv v0.0.0-20240520201108-78e41c74b4b1/go.mod h1:5YoVOkjYAQumqlV356Hj3xeYh4BdZuLE0/nRkf2NKkI= +github.com/goccy/go-json v0.10.6/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= +github.com/golang-jwt/jwt/v5 v5.3.1/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE= github.com/golang/glog v1.2.4/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= +github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/google/cel-go v0.27.0/go.mod h1:tTJ11FWqnhw5KKpnWpvW9CJC3Y9GK4EIS0WXnBbebzw= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-eventlog v0.0.3-0.20250422210130-7c3cc8ffe6c4/go.mod h1:7huE5P8w2NTObSwSJjboHmB7ioBNblkijdzoVa2skfQ= +github.com/google/go-github/v31 v31.0.0/go.mod h1:NQPZol8/1sMoWYGN2yaALIBytu17gAWfhbweiEed3pM= +github.com/google/go-github/v84 v84.0.0/go.mod h1:WwYL1z1ajRdlaPszjVu/47x1L0PXukJBn73xsiYrRRQ= +github.com/google/go-querystring v1.2.0/go.mod h1:8IFJqpSRITyJ8QhQ13bmbeMBDfmeEJZD5A0egEOmkqU= +github.com/google/go-tpm v0.9.8/go.mod h1:h9jEsEECg7gtLis0upRBQU+GhYVH6jMjrFxI8u6bVUY= +github.com/google/gopacket v1.1.19/go.mod h1:iJ8V8n6KS+z2U1A8pUwu8bW5SyEMkXJB8Yo/Vo+TKTo= +github.com/google/renameio v1.0.1/go.mod h1:t/HQoYBZSsWSNK35C6CO/TpPLDVWvxOHboWUAweKUpk= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= +github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= +github.com/gorilla/securecookie v1.1.2/go.mod h1:NfCASbcHqRSY+3a8tlWJwsQap2VX5pwzwo4h3eOamfo= +github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674/go.mod h1:r4w70xmWCQKmi1ONH4KIaBptdivuRPyosB9RmPlGEwA= +github.com/gosexy/gettext v0.0.0-20160830220431-74466a0a0c4a/go.mod h1:IEJaV4/6J0VpoQ33kFCUUP6umRjrcBVEbOva6XCub/Q= +github.com/gosimple/slug v1.15.0/go.mod h1:UiRaFH+GEilHstLUmcBgWcI42viBN7mAb818JrYOeFQ= +github.com/gosimple/unidecode v1.0.1/go.mod h1:CP0Cr1Y1kogOtx0bJblKzsVWrqYaqfNOnHzpgWw4Awc= +github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8= +github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.3/go.mod h1:NbCUVmiS4foBGBHOYlCT25+YmGpJ32dZPi75pGEUpj4= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.8/go.mod h1:mi7YA+gCzVem12exXy46ZespvGtX/lZmD/RLnQhVW7U= +github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= +github.com/hashicorp/hcl/v2 v2.24.0/go.mod h1:oGoO1FIQYfn/AgyOhlg9qLC6/nOJPX3qGbkZpYAcqfM= +github.com/hdevalence/ed25519consensus v0.2.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= +github.com/hexdigest/gowrap v1.4.1/go.mod h1:s+1hE6qakgdaaLqgdwPAj5qKYVBCSbPJhEbx+I1ef/Q= +github.com/huandu/xstrings v1.5.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= +github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/insomniacslk/dhcp v0.0.0-20260407060928-11b94ed970f2/go.mod h1:qfvBmyDNp+/liLEYWRvqny/PEz9hGe2Dz833eXILSmo= +github.com/jaypipes/pcidb v1.1.1/go.mod h1:x27LT2krrUgjf875KxQXKB0Ha/YXLdZRVmw6hH0G7g8= +github.com/jedib0t/go-pretty/v6 v6.7.8/go.mod h1:YwC5CE4fJ1HFUDeivSV1r//AmANFHyqczZk+U6BDALU= +github.com/jeremija/gosubmit v0.2.8/go.mod h1:Ui+HS073lCFREXBbdfrJzMB57OI/bdxTiLtrDHHhFPI= +github.com/jkeiser/iter v0.0.0-20200628201005-c8aa0ae784d1/go.mod h1:fP/NdyhRVOv09PLRbVXrSqHhrfQypdZwgE2L4h2U5C8= +github.com/jochenvg/go-udev v0.0.0-20240801134859-b65ed646224b/go.mod h1:IBDUGq30U56w969YNPomhMbRje1GrhUsCh7tHdwgLXA= +github.com/jonboulle/clockwork v0.5.0/go.mod h1:3mZlmanh0g2NDKO5TWZVJAfofYk64M7XN3SzBPjZF60= +github.com/josharian/native v1.1.0/go.mod h1:7X/raswPFr05uY3HiLlYeyQntB6OO7E/d2Cu7qoaN2w= +github.com/k-sone/critbitgo v1.4.0/go.mod h1:7E6pyoyADnFxlUBEKcnfS49b7SUAQGMK+OAp/UQvo0s= +github.com/k0kubun/go-ansi v0.0.0-20180517002512-3bf9e2903213/go.mod h1:vNUNkEQ1e29fT/6vq2aBdFsgNPmy8qMdSay1npru+Sw= +github.com/karlseguin/ccache/v3 v3.0.6/go.mod h1:b0qfdUOHl4vJgKFQN41paXIdBb3acAtyX2uWrBAZs1w= +github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= +github.com/klauspost/compress v1.18.6/go.mod h1:cwPg85FWrGar70rWktvGQj8/hthj3wpl0PGDogxkrSQ= +github.com/klauspost/cpuid/v2 v2.3.0/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0= +github.com/klauspost/pgzip v1.2.6/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= +github.com/knadh/koanf/maps v0.1.2/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= +github.com/knadh/koanf/parsers/yaml v1.1.0/go.mod h1:HHmcHXUrp9cOPcuC+2wrr44GTUB0EC+PyfN3HZD9tFg= +github.com/knadh/koanf/providers/env v1.1.0/go.mod h1:QhHHHZ87h9JxJAn2czdEl6pdkNnDh/JS1Vtsyt65hTY= +github.com/knadh/koanf/providers/file v1.2.1/go.mod h1:bp1PM5f83Q+TOUu10J/0ApLBd9uIzg+n9UgthfY+nRA= +github.com/knadh/koanf/providers/posflag v1.0.1/go.mod h1:3Wn3+YG3f4ljzRyCUgIwH7G0sZ1pMjCOsNBovrbKmAk= +github.com/knadh/koanf/providers/structs v1.0.0/go.mod h1:kjo5TFtgpaZORlpoJqcbeLowM2cINodv8kX+oFAeQ1w= +github.com/knadh/koanf/v2 v2.3.2/go.mod h1:gRb40VRAbd4iJMYYD5IxZ6hfuopFcXBpc9bbQpZwo28= +github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= +github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI= +github.com/lmittmann/tint v1.1.3/go.mod h1:HIS3gSy7qNwGCj+5oRjAutErFBl4BzdQP6cJZ0NfMwE= +github.com/lufia/plan9stats v0.0.0-20260330125221-c963978e514e/go.mod h1:autxFIvghDt3jPTLoqZ9OZ7s9qTGNAWmYCjVFWPX/zg= +github.com/lxc/distrobuilder/v3 v3.3.2-0.20260410004922-5828176a7f61/go.mod h1:ZcIe6WsvX5vt7cdzu7a5tqRi8v6DX1+9+EmsREbW7L4= +github.com/lxc/go-lxc v0.0.0-20260316180011-3af4ce000ed7/go.mod h1:3UTWXVcHfgxE7JM4ZUnsy6bDA8L1vuzwJbJRF6dlB90= +github.com/lxc/incus/v6 v6.23.1-0.20260327174201-6acde8bd711a/go.mod h1:efEbxmSexfg8VyYQnBgNQz0dZZLci3s90xcU+VXoCYc= +github.com/magiconair/properties v1.8.10/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= +github.com/maniartech/signals v1.3.1/go.mod h1:AbE8Yy9ZjKCWNU/VhQ+0Ea9KOaTWHp6aOfdLBe5m1iM= +github.com/matryer/moq v0.4.0/go.mod h1:kUfalaLk7TcyXhrhonBYQ2Ewun63+/xGbZ7/MzzzC4Y= +github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8= +github.com/mattn/go-isatty v0.0.22/go.mod h1:ZXfXG4SQHsB/w3ZeOYbR0PrPwLy+n6xiMrJlRFqopa4= +github.com/mattn/go-shellwords v1.0.12/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y= +github.com/mattn/go-sqlite3 v1.14.44/go.mod h1:pjEuOr8IwzLJP2MfGeTb0A35jauH+C2kbHKBr7yXKVQ= +github.com/mdlayher/arp v0.0.0-20220512170110-6706a2966875/go.mod h1:kfOoFJuHWp76v1RgZCb9/gVUc7XdY877S2uVYbNliGc= +github.com/mdlayher/ethernet v0.0.0-20220221185849-529eae5b6118/go.mod h1:ZFUnHIVchZ9lJoWoEGUg8Q3M4U8aNNWA3CVSUTkW4og= +github.com/mdlayher/ndp v1.1.0/go.mod h1:FmgESgemgjl38vuOIyAHWUUL6vQKA/pQNkvXdWsdQFM= +github.com/mdlayher/netx v0.0.0-20230430222610-7e21880baee8/go.mod h1:qhZhwMDNWwZglKfwuWm0U9pCr/YKX1QAEwwJk9qfiTQ= +github.com/mdlayher/packet v1.1.2/go.mod h1:GEu1+n9sG5VtiRE4SydOmX5GTwyyYlteZiFU+x0kew4= +github.com/mdlayher/socket v0.6.0/go.mod h1:q7vozUAnxSqnjHc12Fik5yUKIzfZ8ITCfMkhOtE9z18= +github.com/mdlayher/vsock v1.2.1/go.mod h1:NRfCibel++DgeMD8z/hP+PPTjlNJsdPOmxcnENvE+SE= +github.com/miekg/dns v1.1.72/go.mod h1:+EuEPhdHOsfk6Wk5TT2CzssZdqkmFhf8r+aVyDEToIs= +github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db/go.mod h1:l0dey0ia/Uv7NcFFVbCLtqEBQbrT4OCwCSKTEv6enCw= +github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo= +github.com/moby/go-archive v0.2.0/go.mod h1:mNeivT14o8xU+5q1YnNrkQVpK+dnNe/K6fHqnTg4qPU= +github.com/moby/patternmatcher v0.6.0/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc= +github.com/moby/sys/sequential v0.6.0/go.mod h1:uyv8EUTrca5PnDsdMGXhZe6CCe8U/UiTWd+lL+7b/Ko= +github.com/moby/sys/user v0.4.0/go.mod h1:bG+tYYYJgaMtRKgEmuueC0hJEAZWwtIbZTB+85uoHjs= +github.com/moby/sys/userns v0.1.0/go.mod h1:IHUYgu/kao6N8YZlp9Cf444ySSvCmDlmzUcYfDHOl28= +github.com/moby/term v0.5.2/go.mod h1:d3djjFCrjnB+fl8NJux+EJzu0msscUP+f8it8hPkFLc= +github.com/morikuni/aec v1.1.0/go.mod h1:xDRgiq/iw5l+zkao76YTKzKttOp2cwPEne25HDkJnBw= +github.com/muesli/crunchy v0.4.1-0.20210519044311-9cd68953298f/go.mod h1:9k4x6xdSbb7WwtAVy0iDjaiDjIk6Wa5AgUIqp+HqOpU= +github.com/muesli/mango v0.2.0/go.mod h1:5XFpbC8jY5UUv89YQciiXNlbi+iJgt29VDC5xbzrLL4= +github.com/muesli/mango-cobra v1.3.0/go.mod h1:Cj1ZrBu3806Qw7UjxnAUgE+7tllUBj1NCLQDwwGx19E= +github.com/muesli/mango-pflag v0.2.0/go.mod h1:X9LT1p/pbGA1wjvEbtwnixujKErkP0jVmrxwrw3fL0Y= +github.com/muesli/roff v0.1.0/go.mod h1:pjAHQM9hdUUwm/krAfrLGgJkXJ+YuhtsfZ42kieB2Ig= +github.com/muhlemmer/httpforwarded v0.1.0/go.mod h1:yo9czKedo2pdZhoXe+yDkGVbU0TJ0q9oQ90BVoDEtw0= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/natefinch/wrap v0.2.0/go.mod h1:6gMHlAl12DwYEfKP3TkuykYUfLSEAvHw67itm4/KAS8= +github.com/nwidger/jsoncolor v0.3.2/go.mod h1:Cs34umxLbJvgBMnVNVqhji9BhoT/N/KinHqZptQ7cf4= +github.com/oauth2-proxy/mockoidc v0.0.0-20240214162133-caebfff84d25/go.mod h1:eDjgYHYDJbPLBLsyZ6qRaugP0mX8vePOhZ5id1fdzJw= +github.com/oklog/ulid/v2 v2.1.1/go.mod h1:rcEKHmBBKfef9DhnvX7y1HZBYxjXb0cP5ExxNsTT1QQ= +github.com/olekukonko/cat v0.0.0-20250911104152-50322a0618f6/go.mod h1:rEKTHC9roVVicUIfZK7DYrdIoM0EOr8mK1Hj5s3JjH0= +github.com/olekukonko/errors v1.3.0/go.mod h1:ppzxA5jBKcO1vIpCXQ9ZqgDh8iwODz6OXIGKU8r5m4Y= +github.com/olekukonko/ll v0.1.8/go.mod h1:RPRC6UcscfFZgjo1nulkfMH5IM0QAYim0LfnMvUuozw= +github.com/olekukonko/tablewriter v1.1.4/go.mod h1:+kedxuyTtgoZLwif3P1Em4hARJs+mVnzKxmsCL/C5RY= +github.com/opencontainers/runtime-spec v1.3.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= +github.com/opencontainers/umoci v0.6.1-0.20251213054154-70fc5ee1f4df/go.mod h1:s6d/s4QJAZTF92hEU6ozuHjE0+VRc6kVe1QIWfvL7KY= +github.com/openfga/api/proto v0.0.0-20260122181957-618e7e0a4878/go.mod h1:XDX4qYNBUM2Rsa2AbKPh+oocZc2zgme+EF2fFC6amVU= +github.com/openfga/cli v0.7.8/go.mod h1:JXUGoDyTf1PeTR3WI02EXDJn/Mg5h4qA91sRXL0cI/w= +github.com/openfga/go-sdk v0.8.0/go.mod h1:s5zZD4NFmf6yQa74iJEAwBZgHx4NaNzoOOVmA6YcY2M= +github.com/openfga/language/pkg/go v0.2.0-beta.2.0.20251027165255-0f8f255e5f6c/go.mod h1:BG26d1Fk4GSg0wMj60TRJ6Pe4ka2WQ33akhO+mzt3t0= +github.com/openfga/openfga v1.11.5/go.mod h1:dqouURLTeDwoHxpiVHp/z9Ak4sfoVJ+24YElkHjgndw= +github.com/orcaman/concurrent-map/v2 v2.0.1/go.mod h1:9Eq3TG2oBe5FirmYWQfYO5iH1q0Jv47PLaNK++uCdOM= +github.com/osrg/gobgp/v4 v4.5.0/go.mod h1:pgu8waqTvZUYl4eQuPrKNOaVwhHv7Zt9YymuzCaX7f8= +github.com/ovn-kubernetes/libovsdb v0.8.1/go.mod h1:ZlnHLzagmLOSvyd9qfxBIZp6wOSOw0IsRsc+6lNUGbU= +github.com/pierrec/lz4/v4 v4.1.26/go.mod h1:EoQMVJgeeEOMsCqCzqFm2O0cJvljX2nGZjcRIPL34O4= +github.com/pires/go-proxyproto v0.12.0/go.mod h1:qUvfqUMEoX7T8g0q7TQLDnhMjdTrxnG0hvpMn+7ePNI= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/sftp v1.13.10/go.mod h1:bJ1a7uDhrX/4OII+agvy28lzRvQrmIQuaHrcI1HbeGA= +github.com/pkg/xattr v0.4.12/go.mod h1:di8WF84zAKk8jzR1UBTEWh9AUlIZZ7M/JNt8e9B6ktU= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/prometheus/client_golang v1.23.2/go.mod h1:Tb1a6LWHB3/SPIzCoaDXI4I8UHKeFTEQ1YCr+0Gyqmg= +github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE= +github.com/prometheus/common v0.67.5/go.mod h1:SjE/0MzDEEAyrdr5Gqc6G+sXI67maCxzaT3A2+HqjUw= +github.com/prometheus/procfs v0.20.1/go.mod h1:o9EMBZGRyvDrSPH1RqdxhojkuXstoe4UlK79eF5TGGo= +github.com/quasilyte/go-ruleguard/dsl v0.3.23/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= +github.com/rivo/tview v0.42.0/go.mod h1:cSfIYfhpSGCjp3r/ECJb+GKS7cGJnqV8vfjQPwoXyfY= +github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= +github.com/rootless-containers/proto/go-proto v0.0.0-20260207013450-f6ee952d53d9/go.mod h1:LLjEAc6zmycfeN7/1fxIphWQPjHpTt7ElqT7eVf8e4A= +github.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/rs/zerolog v1.34.0/go.mod h1:bJsvje4Z08ROH4Nhs5iH600c3IkWhwp44iRc54W6wYQ= +github.com/rung/go-safecast v1.0.1/go.mod h1:dzUcUS2UMtbfVc7w6mx/Ur3UYcpXEZC+WilISksJ4P8= github.com/russross/blackfriday v1.6.0/go.mod h1:ti0ldHuxg49ri4ksnFxlkCfN+hvslNlmVHqNRXXJNAY= github.com/santhosh-tekuri/jsonschema/v5 v5.3.1/go.mod h1:uToXkOrWAZ6/Oc07xWQrPOhJotwFIyu2bBVN41fcDUY= -github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= +github.com/schollz/progressbar/v3 v3.19.0/go.mod h1:IsO3lpbaGuzh8zIMzgY3+J8l4C8GjO0Y9S69eFvNsec= +github.com/segmentio/fasthash v1.0.3/go.mod h1:waKX8l2N8yckOgmSsXJi7x1ZfdKZ4x7KRMzBtS3oedY= +github.com/shirou/gopsutil/v4 v4.26.4/go.mod h1:LZ6ewCSkBqUpvSOf+LsTGnRinC6iaNUNMGBtDkJBaLQ= +github.com/shogo82148/logrus-slog-hook v0.1.0/go.mod h1:D2Ge8IJO5/lN5LXQ4Aq5NezL1iajb08s/xNCUru8+0Y= +github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME= +github.com/sirupsen/logrus v1.9.4/go.mod h1:ftWc9WdOfJ0a92nsE2jF5u5ZwH8Bv2zdeOC42RjbV2g= +github.com/smallstep/pkcs7 v0.2.1/go.mod h1:RcXHsMfL+BzH8tRhmrF1NkkpebKpq3JEM66cOFxanf0= +github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8/go.mod h1:3n1Cwaq1E1/1lhQhtRK2ts/ZwZEhjcQeJQ1RuC6Q/8U= +github.com/stoewer/go-strcase v1.3.0/go.mod h1:fAH5hQ5pehh+j3nZfvwdk2RgEgQjAoM8wodgtPmh1xo= +github.com/testcontainers/testcontainers-go v0.40.0/go.mod h1:FSXV5KQtX2HAMlm7U3APNyLkkap35zNLxukw9oBi/MY= +github.com/testcontainers/testcontainers-go/modules/openfga v0.40.0/go.mod h1:zwLB9Af9gw2ViufG7oZT/DpmubgKhnpleOWItgcnLVY= github.com/tetratelabs/wazero v1.11.0/go.mod h1:eV28rsN8Q+xwjogd7f4/Pp4xFxO7uOGbLcD/LzB1wiU= +github.com/tidwall/gjson v1.18.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= +github.com/tidwall/match v1.2.0/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= +github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= +github.com/timpalpant/gzran v0.0.0-20201127163450-7b631e56f57b/go.mod h1:yTxMuBKYLrj6gYYtK3gK0ifBhjiBYtD3URZiNK7vBt0= +github.com/tklauser/go-sysconf v0.3.16/go.mod h1:/qNL9xxDhc7tx3HSRsLWNnuzbVfh3e7gh/BmM179nYI= +github.com/tklauser/numcpus v0.11.0/go.mod h1:z+LwcLq54uWZTX0u/bGobaV34u6V7KNlTZejzM6/3MQ= +github.com/u-root/uio v0.0.0-20240224005618-d2acac8f3701/go.mod h1:P3a5rG4X7tI17Nn3aOIAYr5HbIMukwXG0urG0WuL8OA= +github.com/urfave/cli v1.22.17/go.mod h1:b0ht0aqgH/6pBYzzxURyrM4xXNgsoT/n2ZzwQiEhNVo= +github.com/vbatts/go-mtree v0.7.0/go.mod h1:EjdpFC+LZy1TXbRGNa1MKKgjQ+7ew3foMFJK8o4/TdY= +github.com/vektra/mockery/v3 v3.6.4/go.mod h1:z9Wr23Ha8etImqQwS3boTNR9WkjX6tIklW5c88DRkSw= +github.com/vishvananda/netlink v1.3.1/go.mod h1:ARtKouGSTGchR8aMwmkzC0qiNPrrWO5JS/XMVl45+b4= +github.com/vishvananda/netns v0.0.5/go.mod h1:SpkAiCQRtJ6TvvxPnOSyH3BMl6unz3xZlaprSwhNNJM= +github.com/vmware/govmomi v0.50.0/go.mod h1:Z5uo7z0kRhVV00E4gfbUGwUaXIKTgqngsT+t/mIDpcI= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= +github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= +github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= +github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= +github.com/xrash/smetrics v0.0.0-20250705151800-55b8f293f342/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= +github.com/zclconf/go-cty v1.17.0/go.mod h1:wqFzcImaLTI6A5HfsRwB0nj5n0MRZFwmey8YoFPPs3U= +github.com/zeebo/xxh3 v1.1.0/go.mod h1:IisAie1LELR4xhVinxWS5+zf1lA4p0MW4T+w+W07F5s= +github.com/zitadel/logging v0.7.0/go.mod h1:9A6h9feBF/3u0IhA4uffdzSDY7mBaf7RE78H5sFMINQ= +github.com/ztrue/tracerr v0.4.0/go.mod h1:PaFfYlas0DfmXNpo7Eay4MFhZUONqvXM+T2HyGPpngk= +go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.65.0/go.mod h1:c7hN3ddxs/z6q9xwvfLPk+UHlWRQyaeR1LdgfL/66l0= +go.opentelemetry.io/otel v1.43.0/go.mod h1:JuG+u74mvjvcm8vj8pI5XiHy1zDeoCS2LB1spIq7Ay0= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.40.0/go.mod h1:bTdK1nhqF76qiPoCCdyFIV+N/sRHYXYCTQc+3VCi3MI= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.40.0/go.mod h1:EtekO9DEJb4/jRyN4v4Qjc2yA7AtfCBuz2FynRUWTXs= +go.opentelemetry.io/otel/metric v1.43.0/go.mod h1:RDnPtIxvqlgO8GRW18W6Z/4P462ldprJtfxHxyKd2PY= +go.opentelemetry.io/otel/sdk v1.40.0/go.mod h1:Ph7EFdYvxq72Y8Li9q8KebuYUr2KoeyHx0DRMKrYBUE= +go.opentelemetry.io/otel/trace v1.43.0/go.mod h1:/QJhyVBUUswCphDVxq+8mld+AvhXZLhe+8WVFxiFff0= +go.opentelemetry.io/proto/otlp v1.9.0/go.mod h1:xE+Cx5E/eEHw+ISFkwPLwCZefwVjY+pqKg1qcK03+/4= +go.starlark.net v0.0.0-20260326113308-fadfc96def35/go.mod h1:Iue6g6iirlfLoVi/DYCi5/x0h/bAOuWF3dULTKpt2Vo= +go.uber.org/mock v0.6.0/go.mod h1:KiVJ4BqZJaMj4svdfmHM0AUx4NJYO8ZNpPnZn1Z+BBU= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/zap v1.27.1/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= +go.yaml.in/yaml/v2 v2.4.4/go.mod h1:gMZqIpDtDqOfM0uNfy0SkpRhvUryYH0Z6wdMYcacYXQ= +go4.org/mem v0.0.0-20240501181205-ae6ca9944745/go.mod h1:reUoABIJ9ikfM5sgtSF3Wushcza7+WeD01VB9Lirh3g= golang.org/x/crypto v0.49.0/go.mod h1:ErX4dUh2UM+CFYiXZRTcMpEcN8b/1gxEuv3nODoYtCA= +golang.org/x/crypto v0.50.0/go.mod h1:3muZ7vA7PBCE6xgPX7nkzzjiUq87kRItoJQM1Yo8S+Q= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/telemetry v0.0.0-20260311193753-579e4da9a98c/go.mod h1:TpUTTEp9frx7rTdLpC9gFG9kdI7zVLFTFFlqaH2Cncw= +golang.org/x/telemetry v0.0.0-20260409153401-be6f6cb8b1fa/go.mod h1:kHjTxDEnAu6/Nl9lDkzjWpR+bmKfxeiRuSDlsMb70gE= golang.org/x/term v0.41.0/go.mod h1:3pfBgksrReYfZ5lvYM0kSO0LIkAl4Yl2bXOkKP7Ec2A= +golang.org/x/term v0.42.0/go.mod h1:Dq/D+snpsbazcBG5+F9Q1n2rXV8Ma+71xEjTRufARgY= +golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU= +golang.org/x/time v0.15.0/go.mod h1:Y4YMaQmXwGQZoFaVFk4YpCt4FLQMYKZe9oeV/f4MSno= +golang.org/x/tools/go/expect v0.1.1-deprecated/go.mod h1:eihoPOH+FgIqa3FpoTwguz/bVUSGBlGQU67vpBeOrBY= +golang.org/x/tools/go/packages/packagestest v0.1.1-deprecated/go.mod h1:RVAQXBGNv1ib0J382/DPCRS/BPnsGebyM1Gj5VSDpG8= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= +google.golang.org/genproto/googleapis/api v0.0.0-20260223185530-2f722ef697dc/go.mod h1:M5krXqk4GhBKvB596udGL3UyjL4I1+cTbK0orROM9ng= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260427160629-7cedc36a6bc4/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8= +google.golang.org/grpc v1.80.0/go.mod h1:ho/dLnxwi3EDJA4Zghp7k2Ec1+c2jqup0bFkw07bwF4= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +k8s.io/utils v0.0.0-20260319190234-28399d86e0b5/go.mod h1:xDxuJ0whA3d0I4mf/C4ppKHxXynQ+fxnkmQH0vTHnuk= +libguestfs.org/libnbd v1.20.0/go.mod h1:pSICAuDOpSGplmGmaZ8QettnBAT3IUJFcBU1bVgWgk4= +moul.io/http2curl/v2 v2.3.0/go.mod h1:RW4hyBjTWSYDOxapodpNEtX0g5Eb16sxklBqmd2RHcE= +software.sslmate.com/src/go-pkcs12 v0.7.1/go.mod h1:Qiz0EyvDRJjjxGyUQa2cCNZn/wMyzrRJ/qcDXOQazLI= +tailscale.com v1.96.5/go.mod h1:/3lnZBYb2UEwnN0MNu2SDXUtT06AGd5k0s+OWx3WmcY= diff --git a/internal/providers/incusos/imagefile/doc.go b/internal/providers/incusos/imagefile/doc.go new file mode 100644 index 0000000..7c9d4a1 --- /dev/null +++ b/internal/providers/incusos/imagefile/doc.go @@ -0,0 +1,2 @@ +// Package imagefile adapts IncusOS image injection to local filesystem images. +package imagefile diff --git a/internal/providers/incusos/imagefile/injector.go b/internal/providers/incusos/imagefile/injector.go new file mode 100644 index 0000000..d9f9377 --- /dev/null +++ b/internal/providers/incusos/imagefile/injector.go @@ -0,0 +1,426 @@ +package imagefile + +import ( + "bufio" + "compress/gzip" + "context" + "crypto/sha256" + "encoding/hex" + "errors" + "fmt" + "io" + "os" + "path/filepath" + "strings" + + "github.com/meigma/imgcli/internal/providers/incusos" +) + +const ( + defaultSeedOffset = 2148532224 + defaultSeedPartitionSize = 100 * 1024 * 1024 + gzipHeaderLength = 2 + gzipID1 = 0x1f + gzipID2 = 0x8b + copyBufferSize = 1024 * 1024 + outputFileMode = 0o600 + outputDirMode = 0o755 +) + +var _ incusos.ImageInjector = Injector{} + +// Injector writes IncusOS seed archives into local image files. +type Injector struct { + seedOffset int64 + seedPartitionSize int64 +} + +// InjectSeed copies image to outputPath while replacing the upstream IncusOS seed region. +func (i Injector) InjectSeed( + ctx context.Context, + image incusos.DownloadedImage, + seed incusos.SeedArchive, + outputPath string, +) (incusos.CustomizedImage, error) { + if err := ctx.Err(); err != nil { + return incusos.CustomizedImage{}, err + } + + if err := validateInputs(image, seed, outputPath); err != nil { + return incusos.CustomizedImage{}, err + } + + if err := i.validateSeedSize(seed); err != nil { + return incusos.CustomizedImage{}, err + } + + if err := rejectSamePath(image.Path, outputPath); err != nil { + return incusos.CustomizedImage{}, err + } + + source, openErr := os.Open(image.Path) + if openErr != nil { + return incusos.CustomizedImage{}, fmt.Errorf("open incusos source image: %w", openErr) + } + defer source.Close() + + outputDir := filepath.Dir(outputPath) + if mkdirErr := os.MkdirAll(outputDir, outputDirMode); mkdirErr != nil { + return incusos.CustomizedImage{}, fmt.Errorf("create incusos output directory: %w", mkdirErr) + } + + temp, createErr := os.CreateTemp(outputDir, "."+filepath.Base(outputPath)+".*.tmp") + if createErr != nil { + return incusos.CustomizedImage{}, fmt.Errorf("create temporary incusos output image: %w", createErr) + } + + tempPath := temp.Name() + keepTemp := false + defer func() { + if !keepTemp { + _ = os.Remove(tempPath) + } + }() + + if chmodErr := temp.Chmod(outputFileMode); chmodErr != nil { + _ = temp.Close() + return incusos.CustomizedImage{}, fmt.Errorf("set temporary incusos output image mode: %w", chmodErr) + } + + if injectErr := i.inject(ctx, source, temp, seed, outputPath); injectErr != nil { + _ = temp.Close() + return incusos.CustomizedImage{}, injectErr + } + + if closeErr := temp.Close(); closeErr != nil { + return incusos.CustomizedImage{}, fmt.Errorf("close temporary incusos output image: %w", closeErr) + } + + if ctxErr := ctx.Err(); ctxErr != nil { + return incusos.CustomizedImage{}, ctxErr + } + + size, digest, digestErr := fileDigest(tempPath) + if digestErr != nil { + return incusos.CustomizedImage{}, digestErr + } + + if ctxErr := ctx.Err(); ctxErr != nil { + return incusos.CustomizedImage{}, ctxErr + } + + if renameErr := os.Rename(tempPath, outputPath); renameErr != nil { + return incusos.CustomizedImage{}, fmt.Errorf("replace incusos output image: %w", renameErr) + } + keepTemp = true + + return incusos.CustomizedImage{ + Source: image, + Path: outputPath, + Size: size, + SHA256: digest, + }, nil +} + +func (i Injector) inject( + ctx context.Context, + source io.Reader, + output io.Writer, + seed incusos.SeedArchive, + outputPath string, +) error { + sourceReader, closeSource, err := decompressedSource(source) + if err != nil { + return err + } + defer func() { + _ = closeSource() + }() + + outputWriter, closeOutput := compressedOutput(output, outputPath) + defer func() { + _ = closeOutput() + }() + + buffer := make([]byte, copyBufferSize) + offset := i.seedOffsetOrDefault() + if err := copyExactly(ctx, outputWriter, sourceReader, offset, buffer); err != nil { + if errors.Is(err, io.ErrUnexpectedEOF) { + return fmt.Errorf("copy incusos image prefix: source image shorter than seed offset: %w", err) + } + + return fmt.Errorf("copy incusos image prefix: %w", err) + } + + if err := ctx.Err(); err != nil { + return err + } + + if err := writeAll(ctx, outputWriter, seed.Data); err != nil { + return fmt.Errorf("write incusos seed archive: %w", err) + } + + if err := ctx.Err(); err != nil { + return err + } + + if err := discardExactly(ctx, sourceReader, int64(len(seed.Data)), buffer); err != nil { + if errors.Is(err, io.ErrUnexpectedEOF) { + return fmt.Errorf("discard incusos image seed span: source image shorter than seed span: %w", err) + } + + return fmt.Errorf("discard incusos image seed span: %w", err) + } + + if err := copyRemaining(ctx, outputWriter, sourceReader, buffer); err != nil { + return fmt.Errorf("copy incusos image suffix: %w", err) + } + + if err := closeOutput(); err != nil { + return err + } + + return nil +} + +func (i Injector) seedOffsetOrDefault() int64 { + if i.seedOffset > 0 { + return i.seedOffset + } + + return defaultSeedOffset +} + +func (i Injector) seedPartitionSizeOrDefault() int64 { + if i.seedPartitionSize > 0 { + return i.seedPartitionSize + } + + return defaultSeedPartitionSize +} + +func (i Injector) validateSeedSize(seed incusos.SeedArchive) error { + partitionSize := i.seedPartitionSizeOrDefault() + if int64(len(seed.Data)) > partitionSize { + return fmt.Errorf( + "incusos seed archive exceeds seed partition size: seed=%d bytes partition=%d bytes", + len(seed.Data), + partitionSize, + ) + } + + return nil +} + +func validateInputs(image incusos.DownloadedImage, seed incusos.SeedArchive, outputPath string) error { + if strings.TrimSpace(image.Path) == "" { + return errors.New("incusos source image path is required") + } + if len(seed.Data) == 0 { + return errors.New("incusos seed archive is empty") + } + if strings.TrimSpace(outputPath) == "" { + return errors.New("incusos output image path is required") + } + + return nil +} + +func rejectSamePath(sourcePath string, outputPath string) error { + sourceAbs, err := filepath.Abs(sourcePath) + if err != nil { + return fmt.Errorf("resolve incusos source image path: %w", err) + } + + outputAbs, err := filepath.Abs(outputPath) + if err != nil { + return fmt.Errorf("resolve incusos output image path: %w", err) + } + + if sourceAbs == outputAbs { + return errors.New("incusos source and output image paths must differ") + } + + sourceInfo, err := os.Stat(sourcePath) + if err != nil { + return fmt.Errorf("stat incusos source image path: %w", err) + } + + outputInfo, err := os.Stat(outputPath) + if err != nil { + if errors.Is(err, os.ErrNotExist) { + return nil + } + + return fmt.Errorf("stat incusos output image path: %w", err) + } + + if os.SameFile(sourceInfo, outputInfo) { + return errors.New("incusos source and output image paths must differ") + } + + return nil +} + +func decompressedSource(source io.Reader) (io.Reader, func() error, error) { + buffered := bufio.NewReader(source) + header, err := buffered.Peek(gzipHeaderLength) + if err != nil && !errors.Is(err, io.EOF) && !errors.Is(err, bufio.ErrBufferFull) { + return nil, nil, fmt.Errorf("detect incusos source image compression: %w", err) + } + + if len(header) < gzipHeaderLength || header[0] != gzipID1 || header[1] != gzipID2 { + return buffered, func() error { return nil }, nil + } + + gzipReader, err := gzip.NewReader(buffered) + if err != nil { + return nil, nil, fmt.Errorf("open gzip incusos source image: %w", err) + } + + return gzipReader, gzipReader.Close, nil +} + +func compressedOutput(output io.Writer, outputPath string) (io.Writer, func() error) { + if !strings.HasSuffix(outputPath, ".gz") { + return output, func() error { return nil } + } + + gzipWriter := gzip.NewWriter(output) + closed := false + closeWriter := func() error { + if closed { + return nil + } + closed = true + if err := gzipWriter.Close(); err != nil { + return fmt.Errorf("close gzip incusos output image: %w", err) + } + + return nil + } + + return gzipWriter, closeWriter +} + +func copyExactly(ctx context.Context, dst io.Writer, src io.Reader, n int64, buffer []byte) error { + for n > 0 { + if err := ctx.Err(); err != nil { + return err + } + + readSize := min(n, int64(len(buffer))) + + read, readErr := src.Read(buffer[:readSize]) + if read > 0 { + if err := writeAll(ctx, dst, buffer[:read]); err != nil { + return err + } + n -= int64(read) + } + + if readErr != nil { + if errors.Is(readErr, io.EOF) { + if n == 0 { + return ctx.Err() + } + + return io.ErrUnexpectedEOF + } + + return readErr + } + } + + return ctx.Err() +} + +func discardExactly(ctx context.Context, src io.Reader, n int64, buffer []byte) error { + for n > 0 { + if err := ctx.Err(); err != nil { + return err + } + + readSize := min(n, int64(len(buffer))) + + read, readErr := src.Read(buffer[:readSize]) + if read > 0 { + n -= int64(read) + } + + if readErr != nil { + if errors.Is(readErr, io.EOF) { + if n == 0 { + return ctx.Err() + } + + return io.ErrUnexpectedEOF + } + + return readErr + } + } + + return ctx.Err() +} + +func copyRemaining(ctx context.Context, dst io.Writer, src io.Reader, buffer []byte) error { + for { + if err := ctx.Err(); err != nil { + return err + } + + read, readErr := src.Read(buffer) + if read > 0 { + if err := writeAll(ctx, dst, buffer[:read]); err != nil { + return err + } + } + + if readErr != nil { + if errors.Is(readErr, io.EOF) { + return nil + } + + return readErr + } + } +} + +func writeAll(ctx context.Context, dst io.Writer, data []byte) error { + for len(data) > 0 { + if err := ctx.Err(); err != nil { + return err + } + + written, err := dst.Write(data) + if written > 0 { + data = data[written:] + } + + if err != nil { + return err + } + if written == 0 { + return io.ErrShortWrite + } + } + + return ctx.Err() +} + +func fileDigest(path string) (int64, string, error) { + file, err := os.Open(path) + if err != nil { + return 0, "", fmt.Errorf("open customized incusos image for digest: %w", err) + } + defer file.Close() + + hash := sha256.New() + size, err := io.Copy(hash, file) + if err != nil { + return 0, "", fmt.Errorf("digest customized incusos image: %w", err) + } + + return size, hex.EncodeToString(hash.Sum(nil)), nil +} diff --git a/internal/providers/incusos/imagefile/injector_test.go b/internal/providers/incusos/imagefile/injector_test.go new file mode 100644 index 0000000..da02d7d --- /dev/null +++ b/internal/providers/incusos/imagefile/injector_test.go @@ -0,0 +1,308 @@ +package imagefile + +import ( + "compress/gzip" + "context" + "crypto/sha256" + "encoding/hex" + "io" + "os" + "path/filepath" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/meigma/imgcli/internal/providers/incusos" +) + +func TestInjectSeedWritesCustomizedImage(t *testing.T) { + sourceContent := []byte("aaaabbbbcccc") + seed := incusos.SeedArchive{Data: []byte("SEED")} + wantContent := []byte("aaaaSEEDcccc") + + tests := []struct { + name string + sourceGzip bool + outputGzip bool + }{ + { + name: "plain source to plain output", + }, + { + name: "gzip source to gzip output", + sourceGzip: true, + outputGzip: true, + }, + { + name: "gzip source to plain output", + sourceGzip: true, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + dir := t.TempDir() + sourcePath := filepath.Join(dir, "source.img") + if tt.sourceGzip { + sourcePath += ".gz" + } + outputPath := filepath.Join(dir, "out.img") + if tt.outputGzip { + outputPath += ".gz" + } + writeImage(t, sourcePath, sourceContent, tt.sourceGzip) + sourceImage := downloadedImage(t, sourcePath) + + got, err := (Injector{seedOffset: 4}).InjectSeed(context.Background(), sourceImage, seed, outputPath) + + require.NoError(t, err) + assert.Equal(t, sourceImage, got.Source) + assert.Equal(t, outputPath, got.Path) + + size, digest := fileStats(t, outputPath) + assert.Equal(t, size, got.Size) + assert.Equal(t, digest, got.SHA256) + + if tt.outputGzip { + assert.Equal(t, wantContent, readGzip(t, outputPath)) + } else { + assert.Equal(t, wantContent, readFile(t, outputPath)) + } + }) + } +} + +func TestInjectSeedValidatesInputs(t *testing.T) { + dir := t.TempDir() + sourcePath := filepath.Join(dir, "source.img") + writeImage(t, sourcePath, []byte("aaaabbbbcccc"), false) + validImage := downloadedImage(t, sourcePath) + validSeed := incusos.SeedArchive{Data: []byte("SEED")} + outputPath := filepath.Join(dir, "out.img") + + tests := []struct { + name string + image incusos.DownloadedImage + seed incusos.SeedArchive + outputPath string + wantErr string + }{ + { + name: "missing source path", + image: incusos.DownloadedImage{}, + seed: validSeed, + outputPath: outputPath, + wantErr: "incusos source image path is required", + }, + { + name: "empty seed", + image: validImage, + seed: incusos.SeedArchive{}, + outputPath: outputPath, + wantErr: "incusos seed archive is empty", + }, + { + name: "missing output path", + image: validImage, + seed: validSeed, + outputPath: "", + wantErr: "incusos output image path is required", + }, + { + name: "source equals output", + image: validImage, + seed: validSeed, + outputPath: sourcePath, + wantErr: "incusos source and output image paths must differ", + }, + { + name: "source symlink equals output target", + image: downloadedImage(t, sourceSymlink(t, sourcePath)), + seed: validSeed, + outputPath: sourcePath, + wantErr: "incusos source and output image paths must differ", + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got, err := (Injector{seedOffset: 4}).InjectSeed(context.Background(), tt.image, tt.seed, tt.outputPath) + + require.Error(t, err) + require.ErrorContains(t, err, tt.wantErr) + assert.Empty(t, got) + }) + } +} + +func TestInjectSeedValidatesSeedPartitionBoundary(t *testing.T) { + dir := t.TempDir() + sourcePath := filepath.Join(dir, "source.img") + outputPath := filepath.Join(dir, "out.img") + writeImage(t, sourcePath, []byte("aaaabbbbcccc"), false) + image := downloadedImage(t, sourcePath) + + _, err := (Injector{seedOffset: 4, seedPartitionSize: 4}).InjectSeed( + context.Background(), + image, + incusos.SeedArchive{Data: []byte("SEED")}, + outputPath, + ) + require.NoError(t, err) + + got, err := (Injector{seedOffset: 4, seedPartitionSize: 4}).InjectSeed( + context.Background(), + image, + incusos.SeedArchive{Data: []byte("SEEDS")}, + filepath.Join(dir, "oversized.img"), + ) + require.Error(t, err) + require.ErrorContains(t, err, "incusos seed archive exceeds seed partition size") + assert.Empty(t, got) +} + +func TestInjectSeedReturnsErrorWhenSourceIsTooShort(t *testing.T) { + tests := []struct { + name string + sourceContent []byte + seed incusos.SeedArchive + wantErr string + }{ + { + name: "source shorter than seed offset", + sourceContent: []byte("abc"), + seed: incusos.SeedArchive{Data: []byte("S")}, + wantErr: "source image shorter than seed offset", + }, + { + name: "source shorter than seed span", + sourceContent: []byte("abcdX"), + seed: incusos.SeedArchive{Data: []byte("SEED")}, + wantErr: "source image shorter than seed span", + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + dir := t.TempDir() + sourcePath := filepath.Join(dir, "source.img") + outputPath := filepath.Join(dir, "out.img") + writeImage(t, sourcePath, tt.sourceContent, false) + + got, err := (Injector{seedOffset: 4}).InjectSeed( + context.Background(), + downloadedImage(t, sourcePath), + tt.seed, + outputPath, + ) + + require.Error(t, err) + require.ErrorContains(t, err, tt.wantErr) + assert.Empty(t, got) + assert.NoFileExists(t, outputPath) + assertNoTempOutputs(t, dir, outputPath) + }) + } +} + +func TestInjectSeedReturnsContextError(t *testing.T) { + dir := t.TempDir() + sourcePath := filepath.Join(dir, "source.img") + outputPath := filepath.Join(dir, "out.img") + writeImage(t, sourcePath, []byte("aaaabbbbcccc"), false) + ctx, cancel := context.WithCancel(context.Background()) + cancel() + + got, err := (Injector{seedOffset: 4}).InjectSeed( + ctx, + downloadedImage(t, sourcePath), + incusos.SeedArchive{Data: []byte("SEED")}, + outputPath, + ) + + require.ErrorIs(t, err, context.Canceled) + assert.Empty(t, got) + assert.NoFileExists(t, outputPath) +} + +func sourceSymlink(t *testing.T, target string) string { + t.Helper() + + linkPath := filepath.Join(t.TempDir(), "source-link.img") + require.NoError(t, os.Symlink(target, linkPath)) + + return linkPath +} + +func downloadedImage(t *testing.T, path string) incusos.DownloadedImage { + t.Helper() + + size, digest := fileStats(t, path) + return incusos.DownloadedImage{ + Path: path, + Size: size, + SHA256: digest, + } +} + +func writeImage(t *testing.T, path string, content []byte, gzipOutput bool) { + t.Helper() + + if !gzipOutput { + require.NoError(t, os.WriteFile(path, content, 0o600)) + return + } + + file, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0o600) + require.NoError(t, err) + defer file.Close() + + writer := gzip.NewWriter(file) + _, err = writer.Write(content) + require.NoError(t, err) + require.NoError(t, writer.Close()) +} + +func readFile(t *testing.T, path string) []byte { + t.Helper() + + content, err := os.ReadFile(path) + require.NoError(t, err) + + return content +} + +func readGzip(t *testing.T, path string) []byte { + t.Helper() + + file, err := os.Open(path) + require.NoError(t, err) + defer file.Close() + + reader, err := gzip.NewReader(file) + require.NoError(t, err) + defer reader.Close() + + content, err := io.ReadAll(reader) + require.NoError(t, err) + + return content +} + +func fileStats(t *testing.T, path string) (int64, string) { + t.Helper() + + content := readFile(t, path) + sum := sha256.Sum256(content) + + return int64(len(content)), hex.EncodeToString(sum[:]) +} + +func assertNoTempOutputs(t *testing.T, dir string, outputPath string) { + t.Helper() + + matches, err := filepath.Glob(filepath.Join(dir, "."+filepath.Base(outputPath)+".*.tmp")) + require.NoError(t, err) + assert.Empty(t, matches) +} diff --git a/internal/providers/incusos/seed_builder.go b/internal/providers/incusos/seed_builder.go new file mode 100644 index 0000000..567d10b --- /dev/null +++ b/internal/providers/incusos/seed_builder.go @@ -0,0 +1,108 @@ +package incusos + +import ( + "archive/tar" + "bytes" + "context" + "errors" + "fmt" + + "go.yaml.in/yaml/v4" + + incusosschema "github.com/meigma/imgcli/schemas/providers/incusos" +) + +var _ SeedBuilder = SeedArchiveBuilder{} + +const ( + seedArchiveFileMode = 0o600 + seedSectionCount = 8 +) + +var errNoSeedSections = errors.New("incusos seed has no sections") + +// SeedArchiveBuilder creates IncusOS seed tar archives from provider configuration. +type SeedArchiveBuilder struct{} + +// BuildSeed creates the seed archive for a provider configuration. +func (SeedArchiveBuilder) BuildSeed(ctx context.Context, config Config) (SeedArchive, error) { + if err := ctx.Err(); err != nil { + return SeedArchive{}, err + } + + sections := seedSections(config.Seed) + if len(sections) == 0 { + return SeedArchive{}, errNoSeedSections + } + + var buf bytes.Buffer + tw := tar.NewWriter(&buf) + + for _, section := range sections { + if err := ctx.Err(); err != nil { + return SeedArchive{}, err + } + + data, err := yaml.Dump(section.value, yaml.V2) + if err != nil { + return SeedArchive{}, fmt.Errorf("encode incusos seed %s: %w", section.name, err) + } + + header := &tar.Header{ + Name: section.name + ".yaml", + Mode: seedArchiveFileMode, + Size: int64(len(data)), + } + if err := tw.WriteHeader(header); err != nil { + return SeedArchive{}, fmt.Errorf("write incusos seed %s header: %w", section.name, err) + } + if _, err := tw.Write(data); err != nil { + return SeedArchive{}, fmt.Errorf("write incusos seed %s content: %w", section.name, err) + } + } + + if err := tw.Close(); err != nil { + return SeedArchive{}, fmt.Errorf("close incusos seed archive: %w", err) + } + + return SeedArchive{Data: buf.Bytes()}, nil +} + +type seedSection struct { + name string + value any +} + +func seedSections(seed *incusosschema.Seed) []seedSection { + if seed == nil { + return nil + } + + sections := make([]seedSection, 0, seedSectionCount) + if seed.Install != nil { + sections = append(sections, seedSection{name: "install", value: seed.Install}) + } + if seed.Applications != nil { + sections = append(sections, seedSection{name: "applications", value: seed.Applications}) + } + if seed.Incus != nil { + sections = append(sections, seedSection{name: "incus", value: seed.Incus}) + } + if seed.Network != nil { + sections = append(sections, seedSection{name: "network", value: seed.Network}) + } + if seed.MigrationManager != nil { + sections = append(sections, seedSection{name: "migration-manager", value: seed.MigrationManager}) + } + if seed.OperationsCenter != nil { + sections = append(sections, seedSection{name: "operations-center", value: seed.OperationsCenter}) + } + if seed.Provider != nil { + sections = append(sections, seedSection{name: "provider", value: seed.Provider}) + } + if seed.Update != nil { + sections = append(sections, seedSection{name: "update", value: seed.Update}) + } + + return sections +} diff --git a/internal/providers/incusos/seed_builder_test.go b/internal/providers/incusos/seed_builder_test.go new file mode 100644 index 0000000..01d3afb --- /dev/null +++ b/internal/providers/incusos/seed_builder_test.go @@ -0,0 +1,143 @@ +package incusos + +import ( + "archive/tar" + "bytes" + "context" + "errors" + "io" + "testing" + + incusosapi "github.com/lxc/incus-os/incus-osd/api" + apiseed "github.com/lxc/incus-os/incus-osd/api/seed" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "go.yaml.in/yaml/v4" + + incusosschema "github.com/meigma/imgcli/schemas/providers/incusos" +) + +func TestSeedArchiveBuilderRequiresSeedSections(t *testing.T) { + tests := []struct { + name string + config Config + }{ + { + name: "nil seed", + config: Config{}, + }, + { + name: "empty seed", + config: Config{ + Seed: &incusosschema.Seed{}, + }, + }, + } + + builder := SeedArchiveBuilder{} + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + _, err := builder.BuildSeed(context.Background(), tt.config) + + require.ErrorIs(t, err, errNoSeedSections) + }) + } +} + +func TestSeedArchiveBuilderReturnsContextError(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + cancel() + + _, err := SeedArchiveBuilder{}.BuildSeed(ctx, Config{ + Seed: &incusosschema.Seed{ + Install: &apiseed.Install{Version: "1"}, + }, + }) + + require.ErrorIs(t, err, context.Canceled) +} + +func TestSeedArchiveBuilderWritesSeedSectionsInOrder(t *testing.T) { + builder := SeedArchiveBuilder{} + archive, err := builder.BuildSeed(context.Background(), Config{ + Seed: &incusosschema.Seed{ + Install: &apiseed.Install{Version: "1", ForceReboot: true}, + Applications: &apiseed.Applications{Version: "1", Applications: []apiseed.Application{{Name: "incus"}}}, + Incus: &apiseed.Incus{Version: "1", ApplyDefaults: true}, + Network: &apiseed.Network{Version: "1"}, + MigrationManager: &apiseed.MigrationManager{Version: "1"}, + OperationsCenter: &apiseed.OperationsCenter{Version: "1"}, + Provider: &apiseed.Provider{ + SystemProviderConfig: incusosapi.SystemProviderConfig{Name: "images"}, + Version: "1", + }, + Update: &apiseed.Update{ + SystemUpdateConfig: incusosapi.SystemUpdateConfig{ + Channel: "stable", + CheckFrequency: "6h", + }, + Version: "1", + }, + }, + }) + + require.NoError(t, err) + entries := readSeedArchive(t, archive) + + assert.Equal(t, []string{ + "install.yaml", + "applications.yaml", + "incus.yaml", + "network.yaml", + "migration-manager.yaml", + "operations-center.yaml", + "provider.yaml", + "update.yaml", + }, entries.names) + for _, mode := range entries.modes { + assert.Equal(t, int64(0o600), mode) + } + + var install apiseed.Install + require.NoError(t, yaml.Load(entries.contents["install.yaml"], &install)) + assert.Equal(t, "1", install.Version) + assert.True(t, install.ForceReboot) + + var applications apiseed.Applications + require.NoError(t, yaml.Load(entries.contents["applications.yaml"], &applications)) + require.Len(t, applications.Applications, 1) + assert.Equal(t, "incus", applications.Applications[0].Name) +} + +type seedArchiveEntries struct { + names []string + modes map[string]int64 + contents map[string][]byte +} + +func readSeedArchive(t *testing.T, archive SeedArchive) seedArchiveEntries { + t.Helper() + + tr := tar.NewReader(bytes.NewReader(archive.Data)) + entries := seedArchiveEntries{ + modes: map[string]int64{}, + contents: map[string][]byte{}, + } + + for { + header, err := tr.Next() + if errors.Is(err, io.EOF) { + break + } + require.NoError(t, err) + + content, err := io.ReadAll(tr) + require.NoError(t, err) + + entries.names = append(entries.names, header.Name) + entries.modes[header.Name] = header.Mode + entries.contents[header.Name] = content + } + + return entries +} diff --git a/moon.yml b/moon.yml index 92d9d42..cb7881f 100644 --- a/moon.yml +++ b/moon.yml @@ -44,6 +44,8 @@ fileGroups: tasks: build: + deps: + - 'root:schemas-generate-check' command: 'go build -o bin/imgcli ./cmd/imgcli' toolchains: ['go'] inputs: @@ -63,6 +65,8 @@ tasks: cache: false lint: + deps: + - 'root:schemas-generate-check' command: 'proto run golangci-lint -- run --config .golangci.yml ./... --show-stats=false' toolchains: ['go'] inputs: @@ -73,6 +77,8 @@ tasks: cache: false test: + deps: + - 'root:schemas-generate-check' command: 'go test ./...' toolchains: ['go'] inputs: @@ -96,7 +102,7 @@ tasks: cache: false schemas-generate: - script: 'cd schemas && proto run cue -- exp gengotypes ./... && gofmt -w $(find . -name "*.go" -type f)' + script: 'cd schemas && proto run cue -- exp gengotypes . ./core ./providers/... && find cue.mod/gen -name "*.go" -type f -delete && gofmt -w $(find . -path ./cue.mod -prune -o -name "*.go" -type f -print)' inputs: - '@group(schema-config)' - '@group(schema-sources)' @@ -106,7 +112,7 @@ tasks: cache: false schemas-generate-check: - script: 'cd schemas && proto run cue -- exp gengotypes ./... && gofmt -w $(find . -name "*.go" -type f) && git -C .. diff --exit-code -- "schemas/**/*.go"' + script: 'cd schemas && proto run cue -- exp gengotypes . ./core ./providers/... && find cue.mod/gen -name "*.go" -type f -delete && gofmt -w $(find . -path ./cue.mod -prune -o -name "*.go" -type f -print) && git -C .. diff --exit-code -- "schemas/**/*.go"' inputs: - '@group(schema-config)' - '@group(schema-sources)' diff --git a/schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/artifacts_go_gen.cue b/schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/artifacts_go_gen.cue new file mode 100644 index 0000000..fb81c69 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/artifacts_go_gen.cue @@ -0,0 +1,76 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/FuturFusion/migration-manager/shared/api + +package api + +import ( + uuid_9 "github.com/google/uuid" + "time" +) + +#ArtifactType: string // #enumArtifactType + +#enumArtifactType: + #ARTIFACTTYPE_SDK | + #ARTIFACTTYPE_OSIMAGE | + #ARTIFACTTYPE_DRIVER + +#ARTIFACTTYPE_SDK: #ArtifactType & "sdk" +#ARTIFACTTYPE_OSIMAGE: #ArtifactType & "os-image" +#ARTIFACTTYPE_DRIVER: #ArtifactType & "driver" + +// Artifact represents external resources uploaded to Migration Manager. +// +// swagger:model +#Artifact: { + #ArtifactPost + + // Unique identifier of an artifact. + // Example: 400f6ceb-659a-4b3c-8598-0bc9d20eafe3 + uuid: uuid_9.#UUID @go(UUID) + + // Record of the last change to an artifact's properties or resources. + // Example: 2025-01-01 01:00:00 + last_updated: time.Time @go(LastUpdated) + + // List of filenames uploaded as resources. + // Example: vmware-sdk.tar.gz + files: [...string] @go(Files,[]string) +} + +// ArtifactPost represents the properties of an artifact to be registered in Migration Manager. +// +// swagger:model +#ArtifactPost: { + #ArtifactPut + + // Type of the artifact. + // Example: sdk + type: #ArtifactType @go(Type) +} + +// ArtifactPut represents the configurable properties of an artifact record. +// +// swagger:model +#ArtifactPut: { + // Description of the artifact. + // Example: VMware disklib tarball + description?: string @go(Description) + + // OS name that the artifact relates to. + // Example: windows + os?: #OSType @go(OS) + + // Architectures used to match VMs to an artifact. + // Example: x86_64 + architectures?: [...string] @go(Architectures,[]string) + + // Versions used to match VMs to an artifact. + // Example: 1.0 + versions?: [...string] @go(Versions,[]string) + + // Source type that the artifact relates to. + // Example: vmware + source_type?: #SourceType @go(SourceType) +} diff --git a/schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/batch_go_gen.cue b/schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/batch_go_gen.cue new file mode 100644 index 0000000..81a5b9f --- /dev/null +++ b/schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/batch_go_gen.cue @@ -0,0 +1,157 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/FuturFusion/migration-manager/shared/api + +package api + +import "time" + +#BatchStatusType: string // #enumBatchStatusType + +#enumBatchStatusType: + #BATCHSTATUS_DEFINED | + #BATCHSTATUS_RUNNING | + #BATCHSTATUS_STOPPED | + #BATCHSTATUS_FINISHED | + #BATCHSTATUS_ERROR + +#BATCHSTATUS_DEFINED: #BatchStatusType & "Defined" +#BATCHSTATUS_RUNNING: #BatchStatusType & "Running" +#BATCHSTATUS_STOPPED: #BatchStatusType & "Stopped" +#BATCHSTATUS_FINISHED: #BatchStatusType & "Finished" +#BATCHSTATUS_ERROR: #BatchStatusType & "Error" + +#DefaultTarget: "default" +#DefaultTargetProject: "default" +#DefaultStoragePool: "default" + +// Batch defines a collection of Instances to be migrated, possibly during a specific window of time. +// +// swagger:model +#Batch: { + #BatchPut + + // The status of this batch + // Example: BATCHSTATUS_DEFINED + status: #BatchStatusType @go(Status) + + // A free-form string to provide additional information about the status + // Example: "4 of 5 instances migrated" + status_message: string @go(StatusMessage) + + // Time in UTC when the batch was started. + // Example: 2025-01-01 01:00:00 + start_date: time.Time @go(StartDate) +} + +// BatchPut defines the configurable fields of Batch. +// +// swagger:model +#BatchPut: { + // A human-friendly name for this batch + // Example: MyBatch + name: string @go(Name) + + // A Expression used to select instances to add to this batch + // Language reference: https://expr-lang.org/docs/language-definition + // Example: location matches "^foobar/.*" + include_expression: string @go(IncludeExpression) + + // Set of migration window timings. + migration_windows: [...#MigrationWindow] @go(MigrationWindows,[]MigrationWindow) + + // Set of constraints to apply to the batch. For each instance, the last constraint in the list that matches will be applied. + constraints: [...#BatchConstraint] @go(Constraints,[]BatchConstraint) + + // Default configurations for the batch. + defaults: #BatchDefaults @go(Defaults) + + // Additional configuration for the batch. + config: #BatchConfig @go(Config) +} + +#BatchDefaults: { + // Default target placement for instances. Can be overridden with the placement scriptlet. + placement: #BatchPlacement @go(Placement) + + // Network configuration to use during migration of the instance. If unspecified, the default network configuration in the default profile will be used. + migration_network: [...#MigrationNetworkPlacement] @go(MigrationNetwork,[]MigrationNetworkPlacement) + + // Whether to forcibly use the configuration that will allow the migration to proceed, when encountering late-migration conflicts. May result in an out-of-date migration. + force_conflict_resolution: bool @go(ForceConflictResolution) +} + +#MigrationNetworkPlacement: { + #NetworkPlacement + + // Target that the network is available in. + target: string @go(Target) + + // Target project that the network is available in. + target_project: string @go(TargetProject) +} + +#BatchPlacement: { + // The destination target name to be used by all instances in this batch + // Example: Mytarget + target: string @go(Target) + + // The target project to use + // Example: default + target_project: string @go(TargetProject) + + // The Incus storage pool that this batch should use for creating VMs and mounting ISO images + // Example: local + storage_pool: string @go(StoragePool) +} + +#BatchConfig: { + // Whether to re-run scriptlets if a migration restarts + rerun_scriptlets: bool @go(RerunScriptlets) + + // The placement scriptlet used to determine the target for queued instances. + // Example: starlark scriptlet + placement_scriptlet: string @go(PlacementScriptlet) + + // PostMigrationRetries is the maximum number of times post-migration steps will be retried upon errors. + // Example: 5 + post_migration_retries: int @go(PostMigrationRetries) + + // Overrides to allow migrating instances that are otherwise restricted. + instance_restriction_overrides: #InstanceRestrictionOverride @go(RestrictionOverrides) + + // Interval over which background sync will be rerun until the migration window has begun. + background_sync_interval: #Duration @go(BackgroundSyncInterval) + + // The minimum amount of time before the migration window begins that background sync can be re-attempted. + final_background_sync_limit: #Duration @go(FinalBackgroundSyncLimit) +} + +// BatchConstraint is a constraint to be applied to a batch to determine which instances can be migrated. +#BatchConstraint: { + // Name of the constraint. + name: string @go(Name) + + // Description of the constraint. + description: string @go(Description) + + // Expression used to select instances for the constraint. + include_expression: string @go(IncludeExpression) + + // Maximum amount of matched instances that can concurrently migrate, before moving to the next migration window. + max_concurrent_instances: int @go(MaxConcurrentInstances) + + // Minimum amount of time required for an instance to boot after initial disk import. Migration window duration must be at least this much. + min_instance_boot_time: #Duration @go(MinInstanceBootTime) +} + +#InstanceRestrictionOverride: { + // Allow migration of instances with unknown OSes. + allow_unknown_os: bool @go(AllowUnknownOS) + + // Allow migration of instances with no IPv4 addresses. + allow_no_ipv4: bool @go(AllowNoIPv4) + + // Allow migration of instances with no background import support. + allow_no_background_import: bool @go(AllowNoBackgroundImport) +} diff --git a/schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/certificate_go_gen.cue b/schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/certificate_go_gen.cue new file mode 100644 index 0000000..424d952 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/certificate_go_gen.cue @@ -0,0 +1,7 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/FuturFusion/migration-manager/shared/api + +package api + +#Certificate: _ diff --git a/schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/duration_go_gen.cue b/schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/duration_go_gen.cue new file mode 100644 index 0000000..7f51e57 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/duration_go_gen.cue @@ -0,0 +1,8 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/FuturFusion/migration-manager/shared/api + +package api + +// Duration is a wrapper around time.Duration for easy json parsing. +#Duration: _ diff --git a/schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/event_go_gen.cue b/schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/event_go_gen.cue new file mode 100644 index 0000000..8ed2870 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/event_go_gen.cue @@ -0,0 +1,34 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/FuturFusion/migration-manager/shared/api + +package api + +import time_9 "time" + +// Event represents a Migration Manager event. +#Event: { + time: time_9.Time @go(Time) + type: #LogScope @go(Type) + metadata: _ @go(Metadata,json.RawMessage) +} + +// EventLogging represents a logging type event. +#EventLogging: { + message: string @go(Message) + level: string @go(Level) + context: {[string]: string} @go(Context,map[string]string) +} + +// EventLifecycle represents a lifecycle type event. +#EventLifecycle: { + action: string @go(Action) + entities: [...string] @go(Entities,[]string) + requestor?: null | #EventLifecycleRequestor @go(Requestor,*EventLifecycleRequestor) + metadata?: _ @go(Metadata,json.RawMessage) +} + +// EventLifecycleRequestor represents the initial requestor for an event. +#EventLifecycleRequestor: string + +#LifecycleAction: string diff --git a/schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/instance_go_gen.cue b/schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/instance_go_gen.cue new file mode 100644 index 0000000..e443763 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/instance_go_gen.cue @@ -0,0 +1,60 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/FuturFusion/migration-manager/shared/api + +package api + +import "time" + +// Instance defines a VM instance to be migrated. +// +// swagger:model +#Instance: { + #InstanceProperties + + // The originating source name for this instance + // Example: MySource + source: string @go(Source) + + // The source type of the Instance's source. + // Example: vmware + source_type: #SourceType @go(SourceType) + + // OS type used for specific post-migration handling. + // Example: linux + os_type: #OSType @go(OSType) + + // Distribution name used for specific post-migration handling. + // Example: RHEL + distribution: #Distro @go(Distribution) + + // Distribution version used for specific post-migration handling. + // Example: 7 + distribution_version: string @go(DistributionVersion) + + // Last synced update from the source. + // Example: 2025-01-01 01:00:00 + last_update_from_source: time.Time @go(LastUpdateFromSource) + + // Overrides, if any, for this instance + overrides: #InstanceOverride @go(Overrides) +} + +#InstanceFilterable: { + InstanceProperties: #InstanceProperties + os_type: #OSType @go(OSType) + distribution: #Distro @go(Distribution) + distribution_version: string @go(DistributionVersion) + source: string @go(Source) + source_type: string @go(SourceType) + last_update_from_source: time.Time @go(LastUpdateFromSource) +} + +#PowerState: string // #enumPowerState + +#enumPowerState: + #PowerStateOn | + #PowerStateOff + +#PowerStateOn: #PowerState & "on" +#PowerStateOff: #PowerState & "off" diff --git a/schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/instance_override_go_gen.cue b/schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/instance_override_go_gen.cue new file mode 100644 index 0000000..16b5078 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/instance_override_go_gen.cue @@ -0,0 +1,50 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/FuturFusion/migration-manager/shared/api + +package api + +import "time" + +// InstanceOverride defines a limited set of instance values that can be overridden as part of the migration process. +// +// swagger:model +#InstanceOverride: { + #InstancePropertiesConfigurable + + // The last time this instance override was updated + // Example: 2024-11-12 16:15:00 +0000 UTC + last_update: time.Time @go(LastUpdate) + + // An optional comment about the override + // Example: "Manually tweak number of CPUs" + comment: string @go(Comment) + + // OS type used for specific post-migration handling. + // Example: linux + os_type: #OSType @go(OSType) + + // Distribution name used for specific post-migration handling. + // Example: RHEL + distribution: #Distro @go(Distribution) + + // Distribution version used for specific post-migration handling. + // Example: 7 + distribution_version: string @go(DistributionVersion) + + // If true, migration of this instance will be disabled. + // Example: true + disable_migration: bool @go(DisableMigration) + + // If true, restrictions that put the VM in a blocked state, preventing migration, will be ignored. + // Example: true + ignore_restrictions: bool @go(IgnoreRestrictions) + + // If true, after migration the associated target VM will be started. + // Example: true + started_after_migration: bool @go(StartedAfterMigration) + + // If true, after migration the associated target VM will be left stopped. + // Example: true + stopped_after_migration: bool @go(StoppedAfterMigration) +} diff --git a/schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/network_go_gen.cue b/schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/network_go_gen.cue new file mode 100644 index 0000000..9e12c23 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/network_go_gen.cue @@ -0,0 +1,96 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/FuturFusion/migration-manager/shared/api + +package api + +import uuid_9 "github.com/google/uuid" + +#NetworkType: string // #enumNetworkType + +#enumNetworkType: + #NETWORKTYPE_VMWARE_STANDARD | + #NETWORKTYPE_VMWARE_DISTRIBUTED | + #NETWORKTYPE_VMWARE_DISTRIBUTED_NSX | + #NETWORKTYPE_VMWARE_NSX + +// NETWORKTYPE_VMWARE_STANDARD is a standard vCenter switch-backed port group. +#NETWORKTYPE_VMWARE_STANDARD: #NetworkType & "standard" + +// NETWORKTYPE_VMWARE_DISTRIBUTED is a distributed port group backed by a vCenter distributed switch. +#NETWORKTYPE_VMWARE_DISTRIBUTED: #NetworkType & "distributed" + +// NETWORKTYPE_VMWARE_DISTRIBUTED_NSX is a distributed port group backed by NSX. +#NETWORKTYPE_VMWARE_DISTRIBUTED_NSX: #NetworkType & "nsx-distributed" + +// NETWORKTYPE_VMWARE_NSX is an opaque network managed by NSX. +#NETWORKTYPE_VMWARE_NSX: #NetworkType & "nsx" + +#IncusNICType: string // #enumIncusNICType + +#enumIncusNICType: + #INCUSNICTYPE_BRIDGED | + #INCUSNICTYPE_PHYSICAL | + #INCUSNICTYPE_MANAGED + +#INCUSNICTYPE_BRIDGED: #IncusNICType & "bridged" +#INCUSNICTYPE_PHYSICAL: #IncusNICType & "physical" +#INCUSNICTYPE_MANAGED: #IncusNICType & "managed" + +// Network defines the network config for use by the migration manager. +// +// swagger:model +#Network: { + // UUID of the network. + uuid: uuid_9.#UUID @go(UUID) + + // The source-specific identifier of the network + // Example: network-23 + source_specific_id: string @go(SourceSpecificID) + + // vCenter source for the network + // Example: vcenter01 + source: string @go(Source) + + // Type of the network + // Example: standard + type: #NetworkType @go(Type) + + // Full inventory location path of the network + // Example: /vcenter01/network/net0 + location: string @go(Location) + + // Additional properties of the network. + properties: _ @go(Properties,json.RawMessage) + + // Target placement configuration for the network. + placement: #NetworkPlacement @go(Placement) + + // Overrides to the network placement configuration. + overrides: #NetworkPlacement @go(Overrides) +} + +#NetworkFilterable: { + uuid: uuid_9.#UUID @go(UUID) + source_specific_id: string @go(SourceSpecificID) + source: string @go(Source) + type: string @go(Type) + location: string @go(Location) +} + +// NetworkPlacement defines the configurable properties of Network. +// +// swagger:model +#NetworkPlacement: { + // Name of the network on the target. + // Example: "vmware" + network: string @go(Network) + + // NIC type of the interface. + // Example: bridged + nictype: #IncusNICType @go(NICType) + + // Name of the VLAN ID to use with a VLAN network. + // Example: 1 + vlan_id: string @go(VlanID) +} diff --git a/schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/os_go_gen.cue b/schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/os_go_gen.cue new file mode 100644 index 0000000..b98eaa8 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/os_go_gen.cue @@ -0,0 +1,49 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/FuturFusion/migration-manager/shared/api + +package api + +#OSType: string // #enumOSType + +#enumOSType: + #OSTYPE_WINDOWS | + #OSTYPE_LINUX | + #OSTYPE_BSD | + #OSTYPE_FORTIGATE + +#OSTYPE_WINDOWS: #OSType & "windows" +#OSTYPE_LINUX: #OSType & "linux" +#OSTYPE_BSD: #OSType & "bsd" +#OSTYPE_FORTIGATE: #OSType & "fortigate" + +#Distro: string // #enumDistro + +#enumDistro: + #DISTRO_ALMA | + #DISTRO_ARCH | + #DISTRO_DEBIAN | + #DISTRO_UBUNTU | + #DISTRO_ORACLE | + #DISTRO_CENTOS | + #DISTRO_RHEL | + #DISTRO_SUSE | + #DISTRO_ROCKY | + #DISTRO_AMZN | + #DISTRO_FEDORA | + #DISTRO_FREEBSD | + #DISTRO_OTHER + +#DISTRO_ALMA: #Distro & "alma" +#DISTRO_ARCH: #Distro & "arch" +#DISTRO_DEBIAN: #Distro & "debian" +#DISTRO_UBUNTU: #Distro & "ubuntu" +#DISTRO_ORACLE: #Distro & "oracle" +#DISTRO_CENTOS: #Distro & "centos" +#DISTRO_RHEL: #Distro & "rhel" +#DISTRO_SUSE: #Distro & "suse" +#DISTRO_ROCKY: #Distro & "rocky" +#DISTRO_AMZN: #Distro & "amazon" +#DISTRO_FEDORA: #Distro & "fedora" +#DISTRO_FREEBSD: #Distro & "freebsd" +#DISTRO_OTHER: #Distro & "other" diff --git a/schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/properties_go_gen.cue b/schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/properties_go_gen.cue new file mode 100644 index 0000000..946ab6e --- /dev/null +++ b/schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/properties_go_gen.cue @@ -0,0 +1,148 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/FuturFusion/migration-manager/shared/api + +package api + +import uuid_9 "github.com/google/uuid" + +// InstanceProperties are all properties supported by instances. +#InstanceProperties: { + #InstancePropertiesConfigurable + + // Unique identifier of the Instance. + // Example: a2095069-a527-4b2a-ab23-1739325dcac7 + uuid: uuid_9.#UUID @go(UUID) + + // SourceSpecificID is the unique identifier internal to the source type. + // Example: vm-123 (vmware) + source_specific_id: string @go(SourceSpecificID) + + // Location path of the Instance. + // Example: /path/to/instance_name + location: string @go(Location) + + // Description of the Instance. + // Example: Windows Server 2025 + description: string @go(Description) + + // OS name of the Instance. + // Example: Ubuntu + os: string @go(OS) + + // OS version of the Instance. + // Example: 24.04 + os_description: string @go(OSDescription) + + // OS template of the Instance. + // Example: Ubuntu Linux + os_template: string @go(OSTemplate) + + // Whether the Instance has secure-boot enabled. + // Example: true + secure_boot: bool @go(SecureBoot) + + // Whether the Instance uses legacy (CSM) boot. + // Example: true + legacy_boot: bool @go(LegacyBoot) + + // Whether the Instance has a TPM. + // Example: true + tpm: bool @go(TPM) + + // Whether the Instance was running when the sync was performed. + // Example: true + running: bool @go(Running) + + // Whether the Instance supports background-import migrations. + // Example: true + background_import: bool @go(BackgroundImport) + + // List of network interface cards assigned to the Instance. + nics: [...#InstancePropertiesNIC] @go(NICs,[]InstancePropertiesNIC) + + // List of disks assigned to the Instance. + disks: [...#InstancePropertiesDisk] @go(Disks,[]InstancePropertiesDisk) + + // List of snapshots for the Instance. + snapshots: [...#InstancePropertiesSnapshot] @go(Snapshots,[]InstancePropertiesSnapshot) +} + +// InstancePropertiesConfigurable are the configurable properties of an instance. +#InstancePropertiesConfigurable: { + // Name of the Instance. + // Example: myVM + name: string @go(Name) + + // Number of CPUs assigned to the Instance. + // Example: 4 + cpus: int64 @go(CPUs) + + // Memory in bytes assigned to the Instance. + // Example: 1073741824 + memory: int64 @go(Memory) + + // Additional configuration of the Instance. + config: {[string]: string} @go(Config,map[string]string) + + // Architecture of the Instance. + // Example: x86_64 + architecture: string @go(Architecture) +} + +// InstancePropertiesNIC are all properties supported by instance NICs. +#InstancePropertiesNIC: { + // Unique ID identifying the NIC to a network registered in Migration Manager. + // Example: a2095069-a527-4b2a-ab23-1739325dcac7 + uuid: uuid_9.#UUID @go(UUID) + + // Unique identifier of the network associated with the NIC on the source. + // Example: network-123 + source_specific_id: string @go(SourceSpecificID) + + // MAC address of the NIC. + // Example: 00:0c:29:a1:76:30 + hardware_address: string @go(HardwareAddress) + + // Location path of the network associated with the NIC. + // Example: /path/to/my_network + location: string @go(Location) + + // IPv4 address of the NIC. + // Example: 10.0.0.10 + ipv4_address: string @go(IPv4Address) + + // IPv6 address of the NIC. + // Example: fd42::1 + ipv6_address: string @go(IPv6Address) +} + +// InstancePropertiesDisk are all properties supported by instance disks. +#InstancePropertiesDisk: { + // Capacity of the disk in bytes. + // Example: 1073741824 + capacity: int64 @go(Capacity) + + // Name of the disk and associated datastore. + // Example: [mydatastore] disk_1.vmdk + name: string @go(Name) + + // Whether the disk has sharing enabled. + // Example: true + shared: bool @go(Shared) + + // Whether the disk supports migration. + // Example: true + supported: bool @go(Supported) + + // Whether background import has been explicitly verified as supported. + // Example: true + background_import_verified: bool @go(BackgroundImportVerified) +} + +// InstancePropertiesSnapshot are all properties supported by snapshots. +#InstancePropertiesSnapshot: { + // Name of the snapshot. + // Example: snapshot1 + name: string @go(Name) +} diff --git a/schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/queue_go_gen.cue b/schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/queue_go_gen.cue new file mode 100644 index 0000000..f9b1d52 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/queue_go_gen.cue @@ -0,0 +1,98 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/FuturFusion/migration-manager/shared/api + +package api + +import ( + "github.com/google/uuid" + "time" +) + +#MigrationStatusType: string // #enumMigrationStatusType + +#enumMigrationStatusType: + #MIGRATIONSTATUS_BLOCKED | + #MIGRATIONSTATUS_WAITING | + #MIGRATIONSTATUS_CREATING | + #MIGRATIONSTATUS_BACKGROUND_IMPORT | + #MIGRATIONSTATUS_IDLE | + #MIGRATIONSTATUS_FINAL_IMPORT | + #MIGRATIONSTATUS_POST_IMPORT | + #MIGRATIONSTATUS_WORKER_DONE | + #MIGRATIONSTATUS_FINISHED | + #MIGRATIONSTATUS_ERROR | + #MIGRATIONSTATUS_CANCELED | + #MIGRATIONSTATUS_CONFLICT + +#MIGRATIONSTATUS_BLOCKED: #MigrationStatusType & "Blocked" +#MIGRATIONSTATUS_WAITING: #MigrationStatusType & "Waiting" +#MIGRATIONSTATUS_CREATING: #MigrationStatusType & "Creating new VM" +#MIGRATIONSTATUS_BACKGROUND_IMPORT: #MigrationStatusType & "Performing background import tasks" +#MIGRATIONSTATUS_IDLE: #MigrationStatusType & "Idle" +#MIGRATIONSTATUS_FINAL_IMPORT: #MigrationStatusType & "Performing final import tasks" +#MIGRATIONSTATUS_POST_IMPORT: #MigrationStatusType & "Performing post-import tasks" +#MIGRATIONSTATUS_WORKER_DONE: #MigrationStatusType & "Worker tasks complete" +#MIGRATIONSTATUS_FINISHED: #MigrationStatusType & "Finished" +#MIGRATIONSTATUS_ERROR: #MigrationStatusType & "Error" +#MIGRATIONSTATUS_CANCELED: #MigrationStatusType & "Canceled" +#MIGRATIONSTATUS_CONFLICT: #MigrationStatusType & "Conflict" + +#ConflictResolvedMessage: "Conflict resolved" + +// QueueEntry provides a high-level status for an instance that is in a migration stage. +// +// swagger:model +#QueueEntry: { + // UUID for the instance; populated from the source and used across all migration manager operations + // Example: 26fa4eb7-8d4f-4bf8-9a6a-dd95d166dfad + instance_uuid: uuid.#UUID @go(InstanceUUID) + + // The name of the instance + // Example: UbuntuServer + instance_name: string @go(InstanceName) + + // The migration status of the instance + // Example: Running + migration_status: #MigrationStatusType @go(MigrationStatus) + + // A free-form string to provide additional information about the migration status + // Example: "Migration 25% complete" + migration_status_message: string @go(MigrationStatusMessage) + + // A human-friendly name for the batch + // Example: MyBatch + batch_name: string @go(BatchName) + + // Time in UTC that the queue entry received a response from the migration worker + LastWorkerResponse: time.Time + + // The window that this queue entry will perform the final import steps + migration_window: #MigrationWindow @go(MigrationWindow) + + // Configuration for which target the instance will be placed on. + placement: #Placement @go(Placement) +} + +// Placement indicates the destination for a queue entry's instance. +#Placement: { + // Name of the target this queue entry is migrating to + // Example: incus01 + target_name?: string @go(TargetName) + + // Name of the target project this queue entry is migrating to + // Example: default + target_project?: string @go(TargetProject) + + // Storage pools keyed by attached disk name. + // Example: {"[my-datastore] vmname.vmdk": "default"} + storage_pools: {[string]: string} @go(StoragePools,map[string]string) + + // Network placement configuration keyed by attached network identifier. + // Example: {"00:00:00:00:00:01": "incusbr0"} + networks: {[string]: #NetworkPlacement} @go(Networks,map[string]NetworkPlacement) + + // Whether the target instance should be running after migration is complete. + // Example: true + running: bool @go(Running) +} diff --git a/schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/server_go_gen.cue b/schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/server_go_gen.cue new file mode 100644 index 0000000..10f80b4 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/server_go_gen.cue @@ -0,0 +1,70 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/FuturFusion/migration-manager/shared/api + +package api + +#APIVersion: "1.0" +#APIStatus: "devel" + +#ExternalConnectivityStatus: string // #enumExternalConnectivityStatus + +#enumExternalConnectivityStatus: + #EXTERNALCONNECTIVITYSTATUS_UNKNOWN | + #EXTERNALCONNECTIVITYSTATUS_OK | + #EXTERNALCONNECTIVITYSTATUS_CANNOT_CONNECT | + #EXTERNALCONNECTIVITYSTATUS_TLS_ERROR | + #EXTERNALCONNECTIVITYSTATUS_TLS_CONFIRM_FINGERPRINT | + #EXTERNALCONNECTIVITYSTATUS_AUTH_ERROR | + #EXTERNALCONNECTIVITYSTATUS_WAITING_OIDC + +#EXTERNALCONNECTIVITYSTATUS_UNKNOWN: #ExternalConnectivityStatus & "Unknown" +#EXTERNALCONNECTIVITYSTATUS_OK: #ExternalConnectivityStatus & "OK" +#EXTERNALCONNECTIVITYSTATUS_CANNOT_CONNECT: #ExternalConnectivityStatus & "Cannot connect" +#EXTERNALCONNECTIVITYSTATUS_TLS_ERROR: #ExternalConnectivityStatus & "TLS error" +#EXTERNALCONNECTIVITYSTATUS_TLS_CONFIRM_FINGERPRINT: #ExternalConnectivityStatus & "Confirm TLS fingerprint" +#EXTERNALCONNECTIVITYSTATUS_AUTH_ERROR: #ExternalConnectivityStatus & "Authentication error" +#EXTERNALCONNECTIVITYSTATUS_WAITING_OIDC: #ExternalConnectivityStatus & "Waiting for OIDC authentications" + +// ServerPut represents the modifiable fields of a server configuration +// +// swagger:model +#ServerPut: { + // Server configuration map (refer to doc/server.md) + // Example: {"core.https_address": ":6443"} + config: {[string]: string} @go(Config,map[string]string) +} + +// ServerUntrusted represents a server configuration for an untrusted client +// +// swagger:model +#ServerUntrusted: { + #ServerPut + + // Support status of the current API (one of "devel", "stable" or "deprecated") + // Read only: true + // Example: stable + api_status: string @go(APIStatus) + + // API version number + // Read only: true + // Example: 1.0 + api_version: string @go(APIVersion) + + // Whether the client is trusted (one of "trusted" or "untrusted") + // Read only: true + // Example: untrusted + auth: string @go(Auth) + + // List of supported authentication methods + // Read only: true + // Example: ["tls"] + // + // API extension: macaroon_authentication + auth_methods: [...string] @go(AuthMethods,[]string) + + // Server version + // Read only: true + // Example: 1.0.0 + server_version: string @go(ServerVersion) +} diff --git a/schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/source_go_gen.cue b/schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/source_go_gen.cue new file mode 100644 index 0000000..e6d743b --- /dev/null +++ b/schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/source_go_gen.cue @@ -0,0 +1,85 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/FuturFusion/migration-manager/shared/api + +package api + +#SourceType: string // #enumSourceType + +#enumSourceType: + #SOURCETYPE_VMWARE | + #SOURCETYPE_NSX + +#SOURCETYPE_VMWARE: #SourceType & "vmware" +#SOURCETYPE_NSX: #SourceType & "nsx" + +// Source defines properties common to all sources. +// +// swagger:model +#Source: { + SourcePut: #SourcePut + + // Whether the source record was undergoing a data sync when requested. + // Example: true + syncing: bool @go(Syncing) + + // SourceType defines the type of the source + // Example: vmware + source_type: #SourceType @go(SourceType) +} + +// SourcePut defines the configurable properties of Source. +// +// swagger:model +#SourcePut: { + // A human-friendly name for this source + // Example: MySource + name: string @go(Name) + + // Properties contains source type specific properties + properties: _ @go(Properties,json.RawMessage) +} + +// VMwareProperties defines the set of VMware specific properties of an endpoint that the migration manager can connect to. +#VMwareProperties: { + // Hostname or IP address of the source endpoint + // Example: vsphere.local + endpoint: string @go(Endpoint) + + // Store the expected source's TLS certificate, in raw bytes. Useful in situations when TLS certificate validation fails, such as when using self-signed certificates. + trusted_server_certificate?: bytes @go(ServerCertificate,[]byte) + + // If set and the fingerprint matches that of the ServerCertificate, enables use of that certificate when performing TLS handshake. + // Example: b51b3046a03164a2ca279222744b12fe0878a8c12311c88fad427f4e03eca42d + trusted_server_certificate_fingerprint?: string @go(TrustedServerCertificateFingerprint) + + // Username to authenticate against the endpoint + // Example: admin + username: string @go(Username) + + // Password to authenticate against the endpoint + // Example: password + password: string @go(Password) + + // Connectivity status of this source + connectivity_status: #ExternalConnectivityStatus @go(ConnectivityStatus) + + // Maximum number of concurrent imports that can occur + // Example: 10 + import_limit?: int @go(ImportLimit) + + // Timeout for establishing connections to the source. + // Example: 10m + connection_timeout: #Duration @go(ConnectionTimeout) + + // Timeout for importing individual virtual machines from the source. + // Example: 10s + sync_timeout: #Duration @go(SyncTimeout) + + // Number of VMs that will be concurrently fetched from the source. + // Example: 1 + sync_limit: int @go(SyncLimit) + + // Datacenters to search for VMs, networks, and datastores. Defaults to all datacenters. + datacenters: [...string] @go(Datacenters,[]string) +} diff --git a/schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/system_go_gen.cue b/schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/system_go_gen.cue new file mode 100644 index 0000000..b3a18e4 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/system_go_gen.cue @@ -0,0 +1,218 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/FuturFusion/migration-manager/shared/api + +package api + +import "github.com/google/uuid" + +// SystemConfig is the full set of system configuration options for Migration Manager. +#SystemConfig: { + network: #SystemNetwork @go(Network) + security: #SystemSecurity @go(Security) + settings: #SystemSettings @go(Settings) +} + +// SystemSettings represents global system settings. +// +// swagger:model +#SystemSettings: { + // Interval over which data from all sources will be periodically resynced. + sync_interval: #Duration @go(SyncInterval) + + // Whether automatic periodic sync of all sources should be disabled. + disable_auto_sync: bool @go(DisableAutoSync) + + // Daemon log level. + log_level: string @go(LogLevel) + + // Additional logging targets. + log_targets: [...#SystemSettingsLog] @go(LogTargets,[]SystemSettingsLog) +} + +#LogType: string // #enumLogType + +#enumLogType: + #LogTypeWebhook + +#LogScope: string // #enumLogScope + +#enumLogScope: + #LogScopeLogging | + #LogScopeLifecycle + +// LogTypeWebhook is a webhook logging target. +#LogTypeWebhook: #LogType & "webhook" + +// LogScopeLogging is a log scope for regular logs. +#LogScopeLogging: #LogScope & "logging" + +// LogScopeLifecycle is a log scope for lifecycle events. +#LogScopeLifecycle: #LogScope & "lifecycle" + +// SystemSettingsLog represents configuration for a logging target. +#SystemSettingsLog: { + // Name identifying the logging target. + // Example: foo + name: string @go(Name) + + // Type of the logging target. + // Example: webhook + type: #LogType @go(Type) + + // Log level to display. + // Example: WARN + level: string @go(Level) + + // Address of the logging target. + // Example: https://example.com:443 + address: string @go(Address) + + // Username of the logging target. + username: string @go(Username) + + // Password of the logging target. + password: string @go(Password) + + // CA Certificate used to authenticate with the logging target. + ca_cert: string @go(CACert) + + // Number of attempts to make against the logging target. + retry_count: int @go(RetryCount) + + // How long to wait between retrying a log. + retry_timeout: #Duration @go(RetryTimeout) + + // Logging scopes to send to the logging target. + // Example: [logging, lifecycle] + scopes: [...#LogScope] @go(Scopes,[]LogScope) +} + +// SystemNetwork represents the system's network configuration. +// +// swagger:model +#SystemNetwork: { + // Address and port to bind the REST API to. + rest_server_address: string @go(Address) + + // URL used by Migration Manager workers to connect to the Migration Manager daemon. + worker_endpoint: string @go(WorkerEndpoint) +} + +// SystemSecurity represents the system's security configuration. +// +// swagger:model +#SystemSecurity: { + // An array of SHA256 certificate fingerprints that belong to trusted TLS clients. + trusted_tls_client_cert_fingerprints: [...string] @go(TrustedTLSClientCertFingerprints,[]string) + + // An array of trusted HTTPS proxy addresses. + trusted_https_proxies: [...string] @go(TrustedHTTPSProxies,[]string) + + // OIDC configuration. + oidc: #SystemSecurityOIDC @go(OIDC) + + // OpenFGA configuration. + openfga: #SystemSecurityOpenFGA @go(OpenFGA) + + // ACME configuration. + acme: #SystemSecurityACME @go(ACME) +} + +// SystemSecurityOIDC is the OIDC related part of the system's security configuration. +#SystemSecurityOIDC: { + // OIDC Issuer. + issuer: string @go(Issuer) + + // Client ID used for communication with the OIDC issuer. + client_id: string @go(ClientID) + + // Scopes to be requested. + scopes: string @go(Scope) + + // Audience the OIDC tokens should be verified against. + audience: string @go(Audience) + + // Claim which should be used to identify the user or subject. + claim: string @go(Claim) +} + +// SystemSecurityOpenFGA is the OpenFGA related part of the system's security configuration. +#SystemSecurityOpenFGA: { + // API token used for communication with the OpenFGA system. + api_token: string @go(APIToken) + + // URL of the OpenFGA API. + api_url: string @go(APIURL) + + // ID of the OpenFGA store. + store_id: string @go(StoreID) +} + +// ACMEChallengeType represents challenge types for ACME configuration. +#ACMEChallengeType: string // #enumACMEChallengeType + +#enumACMEChallengeType: + #ACMEChallengeHTTP | + #ACMEChallengeDNS + +// ACMEChallengeHTTP is the HTTP ACME challenge type. +#ACMEChallengeHTTP: #ACMEChallengeType & "HTTP-01" + +// ACMEChallengeDNS is the DNS ACME challenge type. +#ACMEChallengeDNS: #ACMEChallengeType & "DNS-01" + +#SystemSecurityACME: { + // Agree to ACME terms of service. + agree_tos: bool @go(AgreeTOS) + + // URL to the directory resource of the ACME service. + ca_url: string @go(CAURL) + + // ACME challenge type to use. + challenge: #ACMEChallengeType @go(Challenge) + + // Domain for which the certificate is issued. + domain: string @go(Domain) + + // Email address used for the account registration. + email: string @go(Email) + + // Address and interface for HTTP server (used by HTTP-01). + http_challenge_address: string @go(Address) + + // Backend provider for the challenge (used by DNS-01). + provider: string @go(Provider) + + // Environment variables to set during the challenge (used by DNS-01). + provider_environment: [...string] @go(ProviderEnvironment,[]string) + + // List of DNS resolvers (used by DNS-01). + provider_resolvers: [...string] @go(ProviderResolvers,[]string) +} + +// SystemCertificatePost represents the fields available for an update of the +// system certificate (server certificate), key, and CA. +// +// swagger:model +#SystemCertificatePost: { + // The new certificate (X509 PEM encoded) for the system (server certificate). + // Example: X509 PEM certificate + certificate: string @go(Cert) + + // The new certificate key (X509 PEM encoded) for the system (server key). + // Example: X509 PEM certificate key + key?: string @go(Key) + + // The new certificate CA (X509 PEM encoded) for the system (server CA). + // Example: X509 PEM certificate CA + ca: string @go(CA) +} + +// SystemBackupPost represents configuration for creating a system backup. +// +// swagger:model +#SystemBackupPost: { + // List of artifact UUIDs to include in the backup. + include_artifacts: [...uuid.#UUID] @go(IncludeArtifacts,[]uuid.UUID) +} diff --git a/schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/target_go_gen.cue b/schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/target_go_gen.cue new file mode 100644 index 0000000..903a1fa --- /dev/null +++ b/schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/target_go_gen.cue @@ -0,0 +1,74 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/FuturFusion/migration-manager/shared/api + +package api + +import "github.com/zitadel/oidc/v3/pkg/oidc" + +#TargetType: string // #enumTargetType + +#enumTargetType: + #TARGETTYPE_INCUS + +#TARGETTYPE_INCUS: #TargetType & "incus" + +// Target defines properties common to all targets. +// +// swagger:model +#Target: { + TargetPut: #TargetPut + + // TargetType defines the type of the target + target_type: #TargetType @go(TargetType) +} + +// TargetPut defines the configurable properties of Target. +// +// swagger:model +#TargetPut: { + // A human-friendly name for this target + // Example: MyTarget + name: string @go(Name) + + // Properties contains target type specific properties + properties: _ @go(Properties,json.RawMessage) +} + +// IncusProperties defines the set of Incus specific properties of a target that the migration manager can connect to. +#IncusProperties: { + // Hostname or IP address of the target endpoint + // Example: https://incus.local:6443 + endpoint: string @go(Endpoint) + + // Store the expected target's TLS certificate, in raw bytes. Useful in situations when TLS certificate validation fails, such as when using self-signed certificates. + trusted_server_certificate?: bytes @go(ServerCertificate,[]byte) + + // If set and the fingerprint matches that of the ServerCertificate, enables use of that certificate when performing TLS handshake. + // Example: b51b3046a03164a2ca279222744b12fe0878a8c12311c88fad427f4e03eca42d + trusted_server_certificate_fingerprint?: string @go(TrustedServerCertificateFingerprint) + + // base64-encoded TLS client key for authentication + tls_client_key?: string @go(TLSClientKey) + + // base64-encoded TLS client certificate for authentication + tls_client_cert?: string @go(TLSClientCert) + + // OpenID Connect tokens + oidc_tokens?: null | oidc.#Tokens @go(OIDCTokens,*oidc.Tokens[*oidc.IDTokenClaims]) + + // Connectivity status of this target + connectivity_status: #ExternalConnectivityStatus @go(ConnectivityStatus) + + // Maximum number of concurrent imports that can occur + // Example: 10 + import_limit?: int @go(ImportLimit) + + // Maximum number of concurrent instance creations that can occur + // Example: 10 + create_limit?: int @go(CreateLimit) + + // Timeout for establishing connections to the target. + // Example: 5m + connection_timeout: #Duration @go(ConnectionTimeout) +} diff --git a/schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/warning_go_gen.cue b/schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/warning_go_gen.cue new file mode 100644 index 0000000..39870d8 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/warning_go_gen.cue @@ -0,0 +1,115 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/FuturFusion/migration-manager/shared/api + +package api + +import ( + uuid_9 "github.com/google/uuid" + "time" +) + +// WarningStatus is the acknowledgement status of a warning. +#WarningStatus: string // #enumWarningStatus + +#enumWarningStatus: + #WARNINGSTATUS_NEW | + #WARNINGSTATUS_ACKNOWLEDGED + +// WarningType represents a warning message group. +#WarningType: string // #enumWarningType + +#enumWarningType: + #NetworkImportFailed | + #InstanceImportFailed | + #InstanceIgnored | + #InstanceMissingNetworkSource | + #SourceUnavailable | + #InstanceIncomplete | + #InstanceCannotMigrate + +// NetworkImportFailed indicates a network failed to be imported from its source. +#NetworkImportFailed: #WarningType & "Networks not imported" + +// InstanceImportFailed indicates an instance failed to be imported from its source. +#InstanceImportFailed: #WarningType & "Instances not imported" + +// InstanceIgnored indicates that an instance was purposely ignored from source import. +#InstanceIgnored: #WarningType & "Instances were ignored" + +// InstanceMissingNetworkSource indicates an instance contains a network with an external source, but that source is not registered. +#InstanceMissingNetworkSource: #WarningType & "External networks with no registered source" + +// SourceUnavailable indicates a target is unavailable. +#SourceUnavailable: #WarningType & "Sources are unavailable" + +// InstanceIncomplete indicates an instance was imported with incomplete properties. +#InstanceIncomplete: #WarningType & "Instances partially imported" + +// InstanceCannotMigrate indicates an instance is restricted and cannot be migrated. +#InstanceCannotMigrate: #WarningType & "Instance migration is restricted" + +#WARNINGSTATUS_NEW: #WarningStatus & "new" +#WARNINGSTATUS_ACKNOWLEDGED: #WarningStatus & "acknowledged" + +// WarningScope represents a scope for a warning. +#WarningScope: { + // Action scope of the warning. + // Example: sync + scope: string @go(Scope) + + // Entity the warning relates to. + // Example: source + entity_type: string @go(EntityType) + + // Name of the entity. + // Example: mySource + entity: string @go(Entity) +} + +// WarningPut represents configurable properties of a warning. +// +// swagger:model +#WarningPut: { + // Current acknowledgement status of the warning. + // Example: new + status: #WarningStatus @go(Status) +} + +// Warning represents a record of a warning. +// +// swagger:model +#Warning: { + #WarningPut + + // Unique identifier of the warning. + // Example: a2095069-a527-4b2a-ab23-1739325dcac7 + uuid: uuid_9.#UUID @go(UUID) + + // Scope of the warning. + scope: #WarningScope @go(Scope) + + // Type of the warning. + // Example: Networks not imported + type: #WarningType @go(Type) + + // First time the warning was seen. + // Example: 2025-01-01 01:00:00 + first_seen_date: time.Time @go(FirstSeenDate) + + // Most recent time the warning was seen. + // Example: 2025-01-01 01:00:00 + last_seen_date: time.Time @go(LastSeenDate) + + // Last time the warning was changed. + // Example: 2025-01-01 01:00:00 + updated_date: time.Time @go(UpdatedDate) + + // Messages associated with the warning type. + // Example: list of messages + messages: [...string] @go(Messages,[]string) + + // Number of times the warning has been seen. + // Example: 10 + count: int @go(Count) +} diff --git a/schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/windows_go_gen.cue b/schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/windows_go_gen.cue new file mode 100644 index 0000000..4b89ab8 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/windows_go_gen.cue @@ -0,0 +1,32 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/FuturFusion/migration-manager/shared/api + +package api + +import "time" + +// MigrationWindow defines the scheduling of a batch migration. +// +// swagger:model +#MigrationWindow: { + // Name of the migration window. + name: string @go(Name) + + // Start time for finalizing migrations after background import. + start: time.Time @go(Start) + + // End time for finalizing migrations after background import. + end: time.Time @go(End) + + // Lockout time after which the batch can no longer modify the target instance. + lockout: time.Time @go(Lockout) + + // Configuration for the window. + config: #MigrationWindowConfig @go(Config) +} + +#MigrationWindowConfig: { + // Number of instances that can be assigned to the window. + capacity: int @go(Capacity) +} diff --git a/schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/worker_go_gen.cue b/schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/worker_go_gen.cue new file mode 100644 index 0000000..56f149b --- /dev/null +++ b/schemas/cue.mod/gen/github.com/FuturFusion/migration-manager/shared/api/worker_go_gen.cue @@ -0,0 +1,96 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/FuturFusion/migration-manager/shared/api + +package api + +#WorkerCommandType: int // #enumWorkerCommandType + +#enumWorkerCommandType: + #WORKERCOMMAND_UNKNOWN | + #WORKERCOMMAND_IDLE | + #WORKERCOMMAND_IMPORT_DISKS | + #WORKERCOMMAND_FINALIZE_IMPORT | + #WORKERCOMMAND_POST_IMPORT + +#values_WorkerCommandType: { + WORKERCOMMAND_UNKNOWN: #WORKERCOMMAND_UNKNOWN + WORKERCOMMAND_IDLE: #WORKERCOMMAND_IDLE + WORKERCOMMAND_IMPORT_DISKS: #WORKERCOMMAND_IMPORT_DISKS + WORKERCOMMAND_FINALIZE_IMPORT: #WORKERCOMMAND_FINALIZE_IMPORT + WORKERCOMMAND_POST_IMPORT: #WORKERCOMMAND_POST_IMPORT +} + +#WORKERCOMMAND_UNKNOWN: #WorkerCommandType & 0 +#WORKERCOMMAND_IDLE: #WorkerCommandType & 1 +#WORKERCOMMAND_IMPORT_DISKS: #WorkerCommandType & 2 +#WORKERCOMMAND_FINALIZE_IMPORT: #WorkerCommandType & 3 +#WORKERCOMMAND_POST_IMPORT: #WorkerCommandType & 4 + +#WorkerResponseType: int // #enumWorkerResponseType + +#enumWorkerResponseType: + #WORKERRESPONSE_UNKNOWN | + #WORKERRESPONSE_RUNNING | + #WORKERRESPONSE_SUCCESS | + #WORKERRESPONSE_FAILED + +#values_WorkerResponseType: { + WORKERRESPONSE_UNKNOWN: #WORKERRESPONSE_UNKNOWN + WORKERRESPONSE_RUNNING: #WORKERRESPONSE_RUNNING + WORKERRESPONSE_SUCCESS: #WORKERRESPONSE_SUCCESS + WORKERRESPONSE_FAILED: #WORKERRESPONSE_FAILED +} + +#WORKERRESPONSE_UNKNOWN: #WorkerResponseType & 0 +#WORKERRESPONSE_RUNNING: #WorkerResponseType & 1 +#WORKERRESPONSE_SUCCESS: #WorkerResponseType & 2 +#WORKERRESPONSE_FAILED: #WorkerResponseType & 3 + +// WorkerCommand defines a command sent from the migration manager to a worker. +#WorkerCommand: { + // The command for the worker to execute + // Example: WORKERCOMMAND_IMPORT_DISKS + command: #WorkerCommandType @go(Command) + + // Internal path to the instance + // Example: /SHF/vm/Migration Tests/DebianTest + location: string @go(Location) + + // SourceType declares the type of the worker and is used as a hint to + // correctly process the details provided in Source. + sourceType: #SourceType @go(SourceType) + + // Source for the worker to fetch VM metadata and/or disk from. + source: _ @go(Source,json.RawMessage) + + // Operating system type + // Example: linux + os_type: #OSType @go(OSType) + + // Distribution name used for specific post-migration handling. + // Example: "RHEL" + distribution: #Distro @go(Distribution) + + // Distribution version used for specific post-migration handling. + // Example: 7 + distribution_version: string @go(DistributionVersion) + + // Architecture of the instance + // Example: x86_64 + architecture: string @go(Architecture) +} + +// WorkerResponse defines a response received from a worker. +#WorkerResponse: { + // The status of the command the work is/was executing. + // Example: WORKERRESPONSE_RUNNING + status: #WorkerResponseType @go(Status) + + // A free-form string to provide additional information about the command status + // Example: "Migration 25% complete" + status_message: string @go(StatusMessage) + + // Additional data included with the response. + metadata: bytes @go(Metadata,[]byte) +} diff --git a/schemas/cue.mod/gen/github.com/FuturFusion/operations-center/shared/api/system/system_go_gen.cue b/schemas/cue.mod/gen/github.com/FuturFusion/operations-center/shared/api/system/system_go_gen.cue new file mode 100644 index 0000000..4d057f0 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/FuturFusion/operations-center/shared/api/system/system_go_gen.cue @@ -0,0 +1,223 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/FuturFusion/operations-center/shared/api/system + +package system + +// CertificatePost represents the fields available for an update of the +// system certificate (server certificate) and key. +// +// swagger:model +#CertificatePost: { + // The new certificate (X509 PEM encoded) for the system (server certificate). + // Example: X509 PEM certificate + certificate: string @go(Certificate) + + // The new certificate key (X509 PEM encoded) for the system (server key). + // Example: X509 PEM certificate key + key: string @go(Key) +} + +// Network represents the system's network configuration. +// +// swagger:model +#Network: { + #NetworkPut +} + +// NetworkPut represents the fields available for an update of the +// system's network configuration. +// +// swagger:model +#NetworkPut: { + // Address of Operations Center which is used by managed servers to connect. + address: string @go(OperationsCenterAddress) + + // Address and port to bind the REST API to. + rest_server_address: string @go(RestServerAddress) +} + +// Security represents the system's security configuration. +// +// swagger:model +#Security: { + #SecurityPut +} + +// SecurityPut represents the fields available for an update of the +// system's security configuration. +// +// swagger:model +#SecurityPut: { + // OIDC configuration. + oidc: #SecurityOIDC @go(OIDC) + + // OpenFGA configuration. + openfga: #SecurityOpenFGA @go(OpenFGA) + + // ACME configuration. + acme: #SecurityACME @go(ACME) + + // An array of SHA256 certificate fingerprints that belong to trusted TLS clients. + trusted_tls_client_cert_fingerprints: [...string] @go(TrustedTLSClientCertFingerprints,[]string) + + // An array of trusted HTTPS proxy addresses. + trusted_https_proxies: [...string] @go(TrustedHTTPSProxies,[]string) +} + +// SecurityOIDC is the OIDC related part of the system's security +// configuration. +#SecurityOIDC: { + // OIDC Issuer. + issuer: string @go(Issuer) + + // CLient ID used for communication with the OIDC issuer. + client_id: string @go(ClientID) + + // Scopes to be requested. + scopes: string @go(Scope) + + // Audience the OIDC tokens should be verified against. + audience: string @go(Audience) + + // Claim which should be used to identify the user or subject. + claim: string @go(Claim) +} + +// SecurityOpenFGA is the OpenFGA related part of the system's security +// configuration. +#SecurityOpenFGA: { + // API token used for communication with the OpenFGA system. + api_token: string @go(APIToken) + + // URL of the OpenFGA API. + api_url: string @go(APIURL) + + // ID of the OpenFGA store. + store_id: string @go(StoreID) +} + +// ACMEChallengeType represents challenge types for ACME configuration. +#ACMEChallengeType: string // #enumACMEChallengeType + +#enumACMEChallengeType: + #ACMEChallengeHTTP | + #ACMEChallengeDNS + +// ACMEChallengeHTTP is the HTTP ACME challenge type. +#ACMEChallengeHTTP: #ACMEChallengeType & "HTTP-01" + +// ACMEChallengeDNS is the DNS ACME challenge type. +#ACMEChallengeDNS: #ACMEChallengeType & "DNS-01" + +#SecurityACME: { + // Agree to ACME terms of service. + agree_tos: bool @go(AgreeTOS) + + // CAURL holds the URL to the CA directory resource of the ACME service. + ca_url: string @go(CAURL) + + // Challenge holds the ACME challenge type to use. + challenge: #ACMEChallengeType @go(Challenge) + + // Domain for which the certificate is issued. + domain: string @go(Domain) + + // Email address used for the account registration. + email: string @go(Email) + + // Address and interface for HTTP server (used by HTTP-01). + http_challenge_address: string @go(Address) + + // Backend provider for the challenge (used by DNS-01)> + provider: string @go(Provider) + + // Environment variables to set during the challenge (used by DNS-01). + provider_environment: [...string] @go(ProviderEnvironment,[]string) + + // List of DNS resolvers (used by DNS-01). + provider_resolvers: [...string] @go(ProviderResolvers,[]string) +} + +// Settings represents global system settings. +// +// swagger:model +#Settings: { + #SettingsPut +} + +// SettingsPut represents the fields available for an update of the global +// system settings. +// +// swagger:model +#SettingsPut: { + // Daemon log level. + log_level: string @go(LogLevel) +} + +// Updates represents the system's updates configuration. +// +// swagger:model +#Updates: { + #UpdatesPut +} + +// UpdatesPut represents the fields available for an update of the +// system's updates configuration. +// +// swagger:model +#UpdatesPut: { + // Source is the URL of the origin, the updates should be fetched from. + source: string @go(Source) + + // Root CA certificate used to verify the signature of index.sjson. + // Example: -----BEGIN CERTIFICATE-----\nMII...\n-----END CERTIFICATE----- + signature_verification_root_ca: string @go(SignatureVerificationRootCA) + + // Filter expression for updates using https://expr-lang.org/ on struct + // provisioning.Update. + // If a filter is defined, the filter needs to evaluate to true for the update + // being fetched by Operations Center. + // Empty filter expression does fallback to the default value defined below. + // To disable filtering, set to "true", which causes the filter to allow all + // updates. + // + // Default: 'stable' in upstream_channels + // + // Example: 'stable' in upstream_channels + filter_expression: string @go(FilterExpression) + + // Filter expression for update files using https://expr-lang.org/ on struct + // provisioning.UpdateFile. + // If a filter is defined, the filter needs to evaluate to true for the file + // being fetched by Operations Center. + // Empty filter expression does fallback to the default value defined below. + // To disable filtering, set to "true", which causes the filter to allow all + // files. + // + // For file filter expression, the following helper functions are available: + // - applies_to_architecture(arch string, expected_arch ...string) bool + // Returns true if the 'arch' string matches one of the given + // 'expected_arch' strings or if 'architecure' is not set. + // + // Default: + // applies_to_architecture(architecture, "x86_64") + // + // Examples: + // architecture == "x86_64" + file_filter_expression: string @go(FileFilterExpression) + + // UpdatesDefaultChannel is the update channel, which is used by default + // new updates fetched from upstream. + updates_default_channel: string @go(UpdatesDefaultChannel) + + // ServerDefaultChannel is the default channel assigned to new server + // and cluster instances. + server_default_channel: string @go(ServerDefaultChannel) + + // ImageServerAuthenticationByQueryParam is a flag that allows to switch from + // HTTP header based image server authentication to query parameter instead. + // If set to true, authentication is done by `token` query parameter on the + // first request, if set to false, authentication is done by HTTP header. + image_server_authentication_by_query_param: bool @go(ImageServerAuthenticationByQueryParam) +} diff --git a/schemas/cue.mod/gen/github.com/google/uuid/dce_go_gen.cue b/schemas/cue.mod/gen/github.com/google/uuid/dce_go_gen.cue new file mode 100644 index 0000000..e647183 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/google/uuid/dce_go_gen.cue @@ -0,0 +1,23 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/google/uuid + +package uuid + +// A Domain represents a Version 2 domain +#Domain: uint8 // #enumDomain + +#enumDomain: + #Person | + #Group | + #Org + +#values_Domain: { + Person: #Person + Group: #Group + Org: #Org +} + +#Person: #Domain & 0 +#Group: #Domain & 1 +#Org: #Domain & 2 diff --git a/schemas/cue.mod/gen/github.com/google/uuid/doc_go_gen.cue b/schemas/cue.mod/gen/github.com/google/uuid/doc_go_gen.cue new file mode 100644 index 0000000..dac6d04 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/google/uuid/doc_go_gen.cue @@ -0,0 +1,12 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/google/uuid + +// Package uuid generates and inspects UUIDs. +// +// UUIDs are based on RFC 4122 and DCE 1.1: Authentication and Security +// Services. +// +// A UUID is a 16 byte (128 bit) array. UUIDs may be used as keys to +// maps or compared directly. +package uuid diff --git a/schemas/cue.mod/gen/github.com/google/uuid/null_go_gen.cue b/schemas/cue.mod/gen/github.com/google/uuid/null_go_gen.cue new file mode 100644 index 0000000..aa324bd --- /dev/null +++ b/schemas/cue.mod/gen/github.com/google/uuid/null_go_gen.cue @@ -0,0 +1,20 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/google/uuid + +package uuid + +// NullUUID represents a UUID that may be null. +// NullUUID implements the SQL driver.Scanner interface so +// it can be used as a scan destination: +// +// var u uuid.NullUUID +// err := db.QueryRow("SELECT name FROM foo WHERE id=?", id).Scan(&u) +// ... +// if u.Valid { +// // use u.UUID +// } else { +// // NULL value +// } +// +#NullUUID: _ diff --git a/schemas/cue.mod/gen/github.com/google/uuid/time_go_gen.cue b/schemas/cue.mod/gen/github.com/google/uuid/time_go_gen.cue new file mode 100644 index 0000000..7c70aa5 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/google/uuid/time_go_gen.cue @@ -0,0 +1,15 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/google/uuid + +package uuid + +// A Time represents a time as the number of 100's of nanoseconds since 15 Oct +// 1582. +#Time: int64 + +_#lillian: 2299160 +_#unix: 2440587 +_#epoch: 141427 +_#g1582: 12219292800 +_#g1582ns100: 122192928000000000 diff --git a/schemas/cue.mod/gen/github.com/google/uuid/uuid_go_gen.cue b/schemas/cue.mod/gen/github.com/google/uuid/uuid_go_gen.cue new file mode 100644 index 0000000..ddfa34f --- /dev/null +++ b/schemas/cue.mod/gen/github.com/google/uuid/uuid_go_gen.cue @@ -0,0 +1,41 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/google/uuid + +package uuid + +// A UUID is a 128 bit (16 byte) Universal Unique IDentifier as defined in RFC +// 4122. +#UUID: string + +// A Version represents a UUID's version. +#Version: uint8 + +// A Variant represents a UUID's variant. +#Variant: uint8 // #enumVariant + +#enumVariant: + #Invalid | + #RFC4122 | + #Reserved | + #Microsoft | + #Future + +#values_Variant: { + Invalid: #Invalid + RFC4122: #RFC4122 + Reserved: #Reserved + Microsoft: #Microsoft + Future: #Future +} + +#Invalid: #Variant & 0 +#RFC4122: #Variant & 1 +#Reserved: #Variant & 2 +#Microsoft: #Variant & 3 +#Future: #Variant & 4 + +_#randPoolSize: 256 + +// UUIDs is a slice of UUID types. +#UUIDs: [...#UUID] diff --git a/schemas/cue.mod/gen/github.com/google/uuid/version7_go_gen.cue b/schemas/cue.mod/gen/github.com/google/uuid/version7_go_gen.cue new file mode 100644 index 0000000..ea6ef5c --- /dev/null +++ b/schemas/cue.mod/gen/github.com/google/uuid/version7_go_gen.cue @@ -0,0 +1,7 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/google/uuid + +package uuid + +_#nanoPerMilli: 1000000 diff --git a/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/application_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/application_go_gen.cue new file mode 100644 index 0000000..fc97572 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/application_go_gen.cue @@ -0,0 +1,24 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus-os/incus-osd/api + +package api + +import "time" + +// ApplicationConfig represents additional configuration for a generic application. +#ApplicationConfig: {} + +// ApplicationState represents the state of a generic application. +#ApplicationState: { + initialized: bool @go(Initialized) + version: string @go(Version) + available_versions: [...string] @go(AvailableVersions,[]string) + last_restored?: null | time.Time @go(LastRestored,*time.Time) +} + +// Application represents the state and configuration of a generic application. +#Application: { + state: #ApplicationState @go(State) + config: #ApplicationConfig @go(Config) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/application_incus_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/application_incus_go_gen.cue new file mode 100644 index 0000000..8379690 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/application_incus_go_gen.cue @@ -0,0 +1,28 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus-os/incus-osd/api + +package api + +// ApplicationIncusConfigLXCFS represents the LXCFS configuration options for the Incus application. +#ApplicationIncusConfigLXCFS: { + cpu_shares: bool @go(CPUShares) + load_average: bool @go(LoadAverage) +} + +// ApplicationIncusConfig represents additional configuration for the Incus application. +#ApplicationIncusConfig: { + ApplicationConfig: #ApplicationConfig + lxcfs: #ApplicationIncusConfigLXCFS @go(LXCFS) +} + +// ApplicationIncusState represents the state of the Incus application. +#ApplicationIncusState: { + ApplicationState: #ApplicationState +} + +// ApplicationIncus represents the state and configuration of the Incus application. +#ApplicationIncus: { + state: #ApplicationIncusState @go(State) + config: #ApplicationIncusConfig @go(Config) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/debug_tui_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/debug_tui_go_gen.cue new file mode 100644 index 0000000..adf0149 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/debug_tui_go_gen.cue @@ -0,0 +1,11 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus-os/incus-osd/api + +package api + +// DebugTUI defines a struct to hold a message to log along with its severity. +#DebugTUI: { + level: _ @go(Level,slog.Level) + message: string @go(Message) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/doc_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/doc_go_gen.cue new file mode 100644 index 0000000..ba260de --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/doc_go_gen.cue @@ -0,0 +1,6 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus-os/incus-osd/api + +// Package api is used for user facing API structs. +package api diff --git a/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/seed/applications_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/seed/applications_go_gen.cue new file mode 100644 index 0000000..10e9442 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/seed/applications_go_gen.cue @@ -0,0 +1,16 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus-os/incus-osd/api/seed + +package seed + +// Applications represents the applications seed file. +#Applications: { + version: string @go(Version) + applications: [...#Application] @go(Applications,[]Application) +} + +// Application represents a single application with the applications seed. +#Application: { + name: string @go(Name) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/seed/doc_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/seed/doc_go_gen.cue new file mode 100644 index 0000000..7e36a19 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/seed/doc_go_gen.cue @@ -0,0 +1,6 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus-os/incus-osd/api/seed + +// Package seed contains the API files used for image seed files. +package seed diff --git a/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/seed/incus_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/seed/incus_go_gen.cue new file mode 100644 index 0000000..c836504 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/seed/incus_go_gen.cue @@ -0,0 +1,14 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus-os/incus-osd/api/seed + +package seed + +import incusapi "github.com/lxc/incus/v7/shared/api" + +// Incus represents the Incus seed file. +#Incus: { + version: string @go(Version) + apply_defaults: bool @go(ApplyDefaults) + preseed?: null | incusapi.#InitPreseed @go(Preseed,*incusapi.InitPreseed) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/seed/install_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/seed/install_go_gen.cue new file mode 100644 index 0000000..c4950a1 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/seed/install_go_gen.cue @@ -0,0 +1,34 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus-os/incus-osd/api/seed + +package seed + +// Install represents the install seed. +#Install: { + version: string @go(Version) + force_install: bool @go(ForceInstall) + force_install_confirmation?: string @go(ForceInstallConfirmation) + force_reboot: bool @go(ForceReboot) + security?: null | #InstallSecurity @go(Security,*InstallSecurity) + target?: null | #InstallTarget @go(Target,*InstallTarget) +} + +// InstallSecurity defines a set of mutually exclusive options that allow IncusOS to run in a degraded security state. +// !!THESE OPTIONS WILL REDUCE THE SYSTEM'S SECURITY COMPARED TO USING PROPERLY CONFIGURED SECURE BOOT AND A TPM!! +#InstallSecurity: { + missing_tpm: bool @go(MissingTPM) + missing_secure_boot: bool @go(MissingSecureBoot) +} + +// InstallTarget defines options used to select the target install disk. +#InstallTarget: { + // The following options are logically AND'ed together when selecting between more than one possible install targets. + bus?: string @go(Bus) + id?: string @go(ID) + max_size?: string @go(MaxSize) + min_size?: string @go(MinSize) + + // If defined, sort potential targets by their capacity and pick the first one. + sort_order?: string @go(SortOrder) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/seed/migration_manager_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/seed/migration_manager_go_gen.cue new file mode 100644 index 0000000..478057d --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/seed/migration_manager_go_gen.cue @@ -0,0 +1,26 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus-os/incus-osd/api/seed + +package seed + +import "github.com/FuturFusion/migration-manager/shared/api" + +// MigrationManager represents a Migration Manager seed file. +#MigrationManager: { + version: string @go(Version) + + // A list of PEM-encoded trusted client certificates. The SHA256 fingerprint of + // each certificate will be added to the list of any SHA256 fingerprints provided + // in SystemSecurity.TrustedTLSClientCertFingerprints. + trusted_client_certificates?: [...string] @go(TrustedClientCertificates,[]string) + apply_defaults: bool @go(ApplyDefaults) + preseed?: null | #MigrationManagerPreseed @go(Preseed,*MigrationManagerPreseed) +} + +// MigrationManagerPreseed holds seed configuration for Migration Manager. +#MigrationManagerPreseed: { + system_certificate?: null | api.#SystemCertificatePost @go(SystemCertificate,*api.SystemCertificatePost) + system_network?: null | api.#SystemNetwork @go(SystemNetwork,*api.SystemNetwork) + system_security?: null | api.#SystemSecurity @go(SystemSecurity,*api.SystemSecurity) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/seed/network_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/seed/network_go_gen.cue new file mode 100644 index 0000000..504dadd --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/seed/network_go_gen.cue @@ -0,0 +1,13 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus-os/incus-osd/api/seed + +package seed + +import "github.com/lxc/incus-os/incus-osd/api" + +// Network represents the network seed. +#Network: { + api.#SystemNetworkConfig + version: string @go(Version) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/seed/operations_center_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/seed/operations_center_go_gen.cue new file mode 100644 index 0000000..0d31bd0 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/seed/operations_center_go_gen.cue @@ -0,0 +1,27 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus-os/incus-osd/api/seed + +package seed + +import "github.com/FuturFusion/operations-center/shared/api/system" + +// OperationsCenter represents an Operations Center seed file. +#OperationsCenter: { + version: string @go(Version) + + // A list of PEM-encoded trusted client certificates. The SHA256 fingerprint of + // each certificate will be added to the list of any SHA256 fingerprints provided + // in SystemSecurity.TrustedTLSClientCertFingerprints. + trusted_client_certificates?: [...string] @go(TrustedClientCertificates,[]string) + apply_defaults: bool @go(ApplyDefaults) + preseed?: null | #OperationsCenterPreseed @go(Preseed,*OperationsCenterPreseed) +} + +// OperationsCenterPreseed holds seed configuration for Operations Center. +#OperationsCenterPreseed: { + system_certificate?: null | system.#CertificatePost @go(SystemCertificate,*system.CertificatePost) + system_network?: null | system.#NetworkPut @go(SystemNetwork,*system.NetworkPut) + system_security?: null | system.#SecurityPut @go(SystemSecurity,*system.SecurityPut) + system_updates?: null | system.#UpdatesPut @go(SystemUpdates,*system.UpdatesPut) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/seed/provider_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/seed/provider_go_gen.cue new file mode 100644 index 0000000..8301483 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/seed/provider_go_gen.cue @@ -0,0 +1,13 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus-os/incus-osd/api/seed + +package seed + +import "github.com/lxc/incus-os/incus-osd/api" + +// Provider represents the provider seed. +#Provider: { + api.#SystemProviderConfig + version: string @go(Version) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/seed/update_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/seed/update_go_gen.cue new file mode 100644 index 0000000..029817c --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/seed/update_go_gen.cue @@ -0,0 +1,13 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus-os/incus-osd/api/seed + +package seed + +import "github.com/lxc/incus-os/incus-osd/api" + +// Update represents the update seed. +#Update: { + api.#SystemUpdateConfig + version: string @go(Version) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/service_ceph_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/service_ceph_go_gen.cue new file mode 100644 index 0000000..fe842d2 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/service_ceph_go_gen.cue @@ -0,0 +1,33 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus-os/incus-osd/api + +package api + +// ServiceCephCluster represents a single Ceph cluster. +#ServiceCephCluster: { + fsid: string @go(FSID) + monitors: [...string] @go(Monitors,[]string) + keyrings: {[string]: #ServiceCephKeyring} @go(Keyrings,map[string]ServiceCephKeyring) + client_config: {[string]: string} @go(ClientConfig,map[string]string) +} + +// ServiceCephKeyring represents a single Ceph keyring entry. +#ServiceCephKeyring: { + key: string @go(Key) +} + +// ServiceCephConfig represents additional configuration for the Ceph service. +#ServiceCephConfig: { + enabled: bool @go(Enabled) + clusters: {[string]: #ServiceCephCluster} @go(Clusters,map[string]ServiceCephCluster) +} + +// ServiceCephState represents state for the Ceph service. +#ServiceCephState: {} + +// ServiceCeph represents the state and configuration of the Ceph service. +#ServiceCeph: { + state: #ServiceCephState @go(State) + config: #ServiceCephConfig @go(Config) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/service_iscsi_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/service_iscsi_go_gen.cue new file mode 100644 index 0000000..e3d9187 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/service_iscsi_go_gen.cue @@ -0,0 +1,29 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus-os/incus-osd/api + +package api + +// ServiceISCSITarget represents a single ISCSI target. +#ServiceISCSITarget: { + target: string @go(Target) + address: string @go(Address) + port: int @go(Port) +} + +// ServiceISCSIConfig represents additional configuration for the ISCSI service. +#ServiceISCSIConfig: { + enabled: bool @go(Enabled) + targets: [...#ServiceISCSITarget] @go(Targets,[]ServiceISCSITarget) +} + +// ServiceISCSI represents the state and configuration of the ISCSI service. +#ServiceISCSI: { + state: #ServiceISCSIState @go(State) + config: #ServiceISCSIConfig @go(Config) +} + +// ServiceISCSIState represents the state for the ISCSI service. +#ServiceISCSIState: { + initiator_name: string @go(InitiatorName) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/service_linstor_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/service_linstor_go_gen.cue new file mode 100644 index 0000000..e2a3848 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/service_linstor_go_gen.cue @@ -0,0 +1,23 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus-os/incus-osd/api + +package api + +// ServiceLinstorConfig represents the Linstor service configuration. +#ServiceLinstorConfig: { + enabled: bool @go(Enabled) + listen_address: string @go(ListenAddress) + tls_server_certificate?: string @go(TLSServerCertificate) + tls_server_key?: string @go(TLSServerKey) + tls_trusted_certificates?: [...string] @go(TLSTrustedCertificates,[]string) +} + +// ServiceLinstorState represents state for the Linstor service. +#ServiceLinstorState: {} + +// ServiceLinstor represents the state and configuration of the Linstor service. +#ServiceLinstor: { + state: #ServiceLinstorState @go(State) + config: #ServiceLinstorConfig @go(Config) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/service_lvm_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/service_lvm_go_gen.cue new file mode 100644 index 0000000..579ca85 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/service_lvm_go_gen.cue @@ -0,0 +1,60 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus-os/incus-osd/api + +package api + +// ServiceLVMConfig represents additional configuration for the LVM service. +#ServiceLVMConfig: { + enabled: bool @go(Enabled) + system_id: int @go(SystemID) +} + +// ServiceLVM represents the state and configuration of the LVM service. +#ServiceLVM: { + state: #ServiceLVMState @go(State) + config: #ServiceLVMConfig @go(Config) +} + +// ServiceLVMState represents the state for the LVM service. +#ServiceLVMState: { + pvs?: [...#ServiceLVMPV] @go(PVs,[]ServiceLVMPV) + vgs?: [...#ServiceLVMVG] @go(VGs,[]ServiceLVMVG) + log?: [...#ServiceLVMLog] @go(Log,[]ServiceLVMLog) +} + +// ServiceLVMPV defines information about a given physical volume. +#ServiceLVMPV: { + pv_name: string @go(PVName) + vg_name: string @go(VGName) + pv_fmt: string @go(PVFmt) + pv_attr: string @go(PVAttr) + pv_size: string @go(PVSize) + pv_free: string @go(PVFree) +} + +// ServiceLVMVG defines information about a given volume group. +#ServiceLVMVG: { + vg_name: string @go(VGName) + pv_count: int @go(PVCount) + lv_count: int @go(LVCount) + snap_count: int @go(SnapCount) + vg_attr: string @go(VGAttr) + vg_size: string @go(VGSize) + vg_free: string @go(VGFree) +} + +// ServiceLVMLog defines a LVM log entry. +#ServiceLVMLog: { + log_seq_num: int @go(LogSeqNum) + log_type: string @go(LogType) + log_context: string @go(LogContext) + log_object_type: string @go(LogObjectType) + log_object_name: string @go(LogObjectName) + log_object_id: string @go(LogObjectID) + log_object_group: string @go(LogObjectGroup) + log_object_group_id: string @go(LogObjectGroupID) + log_message: string @go(LogMessage) + log_errno: int @go(LogErrno) + log_ret_code: int @go(LogRetCode) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/service_multipath_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/service_multipath_go_gen.cue new file mode 100644 index 0000000..c986456 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/service_multipath_go_gen.cue @@ -0,0 +1,43 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus-os/incus-osd/api + +package api + +// ServiceMultipathDevice represents a single Multipath device. +#ServiceMultipathDevice: { + vendor: string @go(Vendor) + size: string @go(Size) + path_groups: [...#ServiceMultipathPathGroup] @go(PathGroups,[]ServiceMultipathPathGroup) +} + +// ServiceMultipathPathGroup represents a single Multipath path group. +#ServiceMultipathPathGroup: { + policy: string @go(Policy) + priority: uint64 @go(Priority) + status: string @go(Status) + paths: [...#ServiceMultipathPath] @go(Paths,[]ServiceMultipathPath) +} + +// ServiceMultipathPath represents a single Multipath path. +#ServiceMultipathPath: { + id: string @go(ID) + status: string @go(Status) +} + +// ServiceMultipathConfig represents additional configuration for the Multipath service. +#ServiceMultipathConfig: { + enabled: bool @go(Enabled) + wwns: [...string] @go(WWNs,[]string) +} + +// ServiceMultipath represents the state and configuration of the Multipath service. +#ServiceMultipath: { + state: #ServiceMultipathState @go(State) + config: #ServiceMultipathConfig @go(Config) +} + +// ServiceMultipathState represents the state for the Multipath service. +#ServiceMultipathState: { + devices: {[string]: #ServiceMultipathDevice} @go(Devices,map[string]ServiceMultipathDevice) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/service_netbird_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/service_netbird_go_gen.cue new file mode 100644 index 0000000..d6d8e98 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/service_netbird_go_gen.cue @@ -0,0 +1,29 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus-os/incus-osd/api + +package api + +// ServiceNetbird represents the state and configuration of the Netbird service. +#ServiceNetbird: { + config: #ServiceNetbirdConfig @go(Config) + state: {} @go(State,struct{}) +} + +// ServiceNetbirdConfig represents additional configuration for the Netbird service. +#ServiceNetbirdConfig: { + enabled: bool @go(Enabled) + setup_key: string @go(SetupKey) + management_url: string @go(ManagementURL) + admin_url: string @go(AdminURL) + anonymize: bool @go(Anonymize) + block_inbound: bool @go(BlockInbound) + block_lan_access: bool @go(BlockLanAccess) + disable_client_routes: bool @go(DisableClientRoutes) + disable_server_routes: bool @go(DisableServerRoutes) + disable_dns: bool @go(DisableDNS) + disable_firewall: bool @go(DisableFirewall) + dns_resolver_address: string @go(DNSResolverAddress) + external_ip_map: [...string] @go(ExternalIPMap,[]string) + extra_dns_labels: [...string] @go(ExtraDNSLabels,[]string) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/service_nvme_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/service_nvme_go_gen.cue new file mode 100644 index 0000000..779965c --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/service_nvme_go_gen.cue @@ -0,0 +1,30 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus-os/incus-osd/api + +package api + +// ServiceNVMETarget represents a single NVME target. +#ServiceNVMETarget: { + transport: string @go(Transport) + address: string @go(Address) + port: int @go(Port) +} + +// ServiceNVMEConfig represents additional configuration for the NVME service. +#ServiceNVMEConfig: { + enabled: bool @go(Enabled) + targets: [...#ServiceNVMETarget] @go(Targets,[]ServiceNVMETarget) +} + +// ServiceNVME represents the state and configuration of the NVME service. +#ServiceNVME: { + state: #ServiceNVMEState @go(State) + config: #ServiceNVMEConfig @go(Config) +} + +// ServiceNVMEState represents the state for the NVME service. +#ServiceNVMEState: { + host_id: string @go(HostID) + host_nqn: string @go(HostNQN) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/service_ovn_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/service_ovn_go_gen.cue new file mode 100644 index 0000000..77e451e --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/service_ovn_go_gen.cue @@ -0,0 +1,26 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus-os/incus-osd/api + +package api + +// ServiceOVNConfig represents additional configuration for the OVN service. +#ServiceOVNConfig: { + enabled: bool @go(Enabled) + ic_chassis?: bool @go(ICChassis) + database: string @go(Database) + tls_client_certificate?: string @go(TLSClientCertificate) + tls_client_key?: string @go(TLSClientKey) + tls_ca_certificate?: string @go(TLSCACertificate) + tunnel_address: string @go(TunnelAddress) + tunnel_protocol: string @go(TunnelProtocol) +} + +// ServiceOVNState represents state for the OVN service. +#ServiceOVNState: {} + +// ServiceOVN represents the state and configuration of the OVN service. +#ServiceOVN: { + state: #ServiceOVNState @go(State) + config: #ServiceOVNConfig @go(Config) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/service_tailscale_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/service_tailscale_go_gen.cue new file mode 100644 index 0000000..42a6294 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/service_tailscale_go_gen.cue @@ -0,0 +1,67 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus-os/incus-osd/api + +package api + +// ServiceTailscale represents the state and configuration of the Tailscale service. +#ServiceTailscale: { + config: #ServiceTailscaleConfig @go(Config) + state: #ServiceTailscaleState @go(State) +} + +// ServiceTailscaleConfig represents additional configuration for the Tailscale service. +#ServiceTailscaleConfig: { + enabled: bool @go(Enabled) + login_server: string @go(LoginServer) + auth_key: string @go(AuthKey) + accept_routes: bool @go(AcceptRoutes) + advertised_routes: [...string] @go(AdvertisedRoutes,[]string) + serve_enabled: bool @go(ServeEnabled) + serve_port: int @go(ServePort) + serve_service: string @go(ServeService) +} + +// ServiceTailscaleBackendStateEnum represents the possible states of the Tailscale backend. +#ServiceTailscaleBackendStateEnum: string // #enumServiceTailscaleBackendStateEnum + +#enumServiceTailscaleBackendStateEnum: + #ServiceTailscaleBackendStateNoState | + #ServiceTailscaleBackendStateNeedsLogin | + #ServiceTailscaleBackendStateNeedsMachineAuth | + #ServiceTailscaleBackendStateStopped | + #ServiceTailscaleBackendStateStarting | + #ServiceTailscaleBackendStateRunning + +#ServiceTailscaleBackendStateNoState: #ServiceTailscaleBackendStateEnum & "NoState" +#ServiceTailscaleBackendStateNeedsLogin: #ServiceTailscaleBackendStateEnum & "NeedsLogin" +#ServiceTailscaleBackendStateNeedsMachineAuth: #ServiceTailscaleBackendStateEnum & "NeedsMachineAuth" +#ServiceTailscaleBackendStateStopped: #ServiceTailscaleBackendStateEnum & "Stopped" +#ServiceTailscaleBackendStateStarting: #ServiceTailscaleBackendStateEnum & "Starting" +#ServiceTailscaleBackendStateRunning: #ServiceTailscaleBackendStateEnum & "Running" + +// ServiceTailscaleStatePeer represents the state of a single peer in the Tailscale network. +#ServiceTailscaleStatePeer: { + id: string @go(ID) + public_key: string @go(PublicKey) + host_name: string @go(HostName) + dns_name: string @go(DNSName) + os: string @go(OS) + tailscale_ips: [...string] @go(TailscaleIPs,[]netip.Addr) + rx_bytes: int64 @go(RxBytes) + tx_bytes: int64 @go(TxBytes) + online: bool @go(Online) + expired: bool @go(Expired) +} + +// ServiceTailscaleState represents the current state of the Tailscale service. +#ServiceTailscaleState: { + version: string @go(Version) + backend_state: #ServiceTailscaleBackendStateEnum @go(BackendState) + tailnet_name?: string @go(TailnetName) + tailnet_dns_suffix?: string @go(TailnetDNSSuffix) + self: #ServiceTailscaleStatePeer @go(Self) + peer?: [...#ServiceTailscaleStatePeer] @go(Peers,[]ServiceTailscaleStatePeer) + have_node_key: bool @go(HaveNodeKey) + health?: [...string] @go(Health,[]string) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/service_usbip_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/service_usbip_go_gen.cue new file mode 100644 index 0000000..8c8db6c --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/service_usbip_go_gen.cue @@ -0,0 +1,26 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus-os/incus-osd/api + +package api + +// ServiceUSBIPTarget represents a single USBIP target. +#ServiceUSBIPTarget: { + address: string @go(Address) + bus_id: string @go(BusID) +} + +// ServiceUSBIPConfig represents additional configuration for the USBIP service. +#ServiceUSBIPConfig: { + enabled: bool @go(Enabled) + targets: [...#ServiceUSBIPTarget] @go(Targets,[]ServiceUSBIPTarget) +} + +// ServiceUSBIPState represents state for the USBIP service. +#ServiceUSBIPState: {} + +// ServiceUSBIP represents the state and configuration of the USBIP service. +#ServiceUSBIP: { + state: #ServiceUSBIPState @go(State) + config: #ServiceUSBIPConfig @go(Config) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/system_kernel_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/system_kernel_go_gen.cue new file mode 100644 index 0000000..eff9c90 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/system_kernel_go_gen.cue @@ -0,0 +1,46 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus-os/incus-osd/api + +package api + +// SystemKernelConfig holds the kernel-level configuration data. +#SystemKernelConfig: { + blacklist_modules?: [...string] @go(BlacklistModules,[]string) + memory?: null | #SystemKernelConfigMemory @go(Memory,*SystemKernelConfigMemory) + network?: null | #SystemKernelConfigNetwork @go(Network,*SystemKernelConfigNetwork) + pci?: null | #SystemKernelConfigPCI @go(PCI,*SystemKernelConfigPCI) +} + +// SystemKernelConfigMemory holds memory-specific kernel configuration. +#SystemKernelConfigMemory: { + persistent_hugepages: int @go(PersistentHugepages) +} + +// SystemKernelConfigNetwork holds network-specific kernel configuration. +#SystemKernelConfigNetwork: { + buffer_size?: int @go(BufferSize) + queuing_discipline?: string @go(QueuingDiscipline) + tcp_congestion_algorithm?: string @go(TCPCongestionAlgorithm) +} + +// SystemKernelConfigPCI holds PCI-specific kernel configuration. +#SystemKernelConfigPCI: { + passthrough?: [...#SystemKernelConfigPCIPassthrough] @go(Passthrough,[]SystemKernelConfigPCIPassthrough) +} + +// SystemKernelConfigPCIPassthrough defines a specific PCI device that should be made available for passthrough to a VM. +#SystemKernelConfigPCIPassthrough: { + vendor_id: string @go(VendorID) + product_id: string @go(ProductID) + pci_address?: string @go(PCIAddress) +} + +// SystemKernelState represents state for the system's kernel-level configuration. +#SystemKernelState: {} + +// SystemKernel defines a struct to hold information about the system's kernel-level configuration. +#SystemKernel: { + config: #SystemKernelConfig @go(Config) + state: #SystemKernelState @go(State) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/system_logging_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/system_logging_go_gen.cue new file mode 100644 index 0000000..7bd601e --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/system_logging_go_gen.cue @@ -0,0 +1,26 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus-os/incus-osd/api + +package api + +// SystemLoggingSyslog contains the configuration options for a remote syslog server. +#SystemLoggingSyslog: { + address: string @go(Address) + protocol: string @go(Protocol) + log_format: string @go(LogFormat) +} + +// SystemLoggingConfig holds the modifiable part of the logging data. +#SystemLoggingConfig: { + syslog: #SystemLoggingSyslog @go(Syslog) +} + +// SystemLoggingState represents state for the system's logging configuration. +#SystemLoggingState: {} + +// SystemLogging defines a struct to hold information about the system's logging configuration. +#SystemLogging: { + config: #SystemLoggingConfig @go(Config) + state: #SystemLoggingState @go(State) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/system_network_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/system_network_go_gen.cue new file mode 100644 index 0000000..5220500 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/system_network_go_gen.cue @@ -0,0 +1,230 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus-os/incus-osd/api + +package api + +// SystemNetworkInterfaceRoleManagement represents the "management" role. +#SystemNetworkInterfaceRoleManagement: "management" + +// SystemNetworkInterfaceRoleCluster represents the "cluster" role. +#SystemNetworkInterfaceRoleCluster: "cluster" + +// SystemNetworkInterfaceRoleInstances represents the "instances" role. +#SystemNetworkInterfaceRoleInstances: "instances" + +// SystemNetworkInterfaceRoleStorage represents the "storage" role. +#SystemNetworkInterfaceRoleStorage: "storage" + +// SystemNetwork defines a struct to hold the three types of supported network configuration. +#SystemNetwork: { + config?: null | #SystemNetworkConfig @go(Config,*SystemNetworkConfig) + state: #SystemNetworkState @go(State) +} + +// SystemNetworkConfig represents the user modifiable network configuration. +#SystemNetworkConfig: { + // If defined, automatically roll back the new network changes after the + // specified timeout has elapsed unless those changes are confirmed before then. + confirmation_timeout?: string @go(ConfirmationTimeout) + dns?: null | #SystemNetworkDNS @go(DNS,*SystemNetworkDNS) + time?: null | #SystemNetworkTime @go(Time,*SystemNetworkTime) + proxy?: null | #SystemNetworkProxy @go(Proxy,*SystemNetworkProxy) + interfaces?: [...#SystemNetworkInterface] @go(Interfaces,[]SystemNetworkInterface) + bonds?: [...#SystemNetworkBond] @go(Bonds,[]SystemNetworkBond) + vlans?: [...#SystemNetworkVLAN] @go(VLANs,[]SystemNetworkVLAN) + wireguard?: [...#SystemNetworkWireguard] @go(Wireguard,[]SystemNetworkWireguard) +} + +// SystemNetworkInterface contains information about a network interface. +#SystemNetworkInterface: { + addresses?: [...string] @go(Addresses,[]string) + ethernet?: null | #SystemNetworkEthernet @go(Ethernet,*SystemNetworkEthernet) + firewall_rules?: [...#SystemNetworkFirewallRule] @go(FirewallRules,[]SystemNetworkFirewallRule) + hwaddr: string @go(Hwaddr) + lldp?: bool @go(LLDP) + mtu?: int @go(MTU) + name: string @go(Name) + required_for_online?: string @go(RequiredForOnline) + roles?: [...string] @go(Roles,[]string) + routes?: [...#SystemNetworkRoute] @go(Routes,[]SystemNetworkRoute) + strict_hwaddr?: bool @go(StrictHwaddr) + vlan_tags?: [...int] @go(VLANTags,[]int) +} + +// SystemNetworkBond contains information about a network bond. +#SystemNetworkBond: { + addresses?: [...string] @go(Addresses,[]string) + ethernet?: null | #SystemNetworkEthernet @go(Ethernet,*SystemNetworkEthernet) + firewall_rules?: [...#SystemNetworkFirewallRule] @go(FirewallRules,[]SystemNetworkFirewallRule) + hwaddr?: string @go(Hwaddr) + lldp?: bool @go(LLDP) + members?: [...string] @go(Members,[]string) + mode: string @go(Mode) + mtu?: int @go(MTU) + name: string @go(Name) + required_for_online?: string @go(RequiredForOnline) + roles?: [...string] @go(Roles,[]string) + routes?: [...#SystemNetworkRoute] @go(Routes,[]SystemNetworkRoute) + vlan_tags?: [...int] @go(VLANTags,[]int) +} + +// SystemNetworkVLAN contains information about a network vlan. +#SystemNetworkVLAN: { + addresses?: [...string] @go(Addresses,[]string) + firewall_rules?: [...#SystemNetworkFirewallRule] @go(FirewallRules,[]SystemNetworkFirewallRule) + id: int @go(ID) + mtu?: int @go(MTU) + name: string @go(Name) + parent: string @go(Parent) + required_for_online?: string @go(RequiredForOnline) + roles?: [...string] @go(Roles,[]string) + routes?: [...#SystemNetworkRoute] @go(Routes,[]SystemNetworkRoute) +} + +// SystemNetworkEthernet contains Ethernet-specific configuration details (offloading and other features). +#SystemNetworkEthernet: { + disable_energy_efficient?: bool @go(DisableEnergyEfficient) + disable_gro?: bool @go(DisableGRO) + disable_gso?: bool @go(DisableGSO) + disable_ipv4_tso?: bool @go(DisableIPv4TSO) + disable_ipv6_tso?: bool @go(DisableIPv6TSO) + wakeonlan?: bool @go(WakeOnLAN) + wakeonlan_modes?: [...string] @go(WakeOnLANModes,[]string) + wakeonlan_password?: string @go(WakeOnLANPassword) +} + +// SystemNetworkFirewallRule defines a firewall rule. +#SystemNetworkFirewallRule: { + action: string @go(Action) + source?: string @go(Source) + protocol?: string @go(Protocol) + port?: int @go(Port) +} + +// SystemNetworkWireguard contains information about a wireguard interface. +#SystemNetworkWireguard: { + addresses?: [...string] @go(Addresses,[]string) + firewall_rules?: [...#SystemNetworkFirewallRule] @go(FirewallRules,[]SystemNetworkFirewallRule) + mtu?: int @go(MTU) + name: string @go(Name) + peers?: [...#SystemNetworkWireguardPeer] @go(Peers,[]SystemNetworkWireguardPeer) + port?: int @go(Port) + private_key?: string @go(PrivateKey) + required_for_online?: string @go(RequiredForOnline) + roles?: [...string] @go(Roles,[]string) + routes?: [...#SystemNetworkRoute] @go(Routes,[]SystemNetworkRoute) +} + +// SystemNetworkWireguardPeer defines wireguard peer. +#SystemNetworkWireguardPeer: { + allowed_ips: [...string] @go(AllowedIPs,[]string) + endpoint?: string @go(Endpoint) + persistent_keepalive?: int @go(PersistentKeepalive) + preshared_key?: string @go(PresharedKey) + public_key: string @go(PublicKey) +} + +// SystemNetworkRoute defines a route. +#SystemNetworkRoute: { + to: string @go(To) + via: string @go(Via) +} + +// SystemNetworkDNS defines DNS configuration options. +#SystemNetworkDNS: { + domain: string @go(Domain) + hostname: string @go(Hostname) + nameservers?: [...string] @go(Nameservers,[]string) + search_domains?: [...string] @go(SearchDomains,[]string) + dns_over_tls?: bool @go(DNSOverTLS) +} + +// SystemNetworkTime defines various time related configuration options (NTP servers, timezone, etc). +#SystemNetworkTime: { + ntp_servers?: [...string] @go(NTPServers,[]string) + timezone?: string @go(Timezone) +} + +// SystemNetworkProxy defines proxy configuration. +#SystemNetworkProxy: { + rules?: [...#SystemNetworkProxyRule] @go(Rules,[]SystemNetworkProxyRule) + servers?: {[string]: #SystemNetworkProxyServer} @go(Servers,map[string]SystemNetworkProxyServer) +} + +// SystemNetworkProxyServer defines a proxy server configuration. +#SystemNetworkProxyServer: { + auth: string @go(Auth) + host: string @go(Host) + password?: string @go(Password) + realm?: string @go(Realm) + username?: string @go(Username) + use_tls: bool @go(UseTLS) +} + +// SystemNetworkProxyRule defines a proxy rule. +#SystemNetworkProxyRule: { + destination: string @go(Destination) + target: string @go(Target) +} + +// SystemNetworkState holds information about the current network state. +#SystemNetworkState: { + interfaces: {[string]: #SystemNetworkInterfaceState} @go(Interfaces,map[string]SystemNetworkInterfaceState) +} + +// SystemNetworkInterfaceState holds state information about a specific network interface. +#SystemNetworkInterfaceState: { + addresses?: [...string] @go(Addresses,[]string) + hwaddr?: string @go(Hwaddr) + lacp?: null | #SystemNetworkLACPState @go(LACP,*SystemNetworkLACPState) + lldp?: [...#SystemNetworkLLDPState] @go(LLDP,[]SystemNetworkLLDPState) + members?: {[string]: #SystemNetworkInterfaceState} @go(Members,map[string]SystemNetworkInterfaceState) + mtu?: int @go(MTU) + roles?: [...string] @go(Roles,[]string) + routes?: [...#SystemNetworkRoute] @go(Routes,[]SystemNetworkRoute) + speed?: string @go(Speed) + state: string @go(State) + stats: #SystemNetworkInterfaceStats @go(Stats) + type?: string @go(Type) + wireguard?: null | #SystemNetworkWireguardState @go(Wireguard,*SystemNetworkWireguardState) +} + +// SystemNetworkInterfaceStats holds RX/TX stats for an interface. +#SystemNetworkInterfaceStats: { + rx_bytes: int @go(RXBytes) + rx_errors: int @go(RXErrors) + tx_bytes: int @go(TXBytes) + tx_errors: int @go(TXErrors) +} + +// SystemNetworkLLDPState holds information about the LLDP state. +#SystemNetworkLLDPState: { + chassis_id: string @go(ChassisID) + name: string @go(Name) + port_id: string @go(PortID) + port?: string @go(Port) +} + +// SystemNetworkLACPState holds information about a bond's LACP state. +#SystemNetworkLACPState: { + local_mac: string @go(LocalMAC) + remote_mac: string @go(RemoteMAC) +} + +// SystemNetworkWireguardState holds state information about a specific wireguard interface. +#SystemNetworkWireguardState: { + listening_port?: int @go(ListeningPort) + peers?: [...#SystemNetworkWireguardPeerState] @go(Peers,[]SystemNetworkWireguardPeerState) + public_key: string @go(PublicKey) +} + +// SystemNetworkWireguardPeerState holds state information about a specific wireguard peer. +#SystemNetworkWireguardPeerState: { + allowed_ips: [...string] @go(AllowedIPs,[]string) + endpoint: string @go(EndPoint) + latest_handshake?: string @go(LatestHandshake) + persistent_keepalive?: string @go(PersistentKeepalive) + public_key: string @go(PublicKey) + stats: #SystemNetworkInterfaceStats @go(Stats) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/system_provider_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/system_provider_go_gen.cue new file mode 100644 index 0000000..2a08b14 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/system_provider_go_gen.cue @@ -0,0 +1,22 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus-os/incus-osd/api + +package api + +// SystemProviderConfig holds the modifiable part of the provider data. +#SystemProviderConfig: { + name: string @go(Name) + config?: {[string]: string} @go(Config,map[string]string) +} + +// SystemProviderState holds information about the current provider state. +#SystemProviderState: { + registered: bool @go(Registered) +} + +// SystemProvider defines a struct to hold information about the system's update and configuration provider. +#SystemProvider: { + config: #SystemProviderConfig @go(Config) + state: #SystemProviderState @go(State) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/system_reset_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/system_reset_go_gen.cue new file mode 100644 index 0000000..1b1eb2e --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/system_reset_go_gen.cue @@ -0,0 +1,12 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus-os/incus-osd/api + +package api + +// SystemReset defines a struct that takes an optional map of seed data to set as part of the factory reset. +#SystemReset: { + allow_tpm_reset_failure: bool @go(AllowTPMResetFailure) + seeds: {...} @go(Seeds,map[string]json.RawMessage) + wipe_existing_seeds: bool @go(WipeExistingSeeds) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/system_security_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/system_security_go_gen.cue new file mode 100644 index 0000000..c13c216 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/system_security_go_gen.cue @@ -0,0 +1,43 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus-os/incus-osd/api + +package api + +// SystemSecurityState holds information about the current security state. +#SystemSecurityState: { + encrypted_volumes: [...#SystemSecurityEncryptedVolume] @go(EncryptedVolumes,[]SystemSecurityEncryptedVolume) + encryption_recovery_keys_retrieved: bool @go(EncryptionRecoveryKeysRetrieved) + drive_recovery_keys: {[string]: string} @go(DriveRecoveryKeys,map[string]string) + pool_recovery_keys: {[string]: string} @go(PoolRecoveryKeys,map[string]string) + secure_boot_certificates: [...#SystemSecuritySecureBootCertificate] @go(SecureBootCertificates,[]SystemSecuritySecureBootCertificate) + secure_boot_enabled: bool @go(SecureBootEnabled) + system_state_is_trusted: bool @go(SystemStateIsTrusted) + tpm_status: string @go(TPMStatus) +} + +// SystemSecurityConfig holds additional security configuration settings. +#SystemSecurityConfig: { + custom_ca_certs?: [...string] @go(CustomCACerts,[]string) + encryption_recovery_keys: [...string] @go(EncryptionRecoveryKeys,[]string) +} + +// SystemSecurity defines a struct to hold information about the system's security state. +#SystemSecurity: { + config: #SystemSecurityConfig @go(Config) + state: #SystemSecurityState @go(State) +} + +// SystemSecuritySecureBootCertificate defines a struct that holds information about Secure Boot keys present on the host. +#SystemSecuritySecureBootCertificate: { + type: string @go(Type) + fingerprint: string @go(Fingerprint) + subject: string @go(Subject) + issuer: string @go(Issuer) +} + +// SystemSecurityEncryptedVolume defines a struct that holds basic information about an encrypted volume. +#SystemSecurityEncryptedVolume: { + volume: string @go(Volume) + state: string @go(State) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/system_storage_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/system_storage_go_gen.cue new file mode 100644 index 0000000..5339faf --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/system_storage_go_gen.cue @@ -0,0 +1,163 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus-os/incus-osd/api + +package api + +import "time" + +// SystemStorageConfig represents additional configuration for the system's local storage. +#SystemStorageConfig: { + scrub_schedule: string @go(ScrubSchedule) + pools?: [...#SystemStoragePool] @go(Pools,[]SystemStoragePool) +} + +// SystemStorageState represents additional state for the system's local storage. +#SystemStorageState: { + drives: [...#SystemStorageDrive] @go(Drives,[]SystemStorageDrive) + pools: [...#SystemStoragePool] @go(Pools,[]SystemStoragePool) +} + +// SystemStorage defines a struct to hold information about the system's local storage. +#SystemStorage: { + config: #SystemStorageConfig @go(Config) + state: #SystemStorageState @go(State) +} + +// SystemStoragePool defines a struct that is used to create or update a storage pool and return its current state. +#SystemStoragePool: { + // Name and Type cannot be changed after pool creation. + name: string @go(Name) + + // Supported pool types: zfs-raid0, zfs-raid1, zfs-raid10, zfs-raidz1, zfs-raidz2, zfs-raidz3. + type: string @go(Type) + + // If true, allow creation of a pool with devices of different sizes. + allow_mixed_dev_sizes?: bool @go(AllowMixedDevSizes) + + // Devices, Cache, Log, and Special can be modified to add/remove/replace devices in the pool. + devices: [...string] @go(Devices,[]string) + cache?: [...string] @go(Cache,[]string) + log?: [...string] @go(Log,[]string) + special?: null | #SystemStoragePoolSpecial @go(Special,*SystemStoragePoolSpecial) + + // Read-only fields returned from the server with additional pool information. + state: string @go(State) + last_scrub?: null | #SystemStoragePoolScrubStatus @go(LastScrub,*SystemStoragePoolScrubStatus) + encryption_key_status: string @go(EncryptionKeyStatus) + devices_degraded?: [...string] @go(DevicesDegraded,[]string) + cache_degraded?: [...string] @go(CacheDegraded,[]string) + log_degraded?: [...string] @go(LogDegraded,[]string) + special_degraded?: [...string] @go(SpecialDegraded,[]string) + raw_pool_size_in_bytes: int @go(RawPoolSizeInBytes) + usable_pool_size_in_bytes: int @go(UsablePoolSizeInBytes) + pool_allocated_space_in_bytes: int @go(PoolAllocatedSpaceInBytes) + volumes: [...#SystemStoragePoolVolume] @go(Volumes,[]SystemStoragePoolVolume) +} + +// SystemStoragePoolSpecial defines a struct that is used to create or update a pool's special vdev. +#SystemStoragePoolSpecial: { + // Supported special device types: zfs-raid0, zfs-raid1, zfs-raid10, zfs-raidz1, zfs-raidz2, zfs-raidz3. + type: string @go(Type) + + // If non-zero, will be used when setting the pool's special_small_blocks property. + special_small_blocks_size_in_kb: int @go(SpecialSmallBlocksSizeInKB) + + // One or more physical devices to create the pool's special vdev. + devices: [...string] @go(Devices,[]string) +} + +// SystemStoragePoolVolume represents a single IncusOS-managed volume in a pool. +#SystemStoragePoolVolume: { + name: string @go(Name) + usage_in_bytes: int @go(UsageInBytes) + quota_in_bytes: int @go(QuotaInBytes) + use: string @go(Use) +} + +// SystemStoragePoolScrubState represents the state of a scan in a pool. +#SystemStoragePoolScrubState: string // #enumSystemStoragePoolScrubState + +#enumSystemStoragePoolScrubState: + #ScrubUnknown | + #ScrubInProgress | + #ScrubFinished + +// ScrubUnknown represents and unknown scrub status. +#ScrubUnknown: #SystemStoragePoolScrubState & "UNKNOWN" + +// ScrubInProgress represents that the scrub is in progress. +#ScrubInProgress: #SystemStoragePoolScrubState & "IN_PROGRESS" + +// ScrubFinished represents that the scrub has finished. +#ScrubFinished: #SystemStoragePoolScrubState & "FINISHED" + +// SystemStoragePoolScrubStatus represents the status of a scrub in a pool. +#SystemStoragePoolScrubStatus: { + state: #SystemStoragePoolScrubState @go(State) + start_time: time.Time @go(StartTime) + end_time: time.Time @go(EndTime) + progress: string @go(Progress) + errors: int @go(Errors) +} + +// SystemStorageDrive defines a struct that holds information about a specific drive. +#SystemStorageDrive: { + id: string @go(ID) + model_family: string @go(ModelFamily) + model_name: string @go(ModelName) + serial_number: string @go(SerialNumber) + bus: string @go(Bus) + capacity_in_bytes: int @go(CapacityInBytes) + boot: bool @go(Boot) + multipath: bool @go(Multipath) + removable: bool @go(Removable) + remote: bool @go(Remote) + wwn?: string @go(WWN) + wwn_id?: string @go(WWNID) + smart?: null | #SystemStorageDriveSMART @go(SMART,*SystemStorageDriveSMART) + member_pool?: string @go(MemberPool) + encrypted?: bool @go(Encrypted) + encrypted_id?: string @go(EncryptedID) +} + +// SystemStorageDriveSMART defines a struct to return basic SMART information about a specific device. +#SystemStorageDriveSMART: { + enabled: bool @go(Enabled) + passed: bool @go(Passed) + error?: string @go(Error) + power_on_hours?: int @go(PowerOnHours) + data_units_read?: int @go(DataUnitsRead) + data_units_written?: int @go(DataUnitsWritten) + available_spare?: int @go(AvailableSpare) + percentage_used?: int @go(PercentageUsed) + raw_read_error_rate?: int @go(RawReadErrorRate) + seek_error_rate?: int @go(SeekErrorRate) + reallocated_sectors?: int @go(ReallocatedSectors) +} + +// SystemStorageWipe defines a struct with information about what drive to wipe. +#SystemStorageWipe: { + id: string @go(ID) + secure_wipe: bool @go(SecureWipe) +} + +// SystemStorageImportEncryptedDrive defines a struct with information about what drive to decrypt. +#SystemStorageImportEncryptedDrive: { + id: string @go(ID) + key: string @go(Key) +} + +// SystemStorageEncrypt defines a struct with information about what drive to encrypt. +#SystemStorageEncrypt: { + id: string @go(ID) + secure_wipe: bool @go(SecureWipe) +} + +// SystemStoragePoolKey defines a struct used to provide an encryption key when importing an existing pool. +// Currently the only supported type is "zfs". +#SystemStoragePoolKey: { + name: string @go(Name) + type: string @go(Type) + encryption_key: string @go(EncryptionKey) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/system_update_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/system_update_go_gen.cue new file mode 100644 index 0000000..6c212c7 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/system_update_go_gen.cue @@ -0,0 +1,39 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus-os/incus-osd/api + +package api + +import "time" + +// SystemUpdate defines a struct to hold information about the system's update policy. +#SystemUpdate: { + config: #SystemUpdateConfig @go(Config) + state: #SystemUpdateState @go(State) +} + +// SystemUpdateConfig defines a struct to hold configuration details for the update checks. +#SystemUpdateConfig: { + auto_reboot: bool @go(AutoReboot) + channel: string @go(Channel) + check_frequency: string @go(CheckFrequency) + maintenance_windows?: [...#SystemUpdateMaintenanceWindow] @go(MaintenanceWindows,[]SystemUpdateMaintenanceWindow) +} + +// SystemUpdateState holds information about the current update state. +#SystemUpdateState: { + last_check: time.Time @go(LastCheck) + status: string @go(Status) + needs_reboot: bool @go(NeedsReboot) +} + +// SystemUpdateMaintenanceWindow defines a maintenance window for when it is acceptable to check for and apply updates. +// StartDayOfWeek and EndDayOfWeek are optional, and if non-zero can be used to limit the migration window to certain day(s). +#SystemUpdateMaintenanceWindow: { + start_day_of_week?: #Weekday @go(StartDayOfWeek) + start_hour: int @go(StartHour) + start_minute: int @go(StartMinute) + end_day_of_week?: #Weekday @go(EndDayOfWeek) + end_hour: int @go(EndHour) + end_minute: int @go(EndMinute) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/weekday_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/weekday_go_gen.cue new file mode 100644 index 0000000..b06e8c5 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus-os/incus-osd/api/weekday_go_gen.cue @@ -0,0 +1,28 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus-os/incus-osd/api + +package api + +// Weekday defines our own type. The time package's Weekday doesn't include any way to indicate +// an empty value, which we need. +#Weekday: string // #enumWeekday + +#enumWeekday: + #NONE | + #Sunday | + #Monday | + #Tuesday | + #Wednesday | + #Thursday | + #Friday | + #Saturday + +#NONE: #Weekday & "" +#Sunday: #Weekday & "Sunday" +#Monday: #Weekday & "Monday" +#Tuesday: #Weekday & "Tuesday" +#Wednesday: #Weekday & "Wednesday" +#Thursday: #Weekday & "Thursday" +#Friday: #Weekday & "Friday" +#Saturday: #Weekday & "Saturday" diff --git a/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/access_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/access_go_gen.cue new file mode 100644 index 0000000..1b3dbd3 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/access_go_gen.cue @@ -0,0 +1,31 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus/v7/shared/api + +package api + +// Access represents everyone that may access a particular resource. +// +// swagger:model +// +// API extension: instance_access. +#Access: [...#AccessEntry] + +// AccessEntry represents an entity having access to the resource. +// +// swagger:model +// +// API extension: instance_access. +#AccessEntry: { + // Certificate fingerprint + // Example: 636b69519d27ae3b0e398cb7928043846ce1e3842f0ca7a589993dd913ab8cc9 + identifier: string @go(Identifier) + + // The role associated with the certificate + // Example: admin, view, operator + role: string @go(Role) + + // Which authorization method the certificate uses + // Example: tls, openfga + provider: string @go(Provider) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/auth_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/auth_go_gen.cue new file mode 100644 index 0000000..3ee53d0 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/auth_go_gen.cue @@ -0,0 +1,11 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus/v7/shared/api + +package api + +// AuthenticationMethodTLS is the default authentication method for interacting with Incus remotely. +#AuthenticationMethodTLS: "tls" + +// AuthenticationMethodOIDC is a token based authentication method. +#AuthenticationMethodOIDC: "oidc" diff --git a/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/certificate_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/certificate_go_gen.cue new file mode 100644 index 0000000..92575df --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/certificate_go_gen.cue @@ -0,0 +1,110 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus/v7/shared/api + +package api + +import "time" + +#CertificateTypeClient: "client" + +#CertificateTypeServer: "server" + +#CertificateTypeMetrics: "metrics" + +#CertificateTypeUnknown: "unknown" + +// CertificatesPost represents the fields of a new certificate +// +// swagger:model +#CertificatesPost: { + #CertificatePut + + // Trust token (used to add an untrusted client) + // Example: blah + trust_token: string @go(TrustToken) + + // Whether to create a certificate add token + // Example: true + // + // API extension: certificate_token + token: bool @go(Token) +} + +// CertificatePut represents the modifiable fields of a certificate +// +// swagger:model +// +// API extension: certificate_update. +#CertificatePut: { + // Name associated with the certificate + // Example: castiana + name: string @go(Name) + + // Usage type for the certificate + // Example: client + type: string @go(Type) + + // Whether to limit the certificate to listed projects + // Example: true + // + // API extension: certificate_project + restricted: bool @go(Restricted) + + // List of allowed projects (applies when restricted) + // Example: ["default", "foo", "bar"] + // + // API extension: certificate_project + projects: [...string] @go(Projects,[]string) + + // The certificate itself, as PEM encoded X509 (or as base64 encoded X509 on POST) + // Example: X509 PEM certificate + // + // API extension: certificate_self_renewal + certificate: string @go(Certificate) + + // Certificate description + // Example: X509 certificate + // + // API extension: certificate_description + description: string @go(Description) +} + +// Certificate represents a certificate +// +// swagger:model +#Certificate: { + #CertificatePut + + // SHA256 fingerprint of the certificate + // Read only: true + // Example: fd200419b271f1dc2a5591b693cc5774b7f234e1ff8c6b78ad703b6888fe2b69 + fingerprint: string @go(Fingerprint) +} + +// CertificateAddToken represents the fields contained within an encoded certificate add token. +// +// swagger:model +// +// API extension: certificate_token. +#CertificateAddToken: { + // The name of the new client + // Example: user@host + client_name: string @go(ClientName) + + // The fingerprint of the network certificate + // Example: 57bb0ff4340b5bb28517e062023101adf788c37846dc8b619eb2c3cb4ef29436 + fingerprint: string @go(Fingerprint) + + // The addresses of the server + // Example: ["10.98.30.229:8443"] + addresses: [...string] @go(Addresses,[]string) + + // The random join secret + // Example: 2b2284d44db32675923fe0d2020477e0e9be11801ff70c435e032b97028c35cd + secret: string @go(Secret) + + // The token's expiry date. + // Example: 2021-03-23T17:38:37.753398689-04:00 + expires_at: time.Time @go(ExpiresAt) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/cluster_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/cluster_go_gen.cue new file mode 100644 index 0000000..2101fc3 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/cluster_go_gen.cue @@ -0,0 +1,305 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus/v7/shared/api + +package api + +import "time" + +// Cluster represents high-level information about a cluster. +// +// swagger:model +// +// API extension: clustering. +#Cluster: { + // Name of the cluster member answering the request + // Example: server01 + server_name: string @go(ServerName) + + // Whether clustering is enabled + // Example: true + enabled: bool @go(Enabled) + + // List of member configuration keys (used during join) + // Example: [] + // + // API extension: clustering_join + member_config: [...#ClusterMemberConfigKey] @go(MemberConfig,[]ClusterMemberConfigKey) +} + +// ClusterMemberConfigKey represents a single config key that a new member of +// the cluster is required to provide when joining. +// +// The Value field is empty when getting clustering information with GET +// /1.0/cluster, and should be filled by the joining server when performing a PUT +// /1.0/cluster join request. +// +// swagger:model +// +// API extension: clustering_join. +#ClusterMemberConfigKey: { + // The kind of configuration key (network, storage-pool, ...) + // Example: storage-pool + entity: string @go(Entity) + + // The name of the object requiring this key + // Example: local + name: string @go(Name) + + // The name of the key + // Example: source + key: string @go(Key) + + // The value on the answering cluster member + // Example: /dev/sdb + value: string @go(Value) + + // A human friendly description key + // Example: "source" property for storage pool "local" + description: string @go(Description) +} + +// ClusterPut represents the fields required to bootstrap or join a cluster. +// +// swagger:model +// +// API extension: clustering. +#ClusterPut: { + #Cluster + + // The address of the cluster you wish to join + // Example: 10.0.0.1:8443 + cluster_address: string @go(ClusterAddress) + + // The expected certificate (X509 PEM encoded) for the cluster + // Example: X509 PEM certificate + cluster_certificate: string @go(ClusterCertificate) + + // The local address to use for cluster communication + // Example: 10.0.0.2:8443 + // + // API extension: clustering_join + server_address: string @go(ServerAddress) + + // The cluster join token for the cluster you're trying to join + // Example: blah + // + // API extension: clustering_join + cluster_token: string @go(ClusterToken) +} + +// ClusterMembersPost represents the fields required to request a join token to add a member to the cluster. +// +// swagger:model +// +// API extension: clustering_join_token. +#ClusterMembersPost: { + // The name of the new cluster member + // Example: server02 + server_name: string @go(ServerName) +} + +// ClusterMemberJoinToken represents the fields contained within an encoded cluster member join token. +// +// swagger:model +// +// API extension: clustering_join_token. +#ClusterMemberJoinToken: { + // The name of the new cluster member + // Example: server02 + server_name: string @go(ServerName) + + // The fingerprint of the network certificate + // Example: 57bb0ff4340b5bb28517e062023101adf788c37846dc8b619eb2c3cb4ef29436 + fingerprint: string @go(Fingerprint) + + // The addresses of existing online cluster members + // Example: ["10.98.30.229:8443"] + addresses: [...string] @go(Addresses,[]string) + + // The random join secret. + // Example: 2b2284d44db32675923fe0d2020477e0e9be11801ff70c435e032b97028c35cd + secret: string @go(Secret) + + // The token's expiry date. + // Example: 2021-03-23T17:38:37.753398689-04:00 + expires_at: time.Time @go(ExpiresAt) +} + +// ClusterMemberPost represents the fields required to rename a cluster member. +// +// swagger:model +// +// API extension: clustering. +#ClusterMemberPost: { + // The new name of the cluster member + // Example: server02 + server_name: string @go(ServerName) +} + +// ClusterMember represents a member of a cluster. +// +// swagger:model +// +// API extension: clustering. +#ClusterMember: { + #ClusterMemberPut + + // Name of the cluster member + // Example: server01 + server_name: string @go(ServerName) + + // URL at which the cluster member can be reached + // Example: https://10.0.0.1:8443 + url: string @go(URL) + + // Whether the cluster member is a database server + // Example: true + database: bool @go(Database) + + // Current status + // Example: Online + status: string @go(Status) + + // Additional status information + // Example: fully operational + message: string @go(Message) + + // The primary architecture of the cluster member + // Example: x86_64 + // + // API extension: clustering_architecture + architecture: string @go(Architecture) +} + +// ClusterMemberPut represents the modifiable fields of a cluster member +// +// swagger:model +// +// API extension: clustering_edit_roles. +#ClusterMemberPut: { + // List of roles held by this cluster member + // Example: ["database"] + // + // API extension: clustering_roles + roles: [...string] @go(Roles,[]string) + + // Name of the failure domain for this cluster member + // Example: rack1 + // + // API extension: clustering_failure_domains + failure_domain: string @go(FailureDomain) + + // Cluster member description + // Example: AMD Epyc 32c/64t + // + // API extension: clustering_description + description: string @go(Description) + + // Additional configuration information + // Example: {"scheduler.instance": "all"} + // + // API extension: clustering_config + config: #ConfigMap @go(Config) + + // List of cluster groups this member belongs to + // Example: ["group1", "group2"] + // + // API extension: clustering_groups + groups: [...string] @go(Groups,[]string) +} + +// ClusterCertificatePut represents the certificate and key pair for all cluster members +// +// swagger:model +// +// API extension: clustering_update_certs. +#ClusterCertificatePut: { + // The new certificate (X509 PEM encoded) for the cluster + // Example: X509 PEM certificate + cluster_certificate: string @go(ClusterCertificate) + + // The new certificate key (X509 PEM encoded) for the cluster + // Example: X509 PEM certificate key + cluster_certificate_key: string @go(ClusterCertificateKey) +} + +// ClusterMemberStatePost represents the fields required to evacuate a cluster member. +// +// swagger:model +// +// API extension: clustering_evacuation. +#ClusterMemberStatePost: { + // The action to be performed. Valid actions are "evacuate" and "restore". + // Example: evacuate + action: string @go(Action) + + // Override the configured evacuation mode. + // Example: stop + // + // API extension: clustering_evacuate_mode + mode: string @go(Mode) +} + +// ClusterGroupsPost represents the fields available for a new cluster group. +// +// swagger:model +// +// API extension: clustering_groups. +#ClusterGroupsPost: { + #ClusterGroupPut + + // The new name of the cluster group + // Example: group1 + name: string @go(Name) +} + +// ClusterGroup represents a cluster group. +// +// swagger:model +// +// API extension: clustering_groups. +#ClusterGroup: { + #ClusterGroupPut + + #ClusterGroupPost + + // List of URLs of objects using this cluster group + // Read only: true + // Example: ["/1.0/cluster/members/server01", "/1.0/project/default"] + // + // API extension: cluster_group_usedby. + used_by: [...string] @go(UsedBy,[]string) +} + +// ClusterGroupPost represents the fields required to rename a cluster group. +// +// swagger:model +// +// API extension: clustering_groups. +#ClusterGroupPost: { + // The new name of the cluster group + // Example: group1 + name: string @go(Name) +} + +// ClusterGroupPut represents the modifiable fields of a cluster group. +// +// swagger:model +// +// API extension: clustering_groups. +#ClusterGroupPut: { + // The description of the cluster group + // Example: amd64 servers + description: string @go(Description) + + // List of members in this group + // Example: ["server01", "server02"] + members: [...string] @go(Members,[]string) + + // Cluster group configuration map + // Example: {"user.mykey": "foo"} + // + // API extension: clustering_groups_config. + config: #ConfigMap @go(Config) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/cluster_state_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/cluster_state_go_gen.cue new file mode 100644 index 0000000..00431df --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/cluster_state_go_gen.cue @@ -0,0 +1,32 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus/v7/shared/api + +package api + +// ClusterMemberSysInfo represents the sysinfo of a cluster member. +// +// swagger:model +// +// API extension: cluster_member_state. +#ClusterMemberSysInfo: { + uptime: int64 @go(Uptime) + load_averages: [...float64] @go(LoadAverages,[]float64) + total_ram: uint64 @go(TotalRAM) + free_ram: uint64 @go(FreeRAM) + shared_ram: uint64 @go(SharedRAM) + buffered_ram: uint64 @go(BufferRAM) + total_swap: uint64 @go(TotalSwap) + free_swap: uint64 @go(FreeSwap) + processes: uint16 @go(Processes) +} + +// ClusterMemberState represents the state of a cluster member. +// +// swagger:model +// +// API extension: cluster_member_state. +#ClusterMemberState: { + sysinfo: #ClusterMemberSysInfo @go(SysInfo) + storage_pools: {[string]: #StoragePoolState} @go(StoragePools,map[string]StoragePoolState) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/config_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/config_go_gen.cue new file mode 100644 index 0000000..8807245 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/config_go_gen.cue @@ -0,0 +1,15 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus/v7/shared/api + +package api + +// ConfigMap type is used to hold incus config. In contrast to plain +// map[string]string it provides unmarshal methods for JSON and YAML, which +// gracefully handle numbers and bools. +// +// swagger:model +// swagger:type object +// +// Example: {"user.mykey": "foo"} +#ConfigMap: _ diff --git a/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/devices_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/devices_go_gen.cue new file mode 100644 index 0000000..14e9818 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/devices_go_gen.cue @@ -0,0 +1,15 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus/v7/shared/api + +package api + +// DevicesMap type is used to hold incus devices configurations. In contrast to +// plain map[string]map[string]string it provides unmarshal methods for JSON and +// YAML, which gracefully handle numbers and bools. +// +// swagger:model +// swagger:type object +// +// Example: {"eth0":{"network":"incusbr0","type":"nic"} +#DevicesMap: _ diff --git a/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/doc_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/doc_go_gen.cue new file mode 100644 index 0000000..ddc2519 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/doc_go_gen.cue @@ -0,0 +1,17 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus/v7/shared/api + +// Package api contains Go structs for all API objects +// +// # Overview +// +// This package has Go structs for every API object, all the various +// structs are named after the object they represent and some variations of +// those structs exist for initial object creation, object update and +// object retrieval. +// +// A few convenience functions are also tied to those structs which let +// you convert between the various strucs for a given object and also query +// some of the more complex metadata available. +package api diff --git a/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/event_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/event_go_gen.cue new file mode 100644 index 0000000..2148d99 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/event_go_gen.cue @@ -0,0 +1,86 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus/v7/shared/api + +package api + +import "time" + +#EventTypeLifecycle: "lifecycle" +#EventTypeLogging: "logging" +#EventTypeOperation: "operation" +#EventTypeNetworkACL: "network-acl" + +// Event represents an event entry (over websocket) +// +// swagger:model +#Event: { + // Event type (one of operation, logging or lifecycle) + // Example: lifecycle + type: string @go(Type) + + // Time at which the event was sent + // Example: 2021-02-24T19:00:45.452649098-05:00 + timestamp: time.Time @go(Timestamp) + + // JSON encoded metadata (see EventLogging, EventLifecycle or Operation) + // Example: {"action": "instance-started", "source": "/1.0/instances/c1", "context": {}} + metadata: _ @go(Metadata,json.RawMessage) + + // Originating cluster member + // Example: server01 + // + // API extension: event_location + location?: string @go(Location) + + // Project the event belongs to. + // Example: default + // + // API extension: event_project + project?: string @go(Project) +} + +// EventLogRecord represents single log record. +#EventLogRecord: { + Time: time.Time + Lvl: string + Msg: string + Ctx: [...] @go(,[]any) +} + +// EventLogging represents a logging type event entry (admin only). +#EventLogging: { + message: string @go(Message) + level: string @go(Level) + context: {[string]: string} @go(Context,map[string]string) +} + +// EventLifecycle represents a lifecycle type event entry +// +// API extension: event_lifecycle. +#EventLifecycle: { + action: string @go(Action) + source: string @go(Source) + context?: {...} @go(Context,map[string]any) + + // API extension: event_lifecycle_requestor + requestor?: null | #EventLifecycleRequestor @go(Requestor,*EventLifecycleRequestor) + + // API extension: event_lifecycle_name_and_project + name?: string @go(Name) + project?: string @go(Project) +} + +// EventLifecycleRequestor represents the initial requestor for an event +// +// API extension: event_lifecycle_requestor. +#EventLifecycleRequestor: { + username: string @go(Username) + protocol: string @go(Protocol) + + // Requestor address + // Example: 10.0.2.15 + // + // API extension: event_lifecycle_requestor_address + address: string @go(Address) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/event_lifecycle_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/event_lifecycle_go_gen.cue new file mode 100644 index 0000000..205122f --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/event_lifecycle_go_gen.cue @@ -0,0 +1,144 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus/v7/shared/api + +package api + +#EventLifecycleCertificateCreated: "certificate-created" +#EventLifecycleCertificateDeleted: "certificate-deleted" +#EventLifecycleCertificateUpdated: "certificate-updated" +#EventLifecycleClusterCertificateUpdated: "cluster-certificate-updated" +#EventLifecycleClusterDisabled: "cluster-disabled" +#EventLifecycleClusterEnabled: "cluster-enabled" +#EventLifecycleClusterGroupCreated: "cluster-group-created" +#EventLifecycleClusterGroupDeleted: "cluster-group-deleted" +#EventLifecycleClusterGroupRenamed: "cluster-group-renamed" +#EventLifecycleClusterGroupUpdated: "cluster-group-updated" +#EventLifecycleClusterMemberAdded: "cluster-member-added" +#EventLifecycleClusterMemberEvacuated: "cluster-member-evacuated" +#EventLifecycleClusterMemberHealed: "cluster-member-healed" +#EventLifecycleClusterMemberRemoved: "cluster-member-removed" +#EventLifecycleClusterMemberRenamed: "cluster-member-renamed" +#EventLifecycleClusterMemberRestored: "cluster-member-restored" +#EventLifecycleClusterMemberUpdated: "cluster-member-updated" +#EventLifecycleClusterTokenCreated: "cluster-token-created" +#EventLifecycleConfigUpdated: "config-updated" +#EventLifecycleImageAliasCreated: "image-alias-created" +#EventLifecycleImageAliasDeleted: "image-alias-deleted" +#EventLifecycleImageAliasRenamed: "image-alias-renamed" +#EventLifecycleImageAliasUpdated: "image-alias-updated" +#EventLifecycleImageCreated: "image-created" +#EventLifecycleImageDeleted: "image-deleted" +#EventLifecycleImageRefreshed: "image-refreshed" +#EventLifecycleImageRetrieved: "image-retrieved" +#EventLifecycleImageSecretCreated: "image-secret-created" +#EventLifecycleImageUpdated: "image-updated" +#EventLifecycleInstanceBackupCreated: "instance-backup-created" +#EventLifecycleInstanceBackupDeleted: "instance-backup-deleted" +#EventLifecycleInstanceBackupRenamed: "instance-backup-renamed" +#EventLifecycleInstanceBackupRetrieved: "instance-backup-retrieved" +#EventLifecycleInstanceConsole: "instance-console" +#EventLifecycleInstanceConsoleReset: "instance-console-reset" +#EventLifecycleInstanceConsoleRetrieved: "instance-console-retrieved" +#EventLifecycleInstanceCreated: "instance-created" +#EventLifecycleInstanceDeleted: "instance-deleted" +#EventLifecycleInstanceExec: "instance-exec" +#EventLifecycleInstanceFileDeleted: "instance-file-deleted" +#EventLifecycleInstanceFilePushed: "instance-file-pushed" +#EventLifecycleInstanceFileRetrieved: "instance-file-retrieved" +#EventLifecycleInstanceLogDeleted: "instance-log-deleted" +#EventLifecycleInstanceLogRetrieved: "instance-log-retrieved" +#EventLifecycleInstanceMetadataRetrieved: "instance-metadata-retrieved" +#EventLifecycleInstanceMetadataTemplateCreated: "instance-metadata-template-created" +#EventLifecycleInstanceMetadataTemplateDeleted: "instance-metadata-template-deleted" +#EventLifecycleInstanceMetadataTemplateRetrieved: "instance-metadata-template-retrieved" +#EventLifecycleInstanceMetadataUpdated: "instance-metadata-updated" +#EventLifecycleInstanceMigrated: "instance-migrated" +#EventLifecycleInstancePaused: "instance-paused" +#EventLifecycleInstanceAgentStarted: "instance-agent-started" +#EventLifecycleInstanceAgentStopped: "instance-agent-stopped" +#EventLifecycleInstanceReady: "instance-ready" +#EventLifecycleInstanceRenamed: "instance-renamed" +#EventLifecycleInstanceRestarted: "instance-restarted" +#EventLifecycleInstanceRestored: "instance-restored" +#EventLifecycleInstanceResumed: "instance-resumed" +#EventLifecycleInstanceShutdown: "instance-shutdown" +#EventLifecycleInstanceSnapshotCreated: "instance-snapshot-created" +#EventLifecycleInstanceSnapshotDeleted: "instance-snapshot-deleted" +#EventLifecycleInstanceSnapshotRenamed: "instance-snapshot-renamed" +#EventLifecycleInstanceSnapshotUpdated: "instance-snapshot-updated" +#EventLifecycleInstanceStarted: "instance-started" +#EventLifecycleInstanceStopped: "instance-stopped" +#EventLifecycleInstanceUpdated: "instance-updated" +#EventLifecycleNetworkACLCreated: "network-acl-created" +#EventLifecycleNetworkACLDeleted: "network-acl-deleted" +#EventLifecycleNetworkACLRenamed: "network-acl-renamed" +#EventLifecycleNetworkACLUpdated: "network-acl-updated" +#EventLifecycleNetworkAddressSetCreated: "network-address-set-created" +#EventLifecycleNetworkAddressSetDeleted: "network-address-set-deleted" +#EventLifecycleNetworkAddressSetRenamed: "network-address-set-renamed" +#EventLifecycleNetworkAddressSetUpdated: "network-address-set-updated" +#EventLifecycleNetworkCreated: "network-created" +#EventLifecycleNetworkDeleted: "network-deleted" +#EventLifecycleNetworkForwardCreated: "network-forward-created" +#EventLifecycleNetworkForwardDeleted: "network-forward-deleted" +#EventLifecycleNetworkForwardUpdated: "network-forward-updated" +#EventLifecycleNetworkIntegrationCreated: "network-integration-created" +#EventLifecycleNetworkIntegrationDeleted: "network-integration-deleted" +#EventLifecycleNetworkIntegrationRenamed: "network-integration-renamed" +#EventLifecycleNetworkIntegrationUpdated: "network-integration-updated" +#EventLifecycleNetworkLoadBalancerCreated: "network-load-balancer-created" +#EventLifecycleNetworkLoadBalancerDeleted: "network-load-balancer-deleted" +#EventLifecycleNetworkLoadBalancerUpdated: "network-load-balancer-updated" +#EventLifecycleNetworkPeerCreated: "network-peer-created" +#EventLifecycleNetworkPeerDeleted: "network-peer-deleted" +#EventLifecycleNetworkPeerUpdated: "network-peer-updated" +#EventLifecycleNetworkRenamed: "network-renamed" +#EventLifecycleNetworkUpdated: "network-updated" +#EventLifecycleNetworkZoneCreated: "network-zone-created" +#EventLifecycleNetworkZoneDeleted: "network-zone-deleted" +#EventLifecycleNetworkZoneRecordCreated: "network-zone-record-created" +#EventLifecycleNetworkZoneRecordDeleted: "network-zone-record-deleted" +#EventLifecycleNetworkZoneRecordUpdated: "network-zone-record-updated" +#EventLifecycleNetworkZoneUpdated: "network-zone-updated" +#EventLifecycleOperationCancelled: "operation-cancelled" +#EventLifecycleProfileCreated: "profile-created" +#EventLifecycleProfileDeleted: "profile-deleted" +#EventLifecycleProfileRenamed: "profile-renamed" +#EventLifecycleProfileUpdated: "profile-updated" +#EventLifecycleProjectCreated: "project-created" +#EventLifecycleProjectDeleted: "project-deleted" +#EventLifecycleProjectRenamed: "project-renamed" +#EventLifecycleProjectUpdated: "project-updated" +#EventLifecycleStorageBucketBackupCreated: "storage-bucket-backup-created" +#EventLifecycleStorageBucketBackupDeleted: "storage-bucket-backup-deleted" +#EventLifecycleStorageBucketBackupRenamed: "storage-bucket-backup-renamed" +#EventLifecycleStorageBucketBackupRetrieved: "storage-bucket-backup-retrieved" +#EventLifecycleStorageBucketCreated: "storage-bucket-created" +#EventLifecycleStorageBucketDeleted: "storage-bucket-deleted" +#EventLifecycleStorageBucketKeyCreated: "storage-bucket-key-created" +#EventLifecycleStorageBucketKeyDeleted: "storage-bucket-key-deleted" +#EventLifecycleStorageBucketKeyUpdated: "storage-bucket-key-updated" +#EventLifecycleStorageBucketUpdated: "storage-bucket-updated" +#EventLifecycleStoragePoolCreated: "storage-pool-created" +#EventLifecycleStoragePoolDeleted: "storage-pool-deleted" +#EventLifecycleStoragePoolUpdated: "storage-pool-updated" +#EventLifecycleStorageVolumeBackupCreated: "storage-volume-backup-created" +#EventLifecycleStorageVolumeBackupDeleted: "storage-volume-backup-deleted" +#EventLifecycleStorageVolumeBackupRenamed: "storage-volume-backup-renamed" +#EventLifecycleStorageVolumeBackupRetrieved: "storage-volume-backup-retrieved" +#EventLifecycleStorageVolumeCreated: "storage-volume-created" +#EventLifecycleStorageVolumeDeleted: "storage-volume-deleted" +#EventLifecycleStorageVolumeFileDeleted: "storage-volume-file-deleted" +#EventLifecycleStorageVolumeFilePushed: "storage-volume-file-pushed" +#EventLifecycleStorageVolumeFileRetrieved: "storage-volume-file-retrieved" +#EventLifecycleStorageVolumeRenamed: "storage-volume-renamed" +#EventLifecycleStorageVolumeRestored: "storage-volume-restored" +#EventLifecycleStorageVolumeSnapshotCreated: "storage-volume-snapshot-created" +#EventLifecycleStorageVolumeSnapshotDeleted: "storage-volume-snapshot-deleted" +#EventLifecycleStorageVolumeSnapshotRenamed: "storage-volume-snapshot-renamed" +#EventLifecycleStorageVolumeSnapshotUpdated: "storage-volume-snapshot-updated" +#EventLifecycleStorageVolumeUpdated: "storage-volume-updated" +#EventLifecycleWarningAcknowledged: "warning-acknowledged" +#EventLifecycleWarningDeleted: "warning-deleted" +#EventLifecycleWarningReset: "warning-reset" diff --git a/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/image_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/image_go_gen.cue new file mode 100644 index 0000000..869a0dc --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/image_go_gen.cue @@ -0,0 +1,345 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus/v7/shared/api + +package api + +import "time" + +// ImageExportPost represents the fields required to export an image +// +// swagger:model +// +// API extension: images_push_relay. +#ImageExportPost: { + // Target server URL + // Example: https://1.2.3.4:8443 + target: string @go(Target) + + // Image receive secret + // Example: RANDOM-STRING + secret: string @go(Secret) + + // Remote server certificate + // Example: X509 PEM certificate + certificate: string @go(Certificate) + + // List of aliases to set on the image + aliases: [...#ImageAlias] @go(Aliases,[]ImageAlias) + + // Project name + // Example: project1 + // + // API extension: image_target_project + project: string @go(Project) + + // List of profiles to use + // Example: ["default"] + // + // API extension: image_copy_profile + profiles: [...string] @go(Profiles,[]string) +} + +// ImagesPost represents the fields available for a new image +// +// swagger:model +#ImagesPost: { + #ImagePut + + // Original filename of the image + // Example: image.tar.xz + filename: string @go(Filename) + + // Source of the image + source?: null | #ImagesPostSource @go(Source,*ImagesPostSource) + + // Compression algorithm to use when turning an instance into an image + // Example: gzip + // + // API extension: image_compression_algorithm + compression_algorithm: string @go(CompressionAlgorithm) + + // Type of image format + // Example: split + // + // API extension: instance_publish_split + format: string @go(Format) + + // Aliases to add to the image + // Example: [{"name": "foo"}, {"name": "bar"}] + // + // API extension: image_create_aliases + aliases: [...#ImageAlias] @go(Aliases,[]ImageAlias) +} + +// ImagesPostSource represents the source of a new image +// +// swagger:model +#ImagesPostSource: { + #ImageSource + + // Transfer mode (push or pull) + // Example: pull + mode: string @go(Mode) + + // Type of image source (instance, snapshot, image or url) + // Example: instance + type: string @go(Type) + + // Source URL (for type "url") + // Example: https://some-server.com/some-directory/ + url: string @go(URL) + + // Instance name (for type "instance" or "snapshot") + // Example: c1/snap0 + name: string @go(Name) + + // Source image fingerprint (for type "image") + // Example: 8ae945c52bb2f2df51c923b04022312f99bbb72c356251f54fa89ea7cf1df1d0 + fingerprint: string @go(Fingerprint) + + // Source image server secret token (when downloading private images) + // Example: RANDOM-STRING + secret: string @go(Secret) + + // Source project name + // Example: project1 + // + // API extension: image_source_project + project: string @go(Project) +} + +// ImagePut represents the modifiable fields of an image +// +// swagger:model +#ImagePut: { + // Whether the image should auto-update when a new build is available + // Example: true + auto_update: bool @go(AutoUpdate) + + // Descriptive properties + // Example: {"os": "Ubuntu", "release": "jammy", "variant": "cloud"} + properties: {[string]: string} @go(Properties,map[string]string) + + // Whether the image is available to unauthenticated users + // Example: false + public: bool @go(Public) + + // When the image becomes obsolete + // Example: 2025-03-23T20:00:00-04:00 + // + // API extension: images_expiry + expires_at: time.Time @go(ExpiresAt) + + // List of profiles to use when creating from this image (if none provided by user) + // Example: ["default"] + // + // API extension: image_profiles + profiles: [...string] @go(Profiles,[]string) +} + +// Image represents an image +// +// swagger:model +#Image: { + #ImagePut + + // List of aliases + aliases: [...#ImageAlias] @go(Aliases,[]ImageAlias) + + // Architecture + // Example: x86_64 + architecture: string @go(Architecture) + + // Whether the image is an automatically cached remote image + // Example: true + cached: bool @go(Cached) + + // Original filename + // Example: 06b86454720d36b20f94e31c6812e05ec51c1b568cf3a8abd273769d213394bb.rootfs + filename: string @go(Filename) + + // Full SHA-256 fingerprint + // Example: 06b86454720d36b20f94e31c6812e05ec51c1b568cf3a8abd273769d213394bb + fingerprint: string @go(Fingerprint) + + // Size of the image in bytes + // Example: 272237676 + size: int64 @go(Size) + + // Where the image came from + update_source?: null | #ImageSource @go(UpdateSource,*ImageSource) + + // Type of image (container or virtual-machine) + // Example: container + // + // API extension: image_types + type: string @go(Type) + + // When the image was originally created + // Example: 2021-03-23T20:00:00-04:00 + created_at: time.Time @go(CreatedAt) + + // Last time the image was used + // Example: 2021-03-22T20:39:00.575185384-04:00 + last_used_at: time.Time @go(LastUsedAt) + + // When the image was added to this server + // Example: 2021-03-24T14:18:15.115036787-04:00 + uploaded_at: time.Time @go(UploadedAt) + + // Project name + // Example: project1 + // + // API extension: images_all_projects + project: string @go(Project) +} + +// ImageAlias represents an alias from the alias list of an image +// +// swagger:model +#ImageAlias: { + // Name of the alias + // Example: ubuntu-22.04 + name: string @go(Name) + + // Description of the alias + // Example: Our preferred Ubuntu image + description: string @go(Description) +} + +// ImageSource represents the source of an image +// +// swagger:model +#ImageSource: { + // Source alias to download from + // Example: jammy + alias: string @go(Alias) + + // Source server certificate (if not trusted by system CA) + // Example: X509 PEM certificate + certificate: string @go(Certificate) + + // Source server protocol + // Example: simplestreams + protocol: string @go(Protocol) + + // URL of the source server + // Example: https://images.linuxcontainers.org + server: string @go(Server) + + // Type of image (container or virtual-machine) + // Example: container + // + // API extension: image_types + image_type: string @go(ImageType) +} + +// ImageAliasesPost represents a new image alias +// +// swagger:model +#ImageAliasesPost: { + #ImageAliasesEntry +} + +// ImageAliasesEntryPost represents the required fields to rename an image alias +// +// swagger:model +#ImageAliasesEntryPost: { + // Alias name + // Example: ubuntu-22.04 + name: string @go(Name) +} + +// ImageAliasesEntryPut represents the modifiable fields of an image alias +// +// swagger:model +#ImageAliasesEntryPut: { + // Alias description + // Example: Our preferred Ubuntu image + description: string @go(Description) + + // Target fingerprint for the alias + // Example: 06b86454720d36b20f94e31c6812e05ec51c1b568cf3a8abd273769d213394bb + target: string @go(Target) +} + +// ImageAliasesEntry represents an image alias +// +// swagger:model +#ImageAliasesEntry: { + #ImageAliasesEntryPut + + // Alias name + // Example: ubuntu-22.04 + name: string @go(Name) + + // Alias type (container or virtual-machine) + // Example: container + // + // API extension: image_types + type: string @go(Type) +} + +// ImageMetadata represents image metadata (used in image tarball) +// +// swagger:model +#ImageMetadata: { + // Architecture name + // Example: x86_64 + architecture: string @go(Architecture) + + // Image creation data (as UNIX epoch) + // Example: 1620655439 + creation_date: int64 @go(CreationDate) + + // Image expiry data (as UNIX epoch) + // Example: 1620685757 + expiry_date: int64 @go(ExpiryDate) + + // Descriptive properties + // Example: {"os": "Ubuntu", "release": "jammy", "variant": "cloud"} + properties: {[string]: string} @go(Properties,map[string]string) + + // Template for files in the image + templates: {[string]: null | #ImageMetadataTemplate} @go(Templates,map[string]*ImageMetadataTemplate) +} + +// ImageMetadataTemplate represents a template entry in image metadata (used in image tarball) +// +// swagger:model +#ImageMetadataTemplate: { + // When to trigger the template (create, copy or start) + // Example: create + when: [...string] @go(When,[]string) + + // Whether to trigger only if the file is missing + // Example: false + create_only: bool @go(CreateOnly) + + // The template itself as a valid pongo2 template + // Example: pongo2-template + template: string @go(Template) + + // Key/value properties to pass to the template + // Example: {"foo": "bar"} + properties: {[string]: string} @go(Properties,map[string]string) + + // The file owner uid. + // Example: 1000 + // + // API extension: image_template_permissions + uid?: string @go(UID) + + // The file owner gid. + // Example: 1000 + // + // API extension: image_template_permissions + gid?: string @go(GID) + + // The file permissions. + // Example: 644 + // + // API extension: image_template_permissions + mode?: string @go(Mode) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/init_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/init_go_gen.cue new file mode 100644 index 0000000..aba8b9a --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/init_go_gen.cue @@ -0,0 +1,113 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus/v7/shared/api + +package api + +// InitPreseed represents initialization configuration that can be supplied to `init`. +// +// swagger:model +// +// API extension: preseed. +#InitPreseed: { + #InitLocalPreseed + cluster?: null | #InitClusterPreseed @go(Cluster,*InitClusterPreseed) +} + +// InitLocalPreseed represents initialization configuration. +// +// swagger:model +// +// API extension: preseed. +#InitLocalPreseed: { + #ServerPut + + // Networks by project to add + // Example: Network on the "default" project + networks: [...#InitNetworksProjectPost] @go(Networks,[]InitNetworksProjectPost) + + // Storage Pools to add + // Example: local dir storage pool + storage_pools: [...#StoragePoolsPost] @go(StoragePools,[]StoragePoolsPost) + + // Storage Volumes to add + // Example: local dir storage volume + // + // API extension: init_preseed_storage_volumes. + storage_volumes: [...#InitStorageVolumesProjectPost] @go(StorageVolumes,[]InitStorageVolumesProjectPost) + + // Profiles to add + // Example: "default" profile with a root disk device + profiles: [...#InitProfileProjectPost] @go(Profiles,[]InitProfileProjectPost) + + // Projects to add + // Example: "default" project + projects: [...#ProjectsPost] @go(Projects,[]ProjectsPost) + + // Certificates to add + // Example: PEM encoded certificate + // + // API extension: init_preseed_certificates. + certificates: [...#CertificatesPost] @go(Certificates,[]CertificatesPost) + + // Cluster groups to add + // + // API extension: init_preseed_cluster_groups. + cluster_groups: [...#ClusterGroupsPost] @go(ClusterGroups,[]ClusterGroupsPost) +} + +// InitNetworksProjectPost represents the fields of a new network along with its associated project. +// +// swagger:model +// +// API extension: preseed. +#InitNetworksProjectPost: { + #NetworksPost + + // Project in which the network will reside + // Example: "default" + Project: string +} + +// InitProfileProjectPost represents the fields of a new profile along with its associated project. +// +// swagger:model +// +// API extension: init_preseed_profile_project. +#InitProfileProjectPost: { + #ProfilesPost + + // Project in which the profile will reside + // Example: "default" + Project: string +} + +// InitStorageVolumesProjectPost represents the fields of a new storage volume along with its associated pool. +// +// swagger:model +// +// API extension: init_preseed_storage_volumes. +#InitStorageVolumesProjectPost: { + #StorageVolumesPost + + // Storage pool in which the volume will reside + // Example: "default" + Pool: string + + // Project in which the volume will reside + // Example: "default" + Project: string +} + +// InitClusterPreseed represents initialization configuration for the cluster. +// +// swagger:model +// +// API extension: preseed. +#InitClusterPreseed: { + #ClusterPut + + // The path to the cluster certificate + // Example: /tmp/cluster.crt + cluster_certificate_path: string @go(ClusterCertificatePath) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/instance_backup_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/instance_backup_go_gen.cue new file mode 100644 index 0000000..bbea198 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/instance_backup_go_gen.cue @@ -0,0 +1,115 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus/v7/shared/api + +package api + +import "time" + +// BackupTarget represents the target storage server for an instance or volume backup. +// +// swagger:model +// +// API extension: backup_s3_upload. +#BackupTarget: { + // Protocol is the upload protocol. + // Example: S3 + protocol: string @go(Protocol) + + // URL is the HTTPS URL for the backup + // Example: https://storage.googleapis.com + url: string @go(URL) + + // BucketName is the name of the S3 bucket. + // Example: my_bucket + bucket_name: string @go(BucketName) + + // Path is the target path. + // Example: foo/test.tar + path: string @go(Path) + + // AccessKey is the S3 API access key + // Example: GOOG1234 + access_key: string @go(AccessKey) + + // SecretKey is the S3 API access key + // Example: secret123 + secret_key: string @go(SecretKey) +} + +// InstanceBackupsPost represents the fields available for a new instance backup. +// +// swagger:model +// +// API extension: instances. +#InstanceBackupsPost: { + // Backup name + // Example: backup0 + name: string @go(Name) + + // When the backup expires (gets auto-deleted) + // Example: 2021-03-23T17:38:37.753398689-04:00 + expires_at: time.Time @go(ExpiresAt) + + // Whether to ignore snapshots + // Example: false + instance_only: bool @go(InstanceOnly) + + // Whether to ignore dependent volumes + // Example: false + root_only: bool @go(RootOnly) + + // Whether to use a pool-optimized binary format (instead of plain tarball) + // Example: true + optimized_storage: bool @go(OptimizedStorage) + + // What compression algorithm to use + // Example: gzip + // + // API extension: backup_compression_algorithm + compression_algorithm: string @go(CompressionAlgorithm) + + // External upload target + // The backup will be uploaded and then deleted from local storage. + // + // API extension: backup_s3_upload + target?: null | #BackupTarget @go(Target,*BackupTarget) +} + +// InstanceBackup represents an instance backup. +// +// swagger:model +// +// API extension: instances. +#InstanceBackup: { + // Backup name + // Example: backup0 + name: string @go(Name) + + // When the backup was created + // Example: 2021-03-23T16:38:37.753398689-04:00 + created_at: time.Time @go(CreatedAt) + + // When the backup expires (gets auto-deleted) + // Example: 2021-03-23T17:38:37.753398689-04:00 + expires_at: time.Time @go(ExpiresAt) + + // Whether to ignore snapshots + // Example: false + instance_only: bool @go(InstanceOnly) + + // Whether to use a pool-optimized binary format (instead of plain tarball) + // Example: true + optimized_storage: bool @go(OptimizedStorage) +} + +// InstanceBackupPost represents the fields available for the renaming of a instance backup. +// +// swagger:model +// +// API extension: instances. +#InstanceBackupPost: { + // New backup name + // Example: backup1 + name: string @go(Name) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/instance_console_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/instance_console_go_gen.cue new file mode 100644 index 0000000..5539fe5 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/instance_console_go_gen.cue @@ -0,0 +1,40 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus/v7/shared/api + +package api + +// InstanceConsoleControl represents a message on the instance console "control" socket. +// +// API extension: instances. +#InstanceConsoleControl: { + command: string @go(Command) + args: {[string]: string} @go(Args,map[string]string) +} + +// InstanceConsolePost represents an instance console request. +// +// swagger:model +// +// API extension: instances. +#InstanceConsolePost: { + // Console width in columns (console type only) + // Example: 80 + width: int @go(Width) + + // Console height in rows (console type only) + // Example: 24 + height: int @go(Height) + + // Type of console to attach to (console or vga) + // Example: console + // + // API extension: console_vga_type + type: string @go(Type) + + // Forces a connection to the console + // Example: true + // + // API extension: console_force + force: bool @go(Force) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/instance_debug_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/instance_debug_go_gen.cue new file mode 100644 index 0000000..8902671 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/instance_debug_go_gen.cue @@ -0,0 +1,16 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus/v7/shared/api + +package api + +// InstanceDebugRepairPost represents an instance repair request. +// +// swagger:model +// +// API extension: instances_debug_repair. +#InstanceDebugRepairPost: { + // The desired repair action. + // Example: rebuild-config-volume + action: string @go(Action) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/instance_exec_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/instance_exec_go_gen.cue new file mode 100644 index 0000000..d66dcbd --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/instance_exec_go_gen.cue @@ -0,0 +1,60 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus/v7/shared/api + +package api + +// InstanceExecControl represents a message on the instance exec "control" socket. +// +// API extension: instances. +#InstanceExecControl: { + command: string @go(Command) + args: {[string]: string} @go(Args,map[string]string) + signal: int @go(Signal) +} + +// InstanceExecPost represents an instance exec request. +// +// swagger:model +// +// API extension: instances. +#InstanceExecPost: { + // Command and its arguments + // Example: ["bash"] + command: [...string] @go(Command,[]string) + + // Whether to wait for all websockets to be connected before spawning the command + // Example: true + "wait-for-websocket": bool @go(WaitForWS) + + // Whether the command is to be spawned in interactive mode (singled PTY instead of 3 PIPEs) + // Example: true + interactive: bool @go(Interactive) + + // Additional environment to pass to the command + // Example: {"FOO": "BAR"} + environment: {[string]: string} @go(Environment,map[string]string) + + // Terminal width in characters (for interactive) + // Example: 80 + width: int @go(Width) + + // Terminal height in rows (for interactive) + // Example: 24 + height: int @go(Height) + + // Whether to capture the output for later download (requires non-interactive) + "record-output": bool @go(RecordOutput) + + // UID of the user to spawn the command as + // Example: 1000 + user: uint32 @go(User) + + // GID of the user to spawn the command as + // Example: 1000 + group: uint32 @go(Group) + + // Current working directory for the command + // Example: /home/foo/ + cwd: string @go(Cwd) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/instance_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/instance_go_gen.cue new file mode 100644 index 0000000..04e402e --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/instance_go_gen.cue @@ -0,0 +1,351 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus/v7/shared/api + +package api + +import "time" + +// InstanceType represents the type if instance being returned or requested via the API. +#InstanceType: string // #enumInstanceType + +#enumInstanceType: + #InstanceTypeAny | + #InstanceTypeContainer | + #InstanceTypeVM + +#InstanceTypeAny: #InstanceType & "" + +#InstanceTypeContainer: #InstanceType & "container" + +#InstanceTypeVM: #InstanceType & "virtual-machine" + +// InstancesPost represents the fields available for a new instance. +// +// swagger:model +// +// API extension: instances. +#InstancesPost: { + #InstancePut + + // Instance name + // Example: foo + name: string @go(Name) + + // Creation source + source: #InstanceSource @go(Source) + + // Cloud instance type (AWS, GCP, Azure, ...) to emulate with limits + // Example: t1.micro + instance_type: string @go(InstanceType) + + // Type (container or virtual-machine) + // Example: container + type: #InstanceType @go(Type) + + // Whether to start the instance after creation + // Example: true + // + // API extension: instance_create_start + start: bool @go(Start) +} + +// InstancesPut represents the fields available for a mass update. +// +// swagger:model +// +// API extension: instance_bulk_state_change. +#InstancesPut: { + // Desired runtime state + state?: null | #InstanceStatePut @go(State,*InstanceStatePut) +} + +// InstancePost represents the fields required to rename/move an instance. +// +// swagger:model +// +// API extension: instances. +#InstancePost: { + // New name for the instance + // Example: bar + name: string @go(Name) + + // Whether the instance is being migrated to another server + // Example: false + migration: bool @go(Migration) + + // Whether to perform a live migration (migration only) + // Example: false + live: bool @go(Live) + + // Whether snapshots should be discarded (migration only) + // Example: false + instance_only: bool @go(InstanceOnly) + + // Target for the migration, will use pull mode if not set (migration only) + target?: null | #InstancePostTarget @go(Target,*InstancePostTarget) + + // Target pool for local cross-pool move + // Example: baz + // + // API extension: instance_pool_move + pool: string @go(Pool) + + // Target project for local cross-project move + // Example: foo + // + // API extension: instance_project_move + project: string @go(Project) + + // AllowInconsistent allow inconsistent copies when migrating. + // Example: false + // + // API extension: instance_allow_inconsistent_copy + allow_inconsistent: bool @go(AllowInconsistent) + + // Instance configuration file. + // Example: {"security.nesting": "true"} + // + // API extension: instance_move_config + Config: #ConfigMap + + // Instance devices. + // Example: {"root": {"type": "disk", "pool": "default", "path": "/"}} + // + // API extension: instance_move_config + Devices: #DevicesMap + + // List of profiles applied to the instance. + // Example: ["default"] + // + // API extension: instance_move_config + Profiles: [...string] @go(,[]string) +} + +// InstancePostTarget represents the migration target host and operation. +// +// swagger:model +// +// API extension: instances. +#InstancePostTarget: { + // The certificate of the migration target + // Example: X509 PEM certificate + certificate: string @go(Certificate) + + // The operation URL on the remote target + // Example: https://1.2.3.4:8443/1.0/operations/5e8e1638-5345-4c2d-bac9-2c79c8577292 + operation?: string @go(Operation) + + // Migration websockets credentials + // Example: {"migration": "random-string", "criu": "random-string"} + secrets?: {[string]: string} @go(Websockets,map[string]string) +} + +// InstancePut represents the modifiable fields of an instance. +// +// swagger:model +// +// API extension: instances. +#InstancePut: { + // Architecture name + // Example: x86_64 + architecture: string @go(Architecture) + + // Instance configuration (see doc/instances.md) + // Example: {"security.nesting": "true"} + config: #ConfigMap @go(Config) + + // Instance devices (see doc/instances.md) + // Example: {"root": {"type": "disk", "pool": "default", "path": "/"}} + devices: #DevicesMap @go(Devices) + + // Whether the instance is ephemeral (deleted on shutdown) + // Example: false + ephemeral: bool @go(Ephemeral) + + // List of profiles applied to the instance + // Example: ["default"] + profiles: [...string] @go(Profiles,[]string) + + // If set, instance will be restored to the provided snapshot name + // Example: snap0 + restore?: string @go(Restore) + + // Whether only the instances disk should be restored + // Example: false + disk_only?: bool @go(DiskOnly) + + // Whether the instance currently has saved state on disk + // Example: false + stateful: bool @go(Stateful) + + // Instance description + // Example: My test instance + description: string @go(Description) +} + +// InstanceRebuildPost indicates how to rebuild an instance. +// +// swagger:model +// +// API extension: instances_rebuild. +#InstanceRebuildPost: { + // Rebuild source + source: #InstanceSource @go(Source) +} + +// Instance represents an instance. +// +// swagger:model +// +// API extension: instances. +#Instance: { + #InstancePut + + // Instance creation timestamp + // Example: 2021-03-23T20:00:00-04:00 + created_at: time.Time @go(CreatedAt) + + // Expanded configuration (all profiles and local config merged) + // Example: {"security.nesting": "true"} + expanded_config?: #ConfigMap @go(ExpandedConfig) + + // Expanded devices (all profiles and local devices merged) + // Example: {"root": {"type": "disk", "pool": "default", "path": "/"}} + expanded_devices?: #DevicesMap @go(ExpandedDevices) + + // Instance name + // Example: foo + name: string @go(Name) + + // Instance status (see instance_state) + // Example: Running + status: string @go(Status) + + // Instance status code (see instance_state) + // Example: 101 + status_code: #StatusCode @go(StatusCode) + + // Last start timestamp + // Example: 2021-03-23T20:00:00-04:00 + last_used_at: time.Time @go(LastUsedAt) + + // What cluster member this instance is located on + // Example: server01 + location: string @go(Location) + + // The type of instance (container or virtual-machine) + // Example: container + type: string @go(Type) + + // Instance project name + // Example: foo + // + // API extension: instance_all_projects + project: string @go(Project) +} + +// InstanceFull is a combination of Instance, InstanceBackup, InstanceState and InstanceSnapshot. +// +// swagger:model +// +// API extension: instances. +#InstanceFull: { + #Instance + + // List of backups. + backups: [...#InstanceBackup] @go(Backups,[]InstanceBackup) + + // Current state. + state?: null | #InstanceState @go(State,*InstanceState) + + // List of snapshots. + snapshots: [...#InstanceSnapshot] @go(Snapshots,[]InstanceSnapshot) +} + +// InstanceSource represents the creation source for a new instance. +// +// swagger:model +// +// API extension: instances. +#InstanceSource: { + // Source type + // Example: image + type: string @go(Type) + + // Certificate (for remote images or migration) + // Example: X509 PEM certificate + certificate: string @go(Certificate) + + // Image alias name (for image source) + // Example: ubuntu/22.04 + alias?: string @go(Alias) + + // Image fingerprint (for image source) + // Example: ed56997f7c5b48e8d78986d2467a26109be6fb9f2d92e8c7b08eb8b6cec7629a + fingerprint?: string @go(Fingerprint) + + // Image filters (for image source) + // Example: {"os": "Ubuntu", "release": "jammy", "variant": "cloud"} + properties?: {[string]: string} @go(Properties,map[string]string) + + // Remote server URL (for remote images) + // Example: https://images.linuxcontainers.org + server?: string @go(Server) + + // Remote server secret (for remote private images) + // Example: RANDOM-STRING + secret?: string @go(Secret) + + // Protocol name (for remote image) + // Example: simplestreams + protocol?: string @go(Protocol) + + // Base image fingerprint (for faster migration) + // Example: ed56997f7c5b48e8d78986d2467a26109be6fb9f2d92e8c7b08eb8b6cec7629a + "base-image"?: string @go(BaseImage) + + // Whether to use pull or push mode (for migration) + // Example: pull + mode?: string @go(Mode) + + // Remote operation URL (for migration) + // Example: https://1.2.3.4:8443/1.0/operations/1721ae08-b6a8-416a-9614-3f89302466e1 + operation?: string @go(Operation) + + // Map of migration websockets (for migration) + // Example: {"criu": "RANDOM-STRING", "rsync": "RANDOM-STRING"} + secrets?: {[string]: string} @go(Websockets,map[string]string) + + // Existing instance name or snapshot (for copy) + // Example: foo/snap0 + source?: string @go(Source) + + // Whether this is a live migration (for migration) + // Example: false + live?: bool @go(Live) + + // Whether the copy should skip the snapshots (for copy) + // Example: false + instance_only?: bool @go(InstanceOnly) + + // Whether this is refreshing an existing instance (for migration and copy) + // Example: false + refresh?: bool @go(Refresh) + + // Whether to exclude source snapshots earlier than latest target snapshot + // Example: false + // + // API extension: custom_volume_refresh_exclude_older_snapshots + refresh_exclude_older?: bool @go(RefreshExcludeOlder) + + // Source project name (for copy and local image) + // Example: blah + project?: string @go(Project) + + // Whether to ignore errors when copying (e.g. for volatile files) + // Example: false + // + // API extension: instance_allow_inconsistent_copy + allow_inconsistent: bool @go(AllowInconsistent) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/instance_snapshot_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/instance_snapshot_go_gen.cue new file mode 100644 index 0000000..9c83dd5 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/instance_snapshot_go_gen.cue @@ -0,0 +1,124 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus/v7/shared/api + +package api + +import "time" + +// InstanceSnapshotsPost represents the fields available for a new instance snapshot. +// +// swagger:model +// +// API extension: instances. +#InstanceSnapshotsPost: { + // Snapshot name + // Example: snap0 + name: string @go(Name) + + // Whether the snapshot should include runtime state + // Example: false + stateful: bool @go(Stateful) + + // When the snapshot expires (gets auto-deleted) + // Example: 2021-03-23T17:38:37.753398689-04:00 + // + // API extension: snapshot_expiry_creation + expires_at?: null | time.Time @go(ExpiresAt,*time.Time) +} + +// InstanceSnapshotPost represents the fields required to rename/move an instance snapshot. +// +// swagger:model +// +// API extension: instances. +#InstanceSnapshotPost: { + // New name for the snapshot + // Example: foo + name: string @go(Name) + + // Whether this is a migration request + // Example: false + migration: bool @go(Migration) + + // Migration target for push migration (requires migration) + target?: null | #InstancePostTarget @go(Target,*InstancePostTarget) + + // Whether to perform a live migration (requires migration) + // Example: false + live?: bool @go(Live) +} + +// InstanceSnapshotPut represents the modifiable fields of an instance snapshot. +// +// swagger:model +// +// API extension: instances. +#InstanceSnapshotPut: { + // When the snapshot expires (gets auto-deleted) + // Example: 2021-03-23T17:38:37.753398689-04:00 + expires_at: time.Time @go(ExpiresAt) +} + +// InstanceSnapshot represents an instance snapshot. +// +// swagger:model +// +// API extension: instances. +#InstanceSnapshot: { + #InstanceSnapshotPut + + // Architecture name + // Example: x86_64 + architecture: string @go(Architecture) + + // Instance configuration (see doc/instances.md) + // Example: {"security.nesting": "true"} + config: #ConfigMap @go(Config) + + // Instance creation timestamp + // Example: 2021-03-23T20:00:00-04:00 + created_at: time.Time @go(CreatedAt) + + // Instance description + // Example: My description + description: string @go(Description) + + // Instance devices (see doc/instances.md) + // Example: {"root": {"type": "disk", "pool": "default", "path": "/"}} + devices: #DevicesMap @go(Devices) + + // Whether the instance is ephemeral (deleted on shutdown) + // Example: false + ephemeral: bool @go(Ephemeral) + + // Expanded configuration (all profiles and local config merged) + // Example: {"security.nesting": "true"} + expanded_config?: #ConfigMap @go(ExpandedConfig) + + // Expanded devices (all profiles and local devices merged) + // Example: {"root": {"type": "disk", "pool": "default", "path": "/"}} + expanded_devices?: #DevicesMap @go(ExpandedDevices) + + // Last start timestamp + // Example: 2021-03-23T20:00:00-04:00 + last_used_at: time.Time @go(LastUsedAt) + + // Snapshot name + // Example: foo + name: string @go(Name) + + // List of profiles applied to the instance + // Example: ["default"] + profiles: [...string] @go(Profiles,[]string) + + // Whether the instance currently has saved state on disk + // Example: false + stateful: bool @go(Stateful) + + // Size of the snapshot in bytes + // Example: 143360 + // + // API extension: snapshot_disk_usage + size: int64 @go(Size) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/instance_state_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/instance_state_go_gen.cue new file mode 100644 index 0000000..e875b85 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/instance_state_go_gen.cue @@ -0,0 +1,262 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus/v7/shared/api + +package api + +import "time" + +// InstanceStatePut represents the modifiable fields of an instance's state. +// +// swagger:model +// +// API extension: instances. +#InstanceStatePut: { + // State change action (start, stop, restart, freeze, unfreeze) + // Example: start + action: string @go(Action) + + // How long to wait (in s) before giving up (when force isn't set) + // Example: 30 + timeout: int @go(Timeout) + + // Whether to force the action (for stop and restart) + // Example: false + force: bool @go(Force) + + // Whether to store the runtime state (for stop) + // Example: false + stateful: bool @go(Stateful) +} + +// InstanceState represents an instance's state. +// +// swagger:model +// +// API extension: instances. +#InstanceState: { + // Current status (Running, Stopped, Frozen or Error) + // Example: Running + status: string @go(Status) + + // Numeric status code (101, 102, 110, 112) + // Example: 101 + status_code: #StatusCode @go(StatusCode) + + // Disk usage key/value pairs + disk: {[string]: #InstanceStateDisk} @go(Disk,map[string]InstanceStateDisk) + + // Memory usage information + memory: #InstanceStateMemory @go(Memory) + + // Network usage key/value pairs + network: {[string]: #InstanceStateNetwork} @go(Network,map[string]InstanceStateNetwork) + + // PID of the runtime + // Example: 7281 + pid: int64 @go(Pid) + + // Number of processes in the instance + // Example: 50 + processes: int64 @go(Processes) + + // CPU usage information + cpu: #InstanceStateCPU @go(CPU) + + // The time that the instance started at + // + // API extension: instance_state_started_at. + started_at: time.Time @go(StartedAt) + + // OS information. + // + // API extension: instances_state_os_info. + os_info?: null | #InstanceStateOSInfo @go(OSInfo,*InstanceStateOSInfo) +} + +// InstanceStateDisk represents the disk information section of an instance's state. +// +// swagger:model +// +// API extension: instances. +#InstanceStateDisk: { + // Disk usage in bytes + // Example: 502239232 + usage: int64 @go(Usage) + + // Total size in bytes + // Example: 502239232 + // + // API extension: instances_state_total + total: int64 @go(Total) +} + +// InstanceStateCPU represents the cpu information section of an instance's state. +// +// swagger:model +// +// API extension: instances. +#InstanceStateCPU: { + // CPU usage in nanoseconds + // Example: 3637691016 + usage: int64 @go(Usage) + + // CPU time available per second, in nanoseconds + // Example: 4000000000 + // + // API extension: instance_state_cpu_time + allocated_time: int64 @go(AllocatedTime) +} + +// InstanceStateMemory represents the memory information section of an instance's state. +// +// swagger:model +// +// API extension: instances. +#InstanceStateMemory: { + // Memory usage in bytes + // Example: 73248768 + usage: int64 @go(Usage) + + // Peak memory usage in bytes + // Example: 73785344 + usage_peak: int64 @go(UsagePeak) + + // Total memory size in bytes + // Example: 12297557 + // + // API extension: instances_state_total + total: int64 @go(Total) + + // SWAP usage in bytes + // Example: 12297557 + swap_usage: int64 @go(SwapUsage) + + // Peak SWAP usage in bytes + // Example: 12297557 + swap_usage_peak: int64 @go(SwapUsagePeak) +} + +// InstanceStateNetwork represents the network information section of an instance's state. +// +// swagger:model +// +// API extension: instances. +#InstanceStateNetwork: { + // List of IP addresses + addresses: [...#InstanceStateNetworkAddress] @go(Addresses,[]InstanceStateNetworkAddress) + + // Traffic counters + counters: #InstanceStateNetworkCounters @go(Counters) + + // MAC address + // Example: 10:66:6a:0c:ee:dd + hwaddr: string @go(Hwaddr) + + // Name of the interface on the host + // Example: vethbbcd39c7 + host_name: string @go(HostName) + + // MTU (maximum transmit unit) for the interface + // Example: 1500 + mtu: int @go(Mtu) + + // Administrative state of the interface (up/down) + // Example: up + state: string @go(State) + + // Type of interface (broadcast, loopback, point-to-point, ...) + // Example: broadcast + type: string @go(Type) +} + +// InstanceStateNetworkAddress represents a network address as part of the network section of an +// instance's state. +// +// swagger:model +// +// API extension: instances. +#InstanceStateNetworkAddress: { + // Network family (inet or inet6) + // Example: inet6 + family: string @go(Family) + + // IP address + // Example: fd42:4c81:5770:1eaf:1266:6aff:fe0c:eedd + address: string @go(Address) + + // Network mask + // Example: 64 + netmask: string @go(Netmask) + + // Address scope (local, link or global) + // Example: global + scope: string @go(Scope) +} + +// InstanceStateNetworkCounters represents packet counters as part of the network section of an +// instance's state. +// +// swagger:model +// +// API extension: instances. +#InstanceStateNetworkCounters: { + // Number of bytes received + // Example: 192021 + bytes_received: int64 @go(BytesReceived) + + // Number of bytes sent + // Example: 10888579 + bytes_sent: int64 @go(BytesSent) + + // Number of packets received + // Example: 1748 + packets_received: int64 @go(PacketsReceived) + + // Number of packets sent + // Example: 964 + packets_sent: int64 @go(PacketsSent) + + // Number of errors received + // Example: 14 + errors_received: int64 @go(ErrorsReceived) + + // Number of errors sent + // Example: 41 + errors_sent: int64 @go(ErrorsSent) + + // Number of outbound packets dropped + // Example: 541 + packets_dropped_outbound: int64 @go(PacketsDroppedOutbound) + + // Number of inbound packets dropped + // Example: 179 + packets_dropped_inbound: int64 @go(PacketsDroppedInbound) +} + +// InstanceStateOSInfo represents the operating system information section of an instance's state. +// +// swagger:model +// +// API extension: instances_state_os_info. +#InstanceStateOSInfo: { + // Operating system running in the instance. + // Example: Debian GNU/Linux + os: string @go(OS) + + // Version of the operating system. + // Example: 12 (bookworm) + os_version: string @go(OSVersion) + + // Version of the kernel running in the instance. + // Example: 6.1.0-25-amd64 + kernel_version: string @go(KernelVersion) + + // Hostname of the instance. + // Example: myhost + hostname: string @go(Hostname) + + // FQDN of the instance. + // Example: myhost.mydomain.local + fqdn: string @go(FQDN) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/metadata_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/metadata_go_gen.cue new file mode 100644 index 0000000..5294ed0 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/metadata_go_gen.cue @@ -0,0 +1,83 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus/v7/shared/api + +package api + +// MetadataConfiguration represents a server's exposed configuration metadata +// +// swagger:model +// +// API extension: metadata_configuration. +#MetadataConfiguration: { + // Metadata about configuration keys. + // Example: {'configs': {'instance': {...}}} + configs: #MetadataConfig @go(Config) +} + +// MetadataConfig repreents metadata about configuration keys +// +// swagger:model +// +// API extension: metadata_configuration. +#MetadataConfig: {[string]: [string]: #MetadataConfigGroup} + +// MetadataConfigEntityName represents a main API object type +// Example: instance +// +// swagger:model +// +// API extension: metadata_configuration. +#MetadataConfigEntityName: string + +// MetadataConfigGroupName represents the name of a group of config keys +// Example: volatile +// +// swagger:model +// +// API extension: metadata_configuration. +#MetadataConfigGroupName: string + +// MetadataConfigGroup represents a group of config keys +// +// swagger:model +// +// API extension: metadata_configuration. +#MetadataConfigGroup: { + keys: [... {[string]: #MetadataConfigKey}] @go(Keys,[]map[string]MetadataConfigKey) +} + +// MetadataConfigKey describe a configuration key +// +// swagger:model +// +// API extension: metadata_configuration. +#MetadataConfigKey: { + // Condition specifies the condition that must be met for the option to be taken into account + // Example: container + condition?: string @go(Condition) + + // Scope defines if option apply to cluster or to the local server + // Example: global + scope?: string @go(Scope) + + // Type specifies the type of the option + // Example: string + type: string @go(Type) + + // DefaultDesc specify default value for configuration + // Example: "`DHCP on eth0`" + defaultdesc?: string @go(Default) + + // LiveUpdate specifies whether the server must be restarted for the option to be updated + // Example: "no" + liveupdate?: string @go(LiveUpdate) + + // ShortDesc provides short description for the configuration + // Example: "Kernel modules to load before starting the instance" + shortdesc: string @go(Description) + + // LongDesc provides long description for the option + // Example: "Specify the kernel modules as a comma-separated list." + longdesc: string @go(LongDescription) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/migration_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/migration_go_gen.cue new file mode 100644 index 0000000..6481dc4 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/migration_go_gen.cue @@ -0,0 +1,11 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus/v7/shared/api + +package api + +#SecretNameControl: "control" + +#SecretNameFilesystem: "fs" + +#SecretNameState: "criu" diff --git a/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/network_acl_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/network_acl_go_gen.cue new file mode 100644 index 0000000..fb312c6 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/network_acl_go_gen.cue @@ -0,0 +1,118 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus/v7/shared/api + +package api + +// NetworkACLRule represents a single rule in an ACL ruleset. +// Refer to doc/network-acls.md for details. +// +// swagger:model +// +// API extension: network_acl. +#NetworkACLRule: { + // Action to perform on rule match + // Example: allow + action: string @go(Action) + + // Source address + // Example: @internal + source?: string @go(Source) + + // Destination address + // Example: 8.8.8.8/32,8.8.4.4/32 + destination?: string @go(Destination) + + // Protocol + // Example: udp + protocol?: string @go(Protocol) + + // Source port + // Example: 1234 + source_port?: string @go(SourcePort) + + // Destination port + // Example: 53 + destination_port?: string @go(DestinationPort) + + // Type of ICMP message (for ICMP protocol) + // Example: 8 + icmp_type?: string @go(ICMPType) + + // ICMP message code (for ICMP protocol) + // Example: 0 + icmp_code?: string @go(ICMPCode) + + // Description of the rule + // Example: Allow DNS queries to Google DNS + description?: string @go(Description) + + // State of the rule + // Example: enabled + state: string @go(State) +} + +// NetworkACLPost used for renaming an ACL. +// +// swagger:model +// +// API extension: network_acl. +#NetworkACLPost: { + // The new name for the ACL + // Example: bar + name: string @go(Name) +} + +// NetworkACLPut used for updating an ACL. +// +// swagger:model +// +// API extension: network_acl. +#NetworkACLPut: { + // Description of the ACL + // Example: Web servers + description: string @go(Description) + + // List of egress rules (order independent) + egress: [...#NetworkACLRule] @go(Egress,[]NetworkACLRule) + + // List of ingress rules (order independent) + ingress: [...#NetworkACLRule] @go(Ingress,[]NetworkACLRule) + + // ACL configuration map (refer to doc/network-acls.md) + // Example: {"user.mykey": "foo"} + config: #ConfigMap @go(Config) +} + +// NetworkACL used for displaying an ACL. +// +// swagger:model +// +// API extension: network_acl. +#NetworkACL: { + #NetworkACLPost + + #NetworkACLPut + + // List of URLs of objects using this profile + // Read only: true + // Example: ["/1.0/instances/c1", "/1.0/instances/v1", "/1.0/networks/mybr0"] + used_by: [...string] @go(UsedBy,[]string) + + // Project name + // Example: project1 + // + // API extension: network_acls_all_projects + project: string @go(Project) +} + +// NetworkACLsPost used for creating an ACL. +// +// swagger:model +// +// API extension: network_acl. +#NetworkACLsPost: { + #NetworkACLPost + + #NetworkACLPut +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/network_address_set_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/network_address_set_go_gen.cue new file mode 100644 index 0000000..2e9698b --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/network_address_set_go_gen.cue @@ -0,0 +1,67 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus/v7/shared/api + +package api + +// NetworkAddressSetPost used for renaming an address set. +// +// swagger:model +// +// API extension: network_address_set. +#NetworkAddressSetPost: { + // The new name of the address set + // Example: "bar" + name: string @go(Name) +} + +// NetworkAddressSetPut used for updating an address set. +// +// swagger:model +// +// API extension: network_address_set. +#NetworkAddressSetPut: { + // List of addresses in the set + // Example: ["192.0.0.1", "2001:0db8:1234::1"] + addresses: [...string] @go(Addresses,[]string) + + // Address set configuration map (refer to doc/network-address-sets.md) + // Example: {"user.mykey": "foo"} + config?: #ConfigMap @go(Config) + + // Description of the address set + // Example: Web servers + description: string @go(Description) +} + +// NetworkAddressSetsPost used for creating a new address set. +// +// swagger:model +// +// API extension: network_address_set. +#NetworkAddressSetsPost: { + #NetworkAddressSetPut + + #NetworkAddressSetPost +} + +// NetworkAddressSet represents an address set. +// Refer to doc/howto/network_address_sets.md for details. +// +// swagger:model +// +// API extension: network_address_set. +#NetworkAddressSet: { + #NetworkAddressSetPut + + #NetworkAddressSetPost + + // List of URLs of objects using this profile + // Read only: true + // Example: ["/1.0/network-acls/foo", "/1.0/network-acls/bar", "/1.0/network-acls/baz"] + used_by: [...string] @go(UsedBy,[]string) + + // Project name + // Example: project1 + project: string @go(Project) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/network_allocation_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/network_allocation_go_gen.cue new file mode 100644 index 0000000..c66f49e --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/network_allocation_go_gen.cue @@ -0,0 +1,29 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus/v7/shared/api + +package api + +// NetworkAllocations used for displaying network addresses used by a consuming entity +// e.g, instance, network forward, load-balancer, network... +// +// swagger:model +// +// API extension: network_allocations. +#NetworkAllocations: { + // The network address of the allocation (in CIDR format) + // Example: 192.0.2.1/24 + addresses: string @go(Address) + + // Hwaddr is the MAC address of the entity consuming the network address + hwaddr: string @go(Hwaddr) + + // Whether the entity comes from a network that performs egress source NAT + nat: bool @go(NAT) + + // Type of the entity consuming the network address + type: string @go(Type) + + // Name of the entity consuming the network address + used_by: string @go(UsedBy) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/network_forward_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/network_forward_go_gen.cue new file mode 100644 index 0000000..5bcfb42 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/network_forward_go_gen.cue @@ -0,0 +1,86 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus/v7/shared/api + +package api + +// NetworkForwardPort represents a port specification in a network address forward +// +// swagger:model +// +// API extension: network_forward. +#NetworkForwardPort: { + // Description of the forward port + // Example: My web server forward + description: string @go(Description) + + // Protocol for port forward (either tcp or udp) + // Example: tcp + protocol: string @go(Protocol) + + // ListenPort(s) to forward (comma delimited ranges) + // Example: 80,81,8080-8090 + listen_port: string @go(ListenPort) + + // TargetPort(s) to forward ListenPorts to (allows for many-to-one) + // Example: 80,81,8080-8090 + target_port: string @go(TargetPort) + + // TargetAddress to forward ListenPorts to + // Example: 198.51.100.2 + target_address: string @go(TargetAddress) + + // SNAT controls whether to apply a matching SNAT rule to new outgoing traffic from the target + // Example: false + // + // API extension: network_forward_snat + snat: bool @go(SNAT) +} + +// NetworkForwardsPost represents the fields of a new network address forward +// +// swagger:model +// +// API extension: network_forward. +#NetworkForwardsPost: { + #NetworkForwardPut + + // The listen address of the forward + // Example: 192.0.2.1 + listen_address: string @go(ListenAddress) +} + +// NetworkForwardPut represents the modifiable fields of a network address forward +// +// swagger:model +// +// API extension: network_forward. +#NetworkForwardPut: { + // Description of the forward listen IP + // Example: My public IP forward + description: string @go(Description) + + // Forward configuration map (refer to doc/network-forwards.md) + // Example: {"user.mykey": "foo"} + config: #ConfigMap @go(Config) + + // Port forwards (optional) + ports: [...#NetworkForwardPort] @go(Ports,[]NetworkForwardPort) +} + +// NetworkForward used for displaying an network address forward. +// +// swagger:model +// +// API extension: network_forward. +#NetworkForward: { + #NetworkForwardPut + + // The listen address of the forward + // Example: 192.0.2.1 + listen_address: string @go(ListenAddress) + + // What cluster member this record was found on + // Example: server01 + location: string @go(Location) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/network_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/network_go_gen.cue new file mode 100644 index 0000000..0755b9c --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/network_go_gen.cue @@ -0,0 +1,343 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus/v7/shared/api + +package api + +// NetworksPost represents the fields of a new network +// +// swagger:model +// +// API extension: network. +#NetworksPost: { + #NetworkPut + + // The name of the new network + // Example: mybr1 + name: string @go(Name) + + // The network type (refer to doc/networks.md) + // Example: bridge + type: string @go(Type) +} + +// NetworkPost represents the fields required to rename a network +// +// swagger:model +// +// API extension: network. +#NetworkPost: { + // The new name for the network + // Example: mybr1 + name: string @go(Name) +} + +// NetworkPut represents the modifiable fields of a network +// +// swagger:model +// +// API extension: network. +#NetworkPut: { + // Network configuration map (refer to doc/networks.md) + // Example: {"ipv4.address": "10.0.0.1/24", "ipv4.nat": "true", "ipv6.address": "none"} + config: #ConfigMap @go(Config) + + // Description of the profile + // Example: My new bridge + // + // API extension: entity_description + description: string @go(Description) +} + +#NetworkStatusPending: "Pending" + +#NetworkStatusCreated: "Created" + +#NetworkStatusErrored: "Errored" + +#NetworkStatusUnknown: "Unknown" + +#NetworkStatusUnavailable: "Unavailable" + +// Network represents a network +// +// swagger:model +#Network: { + #NetworkPut + + // The network name + // Read only: true + // Example: mybr0 + name: string @go(Name) + + // The network type + // Read only: true + // Example: bridge + type: string @go(Type) + + // List of URLs of objects using this profile + // Read only: true + // Example: ["/1.0/profiles/default", "/1.0/instances/c1"] + used_by: [...string] @go(UsedBy,[]string) + + // Whether this is a managed network + // Read only: true + // Example: true + // + // API extension: network + managed: bool @go(Managed) + + // The state of the network (for managed network in clusters) + // Read only: true + // Example: Created + // + // API extension: clustering + status: string @go(Status) + + // Cluster members on which the network has been defined + // Read only: true + // Example: ["server01", "server02", "server03"] + // + // API extension: clustering + locations: [...string] @go(Locations,[]string) + + // Project name + // Example: project1 + // + // API extension: networks_all_projects + project: string @go(Project) +} + +// NetworkLease represents a DHCP lease +// +// swagger:model +// +// API extension: network_leases. +#NetworkLease: { + // The hostname associated with the record + // Example: c1 + hostname: string @go(Hostname) + + // The MAC address + // Example: 10:66:6a:2c:89:d9 + hwaddr: string @go(Hwaddr) + + // The IP address + // Example: 10.0.0.98 + address: string @go(Address) + + // The type of record (static or dynamic) + // Example: dynamic + type: string @go(Type) + + // What cluster member this record was found on + // Example: server01 + // + // API extension: network_leases_location + location: string @go(Location) +} + +// NetworkState represents the network state +// +// swagger:model +#NetworkState: { + // List of addresses + addresses: [...#NetworkStateAddress] @go(Addresses,[]NetworkStateAddress) + + // Interface counters + counters?: null | #NetworkStateCounters @go(Counters,*NetworkStateCounters) + + // MAC address + // Example: 10:66:6a:5a:83:57 + hwaddr: string @go(Hwaddr) + + // MTU + // Example: 1500 + mtu: int @go(Mtu) + + // Link state + // Example: up + state: string @go(State) + + // Interface type + // Example: broadcast + type: string @go(Type) + + // Additional bond interface information + // + // API extension: network_state_bond_bridge + bond?: null | #NetworkStateBond @go(Bond,*NetworkStateBond) + + // Additional bridge interface information + // + // API extension: network_state_bond_bridge + bridge?: null | #NetworkStateBridge @go(Bridge,*NetworkStateBridge) + + // Additional vlan interface information + // + // API extension: network_state_vlan + vlan?: null | #NetworkStateVLAN @go(VLAN,*NetworkStateVLAN) + + // Additional OVN network information + // + // API extension: network_state_ovn + ovn?: null | #NetworkStateOVN @go(OVN,*NetworkStateOVN) +} + +// NetworkStateAddress represents a network address +// +// swagger:model +#NetworkStateAddress: { + // Address family + // Example: inet + family: string @go(Family) + + // IP address + // Example: 10.0.0.1 + address: string @go(Address) + + // IP netmask (CIDR) + // Example: 24 + netmask: string @go(Netmask) + + // Address scope + // Example: global + scope: string @go(Scope) +} + +// NetworkStateCounters represents packet counters +// +// swagger:model +#NetworkStateCounters: { + // Number of bytes received + // Example: 250542118 + bytes_received: int64 @go(BytesReceived) + + // Number of bytes sent + // Example: 17524040140 + bytes_sent: int64 @go(BytesSent) + + // Number of packets received + // Example: 1182515 + packets_received: int64 @go(PacketsReceived) + + // Number of packets sent + // Example: 1567934 + packets_sent: int64 @go(PacketsSent) +} + +// NetworkStateBond represents bond specific state +// +// swagger:model +// +// API extension: network_state_bond_bridge. +#NetworkStateBond: { + // Bonding mode + // Example: 802.3ad + mode: string @go(Mode) + + // Transmit balancing policy + // Example: layer3+4 + transmit_policy: string @go(TransmitPolicy) + + // Delay on link up (ms) + // Example: 0 + up_delay: uint64 @go(UpDelay) + + // Delay on link down (ms) + // Example: 0 + down_delay: uint64 @go(DownDelay) + + // How often to check for link state (ms) + // Example: 100 + mii_frequency: uint64 @go(MIIFrequency) + + // Bond link state + // Example: up + mii_state: string @go(MIIState) + + // List of devices that are part of the bond + // Example: ["eth0", "eth1"] + lower_devices: [...string] @go(LowerDevices,[]string) +} + +// NetworkStateBridge represents bridge specific state +// +// swagger:model +// +// API extension: network_state_bond_bridge. +#NetworkStateBridge: { + // Bridge ID + // Example: 8000.0a0f7c6edbd9 + id: string @go(ID) + + // Whether STP is enabled + // Example: false + stp: bool @go(STP) + + // Delay on port join (ms) + // Example: 1500 + forward_delay: uint64 @go(ForwardDelay) + + // Default VLAN ID + // Example: 1 + vlan_default: uint64 @go(VLANDefault) + + // Whether VLAN filtering is enabled + // Example: false + vlan_filtering: bool @go(VLANFiltering) + + // List of devices that are in the bridge + // Example: ["eth0", "eth1"] + upper_devices: [...string] @go(UpperDevices,[]string) +} + +// NetworkStateVLAN represents VLAN specific state +// +// swagger:model +// +// API extension: network_state_vlan. +#NetworkStateVLAN: { + // Parent device + // Example: eth0 + lower_device: string @go(LowerDevice) + + // VLAN ID + // Example: 100 + vid: uint64 @go(VID) +} + +// NetworkStateOVN represents OVN specific state +// +// swagger:model +// +// API extension: network_state_ovn. +#NetworkStateOVN: { + // OVN network chassis name + // Example: server01 + chassis: string @go(Chassis) + + // OVN logical router name + // Example: incus-net1-lr + // + // API extension: network_state_ovn_lr + logical_router: string @go(LogicalRouter) + + // OVN logical switch name + // Example: incus-net1-ls-int + // + // API extension: network_state_ovn_ls + logical_switch: string @go(LogicalSwitch) + + // OVN network uplink ipv4 address + // Example: 10.0.0.1 + // + // API extension: network_ovn_state_addresses + uplink_ipv4: string @go(UplinkIPv4) + + // OVN network uplink ipv6 address + // Example: 2001:0000:130F:0000:0000:09C0:876A:130B. + // + // API extension: network_ovn_state_addresses + uplink_ipv6: string @go(UplinkIPv6) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/network_integration_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/network_integration_go_gen.cue new file mode 100644 index 0000000..d166f6e --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/network_integration_go_gen.cue @@ -0,0 +1,70 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus/v7/shared/api + +package api + +// NetworkIntegrationsPost represents the fields of a new network integration +// +// swagger:model +// +// API extension: network_integrations. +#NetworkIntegrationsPost: { + #NetworkIntegrationPut + + // The name of the integration + // Example: region1 + name: string @go(Name) + + // The type of integration + // Example: ovn + type: string @go(Type) +} + +// NetworkIntegrationPut represents the modifiable fields of a network integration +// +// swagger:model +// +// API extension: network_integrations. +#NetworkIntegrationPut: { + // Description of the network integration + // Example: OVN interconnection for region1 + description: string @go(Description) + + // Integration configuration map (refer to doc/network-integrations.md) + // Example: {"user.mykey": "foo"} + config: #ConfigMap @go(Config) +} + +// NetworkIntegration represents a network integration. +// +// swagger:model +// +// API extension: network_integrations. +#NetworkIntegration: { + #NetworkIntegrationPut + + // The name of the integration + // Example: region1 + name: string @go(Name) + + // The type of integration + // Example: ovn + type: string @go(Type) + + // List of URLs of objects using this network integration + // Read only: true + // Example: ["/1.0/networks/foo", "/1.0/networks/bar"] + used_by: [...string] @go(UsedBy,[]string) +} + +// NetworkIntegrationPost represents the fields required to rename a network integration +// +// swagger:model +// +// API extension: network_integrations. +#NetworkIntegrationPost: { + // The new name for the network integration + // Example: region2 + name: string @go(Name) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/network_load_balancer_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/network_load_balancer_go_gen.cue new file mode 100644 index 0000000..56978c5 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/network_load_balancer_go_gen.cue @@ -0,0 +1,132 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus/v7/shared/api + +package api + +// NetworkLoadBalancerBackend represents a target backend specification in a network load balancer +// +// swagger:model +// +// API extension: network_load_balancer. +#NetworkLoadBalancerBackend: { + // Name of the load balancer backend + // Example: c1-http + name: string @go(Name) + + // Description of the load balancer backend + // Example: C1 webserver + description: string @go(Description) + + // TargetPort(s) to forward ListenPorts to (allows for many-to-one) + // Example: 80,81,8080-8090 + target_port: string @go(TargetPort) + + // TargetAddress to forward ListenPorts to + // Example: 198.51.100.2 + target_address: string @go(TargetAddress) +} + +// NetworkLoadBalancerPort represents a port specification in a network load balancer +// +// swagger:model +// +// API extension: network_load_balancer. +#NetworkLoadBalancerPort: { + // Description of the load balancer port + // Example: My web server load balancer + description: string @go(Description) + + // Protocol for load balancer port (either tcp or udp) + // Example: tcp + protocol: string @go(Protocol) + + // ListenPort(s) of load balancer (comma delimited ranges) + // Example: 80,81,8080-8090 + listen_port: string @go(ListenPort) + + // TargetBackend backend names to load balance ListenPorts to + // Example: ["c1-http","c2-http"] + target_backend: [...string] @go(TargetBackend,[]string) +} + +// NetworkLoadBalancersPost represents the fields of a new network load balancer +// +// swagger:model +// +// API extension: network_load_balancer. +#NetworkLoadBalancersPost: { + #NetworkLoadBalancerPut + + // The listen address of the load balancer + // Example: 192.0.2.1 + listen_address: string @go(ListenAddress) +} + +// NetworkLoadBalancerPut represents the modifiable fields of a network load balancer +// +// swagger:model +// +// API extension: network_load_balancer. +#NetworkLoadBalancerPut: { + // Description of the load balancer listen IP + // Example: My public IP load balancer + description: string @go(Description) + + // Load balancer configuration map (refer to doc/network-load-balancers.md) + // Example: {"user.mykey": "foo"} + config: #ConfigMap @go(Config) + + // Backends (optional) + backends: [...#NetworkLoadBalancerBackend] @go(Backends,[]NetworkLoadBalancerBackend) + + // Port forwards (optional) + ports: [...#NetworkLoadBalancerPort] @go(Ports,[]NetworkLoadBalancerPort) +} + +// NetworkLoadBalancer used for displaying a network load balancer +// +// swagger:model +// +// API extension: network_load_balancer. +#NetworkLoadBalancer: { + #NetworkLoadBalancerPut + + // The listen address of the load balancer + // Example: 192.0.2.1 + listen_address: string @go(ListenAddress) + + // What cluster member this record was found on + // Example: server01 + location: string @go(Location) +} + +// NetworkLoadBalancerState is used for showing current state of a load balancer +// +// swagger:model +// +// API extension: network_load_balancer_state. +#NetworkLoadBalancerState: { + backend_health: {[string]: #NetworkLoadBalancerStateBackendHealth} @go(BackendHealth,map[string]NetworkLoadBalancerStateBackendHealth) +} + +// NetworkLoadBalancerStateBackendHealth represents the health of a particular load-balancer backend +// +// swagger:model +// +// API extension: network_load_balancer_state. +#NetworkLoadBalancerStateBackendHealth: { + address: string @go(Address) + ports: [...#NetworkLoadBalancerStateBackendHealthPort] @go(Ports,[]NetworkLoadBalancerStateBackendHealthPort) +} + +// NetworkLoadBalancerStateBackendHealthPort represents the health status of a particular load-balancer backend port. +// +// swagger:model +// +// API extension: network_load_balancer_state. +#NetworkLoadBalancerStateBackendHealthPort: { + protocol: string @go(Protocol) + port: int @go(Port) + status: string @go(Status) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/network_peer_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/network_peer_go_gen.cue new file mode 100644 index 0000000..6ba3fa6 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/network_peer_go_gen.cue @@ -0,0 +1,99 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus/v7/shared/api + +package api + +// NetworkPeersPost represents the fields of a new network peering +// +// swagger:model +// +// API extension: network_peer. +#NetworkPeersPost: { + #NetworkPeerPut + + // Name of the peer + // Example: project1-network1 + name: string @go(Name) + + // Name of the target project + // Example: project1 + target_project?: string @go(TargetProject) + + // Name of the target network + // Example: network1 + target_network?: string @go(TargetNetwork) + + // Type of peer + // Example: local + // + // API extension: network_integrations. + type: string @go(Type) + + // Name of the target integration + // Example: ovn-ic1 + // + // API extension: network_integrations. + target_integration?: string @go(TargetIntegration) +} + +// NetworkPeerPut represents the modifiable fields of a network peering +// +// swagger:model +// +// API extension: network_peer. +#NetworkPeerPut: { + // Description of the peer + // Example: Peering with network1 in project1 + description: string @go(Description) + + // Peer configuration map (refer to doc/network-peers.md) + // Example: {"user.mykey": "foo"} + config: #ConfigMap @go(Config) +} + +// NetworkPeer used for displaying a network peering. +// +// swagger:model +// +// API extension: network_forward. +#NetworkPeer: { + #NetworkPeerPut + + // Name of the peer + // Read only: true + // Example: project1-network1 + name: string @go(Name) + + // Name of the target project + // Read only: true + // Example: project1 + target_project?: string @go(TargetProject) + + // Name of the target network + // Read only: true + // Example: network1 + target_network?: string @go(TargetNetwork) + + // The state of the peering + // Read only: true + // Example: Pending + status: string @go(Status) + + // List of URLs of objects using this network peering + // Read only: true + // Example: ["/1.0/network-acls/test", "/1.0/network-acls/foo"] + used_by: [...string] @go(UsedBy,[]string) + + // Type of peer + // Example: local + // + // API extension: network_integrations. + type: string @go(Type) + + // Name of the target integration + // Example: ovn-ic1 + // + // API extension: network_integrations. + target_integration?: string @go(TargetIntegration) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/network_zone_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/network_zone_go_gen.cue new file mode 100644 index 0000000..f63216b --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/network_zone_go_gen.cue @@ -0,0 +1,120 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus/v7/shared/api + +package api + +// NetworkZonesPost represents the fields of a new network zone +// +// swagger:model +// +// API extension: network_dns. +#NetworkZonesPost: { + #NetworkZonePut + + // The name of the zone (DNS domain name) + // Example: example.net + name: string @go(Name) +} + +// NetworkZonePut represents the modifiable fields of a network zone +// +// swagger:model +// +// API extension: network_dns. +#NetworkZonePut: { + // Description of the network zone + // Example: Internal domain + description: string @go(Description) + + // Zone configuration map (refer to doc/network-zones.md) + // Example: {"user.mykey": "foo"} + config: #ConfigMap @go(Config) +} + +// NetworkZone represents a network zone (DNS). +// +// swagger:model +// +// API extension: network_dns. +#NetworkZone: { + #NetworkZonePut + + // The name of the zone (DNS domain name) + // Example: example.net + name: string @go(Name) + + // List of URLs of objects using this network zone + // Read only: true + // Example: ["/1.0/networks/foo", "/1.0/networks/bar"] + used_by: [...string] @go(UsedBy,[]string) + + // Project name + // Example: project1 + // + // API extension: network_zones_all_projects + project: string @go(Project) +} + +// NetworkZoneRecordsPost represents the fields of a new network zone record +// +// swagger:model +// +// API extension: network_dns_records. +#NetworkZoneRecordsPost: { + #NetworkZoneRecordPut + + // The record name in the zone + // Example: @ + name: string @go(Name) +} + +// NetworkZoneRecordPut represents the modifiable fields of a network zone record +// +// swagger:model +// +// API extension: network_dns_records. +#NetworkZoneRecordPut: { + // Description of the record + // Example: SPF record + description: string @go(Description) + + // Entries in the record + entries: [...#NetworkZoneRecordEntry] @go(Entries,[]NetworkZoneRecordEntry) + + // Advanced configuration for the record + // Example: {"user.mykey": "foo"} + config: #ConfigMap @go(Config) +} + +// NetworkZoneRecordEntry represents the fields in a record entry +// +// swagger:model +// +// API extension: network_dns_records. +#NetworkZoneRecordEntry: { + // Type of DNS entry + // Example: TXT + type: string @go(Type) + + // TTL for the entry + // Example: 3600 + ttl?: uint64 @go(TTL) + + // Value for the record + // Example: v=spf1 mx ~all + value: string @go(Value) +} + +// NetworkZoneRecord represents a network zone (DNS) record. +// +// swagger:model +// +// API extension: network_dns_records. +#NetworkZoneRecord: { + #NetworkZoneRecordPut + + // The name of the record + // Example: @ + name: string @go(Name) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/operation_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/operation_go_gen.cue new file mode 100644 index 0000000..2d8e782 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/operation_go_gen.cue @@ -0,0 +1,68 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus/v7/shared/api + +package api + +import "time" + +#OperationClassTask: "task" + +#OperationClassWebsocket: "websocket" + +#OperationClassToken: "token" + +// Operation represents a background operation +// +// swagger:model +#Operation: { + // UUID of the operation + // Example: 6916c8a6-9b7d-4abd-90b3-aedfec7ec7da + id: string @go(ID) + + // Type of operation (task, token or websocket) + // Example: websocket + class: string @go(Class) + + // Description of the operation + // Example: Executing command + description: string @go(Description) + + // Operation creation time + // Example: 2021-03-23T17:38:37.753398689-04:00 + created_at: time.Time @go(CreatedAt) + + // Operation last change + // Example: 2021-03-23T17:38:37.753398689-04:00 + updated_at: time.Time @go(UpdatedAt) + + // Status name + // Example: Running + status: string @go(Status) + + // Status code + // Example: 103 + status_code: #StatusCode @go(StatusCode) + + // Affected resources + // Example: {"instances": ["/1.0/instances/foo"]} + resources: {[string]: [...string]} @go(Resources,map[string][]string) + + // Operation specific metadata + // Example: {"command": ["bash"], "environment": {"HOME": "/root", "LANG": "C.UTF-8", "PATH": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "TERM": "xterm", "USER": "root"}, "fds": {"0": "da3046cf02c0116febf4ef3fe4eaecdf308e720c05e5a9c730ce1a6f15417f66", "1": "05896879d8692607bd6e4a09475667da3b5f6714418ab0ee0e5720b4c57f754b"}, "interactive": true} + metadata: {...} @go(Metadata,map[string]any) + + // Whether the operation can be canceled + // Example: false + may_cancel: bool @go(MayCancel) + + // Operation error message + // Example: Some error message + err: string @go(Err) + + // What cluster member this record was found on + // Example: server01 + // + // API extension: operation_location + location: string @go(Location) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/profile_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/profile_go_gen.cue new file mode 100644 index 0000000..114e4e4 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/profile_go_gen.cue @@ -0,0 +1,67 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus/v7/shared/api + +package api + +// ProfilesPost represents the fields of a new profile +// +// swagger:model +#ProfilesPost: { + #ProfilePut + + // The name of the new profile + // Example: foo + name: string @go(Name) +} + +// ProfilePost represents the fields required to rename a profile +// +// swagger:model +#ProfilePost: { + // The new name for the profile + // Example: bar + name: string @go(Name) +} + +// ProfilePut represents the modifiable fields of a profile +// +// swagger:model +#ProfilePut: { + // Instance configuration map (refer to doc/instances.md) + // Example: {"limits.cpu": "4", "limits.memory": "4GiB"} + config: #ConfigMap @go(Config) + + // Description of the profile + // Example: Medium size instances + description: string @go(Description) + + // List of devices + // Example: {"root": {"type": "disk", "pool": "default", "path": "/"}, "eth0": {"type": "nic", "network": "mybr0", "name": "eth0"}} + devices: #DevicesMap @go(Devices) +} + +// Profile represents a profile +// +// swagger:model +#Profile: { + #ProfilePut + + // The profile name + // Read only: true + // Example: foo + name: string @go(Name) + + // List of URLs of objects using this profile + // Read only: true + // Example: ["/1.0/instances/c1", "/1.0/instances/v1"] + // + // API extension: profile_usedby + used_by: [...string] @go(UsedBy,[]string) + + // Project name + // Example: project1 + // + // API extension: profiles_all_projects + project: string @go(Project) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/project_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/project_go_gen.cue new file mode 100644 index 0000000..93bfec4 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/project_go_gen.cue @@ -0,0 +1,92 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus/v7/shared/api + +package api + +#ProjectDefaultName: "default" + +// ProjectsPost represents the fields of a new project +// +// swagger:model +// +// API extension: projects. +#ProjectsPost: { + #ProjectPut + + // The name of the new project + // Example: foo + name: string @go(Name) +} + +// ProjectPost represents the fields required to rename a project +// +// swagger:model +// +// API extension: projects. +#ProjectPost: { + // The new name for the project + // Example: bar + name: string @go(Name) +} + +// ProjectPut represents the modifiable fields of a project +// +// swagger:model +// +// API extension: projects. +#ProjectPut: { + // Project configuration map (refer to doc/projects.md) + // Example: {"features.profiles": "true", "features.networks": "false"} + config: #ConfigMap @go(Config) + + // Description of the project + // Example: My new project + description: string @go(Description) +} + +// Project represents a project +// +// swagger:model +// +// API extension: projects. +#Project: { + #ProjectPut + + // The project name + // Read only: true + // Example: foo + name: string @go(Name) + + // List of URLs of objects using this project + // Read only: true + // Example: ["/1.0/images/0e60015346f06627f10580d56ac7fffd9ea775f6d4f25987217d5eed94910a20", "/1.0/instances/c1", "/1.0/networks/mybr0", "/1.0/profiles/default", "/1.0/storage-pools/default/volumes/custom/blah"] + used_by: [...string] @go(UsedBy,[]string) +} + +// ProjectState represents the current running state of a project +// +// swagger:model +// +// API extension: project_usage. +#ProjectState: { + // Allocated and used resources + // Read only: true + // Example: {"containers": {"limit": 10, "usage": 4}, "cpu": {"limit": 20, "usage": 16}} + resources: {[string]: #ProjectStateResource} @go(Resources,map[string]ProjectStateResource) +} + +// ProjectStateResource represents the state of a particular resource in a project +// +// swagger:model +// +// API extension: project_usage. +#ProjectStateResource: { + // Limit for the resource (-1 if none) + // Example: 10 + Limit: int64 + + // Current usage for the resource + // Example: 4 + Usage: int64 +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/resource_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/resource_go_gen.cue new file mode 100644 index 0000000..4917e04 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/resource_go_gen.cue @@ -0,0 +1,1209 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus/v7/shared/api + +package api + +// Resources represents the system hardware resources +// +// swagger:model +// +// API extension: resources. +#Resources: { + // CPU information + cpu: #ResourcesCPU @go(CPU) + + // Memory information + memory: #ResourcesMemory @go(Memory) + + // GPU devices + // + // API extension: resources_gpu + gpu: #ResourcesGPU @go(GPU) + + // Network devices + // + // API extension: resources_v2 + network: #ResourcesNetwork @go(Network) + + // Storage devices + // + // API extension: resources_v2 + storage: #ResourcesStorage @go(Storage) + + // USB devices + // + // API extension: resources_usb_pci + usb: #ResourcesUSB @go(USB) + + // PCI devices + // + // API extension: resources_usb_pci + pci: #ResourcesPCI @go(PCI) + + // System information + // + // API extension: resources_system + system: #ResourcesSystem @go(System) + + // Load average information + // + // API extension: resources_load + load: #ResourcesLoad @go(Load) + + // Serial devices + // + // API extension: resources_serial + serial: #ResourcesSerial @go(Serial) +} + +// ResourcesCPU represents the cpu resources available on the system +// +// swagger:model +// +// API extension: resources. +#ResourcesCPU: { + // Architecture name + // Example: x86_64 + // + // API extension: resources_v2 + architecture: string @go(Architecture) + + // List of CPU sockets + sockets: [...#ResourcesCPUSocket] @go(Sockets,[]ResourcesCPUSocket) + + // Total number of CPU threads (from all sockets and cores) + // Example: 1 + total: uint64 @go(Total) +} + +// ResourcesCPUSocket represents a CPU socket on the system +// +// swagger:model +// +// API extension: resources_v2. +#ResourcesCPUSocket: { + // Product name + // Example: Intel(R) Core(TM) i5-7300U CPU @ 2.60GHz + name?: string @go(Name) + + // Vendor name + // Example: GenuineIntel + vendor?: string @go(Vendor) + + // Socket number + // Example: 0 + socket: uint64 @go(Socket) + + // List of CPU caches + cache?: [...#ResourcesCPUCache] @go(Cache,[]ResourcesCPUCache) + + // List of CPU cores + cores: [...#ResourcesCPUCore] @go(Cores,[]ResourcesCPUCore) + + // Current CPU frequency (Mhz) + // Example: 3499 + frequency?: uint64 @go(Frequency) + + // Minimum CPU frequency (Mhz) + // Example: 400 + frequency_minimum?: uint64 @go(FrequencyMinimum) + + // Maximum CPU frequency (Mhz) + // Example: 3500 + frequency_turbo?: uint64 @go(FrequencyTurbo) + + // Address sizes + // + // API extension: resources_cpu_address_sizes. + address_sizes?: null | #ResourcesCPUAddressSizes @go(AddressSizes,*ResourcesCPUAddressSizes) +} + +// ResourcesCPUAddressSizes resprents address size information for a CPU socket. +// +// swagger:model +// +// API extension: resources_cpu_address_sizes. +#ResourcesCPUAddressSizes: { + physical_bits: uint64 @go(PhysicalBits) + virtual_bits: uint64 @go(VirtualBits) +} + +// ResourcesCPUCache represents a CPU cache +// +// swagger:model +// +// API extension: resources_v2. +#ResourcesCPUCache: { + // Cache level (usually a number from 1 to 3) + // Example: 1 + level: uint64 @go(Level) + + // Type of cache (Data, Instruction, Unified, ...) + // Example: Data + type: string @go(Type) + + // Size of the cache (in bytes) + // Example: 32768 + size: uint64 @go(Size) +} + +// ResourcesCPUCore represents a CPU core on the system +// +// swagger:model +// +// API extension: resources_v2. +#ResourcesCPUCore: { + // Core identifier within the socket + // Example: 0 + core: uint64 @go(Core) + + // What die the CPU is a part of (for chiplet designs) + // Example: 0 + // + // API extension: resources_cpu_core_die + die: uint64 @go(Die) + + // List of threads + threads: [...#ResourcesCPUThread] @go(Threads,[]ResourcesCPUThread) + + // Current frequency + // Example: 3500 + frequency?: uint64 @go(Frequency) + + // List of CPU flags + // Example: [] + // + // API extension: resources_cpu_flags + flags: [...string] @go(Flags,[]string) +} + +// ResourcesCPUThread represents a CPU thread on the system +// +// swagger:model +// +// API extension: resources_v2. +#ResourcesCPUThread: { + // Thread ID (used for CPU pinning) + // Example: 0 + id: int64 @go(ID) + + // NUMA node the thread is a part of + // Example: 0 + numa_node: uint64 @go(NUMANode) + + // Thread identifier within the core + // Example: 0 + thread: uint64 @go(Thread) + + // Whether the thread is online (enabled) + // Example: true + online: bool @go(Online) + + // Whether the thread has been isolated (outside of normal scheduling) + // Example: false + // + // API extension: resource_cpu_isolated + isolated: bool @go(Isolated) +} + +// ResourcesGPU represents the GPU resources available on the system +// +// swagger:model +// +// API extension: resources_gpu. +#ResourcesGPU: { + // List of GPUs + cards: [...#ResourcesGPUCard] @go(Cards,[]ResourcesGPUCard) + + // Total number of GPUs + // Example: 1 + total: uint64 @go(Total) +} + +// ResourcesGPUCard represents a GPU card on the system +// +// swagger:model +// +// API extension: resources_v2. +#ResourcesGPUCard: { + // Kernel driver currently associated with the GPU + // Example: i915 + driver?: string @go(Driver) + + // Version of the kernel driver + // Example: 5.8.0-36-generic + driver_version?: string @go(DriverVersion) + + // DRM information (if card is in used by the host) + drm?: null | #ResourcesGPUCardDRM @go(DRM,*ResourcesGPUCardDRM) + + // SRIOV information (when supported by the card) + sriov?: null | #ResourcesGPUCardSRIOV @go(SRIOV,*ResourcesGPUCardSRIOV) + + // NVIDIA specific information + nvidia?: null | #ResourcesGPUCardNvidia @go(Nvidia,*ResourcesGPUCardNvidia) + + // Map of available mediated device profiles + // Example: null + // + // API extension: resources_gpu_mdev + mdev?: {[string]: #ResourcesGPUCardMdev} @go(Mdev,map[string]ResourcesGPUCardMdev) + + // NUMA node the GPU is a part of + // Example: 0 + numa_node: uint64 @go(NUMANode) + + // PCI address + // Example: 0000:00:02.0 + pci_address?: string @go(PCIAddress) + + // Name of the vendor + // Example: Intel Corporation + vendor?: string @go(Vendor) + + // PCI ID of the vendor + // Example: 8086 + vendor_id?: string @go(VendorID) + + // Name of the product + // Example: HD Graphics 620 + product?: string @go(Product) + + // PCI ID of the product + // Example: 5916 + product_id?: string @go(ProductID) + + // USB address (for USB cards) + // Example: 2:7 + // + // API extension: resources_gpu_usb + usb_address?: string @go(USBAddress) +} + +// ResourcesGPUCardDRM represents the Linux DRM configuration of the GPU +// +// swagger:model +// +// API extension: resources_v2. +#ResourcesGPUCardDRM: { + // DRM card ID + // Example: 0 + id: uint64 @go(ID) + + // Card device name + // Example: card0 + card_name: string @go(CardName) + + // Card device number + // Example: 226:0 + card_device: string @go(CardDevice) + + // Control device name + // Example: controlD64 + control_name?: string @go(ControlName) + + // Control device number + // Example: 226:0 + control_device?: string @go(ControlDevice) + + // Render device name + // Example: renderD128 + render_name?: string @go(RenderName) + + // Render device number + // Example: 226:128 + render_device?: string @go(RenderDevice) +} + +// ResourcesGPUCardSRIOV represents the SRIOV configuration of the GPU +// +// swagger:model +// +// API extension: resources_v2. +#ResourcesGPUCardSRIOV: { + // Number of VFs currently configured + // Example: 0 + current_vfs: uint64 @go(CurrentVFs) + + // Maximum number of supported VFs + // Example: 0 + maximum_vfs: uint64 @go(MaximumVFs) + + // List of VFs (as additional GPU devices) + // Example: null + vfs: [...#ResourcesGPUCard] @go(VFs,[]ResourcesGPUCard) +} + +// ResourcesGPUCardNvidia represents additional information for NVIDIA GPUs +// +// swagger:model +// +// API extension: resources_gpu. +#ResourcesGPUCardNvidia: { + // Version of the CUDA API + // Example: 11.0 + cuda_version?: string @go(CUDAVersion) + + // Version of the NVRM (usually driver version) + // Example: 450.102.04 + nvrm_version?: string @go(NVRMVersion) + + // Brand name + // Example: GeForce + brand: string @go(Brand) + + // Model name + // Example: GeForce GT 730 + model: string @go(Model) + + // GPU UUID + // Example: GPU-6ddadebd-dafe-2db9-f10f-125719770fd3 + uuid?: string @go(UUID) + + // Architecture (generation) + // Example: 3.5 + architecture?: string @go(Architecture) + + // Card device name + // Example: nvidia0 + // + // API extension: resources_v2 + card_name: string @go(CardName) + + // Card device number + // Example: 195:0 + // + // API extension: resources_v2 + card_device: string @go(CardDevice) +} + +// ResourcesGPUCardMdev represents the mediated devices configuration of the GPU +// +// swagger:model +// +// API extension: resources_gpu_mdev. +#ResourcesGPUCardMdev: { + // The mechanism used by this device + // Example: vfio-pci + api: string @go(API) + + // Number of available devices of this profile + // Example: 2 + available: uint64 @go(Available) + + // Profile name + // Example: i915-GVTg_V5_8 + name?: string @go(Name) + + // Profile description + // Example: low_gm_size: 128MB\nhigh_gm_size: 512MB\nfence: 4\nresolution: 1920x1200\nweight: 4 + description?: string @go(Description) + + // List of active devices (UUIDs) + // Example: ["42200aac-0977-495c-8c9e-6c51b9092a01", "b4950c00-1437-41d9-88f6-28d61cf9b9ef"] + devices: [...string] @go(Devices,[]string) +} + +// ResourcesNetwork represents the network cards available on the system +// +// swagger:model +// +// API extension: resources_v2. +#ResourcesNetwork: { + // List of network cards + cards: [...#ResourcesNetworkCard] @go(Cards,[]ResourcesNetworkCard) + + // Total number of network cards + // Example: 1 + total: uint64 @go(Total) +} + +// ResourcesNetworkCard represents a network card on the system +// +// swagger:model +// +// API extension: resources_v2. +#ResourcesNetworkCard: { + // Kernel driver currently associated with the card + // Example: atlantic + driver?: string @go(Driver) + + // Version of the kernel driver + // Example: 5.8.0-36-generic + driver_version?: string @go(DriverVersion) + + // List of ports on the card + ports?: [...#ResourcesNetworkCardPort] @go(Ports,[]ResourcesNetworkCardPort) + + // SRIOV information (when supported by the card) + sriov?: null | #ResourcesNetworkCardSRIOV @go(SRIOV,*ResourcesNetworkCardSRIOV) + + // vDPA information (when supported by the card) + // + // API extension: ovn_nic_acceleration_vdpa + vdpa?: null | #ResourcesNetworkCardVDPA @go(VDPA,*ResourcesNetworkCardVDPA) + + // NUMA node the card is a part of + // Example: 0 + numa_node: uint64 @go(NUMANode) + + // PCI address (for PCI cards) + // Example: 0000:0d:00.0 + pci_address?: string @go(PCIAddress) + + // Name of the vendor + // Example: Aquantia Corp. + vendor?: string @go(Vendor) + + // PCI ID of the vendor + // Example: 1d6a + vendor_id?: string @go(VendorID) + + // Name of the product + // Example: AQC107 NBase-T/IEEE + product?: string @go(Product) + + // PCI ID of the product + // Example: 87b1 + product_id?: string @go(ProductID) + + // Current firmware version + // Example: 3.1.100 + // + // API extension: resources_network_firmware + firmware_version?: string @go(FirmwareVersion) + + // USB address (for USB cards) + // Example: 2:7 + // + // API extension: resources_network_usb + usb_address?: string @go(USBAddress) +} + +// ResourcesNetworkCardPort represents a network port on the system +// +// swagger:model +// +// API extension: resources_v2. +#ResourcesNetworkCardPort: { + // Port identifier (interface name) + // Example: eth0 + id: string @go(ID) + + // MAC address + // Example: 00:23:a4:01:01:6f + address?: string @go(Address) + + // Port number + // Example: 0 + port: uint64 @go(Port) + + // Transport protocol + // Example: ethernet + protocol: string @go(Protocol) + + // List of supported modes + // Example: ["100baseT/Full", "1000baseT/Full", "2500baseT/Full", "5000baseT/Full", "10000baseT/Full"] + supported_modes?: [...string] @go(SupportedModes,[]string) + + // List of supported port types + // Example: ["twisted pair"] + supported_ports?: [...string] @go(SupportedPorts,[]string) + + // Current port type + // Example: twisted pair + port_type?: string @go(PortType) + + // Type of transceiver used + // Example: internal + transceiver_type?: string @go(TransceiverType) + + // Whether auto negotiation is used + // Example: true + auto_negotiation: bool @go(AutoNegotiation) + + // Whether a link was detected + // Example: true + link_detected: bool @go(LinkDetected) + + // Current speed (Mbit/s) + // Example: 10000 + link_speed?: uint64 @go(LinkSpeed) + + // Duplex type + // Example: full + link_duplex?: string @go(LinkDuplex) + + // Additional information for infiniband devices + // + // API extension: resources_infiniband + infiniband?: null | #ResourcesNetworkCardPortInfiniband @go(Infiniband,*ResourcesNetworkCardPortInfiniband) +} + +// ResourcesNetworkCardPortInfiniband represents the Linux Infiniband configuration for the port +// +// swagger:model +// +// API extension: resources_infiniband. +#ResourcesNetworkCardPortInfiniband: { + // ISSM device name + // Example: issm0 + issm_name?: string @go(IsSMName) + + // ISSM device number + // Example: 231:64 + issm_device?: string @go(IsSMDevice) + + // MAD device name + // Example: umad0 + mad_name?: string @go(MADName) + + // MAD device number + // Example: 231:0 + mad_device?: string @go(MADDevice) + + // Verb device name + // Example: uverbs0 + verb_name?: string @go(VerbName) + + // Verb device number + // Example: 231:192 + verb_device?: string @go(VerbDevice) +} + +// ResourcesNetworkCardSRIOV represents the SRIOV configuration of the network card +// +// swagger:model +// +// API extension: resources_v2. +#ResourcesNetworkCardSRIOV: { + // Number of VFs currently configured + // Example: 0 + current_vfs: uint64 @go(CurrentVFs) + + // Maximum number of supported VFs + // Example: 0 + maximum_vfs: uint64 @go(MaximumVFs) + + // List of VFs (as additional Network devices) + // Example: null + vfs: [...#ResourcesNetworkCard] @go(VFs,[]ResourcesNetworkCard) +} + +// ResourcesNetworkCardVDPA represents the VDPA configuration of the network card +// +// swagger:model +// +// API extension: ovn_nic_acceleration_vdpa. +#ResourcesNetworkCardVDPA: { + // Name of the VDPA device + name: string @go(Name) + + // Device identifier of the VDPA device + device: string @go(Device) +} + +// ResourcesStorage represents the local storage +// +// swagger:model +// +// API extension: resources_v2. +#ResourcesStorage: { + // List of disks + disks: [...#ResourcesStorageDisk] @go(Disks,[]ResourcesStorageDisk) + + // Total number of partitions + // Example: 1 + total: uint64 @go(Total) +} + +// ResourcesStorageDisk represents a disk +// +// swagger:model +// +// API extension: resources_v2. +#ResourcesStorageDisk: { + // ID of the disk (device name) + // Example: nvme0n1 + id: string @go(ID) + + // Device number + // Example: 259:0 + device: string @go(Device) + + // Disk model name + // Example: INTEL SSDPEKKW256G7 + model?: string @go(Model) + + // Storage type + // Example: nvme + type?: string @go(Type) + + // Whether the disk is read-only + // Example: false + read_only: bool @go(ReadOnly) + + // Total size of the disk (bytes) + // Example: 256060514304 + size: uint64 @go(Size) + + // Whether the disk is removable (hot-plug) + // Example: false + removable: bool @go(Removable) + + // WWN identifier + // Example: eui.0000000001000000e4d25cafae2e4c00 + wwn?: string @go(WWN) + + // NUMA node the disk is a part of + // Example: 0 + numa_node: uint64 @go(NUMANode) + + // Device by-path identifier + // Example: pci-0000:05:00.0-nvme-1 + // + // API extension: resources_disk_sata + device_path?: string @go(DevicePath) + + // Block size + // Example: 512 + // + // API extension: resources_disk_sata + block_size: uint64 @go(BlockSize) + + // Current firmware version + // Example: PSF121C + // + // API extension: resources_disk_sata + firmware_version?: string @go(FirmwareVersion) + + // Rotation speed (RPM) + // Example: 0 + // + // API extension: resources_disk_sata + rpm: uint64 @go(RPM) + + // Serial number + // Example: BTPY63440ARH256D + // + // API extension: resources_disk_sata + serial?: string @go(Serial) + + // Device by-id identifier + // Example: nvme-eui.0000000001000000e4d25cafae2e4c00 + // + // API extension: resources_disk_id + device_id: string @go(DeviceID) + + // List of partitions + partitions: [...#ResourcesStorageDiskPartition] @go(Partitions,[]ResourcesStorageDiskPartition) + + // PCI address + // Example: 0000:05:00.0 + // + // API extension: resources_disk_address + pci_address?: string @go(PCIAddress) + + // USB address + // Example: 3:5 + // + // API extension: resources_disk_address + usb_address?: string @go(USBAddress) +} + +// ResourcesStorageDiskPartition represents a partition on a disk +// +// swagger:model +// +// API extension: resources_v2. +#ResourcesStorageDiskPartition: { + // ID of the partition (device name) + // Example: nvme0n1p1 + id: string @go(ID) + + // Device number + // Example: 259:1 + device: string @go(Device) + + // Whether the partition is read-only + // Example: false + read_only: bool @go(ReadOnly) + + // Size of the partition (bytes) + // Example: 254933278208 + size: uint64 @go(Size) + + // Partition number + // Example: 1 + partition: uint64 @go(Partition) +} + +// ResourcesMemory represents the memory resources available on the system +// +// swagger:model +// +// API extension: resources. +#ResourcesMemory: { + // List of NUMA memory nodes + // Example: null + // + // API extension: resources_v2 + nodes?: [...#ResourcesMemoryNode] @go(Nodes,[]ResourcesMemoryNode) + + // Total of memory huge pages (bytes) + // Example: 429284917248 + hugepages_total: uint64 @go(HugepagesTotal) + + // Used memory huge pages (bytes) + // Example: 429284917248 + hugepages_used: uint64 @go(HugepagesUsed) + + // Size of memory huge pages (bytes) + // Example: 2097152 + hugepages_size: uint64 @go(HugepagesSize) + + // Used system memory (bytes) + // Example: 557450502144 + used: uint64 @go(Used) + + // Total system memory (bytes) + // Example: 687194767360 + total: uint64 @go(Total) +} + +// ResourcesMemoryNode represents the node-specific memory resources available on the system +// +// swagger:model +// +// API extension: resources_v2. +#ResourcesMemoryNode: { + // NUMA node identifier + // Example: 0 + numa_node: uint64 @go(NUMANode) + + // Used memory huge pages (bytes) + // Example: 214536552448 + hugepages_used: uint64 @go(HugepagesUsed) + + // Total of memory huge pages (bytes) + // Example: 214536552448 + hugepages_total: uint64 @go(HugepagesTotal) + + // Used system memory (bytes) + // Example: 264880439296 + used: uint64 @go(Used) + + // Total system memory (bytes) + // Example: 343597383680 + total: uint64 @go(Total) +} + +// ResourcesStoragePool represents the resources available to a given storage pool +// +// swagger:model +// +// API extension: resources. +#ResourcesStoragePool: { + // Disk space usage + space?: #ResourcesStoragePoolSpace @go(Space) + + // Disk inode usage + inodes?: #ResourcesStoragePoolInodes @go(Inodes) +} + +// ResourcesStoragePoolSpace represents the space available to a given storage pool +// +// swagger:model +// +// API extension: resources. +#ResourcesStoragePoolSpace: { + // Used disk space (bytes) + // Example: 343537419776 + used?: uint64 @go(Used) + + // Total disk space (bytes) + // Example: 420100937728 + total: uint64 @go(Total) +} + +// ResourcesStoragePoolInodes represents the inodes available to a given storage pool +// +// swagger:model +// +// API extension: resources. +#ResourcesStoragePoolInodes: { + // Used inodes + // Example: 23937695 + used: uint64 @go(Used) + + // Total inodes + // Example: 30709993797 + total: uint64 @go(Total) +} + +// ResourcesUSB represents the USB devices available on the system +// +// swagger:model +// +// API extension: resources_usb_pci. +#ResourcesUSB: { + // List of USB devices + devices: [...#ResourcesUSBDevice] @go(Devices,[]ResourcesUSBDevice) + + // Total number of USB devices + // Example: 1 + total: uint64 @go(Total) +} + +// ResourcesUSBDevice represents a USB device +// +// swagger:model +// +// API extension: resources_usb_pci. +#ResourcesUSBDevice: { + // USB address (bus) + // Example: 1 + bus_address: uint64 @go(BusAddress) + + // USB address (device) + // Example: 3 + device_address: uint64 @go(DeviceAddress) + + // USB serial number + // Example: DAE005fp + // + // API extension: device_usb_serial. + serial: string @go(Serial) + + // List of USB interfaces + interfaces: [...#ResourcesUSBDeviceInterface] @go(Interfaces,[]ResourcesUSBDeviceInterface) + + // Name of the vendor + // Example: ATEN International Co., Ltd + vendor: string @go(Vendor) + + // USB ID of the vendor + // Example: 0557 + vendor_id: string @go(VendorID) + + // Name of the product + // Example: Hermon USB hidmouse Device + product: string @go(Product) + + // USB ID of the product + // Example: 2221 + product_id: string @go(ProductID) + + // Transfer speed (Mbit/s) + // Example: 12 + speed: float64 @go(Speed) +} + +// ResourcesUSBDeviceInterface represents a USB device interface +// +// swagger:model +// +// API extension: resources_usb_pci. +#ResourcesUSBDeviceInterface: { + // Class of USB interface + // Example: Human Interface Device + class: string @go(Class) + + // ID of the USB interface class + // Example: 3 + class_id: uint64 @go(ClassID) + + // Kernel driver currently associated with the device + // Example: usbhid + driver: string @go(Driver) + + // Version of the kernel driver + // Example: 5.8.0-36-generic + driver_version: string @go(DriverVersion) + + // Interface number + // Example: 0 + number: uint64 @go(Number) + + // Sub class of the interface + // Example: Boot Interface Subclass + subclass: string @go(SubClass) + + // ID of the USB interface sub class + // Example: 1 + subclass_id: uint64 @go(SubClassID) +} + +// ResourcesPCI represents the PCI devices available on the system +// +// swagger:model +// +// API extension: resources_usb_pci. +#ResourcesPCI: { + // List of PCI devices + devices: [...#ResourcesPCIDevice] @go(Devices,[]ResourcesPCIDevice) + + // Total number of PCI devices + // Example: 1 + total: uint64 @go(Total) +} + +// ResourcesPCIDevice represents a PCI device +// +// swagger:model +// +// API extension: resources_usb_pci. +#ResourcesPCIDevice: { + // Kernel driver currently associated with the GPU + // Example: mgag200 + driver: string @go(Driver) + + // Version of the kernel driver + // Example: 5.8.0-36-generic + driver_version: string @go(DriverVersion) + + // NUMA node the card is a part of + // Example: 0 + numa_node: uint64 @go(NUMANode) + + // PCI address + // Example: 0000:07:03.0 + pci_address: string @go(PCIAddress) + + // Name of the vendor + // Example: Matrox Electronics Systems Ltd. + vendor: string @go(Vendor) + + // PCI ID of the vendor + // Example: 102b + vendor_id: string @go(VendorID) + + // Name of the product + // Example: MGA G200eW WPCM450 + product: string @go(Product) + + // PCI ID of the product + // Example: 0532 + product_id: string @go(ProductID) + + // IOMMU group number + // Example: 20 + // + // API extension: resources_pci_iommu + iommu_group: uint64 @go(IOMMUGroup) + + // Vital Product Data + // Example: + // + // API extension: resources_pci_vpd + vpd: #ResourcesPCIVPD @go(VPD) +} + +// ResourcesPCIVPD represents VPD entries for a device +// +// swagger:model +// +// API extension: resources_pci_vpd. +#ResourcesPCIVPD: { + // Hardware provided product name. + // Example: HP Ethernet 1Gb 4-port 331i Adapter + product_name?: string @go(ProductName) + + // Vendor provided key/value pairs. + // Example: {"EC": ""A-5545", "MN": "103C", "V0": "5W PCIeGen2"} + entries?: {[string]: string} @go(Entries,map[string]string) +} + +// ResourcesSystem represents the system +// +// swagger:model +// +// API extension: resources_system. +#ResourcesSystem: { + // System UUID + // Example: 7fa1c0cc-2271-11b2-a85c-aab32a05d71a + uuid: string @go(UUID) + + // System vendor + // Example: LENOVO + vendor: string @go(Vendor) + + // System model + // Example: 20HRCTO1WW + product: string @go(Product) + + // System family + // Example: ThinkPad X1 Carbon 5th + family: string @go(Family) + + // System version + // Example: ThinkPad X1 Carbon 5th + version: string @go(Version) + + // System nanufacturer SKU + // LENOVO_MT_20HR_BU_Think_FM_ThinkPad X1 Carbon 5th + sku: string @go(Sku) + + // System serial number + // Example: PY3DD4X9 + serial: string @go(Serial) + + // System type (unknown, physical, virtual-machine, container, ...) + // Example: physical + type: string @go(Type) + + // Firmware details + firmware?: null | #ResourcesSystemFirmware @go(Firmware,*ResourcesSystemFirmware) + + // Chassis details + chassis?: null | #ResourcesSystemChassis @go(Chassis,*ResourcesSystemChassis) + + // Motherboard details + motherboard?: null | #ResourcesSystemMotherboard @go(Motherboard,*ResourcesSystemMotherboard) +} + +// ResourcesSystemFirmware represents the system firmware +// +// swagger:model +// +// API extension: resources_system. +#ResourcesSystemFirmware: { + // Firmware vendor + // Example: Lenovo + vendor: string @go(Vendor) + + // Firmware build date + // Example: 10/14/2020 + date: string @go(Date) + + // Firmware version + // Example: N1MET64W (1.49) + version: string @go(Version) +} + +// ResourcesSystemChassis represents the system chassis +// +// swagger:model +// +// API extension: resources_system. +#ResourcesSystemChassis: { + // Chassis vendor + // Example: Lenovo + vendor: string @go(Vendor) + + // Chassis type + // Example: Notebook + type: string @go(Type) + + // Chassis serial number + // Example: PY3DD4X9 + serial: string @go(Serial) + + // Chassis version/revision + // Example: None + version: string @go(Version) +} + +// ResourcesSystemMotherboard represents the motherboard +// +// swagger:model +// +// API extension: resources_system. +#ResourcesSystemMotherboard: { + // Motherboard vendor + // Example: Lenovo + vendor: string @go(Vendor) + + // Motherboard model + // Example: 20HRCTO1WW + product: string @go(Product) + + // Motherboard serial number + // Example: L3CF4FX003A + serial: string @go(Serial) + + // Motherboard version/revision + // Example: None + version: string @go(Version) +} + +// ResourcesLoad represents system load information +// +// swagger:model +// +// API extension: resources_load. +#ResourcesLoad: { + // Load average in the past minute + // Example: 0.69 + Average1Min: float64 + + // Load average in the past 5 minutes + // Example: 1.10 + Average5Min: float64 + + // Load average in the past 10 minutes + // Example: 1.29 + Average10Min: float64 + + // The number of active processes + // Example: 1234 + Processes: int +} + +// ResourcesSerial represents the serial devices available on the system +// +// swagger:model +// +// API extension: resources_serial. +#ResourcesSerial: { + // List of serial devices + devices: [...#ResourcesSerialDevice] @go(Devices,[]ResourcesSerialDevice) + + // Total number of serial devices + // Example: 1 + total: uint64 @go(Total) +} + +// ResourcesSerialDevice represents a serial device +// +// swagger:model +// +// API extension: resources_serial. +#ResourcesSerialDevice: { + // Kernel device name (e.g. ttyUSB0, ttyACM0) + // Example: ttyUSB0 + id: string @go(ID) + + // Device number (major:minor) + // Example: 188:0 + device: string @go(Device) + + // Path to /dev/serial/by-id entry + // Example: /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_AB0J1234-if00-port0 + device_id: string @go(DeviceID) + + // Path to /dev/serial/by-path entry + // Example: /dev/serial/by-path/pci-0000:00:14.0-usb-0:2:1.0-port0 + device_path: string @go(DevicePath) + + // kernel driver name (cdc_acm, ftdi_sio, pl2303, cp210x...) + // Example: cdc_acm + driver: string @go(Driver) + + // USB vendor name + // Example: Arduino LLC + vendor: string @go(Vendor) + + // USB vendor ID + // Example: 2341 + vendor_id: string @go(VendorID) + + // USB product name + // Example: Arduino Uno + product: string @go(Product) + + // USB product ID + // Example: 0043 + product_id: string @go(ProductID) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/response_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/response_go_gen.cue new file mode 100644 index 0000000..627002a --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/response_go_gen.cue @@ -0,0 +1,53 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus/v7/shared/api + +package api + +// ResponseRaw represents an operation in its original form. +#ResponseRaw: { + type: #ResponseType @go(Type) + + // Valid only for Sync responses + status: string @go(Status) + status_code: int @go(StatusCode) + + // Valid only for Async responses + operation: string @go(Operation) + + // Valid only for Error responses + error_code: int @go(Code) + error: string @go(Error) + metadata: _ @go(Metadata,any) +} + +// Response represents an operation. +#Response: { + type: #ResponseType @go(Type) + + // Valid only for Sync responses + status: string @go(Status) + status_code: int @go(StatusCode) + + // Valid only for Async responses + operation: string @go(Operation) + + // Valid only for Error responses + error_code: int @go(Code) + error: string @go(Error) + + // Valid for Sync and Error responses + metadata: _ @go(Metadata,json.RawMessage) +} + +// ResponseType represents a valid response type. +#ResponseType: string // #enumResponseType + +#enumResponseType: + #SyncResponse | + #AsyncResponse | + #ErrorResponse + +#SyncResponse: #ResponseType & "sync" +#AsyncResponse: #ResponseType & "async" +#ErrorResponse: #ResponseType & "error" diff --git a/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/server_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/server_go_gen.cue new file mode 100644 index 0000000..c0e7aca --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/server_go_gen.cue @@ -0,0 +1,220 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus/v7/shared/api + +package api + +// ServerEnvironment represents the read-only environment fields of a server configuration. +#ServerEnvironment: { + // List of addresses the server is listening on + // Example: [":8443"] + addresses: [...string] @go(Addresses,[]string) + + // List of architectures supported by the server + // Example: ["x86_64", "i686"] + architectures: [...string] @go(Architectures,[]string) + + // Server certificate as PEM encoded X509 + // Example: X509 PEM certificate + certificate: string @go(Certificate) + + // Server certificate fingerprint as SHA256 + // Example: fd200419b271f1dc2a5591b693cc5774b7f234e1ff8c6b78ad703b6888fe2b69 + certificate_fingerprint: string @go(CertificateFingerprint) + + // List of supported instance drivers (separate by " | ") + // Example: lxc | qemu + driver: string @go(Driver) + + // List of supported instance driver versions (separate by " | ") + // Example: 4.0.7 | 5.2.0 + driver_version: string @go(DriverVersion) + + // Current firewall driver + // Example: nftables + // + // API extension: firewall_driver + firewall: string @go(Firewall) + + // OS kernel name + // Example: Linux + kernel: string @go(Kernel) + + // OS kernel architecture + // Example: x86_64 + kernel_architecture: string @go(KernelArchitecture) + + // Map of kernel features that were tested on startup + // Example: {"netnsid_getifaddrs": "true", "seccomp_listener": "true"} + // + // API extension: kernel_features + kernel_features: {[string]: string} @go(KernelFeatures,map[string]string) + + // Kernel version + // Example: 5.4.0-36-generic + kernel_version: string @go(KernelVersion) + + // Map of LXC features that were tested on startup + // Example: {"cgroup2": "true", "devpts_fd": "true", "pidfd": "true"} + // + // API extension: lxc_features + lxc_features: {[string]: string} @go(LXCFeatures,map[string]string) + + // Name of the operating system (Linux distribution) + // Example: Ubuntu + // + // API extension: api_os + os_name: string @go(OSName) + + // Version of the operating system (Linux distribution) + // Example: 22.04 + // + // API extension: api_os + os_version: string @go(OSVersion) + + // Current project name + // Example: default + // + // API extension: projects + project: string @go(Project) + + // Server implementation name + // Example: incus + server: string @go(Server) + + // Whether the server is part of a cluster + // Example: false + // + // API extension: clustering + server_clustered: bool @go(ServerClustered) + + // Mode that the event distribution subsystem is operating in on this server. + // Either "full-mesh", "hub-server" or "hub-client". + // Example: full-mesh + // + // API extension: event_hub + server_event_mode: string @go(ServerEventMode) + + // Server hostname + // Example: castiana + // + // API extension: clustering + server_name: string @go(ServerName) + + // PID of the daemon + // Example: 1453969 + server_pid: int @go(ServerPid) + + // Server version + // Example: 4.11 + server_version: string @go(ServerVersion) + + // List of active storage drivers (separate by " | ") + // Example: dir | zfs + storage: string @go(Storage) + + // List of active storage driver versions (separate by " | ") + // Example: 1 | 0.8.4-1ubuntu11 + storage_version: string @go(StorageVersion) + + // List of supported storage drivers + storage_supported_drivers: [...#ServerStorageDriverInfo] @go(StorageSupportedDrivers,[]ServerStorageDriverInfo) +} + +// ServerStorageDriverInfo represents the read-only info about a storage driver +// +// swagger:model +// +// API extension: server_supported_storage_drivers. +#ServerStorageDriverInfo: { + // Name of the driver + // Example: zfs + // + // API extension: server_supported_storage_drivers + Name: string + + // Version of the driver + // Example: 0.8.4-1ubuntu11 + // + // API extension: server_supported_storage_drivers + Version: string + + // Whether the driver has remote volumes + // Example: false + // + // API extension: server_supported_storage_drivers + Remote: bool +} + +// ServerPut represents the modifiable fields of a server configuration +// +// swagger:model +#ServerPut: { + // Server configuration map (refer to doc/server.md) + // Example: {"core.https_address": ":8443"} + config: #ConfigMap @go(Config) +} + +// ServerUntrusted represents a server configuration for an untrusted client +// +// swagger:model +#ServerUntrusted: { + #ServerPut + + // List of supported API extensions + // Read only: true + // Example: ["etag", "patch", "network", "storage"] + api_extensions: [...string] @go(APIExtensions,[]string) + + // Support status of the current API (one of "devel", "stable" or "deprecated") + // Read only: true + // Example: stable + api_status: string @go(APIStatus) + + // API version number + // Read only: true + // Example: 1.0 + api_version: string @go(APIVersion) + + // Whether the client is trusted (one of "trusted" or "untrusted") + // Read only: true + // Example: untrusted + auth: string @go(Auth) + + // Whether the server is public-only (only public endpoints are implemented) + // Read only: true + // Example: false + public: bool @go(Public) + + // List of supported authentication methods + // Read only: true + // Example: ["tls"] + // + // API extension: macaroon_authentication + auth_methods: [...string] @go(AuthMethods,[]string) +} + +// Server represents a server configuration +// +// swagger:model +#Server: { + #ServerUntrusted + + // The current API user identifier + // Read only: true + // Example: uid=201105 + // + // API extension: auth_user + auth_user_name: string @go(AuthUserName) + + // The current API user login method + // Read only: true + // Example: unix + // + // API extension: auth_user + auth_user_method: string @go(AuthUserMethod) + + // Read-only status/configuration information + // Read only: true + environment: #ServerEnvironment @go(Environment) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/status_code_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/status_code_go_gen.cue new file mode 100644 index 0000000..57b6d7c --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/status_code_go_gen.cue @@ -0,0 +1,65 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus/v7/shared/api + +package api + +// StatusCode represents a valid operation and container status. +#StatusCode: int // #enumStatusCode + +#enumStatusCode: + #OperationCreated | + #Started | + #Stopped | + #Running | + #Cancelling | + #Pending | + #Starting | + #Stopping | + #Aborting | + #Freezing | + #Frozen | + #Thawed | + #Error | + #Ready | + #Success | + #Failure | + #Cancelled + +#values_StatusCode: { + OperationCreated: #OperationCreated + Started: #Started + Stopped: #Stopped + Running: #Running + Cancelling: #Cancelling + Pending: #Pending + Starting: #Starting + Stopping: #Stopping + Aborting: #Aborting + Freezing: #Freezing + Frozen: #Frozen + Thawed: #Thawed + Error: #Error + Ready: #Ready + Success: #Success + Failure: #Failure + Cancelled: #Cancelled +} + +#OperationCreated: #StatusCode & 100 +#Started: #StatusCode & 101 +#Stopped: #StatusCode & 102 +#Running: #StatusCode & 103 +#Cancelling: #StatusCode & 104 +#Pending: #StatusCode & 105 +#Starting: #StatusCode & 106 +#Stopping: #StatusCode & 107 +#Aborting: #StatusCode & 108 +#Freezing: #StatusCode & 109 +#Frozen: #StatusCode & 110 +#Thawed: #StatusCode & 111 +#Error: #StatusCode & 112 +#Ready: #StatusCode & 113 +#Success: #StatusCode & 200 +#Failure: #StatusCode & 400 +#Cancelled: #StatusCode & 401 diff --git a/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/storage_pool_bucket_backup_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/storage_pool_bucket_backup_go_gen.cue new file mode 100644 index 0000000..20a2157 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/storage_pool_bucket_backup_go_gen.cue @@ -0,0 +1,56 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus/v7/shared/api + +package api + +import "time" + +// StorageBucketBackup represents the fields available for a new storage bucket backup +// +// swagger:model +// +// API extension: storage_bucket_backup. +#StorageBucketBackup: { + // Backup name + // Example: backup0 + name: string @go(Name) + + // When the backup was created + // Example: 2021-03-23T16:38:37.753398689-04:00 + created_at: time.Time @go(CreatedAt) + + // When the backup expires (gets auto-deleted) + // Example: 2021-03-23T17:38:37.753398689-04:00 + expires_at: time.Time @go(ExpiresAt) +} + +// StorageBucketBackupsPost represents the fields available for a new storage bucket backup +// +// swagger:model +// +// API extension: storage_bucket_backup. +#StorageBucketBackupsPost: { + // Backup name + // Example: backup0 + name: string @go(Name) + + // When the backup expires (gets auto-deleted) + // Example: 2021-03-23T17:38:37.753398689-04:00 + expires_at: time.Time @go(ExpiresAt) + + // What compression algorithm to use + // Example: gzip + compression_algorithm: string @go(CompressionAlgorithm) +} + +// StorageBucketBackupPost represents the fields available for the renaming of a bucket backup +// +// swagger:model +// +// API extension: storage_bucket_backup. +#StorageBucketBackupPost: { + // New backup name + // Example: backup1 + name: string @go(Name) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/storage_pool_bucket_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/storage_pool_bucket_go_gen.cue new file mode 100644 index 0000000..49b8899 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/storage_pool_bucket_go_gen.cue @@ -0,0 +1,148 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus/v7/shared/api + +package api + +// StorageBucketsPost represents the fields of a new storage pool bucket +// +// swagger:model +// +// API extension: storage_buckets. +#StorageBucketsPost: { + #StorageBucketPut + + // Bucket name + // Example: foo + // + // API extension: storage_buckets + name: string @go(Name) +} + +// StorageBucketPut represents the modifiable fields of a storage pool bucket +// +// swagger:model +// +// API extension: storage_buckets. +#StorageBucketPut: { + // Storage bucket configuration map + // Example: {"size": "50GiB"} + // + // API extension: storage_buckets + config: #ConfigMap @go(Config) + + // Description of the storage bucket + // Example: My custom bucket + // + // API extension: storage_buckets + description: string @go(Description) +} + +// StorageBucketFull is a combination of StorageBucket, StorageBucketBackup and StorageBucketKey. +// +// swagger:model +// +// API extension: storage_bucket_full. +#StorageBucketFull: { + #StorageBucket + + // List of backups. + backups: [...#StorageBucketBackup] @go(Backups,[]StorageBucketBackup) + + // List of keys. + keys: [...#StorageBucketKey] @go(Keys,[]StorageBucketKey) +} + +// StorageBucket represents the fields of a storage pool bucket +// +// swagger:model +// +// API extension: storage_buckets. +#StorageBucket: { + #StorageBucketPut + + // Bucket name + // Example: foo + // + // API extension: storage_buckets + name: string @go(Name) + + // Bucket S3 URL + // Example: https://127.0.0.1:8080/foo + // + // API extension: storage_buckets + s3_url: string @go(S3URL) + + // What cluster member this record was found on + // Example: server01 + // + // API extension: storage_buckets + location: string @go(Location) + + // Project name + // Example: project1 + // + // API extension: storage_buckets_all_projects + project: string @go(Project) +} + +// StorageBucketKeysPost represents the fields of a new storage pool bucket key +// +// swagger:model +// +// API extension: storage_buckets. +#StorageBucketKeysPost: { + #StorageBucketKeyPut + + // Key name + // Example: my-read-only-key + // + // API extension: storage_buckets + name: string @go(Name) +} + +// StorageBucketKeyPut represents the modifiable fields of a storage pool bucket key +// +// swagger:model +// +// API extension: storage_buckets. +#StorageBucketKeyPut: { + // Description of the storage bucket key + // Example: My read-only bucket key + // + // API extension: storage_buckets + description: string @go(Description) + + // Whether the key can perform write actions or not. + // Example: read-only + // + // API extension: storage_buckets + role: string @go(Role) + + // Access key + // Example: 33UgkaIBLBIxb7O1 + // + // API extension: storage_buckets + "access-key": string @go(AccessKey) + + // Secret key + // Example: kDQD6AOgwHgaQI1UIJBJpPaiLgZuJbq0 + // + // API extension: storage_buckets + "secret-key": string @go(SecretKey) +} + +// StorageBucketKey represents the fields of a storage pool bucket key +// +// swagger:model +// +// API extension: storage_buckets. +#StorageBucketKey: { + #StorageBucketKeyPut + + // Key name + // Example: my-read-only-key + // + // API extension: storage_buckets + name: string @go(Name) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/storage_pool_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/storage_pool_go_gen.cue new file mode 100644 index 0000000..0f4528e --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/storage_pool_go_gen.cue @@ -0,0 +1,93 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus/v7/shared/api + +package api + +#StoragePoolStatusPending: "Pending" + +#StoragePoolStatusCreated: "Created" + +#StoragePoolStatusErrored: "Errored" + +#StoragePoolStatusUnknown: "Unknown" + +#StoragePoolStatusUnvailable: "Unavailable" + +// StoragePoolsPost represents the fields of a new storage pool +// +// swagger:model +// +// API extension: storage. +#StoragePoolsPost: { + #StoragePoolPut + + // Storage pool name + // Example: local + name: string @go(Name) + + // Storage pool driver (btrfs, ceph, cephfs, cephobject, dir, lvm, lvmcluster or zfs) + // Example: zfs + driver: string @go(Driver) +} + +// StoragePool represents the fields of a storage pool. +// +// swagger:model +// +// API extension: storage. +#StoragePool: { + #StoragePoolPut + + // Storage pool name + // Example: local + name: string @go(Name) + + // Storage pool driver (btrfs, ceph, cephfs, cephobject, dir, lvm, lvmcluster or zfs) + // Example: zfs + driver: string @go(Driver) + + // List of URLs of objects using this storage pool + // Example: ["/1.0/profiles/default", "/1.0/instances/c1"] + used_by: [...string] @go(UsedBy,[]string) + + // Pool status (Pending, Created, Errored or Unknown) + // Read only: true + // Example: Created + // + // API extension: clustering + status: string @go(Status) + + // Cluster members on which the storage pool has been defined + // Read only: true + // Example: ["server01", "server02", "server03"] + // + // API extension: clustering + locations: [...string] @go(Locations,[]string) +} + +// StoragePoolPut represents the modifiable fields of a storage pool. +// +// swagger:model +// +// API extension: storage. +#StoragePoolPut: { + // Storage pool configuration map (refer to doc/storage.md) + // Example: {"volume.block.filesystem": "ext4", "volume.size": "50GiB"} + config: #ConfigMap @go(Config) + + // Description of the storage pool + // Example: Local SSD pool + // + // API extension: entity_description + description: string @go(Description) +} + +// StoragePoolState represents the state of a storage pool. +// +// swagger:model +// +// API extension: cluster_member_state. +#StoragePoolState: { + #ResourcesStoragePool +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/storage_pool_volume_backup_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/storage_pool_volume_backup_go_gen.cue new file mode 100644 index 0000000..d78420e --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/storage_pool_volume_backup_go_gen.cue @@ -0,0 +1,78 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus/v7/shared/api + +package api + +import "time" + +// StorageVolumeBackup represents a volume backup +// +// swagger:model +// +// API extension: custom_volume_backup. +#StorageVolumeBackup: { + // Backup name + // Example: backup0 + name: string @go(Name) + + // When the backup was created + // Example: 2021-03-23T16:38:37.753398689-04:00 + created_at: time.Time @go(CreatedAt) + + // When the backup expires (gets auto-deleted) + // Example: 2021-03-23T17:38:37.753398689-04:00 + expires_at: time.Time @go(ExpiresAt) + + // Whether to ignore snapshots + // Example: false + volume_only: bool @go(VolumeOnly) + + // Whether to use a pool-optimized binary format (instead of plain tarball) + // Example: true + optimized_storage: bool @go(OptimizedStorage) +} + +// StorageVolumeBackupsPost represents the fields available for a new volume backup +// +// swagger:model +// +// API extension: custom_volume_backup. +#StorageVolumeBackupsPost: { + // Backup name + // Example: backup0 + name: string @go(Name) + + // When the backup expires (gets auto-deleted) + // Example: 2021-03-23T17:38:37.753398689-04:00 + expires_at: time.Time @go(ExpiresAt) + + // Whether to ignore snapshots + // Example: false + volume_only: bool @go(VolumeOnly) + + // Whether to use a pool-optimized binary format (instead of plain tarball) + // Example: true + optimized_storage: bool @go(OptimizedStorage) + + // What compression algorithm to use + // Example: gzip + compression_algorithm: string @go(CompressionAlgorithm) + + // External upload target + // The backup will be uploaded and then deleted from local storage. + // + // API extension: backup_s3_upload + target?: null | #BackupTarget @go(Target,*BackupTarget) +} + +// StorageVolumeBackupPost represents the fields available for the renaming of a volume backup +// +// swagger:model +// +// API extension: custom_volume_backup. +#StorageVolumeBackupPost: { + // New backup name + // Example: backup1 + name: string @go(Name) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/storage_pool_volume_bitmap_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/storage_pool_volume_bitmap_go_gen.cue new file mode 100644 index 0000000..379a51a --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/storage_pool_volume_bitmap_go_gen.cue @@ -0,0 +1,63 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus/v7/shared/api + +package api + +// StorageVolumeBitmap represents a volume bitmap +// +// swagger:model +// +// API extension: storage_volume_nbd. +#StorageVolumeBitmap: { + // Bitmap name + // Example: bitmap0 + name: string @go(Name) + + // Number of dirty bytes + // Example: 300 + count: int @go(Count) + + // Granularity of the dirty bitmap in bytes + // Example: 32768 + granularity: int @go(Granularity) + + // true if the bitmap is recording new writes from the guest + // Example: false + recording: bool @go(Recording) + + // true if the bitmap is in-use by some operation + // Example: true + busy: bool @go(Busy) + + // true if the bitmap was stored on disk, is scheduled to be stored on disk, or both + // Example: false + persistent: bool @go(Persistent) + + // true if this is a persistent bitmap that was improperly stored + // Example: true + inconsistent: bool @go(Inconsistent) +} + +// StorageVolumeBitmapsPost represents the fields available for a new volume bitmap +// +// swagger:model +// +// API extension: satorage_volume_nbd. +#StorageVolumeBitmapsPost: { + // Bitmap name + // Example: bitmap0 + name: string @go(Name) + + // Granularity of the dirty bitmap in bytes + // Example: 32768 + granularity: int @go(Granularity) + + // true if the bitmap was stored on disk, is scheduled to be stored on disk, or both + // Example: false + persistent: bool @go(Persistent) + + // The bitmap is created in the disabled state + // Example: false + disabled: bool @go(Disabled) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/storage_pool_volume_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/storage_pool_volume_go_gen.cue new file mode 100644 index 0000000..45c5a1e --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/storage_pool_volume_go_gen.cue @@ -0,0 +1,257 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus/v7/shared/api + +package api + +import "time" + +// StorageVolumesPost represents the fields of a new storage pool volume +// +// swagger:model +// +// API extension: storage. +#StorageVolumesPost: { + #StorageVolumePut + + // Volume name + // Example: foo + name: string @go(Name) + + // Volume type (container, custom, image or virtual-machine) + // Example: custom + type: string @go(Type) + + // Migration source + // + // API extension: storage_api_local_volume_handling + source: #StorageVolumeSource @go(Source) + + // Volume content type (filesystem or block) + // Example: filesystem + // + // API extension: custom_block_volumes + content_type: string @go(ContentType) +} + +// StorageVolumePost represents the fields required to rename a storage pool volume +// +// swagger:model +// +// API extension: storage_api_volume_rename. +#StorageVolumePost: { + // New volume name + // Example: foo + name: string @go(Name) + + // New storage pool + // Example: remote + // + // API extension: storage_api_local_volume_handling + pool?: string @go(Pool) + + // Initiate volume migration + // Example: false + // + // API extension: storage_api_remote_volume_handling + migration: bool @go(Migration) + + // Migration target (for push mode) + // + // API extension: storage_api_remote_volume_handling + target?: null | #StorageVolumePostTarget @go(Target,*StorageVolumePostTarget) + + // Whether snapshots should be discarded (migration only) + // Example: false + // + // API extension: storage_api_remote_volume_snapshots + volume_only: bool @go(VolumeOnly) + + // New project name + // Example: foo + // + // API extension: storage_volume_project_move + project?: string @go(Project) + + // Migration source + // + // API extension: cluster_internal_custom_volume_copy + source: #StorageVolumeSource @go(Source) +} + +// StorageVolumePostTarget represents the migration target host and operation +// +// swagger:model +// +// API extension: storage_api_remote_volume_handling. +#StorageVolumePostTarget: { + // The certificate of the migration target + // Example: X509 PEM certificate + certificate: string @go(Certificate) + + // Remote operation URL (for migration) + // Example: https://1.2.3.4:8443/1.0/operations/1721ae08-b6a8-416a-9614-3f89302466e1 + operation?: string @go(Operation) + + // Migration websockets credentials + // Example: {"migration": "random-string"} + secrets?: {[string]: string} @go(Websockets,map[string]string) +} + +// StorageVolumeFull is a combination of StorageVolume, StorageVolumeBackup, StorageVolumeSnapshot and StorageVolumeState. +// +// swagger:model +// +// API extension: storage_volume_full. +#StorageVolumeFull: { + #StorageVolume + + // List of backups. + backups: [...#StorageVolumeBackup] @go(Backups,[]StorageVolumeBackup) + + // List of snapshots. + snapshots: [...#StorageVolumeSnapshot] @go(Snapshots,[]StorageVolumeSnapshot) + + // State. + state?: null | #StorageVolumeState @go(State,*StorageVolumeState) +} + +// StorageVolume represents the fields of a storage volume. +// +// swagger:model +// +// API extension: storage. +#StorageVolume: { + #StorageVolumePut + + // Volume name + // Example: foo + name: string @go(Name) + + // Volume type + // Example: custom + type: string @go(Type) + + // List of URLs of objects using this storage volume + // Example: ["/1.0/instances/blah"] + used_by: [...string] @go(UsedBy,[]string) + + // What cluster member this record was found on + // Example: server01 + // + // API extension: clustering + location: string @go(Location) + + // Volume content type (filesystem or block) + // Example: filesystem + // + // API extension: custom_block_volumes + content_type: string @go(ContentType) + + // Project containing the volume. + // Example: default + // + // API extension: storage_volumes_all_projects + project: string @go(Project) + + // Volume creation timestamp + // Example: 2021-03-23T20:00:00-04:00 + // API extension: storage_volumes_created_at + created_at: time.Time @go(CreatedAt) +} + +// StorageVolumePut represents the modifiable fields of a storage volume +// +// swagger:model +// +// API extension: storage. +#StorageVolumePut: { + // Storage volume configuration map (refer to doc/storage.md) + // Example: {"zfs.remove_snapshots": "true", "size": "50GiB"} + config: #ConfigMap @go(Config) + + // Description of the storage volume + // Example: My custom volume + // + // API extension: entity_description + description: string @go(Description) + + // Name of a snapshot to restore + // Example: snap0 + // + // API extension: storage_api_volume_snapshots + restore?: string @go(Restore) +} + +// StorageVolumeSource represents the creation source for a new storage volume +// +// swagger:model +// +// API extension: storage_api_local_volume_handling. +#StorageVolumeSource: { + // Source volume name (for copy) + // Example: foo + name: string @go(Name) + + // Source type (copy or migration) + // Example: copy + type: string @go(Type) + + // Source storage pool (for copy) + // Example: local + pool: string @go(Pool) + + // Certificate (for migration) + // Example: X509 PEM certificate + // + // API extension: storage_api_remote_volume_handling + certificate: string @go(Certificate) + + // Whether to use pull or push mode (for migration) + // Example: pull + // + // API extension: storage_api_remote_volume_handling + mode?: string @go(Mode) + + // Remote operation URL (for migration) + // Example: https://1.2.3.4:8443/1.0/operations/1721ae08-b6a8-416a-9614-3f89302466e1 + // + // API extension: storage_api_remote_volume_handling + operation?: string @go(Operation) + + // Map of migration websockets (for migration) + // Example: {"rsync": "RANDOM-STRING"} + // + // API extension: storage_api_remote_volume_handling + secrets?: {[string]: string} @go(Websockets,map[string]string) + + // Whether snapshots should be discarded (for migration) + // Example: false + // + // API extension: storage_api_volume_snapshots + volume_only: bool @go(VolumeOnly) + + // Whether existing destination volume should be refreshed + // Example: false + // + // API extension: custom_volume_refresh + refresh: bool @go(Refresh) + + // Whether to exclude source snapshots earlier than latest target snapshot + // Example: false + // + // API extension: custom_volume_refresh_exclude_older_snapshots + refresh_exclude_older: bool @go(RefreshExcludeOlder) + + // Source project name + // Example: foo + // + // API extension: storage_api_project + project?: string @go(Project) + + // What cluster member this record was found on + // Example: server01 + // + // API extension: cluster_internal_custom_volume_copy + location: string @go(Location) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/storage_pool_volume_snapshot_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/storage_pool_volume_snapshot_go_gen.cue new file mode 100644 index 0000000..30e4247 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/storage_pool_volume_snapshot_go_gen.cue @@ -0,0 +1,91 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus/v7/shared/api + +package api + +import "time" + +// StorageVolumeSnapshotsPost represents the fields available for a new storage volume snapshot +// +// swagger:model +// +// API extension: storage_api_volume_snapshots. +#StorageVolumeSnapshotsPost: { + // Snapshot name + // Example: snap0 + name: string @go(Name) + + // When the snapshot expires (gets auto-deleted) + // Example: 2021-03-23T17:38:37.753398689-04:00 + // + // API extension: custom_volume_snapshot_expiry + expires_at?: null | time.Time @go(ExpiresAt,*time.Time) +} + +// StorageVolumeSnapshotPost represents the fields required to rename/move a storage volume snapshot +// +// swagger:model +// +// API extension: storage_api_volume_snapshots. +#StorageVolumeSnapshotPost: { + // New snapshot name + // Example: snap1 + name: string @go(Name) + + // Initiate volume snapshot migration + // Example: false + // + // API extension: storage_api_remote_volume_snapshot_copy + migration: bool @go(Migration) + + // Migration target (for push mode) + // + // API extension: storage_api_remote_volume_snapshot_copy + target?: null | #StorageVolumePostTarget @go(Target,*StorageVolumePostTarget) +} + +// StorageVolumeSnapshot represents a storage volume snapshot +// +// swagger:model +// +// API extension: storage_api_volume_snapshots. +#StorageVolumeSnapshot: { + #StorageVolumeSnapshotPut + + // Snapshot name + // Example: snap0 + name: string @go(Name) + + // Storage volume configuration map (refer to doc/storage.md) + // Example: {"zfs.remove_snapshots": "true", "size": "50GiB"} + config: #ConfigMap @go(Config) + + // The content type (filesystem or block) + // Example: filesystem + // + // API extension: custom_block_volumes + content_type: string @go(ContentType) + + // Volume snapshot creation timestamp + // Example: 2021-03-23T20:00:00-04:00 + // API extension: storage_volumes_created_at + created_at: time.Time @go(CreatedAt) +} + +// StorageVolumeSnapshotPut represents the modifiable fields of a storage volume +// +// swagger:model +// +// API extension: storage_api_volume_snapshots. +#StorageVolumeSnapshotPut: { + // Description of the storage volume + // Example: My custom volume + description: string @go(Description) + + // When the snapshot expires (gets auto-deleted) + // Example: 2021-03-23T17:38:37.753398689-04:00 + // + // API extension: custom_volume_snapshot_expiry + expires_at?: null | time.Time @go(ExpiresAt,*time.Time) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/storage_pool_volume_state_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/storage_pool_volume_state_go_gen.cue new file mode 100644 index 0000000..dfe3308 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/storage_pool_volume_state_go_gen.cue @@ -0,0 +1,32 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus/v7/shared/api + +package api + +// StorageVolumeState represents the live state of the volume +// +// swagger:model +// +// API extension: storage_volume_state. +#StorageVolumeState: { + // Volume usage + usage?: null | #StorageVolumeStateUsage @go(Usage,*StorageVolumeStateUsage) +} + +// StorageVolumeStateUsage represents the disk usage of a volume +// +// swagger:model +// +// API extension: storage_volume_state. +#StorageVolumeStateUsage: { + // Used space in bytes + // Example: 1693552640 + used?: uint64 @go(Used) + + // Storage volume size in bytes + // Example: 5189222192 + // + // API extension: storage_volume_state_total + total: int64 @go(Total) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/url_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/url_go_gen.cue new file mode 100644 index 0000000..8cf31de --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/url_go_gen.cue @@ -0,0 +1,10 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus/v7/shared/api + +package api + +// URL represents an endpoint for the REST API. +#URL: { + URL: _ @go(,url.URL) +} diff --git a/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/warning_go_gen.cue b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/warning_go_gen.cue new file mode 100644 index 0000000..b25417a --- /dev/null +++ b/schemas/cue.mod/gen/github.com/lxc/incus/v7/shared/api/warning_go_gen.cue @@ -0,0 +1,67 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/lxc/incus/v7/shared/api + +package api + +import "time" + +// Warning represents a warning entry. +// +// swagger:model +// +// API extension: warnings. +#Warning: { + #WarningPut + + // UUID of the warning + // Example: e9e9da0d-2538-4351-8047-46d4a8ae4dbb + uuid: string @go(UUID) + + // What cluster member this warning occurred on + // Example: server01 + location: string @go(Location) + + // The project the warning occurred in + // Example: default + project: string @go(Project) + + // Type type of warning + // Example: Couldn't find CGroup + type: string @go(Type) + + // The number of times this warning occurred + // Example: 1 + count: int @go(Count) + + // The first time this warning occurred + // Example: 2021-03-23T17:38:37.753398689-04:00 + first_seen_at: time.Time @go(FirstSeenAt) + + // The last time this warning occurred + // Example: 2021-03-23T17:38:37.753398689-04:00 + last_seen_at: time.Time @go(LastSeenAt) + + // The warning message + // Example: Couldn't find the CGroup blkio.weight, disk priority will be ignored + last_message: string @go(LastMessage) + + // The severity of this warning + // Example: low + severity: string @go(Severity) + + // The entity affected by this warning + // Example: /1.0/instances/c1?project=default + entity_url: string @go(EntityURL) +} + +// WarningPut represents the modifiable fields of a warning. +// +// swagger:model +// +// API extension: warnings. +#WarningPut: { + // Status of the warning (new, acknowledged, or resolved) + // Example: new + status: string @go(Status) +} diff --git a/schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/authorization_go_gen.cue b/schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/authorization_go_gen.cue new file mode 100644 index 0000000..e55bbe0 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/authorization_go_gen.cue @@ -0,0 +1,85 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/zitadel/oidc/v3/pkg/oidc + +package oidc + +// ScopeOpenID defines the scope `openid` +// OpenID Connect requests MUST contain the `openid` scope value +#ScopeOpenID: "openid" + +// ScopeProfile defines the scope `profile` +// This (optional) scope value requests access to the End-User's default profile Claims, +// which are: name, family_name, given_name, middle_name, nickname, preferred_username, +// profile, picture, website, gender, birthdate, zoneinfo, locale, and updated_at. +#ScopeProfile: "profile" + +// ScopeEmail defines the scope `email` +// This (optional) scope value requests access to the email and email_verified Claims. +#ScopeEmail: "email" + +// ScopeAddress defines the scope `address` +// This (optional) scope value requests access to the address Claim. +#ScopeAddress: "address" + +// ScopePhone defines the scope `phone` +// This (optional) scope value requests access to the phone_number and phone_number_verified Claims. +#ScopePhone: "phone" + +// ScopeOfflineAccess defines the scope `offline_access` +// This (optional) scope value requests that an OAuth 2.0 Refresh Token be issued that can be used to obtain an Access Token +// that grants access to the End-User's UserInfo Endpoint even when the End-User is not present (not logged in). +#ScopeOfflineAccess: "offline_access" + +// ResponseTypeCode for the Authorization Code Flow returning a code from the Authorization Server +#ResponseTypeCode: #ResponseType & "code" + +// ResponseTypeIDToken for the Implicit Flow returning id and access tokens directly from the Authorization Server +#ResponseTypeIDToken: #ResponseType & "id_token token" + +// ResponseTypeIDTokenOnly for the Implicit Flow returning only id token directly from the Authorization Server +#ResponseTypeIDTokenOnly: #ResponseType & "id_token" +#DisplayPage: #Display & "page" +#DisplayPopup: #Display & "popup" +#DisplayTouch: #Display & "touch" +#DisplayWAP: #Display & "wap" +#ResponseModeQuery: #ResponseMode & "query" +#ResponseModeFragment: #ResponseMode & "fragment" +#ResponseModeFormPost: #ResponseMode & "form_post" + +// PromptNone (`none`) disallows the Authorization Server to display any authentication or consent user interface pages. +// An error (login_required, interaction_required, ...) will be returned if the user is not already authenticated or consent is needed +#PromptNone: "none" + +// PromptLogin (`login`) directs the Authorization Server to prompt the End-User for reauthentication. +#PromptLogin: "login" + +// PromptConsent (`consent`) directs the Authorization Server to prompt the End-User for consent (of sharing information). +#PromptConsent: "consent" + +// PromptSelectAccount (`select_account `) directs the Authorization Server to prompt the End-User to select a user account (to enable multi user / session switching) +#PromptSelectAccount: "select_account" + +// AuthRequest according to: +// https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest +#AuthRequest: { + scope: #SpaceDelimitedArray @go(Scopes) + response_type: #ResponseType @go(ResponseType) + client_id: string @go(ClientID) + redirect_uri: string @go(RedirectURI) + state: string @go(State) + nonce: string @go(Nonce) + response_mode: #ResponseMode @go(ResponseMode) + display: #Display @go(Display) + prompt: #SpaceDelimitedArray @go(Prompt) + max_age?: null | uint @go(MaxAge,*uint) + ui_locales: #Locales @go(UILocales) + id_token_hint: string @go(IDTokenHint) + login_hint: string @go(LoginHint) + acr_values: #SpaceDelimitedArray @go(ACRValues) + code_challenge: string @go(CodeChallenge) + code_challenge_method: #CodeChallengeMethod @go(CodeChallengeMethod) + + // RequestParam enables OIDC requests to be passed in a single, self-contained parameter (as JWT, called Request Object) + RequestParam: string +} diff --git a/schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/code_challenge_go_gen.cue b/schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/code_challenge_go_gen.cue new file mode 100644 index 0000000..942c631 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/code_challenge_go_gen.cue @@ -0,0 +1,19 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/zitadel/oidc/v3/pkg/oidc + +package oidc + +#CodeChallengeMethodPlain: #CodeChallengeMethod & "plain" +#CodeChallengeMethodS256: #CodeChallengeMethod & "S256" + +#CodeChallengeMethod: string // #enumCodeChallengeMethod + +#enumCodeChallengeMethod: + #CodeChallengeMethodPlain | + #CodeChallengeMethodS256 + +#CodeChallenge: { + Challenge: string + Method: #CodeChallengeMethod +} diff --git a/schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/device_authorization_go_gen.cue b/schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/device_authorization_go_gen.cue new file mode 100644 index 0000000..36e1adb --- /dev/null +++ b/schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/device_authorization_go_gen.cue @@ -0,0 +1,26 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/zitadel/oidc/v3/pkg/oidc + +package oidc + +// DeviceAuthorizationRequest implements +// https://www.rfc-editor.org/rfc/rfc8628#section-3.1, +// 3.1 Device Authorization Request. +#DeviceAuthorizationRequest: { + Scopes: #SpaceDelimitedArray + ClientID: string +} + +// DeviceAuthorizationResponse implements +// https://www.rfc-editor.org/rfc/rfc8628#section-3.2 +// 3.2. Device Authorization Response. +#DeviceAuthorizationResponse: _ + +// DeviceAccessTokenRequest implements +// https://www.rfc-editor.org/rfc/rfc8628#section-3.4, +// Device Access Token Request. +#DeviceAccessTokenRequest: { + grant_type: #GrantType @go(GrantType) + device_code: string @go(DeviceCode) +} diff --git a/schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/discovery_go_gen.cue b/schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/discovery_go_gen.cue new file mode 100644 index 0000000..fe8de4e --- /dev/null +++ b/schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/discovery_go_gen.cue @@ -0,0 +1,170 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/zitadel/oidc/v3/pkg/oidc + +package oidc + +#DiscoveryEndpoint: "/.well-known/openid-configuration" + +#DiscoveryConfiguration: { + // Issuer is the identifier of the OP and is used in the tokens as `iss` claim. + issuer?: string @go(Issuer) + + // AuthorizationEndpoint is the URL of the OAuth 2.0 Authorization Endpoint where all user interactive login start + authorization_endpoint?: string @go(AuthorizationEndpoint) + + // TokenEndpoint is the URL of the OAuth 2.0 Token Endpoint where all tokens are issued, except when using Implicit Flow + token_endpoint?: string @go(TokenEndpoint) + + // IntrospectionEndpoint is the URL of the OAuth 2.0 Introspection Endpoint. + introspection_endpoint?: string @go(IntrospectionEndpoint) + + // UserinfoEndpoint is the URL where an access_token can be used to retrieve the Userinfo. + userinfo_endpoint?: string @go(UserinfoEndpoint) + + // RevocationEndpoint is the URL of the OAuth 2.0 Revocation Endpoint. + revocation_endpoint?: string @go(RevocationEndpoint) + + // EndSessionEndpoint is a URL where the RP can perform a redirect to request that the End-User be logged out at the OP. + end_session_endpoint?: string @go(EndSessionEndpoint) + device_authorization_endpoint?: string @go(DeviceAuthorizationEndpoint) + + // CheckSessionIframe is a URL where the OP provides an iframe that support cross-origin communications for session state information with the RP Client. + check_session_iframe?: string @go(CheckSessionIframe) + + // JwksURI is the URL of the JSON Web Key Set. This site contains the signing keys that RPs can use to validate the signature. + // It may also contain the OP's encryption keys that RPs can use to encrypt request to the OP. + jwks_uri?: string @go(JwksURI) + + // RegistrationEndpoint is the URL for the Dynamic Client Registration. + registration_endpoint?: string @go(RegistrationEndpoint) + + // ScopesSupported lists an array of supported scopes. This list must not include every supported scope by the OP. + scopes_supported?: [...string] @go(ScopesSupported,[]string) + + // ResponseTypesSupported contains a list of the OAuth 2.0 response_type values that the OP supports (code, id_token, token id_token, ...). + response_types_supported?: [...string] @go(ResponseTypesSupported,[]string) + + // ResponseModesSupported contains a list of the OAuth 2.0 response_mode values that the OP supports. If omitted, the default value is ["query", "fragment"]. + response_modes_supported?: [...string] @go(ResponseModesSupported,[]string) + + // GrantTypesSupported contains a list of the OAuth 2.0 grant_type values that the OP supports. If omitted, the default value is ["authorization_code", "implicit"]. + grant_types_supported?: [...#GrantType] @go(GrantTypesSupported,[]GrantType) + + // ACRValuesSupported contains a list of Authentication Context Class References that the OP supports. + acr_values_supported?: [...string] @go(ACRValuesSupported,[]string) + + // SubjectTypesSupported contains a list of Subject Identifier types that the OP supports (pairwise, public). + subject_types_supported?: [...string] @go(SubjectTypesSupported,[]string) + + // IDTokenSigningAlgValuesSupported contains a list of JWS signing algorithms (alg values) supported by the OP for the ID Token. + id_token_signing_alg_values_supported?: [...string] @go(IDTokenSigningAlgValuesSupported,[]string) + + // IDTokenEncryptionAlgValuesSupported contains a list of JWE encryption algorithms (alg values) supported by the OP for the ID Token. + id_token_encryption_alg_values_supported?: [...string] @go(IDTokenEncryptionAlgValuesSupported,[]string) + + // IDTokenEncryptionEncValuesSupported contains a list of JWE encryption algorithms (enc values) supported by the OP for the ID Token. + id_token_encryption_enc_values_supported?: [...string] @go(IDTokenEncryptionEncValuesSupported,[]string) + + // UserinfoSigningAlgValuesSupported contains a list of JWS signing algorithms (alg values) supported by the OP for UserInfo Endpoint. + userinfo_signing_alg_values_supported?: [...string] @go(UserinfoSigningAlgValuesSupported,[]string) + + // UserinfoEncryptionAlgValuesSupported contains a list of JWE encryption algorithms (alg values) supported by the OP for the UserInfo Endpoint. + userinfo_encryption_alg_values_supported?: [...string] @go(UserinfoEncryptionAlgValuesSupported,[]string) + + // UserinfoEncryptionEncValuesSupported contains a list of JWE encryption algorithms (enc values) supported by the OP for the UserInfo Endpoint. + userinfo_encryption_enc_values_supported?: [...string] @go(UserinfoEncryptionEncValuesSupported,[]string) + + // RequestObjectSigningAlgValuesSupported contains a list of JWS signing algorithms (alg values) supported by the OP for Request Objects. + // These algorithms are used both then the Request Object is passed by value (using the request parameter) and when it is passed by reference (using the request_uri parameter). + request_object_signing_alg_values_supported?: [...string] @go(RequestObjectSigningAlgValuesSupported,[]string) + + // RequestObjectEncryptionAlgValuesSupported contains a list of JWE encryption algorithms (alg values) supported by the OP for Request Objects. + // These algorithms are used both when the Request Object is passed by value and by reference. + request_object_encryption_alg_values_supported?: [...string] @go(RequestObjectEncryptionAlgValuesSupported,[]string) + + // RequestObjectEncryptionEncValuesSupported contains a list of JWE encryption algorithms (enc values) supported by the OP for Request Objects. + // These algorithms are used both when the Request Object is passed by value and by reference. + request_object_encryption_enc_values_supported?: [...string] @go(RequestObjectEncryptionEncValuesSupported,[]string) + + // TokenEndpointAuthMethodsSupported contains a list of Client Authentication methods supported by the Token Endpoint. If omitted, the default is client_secret_basic. + token_endpoint_auth_methods_supported?: [...#AuthMethod] @go(TokenEndpointAuthMethodsSupported,[]AuthMethod) + + // TokenEndpointAuthSigningAlgValuesSupported contains a list of JWS signing algorithms (alg values) supported by the Token Endpoint + // for the signature of the JWT used to authenticate the Client by private_key_jwt and client_secret_jwt. + token_endpoint_auth_signing_alg_values_supported?: [...string] @go(TokenEndpointAuthSigningAlgValuesSupported,[]string) + + // RevocationEndpointAuthMethodsSupported contains a list of Client Authentication methods supported by the Revocation Endpoint. If omitted, the default is client_secret_basic. + revocation_endpoint_auth_methods_supported?: [...#AuthMethod] @go(RevocationEndpointAuthMethodsSupported,[]AuthMethod) + + // RevocationEndpointAuthSigningAlgValuesSupported contains a list of JWS signing algorithms (alg values) supported by the Revocation Endpoint + // for the signature of the JWT used to authenticate the Client by private_key_jwt and client_secret_jwt. + revocation_endpoint_auth_signing_alg_values_supported?: [...string] @go(RevocationEndpointAuthSigningAlgValuesSupported,[]string) + + // IntrospectionEndpointAuthMethodsSupported contains a list of Client Authentication methods supported by the Introspection Endpoint. + introspection_endpoint_auth_methods_supported?: [...#AuthMethod] @go(IntrospectionEndpointAuthMethodsSupported,[]AuthMethod) + + // IntrospectionEndpointAuthSigningAlgValuesSupported contains a list of JWS signing algorithms (alg values) supported by the Revocation Endpoint + // for the signature of the JWT used to authenticate the Client by private_key_jwt and client_secret_jwt. + introspection_endpoint_auth_signing_alg_values_supported?: [...string] @go(IntrospectionEndpointAuthSigningAlgValuesSupported,[]string) + + // DisplayValuesSupported contains a list of display parameter values that the OP supports (page, popup, touch, wap). + display_values_supported?: [...#Display] @go(DisplayValuesSupported,[]Display) + + // ClaimTypesSupported contains a list of Claim Types that the OP supports (normal, aggregated, distributed). If omitted, the default is normal Claims. + claim_types_supported?: [...string] @go(ClaimTypesSupported,[]string) + + // ClaimsSupported contains a list of Claim Names the OP may be able to supply values for. This list might not be exhaustive. + claims_supported?: [...string] @go(ClaimsSupported,[]string) + + // ClaimsParameterSupported specifies whether the OP supports use of the `claims` parameter. If omitted, the default is false. + claims_parameter_supported?: bool @go(ClaimsParameterSupported) + + // CodeChallengeMethodsSupported contains a list of Proof Key for Code Exchange (PKCE) code challenge methods supported by the OP. + code_challenge_methods_supported?: [...#CodeChallengeMethod] @go(CodeChallengeMethodsSupported,[]CodeChallengeMethod) + + // ServiceDocumentation is a URL where developers can get information about the OP and its usage. + service_documentation?: string @go(ServiceDocumentation) + + // ClaimsLocalesSupported contains a list of BCP47 language tag values that the OP supports for values of Claims returned. + claims_locales_supported?: #Locales @go(ClaimsLocalesSupported) + + // UILocalesSupported contains a list of BCP47 language tag values that the OP supports for the user interface. + ui_locales_supported?: #Locales @go(UILocalesSupported) + + // RequestParameterSupported specifies whether the OP supports use of the `request` parameter. If omitted, the default value is false. + request_parameter_supported?: bool @go(RequestParameterSupported) + + // RequestURIParameterSupported specifies whether the OP supports use of the `request_uri` parameter. If omitted, the default value is true. (therefore no omitempty) + request_uri_parameter_supported: bool @go(RequestURIParameterSupported) + + // RequireRequestURIRegistration specifies whether the OP requires any `request_uri` to be pre-registered using the request_uris registration parameter. If omitted, the default value is false. + require_request_uri_registration?: bool @go(RequireRequestURIRegistration) + + // OPPolicyURI is a URL the OP provides to the person registering the Client to read about the OP's requirements on how the RP can use the data provided by the OP. + op_policy_uri?: string @go(OPPolicyURI) + + // OPTermsOfServiceURI is a URL the OpenID Provider provides to the person registering the Client to read about OpenID Provider's terms of service. + op_tos_uri?: string @go(OPTermsOfServiceURI) + + // BackChannelLogoutSupported specifies whether the OP supports back-channel logout (https://openid.net/specs/openid-connect-backchannel-1_0.html), + // with true indicating support. If omitted, the default value is false. + backchannel_logout_supported?: bool @go(BackChannelLogoutSupported) + + // BackChannelLogoutSessionSupported specifies whether the OP can pass a sid (session ID) Claim in the Logout Token to identify the RP session with the OP. + // If supported, the sid Claim is also included in ID Tokens issued by the OP. If omitted, the default value is false. + backchannel_logout_session_supported?: bool @go(BackChannelLogoutSessionSupported) +} + +#AuthMethod: string // #enumAuthMethod + +#enumAuthMethod: + #AuthMethodBasic | + #AuthMethodPost | + #AuthMethodNone | + #AuthMethodPrivateKeyJWT + +#AuthMethodBasic: #AuthMethod & "client_secret_basic" +#AuthMethodPost: #AuthMethod & "client_secret_post" +#AuthMethodNone: #AuthMethod & "none" +#AuthMethodPrivateKeyJWT: #AuthMethod & "private_key_jwt" diff --git a/schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/error_go_gen.cue b/schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/error_go_gen.cue new file mode 100644 index 0000000..560cdd7 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/error_go_gen.cue @@ -0,0 +1,33 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/zitadel/oidc/v3/pkg/oidc + +package oidc + +_#errorType: string + +#InvalidRequest: _#errorType & "invalid_request" +#InvalidScope: _#errorType & "invalid_scope" +#InvalidClient: _#errorType & "invalid_client" +#InvalidGrant: _#errorType & "invalid_grant" +#UnauthorizedClient: _#errorType & "unauthorized_client" +#UnsupportedGrantType: _#errorType & "unsupported_grant_type" +#ServerError: _#errorType & "server_error" +#InteractionRequired: _#errorType & "interaction_required" +#LoginRequired: _#errorType & "login_required" +#RequestNotSupported: _#errorType & "request_not_supported" + +// Additional error codes as defined in +// https://www.rfc-editor.org/rfc/rfc8628#section-3.5 +// Device Access Token Response +#AuthorizationPending: _#errorType & "authorization_pending" +#SlowDown: _#errorType & "slow_down" +#AccessDenied: _#errorType & "access_denied" +#ExpiredToken: _#errorType & "expired_token" + +// InvalidTarget error is returned by Token Exchange if +// the requested target or audience is invalid. +// [RFC 8693, Section 2.2.2: Error Response](https://www.rfc-editor.org/rfc/rfc8693#section-2.2.2) +#InvalidTarget: _#errorType & "invalid_target" + +#Error: _ diff --git a/schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/introspection_go_gen.cue b/schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/introspection_go_gen.cue new file mode 100644 index 0000000..94db428 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/introspection_go_gen.cue @@ -0,0 +1,21 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/zitadel/oidc/v3/pkg/oidc + +package oidc + +#IntrospectionRequest: Token: string + +#ClientAssertionParams: { + ClientAssertion: string + ClientAssertionType: string +} + +// IntrospectionResponse implements RFC 7662, section 2.2 and +// OpenID Connect Core 1.0, section 5.1 (UserInfo). +// https://www.rfc-editor.org/rfc/rfc7662.html#section-2.2. +// https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims. +#IntrospectionResponse: _ + +// introspectionResponseAlias prevents loops on the JSON methods +_#introspectionResponseAlias: #IntrospectionResponse diff --git a/schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/jwt_profile_go_gen.cue b/schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/jwt_profile_go_gen.cue new file mode 100644 index 0000000..5bbcf98 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/jwt_profile_go_gen.cue @@ -0,0 +1,11 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/zitadel/oidc/v3/pkg/oidc + +package oidc + +#JWTProfileGrantRequest: { + Assertion: string + Scope: #SpaceDelimitedArray + GrantType: #GrantType +} diff --git a/schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/keyset_go_gen.cue b/schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/keyset_go_gen.cue new file mode 100644 index 0000000..753bf6f --- /dev/null +++ b/schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/keyset_go_gen.cue @@ -0,0 +1,13 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/zitadel/oidc/v3/pkg/oidc + +package oidc + +#KeyUseSignature: "sig" + +// KeySet represents a set of JSON Web Keys +// - remotely fetch via discovery and jwks_uri -> `remoteKeySet` +// - held by the OP itself in storage -> `openIDKeySet` +// - dynamically aggregated by request for OAuth JWT Profile Assertion -> `jwtProfileKeySet` +#KeySet: _ diff --git a/schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/revocation_go_gen.cue b/schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/revocation_go_gen.cue new file mode 100644 index 0000000..62cf2a9 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/revocation_go_gen.cue @@ -0,0 +1,10 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/zitadel/oidc/v3/pkg/oidc + +package oidc + +#RevocationRequest: { + Token: string + TokenTypeHint: string +} diff --git a/schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/session_go_gen.cue b/schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/session_go_gen.cue new file mode 100644 index 0000000..d4e47bd --- /dev/null +++ b/schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/session_go_gen.cue @@ -0,0 +1,16 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/zitadel/oidc/v3/pkg/oidc + +package oidc + +// EndSessionRequest for the RP-Initiated Logout according to: +// https://openid.net/specs/openid-connect-rpinitiated-1_0.html#RPLogout +#EndSessionRequest: { + IdTokenHint: string + LogoutHint: string + ClientID: string + PostLogoutRedirectURI: string + State: string + UILocales: #Locales +} diff --git a/schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/token_go_gen.cue b/schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/token_go_gen.cue new file mode 100644 index 0000000..7d7cd28 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/token_go_gen.cue @@ -0,0 +1,94 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/zitadel/oidc/v3/pkg/oidc + +package oidc + +import "golang.org/x/oauth2" + +// BearerToken defines the token_type `Bearer`, which is returned in a successful token response +#BearerToken: "Bearer" +#PrefixBearer: "Bearer " + +#Tokens: { + Token?: null | oauth2.#Token @go(,*oauth2.Token) + IDTokenClaims: #IDClaims @go(,C) + IDToken: string +} + +// TokenClaims contains the base Claims used all tokens. +// It implements OpenID Connect Core 1.0, section 2. +// https://openid.net/specs/openid-connect-core-1_0.html#IDToken +// And RFC 9068: JSON Web Token (JWT) Profile for OAuth 2.0 Access Tokens, +// section 2.2. https://datatracker.ietf.org/doc/html/rfc9068#name-data-structure +// +// TokenClaims implements the Claims interface, +// and can be used to extend larger claim types by embedding. +#TokenClaims: { + iss?: string @go(Issuer) + sub?: string @go(Subject) + aud?: #Audience @go(Audience) + exp?: #Time @go(Expiration) + iat?: #Time @go(IssuedAt) + auth_time?: #Time @go(AuthTime) + nbf?: #Time @go(NotBefore) + nonce?: string @go(Nonce) + acr?: string @go(AuthenticationContextClassReference) + amr?: #AuthenticationMethodsReferences @go(AuthenticationMethodsReferences) + azp?: string @go(AuthorizedParty) + client_id?: string @go(ClientID) + jti?: string @go(JWTID) + act?: null | #ActorClaims @go(Actor,*ActorClaims) +} + +#AccessTokenClaims: _ + +_#atcAlias: #AccessTokenClaims + +// IDTokenClaims extends TokenClaims by further implementing +// OpenID Connect Core 1.0, sections 3.1.3.6 (Code flow), +// 3.2.2.10 (implicit), 3.3.2.11 (Hybrid) and 5.1 (UserInfo). +// https://openid.net/specs/openid-connect-core-1_0.html#toc +#IDTokenClaims: _ + +_#itcAlias: #IDTokenClaims + +// ActorClaims provides the `act` claims used for impersonation or delegation Token Exchange. +// +// An actor can be nested in case an obtained token is used as actor token to obtain impersonation or delegation. +// This allows creating a chain of actors. +// See [RFC 8693, section 4.1](https://www.rfc-editor.org/rfc/rfc8693#name-act-actor-claim). +#ActorClaims: _ + +_#acAlias: #ActorClaims + +#AccessTokenResponse: { + access_token?: string @go(AccessToken) + token_type?: string @go(TokenType) + refresh_token?: string @go(RefreshToken) + expires_in?: uint64 @go(ExpiresIn) + id_token?: string @go(IDToken) + state?: string @go(State) + scope?: #SpaceDelimitedArray @go(Scope) +} + +#JWTProfileAssertionClaims: _ + +_#jpaAlias: #JWTProfileAssertionClaims + +#TokenExchangeResponse: { + access_token: string @go(AccessToken) + issued_token_type: #TokenType @go(IssuedTokenType) + token_type: string @go(TokenType) + expires_in?: uint64 @go(ExpiresIn) + scope?: #SpaceDelimitedArray @go(Scopes) + refresh_token?: string @go(RefreshToken) + + // IDToken field allows returning an additional ID token + // if the requested_token_type was Access Token and scope contained openid. + id_token?: string @go(IDToken) +} + +#LogoutTokenClaims: _ + +_#ltcAlias: #LogoutTokenClaims diff --git a/schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/token_request_go_gen.cue b/schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/token_request_go_gen.cue new file mode 100644 index 0000000..43fcc71 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/token_request_go_gen.cue @@ -0,0 +1,102 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/zitadel/oidc/v3/pkg/oidc + +package oidc + +// GrantTypeCode defines the grant_type `authorization_code` used for the Token Request in the Authorization Code Flow +#GrantTypeCode: #GrantType & "authorization_code" + +// GrantTypeRefreshToken defines the grant_type `refresh_token` used for the Token Request in the Refresh Token Flow +#GrantTypeRefreshToken: #GrantType & "refresh_token" + +// GrantTypeClientCredentials defines the grant_type `client_credentials` used for the Token Request in the Client Credentials Token Flow +#GrantTypeClientCredentials: #GrantType & "client_credentials" + +// GrantTypeBearer defines the grant_type `urn:ietf:params:oauth:grant-type:jwt-bearer` used for the JWT Authorization Grant +#GrantTypeBearer: #GrantType & "urn:ietf:params:oauth:grant-type:jwt-bearer" + +// GrantTypeTokenExchange defines the grant_type `urn:ietf:params:oauth:grant-type:token-exchange` used for the OAuth Token Exchange Grant +#GrantTypeTokenExchange: #GrantType & "urn:ietf:params:oauth:grant-type:token-exchange" + +// GrantTypeImplicit defines the grant type `implicit` used for implicit flows that skip the generation and exchange of an Authorization Code +#GrantTypeImplicit: #GrantType & "implicit" + +// GrantTypeDeviceCode +#GrantTypeDeviceCode: #GrantType & "urn:ietf:params:oauth:grant-type:device_code" + +// ClientAssertionTypeJWTAssertion defines the client_assertion_type `urn:ietf:params:oauth:client-assertion-type:jwt-bearer` +// used for the OAuth JWT Profile Client Authentication +#ClientAssertionTypeJWTAssertion: "urn:ietf:params:oauth:client-assertion-type:jwt-bearer" + +#GrantType: string // #enumGrantType + +#enumGrantType: + #GrantTypeCode | + #GrantTypeRefreshToken | + #GrantTypeClientCredentials | + #GrantTypeBearer | + #GrantTypeTokenExchange | + #GrantTypeImplicit | + #GrantTypeDeviceCode + +#AccessTokenType: #TokenType & "urn:ietf:params:oauth:token-type:access_token" +#RefreshTokenType: #TokenType & "urn:ietf:params:oauth:token-type:refresh_token" +#IDTokenType: #TokenType & "urn:ietf:params:oauth:token-type:id_token" +#JWTTokenType: #TokenType & "urn:ietf:params:oauth:token-type:jwt" + +#TokenType: string // #enumTokenType + +#enumTokenType: + #AccessTokenType | + #RefreshTokenType | + #IDTokenType | + #JWTTokenType + +#TokenRequest: _ + +#TokenRequestType: #GrantType + +#AccessTokenRequest: { + Code: string + RedirectURI: string + ClientID: string + ClientSecret: string + CodeVerifier: string + ClientAssertion: string + ClientAssertionType: string +} + +// RefreshTokenRequest is not useful for making refresh requests because the +// grant_type is not included explicitly but rather implied. +#RefreshTokenRequest: { + RefreshToken: string + Scopes: #SpaceDelimitedArray + ClientID: string + ClientSecret: string + ClientAssertion: string + ClientAssertionType: string +} + +#JWTTokenRequest: _ + +#TokenExchangeRequest: { + GrantType: #GrantType + SubjectToken: string + SubjectTokenType: #TokenType + ActorToken: string + ActorTokenType: #TokenType + Resource: [...string] @go(,[]string) + Audience: #Audience + Scopes: #SpaceDelimitedArray + RequestedTokenType: #TokenType +} + +#ClientCredentialsRequest: { + GrantType: #GrantType + Scope: #SpaceDelimitedArray + ClientID: string + ClientSecret: string + ClientAssertion: string + ClientAssertionType: string +} diff --git a/schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/types_go_gen.cue b/schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/types_go_gen.cue new file mode 100644 index 0000000..c2675d6 --- /dev/null +++ b/schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/types_go_gen.cue @@ -0,0 +1,51 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/zitadel/oidc/v3/pkg/oidc + +package oidc + +#Audience: _ + +#AuthenticationMethodsReferences: _ + +#Display: string // #enumDisplay + +#enumDisplay: + #DisplayPage | + #DisplayPopup | + #DisplayTouch | + #DisplayWAP + +#Gender: string + +#Locale: _ + +#Locales: _ + +#MaxAge: uint + +#SpaceDelimitedArray: _ + +#Prompt: #SpaceDelimitedArray + +#ResponseType: string // #enumResponseType + +#enumResponseType: + #ResponseTypeCode | + #ResponseTypeIDToken | + #ResponseTypeIDTokenOnly + +#ResponseMode: string // #enumResponseMode + +#enumResponseMode: + #ResponseModeQuery | + #ResponseModeFragment | + #ResponseModeFormPost + +#Time: _ + +#RequestObject: { + iss: string @go(Issuer) + aud: #Audience @go(Audience) + AuthRequest: #AuthRequest +} diff --git a/schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/userinfo_go_gen.cue b/schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/userinfo_go_gen.cue new file mode 100644 index 0000000..f1ea71c --- /dev/null +++ b/schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/userinfo_go_gen.cue @@ -0,0 +1,51 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/zitadel/oidc/v3/pkg/oidc + +package oidc + +#Bool: _ + +// UserInfo implements OpenID Connect Core 1.0, section 5.1. +// https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims. +#UserInfo: _ + +_#uiAlias: #UserInfo + +#UserInfoProfile: { + name?: string @go(Name) + given_name?: string @go(GivenName) + family_name?: string @go(FamilyName) + middle_name?: string @go(MiddleName) + nickname?: string @go(Nickname) + profile?: string @go(Profile) + picture?: string @go(Picture) + website?: string @go(Website) + gender?: #Gender @go(Gender) + birthdate?: string @go(Birthdate) + zoneinfo?: string @go(Zoneinfo) + locale?: null | #Locale @go(Locale,*Locale) + updated_at?: #Time @go(UpdatedAt) + preferred_username?: string @go(PreferredUsername) +} + +#UserInfoEmail: { + email?: string @go(Email) + email_verified?: #Bool @go(EmailVerified) +} + +#UserInfoPhone: { + phone_number?: string @go(PhoneNumber) + phone_number_verified?: #Bool @go(PhoneNumberVerified) +} + +#UserInfoAddress: { + formatted?: string @go(Formatted) + street_address?: string @go(StreetAddress) + locality?: string @go(Locality) + region?: string @go(Region) + postal_code?: string @go(PostalCode) + country?: string @go(Country) +} + +#UserInfoRequest: AccessToken: string diff --git a/schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/verifier_go_gen.cue b/schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/verifier_go_gen.cue new file mode 100644 index 0000000..5d0ecfe --- /dev/null +++ b/schemas/cue.mod/gen/github.com/zitadel/oidc/v3/pkg/oidc/verifier_go_gen.cue @@ -0,0 +1,24 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go github.com/zitadel/oidc/v3/pkg/oidc + +package oidc + +#Claims: _ + +#ClaimsSignature: _ + +#IDClaims: _ + +// Verifier caries configuration for the various token verification +// functions. Use package specific constructor functions to know +// which values need to be set. +#Verifier: { + Issuer: string + MaxAgeIAT: int @go(,time.Duration) + Offset: int @go(,time.Duration) + ClientID: string + SupportedSignAlgs: [...string] @go(,[]string) + MaxAge: int @go(,time.Duration) + KeySet: #KeySet +} diff --git a/schemas/cue.mod/gen/golang.org/x/oauth2/deviceauth_go_gen.cue b/schemas/cue.mod/gen/golang.org/x/oauth2/deviceauth_go_gen.cue new file mode 100644 index 0000000..4570e47 --- /dev/null +++ b/schemas/cue.mod/gen/golang.org/x/oauth2/deviceauth_go_gen.cue @@ -0,0 +1,14 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go golang.org/x/oauth2 + +package oauth2 + +_#errAuthorizationPending: "authorization_pending" +_#errSlowDown: "slow_down" +_#errAccessDenied: "access_denied" +_#errExpiredToken: "expired_token" + +// DeviceAuthResponse describes a successful RFC 8628 Device Authorization Response +// https://datatracker.ietf.org/doc/html/rfc8628#section-3.2 +#DeviceAuthResponse: _ diff --git a/schemas/cue.mod/gen/golang.org/x/oauth2/oauth2_go_gen.cue b/schemas/cue.mod/gen/golang.org/x/oauth2/oauth2_go_gen.cue new file mode 100644 index 0000000..4b7891f --- /dev/null +++ b/schemas/cue.mod/gen/golang.org/x/oauth2/oauth2_go_gen.cue @@ -0,0 +1,82 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go golang.org/x/oauth2 + +// Package oauth2 provides support for making +// OAuth2 authorized and authenticated HTTP requests, +// as specified in RFC 6749. +// It can additionally grant authorization with Bearer JWT. +package oauth2 + +// Config describes a typical 3-legged OAuth2 flow, with both the +// client application information and the server's endpoint URLs. +// For the client credentials 2-legged OAuth2 flow, see the +// [golang.org/x/oauth2/clientcredentials] package. +#Config: { + // ClientID is the application's ID. + ClientID: string + + // ClientSecret is the application's secret. + ClientSecret: string + + // Endpoint contains the authorization server's token endpoint + // URLs. These are constants specific to each server and are + // often available via site-specific packages, such as + // google.Endpoint or github.Endpoint. + Endpoint: #Endpoint + + // RedirectURL is the URL to redirect users going through + // the OAuth flow, after the resource owner's URLs. + RedirectURL: string + + // Scopes specifies optional requested permissions. + Scopes: [...string] @go(,[]string) +} + +// A TokenSource is anything that can return a token. +#TokenSource: _ + +// Endpoint represents an OAuth 2.0 provider's authorization and token +// endpoint URLs. +#Endpoint: { + AuthURL: string + DeviceAuthURL: string + TokenURL: string + + // AuthStyle optionally specifies how the endpoint wants the + // client ID & client secret sent. The zero value means to + // auto-detect. + AuthStyle: #AuthStyle +} + +// AuthStyle represents how requests for tokens are authenticated +// to the server. +#AuthStyle: int // #enumAuthStyle + +#enumAuthStyle: + #AuthStyleAutoDetect | + #AuthStyleInParams | + #AuthStyleInHeader + +#values_AuthStyle: { + AuthStyleAutoDetect: #AuthStyleAutoDetect + AuthStyleInParams: #AuthStyleInParams + AuthStyleInHeader: #AuthStyleInHeader +} + +// AuthStyleAutoDetect means to auto-detect which authentication +// style the provider wants by trying both ways and caching +// the successful way for the future. +#AuthStyleAutoDetect: #AuthStyle & 0 + +// AuthStyleInParams sends the "client_id" and "client_secret" +// in the POST body as application/x-www-form-urlencoded parameters. +#AuthStyleInParams: #AuthStyle & 1 + +// AuthStyleInHeader sends the client_id and client_secret +// using HTTP Basic Authorization. This is an optional style +// described in the OAuth2 RFC 6749 section 2.3.1. +#AuthStyleInHeader: #AuthStyle & 2 + +// An AuthCodeOption is passed to Config.AuthCodeURL. +#AuthCodeOption: _ diff --git a/schemas/cue.mod/gen/golang.org/x/oauth2/pkce_go_gen.cue b/schemas/cue.mod/gen/golang.org/x/oauth2/pkce_go_gen.cue new file mode 100644 index 0000000..429aae3 --- /dev/null +++ b/schemas/cue.mod/gen/golang.org/x/oauth2/pkce_go_gen.cue @@ -0,0 +1,9 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go golang.org/x/oauth2 + +package oauth2 + +_#codeChallengeKey: "code_challenge" +_#codeChallengeMethodKey: "code_challenge_method" +_#codeVerifierKey: "code_verifier" diff --git a/schemas/cue.mod/gen/golang.org/x/oauth2/token_go_gen.cue b/schemas/cue.mod/gen/golang.org/x/oauth2/token_go_gen.cue new file mode 100644 index 0000000..69f65e2 --- /dev/null +++ b/schemas/cue.mod/gen/golang.org/x/oauth2/token_go_gen.cue @@ -0,0 +1,65 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go golang.org/x/oauth2 + +package oauth2 + +import "time" + +_#defaultExpiryDelta: int & 10000000000 + +// Token represents the credentials used to authorize +// the requests to access protected resources on the OAuth 2.0 +// provider's backend. +// +// Most users of this package should not access fields of Token +// directly. They're exported mostly for use by related packages +// implementing derivative OAuth2 flows. +#Token: { + // AccessToken is the token that authorizes and authenticates + // the requests. + access_token: string @go(AccessToken) + + // TokenType is the type of token. + // The Type method returns either this or "Bearer", the default. + token_type?: string @go(TokenType) + + // RefreshToken is a token that's used by the application + // (as opposed to the user) to refresh the access token + // if it expires. + refresh_token?: string @go(RefreshToken) + + // Expiry is the optional expiration time of the access token. + // + // If zero, [TokenSource] implementations will reuse the same + // token forever and RefreshToken or equivalent + // mechanisms for that TokenSource will not be used. + expiry?: time.Time @go(Expiry) + + // ExpiresIn is the OAuth2 wire format "expires_in" field, + // which specifies how many seconds later the token expires, + // relative to an unknown time base approximately around "now". + // It is the application's responsibility to populate + // `Expiry` from `ExpiresIn` when required. + expires_in?: int64 @go(ExpiresIn) +} + +// RetrieveError is the error returned when the token endpoint returns a +// non-2XX HTTP status code or populates RFC 6749's 'error' parameter. +// https://datatracker.ietf.org/doc/html/rfc6749#section-5.2 +#RetrieveError: { + Response?: null | _ @go(,*http.Response) + + // Body is the body that was consumed by reading Response.Body. + // It may be truncated. + Body: bytes @go(,[]byte) + + // ErrorCode is RFC 6749's 'error' parameter. + ErrorCode: string + + // ErrorDescription is RFC 6749's 'error_description' parameter. + ErrorDescription: string + + // ErrorURI is RFC 6749's 'error_uri' parameter. + ErrorURI: string +} diff --git a/schemas/cue.mod/gen/golang.org/x/oauth2/transport_go_gen.cue b/schemas/cue.mod/gen/golang.org/x/oauth2/transport_go_gen.cue new file mode 100644 index 0000000..842dd07 --- /dev/null +++ b/schemas/cue.mod/gen/golang.org/x/oauth2/transport_go_gen.cue @@ -0,0 +1,21 @@ +// Code generated by cue get go. DO NOT EDIT. + +//cue:generate cue get go golang.org/x/oauth2 + +package oauth2 + +// Transport is an [http.RoundTripper] that makes OAuth 2.0 HTTP requests, +// wrapping a base [http.RoundTripper] and adding an Authorization header +// with a token from the supplied [TokenSource]. +// +// Transport is a low-level mechanism. Most code will use the +// higher-level [Config.Client] method instead. +#Transport: { + // Source supplies the token to add to outgoing requests' + // Authorization headers. + Source: #TokenSource + + // Base is the base RoundTripper used to make HTTP requests. + // If nil, http.DefaultTransport is used. + Base: _ @go(,http.RoundTripper) +} diff --git a/schemas/embed.go b/schemas/embed.go index ffcb013..51e4848 100644 --- a/schemas/embed.go +++ b/schemas/embed.go @@ -20,7 +20,7 @@ const ( embeddedModuleDir = "imgcli-schemas-embedded" ) -//go:embed cue.mod/module.cue *.cue core/*.cue providers/*/*.cue +//go:embed cue.mod/module.cue cue.mod/gen *.cue core/*.cue providers/*/*.cue var embeddedModule embed.FS // ModuleFS returns the embedded CUE module files. diff --git a/schemas/embed_test.go b/schemas/embed_test.go index a3e6804..3253f47 100644 --- a/schemas/embed_test.go +++ b/schemas/embed_test.go @@ -7,6 +7,8 @@ import ( "cuelang.org/go/cue" "cuelang.org/go/cue/cuecontext" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) func TestModuleFS(t *testing.T) { @@ -168,3 +170,133 @@ incusos: variants: default: { }) } } + +func TestIncusOSSeedSchema(t *testing.T) { + ctx := cuecontext.New() + + schema, err := ConfigSchema(ctx) + require.NoError(t, err) + + input := ctx.CompileString(` +apiVersion: "imgcli.meigma.io/v0alpha1" +kind: "ImagePlan" +image: name: "test-image" +incusos: { + seed: { + install: {} + applications: applications: [ + {name: "incus"}, + {name: "incus-ceph"}, + {name: "incus-linstor"}, + {name: "migration-manager"}, + {name: "operations-center"}, + ] + } + variants: default: artifact: { + architecture: "amd64" + format: "raw" + } +} +`) + require.NoError(t, input.Err()) + + value := schema.Unify(input) + require.NoError(t, value.Validate(cue.Concrete(false))) + + var config Config + require.NoError(t, value.Decode(&config)) + require.NotNil(t, config.Incusos) + require.NotNil(t, config.Incusos.Seed) + require.NotNil(t, config.Incusos.Seed.Install) + require.NotNil(t, config.Incusos.Seed.Applications) + + assert.Equal(t, "1", config.Incusos.Seed.Install.Version) + assert.False(t, config.Incusos.Seed.Install.ForceInstall) + assert.False(t, config.Incusos.Seed.Install.ForceReboot) + assert.Equal(t, "1", config.Incusos.Seed.Applications.Version) + assert.Len(t, config.Incusos.Seed.Applications.Applications, 5) +} + +func TestIncusOSSeedValidation(t *testing.T) { + tests := []struct { + name string + seed string + }{ + { + name: "invalid application name", + seed: ` +applications: applications: [{name: "debug"}] +`, + }, + { + name: "invalid install target sort order", + seed: ` +install: target: sort_order: "middle" +`, + }, + { + name: "invalid update channel", + seed: ` +update: { + channel: "edge" + check_frequency: "6h" +} +`, + }, + { + name: "install security degraded modes are mutually exclusive", + seed: ` +install: security: { + missing_tpm: true + missing_secure_boot: true +} +`, + }, + { + name: "invalid incus preseed field", + seed: ` +incus: preseed: unknown_field: true +`, + }, + { + name: "invalid migration manager preseed field", + seed: ` +"migration-manager": preseed: unknown_field: true +`, + }, + { + name: "invalid operations center preseed field", + seed: ` +"operations-center": preseed: unknown_field: true +`, + }, + } + + ctx := cuecontext.New() + + schema, err := ConfigSchema(ctx) + require.NoError(t, err) + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + input := ctx.CompileString(` +apiVersion: "imgcli.meigma.io/v0alpha1" +kind: "ImagePlan" +image: name: "test-image" +incusos: { + seed: { +` + tt.seed + ` + } + variants: default: artifact: { + architecture: "amd64" + format: "raw" + } +} +`) + require.NoError(t, input.Err()) + + value := schema.Unify(input) + require.Error(t, value.Validate(cue.Concrete(false))) + }) + } +} diff --git a/schemas/go.mod b/schemas/go.mod index 52dae11..e5a9b9e 100644 --- a/schemas/go.mod +++ b/schemas/go.mod @@ -1,25 +1,39 @@ module github.com/meigma/imgcli/schemas -go 1.26 +go 1.26.1 -require cuelang.org/go v0.16.1 +require ( + cuelang.org/go v0.16.1 + github.com/lxc/incus-os/incus-osd v0.0.0-20260505023852-d32ba1f13f6f + github.com/stretchr/testify v1.11.1 +) require ( cuelabs.dev/go/oci/ociregistry v0.0.0-20251212221603-3adeb8663819 // indirect + github.com/FuturFusion/migration-manager v0.6.9 // indirect + github.com/FuturFusion/operations-center v0.5.8 // indirect github.com/cockroachdb/apd/v3 v3.2.1 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/emicklei/proto v1.14.3 // indirect + github.com/go-jose/go-jose/v4 v4.1.4 // indirect github.com/google/uuid v1.6.0 // indirect + github.com/lxc/incus/v7 v7.0.0 // indirect github.com/mitchellh/go-wordwrap v1.0.1 // indirect + github.com/muhlemmer/gu v0.3.1 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.1 // indirect - github.com/pelletier/go-toml/v2 v2.2.4 // indirect + github.com/pelletier/go-toml/v2 v2.3.0 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/protocolbuffers/txtpbfmt v0.0.0-20260217160748-a481f6a22f94 // indirect github.com/rogpeppe/go-internal v1.14.1 // indirect + github.com/zitadel/oidc/v3 v3.47.5 // indirect + github.com/zitadel/schema v1.3.2 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect - golang.org/x/net v0.52.0 // indirect + golang.org/x/net v0.53.0 // indirect golang.org/x/oauth2 v0.36.0 // indirect golang.org/x/sync v0.20.0 // indirect - golang.org/x/text v0.35.0 // indirect - google.golang.org/protobuf v1.33.0 // indirect + golang.org/x/text v0.36.0 // indirect + google.golang.org/protobuf v1.36.11 // indirect gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/schemas/go.sum b/schemas/go.sum index f72201d..3f75caa 100644 --- a/schemas/go.sum +++ b/schemas/go.sum @@ -2,10 +2,18 @@ cuelabs.dev/go/oci/ociregistry v0.0.0-20251212221603-3adeb8663819 h1:Zh+Ur3OsoWp cuelabs.dev/go/oci/ociregistry v0.0.0-20251212221603-3adeb8663819/go.mod h1:WjmQxb+W6nVNCgj8nXrF24lIz95AHwnSl36tpjDZSU8= cuelang.org/go v0.16.1 h1:iPN1lHZd2J0hjcr8hfq9PnIGk7VfPkKFfxH4de+m9sE= cuelang.org/go v0.16.1/go.mod h1:/aW3967FeWC5Hc1cDrN4Z4ICVApdMi83wO5L3uF/1hM= +github.com/FuturFusion/migration-manager v0.6.9 h1:qf/EtxaasNhSNgM2yv6R53h4yJbA7Gd/Pjlvc3s642A= +github.com/FuturFusion/migration-manager v0.6.9/go.mod h1:Si7dBSilhF7FIbaYMG+V804C0ESIm7t6pF2x8es3IOk= +github.com/FuturFusion/operations-center v0.5.8 h1:Wf5B3ULMzSqju1u7wVgZbyJWHGd/QYOjNygr//hvPto= +github.com/FuturFusion/operations-center v0.5.8/go.mod h1:jmh2YszsUl3Mi5pyZnzndZZykImGJEUgtK+dzAiFFos= github.com/cockroachdb/apd/v3 v3.2.1 h1:U+8j7t0axsIgvQUqthuNm82HIrYXodOV2iWLWtEaIwg= github.com/cockroachdb/apd/v3 v3.2.1/go.mod h1:klXJcjp+FffLTHlhIG69tezTDvdP065naDsHzKhYSqc= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/emicklei/proto v1.14.3 h1:zEhlzNkpP8kN6utonKMzlPfIvy82t5Kb9mufaJxSe1Q= github.com/emicklei/proto v1.14.3/go.mod h1:rn1FgRS/FANiZdD2djyH7TMA9jdRDcYQ9IEN9yvjX0A= +github.com/go-jose/go-jose/v4 v4.1.4 h1:moDMcTHmvE6Groj34emNPLs/qtYXRVcd6S7NHbHz3kA= +github.com/go-jose/go-jose/v4 v4.1.4/go.mod h1:x4oUasVrzR7071A4TnHLGSPpNOm2a21K9Kf04k1rs08= github.com/go-quicktest/qt v1.101.0 h1:O1K29Txy5P2OK0dGo59b7b0LR6wKfIhttaAhHUyn7eI= github.com/go-quicktest/qt v1.101.0/go.mod h1:14Bz/f7NwaXPtdYEgzsx46kqSxVwTbzVZsDC26tQJow= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= @@ -20,35 +28,54 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0 github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/lxc/incus-os/incus-osd v0.0.0-20260505023852-d32ba1f13f6f h1:2wNTDCa/sf8xUOjfDHglPUpj5W4UncvuGKH3w6w/QSU= +github.com/lxc/incus-os/incus-osd v0.0.0-20260505023852-d32ba1f13f6f/go.mod h1:0/gjLA2CMoYq0N93elIlQ6+tBMwtBtE8Rr2BWgQRB/c= +github.com/lxc/incus/v7 v7.0.0 h1:xLz1Q1Xk+yCNL148MFBOSWWrzJVOS1N6PcS0zd8usSc= +github.com/lxc/incus/v7 v7.0.0/go.mod h1:Dxu4id/fVr+OmFPQt9tU3fu4E8LhW89NeFxCtjPLCdo= github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= +github.com/muhlemmer/gu v0.3.1 h1:7EAqmFrW7n3hETvuAdmFmn4hS8W+z3LgKtrnow+YzNM= +github.com/muhlemmer/gu v0.3.1/go.mod h1:YHtHR+gxM+bKEIIs7Hmi9sPT3ZDUvTN/i88wQpZkrdM= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.1 h1:y0fUlFfIZhPF1W537XOLg0/fcx6zcHCJwooC2xJA040= github.com/opencontainers/image-spec v1.1.1/go.mod h1:qpqAh3Dmcf36wStyyWU+kCeDgrGnAve2nCC8+7h8Q0M= -github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4= -github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY= +github.com/pelletier/go-toml/v2 v2.3.0 h1:k59bC/lIZREW0/iVaQR8nDHxVq8OVlIzYCOJf421CaM= +github.com/pelletier/go-toml/v2 v2.3.0/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/protocolbuffers/txtpbfmt v0.0.0-20260217160748-a481f6a22f94 h1:2PC6Ql3jipz1KvBlqUHjjk6v4aMwE86mfDu1XMH0LR8= github.com/protocolbuffers/txtpbfmt v0.0.0-20260217160748-a481f6a22f94/go.mod h1:JSbkp0BviKovYYt9XunS95M3mLPibE9bGg+Y95DsEEY= github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= +github.com/zitadel/oidc/v3 v3.47.5 h1:cR2z0oqa5XZkwpXQiPCUGqKtndrjHgEXb81y3oXocK4= +github.com/zitadel/oidc/v3 v3.47.5/go.mod h1:XxFh0666HRXycyrKmono+3gY0RACpYJLgy4r/+kliKY= +github.com/zitadel/schema v1.3.2 h1:gfJvt7dOMfTmxzhscZ9KkapKo3Nei3B6cAxjav+lyjI= +github.com/zitadel/schema v1.3.2/go.mod h1:IZmdfF9Wu62Zu6tJJTH3UsArevs3Y4smfJIj3L8fzxw= go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= -golang.org/x/mod v0.34.0 h1:xIHgNUUnW6sYkcM5Jleh05DvLOtwc6RitGHbDk4akRI= -golang.org/x/mod v0.34.0/go.mod h1:ykgH52iCZe79kzLLMhyCUzhMci+nQj+0XkbXpNYtVjY= -golang.org/x/net v0.52.0 h1:He/TN1l0e4mmR3QqHMT2Xab3Aj3L9qjbhRm78/6jrW0= -golang.org/x/net v0.52.0/go.mod h1:R1MAz7uMZxVMualyPXb+VaqGSa3LIaUqk0eEt3w36Sw= +go.yaml.in/yaml/v4 v4.0.0-rc.4 h1:UP4+v6fFrBIb1l934bDl//mmnoIZEDK0idg1+AIvX5U= +go.yaml.in/yaml/v4 v4.0.0-rc.4/go.mod h1:aZqd9kCMsGL7AuUv/m/PvWLdg5sjJsZ4oHDEnfPPfY0= +golang.org/x/mod v0.35.0 h1:Ww1D637e6Pg+Zb2KrWfHQUnH2dQRLBQyAtpr/haaJeM= +golang.org/x/mod v0.35.0/go.mod h1:+GwiRhIInF8wPm+4AoT6L0FA1QWAad3OMdTRx4tFYlU= +golang.org/x/net v0.53.0 h1:d+qAbo5L0orcWAr0a9JweQpjXF19LMXJE8Ey7hwOdUA= +golang.org/x/net v0.53.0/go.mod h1:JvMuJH7rrdiCfbeHoo3fCQU24Lf5JJwT9W3sJFulfgs= golang.org/x/oauth2 v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs= golang.org/x/oauth2 v0.36.0/go.mod h1:YDBUJMTkDnJS+A4BP4eZBjCqtokkg1hODuPjwiGPO7Q= golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4= golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= -golang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo= -golang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= -golang.org/x/text v0.35.0 h1:JOVx6vVDFokkpaq1AEptVzLTpDe9KGpj5tR4/X+ybL8= -golang.org/x/text v0.35.0/go.mod h1:khi/HExzZJ2pGnjenulevKNX1W67CUy0AsXcNubPGCA= -golang.org/x/tools v0.43.0 h1:12BdW9CeB3Z+J/I/wj34VMl8X+fEXBxVR90JeMX5E7s= -golang.org/x/tools v0.43.0/go.mod h1:uHkMso649BX2cZK6+RpuIPXS3ho2hZo4FVwfoy1vIk0= -google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= -google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +golang.org/x/sys v0.43.0 h1:Rlag2XtaFTxp19wS8MXlJwTvoh8ArU6ezoyFsMyCTNI= +golang.org/x/sys v0.43.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/text v0.36.0 h1:JfKh3XmcRPqZPKevfXVpI1wXPTqbkE5f7JA92a55Yxg= +golang.org/x/text v0.36.0/go.mod h1:NIdBknypM8iqVmPiuco0Dh6P5Jcdk8lJL0CUebqK164= +golang.org/x/tools v0.44.0 h1:UP4ajHPIcuMjT1GqzDWRlalUEoY+uzoZKnhOjbIPD2c= +golang.org/x/tools v0.44.0/go.mod h1:KA0AfVErSdxRZIsOVipbv3rQhVXTnlU6UhKxHd1seDI= +google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= +google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/schemas/providers/incusos/cue_types_gen.go b/schemas/providers/incusos/cue_types_gen.go index c2d6ffb..f2ffe14 100644 --- a/schemas/providers/incusos/cue_types_gen.go +++ b/schemas/providers/incusos/cue_types_gen.go @@ -3,6 +3,7 @@ package incusos import ( + "github.com/lxc/incus-os/incus-osd/api/seed" "github.com/meigma/imgcli/schemas/core" ) @@ -10,6 +11,34 @@ type Channel string type Version string +// Seed defines the IncusOS seed files to include in a seed archive. +// Each populated field is serialized to the corresponding .yaml file. +type Seed struct { + // Install configures install.yaml for installer behavior. + Install *seed.Install `json:"install,omitempty"` + + // Applications configures applications.yaml for bundled IncusOS apps. + Applications *seed.Applications `json:"applications,omitempty"` + + // Incus configures incus.yaml for Incus preseed behavior. + Incus *seed.Incus `json:"incus,omitempty"` + + // Network configures network.yaml for system network settings. + Network *seed.Network `json:"network,omitempty"` + + // Provider configures provider.yaml for configuration provider settings. + Provider *seed.Provider `json:"provider,omitempty"` + + // Update configures update.yaml for system update policy. + Update *seed.Update `json:"update,omitempty"` + + // MigrationManager configures migration-manager.yaml. + MigrationManager *seed.MigrationManager `json:"migration-manager,omitempty"` + + // OperationsCenter configures operations-center.yaml. + OperationsCenter *seed.OperationsCenter `json:"operations-center,omitempty"` +} + type Source struct { // Release channel to select from the IncusOS image catalog. Channel Channel `json:"channel,omitempty"` @@ -33,5 +62,8 @@ type Variant struct { type Config struct { Defaults *Defaults `json:"defaults,omitempty"` + // Seed defines IncusOS install seed files to embed in customized images. + Seed *Seed `json:"seed,omitempty"` + Variants map[core.VariantName]Variant `json:"variants"` } diff --git a/schemas/providers/incusos/schema.cue b/schemas/providers/incusos/schema.cue index b80ce53..c490270 100644 --- a/schemas/providers/incusos/schema.cue +++ b/schemas/providers/incusos/schema.cue @@ -1,11 +1,171 @@ package incusos -import "github.com/meigma/imgcli/schemas/core" +import ( + "github.com/lxc/incus-os/incus-osd/api/seed" + "github.com/meigma/imgcli/schemas/core" +) #Channel: "stable" | "testing" | error("IncusOS source channel must be one of: stable, testing") #Version: =~"^[0-9]{12}$" | error("IncusOS source version must be a 12 digit release timestamp") +// Seed file format version. IncusOS currently expects "1". +#SeedVersion: *"1" | string @go(-) + +// SeedApplicationName is the set of IncusOS applications supported by the +// upstream applications seed file. +#SeedApplicationName: "incus" | "incus-ceph" | "incus-linstor" | "migration-manager" | "operations-center" | error("IncusOS seed application must be one of: incus, incus-ceph, incus-linstor, migration-manager, operations-center") @go(-) + +// SeedInstallSortOrder selects the target install disk by capacity when more +// than one candidate disk matches the other install target filters. +#SeedInstallSortOrder: "smallest" | "largest" | error("IncusOS install target sort_order must be one of: smallest, largest") @go(-) + +// SeedInstallSecurity permits explicitly degraded install security modes. +// Only one degraded-security option may be enabled at a time. +#SeedInstallSecurity: seed.#InstallSecurity & { + @go(-) + + // missing_tpm allows installation without a physical TPM. + missing_tpm: *false | bool + // missing_secure_boot allows installation without Secure Boot. + missing_secure_boot: *false | bool + + if missing_tpm { + missing_secure_boot: false | error("IncusOS install security cannot set both missing_tpm and missing_secure_boot") + } + if missing_secure_boot { + missing_tpm: false | error("IncusOS install security cannot set both missing_tpm and missing_secure_boot") + } +} + +// SeedInstallTarget selects the disk to receive the IncusOS installation. +#SeedInstallTarget: seed.#InstallTarget & { + @go(-) + + // sort_order chooses the smallest or largest matching install target. + sort_order?: #SeedInstallSortOrder +} + +// SeedInstall configures the install.yaml seed file. +#SeedInstall: seed.#Install & { + @go(-) + + // version is the IncusOS install seed format version. + version: #SeedVersion + // force_install ignores existing data on the target install disk. + force_install: *false | bool + // force_reboot reboots automatically after installation completes. + force_reboot: *false | bool + // security opts into degraded security modes for constrained hardware. + security?: null | #SeedInstallSecurity + // target filters the disk selected for installation. + target?: null | #SeedInstallTarget +} + +// SeedApplications configures the applications.yaml seed file. +#SeedApplications: seed.#Applications & { + @go(-) + + // version is the IncusOS applications seed format version. + version: #SeedVersion + // applications lists the IncusOS applications to enable. + applications: [...seed.#Application & { + // name identifies an upstream-supported IncusOS application. + name: #SeedApplicationName + }] +} + +// SeedIncus configures the incus.yaml seed file. +#SeedIncus: { + @go(-) + + // version is the IncusOS Incus seed format version. + version: #SeedVersion + // apply_defaults asks IncusOS to apply upstream Incus defaults. + apply_defaults: *false | bool + // preseed is passed through to Incus init preseed handling. + preseed?: (seed.#Incus & {preseed: _}).preseed @go(-) +} + +// SeedMigrationManager configures the migration-manager.yaml seed file. +#SeedMigrationManager: { + @go(-) + + // version is the Migration Manager seed format version. + version: #SeedVersion + // trusted_client_certificates lists PEM-encoded client certificates. + trusted_client_certificates?: [...string] + // apply_defaults asks IncusOS to apply upstream Migration Manager defaults. + apply_defaults: *false | bool + // preseed is passed through to Migration Manager preseed handling. + preseed?: (seed.#MigrationManager & {preseed: _}).preseed @go(-) +} + +// SeedOperationsCenter configures the operations-center.yaml seed file. +#SeedOperationsCenter: { + @go(-) + + // version is the Operations Center seed format version. + version: #SeedVersion + // trusted_client_certificates lists PEM-encoded client certificates. + trusted_client_certificates?: [...string] + // apply_defaults asks IncusOS to apply upstream Operations Center defaults. + apply_defaults: *false | bool + // preseed is passed through to Operations Center preseed handling. + preseed?: (seed.#OperationsCenter & {preseed: _}).preseed @go(-) +} + +// SeedNetwork configures the network.yaml seed file. +#SeedNetwork: seed.#Network & { + @go(-) + + // version is the IncusOS network seed format version. + version: #SeedVersion +} + +// SeedProvider configures the provider.yaml seed file. +#SeedProvider: seed.#Provider & { + @go(-) + + // version is the IncusOS provider seed format version. + version: #SeedVersion +} + +// SeedUpdate configures the update.yaml seed file. +#SeedUpdate: seed.#Update & { + @go(-) + + // version is the IncusOS update seed format version. + version: #SeedVersion + // auto_reboot allows automatic reboots after update application. + auto_reboot: *false | bool + // channel selects the IncusOS update channel. + channel: #Channel + // check_frequency controls how often IncusOS checks for updates. + check_frequency: string +} + +// Seed defines the IncusOS seed files to include in a seed archive. +// Each populated field is serialized to the corresponding .yaml file. +#Seed: { + // Install configures install.yaml for installer behavior. + install?: #SeedInstall @go(,type=*"github.com/lxc/incus-os/incus-osd/api/seed".Install) + // Applications configures applications.yaml for bundled IncusOS apps. + applications?: #SeedApplications @go(,type=*"github.com/lxc/incus-os/incus-osd/api/seed".Applications) + // Incus configures incus.yaml for Incus preseed behavior. + incus?: #SeedIncus @go(,type=*"github.com/lxc/incus-os/incus-osd/api/seed".Incus) + // Network configures network.yaml for system network settings. + network?: #SeedNetwork @go(,type=*"github.com/lxc/incus-os/incus-osd/api/seed".Network) + // Provider configures provider.yaml for configuration provider settings. + provider?: #SeedProvider @go(,type=*"github.com/lxc/incus-os/incus-osd/api/seed".Provider) + // Update configures update.yaml for system update policy. + update?: #SeedUpdate @go(,type=*"github.com/lxc/incus-os/incus-osd/api/seed".Update) + // MigrationManager configures migration-manager.yaml. + "migration-manager"?: #SeedMigrationManager @go(MigrationManager,type=*"github.com/lxc/incus-os/incus-osd/api/seed".MigrationManager) + // OperationsCenter configures operations-center.yaml. + "operations-center"?: #SeedOperationsCenter @go(OperationsCenter,type=*"github.com/lxc/incus-os/incus-osd/api/seed".OperationsCenter) +} + #Source: { // Release channel to select from the IncusOS image catalog. channel?: #Channel @@ -32,6 +192,9 @@ import "github.com/meigma/imgcli/schemas/core" #Config: { defaults?: #Defaults @go(,optional=nillable) + // Seed defines IncusOS install seed files to embed in customized images. + seed?: #Seed @go(,optional=nillable) + variants: { [VariantName=core.#VariantName]: #Variant & { artifact: {