From 116e452ee31b8c0e4df3f050276dbe57f99c3294 Mon Sep 17 00:00:00 2001 From: Sushil Lakra Date: Wed, 11 Jun 2025 10:18:58 +0000 Subject: [PATCH 1/4] Changes for modifying OS Resource with installed-packages-url for mutable OS in inventory --- inventory/api/os/v1/os.proto | 20 +- inventory/docs/api/inventory.md | 1 + inventory/docs/inventory-er-diagram.svg | 4488 +++++++++-------- ...611095255_modify_OS_installed_pkgs_url.sql | 2 + .../internal/ent/migrate/migrations/atlas.sum | 3 +- inventory/internal/ent/migrate/schema.go | 3 +- inventory/internal/ent/mutation.go | 137 +- .../internal/ent/operatingsystemresource.go | 13 +- .../operatingsystemresource.go | 8 + .../ent/operatingsystemresource/where.go | 80 + .../ent/operatingsystemresource_create.go | 18 + .../ent/operatingsystemresource_update.go | 6 + .../ent/schema/operating_system_resource.go | 2 +- inventory/internal/store/conversions.go | 47 +- inventory/internal/store/os_test.go | 173 +- inventory/pkg/api/os/v1/os.pb.go | 247 +- inventory/pkg/api/os/v1/os_constants.pb.go | 49 +- inventory/pkg/testing/opts.go | 6 + inventory/pkg/testing/testing_utils.go | 25 +- inventory/python/infra_inventory/os/v1.py | 4 + inventory/sql/inventory.sql | 2 +- 21 files changed, 2804 insertions(+), 2530 deletions(-) create mode 100644 inventory/internal/ent/migrate/migrations/20250611095255_modify_OS_installed_pkgs_url.sql diff --git a/inventory/api/os/v1/os.proto b/inventory/api/os/v1/os.proto index a0d984b85..ec52499b1 100644 --- a/inventory/api/os/v1/os.proto +++ b/inventory/api/os/v1/os.proto @@ -93,7 +93,25 @@ message OperatingSystemResource { optional: true immutable: true }]; // Version of an OS profile that the OS resource belongs to. Along with profile_name uniquely identifies OS resource. - string installed_packages = 9 [(ent.field) = {optional: true}]; // Freeform text, OS-dependent. A list of package names, one per line (newline separated). Should not contain version info. Deprecated in EMF-v3.1, use OSUpdatePolicy. + + string installed_packages = 9 [ + (ent.field) = { + optional: true + immutable: false + }]; // Freeform text, OS-dependent. A list of package names, one per line (newline separated). Should not contain version info. Deprecated in EMF-v3.1, use OSUpdatePolicy. + + // The URL of the OS manifest which contains install packages details. This will be used to fill the installed_packages field + // for the advance use case to allow manual creation of OSProfiles when supported from backend. + string installed_packages_url = 17 [ + (ent.field) = { + optional: true + immutable: true + }, + (buf.validate.field).string = { + pattern: "^$|^[a-zA-Z-_0-9./:;=@?!#,<>*()\"\\ ]+$" + max_len: 200 + }]; + SecurityFeature security_feature = 10 [(ent.field) = { optional: true immutable: true diff --git a/inventory/docs/api/inventory.md b/inventory/docs/api/inventory.md index cbbc775e0..e09ff5c8a 100644 --- a/inventory/docs/api/inventory.md +++ b/inventory/docs/api/inventory.md @@ -369,6 +369,7 @@ | profile_name | [string](#string) | | Name of an OS profile that the OS resource belongs to. Uniquely identifies family of OSResources. | | profile_version | [string](#string) | | Version of an OS profile that the OS resource belongs to. Along with profile_name uniquely identifies OS resource. | | installed_packages | [string](#string) | | Freeform text, OS-dependent. A list of package names, one per line (newline separated). Should not contain version info. Deprecated in EMF-v3.1, use OSUpdatePolicy. | +| installed_packages_url | [string](#string) | | The URL of the OS manifest which contains install packages details. This will be used to fill the installed_packages field for the advance use case to allow manual creation of OSProfiles when supported from backend. | | security_feature | [SecurityFeature](#os-v1-SecurityFeature) | | Indicating if this OS is capable of supporting features like Secure Boot (SB) and Full Disk Encryption (FDE). | | os_type | [OsType](#os-v1-OsType) | | Indicating the type of OS (for example, mutable or immutable). | | os_provider | [OsProviderKind](#os-v1-OsProviderKind) | | Indicating the provider of OS (e.g., Infra or Lenovo). | diff --git a/inventory/docs/inventory-er-diagram.svg b/inventory/docs/inventory-er-diagram.svg index 95cb2ef4f..606f9a016 100644 --- a/inventory/docs/inventory-er-diagram.svg +++ b/inventory/docs/inventory-er-diagram.svg @@ -4,2553 +4,2557 @@ - + dbml region_resources - - - -       region_resources        - - -id -     -bigint - -(!) - - -resource_id     -character varying - -(!) - - -name     -character varying - - -region_kind     -character varying - - -metadata     -character varying - - -tenant_id     -character varying - -(!) - - -created_at     -timestamp - -(!) - - -updated_at     -timestamp - -(!) - - -region_resource_parent_region     -bigint - + + + +       region_resources        + + +id +     +bigint + +(!) + + +resource_id     +character varying + +(!) + + +name     +character varying + + +region_kind     +character varying + + +metadata     +character varying + + +tenant_id     +character varying + +(!) + + +created_at     +timestamp + +(!) + + +updated_at     +timestamp + +(!) + + +region_resource_parent_region     +bigint + region_resources:e->region_resources:w - - -* -1 + + +* +1 site_resources - - - -       site_resources        - - -id -     -bigint - -(!) - - -resource_id     -character varying - -(!) - - -name     -character varying - - -address     -character varying - - -site_lat     -integer - - -site_lng     -integer - - -dns_servers     -character varying - - -docker_registries     -character varying - - -metrics_endpoint     -character varying - - -http_proxy     -character varying - - -https_proxy     -character varying - - -ftp_proxy     -character varying - - -no_proxy     -character varying - - -metadata     -character varying - - -tenant_id     -character varying - -(!) - - -created_at     -timestamp - -(!) - - -updated_at     -timestamp - -(!) - - -site_resource_region     -bigint - - -site_resource_ou     -bigint - - -site_resource_provider     -bigint - + + + +       site_resources        + + +id +     +bigint + +(!) + + +resource_id     +character varying + +(!) + + +name     +character varying + + +address     +character varying + + +site_lat     +integer + + +site_lng     +integer + + +dns_servers     +character varying + + +docker_registries     +character varying + + +metrics_endpoint     +character varying + + +http_proxy     +character varying + + +https_proxy     +character varying + + +ftp_proxy     +character varying + + +no_proxy     +character varying + + +metadata     +character varying + + +tenant_id     +character varying + +(!) + + +created_at     +timestamp + +(!) + + +updated_at     +timestamp + +(!) + + +site_resource_region     +bigint + + +site_resource_ou     +bigint + + +site_resource_provider     +bigint + region_resources:e->site_resources:w - - -* -1 + + +* +1 repeated_schedule_resources - - - -       repeated_schedule_resources        - - -id -     -bigint - -(!) - - -resource_id     -character varying - -(!) - - -schedule_status     -character varying - - -name     -character varying - - -duration_seconds     -bigint - - -cron_minutes     -character varying - -(!) - - -cron_hours     -character varying - -(!) - - -cron_day_month     -character varying - -(!) - - -cron_month     -character varying - -(!) - - -cron_day_week     -character varying - -(!) - - -tenant_id     -character varying - -(!) - - -created_at     -timestamp - -(!) - - -updated_at     -timestamp - -(!) - - -repeated_schedule_resource_target_site     -bigint - - -repeated_schedule_resource_target_host     -bigint - - -repeated_schedule_resource_target_workload     -bigint - - -repeated_schedule_resource_target_region     -bigint - + + + +       repeated_schedule_resources        + + +id +     +bigint + +(!) + + +resource_id     +character varying + +(!) + + +schedule_status     +character varying + + +name     +character varying + + +duration_seconds     +bigint + + +cron_minutes     +character varying + +(!) + + +cron_hours     +character varying + +(!) + + +cron_day_month     +character varying + +(!) + + +cron_month     +character varying + +(!) + + +cron_day_week     +character varying + +(!) + + +tenant_id     +character varying + +(!) + + +created_at     +timestamp + +(!) + + +updated_at     +timestamp + +(!) + + +repeated_schedule_resource_target_site     +bigint + + +repeated_schedule_resource_target_host     +bigint + + +repeated_schedule_resource_target_workload     +bigint + + +repeated_schedule_resource_target_region     +bigint + region_resources:e->repeated_schedule_resources:w - - -* -1 + + +* +1 single_schedule_resources - - - -       single_schedule_resources        - - -id -     -bigint - -(!) - - -resource_id     -character varying - -(!) - - -schedule_status     -character varying - - -name     -character varying - - -start_seconds     -bigint - -(!) - - -end_seconds     -bigint - - -tenant_id     -character varying - -(!) - - -created_at     -timestamp - -(!) - - -updated_at     -timestamp - -(!) - - -single_schedule_resource_target_site     -bigint - - -single_schedule_resource_target_host     -bigint - - -single_schedule_resource_target_workload     -bigint - - -single_schedule_resource_target_region     -bigint - + + + +       single_schedule_resources        + + +id +     +bigint + +(!) + + +resource_id     +character varying + +(!) + + +schedule_status     +character varying + + +name     +character varying + + +start_seconds     +bigint + +(!) + + +end_seconds     +bigint + + +tenant_id     +character varying + +(!) + + +created_at     +timestamp + +(!) + + +updated_at     +timestamp + +(!) + + +single_schedule_resource_target_site     +bigint + + +single_schedule_resource_target_host     +bigint + + +single_schedule_resource_target_workload     +bigint + + +single_schedule_resource_target_region     +bigint + region_resources:e->single_schedule_resources:w - - -* -1 + + +* +1 telemetry_profiles - - - -       telemetry_profiles        - - -id -     -bigint - -(!) - - -resource_id     -character varying - -(!) - - -kind     -character varying - -(!) - - -metrics_interval     -bigint - - -log_level     -character varying - - -tenant_id     -character varying - -(!) - - -created_at     -timestamp - -(!) - - -updated_at     -timestamp - -(!) - - -telemetry_profile_region     -bigint - - -telemetry_profile_site     -bigint - - -telemetry_profile_instance     -bigint - - -telemetry_profile_group     -bigint - -(!) - + + + +       telemetry_profiles        + + +id +     +bigint + +(!) + + +resource_id     +character varying + +(!) + + +kind     +character varying + +(!) + + +metrics_interval     +bigint + + +log_level     +character varying + + +tenant_id     +character varying + +(!) + + +created_at     +timestamp + +(!) + + +updated_at     +timestamp + +(!) + + +telemetry_profile_region     +bigint + + +telemetry_profile_site     +bigint + + +telemetry_profile_instance     +bigint + + +telemetry_profile_group     +bigint + +(!) + region_resources:e->telemetry_profiles:w - - -* -1 + + +* +1 tenants - - - -       tenants        - - -id -     -bigint - -(!) - - -resource_id     -character varying - -(!) - - -current_state     -character varying - - -desired_state     -character varying - -(!) - - -watcher_osmanager     -boolean - - -tenant_id     -character varying - -(!) - - -created_at     -timestamp - -(!) - - -updated_at     -timestamp - -(!) - + + + +       tenants        + + +id +     +bigint + +(!) + + +resource_id     +character varying + +(!) + + +current_state     +character varying + + +desired_state     +character varying + +(!) + + +watcher_osmanager     +boolean + + +tenant_id     +character varying + +(!) + + +created_at     +timestamp + +(!) + + +updated_at     +timestamp + +(!) + ou_resources - - - -       ou_resources        - - -id -     -bigint - -(!) - - -resource_id     -character varying - -(!) - - -name     -character varying - - -ou_kind     -character varying - - -metadata     -character varying - - -tenant_id     -character varying - -(!) - - -created_at     -timestamp - -(!) - - -updated_at     -timestamp - -(!) - - -ou_resource_parent_ou     -bigint - + + + +       ou_resources        + + +id +     +bigint + +(!) + + +resource_id     +character varying + +(!) + + +name     +character varying + + +ou_kind     +character varying + + +metadata     +character varying + + +tenant_id     +character varying + +(!) + + +created_at     +timestamp + +(!) + + +updated_at     +timestamp + +(!) + + +ou_resource_parent_ou     +bigint + ou_resources:e->ou_resources:w - - -* -1 + + +* +1 ou_resources:e->site_resources:w - - -* -1 + + +* +1 provider_resources - - - -       provider_resources        - - -id -     -bigint - -(!) - - -resource_id     -character varying - -(!) - - -provider_kind     -character varying - -(!) - - -provider_vendor     -character varying - - -name     -character varying - -(!) - - -api_endpoint     -character varying - -(!) - - -api_credentials     -character varying - - -config     -character varying - - -tenant_id     -character varying - -(!) - - -created_at     -timestamp - -(!) - - -updated_at     -timestamp - -(!) - + + + +       provider_resources        + + +id +     +bigint + +(!) + + +resource_id     +character varying + +(!) + + +provider_kind     +character varying + +(!) + + +provider_vendor     +character varying + + +name     +character varying + +(!) + + +api_endpoint     +character varying + +(!) + + +api_credentials     +character varying + + +config     +character varying + + +tenant_id     +character varying + +(!) + + +created_at     +timestamp + +(!) + + +updated_at     +timestamp + +(!) + provider_resources:e->site_resources:w - - -* -1 + + +* +1 instance_resources - - - -       instance_resources        - - -id -     -bigint - -(!) - - -resource_id     -character varying - -(!) - - -kind     -character varying - - -name     -character varying - - -desired_state     -character varying - - -current_state     -character varying - - -vm_memory_bytes     -bigint - - -vm_cpu_cores     -bigint - - -vm_storage_bytes     -bigint - - -security_feature     -character varying - - -instance_status     -character varying - - -instance_status_indicator     -character varying - - -instance_status_timestamp     -bigint - - -provisioning_status     -character varying - - -provisioning_status_indicator     -character varying - - -provisioning_status_timestamp     -bigint - - -update_status     -character varying - - -update_status_indicator     -character varying - - -update_status_timestamp     -bigint - - -update_status_detail     -character varying - - -trusted_attestation_status     -character varying - - -trusted_attestation_status_indicator     -character varying - - -trusted_attestation_status_timestamp     -bigint - - -existing_cves     -character varying - - -runtime_packages     -character varying - - -os_update_available     -character varying - - -tenant_id     -character varying - -(!) - - -instance_status_detail     -character varying - - -created_at     -timestamp - -(!) - - -updated_at     -timestamp - -(!) - - -instance_resource_desired_os     -bigint - -(!) - - -instance_resource_current_os     -bigint - - -instance_resource_os     -bigint - - -instance_resource_provider     -bigint - - -instance_resource_localaccount     -bigint - - -instance_resource_os_update_policy     -bigint - + + + +       instance_resources        + + +id +     +bigint + +(!) + + +resource_id     +character varying + +(!) + + +kind     +character varying + + +name     +character varying + + +desired_state     +character varying + + +current_state     +character varying + + +vm_memory_bytes     +bigint + + +vm_cpu_cores     +bigint + + +vm_storage_bytes     +bigint + + +security_feature     +character varying + + +instance_status     +character varying + + +instance_status_indicator     +character varying + + +instance_status_timestamp     +bigint + + +provisioning_status     +character varying + + +provisioning_status_indicator     +character varying + + +provisioning_status_timestamp     +bigint + + +update_status     +character varying + + +update_status_indicator     +character varying + + +update_status_timestamp     +bigint + + +update_status_detail     +character varying + + +trusted_attestation_status     +character varying + + +trusted_attestation_status_indicator     +character varying + + +trusted_attestation_status_timestamp     +bigint + + +existing_cves     +character varying + + +runtime_packages     +character varying + + +os_update_available     +character varying + + +tenant_id     +character varying + +(!) + + +instance_status_detail     +character varying + + +created_at     +timestamp + +(!) + + +updated_at     +timestamp + +(!) + + +instance_resource_desired_os     +bigint + +(!) + + +instance_resource_current_os     +bigint + + +instance_resource_os     +bigint + + +instance_resource_provider     +bigint + + +instance_resource_localaccount     +bigint + + +instance_resource_os_update_policy     +bigint + provider_resources:e->instance_resources:w - - -* -1 + + +* +1 host_resources - - - -       host_resources        - - -id -     -bigint - -(!) - - -resource_id     -character varying - -(!) - - -kind     -character varying - - -name     -character varying - - -desired_state     -character varying - - -current_state     -character varying - - -note     -character varying - - -hardware_kind     -character varying - - -serial_number     -character varying - - -uuid     -character varying - - -memory_bytes     -bigint - - -cpu_model     -character varying - - -cpu_sockets     -bigint - - -cpu_cores     -bigint - - -cpu_capabilities     -character varying - - -cpu_architecture     -character varying - - -cpu_threads     -bigint - - -cpu_topology     -character varying - - -mgmt_ip     -character varying - - -bmc_kind     -character varying - - -bmc_ip     -character varying - - -bmc_username     -character varying - - -bmc_password     -character varying - - -pxe_mac     -character varying - - -hostname     -character varying - - -product_name     -character varying - - -bios_version     -character varying - - -bios_release_date     -character varying - - -bios_vendor     -character varying - - -metadata     -character varying - - -desired_power_state     -character varying - - -current_power_state     -character varying - - -power_status     -character varying - - -power_status_indicator     -character varying - - -power_status_timestamp     -bigint - - -power_command_policy     -character varying - - -power_on_time     -bigint - - -host_status     -character varying - - -host_status_indicator     -character varying - - -host_status_timestamp     -bigint - - -onboarding_status     -character varying - - -onboarding_status_indicator     -character varying - - -onboarding_status_timestamp     -bigint - - -registration_status     -character varying - - -registration_status_indicator     -character varying - - -registration_status_timestamp     -bigint - - -amt_sku     -character varying - - -desired_amt_state     -character varying - - -current_amt_state     -character varying - - -amt_status     -character varying - - -amt_status_indicator     -character varying - - -amt_status_timestamp     -bigint - - -tenant_id     -character varying - -(!) - - -created_at     -timestamp - -(!) - - -updated_at     -timestamp - -(!) - - -host_resource_site     -bigint - - -host_resource_provider     -bigint - - -instance_resource_host     -bigint - + + + +       host_resources        + + +id +     +bigint + +(!) + + +resource_id     +character varying + +(!) + + +kind     +character varying + + +name     +character varying + + +desired_state     +character varying + + +current_state     +character varying + + +note     +character varying + + +hardware_kind     +character varying + + +serial_number     +character varying + + +uuid     +character varying + + +memory_bytes     +bigint + + +cpu_model     +character varying + + +cpu_sockets     +bigint + + +cpu_cores     +bigint + + +cpu_capabilities     +character varying + + +cpu_architecture     +character varying + + +cpu_threads     +bigint + + +cpu_topology     +character varying + + +mgmt_ip     +character varying + + +bmc_kind     +character varying + + +bmc_ip     +character varying + + +bmc_username     +character varying + + +bmc_password     +character varying + + +pxe_mac     +character varying + + +hostname     +character varying + + +product_name     +character varying + + +bios_version     +character varying + + +bios_release_date     +character varying + + +bios_vendor     +character varying + + +metadata     +character varying + + +desired_power_state     +character varying + + +current_power_state     +character varying + + +power_status     +character varying + + +power_status_indicator     +character varying + + +power_status_timestamp     +bigint + + +power_command_policy     +character varying + + +power_on_time     +bigint + + +host_status     +character varying + + +host_status_indicator     +character varying + + +host_status_timestamp     +bigint + + +onboarding_status     +character varying + + +onboarding_status_indicator     +character varying + + +onboarding_status_timestamp     +bigint + + +registration_status     +character varying + + +registration_status_indicator     +character varying + + +registration_status_timestamp     +bigint + + +amt_sku     +character varying + + +desired_amt_state     +character varying + + +current_amt_state     +character varying + + +amt_status     +character varying + + +amt_status_indicator     +character varying + + +amt_status_timestamp     +bigint + + +tenant_id     +character varying + +(!) + + +created_at     +timestamp + +(!) + + +updated_at     +timestamp + +(!) + + +host_resource_site     +bigint + + +host_resource_provider     +bigint + + +instance_resource_host     +bigint + provider_resources:e->host_resources:w - - -* -1 + + +* +1 site_resources:e->host_resources:w - - -* -1 + + +* +1 network_segments - - - -       network_segments        - - -id -     -bigint - -(!) - - -resource_id     -character varying - -(!) - - -name     -character varying - - -vlan_id     -integer - - -tenant_id     -character varying - -(!) - - -created_at     -timestamp - -(!) - - -updated_at     -timestamp - -(!) - - -network_segment_site     -bigint - -(!) - + + + +       network_segments        + + +id +     +bigint + +(!) + + +resource_id     +character varying + +(!) + + +name     +character varying + + +vlan_id     +integer + + +tenant_id     +character varying + +(!) + + +created_at     +timestamp + +(!) + + +updated_at     +timestamp + +(!) + + +network_segment_site     +bigint + +(!) + site_resources:e->network_segments:w - - -* -1 + + +* +1 site_resources:e->repeated_schedule_resources:w - - -* -1 + + +* +1 site_resources:e->single_schedule_resources:w - - -* -1 + + +* +1 site_resources:e->telemetry_profiles:w - - -* -1 + + +* +1 operating_system_resources - - - -       operating_system_resources        - - -id -     -bigint - -(!) - - -resource_id     -character varying - -(!) - - -name     -character varying - - -architecture     -character varying - - -kernel_command     -character varying - - -update_sources     -character varying - - -image_url     -character varying - - -image_id     -character varying - - -sha256     -character varying - - -profile_name     -character varying - - -profile_version     -character varying - - -installed_packages     -character varying - - -security_feature     -character varying - - -os_type     -character varying - - -os_provider     -character varying - -(!) - - -platform_bundle     -character varying - - -description     -character varying - - -metadata     -character varying - - -existing_cves_url     -character varying - - -existing_cves     -character varying - - -fixed_cves_url     -character varying - - -fixed_cves     -character varying - - -tenant_id     -character varying - -(!) - - -created_at     -timestamp - -(!) - - -updated_at     -timestamp - -(!) - + + + +       operating_system_resources        + + +id +     +bigint + +(!) + + +resource_id     +character varying + +(!) + + +name     +character varying + + +architecture     +character varying + + +kernel_command     +character varying + + +update_sources     +character varying + + +image_url     +character varying + + +image_id     +character varying + + +sha256     +character varying + + +profile_name     +character varying + + +profile_version     +character varying + + +installed_packages     +character varying + + +installed_packages_url     +character varying + + +security_feature     +character varying + + +os_type     +character varying + + +os_provider     +character varying + +(!) + + +platform_bundle     +character varying + + +description     +character varying + + +metadata     +character varying + + +existing_cves_url     +character varying + + +existing_cves     +character varying + + +fixed_cves_url     +character varying + + +fixed_cves     +character varying + + +tenant_id     +character varying + +(!) + + +created_at     +timestamp + +(!) + + +updated_at     +timestamp + +(!) + os_update_policy_resources - - - -       os_update_policy_resources        - - -id -     -bigint - -(!) - - -resource_id     -character varying - -(!) - - -name     -character varying - -(!) - - -description     -character varying - - -install_packages     -character varying - - -update_sources     -character varying - - -kernel_command     -character varying - - -update_policy     -character varying - - -tenant_id     -character varying - -(!) - - -created_at     -timestamp - -(!) - - -updated_at     -timestamp - -(!) - - -os_update_policy_resource_target_os     -bigint - + + + +       os_update_policy_resources        + + +id +     +bigint + +(!) + + +resource_id     +character varying + +(!) + + +name     +character varying + +(!) + + +description     +character varying + + +install_packages     +character varying + + +update_sources     +character varying + + +kernel_command     +character varying + + +update_policy     +character varying + + +tenant_id     +character varying + +(!) + + +created_at     +timestamp + +(!) + + +updated_at     +timestamp + +(!) + + +os_update_policy_resource_target_os     +bigint + operating_system_resources:e->os_update_policy_resources:w - - -* -1 + + +* +1 operating_system_resources:e->instance_resources:w - - -* -1 + + +* +1 operating_system_resources:e->instance_resources:w - - -* -1 + + +* +1 operating_system_resources:e->instance_resources:w - - -* -1 + + +* +1 os_update_policies - - - -       os_update_policies        - - -id -     -bigint - -(!) - - -resource_id     -character varying - -(!) - - -installed_packages     -character varying - - -update_sources     -character varying - - -kernel_command     -character varying - - -update_policy     -character varying - - -tenant_id     -character varying - -(!) - - -created_at     -timestamp - -(!) - - -updated_at     -timestamp - -(!) - - -os_update_policy_target_os     -bigint - + + + +       os_update_policies        + + +id +     +bigint + +(!) + + +resource_id     +character varying + +(!) + + +installed_packages     +character varying + + +update_sources     +character varying + + +kernel_command     +character varying + + +update_policy     +character varying + + +tenant_id     +character varying + +(!) + + +created_at     +timestamp + +(!) + + +updated_at     +timestamp + +(!) + + +os_update_policy_target_os     +bigint + operating_system_resources:e->os_update_policies:w - - -* -1 + + +* +1 local_account_resources - - - -       local_account_resources        - - -id -     -bigint - -(!) - - -resource_id     -character varying - -(!) - - -username     -character varying - -(!) - - -ssh_key     -character varying - -(!) - - -tenant_id     -character varying - -(!) - - -created_at     -timestamp - -(!) - - -updated_at     -timestamp - -(!) - + + + +       local_account_resources        + + +id +     +bigint + +(!) + + +resource_id     +character varying + +(!) + + +username     +character varying + +(!) + + +ssh_key     +character varying + +(!) + + +tenant_id     +character varying + +(!) + + +created_at     +timestamp + +(!) + + +updated_at     +timestamp + +(!) + local_account_resources:e->instance_resources:w - - -* -1 + + +* +1 os_update_policy_resources:e->instance_resources:w - - -* -1 + + +* +1 instance_resources:e->host_resources:w - - -* -1 + + +* +1 remote_access_configurations - - - -       remote_access_configurations        - - -id -     -bigint - -(!) - - -resource_id     -character varying - -(!) - - -expiration_timestamp     -bigint - -(!) - - -local_port     -bigint - - -user     -character varying - - -current_state     -character varying - - -desired_state     -character varying - -(!) - - -configuration_status     -character varying - - -configuration_status_indicator     -character varying - - -configuration_status_timestamp     -bigint - - -tenant_id     -character varying - -(!) - - -created_at     -timestamp - -(!) - - -updated_at     -timestamp - -(!) - - -remote_access_configuration_instance     -bigint - -(!) - + + + +       remote_access_configurations        + + +id +     +bigint + +(!) + + +resource_id     +character varying + +(!) + + +expiration_timestamp     +bigint + +(!) + + +local_port     +bigint + + +user     +character varying + + +current_state     +character varying + + +desired_state     +character varying + +(!) + + +configuration_status     +character varying + + +configuration_status_indicator     +character varying + + +configuration_status_timestamp     +bigint + + +tenant_id     +character varying + +(!) + + +created_at     +timestamp + +(!) + + +updated_at     +timestamp + +(!) + + +remote_access_configuration_instance     +bigint + +(!) + instance_resources:e->remote_access_configurations:w - - -* -1 + + +* +1 instance_resources:e->telemetry_profiles:w - - -* -1 + + +* +1 workload_members - - - -       workload_members        - - -id -     -bigint - -(!) - - -resource_id     -character varying - -(!) - - -kind     -character varying - -(!) - - -tenant_id     -character varying - -(!) - - -created_at     -timestamp - -(!) - - -updated_at     -timestamp - -(!) - - -workload_member_workload     -bigint - -(!) - - -workload_member_instance     -bigint - -(!) - + + + +       workload_members        + + +id +     +bigint + +(!) + + +resource_id     +character varying + +(!) + + +kind     +character varying + +(!) + + +tenant_id     +character varying + +(!) + + +created_at     +timestamp + +(!) + + +updated_at     +timestamp + +(!) + + +workload_member_workload     +bigint + +(!) + + +workload_member_instance     +bigint + +(!) + instance_resources:e->workload_members:w - - -* -1 + + +* +1 endpoint_resources - - - -       endpoint_resources        - - -id -     -bigint - -(!) - - -resource_id     -character varying - -(!) - - -kind     -character varying - - -name     -character varying - - -tenant_id     -character varying - -(!) - - -created_at     -timestamp - -(!) - - -updated_at     -timestamp - -(!) - - -endpoint_resource_host     -bigint - + + + +       endpoint_resources        + + +id +     +bigint + +(!) + + +resource_id     +character varying + +(!) + + +kind     +character varying + + +name     +character varying + + +tenant_id     +character varying + +(!) + + +created_at     +timestamp + +(!) + + +updated_at     +timestamp + +(!) + + +endpoint_resource_host     +bigint + host_resources:e->endpoint_resources:w - - -* -1 + + +* +1 hostgpu_resources - - - -       hostgpu_resources        - - -id -     -bigint - -(!) - - -resource_id     -character varying - -(!) - - -pci_id     -character varying - - -product     -character varying - - -vendor     -character varying - - -description     -character varying - - -device_name     -character varying - - -features     -character varying - - -tenant_id     -character varying - -(!) - - -created_at     -timestamp - -(!) - - -updated_at     -timestamp - -(!) - - -hostgpu_resource_host     -bigint - -(!) - + + + +       hostgpu_resources        + + +id +     +bigint + +(!) + + +resource_id     +character varying + +(!) + + +pci_id     +character varying + + +product     +character varying + + +vendor     +character varying + + +description     +character varying + + +device_name     +character varying + + +features     +character varying + + +tenant_id     +character varying + +(!) + + +created_at     +timestamp + +(!) + + +updated_at     +timestamp + +(!) + + +hostgpu_resource_host     +bigint + +(!) + host_resources:e->hostgpu_resources:w - - -* -1 + + +* +1 hostnic_resources - - - -       hostnic_resources        - - -id -     -bigint - -(!) - - -resource_id     -character varying - -(!) - - -kind     -character varying - - -provider_status     -character varying - - -device_name     -character varying - - -pci_identifier     -character varying - - -mac_addr     -character varying - - -sriov_enabled     -boolean - - -sriov_vfs_num     -bigint - - -sriov_vfs_total     -bigint - - -peer_name     -character varying - - -peer_description     -character varying - - -peer_mac     -character varying - - -peer_mgmt_ip     -character varying - - -peer_port     -character varying - - -supported_link_mode     -character varying - - -advertising_link_mode     -character varying - - -current_speed_bps     -bigint - - -current_duplex     -character varying - - -features     -character varying - - -mtu     -bigint - - -link_state     -character varying - - -bmc_interface     -boolean - - -tenant_id     -character varying - -(!) - - -created_at     -timestamp - -(!) - - -updated_at     -timestamp - -(!) - - -hostnic_resource_host     -bigint - -(!) - + + + +       hostnic_resources        + + +id +     +bigint + +(!) + + +resource_id     +character varying + +(!) + + +kind     +character varying + + +provider_status     +character varying + + +device_name     +character varying + + +pci_identifier     +character varying + + +mac_addr     +character varying + + +sriov_enabled     +boolean + + +sriov_vfs_num     +bigint + + +sriov_vfs_total     +bigint + + +peer_name     +character varying + + +peer_description     +character varying + + +peer_mac     +character varying + + +peer_mgmt_ip     +character varying + + +peer_port     +character varying + + +supported_link_mode     +character varying + + +advertising_link_mode     +character varying + + +current_speed_bps     +bigint + + +current_duplex     +character varying + + +features     +character varying + + +mtu     +bigint + + +link_state     +character varying + + +bmc_interface     +boolean + + +tenant_id     +character varying + +(!) + + +created_at     +timestamp + +(!) + + +updated_at     +timestamp + +(!) + + +hostnic_resource_host     +bigint + +(!) + host_resources:e->hostnic_resources:w - - -* -1 + + +* +1 hoststorage_resources - - - -       hoststorage_resources        - - -id -     -bigint - -(!) - - -resource_id     -character varying - -(!) - - -kind     -character varying - - -provider_status     -character varying - - -wwid     -character varying - - -serial     -character varying - - -vendor     -character varying - - -model     -character varying - - -capacity_bytes     -bigint - - -device_name     -character varying - - -tenant_id     -character varying - -(!) - - -created_at     -timestamp - -(!) - - -updated_at     -timestamp - -(!) - - -hoststorage_resource_host     -bigint - -(!) - + + + +       hoststorage_resources        + + +id +     +bigint + +(!) + + +resource_id     +character varying + +(!) + + +kind     +character varying + + +provider_status     +character varying + + +wwid     +character varying + + +serial     +character varying + + +vendor     +character varying + + +model     +character varying + + +capacity_bytes     +bigint + + +device_name     +character varying + + +tenant_id     +character varying + +(!) + + +created_at     +timestamp + +(!) + + +updated_at     +timestamp + +(!) + + +hoststorage_resource_host     +bigint + +(!) + host_resources:e->hoststorage_resources:w - - -* -1 + + +* +1 hostusb_resources - - - -       hostusb_resources        - - -id -     -bigint - -(!) - - -resource_id     -character varying - -(!) - - -kind     -character varying - - -owner_id     -character varying - - -idvendor     -character varying - - -idproduct     -character varying - - -bus     -bigint - - -addr     -bigint - - -class     -character varying - - -serial     -character varying - - -device_name     -character varying - - -tenant_id     -character varying - -(!) - - -created_at     -timestamp - -(!) - - -updated_at     -timestamp - -(!) - - -hostusb_resource_host     -bigint - -(!) - + + + +       hostusb_resources        + + +id +     +bigint + +(!) + + +resource_id     +character varying + +(!) + + +kind     +character varying + + +owner_id     +character varying + + +idvendor     +character varying + + +idproduct     +character varying + + +bus     +bigint + + +addr     +bigint + + +class     +character varying + + +serial     +character varying + + +device_name     +character varying + + +tenant_id     +character varying + +(!) + + +created_at     +timestamp + +(!) + + +updated_at     +timestamp + +(!) + + +hostusb_resource_host     +bigint + +(!) + host_resources:e->hostusb_resources:w - - -* -1 + + +* +1 host_resources:e->repeated_schedule_resources:w - - -* -1 + + +* +1 host_resources:e->single_schedule_resources:w - - -* -1 + + +* +1 netlink_resources - - - -       netlink_resources        - - -id -     -bigint - -(!) - - -resource_id     -character varying - -(!) - - -kind     -character varying - - -name     -character varying - - -desired_state     -character varying - -(!) - - -current_state     -character varying - - -provider_status     -character varying - - -tenant_id     -character varying - -(!) - - -created_at     -timestamp - -(!) - - -updated_at     -timestamp - -(!) - - -netlink_resource_src     -bigint - - -netlink_resource_dst     -bigint - + + + +       netlink_resources        + + +id +     +bigint + +(!) + + +resource_id     +character varying + +(!) + + +kind     +character varying + + +name     +character varying + + +desired_state     +character varying + +(!) + + +current_state     +character varying + + +provider_status     +character varying + + +tenant_id     +character varying + +(!) + + +created_at     +timestamp + +(!) + + +updated_at     +timestamp + +(!) + + +netlink_resource_src     +bigint + + +netlink_resource_dst     +bigint + endpoint_resources:e->netlink_resources:w - - -* -1 + + +* +1 endpoint_resources:e->netlink_resources:w - - -* -1 + + +* +1 ip_address_resources - - - -       ip_address_resources        - - -id -     -bigint - -(!) - - -resource_id     -character varying - -(!) - - -address     -character varying - - -desired_state     -character varying - - -current_state     -character varying - - -status     -character varying - - -status_detail     -character varying - - -config_method     -character varying - - -tenant_id     -character varying - -(!) - - -created_at     -timestamp - -(!) - - -updated_at     -timestamp - -(!) - - -ip_address_resource_nic     -bigint - -(!) - + + + +       ip_address_resources        + + +id +     +bigint + +(!) + + +resource_id     +character varying + +(!) + + +address     +character varying + + +desired_state     +character varying + + +current_state     +character varying + + +status     +character varying + + +status_detail     +character varying + + +config_method     +character varying + + +tenant_id     +character varying + +(!) + + +created_at     +timestamp + +(!) + + +updated_at     +timestamp + +(!) + + +ip_address_resource_nic     +bigint + +(!) + hostnic_resources:e->ip_address_resources:w - - -* -1 + + +* +1 workload_resources - - - -       workload_resources        - - -id -     -bigint - -(!) - - -resource_id     -character varying - -(!) - - -kind     -character varying - -(!) - - -name     -character varying - - -external_id     -character varying - - -desired_state     -character varying - -(!) - - -current_state     -character varying - - -status     -character varying - - -metadata     -character varying - - -tenant_id     -character varying - -(!) - - -created_at     -timestamp - -(!) - - -updated_at     -timestamp - -(!) - + + + +       workload_resources        + + +id +     +bigint + +(!) + + +resource_id     +character varying + +(!) + + +kind     +character varying + +(!) + + +name     +character varying + + +external_id     +character varying + + +desired_state     +character varying + +(!) + + +current_state     +character varying + + +status     +character varying + + +metadata     +character varying + + +tenant_id     +character varying + +(!) + + +created_at     +timestamp + +(!) + + +updated_at     +timestamp + +(!) + workload_resources:e->repeated_schedule_resources:w - - -* -1 + + +* +1 workload_resources:e->single_schedule_resources:w - - -* -1 + + +* +1 workload_resources:e->workload_members:w - - -* -1 + + +* +1 telemetry_group_resources - - - -       telemetry_group_resources        - - -id -     -bigint - -(!) - - -resource_id     -character varying - -(!) - - -name     -character varying - -(!) - - -kind     -character varying - -(!) - - -collector_kind     -character varying - -(!) - - -groups     -character varying - -(!) - - -tenant_id     -character varying - -(!) - - -created_at     -timestamp - -(!) - - -updated_at     -timestamp - -(!) - + + + +       telemetry_group_resources        + + +id +     +bigint + +(!) + + +resource_id     +character varying + +(!) + + +name     +character varying + +(!) + + +kind     +character varying + +(!) + + +collector_kind     +character varying + +(!) + + +groups     +character varying + +(!) + + +tenant_id     +character varying + +(!) + + +created_at     +timestamp + +(!) + + +updated_at     +timestamp + +(!) + telemetry_group_resources:e->telemetry_profiles:w - - -* -1 + + +* +1 diff --git a/inventory/internal/ent/migrate/migrations/20250611095255_modify_OS_installed_pkgs_url.sql b/inventory/internal/ent/migrate/migrations/20250611095255_modify_OS_installed_pkgs_url.sql new file mode 100644 index 000000000..c82003886 --- /dev/null +++ b/inventory/internal/ent/migrate/migrations/20250611095255_modify_OS_installed_pkgs_url.sql @@ -0,0 +1,2 @@ +-- Modify "operating_system_resources" table +ALTER TABLE "operating_system_resources" ADD COLUMN "installed_packages_url" character varying NULL; diff --git a/inventory/internal/ent/migrate/migrations/atlas.sum b/inventory/internal/ent/migrate/migrations/atlas.sum index 8c067c1ff..f2e7c707b 100644 --- a/inventory/internal/ent/migrate/migrations/atlas.sum +++ b/inventory/internal/ent/migrate/migrations/atlas.sum @@ -1,4 +1,4 @@ -h1:U7Hc/XrMbKdh5yC2GW+OoZcOq9rRvq8W5T6pF9NxCc0= +h1:mN1TXbC1X5W9nSzbtwLAxe/bBRy2QxQbKLrzb3t7hVs= 20230600000000_empty.sql h1:WTkYlwWwrdJjax+pXqrJYBNu1BIdqqnF9WoasjlGLUk= 20250324165719_all.sql h1:YEGDRbDPwxh5fBkoaGAwXpPu3nDCsCDdrvTt2EzBekk= 20250520125803_add_osprof_desc.sql h1:RQBqrgNfdTJlElMRdsizeMIRLsfw2Dq1LzzdiIV/JmE= @@ -7,3 +7,4 @@ h1:U7Hc/XrMbKdh5yC2GW+OoZcOq9rRvq8W5T6pF9NxCc0= 20250605145118_add_osmetadata.sql h1:Y6t1wz1AxZD9sskGKmi1YcBh4GTGarWQAsya0vrD7v4= 20250605155657_add_osupdatepolicy.sql h1:Q1CJe+b8PV6k7icmIDaBMbfVn7rZLwhuZTeeFmSegCU= 20250606153212_instance_update.sql h1:xmZLkFyu8Kaumkj9W10czTP+54Fb3sqF7RB90O7dtzE= +20250611095255_modify_OS_installed_pkgs_url.sql h1:Xhp4/L+9mm3DpUW/zPu3qKuaoHEA5+oz/DOZpYSChjQ= diff --git a/inventory/internal/ent/migrate/schema.go b/inventory/internal/ent/migrate/schema.go index 3c48aed61..cd9a0d7c8 100644 --- a/inventory/internal/ent/migrate/schema.go +++ b/inventory/internal/ent/migrate/schema.go @@ -606,6 +606,7 @@ var ( {Name: "profile_name", Type: field.TypeString, Nullable: true}, {Name: "profile_version", Type: field.TypeString, Nullable: true}, {Name: "installed_packages", Type: field.TypeString, Nullable: true}, + {Name: "installed_packages_url", Type: field.TypeString, Nullable: true}, {Name: "security_feature", Type: field.TypeEnum, Nullable: true, Enums: []string{"SECURITY_FEATURE_UNSPECIFIED", "SECURITY_FEATURE_NONE", "SECURITY_FEATURE_SECURE_BOOT_AND_FULL_DISK_ENCRYPTION"}}, {Name: "os_type", Type: field.TypeEnum, Nullable: true, Enums: []string{"OS_TYPE_UNSPECIFIED", "OS_TYPE_MUTABLE", "OS_TYPE_IMMUTABLE"}}, {Name: "os_provider", Type: field.TypeEnum, Enums: []string{"OS_PROVIDER_KIND_UNSPECIFIED", "OS_PROVIDER_KIND_INFRA", "OS_PROVIDER_KIND_LENOVO"}}, @@ -629,7 +630,7 @@ var ( { Name: "operatingsystemresource_tenant_id", Unique: false, - Columns: []*schema.Column{OperatingSystemResourcesColumns[22]}, + Columns: []*schema.Column{OperatingSystemResourcesColumns[23]}, }, }, } diff --git a/inventory/internal/ent/mutation.go b/inventory/internal/ent/mutation.go index adce9a53e..27b1537e0 100644 --- a/inventory/internal/ent/mutation.go +++ b/inventory/internal/ent/mutation.go @@ -19663,37 +19663,38 @@ func (m *OSUpdatePolicyResourceMutation) ResetEdge(name string) error { // OperatingSystemResourceMutation represents an operation that mutates the OperatingSystemResource nodes in the graph. type OperatingSystemResourceMutation struct { config - op Op - typ string - id *int - resource_id *string - name *string - architecture *string - kernel_command *string - update_sources *string - image_url *string - image_id *string - sha256 *string - profile_name *string - profile_version *string - installed_packages *string - security_feature *operatingsystemresource.SecurityFeature - os_type *operatingsystemresource.OsType - os_provider *operatingsystemresource.OsProvider - platform_bundle *string - description *string - metadata *string - existing_cves_url *string - existing_cves *string - fixed_cves_url *string - fixed_cves *string - tenant_id *string - created_at *string - updated_at *string - clearedFields map[string]struct{} - done bool - oldValue func(context.Context) (*OperatingSystemResource, error) - predicates []predicate.OperatingSystemResource + op Op + typ string + id *int + resource_id *string + name *string + architecture *string + kernel_command *string + update_sources *string + image_url *string + image_id *string + sha256 *string + profile_name *string + profile_version *string + installed_packages *string + installed_packages_url *string + security_feature *operatingsystemresource.SecurityFeature + os_type *operatingsystemresource.OsType + os_provider *operatingsystemresource.OsProvider + platform_bundle *string + description *string + metadata *string + existing_cves_url *string + existing_cves *string + fixed_cves_url *string + fixed_cves *string + tenant_id *string + created_at *string + updated_at *string + clearedFields map[string]struct{} + done bool + oldValue func(context.Context) (*OperatingSystemResource, error) + predicates []predicate.OperatingSystemResource } var _ ent.Mutation = (*OperatingSystemResourceMutation)(nil) @@ -20320,6 +20321,55 @@ func (m *OperatingSystemResourceMutation) ResetInstalledPackages() { delete(m.clearedFields, operatingsystemresource.FieldInstalledPackages) } +// SetInstalledPackagesURL sets the "installed_packages_url" field. +func (m *OperatingSystemResourceMutation) SetInstalledPackagesURL(s string) { + m.installed_packages_url = &s +} + +// InstalledPackagesURL returns the value of the "installed_packages_url" field in the mutation. +func (m *OperatingSystemResourceMutation) InstalledPackagesURL() (r string, exists bool) { + v := m.installed_packages_url + if v == nil { + return + } + return *v, true +} + +// OldInstalledPackagesURL returns the old "installed_packages_url" field's value of the OperatingSystemResource entity. +// If the OperatingSystemResource object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *OperatingSystemResourceMutation) OldInstalledPackagesURL(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldInstalledPackagesURL is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldInstalledPackagesURL requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldInstalledPackagesURL: %w", err) + } + return oldValue.InstalledPackagesURL, nil +} + +// ClearInstalledPackagesURL clears the value of the "installed_packages_url" field. +func (m *OperatingSystemResourceMutation) ClearInstalledPackagesURL() { + m.installed_packages_url = nil + m.clearedFields[operatingsystemresource.FieldInstalledPackagesURL] = struct{}{} +} + +// InstalledPackagesURLCleared returns if the "installed_packages_url" field was cleared in this mutation. +func (m *OperatingSystemResourceMutation) InstalledPackagesURLCleared() bool { + _, ok := m.clearedFields[operatingsystemresource.FieldInstalledPackagesURL] + return ok +} + +// ResetInstalledPackagesURL resets all changes to the "installed_packages_url" field. +func (m *OperatingSystemResourceMutation) ResetInstalledPackagesURL() { + m.installed_packages_url = nil + delete(m.clearedFields, operatingsystemresource.FieldInstalledPackagesURL) +} + // SetSecurityFeature sets the "security_feature" field. func (m *OperatingSystemResourceMutation) SetSecurityFeature(of operatingsystemresource.SecurityFeature) { m.security_feature = &of @@ -20939,7 +20989,7 @@ func (m *OperatingSystemResourceMutation) Type() string { // order to get all numeric fields that were incremented/decremented, call // AddedFields(). func (m *OperatingSystemResourceMutation) Fields() []string { - fields := make([]string, 0, 24) + fields := make([]string, 0, 25) if m.resource_id != nil { fields = append(fields, operatingsystemresource.FieldResourceID) } @@ -20973,6 +21023,9 @@ func (m *OperatingSystemResourceMutation) Fields() []string { if m.installed_packages != nil { fields = append(fields, operatingsystemresource.FieldInstalledPackages) } + if m.installed_packages_url != nil { + fields = append(fields, operatingsystemresource.FieldInstalledPackagesURL) + } if m.security_feature != nil { fields = append(fields, operatingsystemresource.FieldSecurityFeature) } @@ -21042,6 +21095,8 @@ func (m *OperatingSystemResourceMutation) Field(name string) (ent.Value, bool) { return m.ProfileVersion() case operatingsystemresource.FieldInstalledPackages: return m.InstalledPackages() + case operatingsystemresource.FieldInstalledPackagesURL: + return m.InstalledPackagesURL() case operatingsystemresource.FieldSecurityFeature: return m.SecurityFeature() case operatingsystemresource.FieldOsType: @@ -21099,6 +21154,8 @@ func (m *OperatingSystemResourceMutation) OldField(ctx context.Context, name str return m.OldProfileVersion(ctx) case operatingsystemresource.FieldInstalledPackages: return m.OldInstalledPackages(ctx) + case operatingsystemresource.FieldInstalledPackagesURL: + return m.OldInstalledPackagesURL(ctx) case operatingsystemresource.FieldSecurityFeature: return m.OldSecurityFeature(ctx) case operatingsystemresource.FieldOsType: @@ -21211,6 +21268,13 @@ func (m *OperatingSystemResourceMutation) SetField(name string, value ent.Value) } m.SetInstalledPackages(v) return nil + case operatingsystemresource.FieldInstalledPackagesURL: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetInstalledPackagesURL(v) + return nil case operatingsystemresource.FieldSecurityFeature: v, ok := value.(operatingsystemresource.SecurityFeature) if !ok { @@ -21362,6 +21426,9 @@ func (m *OperatingSystemResourceMutation) ClearedFields() []string { if m.FieldCleared(operatingsystemresource.FieldInstalledPackages) { fields = append(fields, operatingsystemresource.FieldInstalledPackages) } + if m.FieldCleared(operatingsystemresource.FieldInstalledPackagesURL) { + fields = append(fields, operatingsystemresource.FieldInstalledPackagesURL) + } if m.FieldCleared(operatingsystemresource.FieldSecurityFeature) { fields = append(fields, operatingsystemresource.FieldSecurityFeature) } @@ -21433,6 +21500,9 @@ func (m *OperatingSystemResourceMutation) ClearField(name string) error { case operatingsystemresource.FieldInstalledPackages: m.ClearInstalledPackages() return nil + case operatingsystemresource.FieldInstalledPackagesURL: + m.ClearInstalledPackagesURL() + return nil case operatingsystemresource.FieldSecurityFeature: m.ClearSecurityFeature() return nil @@ -21501,6 +21571,9 @@ func (m *OperatingSystemResourceMutation) ResetField(name string) error { case operatingsystemresource.FieldInstalledPackages: m.ResetInstalledPackages() return nil + case operatingsystemresource.FieldInstalledPackagesURL: + m.ResetInstalledPackagesURL() + return nil case operatingsystemresource.FieldSecurityFeature: m.ResetSecurityFeature() return nil diff --git a/inventory/internal/ent/operatingsystemresource.go b/inventory/internal/ent/operatingsystemresource.go index 76e79c28d..51f50f043 100644 --- a/inventory/internal/ent/operatingsystemresource.go +++ b/inventory/internal/ent/operatingsystemresource.go @@ -38,6 +38,8 @@ type OperatingSystemResource struct { ProfileVersion string `json:"profile_version,omitempty"` // InstalledPackages holds the value of the "installed_packages" field. InstalledPackages string `json:"installed_packages,omitempty"` + // InstalledPackagesURL holds the value of the "installed_packages_url" field. + InstalledPackagesURL string `json:"installed_packages_url,omitempty"` // SecurityFeature holds the value of the "security_feature" field. SecurityFeature operatingsystemresource.SecurityFeature `json:"security_feature,omitempty"` // OsType holds the value of the "os_type" field. @@ -74,7 +76,7 @@ func (*OperatingSystemResource) scanValues(columns []string) ([]any, error) { switch columns[i] { case operatingsystemresource.FieldID: values[i] = new(sql.NullInt64) - case operatingsystemresource.FieldResourceID, operatingsystemresource.FieldName, operatingsystemresource.FieldArchitecture, operatingsystemresource.FieldKernelCommand, operatingsystemresource.FieldUpdateSources, operatingsystemresource.FieldImageURL, operatingsystemresource.FieldImageID, operatingsystemresource.FieldSha256, operatingsystemresource.FieldProfileName, operatingsystemresource.FieldProfileVersion, operatingsystemresource.FieldInstalledPackages, operatingsystemresource.FieldSecurityFeature, operatingsystemresource.FieldOsType, operatingsystemresource.FieldOsProvider, operatingsystemresource.FieldPlatformBundle, operatingsystemresource.FieldDescription, operatingsystemresource.FieldMetadata, operatingsystemresource.FieldExistingCvesURL, operatingsystemresource.FieldExistingCves, operatingsystemresource.FieldFixedCvesURL, operatingsystemresource.FieldFixedCves, operatingsystemresource.FieldTenantID, operatingsystemresource.FieldCreatedAt, operatingsystemresource.FieldUpdatedAt: + case operatingsystemresource.FieldResourceID, operatingsystemresource.FieldName, operatingsystemresource.FieldArchitecture, operatingsystemresource.FieldKernelCommand, operatingsystemresource.FieldUpdateSources, operatingsystemresource.FieldImageURL, operatingsystemresource.FieldImageID, operatingsystemresource.FieldSha256, operatingsystemresource.FieldProfileName, operatingsystemresource.FieldProfileVersion, operatingsystemresource.FieldInstalledPackages, operatingsystemresource.FieldInstalledPackagesURL, operatingsystemresource.FieldSecurityFeature, operatingsystemresource.FieldOsType, operatingsystemresource.FieldOsProvider, operatingsystemresource.FieldPlatformBundle, operatingsystemresource.FieldDescription, operatingsystemresource.FieldMetadata, operatingsystemresource.FieldExistingCvesURL, operatingsystemresource.FieldExistingCves, operatingsystemresource.FieldFixedCvesURL, operatingsystemresource.FieldFixedCves, operatingsystemresource.FieldTenantID, operatingsystemresource.FieldCreatedAt, operatingsystemresource.FieldUpdatedAt: values[i] = new(sql.NullString) default: values[i] = new(sql.UnknownType) @@ -163,6 +165,12 @@ func (osr *OperatingSystemResource) assignValues(columns []string, values []any) } else if value.Valid { osr.InstalledPackages = value.String } + case operatingsystemresource.FieldInstalledPackagesURL: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field installed_packages_url", values[i]) + } else if value.Valid { + osr.InstalledPackagesURL = value.String + } case operatingsystemresource.FieldSecurityFeature: if value, ok := values[i].(*sql.NullString); !ok { return fmt.Errorf("unexpected type %T for field security_feature", values[i]) @@ -310,6 +318,9 @@ func (osr *OperatingSystemResource) String() string { builder.WriteString("installed_packages=") builder.WriteString(osr.InstalledPackages) builder.WriteString(", ") + builder.WriteString("installed_packages_url=") + builder.WriteString(osr.InstalledPackagesURL) + builder.WriteString(", ") builder.WriteString("security_feature=") builder.WriteString(fmt.Sprintf("%v", osr.SecurityFeature)) builder.WriteString(", ") diff --git a/inventory/internal/ent/operatingsystemresource/operatingsystemresource.go b/inventory/internal/ent/operatingsystemresource/operatingsystemresource.go index f02c763d3..a9ddad067 100644 --- a/inventory/internal/ent/operatingsystemresource/operatingsystemresource.go +++ b/inventory/internal/ent/operatingsystemresource/operatingsystemresource.go @@ -35,6 +35,8 @@ const ( FieldProfileVersion = "profile_version" // FieldInstalledPackages holds the string denoting the installed_packages field in the database. FieldInstalledPackages = "installed_packages" + // FieldInstalledPackagesURL holds the string denoting the installed_packages_url field in the database. + FieldInstalledPackagesURL = "installed_packages_url" // FieldSecurityFeature holds the string denoting the security_feature field in the database. FieldSecurityFeature = "security_feature" // FieldOsType holds the string denoting the os_type field in the database. @@ -79,6 +81,7 @@ var Columns = []string{ FieldProfileName, FieldProfileVersion, FieldInstalledPackages, + FieldInstalledPackagesURL, FieldSecurityFeature, FieldOsType, FieldOsProvider, @@ -239,6 +242,11 @@ func ByInstalledPackages(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldInstalledPackages, opts...).ToFunc() } +// ByInstalledPackagesURL orders the results by the installed_packages_url field. +func ByInstalledPackagesURL(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldInstalledPackagesURL, opts...).ToFunc() +} + // BySecurityFeature orders the results by the security_feature field. func BySecurityFeature(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldSecurityFeature, opts...).ToFunc() diff --git a/inventory/internal/ent/operatingsystemresource/where.go b/inventory/internal/ent/operatingsystemresource/where.go index 6de8a5344..558cd70e7 100644 --- a/inventory/internal/ent/operatingsystemresource/where.go +++ b/inventory/internal/ent/operatingsystemresource/where.go @@ -107,6 +107,11 @@ func InstalledPackages(v string) predicate.OperatingSystemResource { return predicate.OperatingSystemResource(sql.FieldEQ(FieldInstalledPackages, v)) } +// InstalledPackagesURL applies equality check predicate on the "installed_packages_url" field. It's identical to InstalledPackagesURLEQ. +func InstalledPackagesURL(v string) predicate.OperatingSystemResource { + return predicate.OperatingSystemResource(sql.FieldEQ(FieldInstalledPackagesURL, v)) +} + // PlatformBundle applies equality check predicate on the "platform_bundle" field. It's identical to PlatformBundleEQ. func PlatformBundle(v string) predicate.OperatingSystemResource { return predicate.OperatingSystemResource(sql.FieldEQ(FieldPlatformBundle, v)) @@ -972,6 +977,81 @@ func InstalledPackagesContainsFold(v string) predicate.OperatingSystemResource { return predicate.OperatingSystemResource(sql.FieldContainsFold(FieldInstalledPackages, v)) } +// InstalledPackagesURLEQ applies the EQ predicate on the "installed_packages_url" field. +func InstalledPackagesURLEQ(v string) predicate.OperatingSystemResource { + return predicate.OperatingSystemResource(sql.FieldEQ(FieldInstalledPackagesURL, v)) +} + +// InstalledPackagesURLNEQ applies the NEQ predicate on the "installed_packages_url" field. +func InstalledPackagesURLNEQ(v string) predicate.OperatingSystemResource { + return predicate.OperatingSystemResource(sql.FieldNEQ(FieldInstalledPackagesURL, v)) +} + +// InstalledPackagesURLIn applies the In predicate on the "installed_packages_url" field. +func InstalledPackagesURLIn(vs ...string) predicate.OperatingSystemResource { + return predicate.OperatingSystemResource(sql.FieldIn(FieldInstalledPackagesURL, vs...)) +} + +// InstalledPackagesURLNotIn applies the NotIn predicate on the "installed_packages_url" field. +func InstalledPackagesURLNotIn(vs ...string) predicate.OperatingSystemResource { + return predicate.OperatingSystemResource(sql.FieldNotIn(FieldInstalledPackagesURL, vs...)) +} + +// InstalledPackagesURLGT applies the GT predicate on the "installed_packages_url" field. +func InstalledPackagesURLGT(v string) predicate.OperatingSystemResource { + return predicate.OperatingSystemResource(sql.FieldGT(FieldInstalledPackagesURL, v)) +} + +// InstalledPackagesURLGTE applies the GTE predicate on the "installed_packages_url" field. +func InstalledPackagesURLGTE(v string) predicate.OperatingSystemResource { + return predicate.OperatingSystemResource(sql.FieldGTE(FieldInstalledPackagesURL, v)) +} + +// InstalledPackagesURLLT applies the LT predicate on the "installed_packages_url" field. +func InstalledPackagesURLLT(v string) predicate.OperatingSystemResource { + return predicate.OperatingSystemResource(sql.FieldLT(FieldInstalledPackagesURL, v)) +} + +// InstalledPackagesURLLTE applies the LTE predicate on the "installed_packages_url" field. +func InstalledPackagesURLLTE(v string) predicate.OperatingSystemResource { + return predicate.OperatingSystemResource(sql.FieldLTE(FieldInstalledPackagesURL, v)) +} + +// InstalledPackagesURLContains applies the Contains predicate on the "installed_packages_url" field. +func InstalledPackagesURLContains(v string) predicate.OperatingSystemResource { + return predicate.OperatingSystemResource(sql.FieldContains(FieldInstalledPackagesURL, v)) +} + +// InstalledPackagesURLHasPrefix applies the HasPrefix predicate on the "installed_packages_url" field. +func InstalledPackagesURLHasPrefix(v string) predicate.OperatingSystemResource { + return predicate.OperatingSystemResource(sql.FieldHasPrefix(FieldInstalledPackagesURL, v)) +} + +// InstalledPackagesURLHasSuffix applies the HasSuffix predicate on the "installed_packages_url" field. +func InstalledPackagesURLHasSuffix(v string) predicate.OperatingSystemResource { + return predicate.OperatingSystemResource(sql.FieldHasSuffix(FieldInstalledPackagesURL, v)) +} + +// InstalledPackagesURLIsNil applies the IsNil predicate on the "installed_packages_url" field. +func InstalledPackagesURLIsNil() predicate.OperatingSystemResource { + return predicate.OperatingSystemResource(sql.FieldIsNull(FieldInstalledPackagesURL)) +} + +// InstalledPackagesURLNotNil applies the NotNil predicate on the "installed_packages_url" field. +func InstalledPackagesURLNotNil() predicate.OperatingSystemResource { + return predicate.OperatingSystemResource(sql.FieldNotNull(FieldInstalledPackagesURL)) +} + +// InstalledPackagesURLEqualFold applies the EqualFold predicate on the "installed_packages_url" field. +func InstalledPackagesURLEqualFold(v string) predicate.OperatingSystemResource { + return predicate.OperatingSystemResource(sql.FieldEqualFold(FieldInstalledPackagesURL, v)) +} + +// InstalledPackagesURLContainsFold applies the ContainsFold predicate on the "installed_packages_url" field. +func InstalledPackagesURLContainsFold(v string) predicate.OperatingSystemResource { + return predicate.OperatingSystemResource(sql.FieldContainsFold(FieldInstalledPackagesURL, v)) +} + // SecurityFeatureEQ applies the EQ predicate on the "security_feature" field. func SecurityFeatureEQ(v SecurityFeature) predicate.OperatingSystemResource { return predicate.OperatingSystemResource(sql.FieldEQ(FieldSecurityFeature, v)) diff --git a/inventory/internal/ent/operatingsystemresource_create.go b/inventory/internal/ent/operatingsystemresource_create.go index 6755bded7..c740a9da0 100644 --- a/inventory/internal/ent/operatingsystemresource_create.go +++ b/inventory/internal/ent/operatingsystemresource_create.go @@ -165,6 +165,20 @@ func (osrc *OperatingSystemResourceCreate) SetNillableInstalledPackages(s *strin return osrc } +// SetInstalledPackagesURL sets the "installed_packages_url" field. +func (osrc *OperatingSystemResourceCreate) SetInstalledPackagesURL(s string) *OperatingSystemResourceCreate { + osrc.mutation.SetInstalledPackagesURL(s) + return osrc +} + +// SetNillableInstalledPackagesURL sets the "installed_packages_url" field if the given value is not nil. +func (osrc *OperatingSystemResourceCreate) SetNillableInstalledPackagesURL(s *string) *OperatingSystemResourceCreate { + if s != nil { + osrc.SetInstalledPackagesURL(*s) + } + return osrc +} + // SetSecurityFeature sets the "security_feature" field. func (osrc *OperatingSystemResourceCreate) SetSecurityFeature(of operatingsystemresource.SecurityFeature) *OperatingSystemResourceCreate { osrc.mutation.SetSecurityFeature(of) @@ -449,6 +463,10 @@ func (osrc *OperatingSystemResourceCreate) createSpec() (*OperatingSystemResourc _spec.SetField(operatingsystemresource.FieldInstalledPackages, field.TypeString, value) _node.InstalledPackages = value } + if value, ok := osrc.mutation.InstalledPackagesURL(); ok { + _spec.SetField(operatingsystemresource.FieldInstalledPackagesURL, field.TypeString, value) + _node.InstalledPackagesURL = value + } if value, ok := osrc.mutation.SecurityFeature(); ok { _spec.SetField(operatingsystemresource.FieldSecurityFeature, field.TypeEnum, value) _node.SecurityFeature = value diff --git a/inventory/internal/ent/operatingsystemresource_update.go b/inventory/internal/ent/operatingsystemresource_update.go index 1636ab3e3..53bcddbc1 100644 --- a/inventory/internal/ent/operatingsystemresource_update.go +++ b/inventory/internal/ent/operatingsystemresource_update.go @@ -304,6 +304,9 @@ func (osru *OperatingSystemResourceUpdate) sqlSave(ctx context.Context) (n int, if osru.mutation.InstalledPackagesCleared() { _spec.ClearField(operatingsystemresource.FieldInstalledPackages, field.TypeString) } + if osru.mutation.InstalledPackagesURLCleared() { + _spec.ClearField(operatingsystemresource.FieldInstalledPackagesURL, field.TypeString) + } if osru.mutation.SecurityFeatureCleared() { _spec.ClearField(operatingsystemresource.FieldSecurityFeature, field.TypeEnum) } @@ -670,6 +673,9 @@ func (osruo *OperatingSystemResourceUpdateOne) sqlSave(ctx context.Context) (_no if osruo.mutation.InstalledPackagesCleared() { _spec.ClearField(operatingsystemresource.FieldInstalledPackages, field.TypeString) } + if osruo.mutation.InstalledPackagesURLCleared() { + _spec.ClearField(operatingsystemresource.FieldInstalledPackagesURL, field.TypeString) + } if osruo.mutation.SecurityFeatureCleared() { _spec.ClearField(operatingsystemresource.FieldSecurityFeature, field.TypeEnum) } diff --git a/inventory/internal/ent/schema/operating_system_resource.go b/inventory/internal/ent/schema/operating_system_resource.go index 1dcd336cf..334389ec7 100644 --- a/inventory/internal/ent/schema/operating_system_resource.go +++ b/inventory/internal/ent/schema/operating_system_resource.go @@ -14,7 +14,7 @@ type OperatingSystemResource struct { } func (OperatingSystemResource) Fields() []ent.Field { - return []ent.Field{field.String("resource_id").Unique(), field.String("name").Optional(), field.String("architecture").Optional(), field.String("kernel_command").Optional(), field.String("update_sources").Optional(), field.String("image_url").Optional().Immutable(), field.String("image_id").Optional().Immutable(), field.String("sha256").Optional().Immutable(), field.String("profile_name").Optional().Immutable(), field.String("profile_version").Optional().Immutable(), field.String("installed_packages").Optional(), field.Enum("security_feature").Optional().Immutable().Values("SECURITY_FEATURE_UNSPECIFIED", "SECURITY_FEATURE_NONE", "SECURITY_FEATURE_SECURE_BOOT_AND_FULL_DISK_ENCRYPTION"), field.Enum("os_type").Optional().Immutable().Values("OS_TYPE_UNSPECIFIED", "OS_TYPE_MUTABLE", "OS_TYPE_IMMUTABLE"), field.Enum("os_provider").Immutable().Values("OS_PROVIDER_KIND_UNSPECIFIED", "OS_PROVIDER_KIND_INFRA", "OS_PROVIDER_KIND_LENOVO"), field.String("platform_bundle").Optional().Immutable(), field.String("description").Optional().Immutable(), field.String("metadata").Optional(), field.String("existing_cves_url").Optional().Immutable(), field.String("existing_cves").Optional(), field.String("fixed_cves_url").Optional().Immutable(), field.String("fixed_cves").Optional(), field.String("tenant_id").Immutable(), field.String("created_at").Immutable().SchemaType(map[string]string{"postgres": "TIMESTAMP"}), field.String("updated_at").SchemaType(map[string]string{"postgres": "TIMESTAMP"})} + return []ent.Field{field.String("resource_id").Unique(), field.String("name").Optional(), field.String("architecture").Optional(), field.String("kernel_command").Optional(), field.String("update_sources").Optional(), field.String("image_url").Optional().Immutable(), field.String("image_id").Optional().Immutable(), field.String("sha256").Optional().Immutable(), field.String("profile_name").Optional().Immutable(), field.String("profile_version").Optional().Immutable(), field.String("installed_packages").Optional(), field.String("installed_packages_url").Optional().Immutable(), field.Enum("security_feature").Optional().Immutable().Values("SECURITY_FEATURE_UNSPECIFIED", "SECURITY_FEATURE_NONE", "SECURITY_FEATURE_SECURE_BOOT_AND_FULL_DISK_ENCRYPTION"), field.Enum("os_type").Optional().Immutable().Values("OS_TYPE_UNSPECIFIED", "OS_TYPE_MUTABLE", "OS_TYPE_IMMUTABLE"), field.Enum("os_provider").Immutable().Values("OS_PROVIDER_KIND_UNSPECIFIED", "OS_PROVIDER_KIND_INFRA", "OS_PROVIDER_KIND_LENOVO"), field.String("platform_bundle").Optional().Immutable(), field.String("description").Optional().Immutable(), field.String("metadata").Optional(), field.String("existing_cves_url").Optional().Immutable(), field.String("existing_cves").Optional(), field.String("fixed_cves_url").Optional().Immutable(), field.String("fixed_cves").Optional(), field.String("tenant_id").Immutable(), field.String("created_at").Immutable().SchemaType(map[string]string{"postgres": "TIMESTAMP"}), field.String("updated_at").SchemaType(map[string]string{"postgres": "TIMESTAMP"})} } func (OperatingSystemResource) Edges() []ent.Edge { return nil diff --git a/inventory/internal/store/conversions.go b/inventory/internal/store/conversions.go index aa0acd492..6ae0eaaf8 100644 --- a/inventory/internal/store/conversions.go +++ b/inventory/internal/store/conversions.go @@ -195,29 +195,30 @@ func entOperatingSystemResourceToProtoOperatingSystemResource(os *ent.OperatingS osType := osv1.OsType_value[os.OsType.String()] // Defaults to 0 if not found osProvider := osv1.OsProviderKind_value[os.OsProvider.String()] // Defaults to 0 if not found protoUpdate := &osv1.OperatingSystemResource{ - ResourceId: os.ResourceID, - Name: os.Name, - Architecture: os.Architecture, - KernelCommand: os.KernelCommand, - ImageUrl: os.ImageURL, - ImageId: os.ImageID, - Sha256: os.Sha256, - ProfileName: os.ProfileName, - ProfileVersion: os.ProfileVersion, - InstalledPackages: os.InstalledPackages, - SecurityFeature: osv1.SecurityFeature(securityFeatures), - OsType: osv1.OsType(osType), - OsProvider: osv1.OsProviderKind(osProvider), - PlatformBundle: os.PlatformBundle, - Description: os.Description, - ExistingCvesUrl: os.ExistingCvesURL, - ExistingCves: os.ExistingCves, - FixedCvesUrl: os.FixedCvesURL, - FixedCves: os.FixedCves, - TenantId: os.TenantID, - CreatedAt: os.CreatedAt, - UpdatedAt: os.UpdatedAt, - Metadata: os.Metadata, + ResourceId: os.ResourceID, + Name: os.Name, + Architecture: os.Architecture, + KernelCommand: os.KernelCommand, + ImageUrl: os.ImageURL, + ImageId: os.ImageID, + Sha256: os.Sha256, + ProfileName: os.ProfileName, + ProfileVersion: os.ProfileVersion, + InstalledPackages: os.InstalledPackages, + InstalledPackagesUrl: os.InstalledPackagesURL, + SecurityFeature: osv1.SecurityFeature(securityFeatures), + OsType: osv1.OsType(osType), + OsProvider: osv1.OsProviderKind(osProvider), + PlatformBundle: os.PlatformBundle, + Description: os.Description, + ExistingCvesUrl: os.ExistingCvesURL, + ExistingCves: os.ExistingCves, + FixedCvesUrl: os.FixedCvesURL, + FixedCves: os.FixedCves, + TenantId: os.TenantID, + CreatedAt: os.CreatedAt, + UpdatedAt: os.UpdatedAt, + Metadata: os.Metadata, } if os.UpdateSources != "" { protoUpdate.UpdateSources = strings.Split(os.UpdateSources, "|") diff --git a/inventory/internal/store/os_test.go b/inventory/internal/store/os_test.go index 8eb5ce07e..36d24ba63 100644 --- a/inventory/internal/store/os_test.go +++ b/inventory/internal/store/os_test.go @@ -35,20 +35,21 @@ func Test_Create_Get_Delete_Update_Os(t *testing.T) { }{ "CreateGoodOs": { in: &os_v1.OperatingSystemResource{ - Name: "Test Os 1", - UpdateSources: []string{"test entry1", "test entry2"}, - ImageUrl: "Repo test entry", - ImageId: "some ID", - Sha256: inv_testing.RandomSha256v1, - ProfileName: "Test OS profile name", - InstalledPackages: "intel-opencl-icd\nintel-level-zero-gpu\nlevel-zero", - SecurityFeature: os_v1.SecurityFeature_SECURITY_FEATURE_NONE, - ProfileVersion: "1.0.0", - OsType: os_v1.OsType_OS_TYPE_IMMUTABLE, - OsProvider: os_v1.OsProviderKind_OS_PROVIDER_KIND_INFRA, - PlatformBundle: "test platform bundle", - Description: "test description", - ExistingCvesUrl: "https://example.com/cves", + Name: "Test Os 1", + UpdateSources: []string{"test entry1", "test entry2"}, + ImageUrl: "Repo test entry", + ImageId: "some ID", + Sha256: inv_testing.RandomSha256v1, + ProfileName: "Test OS profile name", + InstalledPackages: "intel-opencl-icd\nintel-level-zero-gpu\nlevel-zero", + InstalledPackagesUrl: "https://manifest-url.example.com/installed-packages.txt", + SecurityFeature: os_v1.SecurityFeature_SECURITY_FEATURE_NONE, + ProfileVersion: "1.0.0", + OsType: os_v1.OsType_OS_TYPE_IMMUTABLE, + OsProvider: os_v1.OsProviderKind_OS_PROVIDER_KIND_INFRA, + PlatformBundle: "test platform bundle", + Description: "test description", + ExistingCvesUrl: "https://example.com/cves", ExistingCves: `[ { "cve_id": "CVE-000-000", @@ -66,18 +67,19 @@ func Test_Create_Get_Delete_Update_Os(t *testing.T) { }, "CreateGoodOsLenovoProvider": { in: &os_v1.OperatingSystemResource{ - Name: "Test Os 1", - UpdateSources: []string{"test entry1", "test entry2"}, - ImageUrl: "Repo test entry", - ImageId: "some ID", - Sha256: inv_testing.RandomSha256v1, - ProfileName: "Test OS profile name", - InstalledPackages: "intel-opencl-icd\nintel-level-zero-gpu\nlevel-zero", - SecurityFeature: os_v1.SecurityFeature_SECURITY_FEATURE_NONE, - ProfileVersion: "1.0.0", - OsType: os_v1.OsType_OS_TYPE_IMMUTABLE, - OsProvider: os_v1.OsProviderKind_OS_PROVIDER_KIND_LENOVO, - Description: "test description", + Name: "Test Os 1", + UpdateSources: []string{"test entry1", "test entry2"}, + ImageUrl: "Repo test entry", + ImageId: "some ID", + Sha256: inv_testing.RandomSha256v1, + ProfileName: "Test OS profile name", + InstalledPackages: "intel-opencl-icd\nintel-level-zero-gpu\nlevel-zero", + InstalledPackagesUrl: "https://manifest-url.example.com/installed-packages.txt", + SecurityFeature: os_v1.SecurityFeature_SECURITY_FEATURE_NONE, + ProfileVersion: "1.0.0", + OsType: os_v1.OsType_OS_TYPE_IMMUTABLE, + OsProvider: os_v1.OsProviderKind_OS_PROVIDER_KIND_LENOVO, + Description: "test description", }, valid: true, }, @@ -114,12 +116,13 @@ func Test_Create_Get_Delete_Update_Os(t *testing.T) { }, "CreateGoodOsMissingSha": { in: &os_v1.OperatingSystemResource{ - Name: "Test Os 1", - UpdateSources: []string{"test entry1", "test entry2"}, - ImageUrl: "Repo test entry", - InstalledPackages: "intel-opencl-icd\nintel-level-zero-gpu\nlevel-zero", - OsType: os_v1.OsType_OS_TYPE_MUTABLE, - OsProvider: os_v1.OsProviderKind_OS_PROVIDER_KIND_INFRA, + Name: "Test Os 1", + UpdateSources: []string{"test entry1", "test entry2"}, + ImageUrl: "Repo test entry", + InstalledPackages: "intel-opencl-icd\nintel-level-zero-gpu\nlevel-zero", + InstalledPackagesUrl: "https://manifest-url.example.com/installed-packages.txt", + OsType: os_v1.OsType_OS_TYPE_MUTABLE, + OsProvider: os_v1.OsProviderKind_OS_PROVIDER_KIND_INFRA, }, valid: true, }, @@ -161,14 +164,15 @@ func Test_Create_Get_Delete_Update_Os(t *testing.T) { }, "CreateGoodOsNoRepoURL": { in: &os_v1.OperatingSystemResource{ - Name: "Test Os 1", - UpdateSources: []string{"test entry1", "test entry2"}, - Sha256: inv_testing.RandomSha256v1, - ProfileName: "Test OS profile name", - InstalledPackages: "intel-opencl-icd\nintel-level-zero-gpu\nlevel-zero", - SecurityFeature: os_v1.SecurityFeature_SECURITY_FEATURE_NONE, - OsType: os_v1.OsType_OS_TYPE_MUTABLE, - OsProvider: os_v1.OsProviderKind_OS_PROVIDER_KIND_INFRA, + Name: "Test Os 1", + UpdateSources: []string{"test entry1", "test entry2"}, + Sha256: inv_testing.RandomSha256v1, + ProfileName: "Test OS profile name", + InstalledPackages: "intel-opencl-icd\nintel-level-zero-gpu\nlevel-zero", + InstalledPackagesUrl: "https://manifest-url.example.com/installed-packages.txt", + SecurityFeature: os_v1.SecurityFeature_SECURITY_FEATURE_NONE, + OsType: os_v1.OsType_OS_TYPE_MUTABLE, + OsProvider: os_v1.OsProviderKind_OS_PROVIDER_KIND_INFRA, }, valid: true, }, @@ -188,15 +192,16 @@ func Test_Create_Get_Delete_Update_Os(t *testing.T) { }, "CreateBadOsDuplicateMetadata2": { in: &os_v1.OperatingSystemResource{ - Name: "Test Os 1", - UpdateSources: []string{"test entry1", "test entry2"}, - Sha256: inv_testing.RandomSha256v1, - ProfileName: "Test OS profile name", - InstalledPackages: "intel-opencl-icd\nintel-level-zero-gpu\nlevel-zero", - SecurityFeature: os_v1.SecurityFeature_SECURITY_FEATURE_NONE, - OsType: os_v1.OsType_OS_TYPE_MUTABLE, - OsProvider: os_v1.OsProviderKind_OS_PROVIDER_KIND_INFRA, - Metadata: "invalid JSON", + Name: "Test Os 1", + UpdateSources: []string{"test entry1", "test entry2"}, + Sha256: inv_testing.RandomSha256v1, + ProfileName: "Test OS profile name", + InstalledPackages: "intel-opencl-icd\nintel-level-zero-gpu\nlevel-zero", + InstalledPackagesUrl: "https://manifest-url.example.com/installed-packages.txt", + SecurityFeature: os_v1.SecurityFeature_SECURITY_FEATURE_NONE, + OsType: os_v1.OsType_OS_TYPE_MUTABLE, + OsProvider: os_v1.OsProviderKind_OS_PROVIDER_KIND_INFRA, + Metadata: "invalid JSON", }, valid: false, }, @@ -493,15 +498,16 @@ func Test_UpdateOs(t *testing.T) { createresreq := &inv_v1.Resource{ Resource: &inv_v1.Resource_Os{ Os: &os_v1.OperatingSystemResource{ - Name: "Test Os 1", - UpdateSources: []string{"test entries"}, - ImageUrl: "Repo test entry", - Sha256: inv_testing.RandomSha256v1, - ProfileName: "Test OS profile name 1", - InstalledPackages: "intel-opencl-icd\nintel-level-zero-gpu\nlevel-zero", - SecurityFeature: os_v1.SecurityFeature_SECURITY_FEATURE_SECURE_BOOT_AND_FULL_DISK_ENCRYPTION, - OsType: os_v1.OsType_OS_TYPE_MUTABLE, - OsProvider: os_v1.OsProviderKind_OS_PROVIDER_KIND_INFRA, + Name: "Test Os 1", + UpdateSources: []string{"test entries"}, + ImageUrl: "Repo test entry", + Sha256: inv_testing.RandomSha256v1, + ProfileName: "Test OS profile name 1", + InstalledPackages: "intel-opencl-icd\nintel-level-zero-gpu\nlevel-zero", + InstalledPackagesUrl: "https://manifest-url.example.com/installed-packages.txt", + SecurityFeature: os_v1.SecurityFeature_SECURITY_FEATURE_SECURE_BOOT_AND_FULL_DISK_ENCRYPTION, + OsType: os_v1.OsType_OS_TYPE_MUTABLE, + OsProvider: os_v1.OsProviderKind_OS_PROVIDER_KIND_INFRA, }, }, } @@ -671,14 +677,15 @@ func Test_ImmutableFieldsOnUpdate(t *testing.T) { createresreq := &inv_v1.Resource{ Resource: &inv_v1.Resource_Os{ Os: &os_v1.OperatingSystemResource{ - Name: "Test Os 1", - UpdateSources: []string{"test entries"}, - ImageUrl: "Repo test entry", - Sha256: inv_testing.RandomSha256v1, - ProfileName: "Test OS profile name 1", - InstalledPackages: "intel-opencl-icd\nintel-level-zero-gpu\nlevel-zero", - OsType: os_v1.OsType_OS_TYPE_MUTABLE, - OsProvider: os_v1.OsProviderKind_OS_PROVIDER_KIND_INFRA, + Name: "Test Os 1", + UpdateSources: []string{"test entries"}, + ImageUrl: "Repo test entry", + Sha256: inv_testing.RandomSha256v1, + ProfileName: "Test OS profile name 1", + InstalledPackages: "intel-opencl-icd\nintel-level-zero-gpu\nlevel-zero", + InstalledPackagesUrl: "https://manifest-url.example.com/installed-packages.txt", + OsType: os_v1.OsType_OS_TYPE_MUTABLE, + OsProvider: os_v1.OsProviderKind_OS_PROVIDER_KIND_INFRA, }, }, } @@ -698,16 +705,17 @@ func Test_ImmutableFieldsOnUpdate(t *testing.T) { t.Logf("SHA256 in OS resource is %v", getresp.GetResource().GetOs().GetSha256()) allFields := os_v1.OperatingSystemResource{ - ResourceId: os1.ResourceId, - Name: "TEST", - Architecture: "TEST", - KernelCommand: "TEST", - UpdateSources: []string{"TEST"}, - ImageUrl: "TEST", - Sha256: inv_testing.RandomSha256v2, - ProfileName: "Test OS profile name 2", - InstalledPackages: "intel-opencl-icd\nintel-level-zero-gpu\nlevel-zero", - Description: "test description", + ResourceId: os1.ResourceId, + Name: "TEST", + Architecture: "TEST", + KernelCommand: "TEST", + UpdateSources: []string{"TEST"}, + ImageUrl: "TEST", + Sha256: inv_testing.RandomSha256v2, + ProfileName: "Test OS profile name 2", + InstalledPackages: "intel-opencl-icd\nintel-level-zero-gpu\nlevel-zero", + InstalledPackagesUrl: "https://manifest-url.example.com/installed-packages.txt", + Description: "test description", } fmAllFields, err := util.BuildFieldMaskFromMessage(&allFields) require.NoError(t, err, "Failed to create fieldmask for all Fields") @@ -817,6 +825,19 @@ func Test_ImmutableFieldsOnUpdate(t *testing.T) { valid: false, expErrorCode: codes.InvalidArgument, }, + "UpdateImmutableInstalledPackagesUrl": { + in: &os_v1.OperatingSystemResource{ + InstalledPackagesUrl: "https://some-new-url.example.com/test-installed-packages.txt", + }, + resourceID: os1.ResourceId, + fieldMask: &fieldmaskpb.FieldMask{ + Paths: []string{ + oss.FieldInstalledPackagesURL, + }, + }, + valid: false, + expErrorCode: codes.InvalidArgument, + }, } for tcname, tc := range testcases { t.Run(tcname, func(t *testing.T) { diff --git a/inventory/pkg/api/os/v1/os.pb.go b/inventory/pkg/api/os/v1/os.pb.go index 40932c074..5a44d8b4e 100644 --- a/inventory/pkg/api/os/v1/os.pb.go +++ b/inventory/pkg/api/os/v1/os.pb.go @@ -184,30 +184,33 @@ type OperatingSystemResource struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ResourceId string `protobuf:"bytes,1,opt,name=resource_id,json=resourceId,proto3" json:"resource_id,omitempty"` // Resource ID of this OperatingSystemResource - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // user-provided, human-readable name of OS - Architecture string `protobuf:"bytes,3,opt,name=architecture,proto3" json:"architecture,omitempty"` // CPU architecture supported - KernelCommand string `protobuf:"bytes,4,opt,name=kernel_command,json=kernelCommand,proto3" json:"kernel_command,omitempty"` // Kernel Command Line Options. Deprecated in EMF-v3.1, use OSUpdatePolicy. - UpdateSources []string `protobuf:"bytes,5,rep,name=update_sources,json=updateSources,proto3" json:"update_sources,omitempty"` // OS Update Sources. Should be in 'DEB822 Source Format' for Debian style OSs. Deprecated in EMF-v3.1, use OSUpdatePolicy. - ImageUrl string `protobuf:"bytes,6,opt,name=image_url,json=imageUrl,proto3" json:"image_url,omitempty"` // OS image URL. URL of the original installation source. - ImageId string `protobuf:"bytes,13,opt,name=image_id,json=imageId,proto3" json:"image_id,omitempty"` // OS image ID. This must be a unique identifier of OS image that can be retrieved from running OS. Used by IMMUTABLE only. - Sha256 string `protobuf:"bytes,7,opt,name=sha256,proto3" json:"sha256,omitempty"` // SHA256 checksum of the OS resource in HEX. It's length is 32 bytes, but string representation of HEX is twice long (64 chars) - ProfileName string `protobuf:"bytes,8,opt,name=profile_name,json=profileName,proto3" json:"profile_name,omitempty"` // Name of an OS profile that the OS resource belongs to. Uniquely identifies family of OSResources. - ProfileVersion string `protobuf:"bytes,12,opt,name=profile_version,json=profileVersion,proto3" json:"profile_version,omitempty"` // Version of an OS profile that the OS resource belongs to. Along with profile_name uniquely identifies OS resource. - InstalledPackages string `protobuf:"bytes,9,opt,name=installed_packages,json=installedPackages,proto3" json:"installed_packages,omitempty"` // Freeform text, OS-dependent. A list of package names, one per line (newline separated). Should not contain version info. Deprecated in EMF-v3.1, use OSUpdatePolicy. - SecurityFeature SecurityFeature `protobuf:"varint,10,opt,name=security_feature,json=securityFeature,proto3,enum=os.v1.SecurityFeature" json:"security_feature,omitempty"` // Indicating if this OS is capable of supporting features like Secure Boot (SB) and Full Disk Encryption (FDE). - OsType OsType `protobuf:"varint,11,opt,name=os_type,json=osType,proto3,enum=os.v1.OsType" json:"os_type,omitempty"` // Indicating the type of OS (for example, mutable or immutable). - OsProvider OsProviderKind `protobuf:"varint,14,opt,name=os_provider,json=osProvider,proto3,enum=os.v1.OsProviderKind" json:"os_provider,omitempty"` // Indicating the provider of OS (e.g., Infra or Lenovo). - PlatformBundle string `protobuf:"bytes,15,opt,name=platform_bundle,json=platformBundle,proto3" json:"platform_bundle,omitempty"` // An opaque JSON string storing a reference to custom installation script(s) that supplements the base OS with additional OS-level dependencies/configurations. If empty, the default OS installation will be used. - Description string `protobuf:"bytes,16,opt,name=description,proto3" json:"description,omitempty"` // user-provided, human-readable description of OS - Metadata string `protobuf:"bytes,18,opt,name=metadata,proto3" json:"metadata,omitempty"` // Opaque JSON field storing metadata associated to this OS resource. Expected to be a JSON object with string keys and values, or an empty string. - ExistingCvesUrl string `protobuf:"bytes,42,opt,name=existing_cves_url,json=existingCvesUrl,proto3" json:"existing_cves_url,omitempty"` // URL of the file containing information about the existing CVEs on the Operating System. - ExistingCves string `protobuf:"bytes,43,opt,name=existing_cves,json=existingCves,proto3" json:"existing_cves,omitempty"` // The CVEs that are currently present on the Operating System, encoded as a JSON list. - FixedCvesUrl string `protobuf:"bytes,44,opt,name=fixed_cves_url,json=fixedCvesUrl,proto3" json:"fixed_cves_url,omitempty"` // URL of the file containing information about the CVEs that have been fixed by this OS Resource version. - FixedCves string `protobuf:"bytes,45,opt,name=fixed_cves,json=fixedCves,proto3" json:"fixed_cves,omitempty"` // The CVEs that have been fixed by this OS Resource version, encoded as a JSON list. - TenantId string `protobuf:"bytes,100,opt,name=tenant_id,json=tenantId,proto3" json:"tenant_id,omitempty"` // Tenant Identifier - CreatedAt string `protobuf:"bytes,200,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` // Creation timestamp - UpdatedAt string `protobuf:"bytes,201,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` // Update timestamp + ResourceId string `protobuf:"bytes,1,opt,name=resource_id,json=resourceId,proto3" json:"resource_id,omitempty"` // Resource ID of this OperatingSystemResource + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // user-provided, human-readable name of OS + Architecture string `protobuf:"bytes,3,opt,name=architecture,proto3" json:"architecture,omitempty"` // CPU architecture supported + KernelCommand string `protobuf:"bytes,4,opt,name=kernel_command,json=kernelCommand,proto3" json:"kernel_command,omitempty"` // Kernel Command Line Options. Deprecated in EMF-v3.1, use OSUpdatePolicy. + UpdateSources []string `protobuf:"bytes,5,rep,name=update_sources,json=updateSources,proto3" json:"update_sources,omitempty"` // OS Update Sources. Should be in 'DEB822 Source Format' for Debian style OSs. Deprecated in EMF-v3.1, use OSUpdatePolicy. + ImageUrl string `protobuf:"bytes,6,opt,name=image_url,json=imageUrl,proto3" json:"image_url,omitempty"` // OS image URL. URL of the original installation source. + ImageId string `protobuf:"bytes,13,opt,name=image_id,json=imageId,proto3" json:"image_id,omitempty"` // OS image ID. This must be a unique identifier of OS image that can be retrieved from running OS. Used by IMMUTABLE only. + Sha256 string `protobuf:"bytes,7,opt,name=sha256,proto3" json:"sha256,omitempty"` // SHA256 checksum of the OS resource in HEX. It's length is 32 bytes, but string representation of HEX is twice long (64 chars) + ProfileName string `protobuf:"bytes,8,opt,name=profile_name,json=profileName,proto3" json:"profile_name,omitempty"` // Name of an OS profile that the OS resource belongs to. Uniquely identifies family of OSResources. + ProfileVersion string `protobuf:"bytes,12,opt,name=profile_version,json=profileVersion,proto3" json:"profile_version,omitempty"` // Version of an OS profile that the OS resource belongs to. Along with profile_name uniquely identifies OS resource. + InstalledPackages string `protobuf:"bytes,9,opt,name=installed_packages,json=installedPackages,proto3" json:"installed_packages,omitempty"` // Freeform text, OS-dependent. A list of package names, one per line (newline separated). Should not contain version info. Deprecated in EMF-v3.1, use OSUpdatePolicy. + // The URL of the OS manifest which contains install packages details. This will be used to fill the installed_packages field + // for the advance use case to allow manual creation of OSProfiles when supported from backend. + InstalledPackagesUrl string `protobuf:"bytes,17,opt,name=installed_packages_url,json=installedPackagesUrl,proto3" json:"installed_packages_url,omitempty"` + SecurityFeature SecurityFeature `protobuf:"varint,10,opt,name=security_feature,json=securityFeature,proto3,enum=os.v1.SecurityFeature" json:"security_feature,omitempty"` // Indicating if this OS is capable of supporting features like Secure Boot (SB) and Full Disk Encryption (FDE). + OsType OsType `protobuf:"varint,11,opt,name=os_type,json=osType,proto3,enum=os.v1.OsType" json:"os_type,omitempty"` // Indicating the type of OS (for example, mutable or immutable). + OsProvider OsProviderKind `protobuf:"varint,14,opt,name=os_provider,json=osProvider,proto3,enum=os.v1.OsProviderKind" json:"os_provider,omitempty"` // Indicating the provider of OS (e.g., Infra or Lenovo). + PlatformBundle string `protobuf:"bytes,15,opt,name=platform_bundle,json=platformBundle,proto3" json:"platform_bundle,omitempty"` // An opaque JSON string storing a reference to custom installation script(s) that supplements the base OS with additional OS-level dependencies/configurations. If empty, the default OS installation will be used. + Description string `protobuf:"bytes,16,opt,name=description,proto3" json:"description,omitempty"` // user-provided, human-readable description of OS + Metadata string `protobuf:"bytes,18,opt,name=metadata,proto3" json:"metadata,omitempty"` // Opaque JSON field storing metadata associated to this OS resource. Expected to be a JSON object with string keys and values, or an empty string. + ExistingCvesUrl string `protobuf:"bytes,42,opt,name=existing_cves_url,json=existingCvesUrl,proto3" json:"existing_cves_url,omitempty"` // URL of the file containing information about the existing CVEs on the Operating System. + ExistingCves string `protobuf:"bytes,43,opt,name=existing_cves,json=existingCves,proto3" json:"existing_cves,omitempty"` // The CVEs that are currently present on the Operating System, encoded as a JSON list. + FixedCvesUrl string `protobuf:"bytes,44,opt,name=fixed_cves_url,json=fixedCvesUrl,proto3" json:"fixed_cves_url,omitempty"` // URL of the file containing information about the CVEs that have been fixed by this OS Resource version. + FixedCves string `protobuf:"bytes,45,opt,name=fixed_cves,json=fixedCves,proto3" json:"fixed_cves,omitempty"` // The CVEs that have been fixed by this OS Resource version, encoded as a JSON list. + TenantId string `protobuf:"bytes,100,opt,name=tenant_id,json=tenantId,proto3" json:"tenant_id,omitempty"` // Tenant Identifier + CreatedAt string `protobuf:"bytes,200,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` // Creation timestamp + UpdatedAt string `protobuf:"bytes,201,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` // Update timestamp } func (x *OperatingSystemResource) Reset() { @@ -319,6 +322,13 @@ func (x *OperatingSystemResource) GetInstalledPackages() string { return "" } +func (x *OperatingSystemResource) GetInstalledPackagesUrl() string { + if x != nil { + return x.InstalledPackagesUrl + } + return "" +} + func (x *OperatingSystemResource) GetSecurityFeature() SecurityFeature { if x != nil { return x.SecurityFeature @@ -418,7 +428,7 @@ var file_os_v1_os_proto_rawDesc = []byte{ 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0e, 0x65, 0x6e, 0x74, 0x2f, 0x6f, 0x70, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x69, 0x6e, 0x76, 0x2f, 0x69, - 0x6e, 0x66, 0x72, 0x61, 0x69, 0x6e, 0x76, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x81, 0x0c, + 0x6e, 0x66, 0x72, 0x61, 0x69, 0x6e, 0x76, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf2, 0x0c, 0x0a, 0x17, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x43, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x22, @@ -450,97 +460,104 @@ var file_os_v1_os_proto_rawDesc = []byte{ 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x31, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xba, 0xa6, 0x49, 0x04, 0x08, 0x01, 0x28, 0x01, 0x52, 0x0e, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, - 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x35, 0x0a, 0x12, 0x69, 0x6e, 0x73, 0x74, 0x61, + 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x37, 0x0a, 0x12, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x18, 0x09, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x06, 0xba, 0xa6, 0x49, 0x02, 0x08, 0x01, 0x52, 0x11, 0x69, 0x6e, 0x73, - 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x12, 0x4b, - 0x0a, 0x10, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x66, 0x65, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x6f, 0x73, 0x2e, 0x76, 0x31, - 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, - 0x42, 0x08, 0xba, 0xa6, 0x49, 0x04, 0x08, 0x01, 0x28, 0x01, 0x52, 0x0f, 0x73, 0x65, 0x63, 0x75, - 0x72, 0x69, 0x74, 0x79, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x30, 0x0a, 0x07, 0x6f, - 0x73, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0d, 0x2e, 0x6f, - 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x73, 0x54, 0x79, 0x70, 0x65, 0x42, 0x08, 0xba, 0xa6, 0x49, - 0x04, 0x08, 0x01, 0x28, 0x01, 0x52, 0x06, 0x6f, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x40, 0x0a, - 0x0b, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, 0x0e, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x6f, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x73, 0x50, 0x72, 0x6f, - 0x76, 0x69, 0x64, 0x65, 0x72, 0x4b, 0x69, 0x6e, 0x64, 0x42, 0x08, 0xba, 0xa6, 0x49, 0x04, 0x08, - 0x00, 0x28, 0x01, 0x52, 0x0a, 0x6f, 0x73, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, - 0x31, 0x0a, 0x0f, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x5f, 0x62, 0x75, 0x6e, 0x64, - 0x6c, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xba, 0xa6, 0x49, 0x04, 0x08, 0x01, - 0x28, 0x01, 0x52, 0x0e, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x75, 0x6e, 0x64, - 0x6c, 0x65, 0x12, 0x64, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, 0x42, 0x42, 0xba, 0x48, 0x37, 0xd8, 0x01, 0x01, 0x72, - 0x32, 0x28, 0xe8, 0x07, 0x32, 0x2d, 0x5e, 0x24, 0x7c, 0x5e, 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, - 0x5a, 0x2d, 0x5f, 0x30, 0x2d, 0x39, 0x2e, 0x3a, 0x3b, 0x3d, 0x40, 0x3f, 0x21, 0x23, 0x2c, 0x3c, - 0x3e, 0x2a, 0x28, 0x29, 0x7b, 0x7d, 0x26, 0x25, 0x24, 0x60, 0x5e, 0x5c, 0x2b, 0x5c, 0x2d, 0x20, - 0x5d, 0x2b, 0x24, 0xba, 0xa6, 0x49, 0x04, 0x08, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x64, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x50, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x42, 0x34, 0xba, 0x48, 0x2b, 0x72, - 0x29, 0x18, 0xf4, 0x03, 0x32, 0x24, 0x5e, 0x24, 0x7c, 0x5e, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, - 0x39, 0x2c, 0x2e, 0x5c, 0x2d, 0x5f, 0x3a, 0x2f, 0x22, 0x5c, 0x5c, 0x20, 0x5c, 0x5c, 0x6e, 0x5c, - 0x7b, 0x5c, 0x7d, 0x5c, 0x5b, 0x5c, 0x5d, 0x5d, 0x2b, 0x24, 0xba, 0xa6, 0x49, 0x02, 0x08, 0x01, - 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x42, 0x0a, 0x11, 0x65, 0x78, - 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x76, 0x65, 0x73, 0x5f, 0x75, 0x72, 0x6c, 0x18, - 0x2a, 0x20, 0x01, 0x28, 0x09, 0x42, 0x16, 0xba, 0x48, 0x0b, 0xd8, 0x01, 0x01, 0x72, 0x06, 0x18, - 0xf4, 0x03, 0x90, 0x01, 0x01, 0xba, 0xa6, 0x49, 0x04, 0x08, 0x01, 0x28, 0x01, 0x52, 0x0f, 0x65, - 0x78, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x43, 0x76, 0x65, 0x73, 0x55, 0x72, 0x6c, 0x12, 0x6b, - 0x0a, 0x0d, 0x65, 0x78, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x76, 0x65, 0x73, 0x18, - 0x2b, 0x20, 0x01, 0x28, 0x09, 0x42, 0x46, 0xba, 0x48, 0x3d, 0xd8, 0x01, 0x01, 0x72, 0x38, 0x18, - 0xa0, 0x9c, 0x01, 0x32, 0x32, 0x5e, 0x24, 0x7c, 0x5e, 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, 0x5a, - 0x2d, 0x5f, 0x30, 0x2d, 0x39, 0x2e, 0x2f, 0x3a, 0x3b, 0x3d, 0x40, 0x3f, 0x21, 0x23, 0x2c, 0x3c, - 0x3e, 0x2a, 0x2b, 0x7e, 0x28, 0x29, 0x22, 0x5c, 0x5c, 0x20, 0x5c, 0x0a, 0x5c, 0x7b, 0x5c, 0x7d, - 0x5c, 0x5b, 0x5c, 0x5d, 0x5d, 0x2b, 0x24, 0xba, 0xa6, 0x49, 0x02, 0x08, 0x01, 0x52, 0x0c, 0x65, - 0x78, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x43, 0x76, 0x65, 0x73, 0x12, 0x3c, 0x0a, 0x0e, 0x66, - 0x69, 0x78, 0x65, 0x64, 0x5f, 0x63, 0x76, 0x65, 0x73, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x2c, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x16, 0xba, 0x48, 0x0b, 0xd8, 0x01, 0x01, 0x72, 0x06, 0x18, 0xf4, 0x03, - 0x90, 0x01, 0x01, 0xba, 0xa6, 0x49, 0x04, 0x08, 0x01, 0x28, 0x01, 0x52, 0x0c, 0x66, 0x69, 0x78, - 0x65, 0x64, 0x43, 0x76, 0x65, 0x73, 0x55, 0x72, 0x6c, 0x12, 0x65, 0x0a, 0x0a, 0x66, 0x69, 0x78, - 0x65, 0x64, 0x5f, 0x63, 0x76, 0x65, 0x73, 0x18, 0x2d, 0x20, 0x01, 0x28, 0x09, 0x42, 0x46, 0xba, - 0x48, 0x3d, 0xd8, 0x01, 0x01, 0x72, 0x38, 0x18, 0xa0, 0x9c, 0x01, 0x32, 0x32, 0x5e, 0x24, 0x7c, - 0x5e, 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, 0x5a, 0x2d, 0x5f, 0x30, 0x2d, 0x39, 0x2e, 0x2f, 0x3a, - 0x3b, 0x3d, 0x40, 0x3f, 0x21, 0x23, 0x2c, 0x3c, 0x3e, 0x2a, 0x2b, 0x7e, 0x28, 0x29, 0x22, 0x5c, - 0x5c, 0x20, 0x5c, 0x0a, 0x5c, 0x7b, 0x5c, 0x7d, 0x5c, 0x5b, 0x5c, 0x5d, 0x5d, 0x2b, 0x24, 0xba, - 0xa6, 0x49, 0x02, 0x08, 0x01, 0x52, 0x09, 0x66, 0x69, 0x78, 0x65, 0x64, 0x43, 0x76, 0x65, 0x73, - 0x12, 0x32, 0x0a, 0x09, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x64, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x15, 0xba, 0x48, 0x0a, 0xd8, 0x01, 0x01, 0x72, 0x05, 0x28, 0x24, 0xb0, - 0x01, 0x01, 0xba, 0xa6, 0x49, 0x04, 0x08, 0x00, 0x28, 0x01, 0x52, 0x08, 0x74, 0x65, 0x6e, 0x61, - 0x6e, 0x74, 0x49, 0x64, 0x12, 0x3f, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, - 0x61, 0x74, 0x18, 0xc8, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1f, 0xba, 0xa6, 0x49, 0x1b, 0x08, - 0x00, 0x28, 0x01, 0x4a, 0x15, 0x0a, 0x08, 0x70, 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, 0x73, 0x12, - 0x09, 0x54, 0x49, 0x4d, 0x45, 0x53, 0x54, 0x41, 0x4d, 0x50, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x3f, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, - 0x5f, 0x61, 0x74, 0x18, 0xc9, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1f, 0xba, 0xa6, 0x49, 0x1b, - 0x08, 0x00, 0x28, 0x00, 0x4a, 0x15, 0x0a, 0x08, 0x70, 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, 0x73, - 0x12, 0x09, 0x54, 0x49, 0x4d, 0x45, 0x53, 0x54, 0x41, 0x4d, 0x50, 0x52, 0x09, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x3a, 0x19, 0xb2, 0xf9, 0x03, 0x0f, 0x0a, 0x0d, 0x12, 0x09, - 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x00, 0xba, 0xa6, 0x49, 0x02, 0x08, - 0x01, 0x2a, 0x89, 0x01, 0x0a, 0x0f, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x46, 0x65, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x20, 0x0a, 0x1c, 0x53, 0x45, 0x43, 0x55, 0x52, 0x49, 0x54, - 0x59, 0x5f, 0x46, 0x45, 0x41, 0x54, 0x55, 0x52, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, - 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x19, 0x0a, 0x15, 0x53, 0x45, 0x43, 0x55, 0x52, - 0x49, 0x54, 0x59, 0x5f, 0x46, 0x45, 0x41, 0x54, 0x55, 0x52, 0x45, 0x5f, 0x4e, 0x4f, 0x4e, 0x45, - 0x10, 0x01, 0x12, 0x39, 0x0a, 0x35, 0x53, 0x45, 0x43, 0x55, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x46, - 0x45, 0x41, 0x54, 0x55, 0x52, 0x45, 0x5f, 0x53, 0x45, 0x43, 0x55, 0x52, 0x45, 0x5f, 0x42, 0x4f, - 0x4f, 0x54, 0x5f, 0x41, 0x4e, 0x44, 0x5f, 0x46, 0x55, 0x4c, 0x4c, 0x5f, 0x44, 0x49, 0x53, 0x4b, - 0x5f, 0x45, 0x4e, 0x43, 0x52, 0x59, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x02, 0x2a, 0x4d, 0x0a, - 0x06, 0x4f, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x17, 0x0a, 0x13, 0x4f, 0x53, 0x5f, 0x54, 0x59, - 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, - 0x12, 0x13, 0x0a, 0x0f, 0x4f, 0x53, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x55, 0x54, 0x41, - 0x42, 0x4c, 0x45, 0x10, 0x01, 0x12, 0x15, 0x0a, 0x11, 0x4f, 0x53, 0x5f, 0x54, 0x59, 0x50, 0x45, - 0x5f, 0x49, 0x4d, 0x4d, 0x55, 0x54, 0x41, 0x42, 0x4c, 0x45, 0x10, 0x02, 0x2a, 0x6b, 0x0a, 0x0e, - 0x4f, 0x73, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x4b, 0x69, 0x6e, 0x64, 0x12, 0x20, - 0x0a, 0x1c, 0x4f, 0x53, 0x5f, 0x50, 0x52, 0x4f, 0x56, 0x49, 0x44, 0x45, 0x52, 0x5f, 0x4b, 0x49, - 0x4e, 0x44, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, - 0x12, 0x1a, 0x0a, 0x16, 0x4f, 0x53, 0x5f, 0x50, 0x52, 0x4f, 0x56, 0x49, 0x44, 0x45, 0x52, 0x5f, - 0x4b, 0x49, 0x4e, 0x44, 0x5f, 0x49, 0x4e, 0x46, 0x52, 0x41, 0x10, 0x01, 0x12, 0x1b, 0x0a, 0x17, - 0x4f, 0x53, 0x5f, 0x50, 0x52, 0x4f, 0x56, 0x49, 0x44, 0x45, 0x52, 0x5f, 0x4b, 0x49, 0x4e, 0x44, - 0x5f, 0x4c, 0x45, 0x4e, 0x4f, 0x56, 0x4f, 0x10, 0x02, 0x42, 0x4a, 0x5a, 0x48, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x2d, 0x65, 0x64, 0x67, - 0x65, 0x2d, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2f, 0x69, 0x6e, 0x66, 0x72, 0x61, - 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2f, - 0x76, 0x32, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6f, 0x73, 0x2f, 0x76, 0x31, - 0x3b, 0x6f, 0x73, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x01, 0x28, 0x09, 0x42, 0x08, 0xba, 0xa6, 0x49, 0x04, 0x08, 0x01, 0x28, 0x00, 0x52, 0x11, 0x69, + 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, + 0x12, 0x6d, 0x0a, 0x16, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x5f, 0x70, 0x61, + 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x37, 0xba, 0x48, 0x2c, 0x72, 0x2a, 0x18, 0xc8, 0x01, 0x32, 0x25, 0x5e, 0x24, 0x7c, 0x5e, + 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, 0x5a, 0x2d, 0x5f, 0x30, 0x2d, 0x39, 0x2e, 0x2f, 0x3a, 0x3b, + 0x3d, 0x40, 0x3f, 0x21, 0x23, 0x2c, 0x3c, 0x3e, 0x2a, 0x28, 0x29, 0x22, 0x5c, 0x20, 0x5d, 0x2b, + 0x24, 0xba, 0xa6, 0x49, 0x04, 0x08, 0x01, 0x28, 0x01, 0x52, 0x14, 0x69, 0x6e, 0x73, 0x74, 0x61, + 0x6c, 0x6c, 0x65, 0x64, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x55, 0x72, 0x6c, 0x12, + 0x4b, 0x0a, 0x10, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x66, 0x65, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x6f, 0x73, 0x2e, 0x76, + 0x31, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x42, 0x08, 0xba, 0xa6, 0x49, 0x04, 0x08, 0x01, 0x28, 0x01, 0x52, 0x0f, 0x73, 0x65, 0x63, + 0x75, 0x72, 0x69, 0x74, 0x79, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x30, 0x0a, 0x07, + 0x6f, 0x73, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0d, 0x2e, + 0x6f, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x73, 0x54, 0x79, 0x70, 0x65, 0x42, 0x08, 0xba, 0xa6, + 0x49, 0x04, 0x08, 0x01, 0x28, 0x01, 0x52, 0x06, 0x6f, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x40, + 0x0a, 0x0b, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, 0x0e, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x6f, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x73, 0x50, 0x72, + 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x4b, 0x69, 0x6e, 0x64, 0x42, 0x08, 0xba, 0xa6, 0x49, 0x04, + 0x08, 0x00, 0x28, 0x01, 0x52, 0x0a, 0x6f, 0x73, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, + 0x12, 0x31, 0x0a, 0x0f, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x5f, 0x62, 0x75, 0x6e, + 0x64, 0x6c, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xba, 0xa6, 0x49, 0x04, 0x08, + 0x01, 0x28, 0x01, 0x52, 0x0e, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x75, 0x6e, + 0x64, 0x6c, 0x65, 0x12, 0x64, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, 0x42, 0x42, 0xba, 0x48, 0x37, 0xd8, 0x01, 0x01, + 0x72, 0x32, 0x28, 0xe8, 0x07, 0x32, 0x2d, 0x5e, 0x24, 0x7c, 0x5e, 0x5b, 0x61, 0x2d, 0x7a, 0x41, + 0x2d, 0x5a, 0x2d, 0x5f, 0x30, 0x2d, 0x39, 0x2e, 0x3a, 0x3b, 0x3d, 0x40, 0x3f, 0x21, 0x23, 0x2c, + 0x3c, 0x3e, 0x2a, 0x28, 0x29, 0x7b, 0x7d, 0x26, 0x25, 0x24, 0x60, 0x5e, 0x5c, 0x2b, 0x5c, 0x2d, + 0x20, 0x5d, 0x2b, 0x24, 0xba, 0xa6, 0x49, 0x04, 0x08, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x64, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x50, 0x0a, 0x08, 0x6d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x42, 0x34, 0xba, 0x48, 0x2b, + 0x72, 0x29, 0x18, 0xf4, 0x03, 0x32, 0x24, 0x5e, 0x24, 0x7c, 0x5e, 0x5b, 0x61, 0x2d, 0x7a, 0x30, + 0x2d, 0x39, 0x2c, 0x2e, 0x5c, 0x2d, 0x5f, 0x3a, 0x2f, 0x22, 0x5c, 0x5c, 0x20, 0x5c, 0x5c, 0x6e, + 0x5c, 0x7b, 0x5c, 0x7d, 0x5c, 0x5b, 0x5c, 0x5d, 0x5d, 0x2b, 0x24, 0xba, 0xa6, 0x49, 0x02, 0x08, + 0x01, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x42, 0x0a, 0x11, 0x65, + 0x78, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x76, 0x65, 0x73, 0x5f, 0x75, 0x72, 0x6c, + 0x18, 0x2a, 0x20, 0x01, 0x28, 0x09, 0x42, 0x16, 0xba, 0x48, 0x0b, 0xd8, 0x01, 0x01, 0x72, 0x06, + 0x18, 0xf4, 0x03, 0x90, 0x01, 0x01, 0xba, 0xa6, 0x49, 0x04, 0x08, 0x01, 0x28, 0x01, 0x52, 0x0f, + 0x65, 0x78, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x43, 0x76, 0x65, 0x73, 0x55, 0x72, 0x6c, 0x12, + 0x6b, 0x0a, 0x0d, 0x65, 0x78, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x76, 0x65, 0x73, + 0x18, 0x2b, 0x20, 0x01, 0x28, 0x09, 0x42, 0x46, 0xba, 0x48, 0x3d, 0xd8, 0x01, 0x01, 0x72, 0x38, + 0x18, 0xa0, 0x9c, 0x01, 0x32, 0x32, 0x5e, 0x24, 0x7c, 0x5e, 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, + 0x5a, 0x2d, 0x5f, 0x30, 0x2d, 0x39, 0x2e, 0x2f, 0x3a, 0x3b, 0x3d, 0x40, 0x3f, 0x21, 0x23, 0x2c, + 0x3c, 0x3e, 0x2a, 0x2b, 0x7e, 0x28, 0x29, 0x22, 0x5c, 0x5c, 0x20, 0x5c, 0x0a, 0x5c, 0x7b, 0x5c, + 0x7d, 0x5c, 0x5b, 0x5c, 0x5d, 0x5d, 0x2b, 0x24, 0xba, 0xa6, 0x49, 0x02, 0x08, 0x01, 0x52, 0x0c, + 0x65, 0x78, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x43, 0x76, 0x65, 0x73, 0x12, 0x3c, 0x0a, 0x0e, + 0x66, 0x69, 0x78, 0x65, 0x64, 0x5f, 0x63, 0x76, 0x65, 0x73, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x2c, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x16, 0xba, 0x48, 0x0b, 0xd8, 0x01, 0x01, 0x72, 0x06, 0x18, 0xf4, + 0x03, 0x90, 0x01, 0x01, 0xba, 0xa6, 0x49, 0x04, 0x08, 0x01, 0x28, 0x01, 0x52, 0x0c, 0x66, 0x69, + 0x78, 0x65, 0x64, 0x43, 0x76, 0x65, 0x73, 0x55, 0x72, 0x6c, 0x12, 0x65, 0x0a, 0x0a, 0x66, 0x69, + 0x78, 0x65, 0x64, 0x5f, 0x63, 0x76, 0x65, 0x73, 0x18, 0x2d, 0x20, 0x01, 0x28, 0x09, 0x42, 0x46, + 0xba, 0x48, 0x3d, 0xd8, 0x01, 0x01, 0x72, 0x38, 0x18, 0xa0, 0x9c, 0x01, 0x32, 0x32, 0x5e, 0x24, + 0x7c, 0x5e, 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, 0x5a, 0x2d, 0x5f, 0x30, 0x2d, 0x39, 0x2e, 0x2f, + 0x3a, 0x3b, 0x3d, 0x40, 0x3f, 0x21, 0x23, 0x2c, 0x3c, 0x3e, 0x2a, 0x2b, 0x7e, 0x28, 0x29, 0x22, + 0x5c, 0x5c, 0x20, 0x5c, 0x0a, 0x5c, 0x7b, 0x5c, 0x7d, 0x5c, 0x5b, 0x5c, 0x5d, 0x5d, 0x2b, 0x24, + 0xba, 0xa6, 0x49, 0x02, 0x08, 0x01, 0x52, 0x09, 0x66, 0x69, 0x78, 0x65, 0x64, 0x43, 0x76, 0x65, + 0x73, 0x12, 0x32, 0x0a, 0x09, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x64, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x15, 0xba, 0x48, 0x0a, 0xd8, 0x01, 0x01, 0x72, 0x05, 0x28, 0x24, + 0xb0, 0x01, 0x01, 0xba, 0xa6, 0x49, 0x04, 0x08, 0x00, 0x28, 0x01, 0x52, 0x08, 0x74, 0x65, 0x6e, + 0x61, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x3f, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, + 0x5f, 0x61, 0x74, 0x18, 0xc8, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1f, 0xba, 0xa6, 0x49, 0x1b, + 0x08, 0x00, 0x28, 0x01, 0x4a, 0x15, 0x0a, 0x08, 0x70, 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, 0x73, + 0x12, 0x09, 0x54, 0x49, 0x4d, 0x45, 0x53, 0x54, 0x41, 0x4d, 0x50, 0x52, 0x09, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x3f, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x64, 0x5f, 0x61, 0x74, 0x18, 0xc9, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1f, 0xba, 0xa6, 0x49, + 0x1b, 0x08, 0x00, 0x28, 0x00, 0x4a, 0x15, 0x0a, 0x08, 0x70, 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, + 0x73, 0x12, 0x09, 0x54, 0x49, 0x4d, 0x45, 0x53, 0x54, 0x41, 0x4d, 0x50, 0x52, 0x09, 0x75, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x3a, 0x19, 0xb2, 0xf9, 0x03, 0x0f, 0x0a, 0x0d, 0x12, + 0x09, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x00, 0xba, 0xa6, 0x49, 0x02, + 0x08, 0x01, 0x2a, 0x89, 0x01, 0x0a, 0x0f, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x46, + 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x20, 0x0a, 0x1c, 0x53, 0x45, 0x43, 0x55, 0x52, 0x49, + 0x54, 0x59, 0x5f, 0x46, 0x45, 0x41, 0x54, 0x55, 0x52, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, + 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x19, 0x0a, 0x15, 0x53, 0x45, 0x43, 0x55, + 0x52, 0x49, 0x54, 0x59, 0x5f, 0x46, 0x45, 0x41, 0x54, 0x55, 0x52, 0x45, 0x5f, 0x4e, 0x4f, 0x4e, + 0x45, 0x10, 0x01, 0x12, 0x39, 0x0a, 0x35, 0x53, 0x45, 0x43, 0x55, 0x52, 0x49, 0x54, 0x59, 0x5f, + 0x46, 0x45, 0x41, 0x54, 0x55, 0x52, 0x45, 0x5f, 0x53, 0x45, 0x43, 0x55, 0x52, 0x45, 0x5f, 0x42, + 0x4f, 0x4f, 0x54, 0x5f, 0x41, 0x4e, 0x44, 0x5f, 0x46, 0x55, 0x4c, 0x4c, 0x5f, 0x44, 0x49, 0x53, + 0x4b, 0x5f, 0x45, 0x4e, 0x43, 0x52, 0x59, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x02, 0x2a, 0x4d, + 0x0a, 0x06, 0x4f, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x17, 0x0a, 0x13, 0x4f, 0x53, 0x5f, 0x54, + 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, + 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x4f, 0x53, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x55, 0x54, + 0x41, 0x42, 0x4c, 0x45, 0x10, 0x01, 0x12, 0x15, 0x0a, 0x11, 0x4f, 0x53, 0x5f, 0x54, 0x59, 0x50, + 0x45, 0x5f, 0x49, 0x4d, 0x4d, 0x55, 0x54, 0x41, 0x42, 0x4c, 0x45, 0x10, 0x02, 0x2a, 0x6b, 0x0a, + 0x0e, 0x4f, 0x73, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x4b, 0x69, 0x6e, 0x64, 0x12, + 0x20, 0x0a, 0x1c, 0x4f, 0x53, 0x5f, 0x50, 0x52, 0x4f, 0x56, 0x49, 0x44, 0x45, 0x52, 0x5f, 0x4b, + 0x49, 0x4e, 0x44, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, + 0x00, 0x12, 0x1a, 0x0a, 0x16, 0x4f, 0x53, 0x5f, 0x50, 0x52, 0x4f, 0x56, 0x49, 0x44, 0x45, 0x52, + 0x5f, 0x4b, 0x49, 0x4e, 0x44, 0x5f, 0x49, 0x4e, 0x46, 0x52, 0x41, 0x10, 0x01, 0x12, 0x1b, 0x0a, + 0x17, 0x4f, 0x53, 0x5f, 0x50, 0x52, 0x4f, 0x56, 0x49, 0x44, 0x45, 0x52, 0x5f, 0x4b, 0x49, 0x4e, + 0x44, 0x5f, 0x4c, 0x45, 0x4e, 0x4f, 0x56, 0x4f, 0x10, 0x02, 0x42, 0x4a, 0x5a, 0x48, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x2d, 0x65, 0x64, + 0x67, 0x65, 0x2d, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2f, 0x69, 0x6e, 0x66, 0x72, + 0x61, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, + 0x2f, 0x76, 0x32, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6f, 0x73, 0x2f, 0x76, + 0x31, 0x3b, 0x6f, 0x73, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/inventory/pkg/api/os/v1/os_constants.pb.go b/inventory/pkg/api/os/v1/os_constants.pb.go index 2f9aedee4..f2be36c3c 100644 --- a/inventory/pkg/api/os/v1/os_constants.pb.go +++ b/inventory/pkg/api/os/v1/os_constants.pb.go @@ -6,28 +6,29 @@ package osv1 const ( // Fields and Edges constants for "OperatingSystemResource" - OperatingSystemResourceFieldResourceId = "resource_id" - OperatingSystemResourceFieldName = "name" - OperatingSystemResourceFieldArchitecture = "architecture" - OperatingSystemResourceFieldKernelCommand = "kernel_command" - OperatingSystemResourceFieldUpdateSources = "update_sources" - OperatingSystemResourceFieldImageUrl = "image_url" - OperatingSystemResourceFieldImageId = "image_id" - OperatingSystemResourceFieldSha256 = "sha256" - OperatingSystemResourceFieldProfileName = "profile_name" - OperatingSystemResourceFieldProfileVersion = "profile_version" - OperatingSystemResourceFieldInstalledPackages = "installed_packages" - OperatingSystemResourceFieldSecurityFeature = "security_feature" - OperatingSystemResourceFieldOsType = "os_type" - OperatingSystemResourceFieldOsProvider = "os_provider" - OperatingSystemResourceFieldPlatformBundle = "platform_bundle" - OperatingSystemResourceFieldDescription = "description" - OperatingSystemResourceFieldMetadata = "metadata" - OperatingSystemResourceFieldExistingCvesUrl = "existing_cves_url" - OperatingSystemResourceFieldExistingCves = "existing_cves" - OperatingSystemResourceFieldFixedCvesUrl = "fixed_cves_url" - OperatingSystemResourceFieldFixedCves = "fixed_cves" - OperatingSystemResourceFieldTenantId = "tenant_id" - OperatingSystemResourceFieldCreatedAt = "created_at" - OperatingSystemResourceFieldUpdatedAt = "updated_at" + OperatingSystemResourceFieldResourceId = "resource_id" + OperatingSystemResourceFieldName = "name" + OperatingSystemResourceFieldArchitecture = "architecture" + OperatingSystemResourceFieldKernelCommand = "kernel_command" + OperatingSystemResourceFieldUpdateSources = "update_sources" + OperatingSystemResourceFieldImageUrl = "image_url" + OperatingSystemResourceFieldImageId = "image_id" + OperatingSystemResourceFieldSha256 = "sha256" + OperatingSystemResourceFieldProfileName = "profile_name" + OperatingSystemResourceFieldProfileVersion = "profile_version" + OperatingSystemResourceFieldInstalledPackages = "installed_packages" + OperatingSystemResourceFieldInstalledPackagesUrl = "installed_packages_url" + OperatingSystemResourceFieldSecurityFeature = "security_feature" + OperatingSystemResourceFieldOsType = "os_type" + OperatingSystemResourceFieldOsProvider = "os_provider" + OperatingSystemResourceFieldPlatformBundle = "platform_bundle" + OperatingSystemResourceFieldDescription = "description" + OperatingSystemResourceFieldMetadata = "metadata" + OperatingSystemResourceFieldExistingCvesUrl = "existing_cves_url" + OperatingSystemResourceFieldExistingCves = "existing_cves" + OperatingSystemResourceFieldFixedCvesUrl = "fixed_cves_url" + OperatingSystemResourceFieldFixedCves = "fixed_cves" + OperatingSystemResourceFieldTenantId = "tenant_id" + OperatingSystemResourceFieldCreatedAt = "created_at" + OperatingSystemResourceFieldUpdatedAt = "updated_at" ) diff --git a/inventory/pkg/testing/opts.go b/inventory/pkg/testing/opts.go index 800865a0b..a30dc5170 100644 --- a/inventory/pkg/testing/opts.go +++ b/inventory/pkg/testing/opts.go @@ -352,6 +352,12 @@ func InstalledPackages(pkgs string) Opt[osv1.OperatingSystemResource] { } } +func InstalledPackagesUrl(url string) Opt[osv1.OperatingSystemResource] { + return func(t *osv1.OperatingSystemResource) { + t.InstalledPackagesUrl = url + } +} + func Sha256(sha256 string) Opt[osv1.OperatingSystemResource] { return func(t *osv1.OperatingSystemResource) { t.Sha256 = sha256 diff --git a/inventory/pkg/testing/testing_utils.go b/inventory/pkg/testing/testing_utils.go index 0ac5576c7..ad7af6481 100644 --- a/inventory/pkg/testing/testing_utils.go +++ b/inventory/pkg/testing/testing_utils.go @@ -850,18 +850,19 @@ func (c *InvResourceDAO) createOsWithOpts( // a default OS resource, can be overwritten by opts osCreateReq := &osv1.OperatingSystemResource{ - Name: "for unit testing purposes", - UpdateSources: []string{"test entries"}, - ImageUrl: "Repo URL Test", - ImageId: "some image ID", - ProfileName: "test profile name", - ProfileVersion: "1.0.0", - Sha256: "test sha256", - InstalledPackages: "intel-opencl-icd\nintel-level-zero-gpu\nlevel-zero", - SecurityFeature: osv1.SecurityFeature_SECURITY_FEATURE_SECURE_BOOT_AND_FULL_DISK_ENCRYPTION, - OsType: osv1.OsType_OS_TYPE_MUTABLE, - OsProvider: osv1.OsProviderKind_OS_PROVIDER_KIND_INFRA, - TenantId: tenantID, + Name: "for unit testing purposes", + UpdateSources: []string{"test entries"}, + ImageUrl: "Repo URL Test", + ImageId: "some image ID", + ProfileName: "test profile name", + ProfileVersion: "1.0.0", + Sha256: "test sha256", + InstalledPackages: "intel-opencl-icd\nintel-level-zero-gpu\nlevel-zero", + InstalledPackagesUrl: "https://manifest-url.example.com/installed-packages.txt", + SecurityFeature: osv1.SecurityFeature_SECURITY_FEATURE_SECURE_BOOT_AND_FULL_DISK_ENCRYPTION, + OsType: osv1.OsType_OS_TYPE_MUTABLE, + OsProvider: osv1.OsProviderKind_OS_PROVIDER_KIND_INFRA, + TenantId: tenantID, } for _, opt := range opts { diff --git a/inventory/python/infra_inventory/os/v1.py b/inventory/python/infra_inventory/os/v1.py index 535dc57fd..27b8811e6 100644 --- a/inventory/python/infra_inventory/os/v1.py +++ b/inventory/python/infra_inventory/os/v1.py @@ -52,6 +52,10 @@ class OperatingSystemResource(betterproto.Message): profile_name: str = betterproto.string_field(8) profile_version: str = betterproto.string_field(12) installed_packages: str = betterproto.string_field(9) + # The URL of the OS manifest which contains install packages details. This + # will be used to fill the installed_packages field for the advance use case + # to allow manual creation of OSProfiles when supported from backend. + installed_packages_url: str = betterproto.string_field(17) security_feature: "SecurityFeature" = betterproto.enum_field(10) os_type: "OsType" = betterproto.enum_field(11) os_provider: "OsProviderKind" = betterproto.enum_field(14) diff --git a/inventory/sql/inventory.sql b/inventory/sql/inventory.sql index 84189c1b0..94372ba21 100644 --- a/inventory/sql/inventory.sql +++ b/inventory/sql/inventory.sql @@ -15,7 +15,7 @@ CREATE INDEX "providerresource_tenant_id" ON "provider_resources" ("tenant_id"); CREATE TABLE "site_resources" ("id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, "resource_id" character varying NOT NULL, "name" character varying NULL, "address" character varying NULL, "site_lat" integer NULL, "site_lng" integer NULL, "dns_servers" character varying NULL, "docker_registries" character varying NULL, "metrics_endpoint" character varying NULL, "http_proxy" character varying NULL, "https_proxy" character varying NULL, "ftp_proxy" character varying NULL, "no_proxy" character varying NULL, "metadata" character varying NULL, "tenant_id" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "site_resource_region" bigint NULL, "site_resource_ou" bigint NULL, "site_resource_provider" bigint NULL, PRIMARY KEY ("id"), CONSTRAINT "site_resources_region_resources_region" FOREIGN KEY ("site_resource_region") REFERENCES "region_resources" ("id") ON DELETE SET NULL, CONSTRAINT "site_resources_ou_resources_ou" FOREIGN KEY ("site_resource_ou") REFERENCES "ou_resources" ("id") ON DELETE SET NULL, CONSTRAINT "site_resources_provider_resources_provider" FOREIGN KEY ("site_resource_provider") REFERENCES "provider_resources" ("id") ON DELETE SET NULL); CREATE UNIQUE INDEX "site_resources_resource_id_key" ON "site_resources" ("resource_id"); CREATE INDEX "siteresource_tenant_id" ON "site_resources" ("tenant_id"); -CREATE TABLE "operating_system_resources" ("id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, "resource_id" character varying NOT NULL, "name" character varying NULL, "architecture" character varying NULL, "kernel_command" character varying NULL, "update_sources" character varying NULL, "image_url" character varying NULL, "image_id" character varying NULL, "sha256" character varying NULL, "profile_name" character varying NULL, "profile_version" character varying NULL, "installed_packages" character varying NULL, "security_feature" character varying NULL, "os_type" character varying NULL, "os_provider" character varying NOT NULL, "platform_bundle" character varying NULL, "description" character varying NULL, "metadata" character varying NULL, "existing_cves_url" character varying NULL, "existing_cves" character varying NULL, "fixed_cves_url" character varying NULL, "fixed_cves" character varying NULL, "tenant_id" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, PRIMARY KEY ("id")); +CREATE TABLE "operating_system_resources" ("id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, "resource_id" character varying NOT NULL, "name" character varying NULL, "architecture" character varying NULL, "kernel_command" character varying NULL, "update_sources" character varying NULL, "image_url" character varying NULL, "image_id" character varying NULL, "sha256" character varying NULL, "profile_name" character varying NULL, "profile_version" character varying NULL, "installed_packages" character varying NULL, "installed_packages_url" character varying NULL, "security_feature" character varying NULL, "os_type" character varying NULL, "os_provider" character varying NOT NULL, "platform_bundle" character varying NULL, "description" character varying NULL, "metadata" character varying NULL, "existing_cves_url" character varying NULL, "existing_cves" character varying NULL, "fixed_cves_url" character varying NULL, "fixed_cves" character varying NULL, "tenant_id" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, PRIMARY KEY ("id")); CREATE UNIQUE INDEX "operating_system_resources_resource_id_key" ON "operating_system_resources" ("resource_id"); CREATE INDEX "operatingsystemresource_tenant_id" ON "operating_system_resources" ("tenant_id"); CREATE TABLE "local_account_resources" ("id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, "resource_id" character varying NOT NULL, "username" character varying NOT NULL, "ssh_key" character varying NOT NULL, "tenant_id" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, PRIMARY KEY ("id")); From 7ef053bfc44856491f39f57fcd2359a834cdcf54 Mon Sep 17 00:00:00 2001 From: Sushil Lakra Date: Wed, 11 Jun 2025 11:11:56 +0000 Subject: [PATCH 2/4] Changes for API handler implementation update for OS Resource in apiv2 as per the day2 upgrade --- apiv2/internal/server/os.go | 86 +++++++++++++++++++------------------ 1 file changed, 44 insertions(+), 42 deletions(-) diff --git a/apiv2/internal/server/os.go b/apiv2/internal/server/os.go index 052892d93..15a9b47a7 100644 --- a/apiv2/internal/server/os.go +++ b/apiv2/internal/server/os.go @@ -37,25 +37,26 @@ func toInvOSResource(osResource *osv1.OperatingSystemResource) (*inv_osv1.Operat return &inv_osv1.OperatingSystemResource{}, nil } invOSResource := &inv_osv1.OperatingSystemResource{ - Name: osResource.GetName(), - Architecture: osResource.GetArchitecture(), - KernelCommand: osResource.GetKernelCommand(), - UpdateSources: osResource.GetUpdateSources(), - ImageUrl: osResource.GetImageUrl(), - ImageId: osResource.GetImageId(), - Sha256: osResource.GetSha256(), - ProfileName: osResource.GetProfileName(), - ProfileVersion: osResource.GetProfileVersion(), - InstalledPackages: osResource.GetInstalledPackages(), - SecurityFeature: inv_osv1.SecurityFeature(osResource.GetSecurityFeature()), - OsType: inv_osv1.OsType(osResource.GetOsType()), - OsProvider: inv_osv1.OsProviderKind(osResource.GetOsProvider()), - Description: osResource.GetDescription(), - Metadata: osResource.GetMetadata(), - ExistingCvesUrl: osResource.GetExistingCvesUrl(), - ExistingCves: osResource.GetExistingCves(), - FixedCvesUrl: osResource.GetFixedCvesUrl(), - FixedCves: osResource.GetFixedCves(), + Name: osResource.GetName(), + Architecture: osResource.GetArchitecture(), + KernelCommand: osResource.GetKernelCommand(), + UpdateSources: osResource.GetUpdateSources(), + ImageUrl: osResource.GetImageUrl(), + ImageId: osResource.GetImageId(), + Sha256: osResource.GetSha256(), + ProfileName: osResource.GetProfileName(), + ProfileVersion: osResource.GetProfileVersion(), + InstalledPackages: osResource.GetInstalledPackages(), + InstalledPackagesUrl: osResource.GetInstalledPackagesUrl(), + SecurityFeature: inv_osv1.SecurityFeature(osResource.GetSecurityFeature()), + OsType: inv_osv1.OsType(osResource.GetOsType()), + OsProvider: inv_osv1.OsProviderKind(osResource.GetOsProvider()), + Description: osResource.GetDescription(), + Metadata: osResource.GetMetadata(), + ExistingCvesUrl: osResource.GetExistingCvesUrl(), + ExistingCves: osResource.GetExistingCves(), + FixedCvesUrl: osResource.GetFixedCvesUrl(), + FixedCves: osResource.GetFixedCves(), } err := validator.ValidateMessage(invOSResource) @@ -72,29 +73,30 @@ func fromInvOSResource(invOSResource *inv_osv1.OperatingSystemResource) *osv1.Op return &osv1.OperatingSystemResource{} } osResource := &osv1.OperatingSystemResource{ - ResourceId: invOSResource.GetResourceId(), - Name: invOSResource.GetName(), - Architecture: invOSResource.GetArchitecture(), - KernelCommand: invOSResource.GetKernelCommand(), - UpdateSources: invOSResource.GetUpdateSources(), - ImageUrl: invOSResource.GetImageUrl(), - ImageId: invOSResource.GetImageId(), - Sha256: invOSResource.GetSha256(), - ProfileName: invOSResource.GetProfileName(), - ProfileVersion: invOSResource.GetProfileVersion(), - InstalledPackages: invOSResource.GetInstalledPackages(), - SecurityFeature: osv1.SecurityFeature(invOSResource.GetSecurityFeature()), - OsType: osv1.OsType(invOSResource.GetOsType()), - OsProvider: osv1.OsProviderKind(invOSResource.GetOsProvider()), - OsResourceID: invOSResource.GetResourceId(), - Timestamps: GrpcToOpenAPITimestamps(invOSResource), - PlatformBundle: invOSResource.GetPlatformBundle(), - Description: invOSResource.GetDescription(), - Metadata: invOSResource.GetMetadata(), - ExistingCvesUrl: invOSResource.GetExistingCvesUrl(), - ExistingCves: invOSResource.GetExistingCves(), - FixedCvesUrl: invOSResource.GetFixedCvesUrl(), - FixedCves: invOSResource.GetFixedCves(), + ResourceId: invOSResource.GetResourceId(), + Name: invOSResource.GetName(), + Architecture: invOSResource.GetArchitecture(), + KernelCommand: invOSResource.GetKernelCommand(), + UpdateSources: invOSResource.GetUpdateSources(), + ImageUrl: invOSResource.GetImageUrl(), + ImageId: invOSResource.GetImageId(), + Sha256: invOSResource.GetSha256(), + ProfileName: invOSResource.GetProfileName(), + ProfileVersion: invOSResource.GetProfileVersion(), + InstalledPackages: invOSResource.GetInstalledPackages(), + InstalledPackagesUrl: invOSResource.GetInstalledPackagesUrl(), + SecurityFeature: osv1.SecurityFeature(invOSResource.GetSecurityFeature()), + OsType: osv1.OsType(invOSResource.GetOsType()), + OsProvider: osv1.OsProviderKind(invOSResource.GetOsProvider()), + OsResourceID: invOSResource.GetResourceId(), + Timestamps: GrpcToOpenAPITimestamps(invOSResource), + PlatformBundle: invOSResource.GetPlatformBundle(), + Description: invOSResource.GetDescription(), + Metadata: invOSResource.GetMetadata(), + ExistingCvesUrl: invOSResource.GetExistingCvesUrl(), + ExistingCves: invOSResource.GetExistingCves(), + FixedCvesUrl: invOSResource.GetFixedCvesUrl(), + FixedCves: invOSResource.GetFixedCves(), } return osResource } From 24becb59f1155981d4e778d3688f12aa90dff98a Mon Sep 17 00:00:00 2001 From: Sushil Lakra Date: Thu, 12 Jun 2025 18:17:25 +0000 Subject: [PATCH 3/4] fix review comments + changes for merge conflicts --- apiv2/internal/server/os.go | 1 - inventory/docs/inventory-er-diagram.svg | 2765 +++++++++++++++++ .../internal/ent/migrate/migrations/atlas.sum | 7 +- .../ent/schema/operating_system_resource.go | 2 +- inventory/pkg/api/os/v1/os.pb.go | 248 +- 5 files changed, 2895 insertions(+), 128 deletions(-) diff --git a/apiv2/internal/server/os.go b/apiv2/internal/server/os.go index 15a9b47a7..d2d366692 100644 --- a/apiv2/internal/server/os.go +++ b/apiv2/internal/server/os.go @@ -46,7 +46,6 @@ func toInvOSResource(osResource *osv1.OperatingSystemResource) (*inv_osv1.Operat Sha256: osResource.GetSha256(), ProfileName: osResource.GetProfileName(), ProfileVersion: osResource.GetProfileVersion(), - InstalledPackages: osResource.GetInstalledPackages(), InstalledPackagesUrl: osResource.GetInstalledPackagesUrl(), SecurityFeature: inv_osv1.SecurityFeature(osResource.GetSecurityFeature()), OsType: inv_osv1.OsType(osResource.GetOsType()), diff --git a/inventory/docs/inventory-er-diagram.svg b/inventory/docs/inventory-er-diagram.svg index e69de29bb..7fb16b236 100644 --- a/inventory/docs/inventory-er-diagram.svg +++ b/inventory/docs/inventory-er-diagram.svg @@ -0,0 +1,2765 @@ + + + + + + +dbml + + +tenants + + + +       tenants        + + +id +     +bigint + +(!) + + +resource_id     +character varying + +(!) + + +current_state     +character varying + + +desired_state     +character varying + +(!) + + +watcher_osmanager     +boolean + + +tenant_id     +character varying + +(!) + + +created_at     +timestamp + +(!) + + +updated_at     +timestamp + +(!) + + + + +region_resources + + + +       region_resources        + + +id +     +bigint + +(!) + + +resource_id     +character varying + +(!) + + +name     +character varying + + +region_kind     +character varying + + +metadata     +character varying + + +tenant_id     +character varying + +(!) + + +created_at     +timestamp + +(!) + + +updated_at     +timestamp + +(!) + + +region_resource_parent_region     +bigint + + + + + +region_resources:e->region_resources:w + + +* +1 + + + +site_resources + + + +       site_resources        + + +id +     +bigint + +(!) + + +resource_id     +character varying + +(!) + + +name     +character varying + + +address     +character varying + + +site_lat     +integer + + +site_lng     +integer + + +dns_servers     +character varying + + +docker_registries     +character varying + + +metrics_endpoint     +character varying + + +http_proxy     +character varying + + +https_proxy     +character varying + + +ftp_proxy     +character varying + + +no_proxy     +character varying + + +metadata     +character varying + + +tenant_id     +character varying + +(!) + + +created_at     +timestamp + +(!) + + +updated_at     +timestamp + +(!) + + +site_resource_region     +bigint + + +site_resource_ou     +bigint + + +site_resource_provider     +bigint + + + + + +region_resources:e->site_resources:w + + +* +1 + + + +repeated_schedule_resources + + + +       repeated_schedule_resources        + + +id +     +bigint + +(!) + + +resource_id     +character varying + +(!) + + +schedule_status     +character varying + + +name     +character varying + + +duration_seconds     +bigint + + +cron_minutes     +character varying + +(!) + + +cron_hours     +character varying + +(!) + + +cron_day_month     +character varying + +(!) + + +cron_month     +character varying + +(!) + + +cron_day_week     +character varying + +(!) + + +tenant_id     +character varying + +(!) + + +created_at     +timestamp + +(!) + + +updated_at     +timestamp + +(!) + + +repeated_schedule_resource_target_site     +bigint + + +repeated_schedule_resource_target_host     +bigint + + +repeated_schedule_resource_target_workload     +bigint + + +repeated_schedule_resource_target_region     +bigint + + + + + +region_resources:e->repeated_schedule_resources:w + + +* +1 + + + +single_schedule_resources + + + +       single_schedule_resources        + + +id +     +bigint + +(!) + + +resource_id     +character varying + +(!) + + +schedule_status     +character varying + + +name     +character varying + + +start_seconds     +bigint + +(!) + + +end_seconds     +bigint + + +tenant_id     +character varying + +(!) + + +created_at     +timestamp + +(!) + + +updated_at     +timestamp + +(!) + + +single_schedule_resource_target_site     +bigint + + +single_schedule_resource_target_host     +bigint + + +single_schedule_resource_target_workload     +bigint + + +single_schedule_resource_target_region     +bigint + + + + + +region_resources:e->single_schedule_resources:w + + +* +1 + + + +telemetry_profiles + + + +       telemetry_profiles        + + +id +     +bigint + +(!) + + +resource_id     +character varying + +(!) + + +kind     +character varying + +(!) + + +metrics_interval     +bigint + + +log_level     +character varying + + +tenant_id     +character varying + +(!) + + +created_at     +timestamp + +(!) + + +updated_at     +timestamp + +(!) + + +telemetry_profile_region     +bigint + + +telemetry_profile_site     +bigint + + +telemetry_profile_instance     +bigint + + +telemetry_profile_group     +bigint + +(!) + + + + + +region_resources:e->telemetry_profiles:w + + +* +1 + + + +ou_resources + + + +       ou_resources        + + +id +     +bigint + +(!) + + +resource_id     +character varying + +(!) + + +name     +character varying + + +ou_kind     +character varying + + +metadata     +character varying + + +tenant_id     +character varying + +(!) + + +created_at     +timestamp + +(!) + + +updated_at     +timestamp + +(!) + + +ou_resource_parent_ou     +bigint + + + + + +ou_resources:e->ou_resources:w + + +* +1 + + + + +ou_resources:e->site_resources:w + + +* +1 + + + +provider_resources + + + +       provider_resources        + + +id +     +bigint + +(!) + + +resource_id     +character varying + +(!) + + +provider_kind     +character varying + +(!) + + +provider_vendor     +character varying + + +name     +character varying + +(!) + + +api_endpoint     +character varying + +(!) + + +api_credentials     +character varying + + +config     +character varying + + +tenant_id     +character varying + +(!) + + +created_at     +timestamp + +(!) + + +updated_at     +timestamp + +(!) + + + + + +provider_resources:e->site_resources:w + + +* +1 + + + +instance_resources + + + +       instance_resources        + + +id +     +bigint + +(!) + + +resource_id     +character varying + +(!) + + +kind     +character varying + + +name     +character varying + + +desired_state     +character varying + + +current_state     +character varying + + +vm_memory_bytes     +bigint + + +vm_cpu_cores     +bigint + + +vm_storage_bytes     +bigint + + +security_feature     +character varying + + +instance_status     +character varying + + +instance_status_indicator     +character varying + + +instance_status_timestamp     +bigint + + +provisioning_status     +character varying + + +provisioning_status_indicator     +character varying + + +provisioning_status_timestamp     +bigint + + +update_status     +character varying + + +update_status_indicator     +character varying + + +update_status_timestamp     +bigint + + +update_status_detail     +character varying + + +trusted_attestation_status     +character varying + + +trusted_attestation_status_indicator     +character varying + + +trusted_attestation_status_timestamp     +bigint + + +existing_cves     +character varying + + +runtime_packages     +character varying + + +os_update_available     +character varying + + +tenant_id     +character varying + +(!) + + +instance_status_detail     +character varying + + +created_at     +timestamp + +(!) + + +updated_at     +timestamp + +(!) + + +instance_resource_desired_os     +bigint + +(!) + + +instance_resource_current_os     +bigint + + +instance_resource_os     +bigint + + +instance_resource_provider     +bigint + + +instance_resource_localaccount     +bigint + + +instance_resource_os_update_policy     +bigint + + + + + +provider_resources:e->instance_resources:w + + +* +1 + + + +host_resources + + + +       host_resources        + + +id +     +bigint + +(!) + + +resource_id     +character varying + +(!) + + +kind     +character varying + + +name     +character varying + + +desired_state     +character varying + + +current_state     +character varying + + +note     +character varying + + +hardware_kind     +character varying + + +serial_number     +character varying + + +uuid     +character varying + + +memory_bytes     +bigint + + +cpu_model     +character varying + + +cpu_sockets     +bigint + + +cpu_cores     +bigint + + +cpu_capabilities     +character varying + + +cpu_architecture     +character varying + + +cpu_threads     +bigint + + +cpu_topology     +character varying + + +mgmt_ip     +character varying + + +bmc_kind     +character varying + + +bmc_ip     +character varying + + +bmc_username     +character varying + + +bmc_password     +character varying + + +pxe_mac     +character varying + + +hostname     +character varying + + +product_name     +character varying + + +bios_version     +character varying + + +bios_release_date     +character varying + + +bios_vendor     +character varying + + +metadata     +character varying + + +desired_power_state     +character varying + + +current_power_state     +character varying + + +power_status     +character varying + + +power_status_indicator     +character varying + + +power_status_timestamp     +bigint + + +power_command_policy     +character varying + + +power_on_time     +bigint + + +host_status     +character varying + + +host_status_indicator     +character varying + + +host_status_timestamp     +bigint + + +onboarding_status     +character varying + + +onboarding_status_indicator     +character varying + + +onboarding_status_timestamp     +bigint + + +registration_status     +character varying + + +registration_status_indicator     +character varying + + +registration_status_timestamp     +bigint + + +amt_sku     +character varying + + +desired_amt_state     +character varying + + +current_amt_state     +character varying + + +amt_status     +character varying + + +amt_status_indicator     +character varying + + +amt_status_timestamp     +bigint + + +tenant_id     +character varying + +(!) + + +created_at     +timestamp + +(!) + + +updated_at     +timestamp + +(!) + + +host_resource_site     +bigint + + +host_resource_provider     +bigint + + +instance_resource_host     +bigint + + + + + +provider_resources:e->host_resources:w + + +* +1 + + + + +site_resources:e->host_resources:w + + +* +1 + + + +network_segments + + + +       network_segments        + + +id +     +bigint + +(!) + + +resource_id     +character varying + +(!) + + +name     +character varying + + +vlan_id     +integer + + +tenant_id     +character varying + +(!) + + +created_at     +timestamp + +(!) + + +updated_at     +timestamp + +(!) + + +network_segment_site     +bigint + +(!) + + + + + +site_resources:e->network_segments:w + + +* +1 + + + + +site_resources:e->repeated_schedule_resources:w + + +* +1 + + + + +site_resources:e->single_schedule_resources:w + + +* +1 + + + + +site_resources:e->telemetry_profiles:w + + +* +1 + + + +operating_system_resources + + + +       operating_system_resources        + + +id +     +bigint + +(!) + + +resource_id     +character varying + +(!) + + +name     +character varying + + +architecture     +character varying + + +kernel_command     +character varying + + +update_sources     +character varying + + +image_url     +character varying + + +image_id     +character varying + + +sha256     +character varying + + +profile_name     +character varying + + +profile_version     +character varying + + +installed_packages     +character varying + + +installed_packages_url     +character varying + + +security_feature     +character varying + + +os_type     +character varying + + +os_provider     +character varying + +(!) + + +platform_bundle     +character varying + + +description     +character varying + + +metadata     +character varying + + +existing_cves_url     +character varying + + +existing_cves     +character varying + + +fixed_cves_url     +character varying + + +fixed_cves     +character varying + + +tenant_id     +character varying + +(!) + + +created_at     +timestamp + +(!) + + +updated_at     +timestamp + +(!) + + + + +os_update_policy_resources + + + +       os_update_policy_resources        + + +id +     +bigint + +(!) + + +resource_id     +character varying + +(!) + + +name     +character varying + +(!) + + +description     +character varying + + +install_packages     +character varying + + +update_sources     +character varying + + +kernel_command     +character varying + + +update_policy     +character varying + + +tenant_id     +character varying + +(!) + + +created_at     +timestamp + +(!) + + +updated_at     +timestamp + +(!) + + +os_update_policy_resource_target_os     +bigint + + + + + +operating_system_resources:e->os_update_policy_resources:w + + +* +1 + + + + +operating_system_resources:e->instance_resources:w + + +* +1 + + + + +operating_system_resources:e->instance_resources:w + + +* +1 + + + + +operating_system_resources:e->instance_resources:w + + +* +1 + + + +os_update_policies + + + +       os_update_policies        + + +id +     +bigint + +(!) + + +resource_id     +character varying + +(!) + + +installed_packages     +character varying + + +update_sources     +character varying + + +kernel_command     +character varying + + +update_policy     +character varying + + +tenant_id     +character varying + +(!) + + +created_at     +timestamp + +(!) + + +updated_at     +timestamp + +(!) + + +os_update_policy_target_os     +bigint + + + + + +operating_system_resources:e->os_update_policies:w + + +* +1 + + + +local_account_resources + + + +       local_account_resources        + + +id +     +bigint + +(!) + + +resource_id     +character varying + +(!) + + +username     +character varying + +(!) + + +ssh_key     +character varying + +(!) + + +tenant_id     +character varying + +(!) + + +created_at     +timestamp + +(!) + + +updated_at     +timestamp + +(!) + + + + + +local_account_resources:e->instance_resources:w + + +* +1 + + + + +os_update_policy_resources:e->instance_resources:w + + +* +1 + + + +os_update_run_resources + + + +       os_update_run_resources        + + +id +     +bigint + +(!) + + +resource_id     +character varying + +(!) + + +name     +character varying + + +description     +character varying + + +status_indicator     +character varying + +(!) + + +status     +character varying + + +status_details     +character varying + + +status_timestamp     +timestamp + +(!) + + +start_time     +timestamp + +(!) + + +end_time     +timestamp + + +tenant_id     +character varying + +(!) + + +created_at     +timestamp + +(!) + + +updated_at     +timestamp + +(!) + + +os_update_run_resource_applied_policy     +bigint + +(!) + + +os_update_run_resource_instance     +bigint + +(!) + + + + + +os_update_policy_resources:e->os_update_run_resources:w + + +* +1 + + + + +instance_resources:e->host_resources:w + + +* +1 + + + +instance_resource_custom_config + + + +       instance_resource_custom_config        + + +instance_resource_id +     +bigint + +(!) + + +custom_config_resource_id +     +bigint + +(!) + + + + + +instance_resources:e->instance_resource_custom_config:w + + +* +1 + + + + +instance_resources:e->os_update_run_resources:w + + +* +1 + + + +remote_access_configurations + + + +       remote_access_configurations        + + +id +     +bigint + +(!) + + +resource_id     +character varying + +(!) + + +expiration_timestamp     +bigint + +(!) + + +local_port     +bigint + + +user     +character varying + + +current_state     +character varying + + +desired_state     +character varying + +(!) + + +configuration_status     +character varying + + +configuration_status_indicator     +character varying + + +configuration_status_timestamp     +bigint + + +tenant_id     +character varying + +(!) + + +created_at     +timestamp + +(!) + + +updated_at     +timestamp + +(!) + + +remote_access_configuration_instance     +bigint + +(!) + + + + + +instance_resources:e->remote_access_configurations:w + + +* +1 + + + + +instance_resources:e->telemetry_profiles:w + + +* +1 + + + +workload_members + + + +       workload_members        + + +id +     +bigint + +(!) + + +resource_id     +character varying + +(!) + + +kind     +character varying + +(!) + + +tenant_id     +character varying + +(!) + + +created_at     +timestamp + +(!) + + +updated_at     +timestamp + +(!) + + +workload_member_workload     +bigint + +(!) + + +workload_member_instance     +bigint + +(!) + + + + + +instance_resources:e->workload_members:w + + +* +1 + + + +endpoint_resources + + + +       endpoint_resources        + + +id +     +bigint + +(!) + + +resource_id     +character varying + +(!) + + +kind     +character varying + + +name     +character varying + + +tenant_id     +character varying + +(!) + + +created_at     +timestamp + +(!) + + +updated_at     +timestamp + +(!) + + +endpoint_resource_host     +bigint + + + + + +host_resources:e->endpoint_resources:w + + +* +1 + + + +hostgpu_resources + + + +       hostgpu_resources        + + +id +     +bigint + +(!) + + +resource_id     +character varying + +(!) + + +pci_id     +character varying + + +product     +character varying + + +vendor     +character varying + + +description     +character varying + + +device_name     +character varying + + +features     +character varying + + +tenant_id     +character varying + +(!) + + +created_at     +timestamp + +(!) + + +updated_at     +timestamp + +(!) + + +hostgpu_resource_host     +bigint + +(!) + + + + + +host_resources:e->hostgpu_resources:w + + +* +1 + + + +hostnic_resources + + + +       hostnic_resources        + + +id +     +bigint + +(!) + + +resource_id     +character varying + +(!) + + +kind     +character varying + + +provider_status     +character varying + + +device_name     +character varying + + +pci_identifier     +character varying + + +mac_addr     +character varying + + +sriov_enabled     +boolean + + +sriov_vfs_num     +bigint + + +sriov_vfs_total     +bigint + + +peer_name     +character varying + + +peer_description     +character varying + + +peer_mac     +character varying + + +peer_mgmt_ip     +character varying + + +peer_port     +character varying + + +supported_link_mode     +character varying + + +advertising_link_mode     +character varying + + +current_speed_bps     +bigint + + +current_duplex     +character varying + + +features     +character varying + + +mtu     +bigint + + +link_state     +character varying + + +bmc_interface     +boolean + + +tenant_id     +character varying + +(!) + + +created_at     +timestamp + +(!) + + +updated_at     +timestamp + +(!) + + +hostnic_resource_host     +bigint + +(!) + + + + + +host_resources:e->hostnic_resources:w + + +* +1 + + + +hoststorage_resources + + + +       hoststorage_resources        + + +id +     +bigint + +(!) + + +resource_id     +character varying + +(!) + + +kind     +character varying + + +provider_status     +character varying + + +wwid     +character varying + + +serial     +character varying + + +vendor     +character varying + + +model     +character varying + + +capacity_bytes     +bigint + + +device_name     +character varying + + +tenant_id     +character varying + +(!) + + +created_at     +timestamp + +(!) + + +updated_at     +timestamp + +(!) + + +hoststorage_resource_host     +bigint + +(!) + + + + + +host_resources:e->hoststorage_resources:w + + +* +1 + + + +hostusb_resources + + + +       hostusb_resources        + + +id +     +bigint + +(!) + + +resource_id     +character varying + +(!) + + +kind     +character varying + + +owner_id     +character varying + + +idvendor     +character varying + + +idproduct     +character varying + + +bus     +bigint + + +addr     +bigint + + +class     +character varying + + +serial     +character varying + + +device_name     +character varying + + +tenant_id     +character varying + +(!) + + +created_at     +timestamp + +(!) + + +updated_at     +timestamp + +(!) + + +hostusb_resource_host     +bigint + +(!) + + + + + +host_resources:e->hostusb_resources:w + + +* +1 + + + + +host_resources:e->repeated_schedule_resources:w + + +* +1 + + + + +host_resources:e->single_schedule_resources:w + + +* +1 + + + +netlink_resources + + + +       netlink_resources        + + +id +     +bigint + +(!) + + +resource_id     +character varying + +(!) + + +kind     +character varying + + +name     +character varying + + +desired_state     +character varying + +(!) + + +current_state     +character varying + + +provider_status     +character varying + + +tenant_id     +character varying + +(!) + + +created_at     +timestamp + +(!) + + +updated_at     +timestamp + +(!) + + +netlink_resource_src     +bigint + + +netlink_resource_dst     +bigint + + + + + +endpoint_resources:e->netlink_resources:w + + +* +1 + + + + +endpoint_resources:e->netlink_resources:w + + +* +1 + + + +ip_address_resources + + + +       ip_address_resources        + + +id +     +bigint + +(!) + + +resource_id     +character varying + +(!) + + +address     +character varying + + +desired_state     +character varying + + +current_state     +character varying + + +status     +character varying + + +status_detail     +character varying + + +config_method     +character varying + + +tenant_id     +character varying + +(!) + + +created_at     +timestamp + +(!) + + +updated_at     +timestamp + +(!) + + +ip_address_resource_nic     +bigint + +(!) + + + + + +hostnic_resources:e->ip_address_resources:w + + +* +1 + + + +custom_config_resources + + + +       custom_config_resources        + + +id +     +bigint + +(!) + + +resource_id     +character varying + +(!) + + +name     +character varying + +(!) + + +config     +character varying + +(!) + + +description     +character varying + + +tenant_id     +character varying + +(!) + + +created_at     +timestamp + +(!) + + +updated_at     +timestamp + +(!) + + + + + +custom_config_resources:e->instance_resource_custom_config:w + + +* +1 + + + +workload_resources + + + +       workload_resources        + + +id +     +bigint + +(!) + + +resource_id     +character varying + +(!) + + +kind     +character varying + +(!) + + +name     +character varying + + +external_id     +character varying + + +desired_state     +character varying + +(!) + + +current_state     +character varying + + +status     +character varying + + +metadata     +character varying + + +tenant_id     +character varying + +(!) + + +created_at     +timestamp + +(!) + + +updated_at     +timestamp + +(!) + + + + + +workload_resources:e->repeated_schedule_resources:w + + +* +1 + + + + +workload_resources:e->single_schedule_resources:w + + +* +1 + + + + +workload_resources:e->workload_members:w + + +* +1 + + + +telemetry_group_resources + + + +       telemetry_group_resources        + + +id +     +bigint + +(!) + + +resource_id     +character varying + +(!) + + +name     +character varying + +(!) + + +kind     +character varying + +(!) + + +collector_kind     +character varying + +(!) + + +groups     +character varying + +(!) + + +tenant_id     +character varying + +(!) + + +created_at     +timestamp + +(!) + + +updated_at     +timestamp + +(!) + + + + + +telemetry_group_resources:e->telemetry_profiles:w + + +* +1 + + + diff --git a/inventory/internal/ent/migrate/migrations/atlas.sum b/inventory/internal/ent/migrate/migrations/atlas.sum index dcda54262..1a8829780 100644 --- a/inventory/internal/ent/migrate/migrations/atlas.sum +++ b/inventory/internal/ent/migrate/migrations/atlas.sum @@ -1,4 +1,4 @@ -h1:mN1TXbC1X5W9nSzbtwLAxe/bBRy2QxQbKLrzb3t7hVs= +h1:hHvjUfb2ihHnmlwFTIqP05AqB6WcCGIWAT9EP8CfSi0= 20230600000000_empty.sql h1:WTkYlwWwrdJjax+pXqrJYBNu1BIdqqnF9WoasjlGLUk= 20250324165719_all.sql h1:YEGDRbDPwxh5fBkoaGAwXpPu3nDCsCDdrvTt2EzBekk= 20250520125803_add_osprof_desc.sql h1:RQBqrgNfdTJlElMRdsizeMIRLsfw2Dq1LzzdiIV/JmE= @@ -7,4 +7,7 @@ h1:mN1TXbC1X5W9nSzbtwLAxe/bBRy2QxQbKLrzb3t7hVs= 20250605145118_add_osmetadata.sql h1:Y6t1wz1AxZD9sskGKmi1YcBh4GTGarWQAsya0vrD7v4= 20250605155657_add_osupdatepolicy.sql h1:Q1CJe+b8PV6k7icmIDaBMbfVn7rZLwhuZTeeFmSegCU= 20250606153212_instance_update.sql h1:xmZLkFyu8Kaumkj9W10czTP+54Fb3sqF7RB90O7dtzE= -20250611095255_modify_OS_installed_pkgs_url.sql h1:Xhp4/L+9mm3DpUW/zPu3qKuaoHEA5+oz/DOZpYSChjQ= \ No newline at end of file +20250610144827_add_customconfig.sql h1:AEZjZR5G0WSxeuyVDuc7LzIYHDnSX7ALaMGaQIRZYeo= +20250611095255_modify_OS_installed_pkgs_url.sql h1:PM9I8HOkxL7ZQlH/AWEAi+WYl8/JUCgaGwrQi4dSGUQ= +20250611162552_modify_OSResource_name_tenantId_uniqueness.sql h1:MtQqLabFYm9rzl7F43IcqfswuesRmpId5uiJSG5BGrE= +20250612071200_add_OSUpdateRun.sql h1:f3zIP9GajWddFIEwVMvRxarPT0LKwiOOXrvKvW4Locc= diff --git a/inventory/internal/ent/schema/operating_system_resource.go b/inventory/internal/ent/schema/operating_system_resource.go index 16cbfc4f5..705d40c8b 100644 --- a/inventory/internal/ent/schema/operating_system_resource.go +++ b/inventory/internal/ent/schema/operating_system_resource.go @@ -14,7 +14,7 @@ type OperatingSystemResource struct { } func (OperatingSystemResource) Fields() []ent.Field { - return []ent.Field{field.String("resource_id").Unique(), field.String("name").Optional(), field.String("architecture").Optional(), field.String("kernel_command").Optional(), field.String("update_sources").Optional(), field.String("image_url").Optional().Immutable(), field.String("image_id").Optional().Immutable(), field.String("sha256").Optional().Immutable(), field.String("profile_name").Optional().Immutable(), field.String("profile_version").Optional().Immutable(), field.String("installed_packages").Optional(), field.String("installed_packages_url").Optional().Immutable(), field.Enum("security_feature").Optional().Immutable().Values("SECURITY_FEATURE_UNSPECIFIED", "SECURITY_FEATURE_NONE", "SECURITY_FEATURE_SECURE_BOOT_AND_FULL_DISK_ENCRYPTION"), field.Enum("os_type").Optional().Immutable().Values("OS_TYPE_UNSPECIFIED", "OS_TYPE_MUTABLE", "OS_TYPE_IMMUTABLE"), field.Enum("os_provider").Immutable().Values("OS_PROVIDER_KIND_UNSPECIFIED", "OS_PROVIDER_KIND_INFRA", "OS_PROVIDER_KIND_LENOVO"), field.String("platform_bundle").Optional().Immutable(), field.String("description").Optional().Immutable(), field.String("metadata").Optional(), field.String("existing_cves_url").Optional().Immutable(), field.String("existing_cves").Optional(), field.String("fixed_cves_url").Optional().Immutable(), field.String("fixed_cves").Optional(), field.String("tenant_id").Immutable(), field.String("created_at").Immutable().SchemaType(map[string]string{"postgres": "TIMESTAMP"}), field.String("updated_at").SchemaType(map[string]string{"postgres": "TIMESTAMP"})} + return []ent.Field{field.String("resource_id").Unique(), field.String("name").Optional().Immutable(), field.String("architecture").Optional(), field.String("kernel_command").Optional(), field.String("update_sources").Optional(), field.String("image_url").Optional().Immutable(), field.String("image_id").Optional().Immutable(), field.String("sha256").Optional().Immutable(), field.String("profile_name").Optional().Immutable(), field.String("profile_version").Optional().Immutable(), field.String("installed_packages").Optional(), field.String("installed_packages_url").Optional().Immutable(), field.Enum("security_feature").Optional().Immutable().Values("SECURITY_FEATURE_UNSPECIFIED", "SECURITY_FEATURE_NONE", "SECURITY_FEATURE_SECURE_BOOT_AND_FULL_DISK_ENCRYPTION"), field.Enum("os_type").Optional().Immutable().Values("OS_TYPE_UNSPECIFIED", "OS_TYPE_MUTABLE", "OS_TYPE_IMMUTABLE"), field.Enum("os_provider").Immutable().Values("OS_PROVIDER_KIND_UNSPECIFIED", "OS_PROVIDER_KIND_INFRA", "OS_PROVIDER_KIND_LENOVO"), field.String("platform_bundle").Optional().Immutable(), field.String("description").Optional().Immutable(), field.String("metadata").Optional(), field.String("existing_cves_url").Optional().Immutable(), field.String("existing_cves").Optional(), field.String("fixed_cves_url").Optional().Immutable(), field.String("fixed_cves").Optional(), field.String("tenant_id").Immutable(), field.String("created_at").Immutable().SchemaType(map[string]string{"postgres": "TIMESTAMP"}), field.String("updated_at").SchemaType(map[string]string{"postgres": "TIMESTAMP"})} } func (OperatingSystemResource) Edges() []ent.Edge { return nil diff --git a/inventory/pkg/api/os/v1/os.pb.go b/inventory/pkg/api/os/v1/os.pb.go index 5a44d8b4e..107d7e790 100644 --- a/inventory/pkg/api/os/v1/os.pb.go +++ b/inventory/pkg/api/os/v1/os.pb.go @@ -428,136 +428,136 @@ var file_os_v1_os_proto_rawDesc = []byte{ 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0e, 0x65, 0x6e, 0x74, 0x2f, 0x6f, 0x70, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x69, 0x6e, 0x76, 0x2f, 0x69, - 0x6e, 0x66, 0x72, 0x61, 0x69, 0x6e, 0x76, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf2, 0x0c, + 0x6e, 0x66, 0x72, 0x61, 0x69, 0x6e, 0x76, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe5, 0x0c, 0x0a, 0x17, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x43, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x22, 0xba, 0x48, 0x19, 0xd8, 0x01, 0x01, 0x72, 0x14, 0x28, 0x0b, 0x32, 0x10, 0x5e, 0x6f, 0x73, 0x2d, 0x5b, 0x30, 0x2d, 0x39, 0x61, 0x2d, 0x66, 0x5d, 0x7b, 0x38, 0x7d, 0x24, 0xba, 0xa6, 0x49, 0x02, - 0x18, 0x01, 0x52, 0x0a, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, 0x1a, - 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xba, 0xa6, - 0x49, 0x02, 0x08, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x0c, 0x61, 0x72, - 0x63, 0x68, 0x69, 0x74, 0x65, 0x63, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x06, 0xba, 0xa6, 0x49, 0x02, 0x08, 0x01, 0x52, 0x0c, 0x61, 0x72, 0x63, 0x68, 0x69, 0x74, - 0x65, 0x63, 0x74, 0x75, 0x72, 0x65, 0x12, 0x2d, 0x0a, 0x0e, 0x6b, 0x65, 0x72, 0x6e, 0x65, 0x6c, - 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, - 0xba, 0xa6, 0x49, 0x02, 0x08, 0x01, 0x52, 0x0d, 0x6b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x43, 0x6f, - 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x3a, 0x0a, 0x0e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x42, 0x13, 0xba, - 0x48, 0x0a, 0x92, 0x01, 0x07, 0x22, 0x05, 0x72, 0x03, 0x28, 0x90, 0x4e, 0xba, 0xa6, 0x49, 0x02, - 0x08, 0x01, 0x52, 0x0d, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x73, 0x12, 0x25, 0x0a, 0x09, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xba, 0xa6, 0x49, 0x04, 0x08, 0x01, 0x28, 0x01, 0x52, 0x08, - 0x69, 0x6d, 0x61, 0x67, 0x65, 0x55, 0x72, 0x6c, 0x12, 0x23, 0x0a, 0x08, 0x69, 0x6d, 0x61, 0x67, - 0x65, 0x5f, 0x69, 0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xba, 0xa6, 0x49, 0x04, - 0x08, 0x01, 0x28, 0x01, 0x52, 0x07, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x49, 0x64, 0x12, 0x38, 0x0a, - 0x06, 0x73, 0x68, 0x61, 0x32, 0x35, 0x36, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x20, 0xba, - 0x48, 0x15, 0xd8, 0x01, 0x01, 0x72, 0x10, 0x32, 0x0b, 0x5e, 0x5b, 0x61, 0x2d, 0x66, 0x30, 0x2d, - 0x39, 0x5d, 0x2b, 0x24, 0xa0, 0x01, 0x40, 0xba, 0xa6, 0x49, 0x04, 0x08, 0x01, 0x28, 0x01, 0x52, - 0x06, 0x73, 0x68, 0x61, 0x32, 0x35, 0x36, 0x12, 0x2b, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x66, 0x69, - 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xba, - 0xa6, 0x49, 0x04, 0x08, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, - 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x31, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x5f, - 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xba, - 0xa6, 0x49, 0x04, 0x08, 0x01, 0x28, 0x01, 0x52, 0x0e, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, - 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x37, 0x0a, 0x12, 0x69, 0x6e, 0x73, 0x74, 0x61, - 0x6c, 0x6c, 0x65, 0x64, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x18, 0x09, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x08, 0xba, 0xa6, 0x49, 0x04, 0x08, 0x01, 0x28, 0x00, 0x52, 0x11, 0x69, - 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, - 0x12, 0x6d, 0x0a, 0x16, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x5f, 0x70, 0x61, - 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x37, 0xba, 0x48, 0x2c, 0x72, 0x2a, 0x18, 0xc8, 0x01, 0x32, 0x25, 0x5e, 0x24, 0x7c, 0x5e, - 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, 0x5a, 0x2d, 0x5f, 0x30, 0x2d, 0x39, 0x2e, 0x2f, 0x3a, 0x3b, - 0x3d, 0x40, 0x3f, 0x21, 0x23, 0x2c, 0x3c, 0x3e, 0x2a, 0x28, 0x29, 0x22, 0x5c, 0x20, 0x5d, 0x2b, - 0x24, 0xba, 0xa6, 0x49, 0x04, 0x08, 0x01, 0x28, 0x01, 0x52, 0x14, 0x69, 0x6e, 0x73, 0x74, 0x61, - 0x6c, 0x6c, 0x65, 0x64, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x55, 0x72, 0x6c, 0x12, - 0x4b, 0x0a, 0x10, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x66, 0x65, 0x61, 0x74, - 0x75, 0x72, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x6f, 0x73, 0x2e, 0x76, - 0x31, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x42, 0x08, 0xba, 0xa6, 0x49, 0x04, 0x08, 0x01, 0x28, 0x01, 0x52, 0x0f, 0x73, 0x65, 0x63, - 0x75, 0x72, 0x69, 0x74, 0x79, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x30, 0x0a, 0x07, - 0x6f, 0x73, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0d, 0x2e, - 0x6f, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x73, 0x54, 0x79, 0x70, 0x65, 0x42, 0x08, 0xba, 0xa6, - 0x49, 0x04, 0x08, 0x01, 0x28, 0x01, 0x52, 0x06, 0x6f, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x40, - 0x0a, 0x0b, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, 0x0e, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x6f, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x73, 0x50, 0x72, - 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x4b, 0x69, 0x6e, 0x64, 0x42, 0x08, 0xba, 0xa6, 0x49, 0x04, - 0x08, 0x00, 0x28, 0x01, 0x52, 0x0a, 0x6f, 0x73, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, - 0x12, 0x31, 0x0a, 0x0f, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x5f, 0x62, 0x75, 0x6e, - 0x64, 0x6c, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xba, 0xa6, 0x49, 0x04, 0x08, - 0x01, 0x28, 0x01, 0x52, 0x0e, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x75, 0x6e, - 0x64, 0x6c, 0x65, 0x12, 0x64, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, 0x42, 0x42, 0xba, 0x48, 0x37, 0xd8, 0x01, 0x01, - 0x72, 0x32, 0x28, 0xe8, 0x07, 0x32, 0x2d, 0x5e, 0x24, 0x7c, 0x5e, 0x5b, 0x61, 0x2d, 0x7a, 0x41, - 0x2d, 0x5a, 0x2d, 0x5f, 0x30, 0x2d, 0x39, 0x2e, 0x3a, 0x3b, 0x3d, 0x40, 0x3f, 0x21, 0x23, 0x2c, - 0x3c, 0x3e, 0x2a, 0x28, 0x29, 0x7b, 0x7d, 0x26, 0x25, 0x24, 0x60, 0x5e, 0x5c, 0x2b, 0x5c, 0x2d, - 0x20, 0x5d, 0x2b, 0x24, 0xba, 0xa6, 0x49, 0x04, 0x08, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x64, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x50, 0x0a, 0x08, 0x6d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x42, 0x34, 0xba, 0x48, 0x2b, - 0x72, 0x29, 0x18, 0xf4, 0x03, 0x32, 0x24, 0x5e, 0x24, 0x7c, 0x5e, 0x5b, 0x61, 0x2d, 0x7a, 0x30, - 0x2d, 0x39, 0x2c, 0x2e, 0x5c, 0x2d, 0x5f, 0x3a, 0x2f, 0x22, 0x5c, 0x5c, 0x20, 0x5c, 0x5c, 0x6e, - 0x5c, 0x7b, 0x5c, 0x7d, 0x5c, 0x5b, 0x5c, 0x5d, 0x5d, 0x2b, 0x24, 0xba, 0xa6, 0x49, 0x02, 0x08, - 0x01, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x42, 0x0a, 0x11, 0x65, - 0x78, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x76, 0x65, 0x73, 0x5f, 0x75, 0x72, 0x6c, - 0x18, 0x2a, 0x20, 0x01, 0x28, 0x09, 0x42, 0x16, 0xba, 0x48, 0x0b, 0xd8, 0x01, 0x01, 0x72, 0x06, - 0x18, 0xf4, 0x03, 0x90, 0x01, 0x01, 0xba, 0xa6, 0x49, 0x04, 0x08, 0x01, 0x28, 0x01, 0x52, 0x0f, - 0x65, 0x78, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x43, 0x76, 0x65, 0x73, 0x55, 0x72, 0x6c, 0x12, - 0x6b, 0x0a, 0x0d, 0x65, 0x78, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x76, 0x65, 0x73, - 0x18, 0x2b, 0x20, 0x01, 0x28, 0x09, 0x42, 0x46, 0xba, 0x48, 0x3d, 0xd8, 0x01, 0x01, 0x72, 0x38, - 0x18, 0xa0, 0x9c, 0x01, 0x32, 0x32, 0x5e, 0x24, 0x7c, 0x5e, 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, - 0x5a, 0x2d, 0x5f, 0x30, 0x2d, 0x39, 0x2e, 0x2f, 0x3a, 0x3b, 0x3d, 0x40, 0x3f, 0x21, 0x23, 0x2c, - 0x3c, 0x3e, 0x2a, 0x2b, 0x7e, 0x28, 0x29, 0x22, 0x5c, 0x5c, 0x20, 0x5c, 0x0a, 0x5c, 0x7b, 0x5c, - 0x7d, 0x5c, 0x5b, 0x5c, 0x5d, 0x5d, 0x2b, 0x24, 0xba, 0xa6, 0x49, 0x02, 0x08, 0x01, 0x52, 0x0c, - 0x65, 0x78, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x43, 0x76, 0x65, 0x73, 0x12, 0x3c, 0x0a, 0x0e, - 0x66, 0x69, 0x78, 0x65, 0x64, 0x5f, 0x63, 0x76, 0x65, 0x73, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x2c, + 0x18, 0x01, 0x52, 0x0a, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, 0x1c, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xba, 0xa6, + 0x49, 0x04, 0x08, 0x01, 0x28, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x0c, + 0x61, 0x72, 0x63, 0x68, 0x69, 0x74, 0x65, 0x63, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x06, 0xba, 0xa6, 0x49, 0x02, 0x08, 0x01, 0x52, 0x0c, 0x61, 0x72, 0x63, 0x68, + 0x69, 0x74, 0x65, 0x63, 0x74, 0x75, 0x72, 0x65, 0x12, 0x2d, 0x0a, 0x0e, 0x6b, 0x65, 0x72, 0x6e, + 0x65, 0x6c, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x06, 0xba, 0xa6, 0x49, 0x02, 0x08, 0x01, 0x52, 0x0d, 0x6b, 0x65, 0x72, 0x6e, 0x65, 0x6c, + 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x3a, 0x0a, 0x0e, 0x75, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x42, + 0x13, 0xba, 0x48, 0x0a, 0x92, 0x01, 0x07, 0x22, 0x05, 0x72, 0x03, 0x28, 0x90, 0x4e, 0xba, 0xa6, + 0x49, 0x02, 0x08, 0x01, 0x52, 0x0d, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x73, 0x12, 0x25, 0x0a, 0x09, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x5f, 0x75, 0x72, 0x6c, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xba, 0xa6, 0x49, 0x04, 0x08, 0x01, 0x28, 0x01, + 0x52, 0x08, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x55, 0x72, 0x6c, 0x12, 0x23, 0x0a, 0x08, 0x69, 0x6d, + 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xba, 0xa6, + 0x49, 0x04, 0x08, 0x01, 0x28, 0x01, 0x52, 0x07, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x49, 0x64, 0x12, + 0x38, 0x0a, 0x06, 0x73, 0x68, 0x61, 0x32, 0x35, 0x36, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x20, 0xba, 0x48, 0x15, 0xd8, 0x01, 0x01, 0x72, 0x10, 0x32, 0x0b, 0x5e, 0x5b, 0x61, 0x2d, 0x66, + 0x30, 0x2d, 0x39, 0x5d, 0x2b, 0x24, 0xa0, 0x01, 0x40, 0xba, 0xa6, 0x49, 0x04, 0x08, 0x01, 0x28, + 0x01, 0x52, 0x06, 0x73, 0x68, 0x61, 0x32, 0x35, 0x36, 0x12, 0x2b, 0x0a, 0x0c, 0x70, 0x72, 0x6f, + 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x08, 0xba, 0xa6, 0x49, 0x04, 0x08, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x66, 0x69, + 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x31, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, + 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x08, 0xba, 0xa6, 0x49, 0x04, 0x08, 0x01, 0x28, 0x01, 0x52, 0x0e, 0x70, 0x72, 0x6f, 0x66, 0x69, + 0x6c, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x37, 0x0a, 0x12, 0x69, 0x6e, 0x73, + 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x18, + 0x09, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xba, 0xa6, 0x49, 0x04, 0x08, 0x01, 0x28, 0x00, 0x52, + 0x11, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, + 0x65, 0x73, 0x12, 0x49, 0x0a, 0x16, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x5f, + 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x11, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x13, 0xba, 0x48, 0x08, 0x72, 0x06, 0x18, 0xc8, 0x01, 0x90, 0x01, 0x01, 0xba, + 0xa6, 0x49, 0x04, 0x08, 0x01, 0x28, 0x01, 0x52, 0x14, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, + 0x65, 0x64, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x55, 0x72, 0x6c, 0x12, 0x4b, 0x0a, + 0x10, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x6f, 0x73, 0x2e, 0x76, 0x31, 0x2e, + 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x42, + 0x08, 0xba, 0xa6, 0x49, 0x04, 0x08, 0x01, 0x28, 0x01, 0x52, 0x0f, 0x73, 0x65, 0x63, 0x75, 0x72, + 0x69, 0x74, 0x79, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x30, 0x0a, 0x07, 0x6f, 0x73, + 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0d, 0x2e, 0x6f, 0x73, + 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x73, 0x54, 0x79, 0x70, 0x65, 0x42, 0x08, 0xba, 0xa6, 0x49, 0x04, + 0x08, 0x01, 0x28, 0x01, 0x52, 0x06, 0x6f, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x40, 0x0a, 0x0b, + 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, 0x0e, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x15, 0x2e, 0x6f, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x73, 0x50, 0x72, 0x6f, 0x76, + 0x69, 0x64, 0x65, 0x72, 0x4b, 0x69, 0x6e, 0x64, 0x42, 0x08, 0xba, 0xa6, 0x49, 0x04, 0x08, 0x00, + 0x28, 0x01, 0x52, 0x0a, 0x6f, 0x73, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x31, + 0x0a, 0x0f, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x5f, 0x62, 0x75, 0x6e, 0x64, 0x6c, + 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xba, 0xa6, 0x49, 0x04, 0x08, 0x01, 0x28, + 0x01, 0x52, 0x0e, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x75, 0x6e, 0x64, 0x6c, + 0x65, 0x12, 0x64, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, 0x42, 0x42, 0xba, 0x48, 0x37, 0xd8, 0x01, 0x01, 0x72, 0x32, + 0x28, 0xe8, 0x07, 0x32, 0x2d, 0x5e, 0x24, 0x7c, 0x5e, 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, 0x5a, + 0x2d, 0x5f, 0x30, 0x2d, 0x39, 0x2e, 0x3a, 0x3b, 0x3d, 0x40, 0x3f, 0x21, 0x23, 0x2c, 0x3c, 0x3e, + 0x2a, 0x28, 0x29, 0x7b, 0x7d, 0x26, 0x25, 0x24, 0x60, 0x5e, 0x5c, 0x2b, 0x5c, 0x2d, 0x20, 0x5d, + 0x2b, 0x24, 0xba, 0xa6, 0x49, 0x04, 0x08, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x50, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x42, 0x34, 0xba, 0x48, 0x2b, 0x72, 0x29, + 0x18, 0xf4, 0x03, 0x32, 0x24, 0x5e, 0x24, 0x7c, 0x5e, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, + 0x2c, 0x2e, 0x5c, 0x2d, 0x5f, 0x3a, 0x2f, 0x22, 0x5c, 0x5c, 0x20, 0x5c, 0x5c, 0x6e, 0x5c, 0x7b, + 0x5c, 0x7d, 0x5c, 0x5b, 0x5c, 0x5d, 0x5d, 0x2b, 0x24, 0xba, 0xa6, 0x49, 0x02, 0x08, 0x01, 0x52, + 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x42, 0x0a, 0x11, 0x65, 0x78, 0x69, + 0x73, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x76, 0x65, 0x73, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x2a, 0x20, 0x01, 0x28, 0x09, 0x42, 0x16, 0xba, 0x48, 0x0b, 0xd8, 0x01, 0x01, 0x72, 0x06, 0x18, 0xf4, - 0x03, 0x90, 0x01, 0x01, 0xba, 0xa6, 0x49, 0x04, 0x08, 0x01, 0x28, 0x01, 0x52, 0x0c, 0x66, 0x69, - 0x78, 0x65, 0x64, 0x43, 0x76, 0x65, 0x73, 0x55, 0x72, 0x6c, 0x12, 0x65, 0x0a, 0x0a, 0x66, 0x69, - 0x78, 0x65, 0x64, 0x5f, 0x63, 0x76, 0x65, 0x73, 0x18, 0x2d, 0x20, 0x01, 0x28, 0x09, 0x42, 0x46, - 0xba, 0x48, 0x3d, 0xd8, 0x01, 0x01, 0x72, 0x38, 0x18, 0xa0, 0x9c, 0x01, 0x32, 0x32, 0x5e, 0x24, - 0x7c, 0x5e, 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, 0x5a, 0x2d, 0x5f, 0x30, 0x2d, 0x39, 0x2e, 0x2f, - 0x3a, 0x3b, 0x3d, 0x40, 0x3f, 0x21, 0x23, 0x2c, 0x3c, 0x3e, 0x2a, 0x2b, 0x7e, 0x28, 0x29, 0x22, - 0x5c, 0x5c, 0x20, 0x5c, 0x0a, 0x5c, 0x7b, 0x5c, 0x7d, 0x5c, 0x5b, 0x5c, 0x5d, 0x5d, 0x2b, 0x24, - 0xba, 0xa6, 0x49, 0x02, 0x08, 0x01, 0x52, 0x09, 0x66, 0x69, 0x78, 0x65, 0x64, 0x43, 0x76, 0x65, - 0x73, 0x12, 0x32, 0x0a, 0x09, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x64, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x15, 0xba, 0x48, 0x0a, 0xd8, 0x01, 0x01, 0x72, 0x05, 0x28, 0x24, - 0xb0, 0x01, 0x01, 0xba, 0xa6, 0x49, 0x04, 0x08, 0x00, 0x28, 0x01, 0x52, 0x08, 0x74, 0x65, 0x6e, - 0x61, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x3f, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, - 0x5f, 0x61, 0x74, 0x18, 0xc8, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1f, 0xba, 0xa6, 0x49, 0x1b, - 0x08, 0x00, 0x28, 0x01, 0x4a, 0x15, 0x0a, 0x08, 0x70, 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, 0x73, - 0x12, 0x09, 0x54, 0x49, 0x4d, 0x45, 0x53, 0x54, 0x41, 0x4d, 0x50, 0x52, 0x09, 0x63, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x3f, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x64, 0x5f, 0x61, 0x74, 0x18, 0xc9, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1f, 0xba, 0xa6, 0x49, - 0x1b, 0x08, 0x00, 0x28, 0x00, 0x4a, 0x15, 0x0a, 0x08, 0x70, 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, - 0x73, 0x12, 0x09, 0x54, 0x49, 0x4d, 0x45, 0x53, 0x54, 0x41, 0x4d, 0x50, 0x52, 0x09, 0x75, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x3a, 0x19, 0xb2, 0xf9, 0x03, 0x0f, 0x0a, 0x0d, 0x12, - 0x09, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x00, 0xba, 0xa6, 0x49, 0x02, - 0x08, 0x01, 0x2a, 0x89, 0x01, 0x0a, 0x0f, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x46, - 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x20, 0x0a, 0x1c, 0x53, 0x45, 0x43, 0x55, 0x52, 0x49, - 0x54, 0x59, 0x5f, 0x46, 0x45, 0x41, 0x54, 0x55, 0x52, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, - 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x19, 0x0a, 0x15, 0x53, 0x45, 0x43, 0x55, - 0x52, 0x49, 0x54, 0x59, 0x5f, 0x46, 0x45, 0x41, 0x54, 0x55, 0x52, 0x45, 0x5f, 0x4e, 0x4f, 0x4e, - 0x45, 0x10, 0x01, 0x12, 0x39, 0x0a, 0x35, 0x53, 0x45, 0x43, 0x55, 0x52, 0x49, 0x54, 0x59, 0x5f, - 0x46, 0x45, 0x41, 0x54, 0x55, 0x52, 0x45, 0x5f, 0x53, 0x45, 0x43, 0x55, 0x52, 0x45, 0x5f, 0x42, - 0x4f, 0x4f, 0x54, 0x5f, 0x41, 0x4e, 0x44, 0x5f, 0x46, 0x55, 0x4c, 0x4c, 0x5f, 0x44, 0x49, 0x53, - 0x4b, 0x5f, 0x45, 0x4e, 0x43, 0x52, 0x59, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x02, 0x2a, 0x4d, - 0x0a, 0x06, 0x4f, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x17, 0x0a, 0x13, 0x4f, 0x53, 0x5f, 0x54, - 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, - 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x4f, 0x53, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x55, 0x54, - 0x41, 0x42, 0x4c, 0x45, 0x10, 0x01, 0x12, 0x15, 0x0a, 0x11, 0x4f, 0x53, 0x5f, 0x54, 0x59, 0x50, - 0x45, 0x5f, 0x49, 0x4d, 0x4d, 0x55, 0x54, 0x41, 0x42, 0x4c, 0x45, 0x10, 0x02, 0x2a, 0x6b, 0x0a, - 0x0e, 0x4f, 0x73, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x4b, 0x69, 0x6e, 0x64, 0x12, - 0x20, 0x0a, 0x1c, 0x4f, 0x53, 0x5f, 0x50, 0x52, 0x4f, 0x56, 0x49, 0x44, 0x45, 0x52, 0x5f, 0x4b, - 0x49, 0x4e, 0x44, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, - 0x00, 0x12, 0x1a, 0x0a, 0x16, 0x4f, 0x53, 0x5f, 0x50, 0x52, 0x4f, 0x56, 0x49, 0x44, 0x45, 0x52, - 0x5f, 0x4b, 0x49, 0x4e, 0x44, 0x5f, 0x49, 0x4e, 0x46, 0x52, 0x41, 0x10, 0x01, 0x12, 0x1b, 0x0a, - 0x17, 0x4f, 0x53, 0x5f, 0x50, 0x52, 0x4f, 0x56, 0x49, 0x44, 0x45, 0x52, 0x5f, 0x4b, 0x49, 0x4e, - 0x44, 0x5f, 0x4c, 0x45, 0x4e, 0x4f, 0x56, 0x4f, 0x10, 0x02, 0x42, 0x4a, 0x5a, 0x48, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x2d, 0x65, 0x64, - 0x67, 0x65, 0x2d, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2f, 0x69, 0x6e, 0x66, 0x72, - 0x61, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, - 0x2f, 0x76, 0x32, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6f, 0x73, 0x2f, 0x76, - 0x31, 0x3b, 0x6f, 0x73, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x03, 0x90, 0x01, 0x01, 0xba, 0xa6, 0x49, 0x04, 0x08, 0x01, 0x28, 0x01, 0x52, 0x0f, 0x65, 0x78, + 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x43, 0x76, 0x65, 0x73, 0x55, 0x72, 0x6c, 0x12, 0x6b, 0x0a, + 0x0d, 0x65, 0x78, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x76, 0x65, 0x73, 0x18, 0x2b, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x46, 0xba, 0x48, 0x3d, 0xd8, 0x01, 0x01, 0x72, 0x38, 0x18, 0xa0, + 0x9c, 0x01, 0x32, 0x32, 0x5e, 0x24, 0x7c, 0x5e, 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, 0x5a, 0x2d, + 0x5f, 0x30, 0x2d, 0x39, 0x2e, 0x2f, 0x3a, 0x3b, 0x3d, 0x40, 0x3f, 0x21, 0x23, 0x2c, 0x3c, 0x3e, + 0x2a, 0x2b, 0x7e, 0x28, 0x29, 0x22, 0x5c, 0x5c, 0x20, 0x5c, 0x0a, 0x5c, 0x7b, 0x5c, 0x7d, 0x5c, + 0x5b, 0x5c, 0x5d, 0x5d, 0x2b, 0x24, 0xba, 0xa6, 0x49, 0x02, 0x08, 0x01, 0x52, 0x0c, 0x65, 0x78, + 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x43, 0x76, 0x65, 0x73, 0x12, 0x3c, 0x0a, 0x0e, 0x66, 0x69, + 0x78, 0x65, 0x64, 0x5f, 0x63, 0x76, 0x65, 0x73, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x2c, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x16, 0xba, 0x48, 0x0b, 0xd8, 0x01, 0x01, 0x72, 0x06, 0x18, 0xf4, 0x03, 0x90, + 0x01, 0x01, 0xba, 0xa6, 0x49, 0x04, 0x08, 0x01, 0x28, 0x01, 0x52, 0x0c, 0x66, 0x69, 0x78, 0x65, + 0x64, 0x43, 0x76, 0x65, 0x73, 0x55, 0x72, 0x6c, 0x12, 0x65, 0x0a, 0x0a, 0x66, 0x69, 0x78, 0x65, + 0x64, 0x5f, 0x63, 0x76, 0x65, 0x73, 0x18, 0x2d, 0x20, 0x01, 0x28, 0x09, 0x42, 0x46, 0xba, 0x48, + 0x3d, 0xd8, 0x01, 0x01, 0x72, 0x38, 0x18, 0xa0, 0x9c, 0x01, 0x32, 0x32, 0x5e, 0x24, 0x7c, 0x5e, + 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, 0x5a, 0x2d, 0x5f, 0x30, 0x2d, 0x39, 0x2e, 0x2f, 0x3a, 0x3b, + 0x3d, 0x40, 0x3f, 0x21, 0x23, 0x2c, 0x3c, 0x3e, 0x2a, 0x2b, 0x7e, 0x28, 0x29, 0x22, 0x5c, 0x5c, + 0x20, 0x5c, 0x0a, 0x5c, 0x7b, 0x5c, 0x7d, 0x5c, 0x5b, 0x5c, 0x5d, 0x5d, 0x2b, 0x24, 0xba, 0xa6, + 0x49, 0x02, 0x08, 0x01, 0x52, 0x09, 0x66, 0x69, 0x78, 0x65, 0x64, 0x43, 0x76, 0x65, 0x73, 0x12, + 0x32, 0x0a, 0x09, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x64, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x15, 0xba, 0x48, 0x0a, 0xd8, 0x01, 0x01, 0x72, 0x05, 0x28, 0x24, 0xb0, 0x01, + 0x01, 0xba, 0xa6, 0x49, 0x04, 0x08, 0x00, 0x28, 0x01, 0x52, 0x08, 0x74, 0x65, 0x6e, 0x61, 0x6e, + 0x74, 0x49, 0x64, 0x12, 0x3f, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, + 0x74, 0x18, 0xc8, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1f, 0xba, 0xa6, 0x49, 0x1b, 0x08, 0x00, + 0x28, 0x01, 0x4a, 0x15, 0x0a, 0x08, 0x70, 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, 0x73, 0x12, 0x09, + 0x54, 0x49, 0x4d, 0x45, 0x53, 0x54, 0x41, 0x4d, 0x50, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x64, 0x41, 0x74, 0x12, 0x3f, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, + 0x61, 0x74, 0x18, 0xc9, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1f, 0xba, 0xa6, 0x49, 0x1b, 0x08, + 0x00, 0x28, 0x00, 0x4a, 0x15, 0x0a, 0x08, 0x70, 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, 0x73, 0x12, + 0x09, 0x54, 0x49, 0x4d, 0x45, 0x53, 0x54, 0x41, 0x4d, 0x50, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x64, 0x41, 0x74, 0x3a, 0x2e, 0xb2, 0xf9, 0x03, 0x24, 0x0a, 0x13, 0x12, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x09, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x0a, 0x0d, 0x12, 0x09, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x00, 0xba, + 0xa6, 0x49, 0x02, 0x08, 0x01, 0x2a, 0x89, 0x01, 0x0a, 0x0f, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, + 0x74, 0x79, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x20, 0x0a, 0x1c, 0x53, 0x45, 0x43, + 0x55, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x46, 0x45, 0x41, 0x54, 0x55, 0x52, 0x45, 0x5f, 0x55, 0x4e, + 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x19, 0x0a, 0x15, 0x53, + 0x45, 0x43, 0x55, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x46, 0x45, 0x41, 0x54, 0x55, 0x52, 0x45, 0x5f, + 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x01, 0x12, 0x39, 0x0a, 0x35, 0x53, 0x45, 0x43, 0x55, 0x52, 0x49, + 0x54, 0x59, 0x5f, 0x46, 0x45, 0x41, 0x54, 0x55, 0x52, 0x45, 0x5f, 0x53, 0x45, 0x43, 0x55, 0x52, + 0x45, 0x5f, 0x42, 0x4f, 0x4f, 0x54, 0x5f, 0x41, 0x4e, 0x44, 0x5f, 0x46, 0x55, 0x4c, 0x4c, 0x5f, + 0x44, 0x49, 0x53, 0x4b, 0x5f, 0x45, 0x4e, 0x43, 0x52, 0x59, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x10, + 0x02, 0x2a, 0x4d, 0x0a, 0x06, 0x4f, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x17, 0x0a, 0x13, 0x4f, + 0x53, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, + 0x45, 0x44, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x4f, 0x53, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, + 0x4d, 0x55, 0x54, 0x41, 0x42, 0x4c, 0x45, 0x10, 0x01, 0x12, 0x15, 0x0a, 0x11, 0x4f, 0x53, 0x5f, + 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x4d, 0x4d, 0x55, 0x54, 0x41, 0x42, 0x4c, 0x45, 0x10, 0x02, + 0x2a, 0x6b, 0x0a, 0x0e, 0x4f, 0x73, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x4b, 0x69, + 0x6e, 0x64, 0x12, 0x20, 0x0a, 0x1c, 0x4f, 0x53, 0x5f, 0x50, 0x52, 0x4f, 0x56, 0x49, 0x44, 0x45, + 0x52, 0x5f, 0x4b, 0x49, 0x4e, 0x44, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, + 0x45, 0x44, 0x10, 0x00, 0x12, 0x1a, 0x0a, 0x16, 0x4f, 0x53, 0x5f, 0x50, 0x52, 0x4f, 0x56, 0x49, + 0x44, 0x45, 0x52, 0x5f, 0x4b, 0x49, 0x4e, 0x44, 0x5f, 0x49, 0x4e, 0x46, 0x52, 0x41, 0x10, 0x01, + 0x12, 0x1b, 0x0a, 0x17, 0x4f, 0x53, 0x5f, 0x50, 0x52, 0x4f, 0x56, 0x49, 0x44, 0x45, 0x52, 0x5f, + 0x4b, 0x49, 0x4e, 0x44, 0x5f, 0x4c, 0x45, 0x4e, 0x4f, 0x56, 0x4f, 0x10, 0x02, 0x42, 0x4a, 0x5a, + 0x48, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, + 0x2d, 0x65, 0x64, 0x67, 0x65, 0x2d, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2f, 0x69, + 0x6e, 0x66, 0x72, 0x61, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, + 0x6f, 0x72, 0x79, 0x2f, 0x76, 0x32, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6f, + 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x6f, 0x73, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( From 3c687b9072fe3254c3f918d139080164643ac95d Mon Sep 17 00:00:00 2001 From: Sushil Lakra Date: Fri, 13 Jun 2025 14:53:47 +0000 Subject: [PATCH 4/4] Review comments fixes --- apiv2/VERSION | 2 +- apiv2/internal/server/os.go | 2 -- inventory/pkg/testing/opts.go | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/apiv2/VERSION b/apiv2/VERSION index ac2cdeba0..871e30025 100644 --- a/apiv2/VERSION +++ b/apiv2/VERSION @@ -1 +1 @@ -2.1.3 +2.1.5-dev diff --git a/apiv2/internal/server/os.go b/apiv2/internal/server/os.go index d2d366692..0992b2e3c 100644 --- a/apiv2/internal/server/os.go +++ b/apiv2/internal/server/os.go @@ -53,9 +53,7 @@ func toInvOSResource(osResource *osv1.OperatingSystemResource) (*inv_osv1.Operat Description: osResource.GetDescription(), Metadata: osResource.GetMetadata(), ExistingCvesUrl: osResource.GetExistingCvesUrl(), - ExistingCves: osResource.GetExistingCves(), FixedCvesUrl: osResource.GetFixedCvesUrl(), - FixedCves: osResource.GetFixedCves(), } err := validator.ValidateMessage(invOSResource) diff --git a/inventory/pkg/testing/opts.go b/inventory/pkg/testing/opts.go index 03776fd0d..543a22ce0 100644 --- a/inventory/pkg/testing/opts.go +++ b/inventory/pkg/testing/opts.go @@ -353,7 +353,7 @@ func InstalledPackages(pkgs string) Opt[osv1.OperatingSystemResource] { } } -func InstalledPackagesUrl(url string) Opt[osv1.OperatingSystemResource] { +func InstalledPackagesURL(url string) Opt[osv1.OperatingSystemResource] { return func(t *osv1.OperatingSystemResource) { t.InstalledPackagesUrl = url }