From 5d01ee408ed7655c68d984b8cd3769219cc91e6c Mon Sep 17 00:00:00 2001 From: Hamza El-Saawy Date: Wed, 20 Sep 2023 13:49:15 -0400 Subject: [PATCH 1/2] Regenerate hcsschema files Run swagger code generator (`swagger-codegen-cli`) on HCS schema (version 2.5) based on Windows Server 2022 (OS build 20348) files to regenerate the hcsschema package (`internal/hcs/schema2`). See for schema version information. https://learn.microsoft.com/en-us/virtualization/api/hcs/schemareference#schema-version-map (The files show the API version as 2.4, that is controlled by the OpenAPI schema generator, which we have no control over.) Change adds several new schema objects and fields, and updates the types of other fields (eg, `hcsschema.ConsoleSize` is now a `uint16` instead of `int32`). Fix acronym capitalization. Add `internal/hcs/schema2/doc.go` to describe package design considerations, add helper functions, and list files that are manually updated. Added `*_lookup.go` files to augment certain enum types with conversion functions. This is specifically for integer-valued enums, which OpenAPI strips information from in the spec, as well as common enums (ie, `OSType` and `SystemType`) which we convert from strings. Deleted duplicate files, as well as swagger-specific ancillary files (ie, `internal/hcs/schema2/configuration.go`, created by: https://github.com/swagger-api/swagger-codegen/blob/v2.4.32/modules/swagger-codegen/src/main/resources/go/configuration.mustache) Switch from `interface{}` to `json.RawMessage` globally within package to simplify (un)marshalling and pre-compute JSON message components. Add comment to (mostly string) fields with the expected pattern. Signed-off-by: Hamza El-Saawy --- .../hcs/schema2/app_container_launch_type.go | 24 +++ .../apply_secure_boot_template_type.go | 22 +++ internal/hcs/schema2/attachment.go | 42 ++--- internal/hcs/schema2/attachment_type.go | 26 +++ internal/hcs/schema2/attribution_record.go | 24 +++ internal/hcs/schema2/basic_information.go | 20 +++ internal/hcs/schema2/batched_binding.go | 19 +++ internal/hcs/schema2/battery.go | 8 +- internal/hcs/schema2/boot_device.go | 24 +++ internal/hcs/schema2/box.go | 19 +++ .../schema2/cache_allocation_system_info.go | 24 +++ internal/hcs/schema2/cache_mode.go | 25 +++ .../schema2/cache_monitoring_system_info.go | 25 +++ .../hcs/schema2/cache_operation_request.go | 24 +++ .../hcs/schema2/cache_query_stats_response.go | 16 +- .../schema2/cache_set_cos_bitmask_request.go | 19 +++ .../hcs/schema2/cache_set_root_cos_request.go | 18 ++ .../schema2/cache_set_root_rmid_request.go | 18 ++ internal/hcs/schema2/caching_mode.go | 23 +++ internal/hcs/schema2/chipset.go | 33 ++-- internal/hcs/schema2/cim_mount.go | 22 ++- internal/hcs/schema2/cim_mount_flags.go | 9 + internal/hcs/schema2/close_handle.go | 10 +- internal/hcs/schema2/com_port.go | 15 +- internal/hcs/schema2/combined_layers.go | 22 +++ internal/hcs/schema2/compute_system.go | 36 ++-- .../hcs/schema2/compute_system_properties.go | 30 ++++ internal/hcs/schema2/configuration.go | 72 -------- internal/hcs/schema2/console_image.go | 19 +++ internal/hcs/schema2/console_image_query.go | 24 +++ internal/hcs/schema2/console_size.go | 13 +- internal/hcs/schema2/container.go | 42 +++-- ...r_credential_guard_add_instance_request.go | 15 +- ...edential_guard_hv_socket_service_config.go | 12 +- .../container_credential_guard_instance.go | 10 +- ...ainer_credential_guard_modify_operation.go | 11 +- ...iner_credential_guard_operation_request.go | 16 +- ...redential_guard_remove_instance_request.go | 10 +- .../container_credential_guard_state.go | 23 ++- .../container_credential_guard_system_info.go | 8 +- .../container_credential_guard_transport.go | 23 +++ internal/hcs/schema2/container_hv_socket.go | 25 +++ internal/hcs/schema2/container_memory.go | 22 +++ .../schema2/container_memory_information.go | 25 --- internal/hcs/schema2/container_processor.go | 24 +++ .../schema2/containers_def_batched_binding.go | 19 +++ .../hcs/schema2/containers_def_container.go | 18 ++ ...ion_device.go => containers_def_device.go} | 8 +- internal/hcs/schema2/cpu_group.go | 9 +- internal/hcs/schema2/cpu_group_affinity.go | 12 +- internal/hcs/schema2/cpu_group_config.go | 11 +- .../hcs/schema2/cpu_group_configurations.go | 6 +- internal/hcs/schema2/cpu_group_property.go | 16 +- internal/hcs/schema2/crash_options.go | 19 +++ internal/hcs/schema2/crash_report.go | 36 ++++ .../hcs/schema2/crash_report_process_dump.go | 22 +++ internal/hcs/schema2/crash_type.go | 22 +++ .../hcs/schema2/create_group_operation.go | 13 +- internal/hcs/schema2/debug_options.go | 22 ++- .../hcs/schema2/delete_group_operation.go | 9 +- internal/hcs/schema2/device.go | 27 ++- ..._device_category.go => device_category.go} | 6 +- internal/hcs/schema2/device_extension.go | 19 +++ ..._device_instance.go => device_instance.go} | 8 +- ...evice_namespace.go => device_namespace.go} | 6 +- internal/hcs/schema2/device_type.go | 23 +++ internal/hcs/schema2/devices.go | 65 ++++---- internal/hcs/schema2/doc.go | 102 ++++++++++++ internal/hcs/schema2/enhanced_mode_video.go | 8 +- .../schema2/enlightenment_modifications.go | 24 +++ internal/hcs/schema2/error_event.go | 34 ++++ internal/hcs/schema2/event_data.go | 21 +++ internal/hcs/schema2/event_data_type.go | 37 +++++ internal/hcs/schema2/exit_initiator.go | 26 +++ internal/hcs/schema2/export_layer_options.go | 18 ++ .../schema2/feature_setting_disposition.go | 26 +++ .../hcs/schema2/filesystem_isolation_mode.go | 22 +++ internal/hcs/schema2/filesystem_layer.go | 20 +++ internal/hcs/schema2/filesystem_namespace.go | 22 +++ .../hcs/schema2/filesystem_nesting_mode.go | 22 +++ .../hcs/schema2/filtered_property_query.go | 25 +++ internal/hcs/schema2/flexible_io_device.go | 19 ++- .../flexible_io_device_hosting_model.go | 23 +++ internal/hcs/schema2/floppy_controller.go | 19 +++ internal/hcs/schema2/get_property_type.go | 33 ++++ internal/hcs/schema2/gpu_assignment_mode.go | 24 +++ internal/hcs/schema2/gpu_configuration.go | 22 +++ internal/hcs/schema2/guest_connection.go | 16 +- internal/hcs/schema2/guest_connection_info.go | 25 +-- internal/hcs/schema2/guest_crash.go | 19 +++ internal/hcs/schema2/guest_crash_reporting.go | 8 +- internal/hcs/schema2/guest_isolation_type.go | 25 +++ internal/hcs/schema2/guest_memory_info.go | 24 +++ .../schema2/guest_modify_setting_request.go | 26 +++ internal/hcs/schema2/guest_os.go | 12 +- internal/hcs/schema2/guest_state.go | 23 ++- internal/hcs/schema2/guest_state_file_type.go | 22 +++ internal/hcs/schema2/heartbeat.go | 17 ++ internal/hcs/schema2/hook.go | 21 +++ internal/hcs/schema2/hooks.go | 20 +++ internal/hcs/schema2/host_files.go | 20 +++ internal/hcs/schema2/host_memory.go | 31 ++++ .../host_memory_modification_request.go | 23 +++ internal/hcs/schema2/host_memory_operation.go | 27 +++ .../hcs/schema2/host_memory_query_request.go | 23 +++ .../hcs/schema2/host_memory_query_type.go | 22 +++ ...=> host_processor_modification_request.go} | 14 +- internal/hcs/schema2/hosted_system.go | 14 +- internal/hcs/schema2/hv_socket.go | 16 -- internal/hcs/schema2/hv_socket_address.go | 13 +- .../hcs/schema2/hv_socket_service_config.go | 24 ++- .../hcs/schema2/hv_socket_system_config.go | 20 +-- internal/hcs/schema2/ide_controller.go | 19 +++ .../hcs/schema2/idle_processors_request.go | 18 ++ .../hcs/schema2/idled_processor_response.go | 20 +++ .../schema2/inject_non_maskable_interrupt.go | 18 ++ ...ration_component_operating_state_reason.go | 27 +++ ...integration_component_operational_state.go | 29 ++++ .../schema2/integration_component_status.go | 21 +++ ..._interface_class.go => interface_class.go} | 9 +- internal/hcs/schema2/interface_class_type.go | 24 +++ .../hcs/schema2/interrupt_moderation_mode.go | 43 ++--- .../interrupt_moderation_mode_lookup.go | 28 ++++ internal/hcs/schema2/iov_settings.go | 20 ++- internal/hcs/schema2/isolation_settings.go | 14 +- internal/hcs/schema2/job_cpu.go | 19 +++ internal/hcs/schema2/job_memory.go | 18 ++ internal/hcs/schema2/job_namespace.go | 22 +++ internal/hcs/schema2/job_system_root.go | 18 ++ .../hcs/schema2/job_termination_policy.go | 22 +++ internal/hcs/schema2/kernel_integration.go | 17 ++ internal/hcs/schema2/keyboard.go | 8 +- internal/hcs/schema2/kvp_exchange.go | 20 +++ internal/hcs/schema2/kvp_query.go | 21 +++ internal/hcs/schema2/kvp_source.go | 24 +++ internal/hcs/schema2/launch_options.go | 18 ++ internal/hcs/schema2/layer.go | 25 +-- internal/hcs/schema2/layer_data.go | 19 +++ internal/hcs/schema2/licensing.go | 21 +++ internal/hcs/schema2/linux.go | 30 ++++ internal/hcs/schema2/linux_block_io.go | 24 +++ internal/hcs/schema2/linux_capabilities.go | 22 +++ internal/hcs/schema2/linux_combined_layers.go | 20 +++ internal/hcs/schema2/linux_cpu.go | 24 +++ internal/hcs/schema2/linux_device.go | 24 +++ internal/hcs/schema2/linux_device_cgroup.go | 22 +++ .../linux_guest_modify_setting_request.go | 24 +++ internal/hcs/schema2/linux_hosted_system.go | 20 +++ internal/hcs/schema2/linux_hugepage_limit.go | 19 +++ internal/hcs/schema2/linux_id_mapping.go | 20 +++ internal/hcs/schema2/linux_intel_rdt.go | 18 ++ .../hcs/schema2/linux_interface_priority.go | 19 +++ internal/hcs/schema2/linux_kernel_direct.go | 14 +- ...del_device_extension.go => linux_layer.go} | 11 +- .../hcs/schema2/linux_mapped_directory.go | 21 +++ .../hcs/schema2/linux_mapped_virtual_disk.go | 21 +++ internal/hcs/schema2/linux_memory.go | 24 +++ .../hcs/schema2/linux_modify_request_type.go | 23 +++ .../hcs/schema2/linux_modify_resource_type.go | 24 +++ internal/hcs/schema2/linux_namespace.go | 20 +++ internal/hcs/schema2/linux_network.go | 19 +++ internal/hcs/schema2/linux_pids.go | 18 ++ .../hcs/schema2/linux_process_parameters.go | 21 +++ internal/hcs/schema2/linux_rdma.go | 19 +++ internal/hcs/schema2/linux_resources.go | 25 +++ internal/hcs/schema2/linux_seccomp.go | 20 +++ internal/hcs/schema2/linux_seccomp_arg.go | 21 +++ internal/hcs/schema2/linux_syscall.go | 20 +++ internal/hcs/schema2/linux_throttle_device.go | 20 +++ internal/hcs/schema2/linux_weight_device.go | 21 +++ internal/hcs/schema2/logical_processor.go | 17 +- internal/hcs/schema2/mapped_directory.go | 21 ++- internal/hcs/schema2/mapped_pipe.go | 17 +- internal/hcs/schema2/mapped_pipe_path_type.go | 22 +++ internal/hcs/schema2/mapped_virtual_disk.go | 21 +++ .../schema2/mapped_virtual_p_mem_device.go | 19 +++ internal/hcs/schema2/memory.go | 14 -- internal/hcs/schema2/memory_2.go | 49 ------ .../hcs/schema2/memory_backing_page_size.go | 22 +++ internal/hcs/schema2/memory_backing_type.go | 22 +++ internal/hcs/schema2/memory_balancer_info.go | 21 +++ .../memory_balancing_enable_operation.go | 18 ++ .../memory_bw_allocation_system_info.go | 23 +++ .../schema2/memory_information_for_host.go | 24 +++ .../hcs/schema2/memory_information_for_vm.go | 17 +- .../memory_io_space_conversion_operation.go | 21 +++ .../hcs/schema2/memory_reserve_page_size.go | 25 +++ .../memory_reserve_resize_operation.go | 24 +++ internal/hcs/schema2/memory_reserve_target.go | 18 ++ .../memory_reserve_target_operation.go | 19 +++ .../memory_reserve_target_query_operation.go | 18 ++ internal/hcs/schema2/memory_stats.go | 16 +- internal/hcs/schema2/metering_port_acl.go | 27 +++ .../hcs/schema2/model_object_directory.go | 18 -- .../hcs/schema2/model_object_namespace.go | 16 -- internal/hcs/schema2/model_object_symlink.go | 18 -- internal/hcs/schema2/modification_request.go | 16 +- .../hcs/schema2/modification_request_extra.go | 35 ++++ internal/hcs/schema2/modify_operation.go | 22 +++ internal/hcs/schema2/modify_property_type.go | 27 +++ internal/hcs/schema2/modify_request_type.go | 23 +++ internal/hcs/schema2/modify_resource_type.go | 36 ++++ .../hcs/schema2/modify_service_operation.go | 24 +++ .../hcs/schema2/modify_setting_request.go | 23 +-- .../schema2/modify_setting_request_extra.go | 56 +++++++ internal/hcs/schema2/mount.go | 21 +++ .../hcs/schema2/mount_manager_mount_point.go | 19 +++ .../hcs/schema2/mount_manager_namespace.go | 18 ++ internal/hcs/schema2/mouse.go | 8 +- internal/hcs/schema2/named_pipe_namespace.go | 18 ++ internal/hcs/schema2/named_pipe_symlink.go | 19 +++ internal/hcs/schema2/namespace.go | 26 +++ internal/hcs/schema2/network_adapter.go | 37 ++++- internal/hcs/schema2/network_adapter_type.go | 23 +++ .../schema2/network_modify_request_type.go | 24 +++ .../schema2/network_modify_setting_request.go | 25 +++ internal/hcs/schema2/network_namespace.go | 18 ++ internal/hcs/schema2/network_property.go | 18 ++ ...up_operations.go => network_property_2.go} | 13 +- .../hcs/schema2/network_property_query.go | 21 +++ internal/hcs/schema2/networking.go | 20 +-- .../schema2/non_architectural_core_sharing.go | 24 +++ internal/hcs/schema2/notification_type.go | 26 +++ internal/hcs/schema2/numa.go | 20 +++ internal/hcs/schema2/numa_node_memory.go | 21 +++ internal/hcs/schema2/numa_node_processor.go | 19 +++ internal/hcs/schema2/numa_setting.go | 22 +++ internal/hcs/schema2/object_directory.go | 22 +++ .../hcs/schema2/object_directory_shadow.go | 23 +++ internal/hcs/schema2/object_namespace.go | 20 +++ internal/hcs/schema2/object_symlink.go | 22 +++ internal/hcs/schema2/object_symlink_scope.go | 23 +++ internal/hcs/schema2/oci_spec.go | 25 +++ internal/hcs/schema2/operation_failure.go | 18 ++ .../hcs/schema2/operation_failure_detail.go | 46 ++++++ internal/hcs/schema2/os_layer_options.go | 25 +++ internal/hcs/schema2/os_layer_type.go | 22 +++ internal/hcs/schema2/os_type.go | 23 +++ internal/hcs/schema2/os_type_lookup.go | 11 ++ internal/hcs/schema2/path_type.go | 22 +++ internal/hcs/schema2/pause_notification.go | 12 +- internal/hcs/schema2/pause_options.go | 15 +- internal/hcs/schema2/pause_reason.go | 24 +++ .../hcs/schema2/pause_suspension_level.go | 24 +++ internal/hcs/schema2/pcat.go | 19 +++ internal/hcs/schema2/plan9_share.go | 34 ---- .../hcs/schema2/{plan9.go => plan_nine.go} | 8 +- internal/hcs/schema2/plan_nine_share.go | 24 +++ internal/hcs/schema2/plan_nine_share_flags.go | 29 ++++ .../schema2/plan_nine_share_flags_lookup.go | 15 ++ internal/hcs/schema2/process.go | 28 ++++ internal/hcs/schema2/process_details.go | 33 ++-- internal/hcs/schema2/process_dump.go | 23 +++ internal/hcs/schema2/process_dump_type.go | 25 +++ .../hcs/schema2/process_modify_request.go | 18 +- internal/hcs/schema2/process_parameters.go | 53 +++--- internal/hcs/schema2/process_signal.go | 25 +++ internal/hcs/schema2/process_status.go | 21 ++- internal/hcs/schema2/processor.go | 18 -- internal/hcs/schema2/processor_2.go | 23 --- ...rocessor_cache_modify_service_operation.go | 25 +++ .../schema2/processor_capabilities_info.go | 27 +++ internal/hcs/schema2/processor_feature.go | 156 ++++++++++++++++++ internal/hcs/schema2/processor_feature_set.go | 30 ++++ .../hcs/schema2/processor_feature_set_mode.go | 23 +++ .../schema2/processor_information_for_host.go | 22 +++ ...rocessor_limits.go => processor_limits.go} | 8 +- internal/hcs/schema2/processor_stats.go | 16 +- internal/hcs/schema2/processor_topology.go | 7 +- internal/hcs/schema2/properties.go | 82 +++++---- internal/hcs/schema2/property_query.go | 15 -- internal/hcs/schema2/property_response.go | 23 +++ internal/hcs/schema2/property_type.go | 26 --- internal/hcs/schema2/qo_s_capabilities.go | 20 +++ .../hcs/schema2/rdp_connection_options.go | 11 +- internal/hcs/schema2/registry_changes.go | 13 +- internal/hcs/schema2/registry_delete_key.go | 18 ++ internal/hcs/schema2/registry_flush_state.go | 20 +++ internal/hcs/schema2/registry_hive.go | 24 +++ internal/hcs/schema2/registry_hive_stack.go | 21 +++ internal/hcs/schema2/registry_key.go | 16 +- internal/hcs/schema2/registry_layer.go | 28 ++++ internal/hcs/schema2/registry_make_key.go | 22 +++ internal/hcs/schema2/registry_make_value.go | 22 +++ internal/hcs/schema2/registry_namespace.go | 20 +++ .../hcs/schema2/registry_redirection_node.go | 23 +++ internal/hcs/schema2/registry_symlink.go | 19 +++ internal/hcs/schema2/registry_value.go | 32 ++-- internal/hcs/schema2/registry_value_type.go | 28 ++++ internal/hcs/schema2/resolution_type.go | 25 +++ .../hcs/schema2/resolution_type_lookup.go | 10 ++ internal/hcs/schema2/restore_state.go | 18 +- internal/hcs/schema2/result_error.go | 26 +++ internal/hcs/schema2/root.go | 20 +++ .../rs4_network_modify_setting_request.go | 26 +++ internal/hcs/schema2/save_options.go | 17 +- internal/hcs/schema2/save_type.go | 22 +++ internal/hcs/schema2/scsi.go | 16 +- .../schema2/secure_nested_paging_cpu_id.go | 20 +++ .../hcs/schema2/secure_nested_paging_info.go | 22 +++ internal/hcs/schema2/security_settings.go | 6 +- internal/hcs/schema2/serial_console.go | 24 +++ internal/hcs/schema2/service_properties.go | 16 +- .../hcs/schema2/service_property_query.go | 27 +++ internal/hcs/schema2/service_property_type.go | 33 ++++ internal/hcs/schema2/services.go | 21 +++ .../set_mba_cos_throttle_value_request.go | 19 +++ .../hcs/schema2/set_property_operation.go | 22 +++ .../hcs/schema2/sgx_launch_control_mode.go | 24 +++ internal/hcs/schema2/sgx_memory.go | 25 +++ .../schema2/shared_memory_configuration.go | 8 +- internal/hcs/schema2/shared_memory_region.go | 22 +-- .../hcs/schema2/shared_memory_region_info.go | 13 +- .../{model_namespace.go => shutdown.go} | 10 +- internal/hcs/schema2/shutdown_mechanism.go | 23 +++ internal/hcs/schema2/shutdown_options.go | 24 +++ internal/hcs/schema2/shutdown_type.go | 24 +++ .../hcs/schema2/signal_process_options.go | 18 ++ internal/hcs/schema2/silo_properties.go | 13 +- internal/hcs/schema2/silo_settings.go | 25 +++ internal/hcs/schema2/state.go | 27 +++ internal/hcs/schema2/state_override.go | 23 +++ internal/hcs/schema2/statistics.go | 27 ++- internal/hcs/schema2/std_handle.go | 24 +++ internal/hcs/schema2/storage.go | 19 ++- internal/hcs/schema2/storage_qo_s.go | 16 +- internal/hcs/schema2/storage_stats.go | 19 ++- internal/hcs/schema2/subnode.go | 19 +++ internal/hcs/schema2/subnode_type.go | 24 +++ internal/hcs/schema2/system_exit.go | 19 +++ internal/hcs/schema2/system_exit_detail.go | 26 +++ internal/hcs/schema2/system_exit_status.go | 22 +++ .../system_processor_modification_request.go | 20 +++ internal/hcs/schema2/system_property_query.go | 25 +++ internal/hcs/schema2/system_property_type.go | 37 +++++ internal/hcs/schema2/system_query.go | 21 +++ internal/hcs/schema2/system_time.go | 31 ++-- internal/hcs/schema2/system_type.go | 22 +++ internal/hcs/schema2/system_type_lookup.go | 10 ++ internal/hcs/schema2/time_zone_information.go | 24 ++- internal/hcs/schema2/timesync.go | 17 ++ internal/hcs/schema2/topology.go | 14 +- internal/hcs/schema2/triple_fault.go | 18 ++ internal/hcs/schema2/uefi.go | 22 +-- internal/hcs/schema2/uefi_boot_device.go | 24 +++ internal/hcs/schema2/uefi_boot_entry.go | 22 +-- .../hcs/schema2/uefi_system_information.go | 25 +++ internal/hcs/schema2/user.go | 21 +++ internal/hcs/schema2/v_smb_share_flags.go | 43 +++++ .../hcs/schema2/v_smb_share_flags_lookup.go | 28 ++++ internal/hcs/schema2/version.go | 16 +- internal/hcs/schema2/video_monitor.go | 17 +- internal/hcs/schema2/virtio_serial.go | 18 ++ internal/hcs/schema2/virtio_serial_port.go | 19 +++ .../hcs/schema2/virtual_device_failure.go | 29 ++++ .../schema2/virtual_device_failure_detail.go | 47 ++++++ internal/hcs/schema2/virtual_machine.go | 52 +++--- ...cket_2.go => virtual_machine_hv_socket.go} | 12 +- .../hcs/schema2/virtual_machine_memory.go | 51 ++++++ .../hcs/schema2/virtual_machine_processor.go | 38 +++++ internal/hcs/schema2/virtual_node_info.go | 19 ++- .../hcs/schema2/virtual_p_mem_backing_type.go | 22 +++ .../hcs/schema2/virtual_p_mem_controller.go | 18 +- internal/hcs/schema2/virtual_p_mem_device.go | 18 +- .../hcs/schema2/virtual_p_mem_image_format.go | 22 +++ internal/hcs/schema2/virtual_p_mem_mapping.go | 10 +- internal/hcs/schema2/virtual_pci_device.go | 14 +- internal/hcs/schema2/virtual_pci_function.go | 18 +- internal/hcs/schema2/virtual_smb.go | 13 +- .../virtual_smb_alternate_data_stream.go | 23 +++ internal/hcs/schema2/virtual_smb_share.go | 25 ++- .../hcs/schema2/virtual_smb_share_options.go | 74 +++++---- internal/hcs/schema2/vm_memory.go | 28 ++-- .../schema2/vm_memory_modification_request.go | 19 +++ internal/hcs/schema2/vm_memory_operation.go | 22 +++ .../hcs/schema2/vm_processor_requirements.go | 27 +++ .../hcs/schema2/windows_crash_dump_type.go | 28 ++++ internal/hcs/schema2/windows_crash_phase.go | 27 +++ internal/hcs/schema2/windows_crash_report.go | 37 +++++ .../hcs/schema2/windows_crash_reporting.go | 14 +- internal/hcs/schema2/worker_exit.go | 22 +++ internal/hcs/schema2/worker_exit_detail.go | 51 ++++++ internal/hcs/schema2/worker_exit_type.go | 28 ++++ .../hcs/schema2/xsave_processor_feature.go | 53 ++++++ 384 files changed, 7493 insertions(+), 1234 deletions(-) create mode 100644 internal/hcs/schema2/app_container_launch_type.go create mode 100644 internal/hcs/schema2/apply_secure_boot_template_type.go create mode 100644 internal/hcs/schema2/attachment_type.go create mode 100644 internal/hcs/schema2/attribution_record.go create mode 100644 internal/hcs/schema2/basic_information.go create mode 100644 internal/hcs/schema2/batched_binding.go create mode 100644 internal/hcs/schema2/boot_device.go create mode 100644 internal/hcs/schema2/box.go create mode 100644 internal/hcs/schema2/cache_allocation_system_info.go create mode 100644 internal/hcs/schema2/cache_mode.go create mode 100644 internal/hcs/schema2/cache_monitoring_system_info.go create mode 100644 internal/hcs/schema2/cache_operation_request.go create mode 100644 internal/hcs/schema2/cache_set_cos_bitmask_request.go create mode 100644 internal/hcs/schema2/cache_set_root_cos_request.go create mode 100644 internal/hcs/schema2/cache_set_root_rmid_request.go create mode 100644 internal/hcs/schema2/caching_mode.go create mode 100644 internal/hcs/schema2/cim_mount_flags.go create mode 100644 internal/hcs/schema2/combined_layers.go create mode 100644 internal/hcs/schema2/compute_system_properties.go delete mode 100644 internal/hcs/schema2/configuration.go create mode 100644 internal/hcs/schema2/console_image.go create mode 100644 internal/hcs/schema2/console_image_query.go create mode 100644 internal/hcs/schema2/container_credential_guard_transport.go create mode 100644 internal/hcs/schema2/container_hv_socket.go create mode 100644 internal/hcs/schema2/container_memory.go delete mode 100644 internal/hcs/schema2/container_memory_information.go create mode 100644 internal/hcs/schema2/container_processor.go create mode 100644 internal/hcs/schema2/containers_def_batched_binding.go create mode 100644 internal/hcs/schema2/containers_def_container.go rename internal/hcs/schema2/{model_container_definition_device.go => containers_def_device.go} (65%) create mode 100644 internal/hcs/schema2/crash_options.go create mode 100644 internal/hcs/schema2/crash_report.go create mode 100644 internal/hcs/schema2/crash_report_process_dump.go create mode 100644 internal/hcs/schema2/crash_type.go rename internal/hcs/schema2/{model_device_category.go => device_category.go} (74%) create mode 100644 internal/hcs/schema2/device_extension.go rename internal/hcs/schema2/{model_device_instance.go => device_instance.go} (71%) rename internal/hcs/schema2/{model_device_namespace.go => device_namespace.go} (78%) create mode 100644 internal/hcs/schema2/device_type.go create mode 100644 internal/hcs/schema2/doc.go create mode 100644 internal/hcs/schema2/enlightenment_modifications.go create mode 100644 internal/hcs/schema2/error_event.go create mode 100644 internal/hcs/schema2/event_data.go create mode 100644 internal/hcs/schema2/event_data_type.go create mode 100644 internal/hcs/schema2/exit_initiator.go create mode 100644 internal/hcs/schema2/export_layer_options.go create mode 100644 internal/hcs/schema2/feature_setting_disposition.go create mode 100644 internal/hcs/schema2/filesystem_isolation_mode.go create mode 100644 internal/hcs/schema2/filesystem_layer.go create mode 100644 internal/hcs/schema2/filesystem_namespace.go create mode 100644 internal/hcs/schema2/filesystem_nesting_mode.go create mode 100644 internal/hcs/schema2/filtered_property_query.go create mode 100644 internal/hcs/schema2/flexible_io_device_hosting_model.go create mode 100644 internal/hcs/schema2/floppy_controller.go create mode 100644 internal/hcs/schema2/get_property_type.go create mode 100644 internal/hcs/schema2/gpu_assignment_mode.go create mode 100644 internal/hcs/schema2/gpu_configuration.go create mode 100644 internal/hcs/schema2/guest_crash.go create mode 100644 internal/hcs/schema2/guest_isolation_type.go create mode 100644 internal/hcs/schema2/guest_memory_info.go create mode 100644 internal/hcs/schema2/guest_modify_setting_request.go create mode 100644 internal/hcs/schema2/guest_state_file_type.go create mode 100644 internal/hcs/schema2/heartbeat.go create mode 100644 internal/hcs/schema2/hook.go create mode 100644 internal/hcs/schema2/hooks.go create mode 100644 internal/hcs/schema2/host_files.go create mode 100644 internal/hcs/schema2/host_memory.go create mode 100644 internal/hcs/schema2/host_memory_modification_request.go create mode 100644 internal/hcs/schema2/host_memory_operation.go create mode 100644 internal/hcs/schema2/host_memory_query_request.go create mode 100644 internal/hcs/schema2/host_memory_query_type.go rename internal/hcs/schema2/{host_processor_modify_request.go => host_processor_modification_request.go} (53%) delete mode 100644 internal/hcs/schema2/hv_socket.go create mode 100644 internal/hcs/schema2/ide_controller.go create mode 100644 internal/hcs/schema2/idle_processors_request.go create mode 100644 internal/hcs/schema2/idled_processor_response.go create mode 100644 internal/hcs/schema2/inject_non_maskable_interrupt.go create mode 100644 internal/hcs/schema2/integration_component_operating_state_reason.go create mode 100644 internal/hcs/schema2/integration_component_operational_state.go create mode 100644 internal/hcs/schema2/integration_component_status.go rename internal/hcs/schema2/{model_interface_class.go => interface_class.go} (59%) create mode 100644 internal/hcs/schema2/interface_class_type.go create mode 100644 internal/hcs/schema2/interrupt_moderation_mode_lookup.go create mode 100644 internal/hcs/schema2/job_cpu.go create mode 100644 internal/hcs/schema2/job_memory.go create mode 100644 internal/hcs/schema2/job_namespace.go create mode 100644 internal/hcs/schema2/job_system_root.go create mode 100644 internal/hcs/schema2/job_termination_policy.go create mode 100644 internal/hcs/schema2/kernel_integration.go create mode 100644 internal/hcs/schema2/kvp_exchange.go create mode 100644 internal/hcs/schema2/kvp_query.go create mode 100644 internal/hcs/schema2/kvp_source.go create mode 100644 internal/hcs/schema2/launch_options.go create mode 100644 internal/hcs/schema2/layer_data.go create mode 100644 internal/hcs/schema2/licensing.go create mode 100644 internal/hcs/schema2/linux.go create mode 100644 internal/hcs/schema2/linux_block_io.go create mode 100644 internal/hcs/schema2/linux_capabilities.go create mode 100644 internal/hcs/schema2/linux_combined_layers.go create mode 100644 internal/hcs/schema2/linux_cpu.go create mode 100644 internal/hcs/schema2/linux_device.go create mode 100644 internal/hcs/schema2/linux_device_cgroup.go create mode 100644 internal/hcs/schema2/linux_guest_modify_setting_request.go create mode 100644 internal/hcs/schema2/linux_hosted_system.go create mode 100644 internal/hcs/schema2/linux_hugepage_limit.go create mode 100644 internal/hcs/schema2/linux_id_mapping.go create mode 100644 internal/hcs/schema2/linux_intel_rdt.go create mode 100644 internal/hcs/schema2/linux_interface_priority.go rename internal/hcs/schema2/{model_device_extension.go => linux_layer.go} (55%) create mode 100644 internal/hcs/schema2/linux_mapped_directory.go create mode 100644 internal/hcs/schema2/linux_mapped_virtual_disk.go create mode 100644 internal/hcs/schema2/linux_memory.go create mode 100644 internal/hcs/schema2/linux_modify_request_type.go create mode 100644 internal/hcs/schema2/linux_modify_resource_type.go create mode 100644 internal/hcs/schema2/linux_namespace.go create mode 100644 internal/hcs/schema2/linux_network.go create mode 100644 internal/hcs/schema2/linux_pids.go create mode 100644 internal/hcs/schema2/linux_process_parameters.go create mode 100644 internal/hcs/schema2/linux_rdma.go create mode 100644 internal/hcs/schema2/linux_resources.go create mode 100644 internal/hcs/schema2/linux_seccomp.go create mode 100644 internal/hcs/schema2/linux_seccomp_arg.go create mode 100644 internal/hcs/schema2/linux_syscall.go create mode 100644 internal/hcs/schema2/linux_throttle_device.go create mode 100644 internal/hcs/schema2/linux_weight_device.go create mode 100644 internal/hcs/schema2/mapped_pipe_path_type.go create mode 100644 internal/hcs/schema2/mapped_virtual_disk.go create mode 100644 internal/hcs/schema2/mapped_virtual_p_mem_device.go delete mode 100644 internal/hcs/schema2/memory.go delete mode 100644 internal/hcs/schema2/memory_2.go create mode 100644 internal/hcs/schema2/memory_backing_page_size.go create mode 100644 internal/hcs/schema2/memory_backing_type.go create mode 100644 internal/hcs/schema2/memory_balancer_info.go create mode 100644 internal/hcs/schema2/memory_balancing_enable_operation.go create mode 100644 internal/hcs/schema2/memory_bw_allocation_system_info.go create mode 100644 internal/hcs/schema2/memory_information_for_host.go create mode 100644 internal/hcs/schema2/memory_io_space_conversion_operation.go create mode 100644 internal/hcs/schema2/memory_reserve_page_size.go create mode 100644 internal/hcs/schema2/memory_reserve_resize_operation.go create mode 100644 internal/hcs/schema2/memory_reserve_target.go create mode 100644 internal/hcs/schema2/memory_reserve_target_operation.go create mode 100644 internal/hcs/schema2/memory_reserve_target_query_operation.go create mode 100644 internal/hcs/schema2/metering_port_acl.go delete mode 100644 internal/hcs/schema2/model_object_directory.go delete mode 100644 internal/hcs/schema2/model_object_namespace.go delete mode 100644 internal/hcs/schema2/model_object_symlink.go create mode 100644 internal/hcs/schema2/modification_request_extra.go create mode 100644 internal/hcs/schema2/modify_operation.go create mode 100644 internal/hcs/schema2/modify_property_type.go create mode 100644 internal/hcs/schema2/modify_request_type.go create mode 100644 internal/hcs/schema2/modify_resource_type.go create mode 100644 internal/hcs/schema2/modify_service_operation.go create mode 100644 internal/hcs/schema2/modify_setting_request_extra.go create mode 100644 internal/hcs/schema2/mount.go create mode 100644 internal/hcs/schema2/mount_manager_mount_point.go create mode 100644 internal/hcs/schema2/mount_manager_namespace.go create mode 100644 internal/hcs/schema2/named_pipe_namespace.go create mode 100644 internal/hcs/schema2/named_pipe_symlink.go create mode 100644 internal/hcs/schema2/namespace.go create mode 100644 internal/hcs/schema2/network_adapter_type.go create mode 100644 internal/hcs/schema2/network_modify_request_type.go create mode 100644 internal/hcs/schema2/network_modify_setting_request.go create mode 100644 internal/hcs/schema2/network_namespace.go create mode 100644 internal/hcs/schema2/network_property.go rename internal/hcs/schema2/{cpu_group_operations.go => network_property_2.go} (50%) create mode 100644 internal/hcs/schema2/network_property_query.go create mode 100644 internal/hcs/schema2/non_architectural_core_sharing.go create mode 100644 internal/hcs/schema2/notification_type.go create mode 100644 internal/hcs/schema2/numa.go create mode 100644 internal/hcs/schema2/numa_node_memory.go create mode 100644 internal/hcs/schema2/numa_node_processor.go create mode 100644 internal/hcs/schema2/numa_setting.go create mode 100644 internal/hcs/schema2/object_directory.go create mode 100644 internal/hcs/schema2/object_directory_shadow.go create mode 100644 internal/hcs/schema2/object_namespace.go create mode 100644 internal/hcs/schema2/object_symlink.go create mode 100644 internal/hcs/schema2/object_symlink_scope.go create mode 100644 internal/hcs/schema2/oci_spec.go create mode 100644 internal/hcs/schema2/operation_failure.go create mode 100644 internal/hcs/schema2/operation_failure_detail.go create mode 100644 internal/hcs/schema2/os_layer_options.go create mode 100644 internal/hcs/schema2/os_layer_type.go create mode 100644 internal/hcs/schema2/os_type.go create mode 100644 internal/hcs/schema2/os_type_lookup.go create mode 100644 internal/hcs/schema2/path_type.go create mode 100644 internal/hcs/schema2/pause_reason.go create mode 100644 internal/hcs/schema2/pause_suspension_level.go create mode 100644 internal/hcs/schema2/pcat.go delete mode 100644 internal/hcs/schema2/plan9_share.go rename internal/hcs/schema2/{plan9.go => plan_nine.go} (65%) create mode 100644 internal/hcs/schema2/plan_nine_share.go create mode 100644 internal/hcs/schema2/plan_nine_share_flags.go create mode 100644 internal/hcs/schema2/plan_nine_share_flags_lookup.go create mode 100644 internal/hcs/schema2/process.go create mode 100644 internal/hcs/schema2/process_dump.go create mode 100644 internal/hcs/schema2/process_dump_type.go create mode 100644 internal/hcs/schema2/process_signal.go delete mode 100644 internal/hcs/schema2/processor.go delete mode 100644 internal/hcs/schema2/processor_2.go create mode 100644 internal/hcs/schema2/processor_cache_modify_service_operation.go create mode 100644 internal/hcs/schema2/processor_capabilities_info.go create mode 100644 internal/hcs/schema2/processor_feature.go create mode 100644 internal/hcs/schema2/processor_feature_set.go create mode 100644 internal/hcs/schema2/processor_feature_set_mode.go create mode 100644 internal/hcs/schema2/processor_information_for_host.go rename internal/hcs/schema2/{vm_processor_limits.go => processor_limits.go} (79%) delete mode 100644 internal/hcs/schema2/property_query.go create mode 100644 internal/hcs/schema2/property_response.go delete mode 100644 internal/hcs/schema2/property_type.go create mode 100644 internal/hcs/schema2/qo_s_capabilities.go create mode 100644 internal/hcs/schema2/registry_delete_key.go create mode 100644 internal/hcs/schema2/registry_flush_state.go create mode 100644 internal/hcs/schema2/registry_hive.go create mode 100644 internal/hcs/schema2/registry_hive_stack.go create mode 100644 internal/hcs/schema2/registry_layer.go create mode 100644 internal/hcs/schema2/registry_make_key.go create mode 100644 internal/hcs/schema2/registry_make_value.go create mode 100644 internal/hcs/schema2/registry_namespace.go create mode 100644 internal/hcs/schema2/registry_redirection_node.go create mode 100644 internal/hcs/schema2/registry_symlink.go create mode 100644 internal/hcs/schema2/registry_value_type.go create mode 100644 internal/hcs/schema2/resolution_type.go create mode 100644 internal/hcs/schema2/resolution_type_lookup.go create mode 100644 internal/hcs/schema2/result_error.go create mode 100644 internal/hcs/schema2/root.go create mode 100644 internal/hcs/schema2/rs4_network_modify_setting_request.go create mode 100644 internal/hcs/schema2/save_type.go create mode 100644 internal/hcs/schema2/secure_nested_paging_cpu_id.go create mode 100644 internal/hcs/schema2/secure_nested_paging_info.go create mode 100644 internal/hcs/schema2/serial_console.go create mode 100644 internal/hcs/schema2/service_property_query.go create mode 100644 internal/hcs/schema2/service_property_type.go create mode 100644 internal/hcs/schema2/services.go create mode 100644 internal/hcs/schema2/set_mba_cos_throttle_value_request.go create mode 100644 internal/hcs/schema2/set_property_operation.go create mode 100644 internal/hcs/schema2/sgx_launch_control_mode.go create mode 100644 internal/hcs/schema2/sgx_memory.go rename internal/hcs/schema2/{model_namespace.go => shutdown.go} (60%) create mode 100644 internal/hcs/schema2/shutdown_mechanism.go create mode 100644 internal/hcs/schema2/shutdown_options.go create mode 100644 internal/hcs/schema2/shutdown_type.go create mode 100644 internal/hcs/schema2/signal_process_options.go create mode 100644 internal/hcs/schema2/silo_settings.go create mode 100644 internal/hcs/schema2/state.go create mode 100644 internal/hcs/schema2/state_override.go create mode 100644 internal/hcs/schema2/std_handle.go create mode 100644 internal/hcs/schema2/subnode.go create mode 100644 internal/hcs/schema2/subnode_type.go create mode 100644 internal/hcs/schema2/system_exit.go create mode 100644 internal/hcs/schema2/system_exit_detail.go create mode 100644 internal/hcs/schema2/system_exit_status.go create mode 100644 internal/hcs/schema2/system_processor_modification_request.go create mode 100644 internal/hcs/schema2/system_property_query.go create mode 100644 internal/hcs/schema2/system_property_type.go create mode 100644 internal/hcs/schema2/system_query.go create mode 100644 internal/hcs/schema2/system_type.go create mode 100644 internal/hcs/schema2/system_type_lookup.go create mode 100644 internal/hcs/schema2/timesync.go create mode 100644 internal/hcs/schema2/triple_fault.go create mode 100644 internal/hcs/schema2/uefi_boot_device.go create mode 100644 internal/hcs/schema2/uefi_system_information.go create mode 100644 internal/hcs/schema2/user.go create mode 100644 internal/hcs/schema2/v_smb_share_flags.go create mode 100644 internal/hcs/schema2/v_smb_share_flags_lookup.go create mode 100644 internal/hcs/schema2/virtio_serial.go create mode 100644 internal/hcs/schema2/virtio_serial_port.go create mode 100644 internal/hcs/schema2/virtual_device_failure.go create mode 100644 internal/hcs/schema2/virtual_device_failure_detail.go rename internal/hcs/schema2/{hv_socket_2.go => virtual_machine_hv_socket.go} (56%) create mode 100644 internal/hcs/schema2/virtual_machine_memory.go create mode 100644 internal/hcs/schema2/virtual_machine_processor.go create mode 100644 internal/hcs/schema2/virtual_p_mem_backing_type.go create mode 100644 internal/hcs/schema2/virtual_p_mem_image_format.go create mode 100644 internal/hcs/schema2/virtual_smb_alternate_data_stream.go create mode 100644 internal/hcs/schema2/vm_memory_modification_request.go create mode 100644 internal/hcs/schema2/vm_memory_operation.go create mode 100644 internal/hcs/schema2/vm_processor_requirements.go create mode 100644 internal/hcs/schema2/windows_crash_dump_type.go create mode 100644 internal/hcs/schema2/windows_crash_phase.go create mode 100644 internal/hcs/schema2/windows_crash_report.go create mode 100644 internal/hcs/schema2/worker_exit.go create mode 100644 internal/hcs/schema2/worker_exit_detail.go create mode 100644 internal/hcs/schema2/worker_exit_type.go create mode 100644 internal/hcs/schema2/xsave_processor_feature.go diff --git a/internal/hcs/schema2/app_container_launch_type.go b/internal/hcs/schema2/app_container_launch_type.go new file mode 100644 index 0000000000..23f09f0b56 --- /dev/null +++ b/internal/hcs/schema2/app_container_launch_type.go @@ -0,0 +1,24 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type AppContainerLaunchType string + +// List of AppContainerLaunchType +const ( + AppContainerLaunchType_DEFAULT_ AppContainerLaunchType = "Default" + AppContainerLaunchType_NONE AppContainerLaunchType = "None" + AppContainerLaunchType_APP_CONTAINER AppContainerLaunchType = "AppContainer" + AppContainerLaunchType_LESS_PRIVILEGED_APP_CONTAINER AppContainerLaunchType = "LessPrivilegedAppContainer" +) diff --git a/internal/hcs/schema2/apply_secure_boot_template_type.go b/internal/hcs/schema2/apply_secure_boot_template_type.go new file mode 100644 index 0000000000..2ac3b86e66 --- /dev/null +++ b/internal/hcs/schema2/apply_secure_boot_template_type.go @@ -0,0 +1,22 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type ApplySecureBootTemplateType string + +// List of ApplySecureBootTemplateType +const ( + ApplySecureBootTemplateType_SKIP ApplySecureBootTemplateType = "Skip" + ApplySecureBootTemplateType_APPLY ApplySecureBootTemplateType = "Apply" +) diff --git a/internal/hcs/schema2/attachment.go b/internal/hcs/schema2/attachment.go index 70884aad75..9c7c2b134c 100644 --- a/internal/hcs/schema2/attachment.go +++ b/internal/hcs/schema2/attachment.go @@ -1,36 +1,28 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema type Attachment struct { - Type_ string `json:"Type,omitempty"` - - Path string `json:"Path,omitempty"` - - IgnoreFlushes bool `json:"IgnoreFlushes,omitempty"` - - CachingMode string `json:"CachingMode,omitempty"` - - NoWriteHardening bool `json:"NoWriteHardening,omitempty"` - - DisableExpansionOptimization bool `json:"DisableExpansionOptimization,omitempty"` - - IgnoreRelativeLocator bool `json:"IgnoreRelativeLocator,omitempty"` - - CaptureIoAttributionContext bool `json:"CaptureIoAttributionContext,omitempty"` - - ReadOnly bool `json:"ReadOnly,omitempty"` - - SupportCompressedVolumes bool `json:"SupportCompressedVolumes,omitempty"` - - AlwaysAllowSparseFiles bool `json:"AlwaysAllowSparseFiles,omitempty"` - - ExtensibleVirtualDiskType string `json:"ExtensibleVirtualDiskType,omitempty"` + Type_ *AttachmentType `json:"Type,omitempty"` + Path string `json:"Path,omitempty"` + IgnoreFlushes bool `json:"IgnoreFlushes,omitempty"` + CachingMode *CachingMode `json:"CachingMode,omitempty"` + NoWriteHardening bool `json:"NoWriteHardening,omitempty"` + DisableExpansionOptimization bool `json:"DisableExpansionOptimization,omitempty"` + IgnoreRelativeLocator bool `json:"IgnoreRelativeLocator,omitempty"` + CaptureIOAttributionContext bool `json:"CaptureIoAttributionContext,omitempty"` + ReadOnly bool `json:"ReadOnly,omitempty"` + SupportCompressedVolumes bool `json:"SupportCompressedVolumes,omitempty"` + ExtensibleVirtualDiskType string `json:"ExtensibleVirtualDiskType,omitempty"` } diff --git a/internal/hcs/schema2/attachment_type.go b/internal/hcs/schema2/attachment_type.go new file mode 100644 index 0000000000..078a67b09b --- /dev/null +++ b/internal/hcs/schema2/attachment_type.go @@ -0,0 +1,26 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type AttachmentType string + +// List of AttachmentType +const ( + AttachmentType_VIRTUAL_DISK AttachmentType = "VirtualDisk" + AttachmentType_SHARED_DISK AttachmentType = "SharedDisk" + AttachmentType_ISO AttachmentType = "Iso" + AttachmentType_PASS_THRU AttachmentType = "PassThru" + AttachmentType_EXTENSIBLE_VIRTUAL_DISK AttachmentType = "ExtensibleVirtualDisk" + AttachmentType_VIRTUAL_FLOPPY_DISK AttachmentType = "VirtualFloppyDisk" +) diff --git a/internal/hcs/schema2/attribution_record.go b/internal/hcs/schema2/attribution_record.go new file mode 100644 index 0000000000..a0848c9f4e --- /dev/null +++ b/internal/hcs/schema2/attribution_record.go @@ -0,0 +1,24 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type AttributionRecord struct { + WorkerExit *WorkerExit `json:"WorkerExit,omitempty"` + GuestCrash *GuestCrash `json:"GuestCrash,omitempty"` + TripleFault *TripleFault `json:"TripleFault,omitempty"` + InjectNonMaskableInterrupt *InjectNonMaskableInterrupt `json:"InjectNonMaskableInterrupt,omitempty"` + OperationFailure *OperationFailure `json:"OperationFailure,omitempty"` + SystemExit *SystemExit `json:"SystemExit,omitempty"` + VirtualDeviceFailure *VirtualDeviceFailure `json:"VirtualDeviceFailure,omitempty"` +} diff --git a/internal/hcs/schema2/basic_information.go b/internal/hcs/schema2/basic_information.go new file mode 100644 index 0000000000..88aeee2203 --- /dev/null +++ b/internal/hcs/schema2/basic_information.go @@ -0,0 +1,20 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// Basic information +type BasicInformation struct { + // The supported schema versions will be returned as an array. Array element A.X implies all versions with major version A and minor version from 0 to X are also supported. + SupportedSchemaVersions []Version `json:"SupportedSchemaVersions,omitempty"` +} diff --git a/internal/hcs/schema2/batched_binding.go b/internal/hcs/schema2/batched_binding.go new file mode 100644 index 0000000000..cc927ae981 --- /dev/null +++ b/internal/hcs/schema2/batched_binding.go @@ -0,0 +1,19 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type BatchedBinding struct { + FilePath string `json:"FilePath,omitempty"` + BindingRoots []string `json:"BindingRoots,omitempty"` +} diff --git a/internal/hcs/schema2/battery.go b/internal/hcs/schema2/battery.go index ecbbed4c23..75b3d37911 100644 --- a/internal/hcs/schema2/battery.go +++ b/internal/hcs/schema2/battery.go @@ -1,9 +1,13 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ diff --git a/internal/hcs/schema2/boot_device.go b/internal/hcs/schema2/boot_device.go new file mode 100644 index 0000000000..942ff3e4fb --- /dev/null +++ b/internal/hcs/schema2/boot_device.go @@ -0,0 +1,24 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type BootDevice string + +// List of BootDevice +const ( + BootDevice_FLOPPY BootDevice = "Floppy" + BootDevice_OPTICAL BootDevice = "Optical" + BootDevice_HARD_DRIVE BootDevice = "HardDrive" + BootDevice_NETWORK BootDevice = "Network" +) diff --git a/internal/hcs/schema2/box.go b/internal/hcs/schema2/box.go new file mode 100644 index 0000000000..bc9a415cdb --- /dev/null +++ b/internal/hcs/schema2/box.go @@ -0,0 +1,19 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type Box struct { + Height uint64 `json:"height,omitempty"` + Width uint64 `json:"width,omitempty"` +} diff --git a/internal/hcs/schema2/cache_allocation_system_info.go b/internal/hcs/schema2/cache_allocation_system_info.go new file mode 100644 index 0000000000..59dcedf72d --- /dev/null +++ b/internal/hcs/schema2/cache_allocation_system_info.go @@ -0,0 +1,24 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// Structure to return processor cache partitioning settings for a Service property query. +type CacheAllocationSystemInfo struct { + L3CatSupported bool `json:"L3CatSupported,omitempty"` + L3CosBitmaskWidth uint32 `json:"L3CosBitmaskWidth,omitempty"` + L3CosBitmaskHwReserved uint32 `json:"L3CosBitmaskHwReserved,omitempty"` + NumL3CosSlots uint32 `json:"NumL3CosSlots,omitempty"` + L3CosSlots []int64 `json:"L3CosSlots,omitempty"` + RootCos uint32 `json:"RootCos,omitempty"` +} diff --git a/internal/hcs/schema2/cache_mode.go b/internal/hcs/schema2/cache_mode.go new file mode 100644 index 0000000000..b9d333f7eb --- /dev/null +++ b/internal/hcs/schema2/cache_mode.go @@ -0,0 +1,25 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type CacheMode string + +// List of CacheMode +const ( + CacheMode_EMPTY CacheMode = "" + CacheMode_DISABLED CacheMode = "Disabled" + CacheMode_ENABLED CacheMode = "Enabled" + CacheMode_PRIVATE CacheMode = "Private" + CacheMode_PRIVATE_ALLOW_SHARING CacheMode = "PrivateAllowSharing" +) diff --git a/internal/hcs/schema2/cache_monitoring_system_info.go b/internal/hcs/schema2/cache_monitoring_system_info.go new file mode 100644 index 0000000000..0f30e9f3c2 --- /dev/null +++ b/internal/hcs/schema2/cache_monitoring_system_info.go @@ -0,0 +1,25 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// Structure to return processor cache monitoring settings for a Service property query. +type CacheMonitoringSystemInfo struct { + L3CmtSupported bool `json:"L3CmtSupported,omitempty"` + L3OccupancyMonitoringSupported bool `json:"L3OccupancyMonitoringSupported,omitempty"` + L3TotalBwMonitoringSupported bool `json:"L3TotalBwMonitoringSupported,omitempty"` + L3LocalBwMonitoringSupported bool `json:"L3LocalBwMonitoringSupported,omitempty"` + MaxRmid uint32 `json:"MaxRmid,omitempty"` + RootRmid uint32 `json:"RootRmid,omitempty"` + RootCacheStats *CacheQueryStatsResponse `json:"RootCacheStats,omitempty"` +} diff --git a/internal/hcs/schema2/cache_operation_request.go b/internal/hcs/schema2/cache_operation_request.go new file mode 100644 index 0000000000..f9ea91e2bf --- /dev/null +++ b/internal/hcs/schema2/cache_operation_request.go @@ -0,0 +1,24 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +import ( + "encoding/json" +) + +// Structure for processor cache operations +type CacheOperationRequest struct { + Operation *ProcessorCacheModifyServiceOperation `json:"Operation,omitempty"` + OperationDetails *json.RawMessage `json:"OperationDetails,omitempty"` +} diff --git a/internal/hcs/schema2/cache_query_stats_response.go b/internal/hcs/schema2/cache_query_stats_response.go index c1ea3953b5..08574bf657 100644 --- a/internal/hcs/schema2/cache_query_stats_response.go +++ b/internal/hcs/schema2/cache_query_stats_response.go @@ -1,18 +1,20 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema type CacheQueryStatsResponse struct { - L3OccupancyBytes int32 `json:"L3OccupancyBytes,omitempty"` - - L3TotalBwBytes int32 `json:"L3TotalBwBytes,omitempty"` - - L3LocalBwBytes int32 `json:"L3LocalBwBytes,omitempty"` + L3OccupancyBytes uint64 `json:"L3OccupancyBytes,omitempty"` + L3TotalBwBytes uint64 `json:"L3TotalBwBytes,omitempty"` + L3LocalBwBytes uint64 `json:"L3LocalBwBytes,omitempty"` } diff --git a/internal/hcs/schema2/cache_set_cos_bitmask_request.go b/internal/hcs/schema2/cache_set_cos_bitmask_request.go new file mode 100644 index 0000000000..fd968cb90b --- /dev/null +++ b/internal/hcs/schema2/cache_set_cos_bitmask_request.go @@ -0,0 +1,19 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type CacheSetCosBitmaskRequest struct { + CosIndex uint32 `json:"CosIndex,omitempty"` + CosBitmap uint32 `json:"CosBitmap,omitempty"` +} diff --git a/internal/hcs/schema2/cache_set_root_cos_request.go b/internal/hcs/schema2/cache_set_root_cos_request.go new file mode 100644 index 0000000000..b408a13f07 --- /dev/null +++ b/internal/hcs/schema2/cache_set_root_cos_request.go @@ -0,0 +1,18 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type CacheSetRootCosRequest struct { + CosIndex uint32 `json:"CosIndex,omitempty"` +} diff --git a/internal/hcs/schema2/cache_set_root_rmid_request.go b/internal/hcs/schema2/cache_set_root_rmid_request.go new file mode 100644 index 0000000000..b1f322cf09 --- /dev/null +++ b/internal/hcs/schema2/cache_set_root_rmid_request.go @@ -0,0 +1,18 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type CacheSetRootRmidRequest struct { + Rmid uint32 `json:"Rmid,omitempty"` +} diff --git a/internal/hcs/schema2/caching_mode.go b/internal/hcs/schema2/caching_mode.go new file mode 100644 index 0000000000..49c52f4982 --- /dev/null +++ b/internal/hcs/schema2/caching_mode.go @@ -0,0 +1,23 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type CachingMode string + +// List of CachingMode +const ( + CachingMode_UNCACHED CachingMode = "Uncached" + CachingMode_CACHED CachingMode = "Cached" + CachingMode_READ_ONLY_CACHED CachingMode = "ReadOnlyCached" +) diff --git a/internal/hcs/schema2/chipset.go b/internal/hcs/schema2/chipset.go index ca75277a3f..99e963b9e5 100644 --- a/internal/hcs/schema2/chipset.go +++ b/internal/hcs/schema2/chipset.go @@ -1,27 +1,28 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema type Chipset struct { - Uefi *Uefi `json:"Uefi,omitempty"` - - IsNumLockDisabled bool `json:"IsNumLockDisabled,omitempty"` - - BaseBoardSerialNumber string `json:"BaseBoardSerialNumber,omitempty"` - - ChassisSerialNumber string `json:"ChassisSerialNumber,omitempty"` - - ChassisAssetTag string `json:"ChassisAssetTag,omitempty"` - - UseUtc bool `json:"UseUtc,omitempty"` - - // LinuxKernelDirect - Added in v2.2 Builds >=181117 - LinuxKernelDirect *LinuxKernelDirect `json:"LinuxKernelDirect,omitempty"` + Uefi *Uefi `json:"Uefi,omitempty"` + Pcat *Pcat `json:"Pcat,omitempty"` + IsNumLockDisabled bool `json:"IsNumLockDisabled,omitempty"` + BaseBoardSerialNumber string `json:"BaseBoardSerialNumber,omitempty"` + ChassisSerialNumber string `json:"ChassisSerialNumber,omitempty"` + ChassisAssetTag string `json:"ChassisAssetTag,omitempty"` + EnableHibernation bool `json:"EnableHibernation,omitempty"` + UseUTC bool `json:"UseUtc,omitempty"` + LinuxKernelDirect *LinuxKernelDirect `json:"LinuxKernelDirect,omitempty"` + SystemInformation *UefiSystemInformation `json:"SystemInformation,omitempty"` + MemoryDeviceSerialNumber string `json:"MemoryDeviceSerialNumber,omitempty"` } diff --git a/internal/hcs/schema2/cim_mount.go b/internal/hcs/schema2/cim_mount.go index 81865e7ea4..ad9df52909 100644 --- a/internal/hcs/schema2/cim_mount.go +++ b/internal/hcs/schema2/cim_mount.go @@ -1,25 +1,23 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.5 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema -const ( - CimMountFlagNone uint32 = 0x0 - CimMountFlagChildOnly uint32 = 0x1 - CimMountFlagEnableDax uint32 = 0x2 - CimMountFlagCacheFiles uint32 = 0x4 - CimMountFlagCacheRegions uint32 = 0x8 -) - type CimMount struct { ImagePath string `json:"ImagePath,omitempty"` FileSystemName string `json:"FileSystemName,omitempty"` - VolumeGuid string `json:"VolumeGuid,omitempty"` - MountFlags uint32 `json:"MountFlags,omitempty"` + // Pattern: /^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/ + VolumeGUID string `json:"VolumeGuid,omitempty"` + // MountFlags are the flags that are used to alter the behaviour of a mounted cim. These values are defined by the CIMFS API. The value passed for this field will be forwarded to the the CimMountImage call. + MountFlags uint32 `json:"MountFlags,omitempty"` } diff --git a/internal/hcs/schema2/cim_mount_flags.go b/internal/hcs/schema2/cim_mount_flags.go new file mode 100644 index 0000000000..32792582b2 --- /dev/null +++ b/internal/hcs/schema2/cim_mount_flags.go @@ -0,0 +1,9 @@ +package hcsschema + +const ( + CimMountFlagNone uint32 = 0x0 + CimMountFlagChildOnly uint32 = 0x1 + CimMountFlagEnableDax uint32 = 0x2 + CimMountFlagCacheFiles uint32 = 0x4 + CimMountFlagCacheRegions uint32 = 0x8 +) diff --git a/internal/hcs/schema2/close_handle.go b/internal/hcs/schema2/close_handle.go index b4f9c315b0..e51146fe1d 100644 --- a/internal/hcs/schema2/close_handle.go +++ b/internal/hcs/schema2/close_handle.go @@ -1,14 +1,18 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema type CloseHandle struct { - Handle string `json:"Handle,omitempty"` + Handle *StdHandle `json:"Handle,omitempty"` } diff --git a/internal/hcs/schema2/com_port.go b/internal/hcs/schema2/com_port.go index 8bf8cab60e..fcf94a3741 100644 --- a/internal/hcs/schema2/com_port.go +++ b/internal/hcs/schema2/com_port.go @@ -1,17 +1,20 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema -// ComPort specifies the named pipe that will be used for the port, with empty string indicating a disconnected port. +// ComPort specifies the named pipe that will be used for the port, with empty string indicating a disconnected port. type ComPort struct { - NamedPipe string `json:"NamedPipe,omitempty"` - - OptimizeForDebugger bool `json:"OptimizeForDebugger,omitempty"` + NamedPipe string `json:"NamedPipe,omitempty"` + OptimizeForDebugger bool `json:"OptimizeForDebugger,omitempty"` } diff --git a/internal/hcs/schema2/combined_layers.go b/internal/hcs/schema2/combined_layers.go new file mode 100644 index 0000000000..7ef2150402 --- /dev/null +++ b/internal/hcs/schema2/combined_layers.go @@ -0,0 +1,22 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// Object used by a modify request to add or remove a combined layers structure in the guest. For Windows, the GCS applies a filter in ContainerRootPath using the specified layers as the parent content. Ignores property ScratchPath since the container path is already the scratch path. For linux, the GCS unions the specified layers and ScratchPath together, placing the resulting union filesystem at ContainerRootPath. +type CombinedLayers struct { + // Layer hierarchy to be combined. + Layers []Layer `json:"Layers,omitempty"` + ScratchPath string `json:"ScratchPath,omitempty"` + ContainerRootPath string `json:"ContainerRootPath,omitempty"` +} diff --git a/internal/hcs/schema2/compute_system.go b/internal/hcs/schema2/compute_system.go index 10cea67e04..2e88391066 100644 --- a/internal/hcs/schema2/compute_system.go +++ b/internal/hcs/schema2/compute_system.go @@ -1,26 +1,34 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema -type ComputeSystem struct { - Owner string `json:"Owner,omitempty"` +import ( + "encoding/json" +) +// Describes the configuration of a compute system to create with all of the necessary resources it requires for a successful boot. +type ComputeSystem struct { + // A string identifying the owning client for this system. + Owner string `json:"Owner,omitempty"` SchemaVersion *Version `json:"SchemaVersion,omitempty"` - - HostingSystemId string `json:"HostingSystemId,omitempty"` - - HostedSystem interface{} `json:"HostedSystem,omitempty"` - - Container *Container `json:"Container,omitempty"` - - VirtualMachine *VirtualMachine `json:"VirtualMachine,omitempty"` - - ShouldTerminateOnLastHandleClosed bool `json:"ShouldTerminateOnLastHandleClosed,omitempty"` + // The identifier of the compute system that will host the system described by HostedSystem. The hosting system must already have been created. + HostingSystemID string `json:"HostingSystemId,omitempty"` + // The JSON describing the compute system that will be launched inside of the system identified by HostingSystemId. This property is mutually exclusive with the Container and VirtualMachine properties. + HostedSystem *json.RawMessage `json:"HostedSystem,omitempty"` + Container *Container `json:"Container,omitempty"` + VirtualMachine *VirtualMachine `json:"VirtualMachine,omitempty"` + // If true, this system will be forcibly terminated when the last HCS_SYSTEM handle corresponding to it is closed. + ShouldTerminateOnLastHandleClosed bool `json:"ShouldTerminateOnLastHandleClosed,omitempty"` + JobName string `json:"JobName,omitempty"` } diff --git a/internal/hcs/schema2/compute_system_properties.go b/internal/hcs/schema2/compute_system_properties.go new file mode 100644 index 0000000000..05546ac708 --- /dev/null +++ b/internal/hcs/schema2/compute_system_properties.go @@ -0,0 +1,30 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// An object consisting of basic system properties for a compute system +type ComputeSystemProperties struct { + ID string `json:"Id,omitempty"` + Name string `json:"Name,omitempty"` + SystemType *SystemType `json:"SystemType,omitempty"` + State *State `json:"State,omitempty"` + Owner string `json:"Owner,omitempty"` + // Pattern: /^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/ + RuntimeID string `json:"RuntimeId,omitempty"` + RuntimeOSType *OSType `json:"RuntimeOsType,omitempty"` + HostingSystemID string `json:"HostingSystemId,omitempty"` + IsDummy bool `json:"IsDummy,omitempty"` + ObRoot string `json:"ObRoot,omitempty"` + RuntimeTemplateID string `json:"RuntimeTemplateId,omitempty"` +} diff --git a/internal/hcs/schema2/configuration.go b/internal/hcs/schema2/configuration.go deleted file mode 100644 index 1d5dfe68ad..0000000000 --- a/internal/hcs/schema2/configuration.go +++ /dev/null @@ -1,72 +0,0 @@ -/* - * HCS API - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * API version: 2.1 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package hcsschema - -import ( - "net/http" -) - -// contextKeys are used to identify the type of value in the context. -// Since these are string, it is possible to get a short description of the -// context key for logging and debugging using key.String(). - -type contextKey string - -func (c contextKey) String() string { - return "auth " + string(c) -} - -var ( - // ContextOAuth2 takes a oauth2.TokenSource as authentication for the request. - ContextOAuth2 = contextKey("token") - - // ContextBasicAuth takes BasicAuth as authentication for the request. - ContextBasicAuth = contextKey("basic") - - // ContextAccessToken takes a string oauth2 access token as authentication for the request. - ContextAccessToken = contextKey("accesstoken") - - // ContextAPIKey takes an APIKey as authentication for the request - ContextAPIKey = contextKey("apikey") -) - -// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth -type BasicAuth struct { - UserName string `json:"userName,omitempty"` - Password string `json:"password,omitempty"` -} - -// APIKey provides API key based authentication to a request passed via context using ContextAPIKey -type APIKey struct { - Key string - Prefix string -} - -type Configuration struct { - BasePath string `json:"basePath,omitempty"` - Host string `json:"host,omitempty"` - Scheme string `json:"scheme,omitempty"` - DefaultHeader map[string]string `json:"defaultHeader,omitempty"` - UserAgent string `json:"userAgent,omitempty"` - HTTPClient *http.Client -} - -func NewConfiguration() *Configuration { - cfg := &Configuration{ - BasePath: "https://localhost", - DefaultHeader: make(map[string]string), - UserAgent: "Swagger-Codegen/2.1.0/go", - } - return cfg -} - -func (c *Configuration) AddDefaultHeader(key string, value string) { - c.DefaultHeader[key] = value -} diff --git a/internal/hcs/schema2/console_image.go b/internal/hcs/schema2/console_image.go new file mode 100644 index 0000000000..b2696cdd1f --- /dev/null +++ b/internal/hcs/schema2/console_image.go @@ -0,0 +1,19 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type ConsoleImage struct { + // Pattern: /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/ + Image string `json:"Image,omitempty"` +} diff --git a/internal/hcs/schema2/console_image_query.go b/internal/hcs/schema2/console_image_query.go new file mode 100644 index 0000000000..5dc66d1697 --- /dev/null +++ b/internal/hcs/schema2/console_image_query.go @@ -0,0 +1,24 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// A query to request a screenshot of the console of the virtual machine +type ConsoleImageQuery struct { + // Requested width of the resulting image + Width uint16 `json:"Width,omitempty"` + // Requested height of the resulting image + Height uint16 `json:"Height,omitempty"` + // Flags that determine certain characteristics of the output of the returned image 0x00000001ul: The image data is returned in the OctetString format defined by the DMTF. The first four bytes of the data contains the number of octets (bytes), including the four-byte length, in the big-endian format + Flags uint32 `json:"Flags,omitempty"` +} diff --git a/internal/hcs/schema2/console_size.go b/internal/hcs/schema2/console_size.go index 68aa04a573..5a98b60fb3 100644 --- a/internal/hcs/schema2/console_size.go +++ b/internal/hcs/schema2/console_size.go @@ -1,16 +1,19 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema type ConsoleSize struct { - Height int32 `json:"Height,omitempty"` - - Width int32 `json:"Width,omitempty"` + Height uint16 `json:"Height,omitempty"` + Width uint16 `json:"Width,omitempty"` } diff --git a/internal/hcs/schema2/container.go b/internal/hcs/schema2/container.go index 39a54432c0..3b5bdf182e 100644 --- a/internal/hcs/schema2/container.go +++ b/internal/hcs/schema2/container.go @@ -1,36 +1,34 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema +// Configuration of a Windows Server Container, used during its creation to set up and/or use resources. type Container struct { - GuestOs *GuestOs `json:"GuestOs,omitempty"` - + GuestOS *GuestOS `json:"GuestOs,omitempty"` Storage *Storage `json:"Storage,omitempty"` - + // Optional list of directories in the container host that will be mapped to the container guest on creation. MappedDirectories []MappedDirectory `json:"MappedDirectories,omitempty"` - - MappedPipes []MappedPipe `json:"MappedPipes,omitempty"` - - Memory *Memory `json:"Memory,omitempty"` - - Processor *Processor `json:"Processor,omitempty"` - - Networking *Networking `json:"Networking,omitempty"` - - HvSocket *HvSocket `json:"HvSocket,omitempty"` - + // Optional list of named pipes in the container host that will be mapped to the container guest on creation. + MappedPipes []MappedPipe `json:"MappedPipes,omitempty"` + Memory *ContainerMemory `json:"Memory,omitempty"` + Processor *ContainerProcessor `json:"Processor,omitempty"` + Networking *Networking `json:"Networking,omitempty"` + HvSocket *ContainerHvSocket `json:"HvSocket,omitempty"` ContainerCredentialGuard *ContainerCredentialGuardState `json:"ContainerCredentialGuard,omitempty"` - - RegistryChanges *RegistryChanges `json:"RegistryChanges,omitempty"` - - AssignedDevices []Device `json:"AssignedDevices,omitempty"` - - AdditionalDeviceNamespace *ContainerDefinitionDevice `json:"AdditionalDeviceNamespace,omitempty"` + RegistryChanges *RegistryChanges `json:"RegistryChanges,omitempty"` + // Optional list of direct device assignment configurations. + AssignedDevices []Device `json:"AssignedDevices,omitempty"` + AdditionalDeviceNamespace *ContainersDefDevice `json:"AdditionalDeviceNamespace,omitempty"` + ContainerDefinitionFilePath string `json:"ContainerDefinitionFilePath,omitempty"` } diff --git a/internal/hcs/schema2/container_credential_guard_add_instance_request.go b/internal/hcs/schema2/container_credential_guard_add_instance_request.go index 495c6ebc8f..bc5fc0f7ed 100644 --- a/internal/hcs/schema2/container_credential_guard_add_instance_request.go +++ b/internal/hcs/schema2/container_credential_guard_add_instance_request.go @@ -1,5 +1,9 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * @@ -9,8 +13,11 @@ package hcsschema +// Object describing a request to add a Container Credential Guard Instance. type ContainerCredentialGuardAddInstanceRequest struct { - Id string `json:"Id,omitempty"` - CredentialSpec string `json:"CredentialSpec,omitempty"` - Transport string `json:"Transport,omitempty"` + // Globally unique identifier to use for the Container Credential Guard Instance. + ID string `json:"Id,omitempty"` + // JSON document as a string that describes the Container Credential Guard Instance's credential specification to use. + CredentialSpec string `json:"CredentialSpec,omitempty"` + Transport *ContainerCredentialGuardTransport `json:"Transport,omitempty"` } diff --git a/internal/hcs/schema2/container_credential_guard_hv_socket_service_config.go b/internal/hcs/schema2/container_credential_guard_hv_socket_service_config.go index 1ed4c008f2..208b8d38b1 100644 --- a/internal/hcs/schema2/container_credential_guard_hv_socket_service_config.go +++ b/internal/hcs/schema2/container_credential_guard_hv_socket_service_config.go @@ -1,5 +1,9 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * @@ -9,7 +13,11 @@ package hcsschema +// Specifies the HvSocket configurations required for a Container Credential Guard instance that is meant to be used with HvSocket transport. type ContainerCredentialGuardHvSocketServiceConfig struct { - ServiceId string `json:"ServiceId,omitempty"` + // Identifier of the service that needs to be configured over HvSocket. + // + // Pattern: /^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/ + ServiceID string `json:"ServiceId,omitempty"` ServiceConfig *HvSocketServiceConfig `json:"ServiceConfig,omitempty"` } diff --git a/internal/hcs/schema2/container_credential_guard_instance.go b/internal/hcs/schema2/container_credential_guard_instance.go index d7ebd0fcca..7b55bcbb50 100644 --- a/internal/hcs/schema2/container_credential_guard_instance.go +++ b/internal/hcs/schema2/container_credential_guard_instance.go @@ -1,5 +1,9 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * @@ -9,8 +13,10 @@ package hcsschema +// Describes the configuration of a running Container Credential Guard Instance. type ContainerCredentialGuardInstance struct { - Id string `json:"Id,omitempty"` + // Identifier of a Container Credential Guard Instance, globally unique. + ID string `json:"Id,omitempty"` CredentialGuard *ContainerCredentialGuardState `json:"CredentialGuard,omitempty"` HvSocketConfig *ContainerCredentialGuardHvSocketServiceConfig `json:"HvSocketConfig,omitempty"` } diff --git a/internal/hcs/schema2/container_credential_guard_modify_operation.go b/internal/hcs/schema2/container_credential_guard_modify_operation.go index 71005b090b..e33295705a 100644 --- a/internal/hcs/schema2/container_credential_guard_modify_operation.go +++ b/internal/hcs/schema2/container_credential_guard_modify_operation.go @@ -1,5 +1,9 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * @@ -11,7 +15,8 @@ package hcsschema type ContainerCredentialGuardModifyOperation string +// List of ContainerCredentialGuardModifyOperation const ( - AddInstance ContainerCredentialGuardModifyOperation = "AddInstance" - RemoveInstance ContainerCredentialGuardModifyOperation = "RemoveInstance" + ContainerCredentialGuardModifyOperation_ADD_INSTANCE ContainerCredentialGuardModifyOperation = "AddInstance" + ContainerCredentialGuardModifyOperation_REMOVE_INSTANCE ContainerCredentialGuardModifyOperation = "RemoveInstance" ) diff --git a/internal/hcs/schema2/container_credential_guard_operation_request.go b/internal/hcs/schema2/container_credential_guard_operation_request.go index 952cda4965..a8ac60473f 100644 --- a/internal/hcs/schema2/container_credential_guard_operation_request.go +++ b/internal/hcs/schema2/container_credential_guard_operation_request.go @@ -1,5 +1,9 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * @@ -9,7 +13,13 @@ package hcsschema +import ( + "encoding/json" +) + +// Object describing a Container Credential Guard system request. type ContainerCredentialGuardOperationRequest struct { - Operation ContainerCredentialGuardModifyOperation `json:"Operation,omitempty"` - OperationDetails interface{} `json:"OperationDetails,omitempty"` + Operation *ContainerCredentialGuardModifyOperation `json:"Operation,omitempty"` + // Object describing the input properties used by the specified operation type. + OperationDetails *json.RawMessage `json:"OperationDetails,omitempty"` } diff --git a/internal/hcs/schema2/container_credential_guard_remove_instance_request.go b/internal/hcs/schema2/container_credential_guard_remove_instance_request.go index 32e5a3beed..7ca352f591 100644 --- a/internal/hcs/schema2/container_credential_guard_remove_instance_request.go +++ b/internal/hcs/schema2/container_credential_guard_remove_instance_request.go @@ -1,5 +1,9 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * @@ -9,6 +13,8 @@ package hcsschema +// Object describing a request to remove a running Container Credential Guard Instance. type ContainerCredentialGuardRemoveInstanceRequest struct { - Id string `json:"Id,omitempty"` + // Globally unique identifier of a running Container Credential Guard Instance. + ID string `json:"Id,omitempty"` } diff --git a/internal/hcs/schema2/container_credential_guard_state.go b/internal/hcs/schema2/container_credential_guard_state.go index 0f8f644379..2e593dcfac 100644 --- a/internal/hcs/schema2/container_credential_guard_state.go +++ b/internal/hcs/schema2/container_credential_guard_state.go @@ -1,25 +1,24 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema type ContainerCredentialGuardState struct { - - // Authentication cookie for calls to a Container Credential Guard instance. + // Authentication cookie for calls to a Container Credential Guard instance. Cookie string `json:"Cookie,omitempty"` - - // Name of the RPC endpoint of the Container Credential Guard instance. - RpcEndpoint string `json:"RpcEndpoint,omitempty"` - - // Transport used for the configured Container Credential Guard instance. - Transport string `json:"Transport,omitempty"` - - // Credential spec used for the configured Container Credential Guard instance. + // Name of the RPC endpoint of the Container Credential Guard instance. + RPCEndpoint string `json:"RpcEndpoint,omitempty"` + Transport *ContainerCredentialGuardTransport `json:"Transport,omitempty"` + // Credential spec used for the configured Container Credential Guard instance. CredentialSpec string `json:"CredentialSpec,omitempty"` } diff --git a/internal/hcs/schema2/container_credential_guard_system_info.go b/internal/hcs/schema2/container_credential_guard_system_info.go index ea306fa21a..102f810aeb 100644 --- a/internal/hcs/schema2/container_credential_guard_system_info.go +++ b/internal/hcs/schema2/container_credential_guard_system_info.go @@ -1,5 +1,9 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * @@ -9,6 +13,8 @@ package hcsschema +// Object listing the system's running Container Credential Guard Instances. type ContainerCredentialGuardSystemInfo struct { + // Array of running Container Credential Guard Instances. Instances []ContainerCredentialGuardInstance `json:"Instances,omitempty"` } diff --git a/internal/hcs/schema2/container_credential_guard_transport.go b/internal/hcs/schema2/container_credential_guard_transport.go new file mode 100644 index 0000000000..a012fe175d --- /dev/null +++ b/internal/hcs/schema2/container_credential_guard_transport.go @@ -0,0 +1,23 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type ContainerCredentialGuardTransport string + +// List of ContainerCredentialGuardTransport +const ( + ContainerCredentialGuardTransport_LRPC ContainerCredentialGuardTransport = "LRPC" + ContainerCredentialGuardTransport_HV_SOCKET ContainerCredentialGuardTransport = "HvSocket" + ContainerCredentialGuardTransport_COUNT ContainerCredentialGuardTransport = "Count" +) diff --git a/internal/hcs/schema2/container_hv_socket.go b/internal/hcs/schema2/container_hv_socket.go new file mode 100644 index 0000000000..ebac2b7ce5 --- /dev/null +++ b/internal/hcs/schema2/container_hv_socket.go @@ -0,0 +1,25 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// Describes the HvSocket configuration and options for a container. +type ContainerHvSocket struct { + Config *HvSocketSystemConfig `json:"Config,omitempty"` + // When true, enables Powershell Direct service in the guest to allow it to use the HvSocket transport. + EnablePowerShellDirect bool `json:"EnablePowerShellDirect,omitempty"` + // When true, enables UTC relay in the HvSocket transport. + EnableUTCRelay bool `json:"EnableUtcRelay,omitempty"` + // When true, enables auditing in the HvSocket transport. + EnableAuditing bool `json:"EnableAuditing,omitempty"` +} diff --git a/internal/hcs/schema2/container_memory.go b/internal/hcs/schema2/container_memory.go new file mode 100644 index 0000000000..ee2f388843 --- /dev/null +++ b/internal/hcs/schema2/container_memory.go @@ -0,0 +1,22 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// Describes memory configuration for a container. +type ContainerMemory struct { + // Specifies the memory size in megabytes. + SizeInMB uint64 `json:"SizeInMB,omitempty"` + // TODO (beweedon 7/18/2018): Remove this once we no longer support RS4 GCS. + Maximum uint64 `json:"Maximum,omitempty"` +} diff --git a/internal/hcs/schema2/container_memory_information.go b/internal/hcs/schema2/container_memory_information.go deleted file mode 100644 index 1fd7ca5d56..0000000000 --- a/internal/hcs/schema2/container_memory_information.go +++ /dev/null @@ -1,25 +0,0 @@ -/* - * HCS API - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * API version: 2.1 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package hcsschema - -// memory usage as viewed from within the container -type ContainerMemoryInformation struct { - TotalPhysicalBytes int32 `json:"TotalPhysicalBytes,omitempty"` - - TotalUsage int32 `json:"TotalUsage,omitempty"` - - CommittedBytes int32 `json:"CommittedBytes,omitempty"` - - SharedCommittedBytes int32 `json:"SharedCommittedBytes,omitempty"` - - CommitLimitBytes int32 `json:"CommitLimitBytes,omitempty"` - - PeakCommitmentBytes int32 `json:"PeakCommitmentBytes,omitempty"` -} diff --git a/internal/hcs/schema2/container_processor.go b/internal/hcs/schema2/container_processor.go new file mode 100644 index 0000000000..c7b0b7a652 --- /dev/null +++ b/internal/hcs/schema2/container_processor.go @@ -0,0 +1,24 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// Specifies CPU limits for a container. Count, Maximum and Weight are all mutually exclusive. +type ContainerProcessor struct { + // Optional property that represents the fraction of the configured processor count in a container in relation to the processors available in the host. The fraction ultimately determines the portion of processor cycles that the threads in a container can use during each scheduling interval, as the number of cycles per 10,000 cycles. + Count uint32 `json:"Count,omitempty"` + // Optional property that limits the share of processor time given to the container relative to other workloads on the processor. The processor weight is a value between 0 and 10000. + Weight int64 `json:"Weight,omitempty"` + // Optional property that determines the portion of processor cycles that the threads in a container can use during each scheduling interval, as the number of cycles per 10,000 cycles. Set processor maximum to a percentage times 100. + Maximum int64 `json:"Maximum,omitempty"` +} diff --git a/internal/hcs/schema2/containers_def_batched_binding.go b/internal/hcs/schema2/containers_def_batched_binding.go new file mode 100644 index 0000000000..57c2fc1ab7 --- /dev/null +++ b/internal/hcs/schema2/containers_def_batched_binding.go @@ -0,0 +1,19 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type ContainersDefBatchedBinding struct { + Filepath string `json:"filepath,omitempty"` + Bindingroots []string `json:"bindingroots,omitempty"` +} diff --git a/internal/hcs/schema2/containers_def_container.go b/internal/hcs/schema2/containers_def_container.go new file mode 100644 index 0000000000..9c461f0df6 --- /dev/null +++ b/internal/hcs/schema2/containers_def_container.go @@ -0,0 +1,18 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type ContainersDefContainer struct { + Namespace *Namespace `json:"namespace,omitempty"` +} diff --git a/internal/hcs/schema2/model_container_definition_device.go b/internal/hcs/schema2/containers_def_device.go similarity index 65% rename from internal/hcs/schema2/model_container_definition_device.go rename to internal/hcs/schema2/containers_def_device.go index 8dbe40b3be..c5246a38ad 100644 --- a/internal/hcs/schema2/model_container_definition_device.go +++ b/internal/hcs/schema2/containers_def_device.go @@ -1,5 +1,9 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * @@ -9,6 +13,6 @@ package hcsschema -type ContainerDefinitionDevice struct { +type ContainersDefDevice struct { DeviceExtension []DeviceExtension `json:"device_extension,omitempty"` } diff --git a/internal/hcs/schema2/cpu_group.go b/internal/hcs/schema2/cpu_group.go index 90332a5190..5630d2894a 100644 --- a/internal/hcs/schema2/cpu_group.go +++ b/internal/hcs/schema2/cpu_group.go @@ -1,5 +1,9 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * @@ -11,5 +15,6 @@ package hcsschema // CPU groups allow Hyper-V administrators to better manage and allocate the host's CPU resources across guest virtual machines type CpuGroup struct { - Id string `json:"Id,omitempty"` + // Pattern: /^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/ + ID string `json:"Id,omitempty"` } diff --git a/internal/hcs/schema2/cpu_group_affinity.go b/internal/hcs/schema2/cpu_group_affinity.go index 8794961bf5..24c6ace58b 100644 --- a/internal/hcs/schema2/cpu_group_affinity.go +++ b/internal/hcs/schema2/cpu_group_affinity.go @@ -1,5 +1,9 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * @@ -9,7 +13,9 @@ package hcsschema +// MODIFICATION: updated []int64 to []uint32 for LogicalProcessors + type CpuGroupAffinity struct { - LogicalProcessorCount int32 `json:"LogicalProcessorCount,omitempty"` - LogicalProcessors []int32 `json:"LogicalProcessors,omitempty"` + LogicalProcessorCount uint32 `json:"LogicalProcessorCount,omitempty"` + LogicalProcessors []uint32 `json:"LogicalProcessors,omitempty"` } diff --git a/internal/hcs/schema2/cpu_group_config.go b/internal/hcs/schema2/cpu_group_config.go index 0be0475d41..bcbf15f46c 100644 --- a/internal/hcs/schema2/cpu_group_config.go +++ b/internal/hcs/schema2/cpu_group_config.go @@ -1,5 +1,9 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * @@ -10,9 +14,10 @@ package hcsschema type CpuGroupConfig struct { - GroupId string `json:"GroupId,omitempty"` + // Pattern: /^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/ + GroupID string `json:"GroupId,omitempty"` Affinity *CpuGroupAffinity `json:"Affinity,omitempty"` GroupProperties []CpuGroupProperty `json:"GroupProperties,omitempty"` // Hypervisor CPU group IDs exposed to clients - HypervisorGroupId uint64 `json:"HypervisorGroupId,omitempty"` + HypervisorGroupID uint64 `json:"HypervisorGroupId,omitempty"` } diff --git a/internal/hcs/schema2/cpu_group_configurations.go b/internal/hcs/schema2/cpu_group_configurations.go index 3ace0ccc3b..7993891546 100644 --- a/internal/hcs/schema2/cpu_group_configurations.go +++ b/internal/hcs/schema2/cpu_group_configurations.go @@ -1,5 +1,9 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * diff --git a/internal/hcs/schema2/cpu_group_property.go b/internal/hcs/schema2/cpu_group_property.go index 31fe07c3aa..1a6f49d7be 100644 --- a/internal/hcs/schema2/cpu_group_property.go +++ b/internal/hcs/schema2/cpu_group_property.go @@ -1,5 +1,9 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * @@ -9,15 +13,7 @@ package hcsschema -type CPUGroupPropertyCode uint32 - -const ( - CPUCapacityProperty = 0x00010000 - CPUSchedulingPriorityProperty = 0x00020000 - IdleLPReserveProperty = 0x00030000 -) - type CpuGroupProperty struct { PropertyCode uint32 `json:"PropertyCode,omitempty"` - PropertyValue uint32 `json:"PropertyValue,omitempty"` + PropertyValue uint64 `json:"PropertyValue,omitempty"` } diff --git a/internal/hcs/schema2/crash_options.go b/internal/hcs/schema2/crash_options.go new file mode 100644 index 0000000000..e3d0239164 --- /dev/null +++ b/internal/hcs/schema2/crash_options.go @@ -0,0 +1,19 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type CrashOptions struct { + Type_ *CrashType `json:"Type,omitempty"` + GuestDebugStateFile string `json:"GuestDebugStateFile,omitempty"` +} diff --git a/internal/hcs/schema2/crash_report.go b/internal/hcs/schema2/crash_report.go new file mode 100644 index 0000000000..453dec49d8 --- /dev/null +++ b/internal/hcs/schema2/crash_report.go @@ -0,0 +1,36 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// Crash information reported through HcsEventSystemCrashInitiated and HcsEventSystemCrashReport notifications. This object is also used as the input to HcsSubmitWerReport. +type CrashReport struct { + // Compute system id the CrashReport is for. + SystemID string `json:"SystemId,omitempty"` + // Trace correlation activity Id. + // + // Pattern: /^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/ + ActivityID string `json:"ActivityId,omitempty"` + WindowsCrashInfo *WindowsCrashReport `json:"WindowsCrashInfo,omitempty"` + // Crash parameters as reported by the guest OS. For Windows these correspond to the bug check code followed by 4 bug check code specific values. The CrashParameters are available in both HcsEventSystemCrashInitiated and HcsEventSystemCrashReport events. + CrashParameters []int64 `json:"CrashParameters,omitempty"` + // An optional string provided by the guest OS. Currently only used by Linux guest OSes with Hyper-V Linux Integration Services configured. + CrashLog string `json:"CrashLog,omitempty"` + VmwpDump *CrashReportProcessDump `json:"VmwpDump,omitempty"` + // Provides overall status on crash reporting, S_OK indicates success, other HRESULT values on error. + Status int32 `json:"Status,omitempty"` + // Opaque guest OS reported ID. + PreOSID uint32 `json:"PreOSId,omitempty"` + // If true, the guest OS reported that a crash dump stack/handler was unavailable or could not be invoked. + CrashStackUnavailable bool `json:"CrashStackUnavailable,omitempty"` +} diff --git a/internal/hcs/schema2/crash_report_process_dump.go b/internal/hcs/schema2/crash_report_process_dump.go new file mode 100644 index 0000000000..24944e8bf0 --- /dev/null +++ b/internal/hcs/schema2/crash_report_process_dump.go @@ -0,0 +1,22 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// Information on auxillary process dumps. Auxillary process dumps are configured in the DebugOptions +type CrashReportProcessDump struct { + // Name of the dump file + DumpFile string `json:"DumpFile,omitempty"` + // Status of the process dump. S_OK indicates success, other HRESULT values on error. + Status int32 `json:"Status,omitempty"` +} diff --git a/internal/hcs/schema2/crash_type.go b/internal/hcs/schema2/crash_type.go new file mode 100644 index 0000000000..9438142ae9 --- /dev/null +++ b/internal/hcs/schema2/crash_type.go @@ -0,0 +1,22 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type CrashType string + +// List of CrashType +const ( + CrashType_CRASH_GUEST CrashType = "CrashGuest" + CrashType_CAPTURE_GUEST_DEBUG_STATE CrashType = "CaptureGuestDebugState" +) diff --git a/internal/hcs/schema2/create_group_operation.go b/internal/hcs/schema2/create_group_operation.go index 91a8278fe3..5661547a11 100644 --- a/internal/hcs/schema2/create_group_operation.go +++ b/internal/hcs/schema2/create_group_operation.go @@ -1,5 +1,9 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * @@ -9,9 +13,12 @@ package hcsschema +// MODIFICATION: updated []int64 to []uint32 for LogicalProcessors + // Create group operation settings type CreateGroupOperation struct { - GroupId string `json:"GroupId,omitempty"` - LogicalProcessorCount uint32 `json:"LogicalProcessorCount,omitempty"` + // Pattern: /^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/ + GroupID string `json:"GroupId,omitempty"` + LogicalProcessorCount uint32 `json:"LogicalProcessorCount,omitempty"` LogicalProcessors []uint32 `json:"LogicalProcessors,omitempty"` } diff --git a/internal/hcs/schema2/debug_options.go b/internal/hcs/schema2/debug_options.go index 5385850fe4..85d7a6f6bb 100644 --- a/internal/hcs/schema2/debug_options.go +++ b/internal/hcs/schema2/debug_options.go @@ -1,22 +1,26 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema type DebugOptions struct { - // BugcheckSavedStateFileName is the path for the file in which the guest VM state will be saved when - // the guest crashes. + // Capture a save state to the given file if the guest crashes. BugcheckSavedStateFileName string `json:"BugcheckSavedStateFileName,omitempty"` - // BugcheckNoCrashdumpSavedStateFileName is the path of the file in which the guest VM state will be - // saved when the guest crashes but the guest isn't able to generate the crash dump. This usually - // happens in early boot failures. + // Capture a save state to the given file if the guest crashes and no crash dump can be written. BugcheckNoCrashdumpSavedStateFileName string `json:"BugcheckNoCrashdumpSavedStateFileName,omitempty"` - TripleFaultSavedStateFileName string `json:"TripleFaultSavedStateFileName,omitempty"` - FirmwareDumpFileName string `json:"FirmwareDumpFileName,omitempty"` + // Capture a save state to the given file if the guest triple faults. + TripleFaultSavedStateFileName string `json:"TripleFaultSavedStateFileName,omitempty"` + // Name of a dump file to use for firmware crashes. + FirmwareDumpFileName string `json:"FirmwareDumpFileName,omitempty"` + WorkerProcessDumpOnGuestCrash *ProcessDump `json:"WorkerProcessDumpOnGuestCrash,omitempty"` } diff --git a/internal/hcs/schema2/delete_group_operation.go b/internal/hcs/schema2/delete_group_operation.go index 134bd98817..f2b9a02877 100644 --- a/internal/hcs/schema2/delete_group_operation.go +++ b/internal/hcs/schema2/delete_group_operation.go @@ -1,5 +1,9 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * @@ -11,5 +15,6 @@ package hcsschema // Delete group operation settings type DeleteGroupOperation struct { - GroupId string `json:"GroupId,omitempty"` + // Pattern: /^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/ + GroupID string `json:"GroupId,omitempty"` } diff --git a/internal/hcs/schema2/device.go b/internal/hcs/schema2/device.go index 31c4538aff..e6e63597c5 100644 --- a/internal/hcs/schema2/device.go +++ b/internal/hcs/schema2/device.go @@ -1,27 +1,24 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema -type DeviceType string - -const ( - ClassGUID DeviceType = "ClassGuid" - DeviceInstanceID DeviceType = "DeviceInstance" - GPUMirror DeviceType = "GpuMirror" -) - type Device struct { - // The type of device to assign to the container. - Type DeviceType `json:"Type,omitempty"` - // The interface class guid of the device interfaces to assign to the container. Only used when Type is ClassGuid. - InterfaceClassGuid string `json:"InterfaceClassGuid,omitempty"` - // The location path of the device to assign to the container. Only used when Type is DeviceInstanceID. + Type_ *DeviceType `json:"Type,omitempty"` + // The interface class guid of the device interfaces to assign to the container. Only used when Type is ClassGuid. + // + // Pattern: /^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/ + InterfaceClassGUID string `json:"InterfaceClassGuid,omitempty"` + // The location path of the device to assign to the container. Only used when Type is DeviceInstance. LocationPath string `json:"LocationPath,omitempty"` } diff --git a/internal/hcs/schema2/model_device_category.go b/internal/hcs/schema2/device_category.go similarity index 74% rename from internal/hcs/schema2/model_device_category.go rename to internal/hcs/schema2/device_category.go index 8fe89f9274..3db9153496 100644 --- a/internal/hcs/schema2/model_device_category.go +++ b/internal/hcs/schema2/device_category.go @@ -1,5 +1,9 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * diff --git a/internal/hcs/schema2/device_extension.go b/internal/hcs/schema2/device_extension.go new file mode 100644 index 0000000000..a64d5a10de --- /dev/null +++ b/internal/hcs/schema2/device_extension.go @@ -0,0 +1,19 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type DeviceExtension struct { + DeviceCategory *DeviceCategory `json:"device_category,omitempty"` + Namespace *Namespace `json:"namespace,omitempty"` +} diff --git a/internal/hcs/schema2/model_device_instance.go b/internal/hcs/schema2/device_instance.go similarity index 71% rename from internal/hcs/schema2/model_device_instance.go rename to internal/hcs/schema2/device_instance.go index a7410febd6..39d36c2fa1 100644 --- a/internal/hcs/schema2/model_device_instance.go +++ b/internal/hcs/schema2/device_instance.go @@ -1,5 +1,9 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * @@ -10,7 +14,7 @@ package hcsschema type DeviceInstance struct { - Id string `json:"id,omitempty"` + ID string `json:"id,omitempty"` LocationPath string `json:"location_path,omitempty"` PortName string `json:"port_name,omitempty"` InterfaceClass []InterfaceClass `json:"interface_class,omitempty"` diff --git a/internal/hcs/schema2/model_device_namespace.go b/internal/hcs/schema2/device_namespace.go similarity index 78% rename from internal/hcs/schema2/model_device_namespace.go rename to internal/hcs/schema2/device_namespace.go index 3553640647..9db14013bb 100644 --- a/internal/hcs/schema2/model_device_namespace.go +++ b/internal/hcs/schema2/device_namespace.go @@ -1,5 +1,9 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * diff --git a/internal/hcs/schema2/device_type.go b/internal/hcs/schema2/device_type.go new file mode 100644 index 0000000000..e24ad0d2c2 --- /dev/null +++ b/internal/hcs/schema2/device_type.go @@ -0,0 +1,23 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type DeviceType string + +// List of DeviceType +const ( + DeviceType_CLASS_GUID DeviceType = "ClassGuid" + DeviceType_DEVICE_INSTANCE DeviceType = "DeviceInstance" + DeviceType_GPU_MIRROR DeviceType = "GpuMirror" +) diff --git a/internal/hcs/schema2/devices.go b/internal/hcs/schema2/devices.go index e985d96d22..b613dc6516 100644 --- a/internal/hcs/schema2/devices.go +++ b/internal/hcs/schema2/devices.go @@ -1,46 +1,43 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema type Devices struct { - ComPorts map[string]ComPort `json:"ComPorts,omitempty"` - - Scsi map[string]Scsi `json:"Scsi,omitempty"` - + // An optional object that maps COM Port objects for any ports configured on the virtual machine. The key in the map is the integer, starting from zero, that will identify the COM port into the guest. + ComPorts map[string]ComPort `json:"ComPorts,omitempty"` + VirtioSerial *VirtioSerial `json:"VirtioSerial,omitempty"` + // An optional object that maps SCSI controllers, identified by friendly name. The provided name is hashed to create the controller's channel instance identifier. If the name is already a GUID, that GUID will be used as the channel instance identifier as-is. + SCSI map[string]SCSI `json:"Scsi,omitempty"` VirtualPMem *VirtualPMemController `json:"VirtualPMem,omitempty"` - - NetworkAdapters map[string]NetworkAdapter `json:"NetworkAdapters,omitempty"` - - VideoMonitor *VideoMonitor `json:"VideoMonitor,omitempty"` - - Keyboard *Keyboard `json:"Keyboard,omitempty"` - - Mouse *Mouse `json:"Mouse,omitempty"` - - HvSocket *HvSocket2 `json:"HvSocket,omitempty"` - - EnhancedModeVideo *EnhancedModeVideo `json:"EnhancedModeVideo,omitempty"` - - GuestCrashReporting *GuestCrashReporting `json:"GuestCrashReporting,omitempty"` - - VirtualSmb *VirtualSmb `json:"VirtualSmb,omitempty"` - - Plan9 *Plan9 `json:"Plan9,omitempty"` - - Battery *Battery `json:"Battery,omitempty"` - - FlexibleIov map[string]FlexibleIoDevice `json:"FlexibleIov,omitempty"` - - SharedMemory *SharedMemoryConfiguration `json:"SharedMemory,omitempty"` - - // TODO: This is pre-release support in schema 2.3. Need to add build number - // docs when a public build with this is out. - VirtualPci map[string]VirtualPciDevice `json:",omitempty"` + // An optional object that maps network adapters, identified by friendly name. The provided name is hashed to create the adapter's instance identifier. If the name is already a GUID, that GUID will be used as the identifier as-is. + NetworkAdapters map[string]NetworkAdapter `json:"NetworkAdapters,omitempty"` + VideoMonitor *VideoMonitor `json:"VideoMonitor,omitempty"` + Keyboard *Keyboard `json:"Keyboard,omitempty"` + Mouse *Mouse `json:"Mouse,omitempty"` + HvSocket *VirtualMachineHvSocket `json:"HvSocket,omitempty"` + EnhancedModeVideo *EnhancedModeVideo `json:"EnhancedModeVideo,omitempty"` + GuestCrashReporting *GuestCrashReporting `json:"GuestCrashReporting,omitempty"` + VirtualSmb *VirtualSmb `json:"VirtualSmb,omitempty"` + Plan9 *Plan9 `json:"Plan9,omitempty"` + Licensing *Licensing `json:"Licensing,omitempty"` + Battery *Battery `json:"Battery,omitempty"` + // An optional object that maps flexible IoV devices, identified by friendly name. The provided name is hashed to create the device's instance identifier. If the name is already a GUID, that GUID will be used as the identifier as-is. + FlexibleIOV map[string]FlexibleIODevice `json:"FlexibleIov,omitempty"` + SharedMemory *SharedMemoryConfiguration `json:"SharedMemory,omitempty"` + KernelIntegration *KernelIntegration `json:"KernelIntegration,omitempty"` + VirtualPCI map[string]VirtualPCIDevice `json:"VirtualPci,omitempty"` + // A list of instances that describes each IDE controller device + IDE []IDEController `json:"Ide,omitempty"` + Floppy *FloppyController `json:"Floppy,omitempty"` } diff --git a/internal/hcs/schema2/doc.go b/internal/hcs/schema2/doc.go new file mode 100644 index 0000000000..d651ebab4a --- /dev/null +++ b/internal/hcs/schema2/doc.go @@ -0,0 +1,102 @@ +// This package contains bindings to the Host Compute Schema (HCS) [JSON API]. +// +// Several HCS structs take arbitrary objects, repsented in the schema as `Any` (eg, see +// [ModifySettingRequest] and [HcsModifyComputeSystem]). +// Rather than represent them as [interface{}] (or [any]), [json.RawMessage] is used instead. +// The primary use for [json.RawMessage] is to allow delayed unmarshalling, so fields do not +// have to be marshalled back to JSON and then re-unmarshalled to the the correct type. +// (Typically [json] will default to primitive types, such as [map] when unmarshalling [any].) +// +// Defaulting to [json.RawMessag] avoids needing to manually update types, and allows +// reusing the same type definitions for both marshalling (on the host) and unmarshalling +// (in the guest). +// +// [JSON API]: https://learn.microsoft.com/en-us/virtualization/api/hcs/schemareference +// [ModifySettingRequest]: https://learn.microsoft.com/en-us/virtualization/api/hcs/schemareference#ModifySettingRequest +// [HcsModifyComputeSystem]: https://learn.microsoft.com/en-us/virtualization/api/hcs/reference/hcsmodifycomputesystem#remarks +package hcsschema + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// ! if modifying an auto-generated file, write its name here and add a `// MODIFICATION: ` comment to the file + +// Manually edited files: +// - cpu_group_affinity.go +// - create_group_operation.go +// - iov_settings.go +// - isolation_settings.go +// - process_parameters.go +// - properties.go +// - virtual_smb_share.go + +// ! write the name of any additional files created in this package + +// Manually created (lookup) files +// - cim_mount_flags.go +// - interrupt_moderation_mode_lookup.go +// - modification_request_extra.go +// - modify_setting_request_extra.go +// - os_type_lookup.go +// - plan_nine_share_flags_lookup.go +// - resolution_type_lookup.go +// - system_type_lookup.go +// - v_smb_share_flags_lookup.go + +// ToRawMessage is a convenience function to encode a value into a [json.RawMessage]. +func ToRawMessage(v any) (*json.RawMessage, error) { + // TODO: create a [sync.Pool] of encoders and buffers + + // since we don't know the `omitempty` status of the field the message is going into, + // return nil for nil-valued inputs, and when the parent struct is marshalled, it can + // decide how to encode an empty message + + // note: an "empty" JSON message is non-empty: ie, "null", "{}", "[]", or "\"\"" + // if the JSON string is empty, (ie, ""), return nil instead of a pointer + // to an empty (or nil) slice. + + if v == nil { + return nil, nil + } + + // don't re-encode a RawMessage + switch v := v.(type) { + case json.RawMessage: + if len(v) == 0 { + return nil, nil + } + return &v, nil + case *json.RawMessage: + return v, nil + } + + buf := &bytes.Buffer{} + enc := json.NewEncoder(buf) + enc.SetIndent("", "") + enc.SetEscapeHTML(false) + if err := enc.Encode(v); err != nil { + return nil, err + } + + // trim trailing new line + m := json.RawMessage(bytes.TrimSuffix(buf.Bytes(), []byte("\n"))) + if len(m) == 0 { + return nil, nil + } + return &m, nil +} + +// enumLookup is used to simplify functions that look up enum created as a set of const declarations. +// E.g., creating a functions to find the enum value corresponding to a string value requires only +// defining a `map[string]EnumType`. +func enumLookup[M ~map[K]V, K comparable, V any](m M, k K) (V, error) { + if v, ok := m[k]; ok { + return v, nil + } + + v := *new(V) + return v, fmt.Errorf("failed enum lookup from %T to %T: unknown value: %+v", k, v, k) +} diff --git a/internal/hcs/schema2/enhanced_mode_video.go b/internal/hcs/schema2/enhanced_mode_video.go index 85450c41e1..9650636c0a 100644 --- a/internal/hcs/schema2/enhanced_mode_video.go +++ b/internal/hcs/schema2/enhanced_mode_video.go @@ -1,9 +1,13 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ diff --git a/internal/hcs/schema2/enlightenment_modifications.go b/internal/hcs/schema2/enlightenment_modifications.go new file mode 100644 index 0000000000..853a32145a --- /dev/null +++ b/internal/hcs/schema2/enlightenment_modifications.go @@ -0,0 +1,24 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// EnlightenmentModifications : Enum for enlightenment modifications +type EnlightenmentModifications string + +// List of EnlightenmentModifications +const ( + EnlightenmentModifications_UNREPORTED EnlightenmentModifications = "Unreported" + EnlightenmentModifications_FAVOR_AUTO_EOI EnlightenmentModifications = "FavorAutoEoi" + EnlightenmentModifications_RSVD_Z1 EnlightenmentModifications = "RsvdZ1" +) diff --git a/internal/hcs/schema2/error_event.go b/internal/hcs/schema2/error_event.go new file mode 100644 index 0000000000..5be2404978 --- /dev/null +++ b/internal/hcs/schema2/error_event.go @@ -0,0 +1,34 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// Error descriptor that provides the info of an error object +type ErrorEvent struct { + // Fully formated error message + Message string `json:"Message,omitempty"` + // Stack trace in string form + StackTrace string `json:"StackTrace,omitempty"` + // Event definition + // + // Pattern: /^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/ + Provider string `json:"Provider,omitempty"` + // Event Id + EventID uint16 `json:"EventId,omitempty"` + // Flags + Flags uint32 `json:"Flags,omitempty"` + // Source + Source string `json:"Source,omitempty"` + // Event data + Data []EventData `json:"Data,omitempty"` +} diff --git a/internal/hcs/schema2/event_data.go b/internal/hcs/schema2/event_data.go new file mode 100644 index 0000000000..1902dfd2e1 --- /dev/null +++ b/internal/hcs/schema2/event_data.go @@ -0,0 +1,21 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// Event data element +type EventData struct { + Type_ *EventDataType `json:"Type,omitempty"` + // Event value + Value string `json:"Value,omitempty"` +} diff --git a/internal/hcs/schema2/event_data_type.go b/internal/hcs/schema2/event_data_type.go new file mode 100644 index 0000000000..a14137aa59 --- /dev/null +++ b/internal/hcs/schema2/event_data_type.go @@ -0,0 +1,37 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// EventDataType : Data types for event data elements, based on EVT_VARIANT_TYPE +type EventDataType string + +// List of EventDataType +const ( + EventDataType_EMPTY EventDataType = "Empty" + EventDataType_STRING_ EventDataType = "String" + EventDataType_ANSI_STRING EventDataType = "AnsiString" + EventDataType_S_BYTE EventDataType = "SByte" + EventDataType_BYTE_ EventDataType = "Byte" + EventDataType_INT16_ EventDataType = "Int16" + EventDataType_U_INT16 EventDataType = "UInt16" + EventDataType_INT32_ EventDataType = "Int32" + EventDataType_U_INT32 EventDataType = "UInt32" + EventDataType_INT64_ EventDataType = "Int64" + EventDataType_U_INT64 EventDataType = "UInt64" + EventDataType_SINGLE EventDataType = "Single" + EventDataType_DOUBLE EventDataType = "Double" + EventDataType_BOOLEAN EventDataType = "Boolean" + EventDataType_BINARY EventDataType = "Binary" + EventDataType_GUID EventDataType = "Guid" +) diff --git a/internal/hcs/schema2/exit_initiator.go b/internal/hcs/schema2/exit_initiator.go new file mode 100644 index 0000000000..7e15adcce8 --- /dev/null +++ b/internal/hcs/schema2/exit_initiator.go @@ -0,0 +1,26 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// ExitInitiator : Initiator of an exit (guest, management client, etc.) +type ExitInitiator string + +// List of ExitInitiator +const ( + ExitInitiator_NONE ExitInitiator = "None" + ExitInitiator_GUEST_OS ExitInitiator = "GuestOS" + ExitInitiator_CLIENT ExitInitiator = "Client" + ExitInitiator_INTERNAL ExitInitiator = "Internal" + ExitInitiator_UNKNOWN ExitInitiator = "Unknown" +) diff --git a/internal/hcs/schema2/export_layer_options.go b/internal/hcs/schema2/export_layer_options.go new file mode 100644 index 0000000000..5729a1553f --- /dev/null +++ b/internal/hcs/schema2/export_layer_options.go @@ -0,0 +1,18 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type ExportLayerOptions struct { + IsWritableLayer bool `json:"IsWritableLayer,omitempty"` +} diff --git a/internal/hcs/schema2/feature_setting_disposition.go b/internal/hcs/schema2/feature_setting_disposition.go new file mode 100644 index 0000000000..09d5afd955 --- /dev/null +++ b/internal/hcs/schema2/feature_setting_disposition.go @@ -0,0 +1,26 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// FeatureSettingDisposition : The operation to perform on this port ACL while configuring its network adapter. +type FeatureSettingDisposition string + +// List of FeatureSettingDisposition +const ( + FeatureSettingDisposition_CURRENT FeatureSettingDisposition = "Current" + FeatureSettingDisposition_ADD FeatureSettingDisposition = "Add" + FeatureSettingDisposition_MODIFY FeatureSettingDisposition = "Modify" + FeatureSettingDisposition_DELETE FeatureSettingDisposition = "Delete" + FeatureSettingDisposition_CLEANUP FeatureSettingDisposition = "Cleanup" +) diff --git a/internal/hcs/schema2/filesystem_isolation_mode.go b/internal/hcs/schema2/filesystem_isolation_mode.go new file mode 100644 index 0000000000..fa6a2c4275 --- /dev/null +++ b/internal/hcs/schema2/filesystem_isolation_mode.go @@ -0,0 +1,22 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type FilesystemIsolationMode string + +// List of FilesystemIsolationMode +const ( + FilesystemIsolationMode_HARD FilesystemIsolationMode = "hard" + FilesystemIsolationMode_SOFT FilesystemIsolationMode = "soft" +) diff --git a/internal/hcs/schema2/filesystem_layer.go b/internal/hcs/schema2/filesystem_layer.go new file mode 100644 index 0000000000..9bf0b48a64 --- /dev/null +++ b/internal/hcs/schema2/filesystem_layer.go @@ -0,0 +1,20 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type FilesystemLayer struct { + // Pattern: /^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/ + Identifier string `json:"identifier,omitempty"` + Path string `json:"path,omitempty"` +} diff --git a/internal/hcs/schema2/filesystem_namespace.go b/internal/hcs/schema2/filesystem_namespace.go new file mode 100644 index 0000000000..89d731f3ee --- /dev/null +++ b/internal/hcs/schema2/filesystem_namespace.go @@ -0,0 +1,22 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type FilesystemNamespace struct { + Path string `json:"path,omitempty"` + Isolation *FilesystemIsolationMode `json:"isolation,omitempty"` + Nesting *FilesystemNestingMode `json:"nesting,omitempty"` + Layer []FilesystemLayer `json:"layer,omitempty"` + Bindings []ContainersDefBatchedBinding `json:"bindings,omitempty"` +} diff --git a/internal/hcs/schema2/filesystem_nesting_mode.go b/internal/hcs/schema2/filesystem_nesting_mode.go new file mode 100644 index 0000000000..68e4fb393c --- /dev/null +++ b/internal/hcs/schema2/filesystem_nesting_mode.go @@ -0,0 +1,22 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type FilesystemNestingMode string + +// List of FilesystemNestingMode +const ( + FilesystemNestingMode_INNER FilesystemNestingMode = "inner" + FilesystemNestingMode_OUTER FilesystemNestingMode = "outer" +) diff --git a/internal/hcs/schema2/filtered_property_query.go b/internal/hcs/schema2/filtered_property_query.go new file mode 100644 index 0000000000..f0328ed958 --- /dev/null +++ b/internal/hcs/schema2/filtered_property_query.go @@ -0,0 +1,25 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +import ( + "encoding/json" +) + +// Structures used to perform a filtered property query. +type FilteredPropertyQuery struct { + PropertyType *GetPropertyType `json:"PropertyType,omitempty"` + // Filter - Additional filter to query. The following map describes the relationship between property type and its filter. [\"Memory\" => HostMemoryQueryRequest] + Filter *json.RawMessage `json:"Filter,omitempty"` +} diff --git a/internal/hcs/schema2/flexible_io_device.go b/internal/hcs/schema2/flexible_io_device.go index fe86cab655..000281db99 100644 --- a/internal/hcs/schema2/flexible_io_device.go +++ b/internal/hcs/schema2/flexible_io_device.go @@ -1,18 +1,21 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema -type FlexibleIoDevice struct { - EmulatorId string `json:"EmulatorId,omitempty"` - - HostingModel string `json:"HostingModel,omitempty"` - - Configuration []string `json:"Configuration,omitempty"` +type FlexibleIODevice struct { + // Pattern: /^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/ + EmulatorID string `json:"EmulatorId,omitempty"` + HostingModel *FlexibleIODeviceHostingModel `json:"HostingModel,omitempty"` + Configuration []string `json:"Configuration,omitempty"` } diff --git a/internal/hcs/schema2/flexible_io_device_hosting_model.go b/internal/hcs/schema2/flexible_io_device_hosting_model.go new file mode 100644 index 0000000000..94273b0b84 --- /dev/null +++ b/internal/hcs/schema2/flexible_io_device_hosting_model.go @@ -0,0 +1,23 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type FlexibleIODeviceHostingModel string + +// List of FlexibleIoDeviceHostingModel +const ( + FlexibleIODeviceHostingModel_INTERNAL FlexibleIODeviceHostingModel = "Internal" + FlexibleIODeviceHostingModel_EXTERNAL FlexibleIODeviceHostingModel = "External" + FlexibleIODeviceHostingModel_EXTERNAL_RESTRICTED FlexibleIODeviceHostingModel = "ExternalRestricted" +) diff --git a/internal/hcs/schema2/floppy_controller.go b/internal/hcs/schema2/floppy_controller.go new file mode 100644 index 0000000000..a34e653b94 --- /dev/null +++ b/internal/hcs/schema2/floppy_controller.go @@ -0,0 +1,19 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type FloppyController struct { + // The index of the attachment list indicates the location of the drive + Attachments []Attachment `json:"Attachments,omitempty"` +} diff --git a/internal/hcs/schema2/get_property_type.go b/internal/hcs/schema2/get_property_type.go new file mode 100644 index 0000000000..b37bc34659 --- /dev/null +++ b/internal/hcs/schema2/get_property_type.go @@ -0,0 +1,33 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// GetPropertyType : Service property type queried by HcsGetServiceProperties +type GetPropertyType string + +// List of GetPropertyType +const ( + GetPropertyType_BASIC GetPropertyType = "Basic" + GetPropertyType_MEMORY GetPropertyType = "Memory" + GetPropertyType_CPU_GROUP GetPropertyType = "CpuGroup" + GetPropertyType_PROCESSOR_TOPOLOGY GetPropertyType = "ProcessorTopology" + GetPropertyType_CACHE_ALLOCATION GetPropertyType = "CacheAllocation" + GetPropertyType_CACHE_MONITORING GetPropertyType = "CacheMonitoring" + GetPropertyType_CONTAINER_CREDENTIAL_GUARD GetPropertyType = "ContainerCredentialGuard" + GetPropertyType_QO_S_CAPABILITIES GetPropertyType = "QoSCapabilities" + GetPropertyType_MEMORY_BW_ALLOCATION GetPropertyType = "MemoryBwAllocation" + GetPropertyType_PROCESSOR GetPropertyType = "Processor" + GetPropertyType_SECURE_NESTED_PAGING GetPropertyType = "SecureNestedPaging" + GetPropertyType_UNDEFINED GetPropertyType = "Undefined" +) diff --git a/internal/hcs/schema2/gpu_assignment_mode.go b/internal/hcs/schema2/gpu_assignment_mode.go new file mode 100644 index 0000000000..0e442546ce --- /dev/null +++ b/internal/hcs/schema2/gpu_assignment_mode.go @@ -0,0 +1,24 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type GPUAssignmentMode string + +// List of GpuAssignmentMode +const ( + GPUAssignmentMode_DISABLED GPUAssignmentMode = "Disabled" + GPUAssignmentMode_DEFAULT_ GPUAssignmentMode = "Default" + GPUAssignmentMode_LIST GPUAssignmentMode = "List" + GPUAssignmentMode_MIRROR GPUAssignmentMode = "Mirror" +) diff --git a/internal/hcs/schema2/gpu_configuration.go b/internal/hcs/schema2/gpu_configuration.go new file mode 100644 index 0000000000..7b41ca8f7c --- /dev/null +++ b/internal/hcs/schema2/gpu_configuration.go @@ -0,0 +1,22 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type GPUConfiguration struct { + AssignmentMode *GPUAssignmentMode `json:"AssignmentMode,omitempty"` + // This only applies to List mode, and is ignored in other modes. In GPU-P, string is GPU device interface, and unit16 is partition id. HCS simply assigns the partition with the input id. In GPU-PV, string is GPU device interface, and unit16 is 0xffff. HCS needs to find an available partition to assign. + AssignmentRequest map[string]int64 `json:"AssignmentRequest,omitempty"` + // Whether we allow vendor extension. + AllowVendorExtension bool `json:"AllowVendorExtension,omitempty"` +} diff --git a/internal/hcs/schema2/guest_connection.go b/internal/hcs/schema2/guest_connection.go index 7db29495b3..c5a6b68935 100644 --- a/internal/hcs/schema2/guest_connection.go +++ b/internal/hcs/schema2/guest_connection.go @@ -1,19 +1,23 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema type GuestConnection struct { - - // Use Vsock rather than Hyper-V sockets to communicate with the guest service. + // When true, use Vsock rather than Hyper-V sockets to communicate with the guest service. UseVsock bool `json:"UseVsock,omitempty"` - - // Don't disconnect the guest connection when pausing the virtual machine. + // When true, don't disconnect the guest connection when pausing the virtual machine. UseConnectedSuspend bool `json:"UseConnectedSuspend,omitempty"` + // when true, set the guest's time zone to that of the host. + UseHostTimeZone bool `json:"UseHostTimeZone,omitempty"` } diff --git a/internal/hcs/schema2/guest_connection_info.go b/internal/hcs/schema2/guest_connection_info.go index 8a369bab71..5d0b49f22d 100644 --- a/internal/hcs/schema2/guest_connection_info.go +++ b/internal/hcs/schema2/guest_connection_info.go @@ -1,21 +1,26 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema -// Information about the guest. -type GuestConnectionInfo struct { - - // Each schema version x.y stands for the range of versions a.b where a==x and b<=y. This list comes from the SupportedSchemaVersions field in GcsCapabilities. - SupportedSchemaVersions []Version `json:"SupportedSchemaVersions,omitempty"` - - ProtocolVersion int32 `json:"ProtocolVersion,omitempty"` +import ( + "encoding/json" +) - GuestDefinedCapabilities *interface{} `json:"GuestDefinedCapabilities,omitempty"` +// Information about the guest. +type GuestConnectionInfo struct { + // Each schema version x.y stands for the range of versions a.b where a==x and b<=y. This list comes from the SupportedSchemaVersions field in GcsCapabilities. + SupportedSchemaVersions []Version `json:"SupportedSchemaVersions,omitempty"` + ProtocolVersion uint32 `json:"ProtocolVersion,omitempty"` + GuestDefinedCapabilities *json.RawMessage `json:"GuestDefinedCapabilities,omitempty"` } diff --git a/internal/hcs/schema2/guest_crash.go b/internal/hcs/schema2/guest_crash.go new file mode 100644 index 0000000000..bf01fa8efb --- /dev/null +++ b/internal/hcs/schema2/guest_crash.go @@ -0,0 +1,19 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type GuestCrash struct { + // Crash parameters as reported by the guest. + CrashParameters []int64 `json:"CrashParameters,omitempty"` +} diff --git a/internal/hcs/schema2/guest_crash_reporting.go b/internal/hcs/schema2/guest_crash_reporting.go index af82800483..b4a40a34d4 100644 --- a/internal/hcs/schema2/guest_crash_reporting.go +++ b/internal/hcs/schema2/guest_crash_reporting.go @@ -1,9 +1,13 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ diff --git a/internal/hcs/schema2/guest_isolation_type.go b/internal/hcs/schema2/guest_isolation_type.go new file mode 100644 index 0000000000..544ac5890c --- /dev/null +++ b/internal/hcs/schema2/guest_isolation_type.go @@ -0,0 +1,25 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type GuestIsolationType string + +// List of GuestIsolationType +const ( + GuestIsolationType_DISABLED GuestIsolationType = "Disabled" + GuestIsolationType_GUEST_STATE_ONLY GuestIsolationType = "GuestStateOnly" + GuestIsolationType_VIRTUALIZATION_BASED_SECURITY GuestIsolationType = "VirtualizationBasedSecurity" + GuestIsolationType_SECURE_NESTED_PAGING GuestIsolationType = "SecureNestedPaging" + GuestIsolationType_SECURE_NESTED_PAGING_EMULATION GuestIsolationType = "SecureNestedPagingEmulation" +) diff --git a/internal/hcs/schema2/guest_memory_info.go b/internal/hcs/schema2/guest_memory_info.go new file mode 100644 index 0000000000..792f377aa0 --- /dev/null +++ b/internal/hcs/schema2/guest_memory_info.go @@ -0,0 +1,24 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// Memory usage as viewed from the guest OS. +type GuestMemoryInfo struct { + TotalPhysicalBytes uint64 `json:"TotalPhysicalBytes,omitempty"` + TotalUsage uint64 `json:"TotalUsage,omitempty"` + CommittedBytes uint64 `json:"CommittedBytes,omitempty"` + SharedCommittedBytes uint64 `json:"SharedCommittedBytes,omitempty"` + CommitLimitBytes uint64 `json:"CommitLimitBytes,omitempty"` + PeakCommitmentBytes uint64 `json:"PeakCommitmentBytes,omitempty"` +} diff --git a/internal/hcs/schema2/guest_modify_setting_request.go b/internal/hcs/schema2/guest_modify_setting_request.go new file mode 100644 index 0000000000..2ca369a30f --- /dev/null +++ b/internal/hcs/schema2/guest_modify_setting_request.go @@ -0,0 +1,26 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +import ( + "encoding/json" +) + +type GuestModifySettingRequest struct { + ResourceType *ModifyResourceType `json:"ResourceType,omitempty"` + RequestType *ModifyRequestType `json:"RequestType,omitempty"` + Settings *json.RawMessage `json:"Settings,omitempty"` + // TODO (beweedon 7/6/2018): Remove this field once we no longer support RS4 GCS. + HostedSettings *json.RawMessage `json:"HostedSettings,omitempty"` +} diff --git a/internal/hcs/schema2/guest_os.go b/internal/hcs/schema2/guest_os.go index 8838519a39..1b24889c73 100644 --- a/internal/hcs/schema2/guest_os.go +++ b/internal/hcs/schema2/guest_os.go @@ -1,14 +1,20 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema -type GuestOs struct { +// Properties of the guest operating system that boots on a Windows Server Container. +type GuestOS struct { + // HostName assigned to a container guest operating system. HostName string `json:"HostName,omitempty"` } diff --git a/internal/hcs/schema2/guest_state.go b/internal/hcs/schema2/guest_state.go index a48a653945..04aa90375e 100644 --- a/internal/hcs/schema2/guest_state.go +++ b/internal/hcs/schema2/guest_state.go @@ -1,25 +1,24 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema type GuestState struct { - - // The path to an existing file uses for persistent guest state storage. An empty string indicates the system should initialize new transient, in-memory guest state. + // The path to an existing file uses for persistent guest state storage. An empty string indicates the system should initialize new transient, in-memory guest state. GuestStateFilePath string `json:"GuestStateFilePath,omitempty"` - - // The guest state file type affected by different guest isolation modes - whether a file or block storage. - GuestStateFileType string `json:"GuestStateFileType,omitempty"` - - // The path to an existing file for persistent runtime state storage. An empty string indicates the system should initialize new transient, in-memory runtime state. + // The path to an existing file for persistent runtime state storage. An empty string indicates the system should initialize new transient, in-memory runtime state. RuntimeStateFilePath string `json:"RuntimeStateFilePath,omitempty"` - - // If true, the guest state and runtime state files will be used as templates to populate transient, in-memory state instead of using the files as persistent backing store. - ForceTransientState bool `json:"ForceTransientState,omitempty"` + // If true, the guest state and runtime state files will be used as templates to populate transient, in-memory state instead of using the files as persistent backing store. + ForceTransientState bool `json:"ForceTransientState,omitempty"` + GuestStateFileType *GuestStateFileType `json:"GuestStateFileType,omitempty"` } diff --git a/internal/hcs/schema2/guest_state_file_type.go b/internal/hcs/schema2/guest_state_file_type.go new file mode 100644 index 0000000000..860f09461d --- /dev/null +++ b/internal/hcs/schema2/guest_state_file_type.go @@ -0,0 +1,22 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type GuestStateFileType string + +// List of GuestStateFileType +const ( + GuestStateFileType_BLOCK_STORAGE GuestStateFileType = "BlockStorage" + GuestStateFileType_FILE_MODE GuestStateFileType = "FileMode" +) diff --git a/internal/hcs/schema2/heartbeat.go b/internal/hcs/schema2/heartbeat.go new file mode 100644 index 0000000000..ef6b927fa2 --- /dev/null +++ b/internal/hcs/schema2/heartbeat.go @@ -0,0 +1,17 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type Heartbeat struct { +} diff --git a/internal/hcs/schema2/hook.go b/internal/hcs/schema2/hook.go new file mode 100644 index 0000000000..9e82422b30 --- /dev/null +++ b/internal/hcs/schema2/hook.go @@ -0,0 +1,21 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type Hook struct { + Path string `json:"path,omitempty"` + Args []string `json:"args,omitempty"` + Env []string `json:"env,omitempty"` + Timeout int64 `json:"timeout,omitempty"` +} diff --git a/internal/hcs/schema2/hooks.go b/internal/hcs/schema2/hooks.go new file mode 100644 index 0000000000..19647475f0 --- /dev/null +++ b/internal/hcs/schema2/hooks.go @@ -0,0 +1,20 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type Hooks struct { + Prestart []Hook `json:"prestart,omitempty"` + Poststart []Hook `json:"poststart,omitempty"` + Poststop []Hook `json:"poststop,omitempty"` +} diff --git a/internal/hcs/schema2/host_files.go b/internal/hcs/schema2/host_files.go new file mode 100644 index 0000000000..31236e1d6e --- /dev/null +++ b/internal/hcs/schema2/host_files.go @@ -0,0 +1,20 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type HostFiles struct { + BaseImagePath string `json:"base_image_path,omitempty"` + SandboxPath string `json:"sandbox_path,omitempty"` + File []string `json:"file,omitempty"` +} diff --git a/internal/hcs/schema2/host_memory.go b/internal/hcs/schema2/host_memory.go new file mode 100644 index 0000000000..6da96eef64 --- /dev/null +++ b/internal/hcs/schema2/host_memory.go @@ -0,0 +1,31 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type HostMemory struct { + // Total host physical memory in pages. + TotalMemoryInPages uint64 `json:"TotalMemoryInPages,omitempty"` + // Total physical memory on the host that is consumable by the VMs. + TotalConsumableMemoryInPages uint64 `json:"TotalConsumableMemoryInPages,omitempty"` + // Available physical memory on the host for the VMs to use. + AvailableMemoryInPages uint64 `json:"AvailableMemoryInPages,omitempty"` + // Operational overhead associated with a VM. + VmOverheadInPages uint64 `json:"VmOverheadInPages,omitempty"` + // Operational overhead associated with a VM based on the size of the VM. + VmOverheadPerGBInPages uint64 `json:"VmOverheadPerGBInPages,omitempty"` + // Part of the host memory that is not allowed to be used by the VMs. It is set aside for the host use only and the balancer chooses to not use this memory. + SystemOverheadInPages uint64 `json:"SystemOverheadInPages,omitempty"` + // Host setting to control whether NUMA spanning is allowed or not. + NumaSpanningEnabled bool `json:"NumaSpanningEnabled,omitempty"` +} diff --git a/internal/hcs/schema2/host_memory_modification_request.go b/internal/hcs/schema2/host_memory_modification_request.go new file mode 100644 index 0000000000..1ff7466b04 --- /dev/null +++ b/internal/hcs/schema2/host_memory_modification_request.go @@ -0,0 +1,23 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +import ( + "encoding/json" +) + +type HostMemoryModificationRequest struct { + Operation *HostMemoryOperation `json:"Operation,omitempty"` + OperationDetails *json.RawMessage `json:"OperationDetails,omitempty"` +} diff --git a/internal/hcs/schema2/host_memory_operation.go b/internal/hcs/schema2/host_memory_operation.go new file mode 100644 index 0000000000..386aac8439 --- /dev/null +++ b/internal/hcs/schema2/host_memory_operation.go @@ -0,0 +1,27 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type HostMemoryOperation string + +// List of HostMemoryOperation +const ( + HostMemoryOperation_MEMORY_RESERVE_GROW HostMemoryOperation = "MemoryReserveGrow" + HostMemoryOperation_MEMORY_RESERVE_SHRINK HostMemoryOperation = "MemoryReserveShrink" + HostMemoryOperation_MEMORY_BALANCING_ENABLE HostMemoryOperation = "MemoryBalancingEnable" + HostMemoryOperation_MEMORY_RESERVE_TARGET HostMemoryOperation = "MemoryReserveTarget" + HostMemoryOperation_MEMORY_RESERVE_IO_SPACE_CONVERT HostMemoryOperation = "MemoryReserveIoSpaceConvert" + HostMemoryOperation_MEMORY_RESERVE_IO_SPACE_GROW HostMemoryOperation = "MemoryReserveIoSpaceGrow" + HostMemoryOperation_MEMORY_RESERVE_IO_SPACE_SHRINK HostMemoryOperation = "MemoryReserveIoSpaceShrink" +) diff --git a/internal/hcs/schema2/host_memory_query_request.go b/internal/hcs/schema2/host_memory_query_request.go new file mode 100644 index 0000000000..d020501a17 --- /dev/null +++ b/internal/hcs/schema2/host_memory_query_request.go @@ -0,0 +1,23 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +import ( + "encoding/json" +) + +type HostMemoryQueryRequest struct { + Type_ *HostMemoryQueryType `json:"Type,omitempty"` + OperationDetails *json.RawMessage `json:"OperationDetails,omitempty"` +} diff --git a/internal/hcs/schema2/host_memory_query_type.go b/internal/hcs/schema2/host_memory_query_type.go new file mode 100644 index 0000000000..8dc4e908b7 --- /dev/null +++ b/internal/hcs/schema2/host_memory_query_type.go @@ -0,0 +1,22 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type HostMemoryQueryType string + +// List of HostMemoryQueryType +const ( + HostMemoryQueryType_DYNAMIC_MEMORY HostMemoryQueryType = "DynamicMemory" + HostMemoryQueryType_MEMORY_RESERVE_TARGET HostMemoryQueryType = "MemoryReserveTarget" +) diff --git a/internal/hcs/schema2/host_processor_modify_request.go b/internal/hcs/schema2/host_processor_modification_request.go similarity index 53% rename from internal/hcs/schema2/host_processor_modify_request.go rename to internal/hcs/schema2/host_processor_modification_request.go index 2238ce5306..02b9ce5691 100644 --- a/internal/hcs/schema2/host_processor_modify_request.go +++ b/internal/hcs/schema2/host_processor_modification_request.go @@ -1,5 +1,9 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * @@ -9,8 +13,12 @@ package hcsschema +import ( + "encoding/json" +) + // Structure used to request a service processor modification type HostProcessorModificationRequest struct { - Operation CPUGroupOperation `json:"Operation,omitempty"` - OperationDetails interface{} `json:"OperationDetails,omitempty"` + Operation *ModifyServiceOperation `json:"Operation,omitempty"` + OperationDetails *json.RawMessage `json:"OperationDetails,omitempty"` } diff --git a/internal/hcs/schema2/hosted_system.go b/internal/hcs/schema2/hosted_system.go index ea3084bca7..46c81d6acf 100644 --- a/internal/hcs/schema2/hosted_system.go +++ b/internal/hcs/schema2/hosted_system.go @@ -1,16 +1,20 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema +// Describes the configuration of a container compute system hosted by another compute system. This can have its own schema version since the hosted system could support different versions compared to the host machine. type HostedSystem struct { - SchemaVersion *Version `json:"SchemaVersion,omitempty"` - - Container *Container `json:"Container,omitempty"` + SchemaVersion *Version `json:"SchemaVersion,omitempty"` + Container *Container `json:"Container,omitempty"` } diff --git a/internal/hcs/schema2/hv_socket.go b/internal/hcs/schema2/hv_socket.go deleted file mode 100644 index 23b2ee9e7d..0000000000 --- a/internal/hcs/schema2/hv_socket.go +++ /dev/null @@ -1,16 +0,0 @@ -/* - * HCS API - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * API version: 2.1 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package hcsschema - -type HvSocket struct { - Config *HvSocketSystemConfig `json:"Config,omitempty"` - - EnablePowerShellDirect bool `json:"EnablePowerShellDirect,omitempty"` -} diff --git a/internal/hcs/schema2/hv_socket_address.go b/internal/hcs/schema2/hv_socket_address.go index 84c11b93ee..67e61c2dd6 100644 --- a/internal/hcs/schema2/hv_socket_address.go +++ b/internal/hcs/schema2/hv_socket_address.go @@ -1,5 +1,9 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * @@ -9,9 +13,10 @@ package hcsschema -// This class defines address settings applied to a VM -// by the GCS every time a VM starts or restores. +// This class defines address settings applied to a VM by the GCS every time a VM starts or restores. type HvSocketAddress struct { - LocalAddress string `json:"LocalAddress,omitempty"` + // Pattern: /^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/ + LocalAddress string `json:"LocalAddress,omitempty"` + // Pattern: /^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/ ParentAddress string `json:"ParentAddress,omitempty"` } diff --git a/internal/hcs/schema2/hv_socket_service_config.go b/internal/hcs/schema2/hv_socket_service_config.go index ecd9f7fbac..b38e7d2fe0 100644 --- a/internal/hcs/schema2/hv_socket_service_config.go +++ b/internal/hcs/schema2/hv_socket_service_config.go @@ -1,28 +1,24 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema type HvSocketServiceConfig struct { - - // SDDL string that HvSocket will check before allowing a host process to bind to this specific service. If not specified, defaults to the system DefaultBindSecurityDescriptor, defined in HvSocketSystemWpConfig in V1. + // SDDL string that HvSocket will check before allowing a host process to bind to this specific service. If not specified, defaults to the system DefaultBindSecurityDescriptor, defined in HvSocketSystemWpConfig in V1. BindSecurityDescriptor string `json:"BindSecurityDescriptor,omitempty"` - - // SDDL string that HvSocket will check before allowing a host process to connect to this specific service. If not specified, defaults to the system DefaultConnectSecurityDescriptor, defined in HvSocketSystemWpConfig in V1. + // SDDL string that HvSocket will check before allowing a host process to connect to this specific service. If not specified, defaults to the system DefaultConnectSecurityDescriptor, defined in HvSocketSystemWpConfig in V1. ConnectSecurityDescriptor string `json:"ConnectSecurityDescriptor,omitempty"` - - // If true, HvSocket will process wildcard binds for this service/system combination. Wildcard binds are secured in the registry at SOFTWARE/Microsoft/Windows NT/CurrentVersion/Virtualization/HvSocket/WildcardDescriptors + // If true, HvSocket will process wildcard binds for this service/system combination. Wildcard binds are secured in the registry at SOFTWARE/Microsoft/Windows NT/CurrentVersion/Virtualization/HvSocket/WildcardDescriptors AllowWildcardBinds bool `json:"AllowWildcardBinds,omitempty"` - - // Disabled controls whether the HvSocket service is accepting connection requests. - // This set to true will make the service refuse all incoming connections as well as cancel - // any connections already established. The service itself will still be active however - // and can be re-enabled at a future time. - Disabled bool `json:"Disabled,omitempty"` + Disabled bool `json:"Disabled,omitempty"` } diff --git a/internal/hcs/schema2/hv_socket_system_config.go b/internal/hcs/schema2/hv_socket_system_config.go index 69f4f9d39b..4c500eb67f 100644 --- a/internal/hcs/schema2/hv_socket_system_config.go +++ b/internal/hcs/schema2/hv_socket_system_config.go @@ -1,22 +1,22 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema -// This is the HCS Schema version of the HvSocket configuration. The VMWP version is located in Config.Devices.IC in V1. type HvSocketSystemConfig struct { - - // SDDL string that HvSocket will check before allowing a host process to bind to an unlisted service for this specific container/VM (not wildcard binds). + // SDDL string that HvSocket will check before allowing a host process to bind to an unlisted service for this specific container/VM (not wildcard binds). DefaultBindSecurityDescriptor string `json:"DefaultBindSecurityDescriptor,omitempty"` - - // SDDL string that HvSocket will check before allowing a host process to connect to an unlisted service in the VM/container. - DefaultConnectSecurityDescriptor string `json:"DefaultConnectSecurityDescriptor,omitempty"` - - ServiceTable map[string]HvSocketServiceConfig `json:"ServiceTable,omitempty"` + // SDDL string that HvSocket will check before allowing a host process to connect to an unlisted service in the VM/container. + DefaultConnectSecurityDescriptor string `json:"DefaultConnectSecurityDescriptor,omitempty"` + ServiceTable map[string]HvSocketServiceConfig `json:"ServiceTable,omitempty"` } diff --git a/internal/hcs/schema2/ide_controller.go b/internal/hcs/schema2/ide_controller.go new file mode 100644 index 0000000000..1a6079c197 --- /dev/null +++ b/internal/hcs/schema2/ide_controller.go @@ -0,0 +1,19 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type IDEController struct { + // The index of the attachment list indicates the location of the drive + Attachments []Attachment `json:"Attachments,omitempty"` +} diff --git a/internal/hcs/schema2/idle_processors_request.go b/internal/hcs/schema2/idle_processors_request.go new file mode 100644 index 0000000000..2b2ac42606 --- /dev/null +++ b/internal/hcs/schema2/idle_processors_request.go @@ -0,0 +1,18 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type IdleProcessorsRequest struct { + IdleProcessorCount uint32 `json:"IdleProcessorCount,omitempty"` +} diff --git a/internal/hcs/schema2/idled_processor_response.go b/internal/hcs/schema2/idled_processor_response.go new file mode 100644 index 0000000000..cd07f0649d --- /dev/null +++ b/internal/hcs/schema2/idled_processor_response.go @@ -0,0 +1,20 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type IdledProcessorResponse struct { + RequestedIdle uint32 `json:"RequestedIdle,omitempty"` + IdleStatus uint32 `json:"IdleStatus,omitempty"` + CurrentIdle uint32 `json:"CurrentIdle,omitempty"` +} diff --git a/internal/hcs/schema2/inject_non_maskable_interrupt.go b/internal/hcs/schema2/inject_non_maskable_interrupt.go new file mode 100644 index 0000000000..6aade8d7c1 --- /dev/null +++ b/internal/hcs/schema2/inject_non_maskable_interrupt.go @@ -0,0 +1,18 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// A non-maskable interrupt (NMI) was inject by the host management client or other tool. +type InjectNonMaskableInterrupt struct { +} diff --git a/internal/hcs/schema2/integration_component_operating_state_reason.go b/internal/hcs/schema2/integration_component_operating_state_reason.go new file mode 100644 index 0000000000..f9e413f458 --- /dev/null +++ b/internal/hcs/schema2/integration_component_operating_state_reason.go @@ -0,0 +1,27 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// IntegrationComponentOperatingStateReason : Possible reason for integration component's state +type IntegrationComponentOperatingStateReason string + +// List of IntegrationComponentOperatingStateReason +const ( + IntegrationComponentOperatingStateReason_UNKNOWN IntegrationComponentOperatingStateReason = "Unknown" + IntegrationComponentOperatingStateReason_APPS_IN_CRITICAL_STATE IntegrationComponentOperatingStateReason = "AppsInCriticalState" + IntegrationComponentOperatingStateReason_COMMUNICATION_TIMED_OUT IntegrationComponentOperatingStateReason = "CommunicationTimedOut" + IntegrationComponentOperatingStateReason_FAILED_COMMUNICATION IntegrationComponentOperatingStateReason = "FailedCommunication" + IntegrationComponentOperatingStateReason_HEALTHY_APPS IntegrationComponentOperatingStateReason = "HealthyApps" + IntegrationComponentOperatingStateReason_PROTOCOL_MISMATCH IntegrationComponentOperatingStateReason = "ProtocolMismatch" +) diff --git a/internal/hcs/schema2/integration_component_operational_state.go b/internal/hcs/schema2/integration_component_operational_state.go new file mode 100644 index 0000000000..3848071657 --- /dev/null +++ b/internal/hcs/schema2/integration_component_operational_state.go @@ -0,0 +1,29 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// IntegrationComponentOperationalState : Operational status for integration component +type IntegrationComponentOperationalState string + +// List of IntegrationComponentOperationalState +const ( + IntegrationComponentOperationalState_UNKNOWN IntegrationComponentOperationalState = "Unknown" + IntegrationComponentOperationalState_DEGRADED IntegrationComponentOperationalState = "Degraded" + IntegrationComponentOperationalState_DORMANT IntegrationComponentOperationalState = "Dormant" + IntegrationComponentOperationalState_ERROR_ IntegrationComponentOperationalState = "Error" + IntegrationComponentOperationalState_LOST_COMMUNICATION IntegrationComponentOperationalState = "LostCommunication" + IntegrationComponentOperationalState_NON_RECOVERABLE_ERROR IntegrationComponentOperationalState = "NonRecoverableError" + IntegrationComponentOperationalState_NO_CONTACT IntegrationComponentOperationalState = "NoContact" + IntegrationComponentOperationalState_OK IntegrationComponentOperationalState = "Ok" +) diff --git a/internal/hcs/schema2/integration_component_status.go b/internal/hcs/schema2/integration_component_status.go new file mode 100644 index 0000000000..fb8371890d --- /dev/null +++ b/internal/hcs/schema2/integration_component_status.go @@ -0,0 +1,21 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type IntegrationComponentStatus struct { + // If IC is enabled on this compute system + IsEnabled bool `json:"IsEnabled,omitempty"` + State *IntegrationComponentOperationalState `json:"State,omitempty"` + Reason *IntegrationComponentOperatingStateReason `json:"Reason,omitempty"` +} diff --git a/internal/hcs/schema2/model_interface_class.go b/internal/hcs/schema2/interface_class.go similarity index 59% rename from internal/hcs/schema2/model_interface_class.go rename to internal/hcs/schema2/interface_class.go index 7be98b5410..8b286a2cea 100644 --- a/internal/hcs/schema2/model_interface_class.go +++ b/internal/hcs/schema2/interface_class.go @@ -1,5 +1,9 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * @@ -10,7 +14,8 @@ package hcsschema type InterfaceClass struct { - Type_ string `json:"type,omitempty"` + Type_ *InterfaceClassType `json:"type,omitempty"` + // Pattern: /^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/ Identifier string `json:"identifier,omitempty"` Recurse bool `json:"recurse,omitempty"` } diff --git a/internal/hcs/schema2/interface_class_type.go b/internal/hcs/schema2/interface_class_type.go new file mode 100644 index 0000000000..796985f92b --- /dev/null +++ b/internal/hcs/schema2/interface_class_type.go @@ -0,0 +1,24 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// InterfaceClassType : Enum used to specify how the interface class should be treated when applying a device extension/creating container symlinks. This enum is ordering-sensitive; if two interface classes with the same identifier are merged, the type of the resulting interface class is given by the larger enum value (e.g., DeviceInstance + ClassGuid = ClassGuid). +type InterfaceClassType string + +// List of InterfaceClassType +const ( + InterfaceClassType_INHERIT InterfaceClassType = "Inherit" + InterfaceClassType_DEVICE_INSTANCE InterfaceClassType = "DeviceInstance" + InterfaceClassType_CLASS_GUID InterfaceClassType = "ClassGuid" +) diff --git a/internal/hcs/schema2/interrupt_moderation_mode.go b/internal/hcs/schema2/interrupt_moderation_mode.go index a614d63bd7..0f153d6e05 100644 --- a/internal/hcs/schema2/interrupt_moderation_mode.go +++ b/internal/hcs/schema2/interrupt_moderation_mode.go @@ -1,5 +1,9 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * @@ -9,34 +13,15 @@ package hcsschema -type InterruptModerationName string +// InterruptModerationMode : The valid interrupt moderation modes for I/O virtualization (IOV) offloading. +type InterruptModerationMode string -// The valid interrupt moderation modes for I/O virtualization (IOV) offloading. +// List of InterruptModerationMode const ( - DefaultName InterruptModerationName = "Default" - AdaptiveName InterruptModerationName = "Adaptive" - OffName InterruptModerationName = "Off" - LowName InterruptModerationName = "Low" - MediumName InterruptModerationName = "Medium" - HighName InterruptModerationName = "High" + InterruptModerationMode_DEFAULT_ InterruptModerationMode = "Default" + InterruptModerationMode_ADAPTIVE InterruptModerationMode = "Adaptive" + InterruptModerationMode_OFF InterruptModerationMode = "Off" + InterruptModerationMode_LOW InterruptModerationMode = "Low" + InterruptModerationMode_MEDIUM InterruptModerationMode = "Medium" + InterruptModerationMode_HIGH InterruptModerationMode = "High" ) - -type InterruptModerationValue uint32 - -const ( - DefaultValue InterruptModerationValue = iota - AdaptiveValue - OffValue - LowValue InterruptModerationValue = 100 - MediumValue InterruptModerationValue = 200 - HighValue InterruptModerationValue = 300 -) - -var InterruptModerationValueToName = map[InterruptModerationValue]InterruptModerationName{ - DefaultValue: DefaultName, - AdaptiveValue: AdaptiveName, - OffValue: OffName, - LowValue: LowName, - MediumValue: MediumName, - HighValue: HighName, -} diff --git a/internal/hcs/schema2/interrupt_moderation_mode_lookup.go b/internal/hcs/schema2/interrupt_moderation_mode_lookup.go new file mode 100644 index 0000000000..ab4aaa910f --- /dev/null +++ b/internal/hcs/schema2/interrupt_moderation_mode_lookup.go @@ -0,0 +1,28 @@ +package hcsschema + +// schema reference has [InterruptModerationMode] as a string enum: +// https://learn.microsoft.com/en-us/virtualization/api/hcs/schemareference#interruptmoderationmode +// +// however, Schema.VirtualMachines.Resources.Network.mars shows it as a int enum + +func (x InterruptModerationMode) Int64() (int64, error) { + return enumLookup(map[InterruptModerationMode]int64{ + InterruptModerationMode_DEFAULT_: 0, + InterruptModerationMode_ADAPTIVE: 1, + InterruptModerationMode_OFF: 2, + InterruptModerationMode_LOW: 100, + InterruptModerationMode_MEDIUM: 200, + InterruptModerationMode_HIGH: 300, + }, x) +} + +func NewInterruptModerationModeFromInt64(x int64) (InterruptModerationMode, error) { + return enumLookup(map[int64]InterruptModerationMode{ + 0: InterruptModerationMode_DEFAULT_, + 1: InterruptModerationMode_ADAPTIVE, + 2: InterruptModerationMode_OFF, + 100: InterruptModerationMode_LOW, + 200: InterruptModerationMode_MEDIUM, + 300: InterruptModerationMode_HIGH, + }, x) +} diff --git a/internal/hcs/schema2/iov_settings.go b/internal/hcs/schema2/iov_settings.go index 2a55cc37cd..437d9973dc 100644 --- a/internal/hcs/schema2/iov_settings.go +++ b/internal/hcs/schema2/iov_settings.go @@ -1,5 +1,9 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * @@ -9,14 +13,12 @@ package hcsschema -type IovSettings struct { - // The weight assigned to this port for I/O virtualization (IOV) offloading. - // Setting this to 0 disables IOV offloading. - OffloadWeight *uint32 `json:"OffloadWeight,omitempty"` +// MODIFICATION: updated uint32 to *uin32 for OffloadWeight and QueuePairsRequested +type IOVSettings struct { + // The weight assigned to this port for I/O virtualization (IOV) offloading. Setting this to 0 disables IOV offloading. + OffloadWeight *uint32 `json:"OffloadWeight,omitempty"` // The number of queue pairs requested for this port for I/O virtualization (IOV) offloading. - QueuePairsRequested *uint32 `json:"QueuePairsRequested,omitempty"` - - // The interrupt moderation mode for I/O virtualization (IOV) offloading. - InterruptModeration *InterruptModerationName `json:"InterruptModeration,omitempty"` + QueuePairsRequested *uint32 `json:"QueuePairsRequested,omitempty"` + InterruptModeration *InterruptModerationMode `json:"InterruptModeration,omitempty"` } diff --git a/internal/hcs/schema2/isolation_settings.go b/internal/hcs/schema2/isolation_settings.go index a34c2f99ae..f7e6326dcc 100644 --- a/internal/hcs/schema2/isolation_settings.go +++ b/internal/hcs/schema2/isolation_settings.go @@ -1,5 +1,9 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * @@ -9,10 +13,12 @@ package hcsschema +// MODIFICATION: add DebugHost, DebugPort, LaunchData, HclEnabled + type IsolationSettings struct { - // Guest isolation type options to decide virtual trust levels of virtual machine - IsolationType string `json:"IsolationType,omitempty"` - // Configuration to debug HCL layer for HCS VM TODO: Task 31102306: Miss the way to prevent the exposure of private debug configuration in HCS TODO: Think about the secret configurations which are private in VMMS VM (only edit by hvsedit) + IsolationType *GuestIsolationType `json:"IsolationType,omitempty"` + + // Configuration to debug HCL layer for HCS VM DebugHost string `json:"DebugHost,omitempty"` DebugPort int64 `json:"DebugPort,omitempty"` // Optional data passed by host on isolated virtual machine start diff --git a/internal/hcs/schema2/job_cpu.go b/internal/hcs/schema2/job_cpu.go new file mode 100644 index 0000000000..93d477e342 --- /dev/null +++ b/internal/hcs/schema2/job_cpu.go @@ -0,0 +1,19 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type JobCpu struct { + Rate uint32 `json:"rate,omitempty"` + Weight uint32 `json:"weight,omitempty"` +} diff --git a/internal/hcs/schema2/job_memory.go b/internal/hcs/schema2/job_memory.go new file mode 100644 index 0000000000..318d6882c2 --- /dev/null +++ b/internal/hcs/schema2/job_memory.go @@ -0,0 +1,18 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type JobMemory struct { + Limit uint64 `json:"limit,omitempty"` +} diff --git a/internal/hcs/schema2/job_namespace.go b/internal/hcs/schema2/job_namespace.go new file mode 100644 index 0000000000..7891ca2b27 --- /dev/null +++ b/internal/hcs/schema2/job_namespace.go @@ -0,0 +1,22 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type JobNamespace struct { + Cpu *JobCpu `json:"cpu,omitempty"` + Memory *JobMemory `json:"memory,omitempty"` + Systemroot *JobSystemRoot `json:"systemroot,omitempty"` + Terminationpolicy *JobTerminationPolicy `json:"terminationpolicy,omitempty"` + Threadimpersonation bool `json:"threadimpersonation,omitempty"` +} diff --git a/internal/hcs/schema2/job_system_root.go b/internal/hcs/schema2/job_system_root.go new file mode 100644 index 0000000000..ba01ce973e --- /dev/null +++ b/internal/hcs/schema2/job_system_root.go @@ -0,0 +1,18 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type JobSystemRoot struct { + Path string `json:"path,omitempty"` +} diff --git a/internal/hcs/schema2/job_termination_policy.go b/internal/hcs/schema2/job_termination_policy.go new file mode 100644 index 0000000000..653213155c --- /dev/null +++ b/internal/hcs/schema2/job_termination_policy.go @@ -0,0 +1,22 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type JobTerminationPolicy string + +// List of JobTerminationPolicy +const ( + JobTerminationPolicy_PERMANENT_QUIESCENT JobTerminationPolicy = "PermanentQuiescent" + JobTerminationPolicy_KILL_ON_HANDLE_CLOSE JobTerminationPolicy = "KillOnHandleClose" +) diff --git a/internal/hcs/schema2/kernel_integration.go b/internal/hcs/schema2/kernel_integration.go new file mode 100644 index 0000000000..6cda6781e2 --- /dev/null +++ b/internal/hcs/schema2/kernel_integration.go @@ -0,0 +1,17 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type KernelIntegration struct { +} diff --git a/internal/hcs/schema2/keyboard.go b/internal/hcs/schema2/keyboard.go index 3d3fa3b1c7..ecadb88093 100644 --- a/internal/hcs/schema2/keyboard.go +++ b/internal/hcs/schema2/keyboard.go @@ -1,9 +1,13 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ diff --git a/internal/hcs/schema2/kvp_exchange.go b/internal/hcs/schema2/kvp_exchange.go new file mode 100644 index 0000000000..4ad9f82870 --- /dev/null +++ b/internal/hcs/schema2/kvp_exchange.go @@ -0,0 +1,20 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type KvpExchange struct { + EnableHostOSInfoKvpItems *StateOverride `json:"EnableHostOSInfoKvpItems,omitempty"` + EntriesToBeAdded map[string]string `json:"EntriesToBeAdded,omitempty"` + EntriesToBeRemoved []string `json:"EntriesToBeRemoved,omitempty"` +} diff --git a/internal/hcs/schema2/kvp_query.go b/internal/hcs/schema2/kvp_query.go new file mode 100644 index 0000000000..2c8cf71e78 --- /dev/null +++ b/internal/hcs/schema2/kvp_query.go @@ -0,0 +1,21 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// Query information to request from the key-value exchange integration component +type KvpQuery struct { + Source *KvpSource `json:"Source,omitempty"` + // Keys in the key-value pair to be used for the query depending on the operation + Keys []string `json:"Keys,omitempty"` +} diff --git a/internal/hcs/schema2/kvp_source.go b/internal/hcs/schema2/kvp_source.go new file mode 100644 index 0000000000..29874bf6a4 --- /dev/null +++ b/internal/hcs/schema2/kvp_source.go @@ -0,0 +1,24 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// KvpSource : The source sets the location of the key-value pairs stored depending on the type of the key-value pairs +type KvpSource string + +// List of KvpSource +const ( + KvpSource_KVP_SET_BY_HOST KvpSource = "KvpSetByHost" + KvpSource_KVP_SET_BY_GUEST KvpSource = "KvpSetByGuest" + KvpSource_GUEST_OS_INFO KvpSource = "GuestOSInfo" +) diff --git a/internal/hcs/schema2/launch_options.go b/internal/hcs/schema2/launch_options.go new file mode 100644 index 0000000000..0310c14b81 --- /dev/null +++ b/internal/hcs/schema2/launch_options.go @@ -0,0 +1,18 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type LaunchOptions struct { + Type_ *AppContainerLaunchType `json:"Type,omitempty"` +} diff --git a/internal/hcs/schema2/layer.go b/internal/hcs/schema2/layer.go index 176c49d495..3ad25aa2bd 100644 --- a/internal/hcs/schema2/layer.go +++ b/internal/hcs/schema2/layer.go @@ -1,21 +1,26 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema +// Describe the parent hierarchy for a container's storage type Layer struct { - Id string `json:"Id,omitempty"` - - Path string `json:"Path,omitempty"` - - PathType string `json:"PathType,omitempty"` - - // Unspecified defaults to Enabled - Cache string `json:"Cache,omitempty"` + // Identifier for a layer. + // + // Pattern: /^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/ + ID string `json:"Id,omitempty"` + // Root path of the layer. + Path string `json:"Path,omitempty"` + PathType *PathType `json:"PathType,omitempty"` + Cache *CacheMode `json:"Cache,omitempty"` } diff --git a/internal/hcs/schema2/layer_data.go b/internal/hcs/schema2/layer_data.go new file mode 100644 index 0000000000..e88bb38f2d --- /dev/null +++ b/internal/hcs/schema2/layer_data.go @@ -0,0 +1,19 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type LayerData struct { + SchemaVersion *Version `json:"SchemaVersion,omitempty"` + Layers []Layer `json:"Layers,omitempty"` +} diff --git a/internal/hcs/schema2/licensing.go b/internal/hcs/schema2/licensing.go new file mode 100644 index 0000000000..019e42a885 --- /dev/null +++ b/internal/hcs/schema2/licensing.go @@ -0,0 +1,21 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// The settings used to configure guest activation. +type Licensing struct { + // Pattern: /^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/ + ContainerID string `json:"ContainerID,omitempty"` + PackageFamilyNames []string `json:"PackageFamilyNames,omitempty"` +} diff --git a/internal/hcs/schema2/linux.go b/internal/hcs/schema2/linux.go new file mode 100644 index 0000000000..b1b5ddeb0a --- /dev/null +++ b/internal/hcs/schema2/linux.go @@ -0,0 +1,30 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type Linux struct { + UidMappings []LinuxIDMapping `json:"uidMappings,omitempty"` + GidMappings []LinuxIDMapping `json:"gidMappings,omitempty"` + Sysctl map[string]string `json:"sysctl,omitempty"` + Resources *LinuxResources `json:"resources,omitempty"` + CgroupsPath string `json:"cgroupsPath,omitempty"` + Namespaces []LinuxNamespace `json:"namespaces,omitempty"` + Devices []LinuxDevice `json:"devices,omitempty"` + Seccomp *LinuxSeccomp `json:"seccomp,omitempty"` + RootfsPropagation string `json:"rootfsPropagation,omitempty"` + MaskedPaths []string `json:"maskedPaths,omitempty"` + ReadonlyPaths []string `json:"readonlyPaths,omitempty"` + MountLabel string `json:"mountLabel,omitempty"` + IntelRdt *LinuxIntelRdt `json:"intelRdt,omitempty"` +} diff --git a/internal/hcs/schema2/linux_block_io.go b/internal/hcs/schema2/linux_block_io.go new file mode 100644 index 0000000000..5ea6679ffd --- /dev/null +++ b/internal/hcs/schema2/linux_block_io.go @@ -0,0 +1,24 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type LinuxBlockIO struct { + Weight uint16 `json:"weight,omitempty"` + LeafWeight uint16 `json:"leafWeight,omitempty"` + WeightDevice []LinuxWeightDevice `json:"weightDevice,omitempty"` + ThrottleReadBpsDevice []LinuxThrottleDevice `json:"throttleReadBpsDevice,omitempty"` + ThrottleWriteBpsDevice []LinuxThrottleDevice `json:"throttleWriteBpsDevice,omitempty"` + ThrottleReadIOPSDevice []LinuxThrottleDevice `json:"throttleReadIOPSDevice,omitempty"` + ThrottleWriteIOPSDevice []LinuxThrottleDevice `json:"throttleWriteIOPSDevice,omitempty"` +} diff --git a/internal/hcs/schema2/linux_capabilities.go b/internal/hcs/schema2/linux_capabilities.go new file mode 100644 index 0000000000..308e8d690b --- /dev/null +++ b/internal/hcs/schema2/linux_capabilities.go @@ -0,0 +1,22 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type LinuxCapabilities struct { + Bounding []string `json:"bounding,omitempty"` + Effective []string `json:"effective,omitempty"` + Inheritable []string `json:"inheritable,omitempty"` + Permitted []string `json:"permitted,omitempty"` + Ambient []string `json:"ambient,omitempty"` +} diff --git a/internal/hcs/schema2/linux_combined_layers.go b/internal/hcs/schema2/linux_combined_layers.go new file mode 100644 index 0000000000..91964b1dea --- /dev/null +++ b/internal/hcs/schema2/linux_combined_layers.go @@ -0,0 +1,20 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type LinuxCombinedLayers struct { + Layers []LinuxLayer `json:"Layers,omitempty"` + ScratchPath string `json:"ScratchPath,omitempty"` + ContainerRootPath string `json:"ContainerRootPath,omitempty"` +} diff --git a/internal/hcs/schema2/linux_cpu.go b/internal/hcs/schema2/linux_cpu.go new file mode 100644 index 0000000000..493784cb41 --- /dev/null +++ b/internal/hcs/schema2/linux_cpu.go @@ -0,0 +1,24 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type LinuxCpu struct { + Shares uint64 `json:"shares,omitempty"` + Quota int64 `json:"quota,omitempty"` + Period uint64 `json:"period,omitempty"` + RealtimeRuntime int64 `json:"realtimeRuntime,omitempty"` + RealtimePeriod uint64 `json:"realtimePeriod,omitempty"` + Cpus string `json:"cpus,omitempty"` + Mems string `json:"mems,omitempty"` +} diff --git a/internal/hcs/schema2/linux_device.go b/internal/hcs/schema2/linux_device.go new file mode 100644 index 0000000000..978906a81b --- /dev/null +++ b/internal/hcs/schema2/linux_device.go @@ -0,0 +1,24 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type LinuxDevice struct { + Path string `json:"path,omitempty"` + Type_ string `json:"type,omitempty"` + Major int64 `json:"major,omitempty"` + Minor int64 `json:"minor,omitempty"` + FileMode uint32 `json:"fileMode,omitempty"` + Uid uint32 `json:"uid,omitempty"` + Gid uint32 `json:"gid,omitempty"` +} diff --git a/internal/hcs/schema2/linux_device_cgroup.go b/internal/hcs/schema2/linux_device_cgroup.go new file mode 100644 index 0000000000..949822c6f4 --- /dev/null +++ b/internal/hcs/schema2/linux_device_cgroup.go @@ -0,0 +1,22 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type LinuxDeviceCgroup struct { + Allow bool `json:"allow,omitempty"` + Type_ string `json:"type,omitempty"` + Major int64 `json:"major,omitempty"` + Minor int64 `json:"minor,omitempty"` + Access string `json:"access,omitempty"` +} diff --git a/internal/hcs/schema2/linux_guest_modify_setting_request.go b/internal/hcs/schema2/linux_guest_modify_setting_request.go new file mode 100644 index 0000000000..0fc132e9ee --- /dev/null +++ b/internal/hcs/schema2/linux_guest_modify_setting_request.go @@ -0,0 +1,24 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +import ( + "encoding/json" +) + +type LinuxGuestModifySettingRequest struct { + ResourceType *LinuxModifyResourceType `json:"ResourceType,omitempty"` + RequestType *LinuxModifyRequestType `json:"RequestType,omitempty"` + Settings *json.RawMessage `json:"Settings,omitempty"` +} diff --git a/internal/hcs/schema2/linux_hosted_system.go b/internal/hcs/schema2/linux_hosted_system.go new file mode 100644 index 0000000000..5c81f40b76 --- /dev/null +++ b/internal/hcs/schema2/linux_hosted_system.go @@ -0,0 +1,20 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type LinuxHostedSystem struct { + SchemaVersion *Version `json:"SchemaVersion,omitempty"` + OciBundlePath string `json:"OciBundlePath,omitempty"` + OciSpecification *OciSpec `json:"OciSpecification,omitempty"` +} diff --git a/internal/hcs/schema2/linux_hugepage_limit.go b/internal/hcs/schema2/linux_hugepage_limit.go new file mode 100644 index 0000000000..c8c8d49f23 --- /dev/null +++ b/internal/hcs/schema2/linux_hugepage_limit.go @@ -0,0 +1,19 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type LinuxHugepageLimit struct { + PageSize string `json:"pageSize,omitempty"` + Limit uint64 `json:"limit,omitempty"` +} diff --git a/internal/hcs/schema2/linux_id_mapping.go b/internal/hcs/schema2/linux_id_mapping.go new file mode 100644 index 0000000000..bf3da02f6b --- /dev/null +++ b/internal/hcs/schema2/linux_id_mapping.go @@ -0,0 +1,20 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type LinuxIDMapping struct { + ContainerID uint32 `json:"containerID,omitempty"` + HostID uint32 `json:"hostID,omitempty"` + Size uint32 `json:"size,omitempty"` +} diff --git a/internal/hcs/schema2/linux_intel_rdt.go b/internal/hcs/schema2/linux_intel_rdt.go new file mode 100644 index 0000000000..d382544ceb --- /dev/null +++ b/internal/hcs/schema2/linux_intel_rdt.go @@ -0,0 +1,18 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type LinuxIntelRdt struct { + L3CacheSchema string `json:"l3CacheSchema,omitempty"` +} diff --git a/internal/hcs/schema2/linux_interface_priority.go b/internal/hcs/schema2/linux_interface_priority.go new file mode 100644 index 0000000000..c8ae2719e3 --- /dev/null +++ b/internal/hcs/schema2/linux_interface_priority.go @@ -0,0 +1,19 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type LinuxInterfacePriority struct { + Name string `json:"name,omitempty"` + Priority uint32 `json:"priority,omitempty"` +} diff --git a/internal/hcs/schema2/linux_kernel_direct.go b/internal/hcs/schema2/linux_kernel_direct.go index 0ab6c280fc..01c6049f83 100644 --- a/internal/hcs/schema2/linux_kernel_direct.go +++ b/internal/hcs/schema2/linux_kernel_direct.go @@ -1,9 +1,13 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.2 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ @@ -11,8 +15,6 @@ package hcsschema type LinuxKernelDirect struct { KernelFilePath string `json:"KernelFilePath,omitempty"` - - InitRdPath string `json:"InitRdPath,omitempty"` - - KernelCmdLine string `json:"KernelCmdLine,omitempty"` + InitRdPath string `json:"InitRdPath,omitempty"` + KernelCmdLine string `json:"KernelCmdLine,omitempty"` } diff --git a/internal/hcs/schema2/model_device_extension.go b/internal/hcs/schema2/linux_layer.go similarity index 55% rename from internal/hcs/schema2/model_device_extension.go rename to internal/hcs/schema2/linux_layer.go index a62568d892..f121ba17dd 100644 --- a/internal/hcs/schema2/model_device_extension.go +++ b/internal/hcs/schema2/linux_layer.go @@ -1,5 +1,9 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * @@ -9,7 +13,6 @@ package hcsschema -type DeviceExtension struct { - DeviceCategory *DeviceCategory `json:"device_category,omitempty"` - Namespace *DeviceExtensionNamespace `json:"namespace,omitempty"` +type LinuxLayer struct { + Path string `json:"Path,omitempty"` } diff --git a/internal/hcs/schema2/linux_mapped_directory.go b/internal/hcs/schema2/linux_mapped_directory.go new file mode 100644 index 0000000000..7d7ec8756a --- /dev/null +++ b/internal/hcs/schema2/linux_mapped_directory.go @@ -0,0 +1,21 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type LinuxMappedDirectory struct { + MountPath string `json:"MountPath,omitempty"` + Port uint32 `json:"Port,omitempty"` + ShareName string `json:"ShareName,omitempty"` + ReadOnly bool `json:"ReadOnly,omitempty"` +} diff --git a/internal/hcs/schema2/linux_mapped_virtual_disk.go b/internal/hcs/schema2/linux_mapped_virtual_disk.go new file mode 100644 index 0000000000..d3be34f787 --- /dev/null +++ b/internal/hcs/schema2/linux_mapped_virtual_disk.go @@ -0,0 +1,21 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type LinuxMappedVirtualDisk struct { + MountPath string `json:"MountPath,omitempty"` + Lun uint8 `json:"Lun,omitempty"` + Controller uint8 `json:"Controller,omitempty"` + ReadOnly bool `json:"ReadOnly,omitempty"` +} diff --git a/internal/hcs/schema2/linux_memory.go b/internal/hcs/schema2/linux_memory.go new file mode 100644 index 0000000000..4d2cc65949 --- /dev/null +++ b/internal/hcs/schema2/linux_memory.go @@ -0,0 +1,24 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type LinuxMemory struct { + Limit int64 `json:"limit,omitempty"` + Reservation int64 `json:"reservation,omitempty"` + Swap int64 `json:"swap,omitempty"` + Kernel int64 `json:"kernel,omitempty"` + KernelTCP int64 `json:"kernelTCP,omitempty"` + Swappiness uint64 `json:"swappiness,omitempty"` + DisableOOMKiller bool `json:"disableOOMKiller,omitempty"` +} diff --git a/internal/hcs/schema2/linux_modify_request_type.go b/internal/hcs/schema2/linux_modify_request_type.go new file mode 100644 index 0000000000..ded1be0352 --- /dev/null +++ b/internal/hcs/schema2/linux_modify_request_type.go @@ -0,0 +1,23 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type LinuxModifyRequestType string + +// List of Linux_ModifyRequestType +const ( + LinuxModifyRequestType_ADD LinuxModifyRequestType = "Add" + LinuxModifyRequestType_REMOVE LinuxModifyRequestType = "Remove" + LinuxModifyRequestType_UPDATE LinuxModifyRequestType = "Update" +) diff --git a/internal/hcs/schema2/linux_modify_resource_type.go b/internal/hcs/schema2/linux_modify_resource_type.go new file mode 100644 index 0000000000..4040b4694d --- /dev/null +++ b/internal/hcs/schema2/linux_modify_resource_type.go @@ -0,0 +1,24 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type LinuxModifyResourceType string + +// List of Linux_ModifyResourceType +const ( + LinuxModifyResourceType_MAPPED_DIRECTORY LinuxModifyResourceType = "MappedDirectory" + LinuxModifyResourceType_MAPPED_VIRTUAL_DISK LinuxModifyResourceType = "MappedVirtualDisk" + LinuxModifyResourceType_COMBINED_LAYERS LinuxModifyResourceType = "CombinedLayers" + LinuxModifyResourceType_VP_MEM_DEVICE LinuxModifyResourceType = "VPMemDevice" +) diff --git a/internal/hcs/schema2/linux_namespace.go b/internal/hcs/schema2/linux_namespace.go new file mode 100644 index 0000000000..689eb140d9 --- /dev/null +++ b/internal/hcs/schema2/linux_namespace.go @@ -0,0 +1,20 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type LinuxNamespace struct { + // pid, network, mount, ipc, uts, user, cgroup + Type_ string `json:"type,omitempty"` + Path string `json:"path,omitempty"` +} diff --git a/internal/hcs/schema2/linux_network.go b/internal/hcs/schema2/linux_network.go new file mode 100644 index 0000000000..d142e1e06e --- /dev/null +++ b/internal/hcs/schema2/linux_network.go @@ -0,0 +1,19 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type LinuxNetwork struct { + ClassID uint32 `json:"classID,omitempty"` + Priorities []LinuxInterfacePriority `json:"priorities,omitempty"` +} diff --git a/internal/hcs/schema2/linux_pids.go b/internal/hcs/schema2/linux_pids.go new file mode 100644 index 0000000000..ee7d6f16a0 --- /dev/null +++ b/internal/hcs/schema2/linux_pids.go @@ -0,0 +1,18 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type LinuxPids struct { + Limit int64 `json:"limit,omitempty"` +} diff --git a/internal/hcs/schema2/linux_process_parameters.go b/internal/hcs/schema2/linux_process_parameters.go new file mode 100644 index 0000000000..de3a880477 --- /dev/null +++ b/internal/hcs/schema2/linux_process_parameters.go @@ -0,0 +1,21 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type LinuxProcessParameters struct { + CreateStdInPipe bool `json:"CreateStdInPipe,omitempty"` + CreateStdOutPipe bool `json:"CreateStdOutPipe,omitempty"` + CreateStdErrPipe bool `json:"CreateStdErrPipe,omitempty"` + OciProcess *Process `json:"OciProcess,omitempty"` +} diff --git a/internal/hcs/schema2/linux_rdma.go b/internal/hcs/schema2/linux_rdma.go new file mode 100644 index 0000000000..daf822dc1f --- /dev/null +++ b/internal/hcs/schema2/linux_rdma.go @@ -0,0 +1,19 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type LinuxRdma struct { + HcaHandles uint32 `json:"hcaHandles,omitempty"` + HcaObjects uint32 `json:"hcaObjects,omitempty"` +} diff --git a/internal/hcs/schema2/linux_resources.go b/internal/hcs/schema2/linux_resources.go new file mode 100644 index 0000000000..7788a5bff9 --- /dev/null +++ b/internal/hcs/schema2/linux_resources.go @@ -0,0 +1,25 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type LinuxResources struct { + Devices []LinuxDeviceCgroup `json:"devices,omitempty"` + Memory *LinuxMemory `json:"memory,omitempty"` + Cpu *LinuxCpu `json:"cpu,omitempty"` + Pids *LinuxPids `json:"pids,omitempty"` + BlockIO *LinuxBlockIO `json:"blockIO,omitempty"` + HugepageLimits []LinuxHugepageLimit `json:"hugepageLimits,omitempty"` + Network *LinuxNetwork `json:"network,omitempty"` + Rdma map[string]LinuxRdma `json:"rdma,omitempty"` +} diff --git a/internal/hcs/schema2/linux_seccomp.go b/internal/hcs/schema2/linux_seccomp.go new file mode 100644 index 0000000000..977344d83c --- /dev/null +++ b/internal/hcs/schema2/linux_seccomp.go @@ -0,0 +1,20 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type LinuxSeccomp struct { + DefaultAction string `json:"defaultAction,omitempty"` + Architectures []string `json:"architectures,omitempty"` + Syscalls []LinuxSyscall `json:"syscalls,omitempty"` +} diff --git a/internal/hcs/schema2/linux_seccomp_arg.go b/internal/hcs/schema2/linux_seccomp_arg.go new file mode 100644 index 0000000000..d8e29bc0d2 --- /dev/null +++ b/internal/hcs/schema2/linux_seccomp_arg.go @@ -0,0 +1,21 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type LinuxSeccompArg struct { + Index uint64 `json:"index,omitempty"` + Value uint64 `json:"value,omitempty"` + ValueTwo uint64 `json:"valueTwo,omitempty"` + Op string `json:"op,omitempty"` +} diff --git a/internal/hcs/schema2/linux_syscall.go b/internal/hcs/schema2/linux_syscall.go new file mode 100644 index 0000000000..bb14b275b8 --- /dev/null +++ b/internal/hcs/schema2/linux_syscall.go @@ -0,0 +1,20 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type LinuxSyscall struct { + Names []string `json:"names,omitempty"` + Action string `json:"action,omitempty"` + Args []LinuxSeccompArg `json:"args,omitempty"` +} diff --git a/internal/hcs/schema2/linux_throttle_device.go b/internal/hcs/schema2/linux_throttle_device.go new file mode 100644 index 0000000000..9ee377656b --- /dev/null +++ b/internal/hcs/schema2/linux_throttle_device.go @@ -0,0 +1,20 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type LinuxThrottleDevice struct { + Major int64 `json:"major,omitempty"` + Minor int64 `json:"minor,omitempty"` + Rate uint64 `json:"rate,omitempty"` +} diff --git a/internal/hcs/schema2/linux_weight_device.go b/internal/hcs/schema2/linux_weight_device.go new file mode 100644 index 0000000000..dae5e7744a --- /dev/null +++ b/internal/hcs/schema2/linux_weight_device.go @@ -0,0 +1,21 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type LinuxWeightDevice struct { + Major int64 `json:"major,omitempty"` + Minor int64 `json:"minor,omitempty"` + Weight uint16 `json:"weight,omitempty"` + LeafWeight uint16 `json:"leafWeight,omitempty"` +} diff --git a/internal/hcs/schema2/logical_processor.go b/internal/hcs/schema2/logical_processor.go index 2e3aa5e175..d28df63e74 100644 --- a/internal/hcs/schema2/logical_processor.go +++ b/internal/hcs/schema2/logical_processor.go @@ -1,5 +1,9 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * @@ -10,9 +14,10 @@ package hcsschema type LogicalProcessor struct { - LpIndex uint32 `json:"LpIndex,omitempty"` - NodeNumber uint8 `json:"NodeNumber,omitempty"` - PackageId uint32 `json:"PackageId,omitempty"` - CoreId uint32 `json:"CoreId,omitempty"` - RootVpIndex int32 `json:"RootVpIndex,omitempty"` + LpIndex uint32 `json:"LpIndex,omitempty"` + NodeNumber uint8 `json:"NodeNumber,omitempty"` + PackageID uint32 `json:"PackageId,omitempty"` + CoreID uint32 `json:"CoreId,omitempty"` + RootVpIndex int32 `json:"RootVpIndex,omitempty"` + Subnodes []Subnode `json:"Subnodes,omitempty"` } diff --git a/internal/hcs/schema2/mapped_directory.go b/internal/hcs/schema2/mapped_directory.go index 9b86a40457..32379f2cf9 100644 --- a/internal/hcs/schema2/mapped_directory.go +++ b/internal/hcs/schema2/mapped_directory.go @@ -1,20 +1,27 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema +// Object that describes a directory in the host that is requested to be mapped into a compute system's guest. type MappedDirectory struct { - HostPath string `json:"HostPath,omitempty"` - - HostPathType string `json:"HostPathType,omitempty"` - + // Path in the host that is going to be mapped into the compute system. + HostPath string `json:"HostPath,omitempty"` + HostPathType *PathType `json:"HostPathType,omitempty"` + // Path relative to the compute system's guest. This is the resulting path from mapping the host path. ContainerPath string `json:"ContainerPath,omitempty"` - + // When set to true, the mapped directory in the compute system's guest will be read-only. ReadOnly bool `json:"ReadOnly,omitempty"` + // When set to true, the mapped directory in the compute system's guest will support cloud files. + SupportCloudFiles bool `json:"SupportCloudFiles,omitempty"` } diff --git a/internal/hcs/schema2/mapped_pipe.go b/internal/hcs/schema2/mapped_pipe.go index 208074e9a2..7986607608 100644 --- a/internal/hcs/schema2/mapped_pipe.go +++ b/internal/hcs/schema2/mapped_pipe.go @@ -1,18 +1,23 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema +// Object that describes a named pipe that is requested to be mapped into a compute system's guest. type MappedPipe struct { + // The resulting named pipe that will be accessible in the compute system's guest. ContainerPipeName string `json:"ContainerPipeName,omitempty"` - - HostPath string `json:"HostPath,omitempty"` - - HostPathType string `json:"HostPathType,omitempty"` + // The named pipe path in the host that will be mapped into a compute system's guest. + HostPath string `json:"HostPath,omitempty"` + HostPathType *MappedPipePathType `json:"HostPathType,omitempty"` } diff --git a/internal/hcs/schema2/mapped_pipe_path_type.go b/internal/hcs/schema2/mapped_pipe_path_type.go new file mode 100644 index 0000000000..182092ba40 --- /dev/null +++ b/internal/hcs/schema2/mapped_pipe_path_type.go @@ -0,0 +1,22 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type MappedPipePathType string + +// List of MappedPipePathType +const ( + MappedPipePathType_ABSOLUTE_PATH MappedPipePathType = "AbsolutePath" + MappedPipePathType_VIRTUAL_SMB_PIPE_NAME MappedPipePathType = "VirtualSmbPipeName" +) diff --git a/internal/hcs/schema2/mapped_virtual_disk.go b/internal/hcs/schema2/mapped_virtual_disk.go new file mode 100644 index 0000000000..35769a455a --- /dev/null +++ b/internal/hcs/schema2/mapped_virtual_disk.go @@ -0,0 +1,21 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type MappedVirtualDisk struct { + ContainerPath string `json:"ContainerPath,omitempty"` + Lun uint8 `json:"Lun,omitempty"` + // If `true` then delete `ContainerPath` if it exists. + OverwriteIfExists bool `json:"OverwriteIfExists,omitempty"` +} diff --git a/internal/hcs/schema2/mapped_virtual_p_mem_device.go b/internal/hcs/schema2/mapped_virtual_p_mem_device.go new file mode 100644 index 0000000000..6621a9dac0 --- /dev/null +++ b/internal/hcs/schema2/mapped_virtual_p_mem_device.go @@ -0,0 +1,19 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type MappedVirtualPMemDevice struct { + DeviceNumber uint32 `json:"DeviceNumber,omitempty"` + MountPath string `json:"MountPath,omitempty"` +} diff --git a/internal/hcs/schema2/memory.go b/internal/hcs/schema2/memory.go deleted file mode 100644 index 30749c6724..0000000000 --- a/internal/hcs/schema2/memory.go +++ /dev/null @@ -1,14 +0,0 @@ -/* - * HCS API - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * API version: 2.1 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package hcsschema - -type Memory struct { - SizeInMB uint64 `json:"SizeInMB,omitempty"` -} diff --git a/internal/hcs/schema2/memory_2.go b/internal/hcs/schema2/memory_2.go deleted file mode 100644 index 71224c75b9..0000000000 --- a/internal/hcs/schema2/memory_2.go +++ /dev/null @@ -1,49 +0,0 @@ -/* - * HCS API - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * API version: 2.1 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package hcsschema - -type Memory2 struct { - SizeInMB uint64 `json:"SizeInMB,omitempty"` - - AllowOvercommit bool `json:"AllowOvercommit,omitempty"` - - EnableHotHint bool `json:"EnableHotHint,omitempty"` - - EnableColdHint bool `json:"EnableColdHint,omitempty"` - - EnableEpf bool `json:"EnableEpf,omitempty"` - - // EnableDeferredCommit is private in the schema. If regenerated need to add back. - EnableDeferredCommit bool `json:"EnableDeferredCommit,omitempty"` - - // EnableColdDiscardHint if enabled, then the memory cold discard hint feature is exposed - // to the VM, allowing it to trim non-zeroed pages from the working set (if supported by - // the guest operating system). - EnableColdDiscardHint bool `json:"EnableColdDiscardHint,omitempty"` - - // LowMmioGapInMB is the low MMIO region allocated below 4GB. - // - // TODO: This is pre-release support in schema 2.3. Need to add build number - // docs when a public build with this is out. - LowMMIOGapInMB uint64 `json:"LowMmioGapInMB,omitempty"` - - // HighMmioBaseInMB is the high MMIO region allocated above 4GB (base and - // size). - // - // TODO: This is pre-release support in schema 2.3. Need to add build number - // docs when a public build with this is out. - HighMMIOBaseInMB uint64 `json:"HighMmioBaseInMB,omitempty"` - - // HighMmioGapInMB is the high MMIO region. - // - // TODO: This is pre-release support in schema 2.3. Need to add build number - // docs when a public build with this is out. - HighMMIOGapInMB uint64 `json:"HighMmioGapInMB,omitempty"` -} diff --git a/internal/hcs/schema2/memory_backing_page_size.go b/internal/hcs/schema2/memory_backing_page_size.go new file mode 100644 index 0000000000..bcaea3d97e --- /dev/null +++ b/internal/hcs/schema2/memory_backing_page_size.go @@ -0,0 +1,22 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type MemoryBackingPageSize string + +// List of MemoryBackingPageSize +const ( + MemoryBackingPageSize_SMALL MemoryBackingPageSize = "Small" + MemoryBackingPageSize_LARGE MemoryBackingPageSize = "Large" +) diff --git a/internal/hcs/schema2/memory_backing_type.go b/internal/hcs/schema2/memory_backing_type.go new file mode 100644 index 0000000000..6d6e33e4aa --- /dev/null +++ b/internal/hcs/schema2/memory_backing_type.go @@ -0,0 +1,22 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type MemoryBackingType string + +// List of MemoryBackingType +const ( + MemoryBackingType_PHYSICAL MemoryBackingType = "Physical" + MemoryBackingType_VIRTUAL MemoryBackingType = "Virtual" +) diff --git a/internal/hcs/schema2/memory_balancer_info.go b/internal/hcs/schema2/memory_balancer_info.go new file mode 100644 index 0000000000..76c06ae82e --- /dev/null +++ b/internal/hcs/schema2/memory_balancer_info.go @@ -0,0 +1,21 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type MemoryBalancerInfo struct { + // Currently available physical memory with this balancer instance. + AvailableMemoryInPages uint64 `json:"AvailableMemoryInPages,omitempty"` + // Host available memory with this balancer instance after accounting for pages freed due to applying pressure. + AvailableMemoryForStartingVmsInPages uint64 `json:"AvailableMemoryForStartingVmsInPages,omitempty"` +} diff --git a/internal/hcs/schema2/memory_balancing_enable_operation.go b/internal/hcs/schema2/memory_balancing_enable_operation.go new file mode 100644 index 0000000000..f85cd66d50 --- /dev/null +++ b/internal/hcs/schema2/memory_balancing_enable_operation.go @@ -0,0 +1,18 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type MemoryBalancingEnableOperation struct { + EnableMemoryBalancing bool `json:"EnableMemoryBalancing,omitempty"` +} diff --git a/internal/hcs/schema2/memory_bw_allocation_system_info.go b/internal/hcs/schema2/memory_bw_allocation_system_info.go new file mode 100644 index 0000000000..204bced946 --- /dev/null +++ b/internal/hcs/schema2/memory_bw_allocation_system_info.go @@ -0,0 +1,23 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// Structure to return processor L3 cache memory bandwidth allocation settings for a Service property query. +type MemoryBwAllocationSystemInfo struct { + MbaSupported bool `json:"MbaSupported,omitempty"` + MbaLinear bool `json:"MbaLinear,omitempty"` + MaxMbaCos uint32 `json:"MaxMbaCos,omitempty"` + MaxMbaThrottleValue uint32 `json:"MaxMbaThrottleValue,omitempty"` + MbaCosSlots []int64 `json:"MbaCosSlots,omitempty"` +} diff --git a/internal/hcs/schema2/memory_information_for_host.go b/internal/hcs/schema2/memory_information_for_host.go new file mode 100644 index 0000000000..85192240be --- /dev/null +++ b/internal/hcs/schema2/memory_information_for_host.go @@ -0,0 +1,24 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type MemoryInformationForHost struct { + // Number of physical NUMA nodes on the host. + NumaNodeCount uint8 `json:"NumaNodeCount,omitempty"` + HostMemoryInformation *HostMemory `json:"HostMemoryInformation,omitempty"` + // Physical NUMA node specific information (see NumaNodeMemory). + NumaNodes []NumaNodeMemory `json:"NumaNodes,omitempty"` + // Memory balancer specific information (see MemoryBalancerInfo). + Balancers []MemoryBalancerInfo `json:"Balancers,omitempty"` +} diff --git a/internal/hcs/schema2/memory_information_for_vm.go b/internal/hcs/schema2/memory_information_for_vm.go index 811779b04b..77b1f2c59c 100644 --- a/internal/hcs/schema2/memory_information_for_vm.go +++ b/internal/hcs/schema2/memory_information_for_vm.go @@ -1,18 +1,21 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema +// The response of memory information for virtual machine when query memory propery of compute system type MemoryInformationForVm struct { - VirtualNodeCount uint32 `json:"VirtualNodeCount,omitempty"` - - VirtualMachineMemory *VmMemory `json:"VirtualMachineMemory,omitempty"` - - VirtualNodes []VirtualNodeInfo `json:"VirtualNodes,omitempty"` + VirtualNodeCount uint8 `json:"VirtualNodeCount,omitempty"` + VirtualMachineMemory *VmMemory `json:"VirtualMachineMemory,omitempty"` + VirtualNodes []VirtualNodeInfo `json:"VirtualNodes,omitempty"` } diff --git a/internal/hcs/schema2/memory_io_space_conversion_operation.go b/internal/hcs/schema2/memory_io_space_conversion_operation.go new file mode 100644 index 0000000000..baf2b1c79a --- /dev/null +++ b/internal/hcs/schema2/memory_io_space_conversion_operation.go @@ -0,0 +1,21 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type MemoryIOSpaceConversionOperation struct { + NumaNodeIndex uint8 `json:"NumaNodeIndex,omitempty"` + Promote bool `json:"Promote,omitempty"` + AnyNodeOkay bool `json:"AnyNodeOkay,omitempty"` + BadPagesOnly bool `json:"BadPagesOnly,omitempty"` +} diff --git a/internal/hcs/schema2/memory_reserve_page_size.go b/internal/hcs/schema2/memory_reserve_page_size.go new file mode 100644 index 0000000000..7d62ad789a --- /dev/null +++ b/internal/hcs/schema2/memory_reserve_page_size.go @@ -0,0 +1,25 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type MemoryReservePageSize string + +// List of MemoryReservePageSize +const ( + MemoryReservePageSize_NO_PREFERENCE MemoryReservePageSize = "NoPreference" + MemoryReservePageSize_HUGE_PAGES_ONLY MemoryReservePageSize = "HugePagesOnly" + MemoryReservePageSize_FAST_PAGES_ONLY MemoryReservePageSize = "FastPagesOnly" + MemoryReservePageSize_FAST_HUGE_PAGES_ONLY MemoryReservePageSize = "FastHugePagesOnly" + MemoryReservePageSize_ANY_PAGES_OKAY MemoryReservePageSize = "AnyPagesOkay" +) diff --git a/internal/hcs/schema2/memory_reserve_resize_operation.go b/internal/hcs/schema2/memory_reserve_resize_operation.go new file mode 100644 index 0000000000..4ed698f0ed --- /dev/null +++ b/internal/hcs/schema2/memory_reserve_resize_operation.go @@ -0,0 +1,24 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type MemoryReserveResizeOperation struct { + NumaNodeIndex uint8 `json:"NumaNodeIndex,omitempty"` + PageCount uint64 `json:"PageCount,omitempty"` + PageSize *MemoryReservePageSize `json:"PageSize,omitempty"` + AnyNodeOkay bool `json:"AnyNodeOkay,omitempty"` + // Only returns pages with addresses higher than 4 GB. + Above4Gb bool `json:"Above4Gb,omitempty"` + DemoteOnMove bool `json:"DemoteOnMove,omitempty"` +} diff --git a/internal/hcs/schema2/memory_reserve_target.go b/internal/hcs/schema2/memory_reserve_target.go new file mode 100644 index 0000000000..5d580e4b38 --- /dev/null +++ b/internal/hcs/schema2/memory_reserve_target.go @@ -0,0 +1,18 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type MemoryReserveTarget struct { + MemoryReserveTargetInMbArray []int64 `json:"MemoryReserveTargetInMbArray,omitempty"` +} diff --git a/internal/hcs/schema2/memory_reserve_target_operation.go b/internal/hcs/schema2/memory_reserve_target_operation.go new file mode 100644 index 0000000000..838594fb02 --- /dev/null +++ b/internal/hcs/schema2/memory_reserve_target_operation.go @@ -0,0 +1,19 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type MemoryReserveTargetOperation struct { + MemoryReserveName string `json:"MemoryReserveName,omitempty"` + MemoryReserveTargetInMbArray []int64 `json:"MemoryReserveTargetInMbArray,omitempty"` +} diff --git a/internal/hcs/schema2/memory_reserve_target_query_operation.go b/internal/hcs/schema2/memory_reserve_target_query_operation.go new file mode 100644 index 0000000000..ce6be5e1b5 --- /dev/null +++ b/internal/hcs/schema2/memory_reserve_target_query_operation.go @@ -0,0 +1,18 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type MemoryReserveTargetQueryOperation struct { + MemoryReserveName string `json:"MemoryReserveName,omitempty"` +} diff --git a/internal/hcs/schema2/memory_stats.go b/internal/hcs/schema2/memory_stats.go index 906ba597f9..f994101c1d 100644 --- a/internal/hcs/schema2/memory_stats.go +++ b/internal/hcs/schema2/memory_stats.go @@ -1,19 +1,21 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema -// Memory runtime statistics +// Memory runtime statistics type MemoryStats struct { - MemoryUsageCommitBytes uint64 `json:"MemoryUsageCommitBytes,omitempty"` - - MemoryUsageCommitPeakBytes uint64 `json:"MemoryUsageCommitPeakBytes,omitempty"` - + MemoryUsageCommitBytes uint64 `json:"MemoryUsageCommitBytes,omitempty"` + MemoryUsageCommitPeakBytes uint64 `json:"MemoryUsageCommitPeakBytes,omitempty"` MemoryUsagePrivateWorkingSetBytes uint64 `json:"MemoryUsagePrivateWorkingSetBytes,omitempty"` } diff --git a/internal/hcs/schema2/metering_port_acl.go b/internal/hcs/schema2/metering_port_acl.go new file mode 100644 index 0000000000..e5e36317da --- /dev/null +++ b/internal/hcs/schema2/metering_port_acl.go @@ -0,0 +1,27 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// A port ACL (access control list) that expresses a rule for measuring network traffic based on IP address range and direction. +type MeteringPortAcl struct { + Disposition *FeatureSettingDisposition `json:"Disposition,omitempty"` + // Whether to measure inbound network traffic, as opposed to outbound. + IsInbound bool `json:"IsInbound,omitempty"` + // The range of IP addresses over which to measure the traffic. + IPAddressRange string `json:"IPAddressRange,omitempty"` + // The unique identifier for this port ACL instance. + // + // Pattern: /^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/ + InstanceID string `json:"InstanceId,omitempty"` +} diff --git a/internal/hcs/schema2/model_object_directory.go b/internal/hcs/schema2/model_object_directory.go deleted file mode 100644 index d2f51b3b53..0000000000 --- a/internal/hcs/schema2/model_object_directory.go +++ /dev/null @@ -1,18 +0,0 @@ -/* - * HCS API - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * API version: 2.4 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package hcsschema - -type ObjectDirectory struct { - Name string `json:"name,omitempty"` - Clonesd string `json:"clonesd,omitempty"` - Shadow string `json:"shadow,omitempty"` - Symlink []ObjectSymlink `json:"symlink,omitempty"` - Objdir []ObjectDirectory `json:"objdir,omitempty"` -} diff --git a/internal/hcs/schema2/model_object_namespace.go b/internal/hcs/schema2/model_object_namespace.go deleted file mode 100644 index 47dfb55bfa..0000000000 --- a/internal/hcs/schema2/model_object_namespace.go +++ /dev/null @@ -1,16 +0,0 @@ -/* - * HCS API - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * API version: 2.4 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package hcsschema - -type ObjectNamespace struct { - Shadow string `json:"shadow,omitempty"` - Symlink []ObjectSymlink `json:"symlink,omitempty"` - Objdir []ObjectDirectory `json:"objdir,omitempty"` -} diff --git a/internal/hcs/schema2/model_object_symlink.go b/internal/hcs/schema2/model_object_symlink.go deleted file mode 100644 index 8867ebe5f0..0000000000 --- a/internal/hcs/schema2/model_object_symlink.go +++ /dev/null @@ -1,18 +0,0 @@ -/* - * HCS API - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * API version: 2.4 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package hcsschema - -type ObjectSymlink struct { - Name string `json:"name,omitempty"` - Path string `json:"path,omitempty"` - Scope string `json:"scope,omitempty"` - Pathtoclone string `json:"pathtoclone,omitempty"` - AccessMask int32 `json:"access_mask,omitempty"` -} diff --git a/internal/hcs/schema2/modification_request.go b/internal/hcs/schema2/modification_request.go index 1384ed8882..67630b3a92 100644 --- a/internal/hcs/schema2/modification_request.go +++ b/internal/hcs/schema2/modification_request.go @@ -1,5 +1,9 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * @@ -9,7 +13,13 @@ package hcsschema +import ( + "encoding/json" +) + +// Structure used for service level modification request. Right now, we support modification of a single property type in a call. type ModificationRequest struct { - PropertyType PropertyType `json:"PropertyType,omitempty"` - Settings interface{} `json:"Settings,omitempty"` + PropertyType *ModifyPropertyType `json:"PropertyType,omitempty"` + // Settings to the modification request + Settings *json.RawMessage `json:"Settings,omitempty"` } diff --git a/internal/hcs/schema2/modification_request_extra.go b/internal/hcs/schema2/modification_request_extra.go new file mode 100644 index 0000000000..8c9050ef39 --- /dev/null +++ b/internal/hcs/schema2/modification_request_extra.go @@ -0,0 +1,35 @@ +package hcsschema + +import "fmt" + +// NewModificationRequest creates a new [ModificationRequest] with the provided settings to +// use with the [HcsModifyServiceSettings] HCS API call. +// +// [HcsModifyServiceSettings]: https://learn.microsoft.com/en-us/virtualization/api/hcs/reference/hcsmodifyservicesettings +func NewModificationRequest(pt ModifyPropertyType, settings any) (ModificationRequest, error) { + switch pt { + case ModifyPropertyType_CPU_GROUP: + if _, ok := settings.(HostProcessorModificationRequest); !ok { + return ModificationRequest{}, + fmt.Errorf("ModifyPropertyType %s requires settings type 'HostProcessorModificationRequest': received %T", pt, settings) + } + case ModifyPropertyType_CONTAINER_CREDENTIAL_GUARD: + if _, ok := settings.(ContainerCredentialGuardOperationRequest); !ok { + return ModificationRequest{}, + fmt.Errorf("ModifyPropertyType %s requires settings type 'ContainerCredentialGuardOperationRequest': received %T", pt, settings) + } + default: + return ModificationRequest{}, fmt.Errorf("unsupported ModifyPropertyType: %s", pt) + } + + s, err := ToRawMessage(settings) + if err != nil { + return ModificationRequest{}, + fmt.Errorf("encode %s modification settings (%+v) to json: %w", string(pt), settings, err) + } + + return ModificationRequest{ + PropertyType: &pt, + Settings: s, + }, nil +} diff --git a/internal/hcs/schema2/modify_operation.go b/internal/hcs/schema2/modify_operation.go new file mode 100644 index 0000000000..0e70b3bbd7 --- /dev/null +++ b/internal/hcs/schema2/modify_operation.go @@ -0,0 +1,22 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type ModifyOperation string + +// List of ModifyOperation +const ( + ModifyOperation_CONSOLE_SIZE ModifyOperation = "ConsoleSize" + ModifyOperation_CLOSE_HANDLE ModifyOperation = "CloseHandle" +) diff --git a/internal/hcs/schema2/modify_property_type.go b/internal/hcs/schema2/modify_property_type.go new file mode 100644 index 0000000000..d7700073af --- /dev/null +++ b/internal/hcs/schema2/modify_property_type.go @@ -0,0 +1,27 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// ModifyPropertyType : Service property type modified by HcsModifyServiceSettings +type ModifyPropertyType string + +// List of ModifyPropertyType +const ( + ModifyPropertyType_MEMORY ModifyPropertyType = "Memory" + ModifyPropertyType_CPU_GROUP ModifyPropertyType = "CpuGroup" + ModifyPropertyType_CACHE_ALLOCATION ModifyPropertyType = "CacheAllocation" + ModifyPropertyType_CACHE_MONITORING ModifyPropertyType = "CacheMonitoring" + ModifyPropertyType_CONTAINER_CREDENTIAL_GUARD ModifyPropertyType = "ContainerCredentialGuard" + ModifyPropertyType_MEMORY_BW_ALLOCATION ModifyPropertyType = "MemoryBwAllocation" +) diff --git a/internal/hcs/schema2/modify_request_type.go b/internal/hcs/schema2/modify_request_type.go new file mode 100644 index 0000000000..53ae96d6f8 --- /dev/null +++ b/internal/hcs/schema2/modify_request_type.go @@ -0,0 +1,23 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type ModifyRequestType string + +// List of ModifyRequestType +const ( + ModifyRequestType_ADD ModifyRequestType = "Add" + ModifyRequestType_REMOVE ModifyRequestType = "Remove" + ModifyRequestType_UPDATE ModifyRequestType = "Update" +) diff --git a/internal/hcs/schema2/modify_resource_type.go b/internal/hcs/schema2/modify_resource_type.go new file mode 100644 index 0000000000..1de0d8511a --- /dev/null +++ b/internal/hcs/schema2/modify_resource_type.go @@ -0,0 +1,36 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type ModifyResourceType string + +// List of ModifyResourceType +const ( + ModifyResourceType_NETWORK ModifyResourceType = "Network" + ModifyResourceType_CPU_GROUP ModifyResourceType = "CpuGroup" + ModifyResourceType_V_SMB_SHARE ModifyResourceType = "VSmbShare" + ModifyResourceType_PLAN9_SHARE ModifyResourceType = "Plan9Share" + ModifyResourceType_HV_SOCKET ModifyResourceType = "HvSocket" + ModifyResourceType_SHARED_MEMORY_REGION ModifyResourceType = "SharedMemoryRegion" + ModifyResourceType_VP_MEM_DEVICE ModifyResourceType = "VPMemDevice" + ModifyResourceType_GPU ModifyResourceType = "Gpu" + ModifyResourceType_LICENSING ModifyResourceType = "Licensing" + ModifyResourceType_MEMORY ModifyResourceType = "Memory" + ModifyResourceType_MAPPED_DIRECTORY ModifyResourceType = "MappedDirectory" + ModifyResourceType_MAPPED_PIPE ModifyResourceType = "MappedPipe" + ModifyResourceType_MAPPED_VIRTUAL_DISK ModifyResourceType = "MappedVirtualDisk" + ModifyResourceType_COMBINED_LAYERS ModifyResourceType = "CombinedLayers" + ModifyResourceType_NETWORK_NAMESPACE ModifyResourceType = "NetworkNamespace" + ModifyResourceType_CIM_MOUNT ModifyResourceType = "CimMount" +) diff --git a/internal/hcs/schema2/modify_service_operation.go b/internal/hcs/schema2/modify_service_operation.go new file mode 100644 index 0000000000..ebbee1b7fb --- /dev/null +++ b/internal/hcs/schema2/modify_service_operation.go @@ -0,0 +1,24 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// ModifyServiceOperation : Enumeration of different supported service processor modification requests +type ModifyServiceOperation string + +// List of ModifyServiceOperation +const ( + ModifyServiceOperation_CREATE_GROUP ModifyServiceOperation = "CreateGroup" + ModifyServiceOperation_DELETE_GROUP ModifyServiceOperation = "DeleteGroup" + ModifyServiceOperation_SET_PROPERTY ModifyServiceOperation = "SetProperty" +) diff --git a/internal/hcs/schema2/modify_setting_request.go b/internal/hcs/schema2/modify_setting_request.go index 6364da8e23..8385cd0ce9 100644 --- a/internal/hcs/schema2/modify_setting_request.go +++ b/internal/hcs/schema2/modify_setting_request.go @@ -1,22 +1,25 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema -import "github.com/Microsoft/hcsshim/internal/protocol/guestrequest" +import ( + "encoding/json" +) type ModifySettingRequest struct { - ResourcePath string `json:"ResourcePath,omitempty"` - - RequestType guestrequest.RequestType `json:"RequestType,omitempty"` // NOTE: Swagger generated as string. Locally updated. - - Settings interface{} `json:"Settings,omitempty"` // NOTE: Swagger generated as *interface{}. Locally updated - - GuestRequest interface{} `json:"GuestRequest,omitempty"` // NOTE: Swagger generated as *interface{}. Locally updated + ResourcePath string `json:"ResourcePath,omitempty"` + RequestType *ModifyRequestType `json:"RequestType,omitempty"` + Settings *json.RawMessage `json:"Settings,omitempty"` + GuestRequest *json.RawMessage `json:"GuestRequest,omitempty"` } diff --git a/internal/hcs/schema2/modify_setting_request_extra.go b/internal/hcs/schema2/modify_setting_request_extra.go new file mode 100644 index 0000000000..7c459ae51c --- /dev/null +++ b/internal/hcs/schema2/modify_setting_request_extra.go @@ -0,0 +1,56 @@ +package hcsschema + +import "fmt" + +// NewModifySettingRequest creates a [ModifySettingRequest] with the provided settings to use +// with the [HcsModifyComputeSystem] HCS API call. +// +// [HcsModifyComputeSystem]: https://learn.microsoft.com/en-us/virtualization/api/hcs/reference/hcsmodifycomputesystem +func NewModifySettingRequest( + path string, + reqType ModifyRequestType, + settings any, + guestRequest any, +) (ModifySettingRequest, error) { + switch reqType { + case ModifyRequestType_ADD, + ModifyRequestType_REMOVE, + ModifyRequestType_UPDATE: + default: + return ModifySettingRequest{}, fmt.Errorf("unsupported ModifyRequestType: %s", reqType) + } + + s, err := ToRawMessage(settings) + if err != nil { + return ModifySettingRequest{}, + fmt.Errorf("encode %s ModifySettingRequest settings (%+v) at path %q to json: %w", string(reqType), path, settings, err) + } + + gr, err := ToRawMessage(guestRequest) + if err != nil { + return ModifySettingRequest{}, + fmt.Errorf("encode ModifySettingRequest guest request (%+v) to json: %w", guestRequest, err) + } + + return ModifySettingRequest{ + ResourcePath: path, + RequestType: &reqType, + Settings: s, + GuestRequest: gr, + }, nil +} + +// NewModifySettingGuestRequest creates a [ModifySettingRequest] with the provided guestRequest. +func NewModifySettingGuestRequest(guestRequest any) (ModifySettingRequest, error) { + gr, err := ToRawMessage(guestRequest) + if err != nil { + return ModifySettingRequest{}, + fmt.Errorf("encode ModifySettingRequest guest request (%+v) to json: %w", guestRequest, err) + } + + return ModifySettingRequest{GuestRequest: gr}, nil +} + +func (r *ModifySettingRequest) ValidGuestRequest() bool { + return r != nil && r.GuestRequest != nil || len(*r.GuestRequest) > 0 +} diff --git a/internal/hcs/schema2/mount.go b/internal/hcs/schema2/mount.go new file mode 100644 index 0000000000..917a82cfe0 --- /dev/null +++ b/internal/hcs/schema2/mount.go @@ -0,0 +1,21 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type Mount struct { + Destination string `json:"destination,omitempty"` + Type_ string `json:"type,omitempty"` + Source string `json:"source,omitempty"` + Options []string `json:"options,omitempty"` +} diff --git a/internal/hcs/schema2/mount_manager_mount_point.go b/internal/hcs/schema2/mount_manager_mount_point.go new file mode 100644 index 0000000000..41e35ba862 --- /dev/null +++ b/internal/hcs/schema2/mount_manager_mount_point.go @@ -0,0 +1,19 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type MountManagerMountPoint struct { + Name string `json:"name,omitempty"` + Path string `json:"path,omitempty"` +} diff --git a/internal/hcs/schema2/mount_manager_namespace.go b/internal/hcs/schema2/mount_manager_namespace.go new file mode 100644 index 0000000000..8c5760cb2e --- /dev/null +++ b/internal/hcs/schema2/mount_manager_namespace.go @@ -0,0 +1,18 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type MountManagerNamespace struct { + MountPoint []MountManagerMountPoint `json:"mount_point,omitempty"` +} diff --git a/internal/hcs/schema2/mouse.go b/internal/hcs/schema2/mouse.go index ccf8b938f3..4bd6734112 100644 --- a/internal/hcs/schema2/mouse.go +++ b/internal/hcs/schema2/mouse.go @@ -1,9 +1,13 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ diff --git a/internal/hcs/schema2/named_pipe_namespace.go b/internal/hcs/schema2/named_pipe_namespace.go new file mode 100644 index 0000000000..50d44b6b0f --- /dev/null +++ b/internal/hcs/schema2/named_pipe_namespace.go @@ -0,0 +1,18 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type NamedPipeNamespace struct { + Symlink []NamedPipeSymlink `json:"symlink,omitempty"` +} diff --git a/internal/hcs/schema2/named_pipe_symlink.go b/internal/hcs/schema2/named_pipe_symlink.go new file mode 100644 index 0000000000..33b8e9702f --- /dev/null +++ b/internal/hcs/schema2/named_pipe_symlink.go @@ -0,0 +1,19 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type NamedPipeSymlink struct { + Name string `json:"name,omitempty"` + Path string `json:"path,omitempty"` +} diff --git a/internal/hcs/schema2/namespace.go b/internal/hcs/schema2/namespace.go new file mode 100644 index 0000000000..1477bb679a --- /dev/null +++ b/internal/hcs/schema2/namespace.go @@ -0,0 +1,26 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type Namespace struct { + Job *JobNamespace `json:"job,omitempty"` + Filesystem *FilesystemNamespace `json:"filesystem,omitempty"` + Mountmgr *MountManagerNamespace `json:"mountmgr,omitempty"` + Namedpipe *NamedPipeNamespace `json:"namedpipe,omitempty"` + Ob *ObjectNamespace `json:"ob,omitempty"` + Registry *RegistryNamespace `json:"registry,omitempty"` + Network *NetworkNamespace `json:"network,omitempty"` + Device *DeviceNamespace `json:"device,omitempty"` + Hostfiles *HostFiles `json:"hostfiles,omitempty"` +} diff --git a/internal/hcs/schema2/network_adapter.go b/internal/hcs/schema2/network_adapter.go index 7408abd317..98704c2b1c 100644 --- a/internal/hcs/schema2/network_adapter.go +++ b/internal/hcs/schema2/network_adapter.go @@ -1,17 +1,44 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema type NetworkAdapter struct { - EndpointId string `json:"EndpointId,omitempty"` + // Pattern: /^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/ + EndpointID string `json:"EndpointId,omitempty"` MacAddress string `json:"MacAddress,omitempty"` - // The I/O virtualization (IOV) offloading configuration. - IovSettings *IovSettings `json:"IovSettings,omitempty"` + MediaType uint32 `json:"MediaType,omitempty"` + // Pattern: /^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/ + InstanceID string `json:"InstanceId,omitempty"` + // Disable interrupt batching (MNF) for network to decrease latency and increase throughput, at per-interrupt processing cost. + DisableInterruptBatching bool `json:"DisableInterruptBatching,omitempty"` + IOVSettings *IOVSettings `json:"IovSettings,omitempty"` + ConnectionState *StateOverride `json:"ConnectionState,omitempty"` + NetworkAdapterType *NetworkAdapterType `json:"NetworkAdapterType,omitempty"` + // Identification of the connected switch + // + // Pattern: /^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/ + SwitchID string `json:"SwitchId,omitempty"` + // Identification of the connected port that is part of the switch + // + // Pattern: /^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/ + PortID string `json:"PortId,omitempty"` + // Name of the switch + SwitchName string `json:"SwitchName,omitempty"` + // Whether the switch port used by this network adapter is configured to persist across reboots, used to support legacy scenarios. Persistent ports are heavier-weight than transient ports, which are cleaned up on host exit. + UsePersistentPort bool `json:"UsePersistentPort,omitempty"` + // The resource pool ID associated with this network adapter, used to report network metrics aggregated by that resource pool. + ResourcePoolID string `json:"ResourcePoolId,omitempty"` + // The metering port ACLs that describe what network traffic will be measured for this connection. + MeteringAcls []MeteringPortAcl `json:"MeteringAcls,omitempty"` } diff --git a/internal/hcs/schema2/network_adapter_type.go b/internal/hcs/schema2/network_adapter_type.go new file mode 100644 index 0000000000..cbb9a6a133 --- /dev/null +++ b/internal/hcs/schema2/network_adapter_type.go @@ -0,0 +1,23 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// NetworkAdapterType : Type of the network adapter +type NetworkAdapterType string + +// List of NetworkAdapterType +const ( + NetworkAdapterType_SYNTHETIC NetworkAdapterType = "Synthetic" + NetworkAdapterType_EMULATED NetworkAdapterType = "Emulated" +) diff --git a/internal/hcs/schema2/network_modify_request_type.go b/internal/hcs/schema2/network_modify_request_type.go new file mode 100644 index 0000000000..c485ee35cf --- /dev/null +++ b/internal/hcs/schema2/network_modify_request_type.go @@ -0,0 +1,24 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// NetworkModifyRequestType : The modify request type when ResourceType is Network in GuestModifySettingRequest +type NetworkModifyRequestType string + +// List of NetworkModifyRequestType +const ( + NetworkModifyRequestType_PRE_ADD NetworkModifyRequestType = "PreAdd" + NetworkModifyRequestType_ADD NetworkModifyRequestType = "Add" + NetworkModifyRequestType_REMOVE NetworkModifyRequestType = "Remove" +) diff --git a/internal/hcs/schema2/network_modify_setting_request.go b/internal/hcs/schema2/network_modify_setting_request.go new file mode 100644 index 0000000000..8d924290fd --- /dev/null +++ b/internal/hcs/schema2/network_modify_setting_request.go @@ -0,0 +1,25 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +import ( + "encoding/json" +) + +// The modify setting request when ResourceType is Network in GuestModifySettingRequest +type NetworkModifySettingRequest struct { + RequestType *NetworkModifyRequestType `json:"RequestType,omitempty"` + AdapterID string `json:"AdapterId,omitempty"` + Settings *json.RawMessage `json:"Settings,omitempty"` +} diff --git a/internal/hcs/schema2/network_namespace.go b/internal/hcs/schema2/network_namespace.go new file mode 100644 index 0000000000..ed31aebef1 --- /dev/null +++ b/internal/hcs/schema2/network_namespace.go @@ -0,0 +1,18 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type NetworkNamespace struct { + Compartment string `json:"compartment,omitempty"` +} diff --git a/internal/hcs/schema2/network_property.go b/internal/hcs/schema2/network_property.go new file mode 100644 index 0000000000..1bc018818e --- /dev/null +++ b/internal/hcs/schema2/network_property.go @@ -0,0 +1,18 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type NetworkProperty struct { + MacAddress string `json:"MacAddress,omitempty"` +} diff --git a/internal/hcs/schema2/cpu_group_operations.go b/internal/hcs/schema2/network_property_2.go similarity index 50% rename from internal/hcs/schema2/cpu_group_operations.go rename to internal/hcs/schema2/network_property_2.go index 7d89780701..95514c08dd 100644 --- a/internal/hcs/schema2/cpu_group_operations.go +++ b/internal/hcs/schema2/network_property_2.go @@ -1,5 +1,9 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * @@ -9,10 +13,9 @@ package hcsschema -type CPUGroupOperation string +type NetworkProperty2 string +// List of NetworkProperty_2 const ( - CreateGroup CPUGroupOperation = "CreateGroup" - DeleteGroup CPUGroupOperation = "DeleteGroup" - SetProperty CPUGroupOperation = "SetProperty" + NetworkProperty2_MAC_ADDRESS NetworkProperty2 = "MacAddress" ) diff --git a/internal/hcs/schema2/network_property_query.go b/internal/hcs/schema2/network_property_query.go new file mode 100644 index 0000000000..d9eae0f798 --- /dev/null +++ b/internal/hcs/schema2/network_property_query.go @@ -0,0 +1,21 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type NetworkPropertyQuery struct { + // The list of properties to be queried for + NetworkProperties []NetworkProperty2 `json:"NetworkProperties,omitempty"` + // The map of the name of the network adapters and the type of the network adapter + NetworkAdapterNames map[string]NetworkAdapterType `json:"NetworkAdapterNames,omitempty"` +} diff --git a/internal/hcs/schema2/networking.go b/internal/hcs/schema2/networking.go index e5ea187a29..a4b2389ce6 100644 --- a/internal/hcs/schema2/networking.go +++ b/internal/hcs/schema2/networking.go @@ -1,23 +1,23 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema type Networking struct { - AllowUnqualifiedDnsQuery bool `json:"AllowUnqualifiedDnsQuery,omitempty"` - - DnsSearchList string `json:"DnsSearchList,omitempty"` - + AllowUnqualifiedDNSQuery bool `json:"AllowUnqualifiedDnsQuery,omitempty"` + DNSSearchList string `json:"DnsSearchList,omitempty"` NetworkSharedContainerName string `json:"NetworkSharedContainerName,omitempty"` - - // Guid in windows; string in linux - Namespace string `json:"Namespace,omitempty"` - + // Guid in windows; string in linux + Namespace string `json:"Namespace,omitempty"` NetworkAdapters []string `json:"NetworkAdapters,omitempty"` } diff --git a/internal/hcs/schema2/non_architectural_core_sharing.go b/internal/hcs/schema2/non_architectural_core_sharing.go new file mode 100644 index 0000000000..f3401ab025 --- /dev/null +++ b/internal/hcs/schema2/non_architectural_core_sharing.go @@ -0,0 +1,24 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// NonArchitecturalCoreSharing : Enum for non architecture core sharing +type NonArchitecturalCoreSharing string + +// List of NonArchitecturalCoreSharing +const ( + NonArchitecturalCoreSharing_UNREPORTED NonArchitecturalCoreSharing = "Unreported" + NonArchitecturalCoreSharing_OFF NonArchitecturalCoreSharing = "Off" + NonArchitecturalCoreSharing_ON NonArchitecturalCoreSharing = "On" +) diff --git a/internal/hcs/schema2/notification_type.go b/internal/hcs/schema2/notification_type.go new file mode 100644 index 0000000000..c9193d5dc0 --- /dev/null +++ b/internal/hcs/schema2/notification_type.go @@ -0,0 +1,26 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// NotificationType : Exit type of a compute system. +type NotificationType string + +// List of NotificationType +const ( + NotificationType_NONE NotificationType = "None" + NotificationType_GRACEFUL_EXIT NotificationType = "GracefulExit" + NotificationType_FORCED_EXIT NotificationType = "ForcedExit" + NotificationType_UNEXPECTED_EXIT NotificationType = "UnexpectedExit" + NotificationType_UNKNOWN NotificationType = "Unknown" +) diff --git a/internal/hcs/schema2/numa.go b/internal/hcs/schema2/numa.go new file mode 100644 index 0000000000..70978e9cc7 --- /dev/null +++ b/internal/hcs/schema2/numa.go @@ -0,0 +1,20 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type Numa struct { + VirtualNodeCount uint8 `json:"VirtualNodeCount,omitempty"` + PreferredPhysicalNodes []int64 `json:"PreferredPhysicalNodes,omitempty"` + Settings []NumaSetting `json:"Settings,omitempty"` +} diff --git a/internal/hcs/schema2/numa_node_memory.go b/internal/hcs/schema2/numa_node_memory.go new file mode 100644 index 0000000000..36fb54bcb9 --- /dev/null +++ b/internal/hcs/schema2/numa_node_memory.go @@ -0,0 +1,21 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type NumaNodeMemory struct { + // Total physical memory on on this physical NUMA node that is consumable by the VMs. + TotalConsumableMemoryInPages uint64 `json:"TotalConsumableMemoryInPages,omitempty"` + // Currently available physical memory on this physical NUMA node for the VMs. + AvailableMemoryInPages uint64 `json:"AvailableMemoryInPages,omitempty"` +} diff --git a/internal/hcs/schema2/numa_node_processor.go b/internal/hcs/schema2/numa_node_processor.go new file mode 100644 index 0000000000..692072e404 --- /dev/null +++ b/internal/hcs/schema2/numa_node_processor.go @@ -0,0 +1,19 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type NumaNodeProcessor struct { + TotalAssignedProcessors uint32 `json:"TotalAssignedProcessors,omitempty"` + TotalAvailableProcessors uint32 `json:"TotalAvailableProcessors,omitempty"` +} diff --git a/internal/hcs/schema2/numa_setting.go b/internal/hcs/schema2/numa_setting.go new file mode 100644 index 0000000000..204cd428d5 --- /dev/null +++ b/internal/hcs/schema2/numa_setting.go @@ -0,0 +1,22 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type NumaSetting struct { + VirtualNodeNumber uint32 `json:"VirtualNodeNumber,omitempty"` + PhysicalNodeNumber uint32 `json:"PhysicalNodeNumber,omitempty"` + VirtualSocketNumber uint32 `json:"VirtualSocketNumber,omitempty"` + CountOfProcessors uint32 `json:"CountOfProcessors,omitempty"` + CountOfMemoryBlocks uint64 `json:"CountOfMemoryBlocks,omitempty"` +} diff --git a/internal/hcs/schema2/object_directory.go b/internal/hcs/schema2/object_directory.go new file mode 100644 index 0000000000..107d45d442 --- /dev/null +++ b/internal/hcs/schema2/object_directory.go @@ -0,0 +1,22 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type ObjectDirectory struct { + Name string `json:"name,omitempty"` + Clonesd string `json:"clonesd,omitempty"` + Shadow *ObjectDirectoryShadow `json:"shadow,omitempty"` + Symlink []ObjectSymlink `json:"symlink,omitempty"` + Objdir []ObjectDirectory `json:"objdir,omitempty"` +} diff --git a/internal/hcs/schema2/object_directory_shadow.go b/internal/hcs/schema2/object_directory_shadow.go new file mode 100644 index 0000000000..ee24b81639 --- /dev/null +++ b/internal/hcs/schema2/object_directory_shadow.go @@ -0,0 +1,23 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type ObjectDirectoryShadow string + +// List of ObjectDirectoryShadow +const ( + ObjectDirectoryShadow_FALSE ObjectDirectoryShadow = "false" + ObjectDirectoryShadow_TRUE ObjectDirectoryShadow = "true" + ObjectDirectoryShadow_IFEXISTS ObjectDirectoryShadow = "ifexists" +) diff --git a/internal/hcs/schema2/object_namespace.go b/internal/hcs/schema2/object_namespace.go new file mode 100644 index 0000000000..ca59cbf525 --- /dev/null +++ b/internal/hcs/schema2/object_namespace.go @@ -0,0 +1,20 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type ObjectNamespace struct { + Shadow *ObjectDirectoryShadow `json:"shadow,omitempty"` + Symlink []ObjectSymlink `json:"symlink,omitempty"` + Objdir []ObjectDirectory `json:"objdir,omitempty"` +} diff --git a/internal/hcs/schema2/object_symlink.go b/internal/hcs/schema2/object_symlink.go new file mode 100644 index 0000000000..417e83cd26 --- /dev/null +++ b/internal/hcs/schema2/object_symlink.go @@ -0,0 +1,22 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type ObjectSymlink struct { + Name string `json:"name,omitempty"` + Path string `json:"path,omitempty"` + Scope *ObjectSymlinkScope `json:"scope,omitempty"` + Pathtoclone string `json:"pathtoclone,omitempty"` + AccessMask uint32 `json:"access_mask,omitempty"` +} diff --git a/internal/hcs/schema2/object_symlink_scope.go b/internal/hcs/schema2/object_symlink_scope.go new file mode 100644 index 0000000000..926b9d4cc9 --- /dev/null +++ b/internal/hcs/schema2/object_symlink_scope.go @@ -0,0 +1,23 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type ObjectSymlinkScope string + +// List of ObjectSymlinkScope +const ( + ObjectSymlinkScope_LOCAL ObjectSymlinkScope = "Local" + ObjectSymlinkScope_GLOBAL ObjectSymlinkScope = "Global" + ObjectSymlinkScope_GLOBAL_DROP_SILO ObjectSymlinkScope = "GlobalDropSilo" +) diff --git a/internal/hcs/schema2/oci_spec.go b/internal/hcs/schema2/oci_spec.go new file mode 100644 index 0000000000..433791d78c --- /dev/null +++ b/internal/hcs/schema2/oci_spec.go @@ -0,0 +1,25 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type OciSpec struct { + OciVersion string `json:"ociVersion,omitempty"` + Process *Process `json:"process,omitempty"` + Root *Root `json:"root,omitempty"` + Hostname string `json:"hostname,omitempty"` + Mounts []Mount `json:"mounts,omitempty"` + Hooks *Hooks `json:"hooks,omitempty"` + Annotations map[string]string `json:"annotations,omitempty"` + Linux *Linux `json:"linux,omitempty"` +} diff --git a/internal/hcs/schema2/operation_failure.go b/internal/hcs/schema2/operation_failure.go new file mode 100644 index 0000000000..6b8bdb223a --- /dev/null +++ b/internal/hcs/schema2/operation_failure.go @@ -0,0 +1,18 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type OperationFailure struct { + Detail *OperationFailureDetail `json:"Detail,omitempty"` +} diff --git a/internal/hcs/schema2/operation_failure_detail.go b/internal/hcs/schema2/operation_failure_detail.go new file mode 100644 index 0000000000..d8cae5cb8c --- /dev/null +++ b/internal/hcs/schema2/operation_failure_detail.go @@ -0,0 +1,46 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type OperationFailureDetail string + +// List of OperationFailureDetail +const ( + OperationFailureDetail_INVALID OperationFailureDetail = "Invalid" + OperationFailureDetail_CREATE_INTERNAL_ERROR OperationFailureDetail = "CreateInternalError" + OperationFailureDetail_CONSTRUCT_STATE_ERROR OperationFailureDetail = "ConstructStateError" + OperationFailureDetail_RUNTIME_OS_TYPE_MISMATCH OperationFailureDetail = "RuntimeOsTypeMismatch" + OperationFailureDetail_CONSTRUCT OperationFailureDetail = "Construct" + OperationFailureDetail_START OperationFailureDetail = "Start" + OperationFailureDetail_PAUSE OperationFailureDetail = "Pause" + OperationFailureDetail_RESUME OperationFailureDetail = "Resume" + OperationFailureDetail_SHUTDOWN OperationFailureDetail = "Shutdown" + OperationFailureDetail_TERMINATE OperationFailureDetail = "Terminate" + OperationFailureDetail_SAVE OperationFailureDetail = "Save" + OperationFailureDetail_GET_PROPERTIES OperationFailureDetail = "GetProperties" + OperationFailureDetail_MODIFY OperationFailureDetail = "Modify" + OperationFailureDetail_CRASH OperationFailureDetail = "Crash" + OperationFailureDetail_GUEST_CRASH OperationFailureDetail = "GuestCrash" + OperationFailureDetail_LIFECYCLE_NOTIFY OperationFailureDetail = "LifecycleNotify" + OperationFailureDetail_EXECUTE_PROCESS OperationFailureDetail = "ExecuteProcess" + OperationFailureDetail_GET_PROCESS_INFO OperationFailureDetail = "GetProcessInfo" + OperationFailureDetail_WAIT_FOR_PROCESS OperationFailureDetail = "WaitForProcess" + OperationFailureDetail_SIGNAL_PROCESS OperationFailureDetail = "SignalProcess" + OperationFailureDetail_MODIFY_PROCESS OperationFailureDetail = "ModifyProcess" + OperationFailureDetail_PREPARE_FOR_HOSTING OperationFailureDetail = "PrepareForHosting" + OperationFailureDetail_REGISTER_HOSTED_SYSTEM OperationFailureDetail = "RegisterHostedSystem" + OperationFailureDetail_UNREGISTER_HOSTED_SYSTEM OperationFailureDetail = "UnregisterHostedSystem" + OperationFailureDetail_PREPARE_FOR_CLONE OperationFailureDetail = "PrepareForClone" + OperationFailureDetail_GET_CLONE_TEMPLATE OperationFailureDetail = "GetCloneTemplate" +) diff --git a/internal/hcs/schema2/os_layer_options.go b/internal/hcs/schema2/os_layer_options.go new file mode 100644 index 0000000000..c768c3fd88 --- /dev/null +++ b/internal/hcs/schema2/os_layer_options.go @@ -0,0 +1,25 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type OSLayerOptions struct { + Type_ *OSLayerType `json:"Type,omitempty"` + DisableCiCacheOptimization bool `json:"DisableCiCacheOptimization,omitempty"` + SkipUpdateBcdForBoot bool `json:"SkipUpdateBcdForBoot,omitempty"` + IsDynamic bool `json:"IsDynamic,omitempty"` + SkipSandboxPreExpansion bool `json:"SkipSandboxPreExpansion,omitempty"` + FileSystemLayers []Layer `json:"FileSystemLayers,omitempty"` + // Pattern: /^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/ + SandboxVhdPartitionID string `json:"SandboxVhdPartitionId,omitempty"` +} diff --git a/internal/hcs/schema2/os_layer_type.go b/internal/hcs/schema2/os_layer_type.go new file mode 100644 index 0000000000..cbcd000675 --- /dev/null +++ b/internal/hcs/schema2/os_layer_type.go @@ -0,0 +1,22 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type OSLayerType string + +// List of OsLayerType +const ( + OSLayerType_CONTAINER OSLayerType = "Container" + OSLayerType_VM OSLayerType = "Vm" +) diff --git a/internal/hcs/schema2/os_type.go b/internal/hcs/schema2/os_type.go new file mode 100644 index 0000000000..71d76e4d2e --- /dev/null +++ b/internal/hcs/schema2/os_type.go @@ -0,0 +1,23 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type OSType string + +// List of OsType +const ( + OSType_EMPTY OSType = "" + OSType_WINDOWS OSType = "Windows" + OSType_LINUX OSType = "Linux" +) diff --git a/internal/hcs/schema2/os_type_lookup.go b/internal/hcs/schema2/os_type_lookup.go new file mode 100644 index 0000000000..fa0e21ade6 --- /dev/null +++ b/internal/hcs/schema2/os_type_lookup.go @@ -0,0 +1,11 @@ +package hcsschema + +import "strings" + +func NewOSType(x string) (OSType, error) { + return enumLookup(map[string]OSType{ + strings.ToLower(string(OSType_EMPTY)): OSType_EMPTY, + strings.ToLower(string(OSType_WINDOWS)): OSType_WINDOWS, + strings.ToLower(string(OSType_LINUX)): OSType_LINUX, + }, strings.ToLower(x)) +} diff --git a/internal/hcs/schema2/path_type.go b/internal/hcs/schema2/path_type.go new file mode 100644 index 0000000000..0f5db10a19 --- /dev/null +++ b/internal/hcs/schema2/path_type.go @@ -0,0 +1,22 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type PathType string + +// List of PathType +const ( + PathType_ABSOLUTE_PATH PathType = "AbsolutePath" + PathType_VIRTUAL_SMB_SHARE_NAME PathType = "VirtualSmbShareName" +) diff --git a/internal/hcs/schema2/pause_notification.go b/internal/hcs/schema2/pause_notification.go index d96c9501f3..0fbc245c3e 100644 --- a/internal/hcs/schema2/pause_notification.go +++ b/internal/hcs/schema2/pause_notification.go @@ -1,15 +1,19 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema -// Notification data that is indicated to components running in the Virtual Machine. +// Notification data that is indicated to components running in the Virtual Machine. type PauseNotification struct { - Reason string `json:"Reason,omitempty"` + Reason *PauseReason `json:"Reason,omitempty"` } diff --git a/internal/hcs/schema2/pause_options.go b/internal/hcs/schema2/pause_options.go index 21707a88eb..2fd6c875ba 100644 --- a/internal/hcs/schema2/pause_options.go +++ b/internal/hcs/schema2/pause_options.go @@ -1,17 +1,20 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema -// Options for HcsPauseComputeSystem +// Options for HcsPauseComputeSystem type PauseOptions struct { - SuspensionLevel string `json:"SuspensionLevel,omitempty"` - - HostedNotification *PauseNotification `json:"HostedNotification,omitempty"` + SuspensionLevel *PauseSuspensionLevel `json:"SuspensionLevel,omitempty"` + HostedNotification *PauseNotification `json:"HostedNotification,omitempty"` } diff --git a/internal/hcs/schema2/pause_reason.go b/internal/hcs/schema2/pause_reason.go new file mode 100644 index 0000000000..e3e2af99c8 --- /dev/null +++ b/internal/hcs/schema2/pause_reason.go @@ -0,0 +1,24 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// PauseReason : Pause reason that is indicated to components running in the Virtual Machine. +type PauseReason string + +// List of PauseReason +const ( + PauseReason_NONE PauseReason = "None" + PauseReason_SAVE PauseReason = "Save" + PauseReason_TEMPLATE PauseReason = "Template" +) diff --git a/internal/hcs/schema2/pause_suspension_level.go b/internal/hcs/schema2/pause_suspension_level.go new file mode 100644 index 0000000000..674cf61598 --- /dev/null +++ b/internal/hcs/schema2/pause_suspension_level.go @@ -0,0 +1,24 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type PauseSuspensionLevel string + +// List of PauseSuspensionLevel +const ( + PauseSuspensionLevel_SUSPEND PauseSuspensionLevel = "Suspend" + PauseSuspensionLevel_MEMORY_LOW PauseSuspensionLevel = "MemoryLow" + PauseSuspensionLevel_MEMORY_MEDIUM PauseSuspensionLevel = "MemoryMedium" + PauseSuspensionLevel_MEMORY_HIGH PauseSuspensionLevel = "MemoryHigh" +) diff --git a/internal/hcs/schema2/pcat.go b/internal/hcs/schema2/pcat.go new file mode 100644 index 0000000000..cef914a250 --- /dev/null +++ b/internal/hcs/schema2/pcat.go @@ -0,0 +1,19 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type Pcat struct { + // The order of booting devices + BootOrder []BootDevice `json:"BootOrder,omitempty"` +} diff --git a/internal/hcs/schema2/plan9_share.go b/internal/hcs/schema2/plan9_share.go deleted file mode 100644 index 41f8fdea02..0000000000 --- a/internal/hcs/schema2/plan9_share.go +++ /dev/null @@ -1,34 +0,0 @@ -/* - * HCS API - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * API version: 2.1 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package hcsschema - -type Plan9Share struct { - Name string `json:"Name,omitempty"` - - // The name by which the guest operation system can access this share, via the aname parameter in the Plan9 protocol. - AccessName string `json:"AccessName,omitempty"` - - Path string `json:"Path,omitempty"` - - Port int32 `json:"Port,omitempty"` - - // Flags are marked private. Until they are exported correctly - // - // ReadOnly 0x00000001 - // LinuxMetadata 0x00000004 - // CaseSensitive 0x00000008 - Flags int32 `json:"Flags,omitempty"` - - ReadOnly bool `json:"ReadOnly,omitempty"` - - UseShareRootIdentity bool `json:"UseShareRootIdentity,omitempty"` - - AllowedFiles []string `json:"AllowedFiles,omitempty"` -} diff --git a/internal/hcs/schema2/plan9.go b/internal/hcs/schema2/plan_nine.go similarity index 65% rename from internal/hcs/schema2/plan9.go rename to internal/hcs/schema2/plan_nine.go index 29d8c8012f..bf54b63ab3 100644 --- a/internal/hcs/schema2/plan9.go +++ b/internal/hcs/schema2/plan_nine.go @@ -1,9 +1,13 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ diff --git a/internal/hcs/schema2/plan_nine_share.go b/internal/hcs/schema2/plan_nine_share.go new file mode 100644 index 0000000000..afe5091097 --- /dev/null +++ b/internal/hcs/schema2/plan_nine_share.go @@ -0,0 +1,24 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type Plan9Share struct { + Name string `json:"Name,omitempty"` + // The name by which the guest operation system can access this share, via the aname parameter in the Plan9 protocol. + AccessName string `json:"AccessName,omitempty"` + Path string `json:"Path,omitempty"` + Port uint32 `json:"Port,omitempty"` + Flags int64 `json:"Flags,omitempty"` + AllowedFiles []string `json:"AllowedFiles,omitempty"` +} diff --git a/internal/hcs/schema2/plan_nine_share_flags.go b/internal/hcs/schema2/plan_nine_share_flags.go new file mode 100644 index 0000000000..d347b237c4 --- /dev/null +++ b/internal/hcs/schema2/plan_nine_share_flags.go @@ -0,0 +1,29 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type Plan9ShareFlags string + +// List of Plan9ShareFlags +const ( + Plan9ShareFlags_NONE Plan9ShareFlags = "None" + Plan9ShareFlags_READ_ONLY Plan9ShareFlags = "ReadOnly" + Plan9ShareFlags_LINUX_METADATA Plan9ShareFlags = "LinuxMetadata" + Plan9ShareFlags_CASE_SENSITIVE Plan9ShareFlags = "CaseSensitive" + Plan9ShareFlags_USE_SHARE_ROOT_IDENTITY Plan9ShareFlags = "UseShareRootIdentity" + Plan9ShareFlags_ALLOW_OPTIONS Plan9ShareFlags = "AllowOptions" + Plan9ShareFlags_ALLOW_SUB_PATHS Plan9ShareFlags = "AllowSubPaths" + Plan9ShareFlags_RESTRICT_FILE_ACCESS Plan9ShareFlags = "RestrictFileAccess" + Plan9ShareFlags_UNLIMITED_CONNECTIONS Plan9ShareFlags = "UnlimitedConnections" +) diff --git a/internal/hcs/schema2/plan_nine_share_flags_lookup.go b/internal/hcs/schema2/plan_nine_share_flags_lookup.go new file mode 100644 index 0000000000..02572c2a28 --- /dev/null +++ b/internal/hcs/schema2/plan_nine_share_flags_lookup.go @@ -0,0 +1,15 @@ +package hcsschema + +func (x Plan9ShareFlags) Int64() (int64, error) { + return enumLookup(map[Plan9ShareFlags]int64{ + Plan9ShareFlags_NONE: 0x00000000, + Plan9ShareFlags_READ_ONLY: 0x00000001, + Plan9ShareFlags_LINUX_METADATA: 0x00000004, + Plan9ShareFlags_CASE_SENSITIVE: 0x00000008, + Plan9ShareFlags_USE_SHARE_ROOT_IDENTITY: 0x00000010, + Plan9ShareFlags_ALLOW_OPTIONS: 0x00000020, + Plan9ShareFlags_ALLOW_SUB_PATHS: 0x00000040, + Plan9ShareFlags_RESTRICT_FILE_ACCESS: 0x00000080, + Plan9ShareFlags_UNLIMITED_CONNECTIONS: 0x00000100, + }, x) +} diff --git a/internal/hcs/schema2/process.go b/internal/hcs/schema2/process.go new file mode 100644 index 0000000000..62f838a8bf --- /dev/null +++ b/internal/hcs/schema2/process.go @@ -0,0 +1,28 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type Process struct { + Terminal bool `json:"terminal,omitempty"` + ConsoleSize *Box `json:"consoleSize,omitempty"` + User *User `json:"user,omitempty"` + Args []string `json:"args,omitempty"` + Env []string `json:"env,omitempty"` + Cwd string `json:"cwd,omitempty"` + Capabilities *LinuxCapabilities `json:"capabilities,omitempty"` + NoNewPrivileges bool `json:"noNewPrivileges,omitempty"` + ApparmorProfile string `json:"apparmorProfile,omitempty"` + OomScoreAdj int64 `json:"oomScoreAdj,omitempty"` + SelinuxLabel string `json:"selinuxLabel,omitempty"` +} diff --git a/internal/hcs/schema2/process_details.go b/internal/hcs/schema2/process_details.go index e9a662dd59..2809f600d8 100644 --- a/internal/hcs/schema2/process_details.go +++ b/internal/hcs/schema2/process_details.go @@ -1,9 +1,13 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ @@ -13,21 +17,14 @@ import ( "time" ) -// Information about a process running in a container +// Information about a process running in a container type ProcessDetails struct { - ProcessId int32 `json:"ProcessId,omitempty"` - - ImageName string `json:"ImageName,omitempty"` - - CreateTimestamp time.Time `json:"CreateTimestamp,omitempty"` - - UserTime100ns int32 `json:"UserTime100ns,omitempty"` - - KernelTime100ns int32 `json:"KernelTime100ns,omitempty"` - - MemoryCommitBytes int32 `json:"MemoryCommitBytes,omitempty"` - - MemoryWorkingSetPrivateBytes int32 `json:"MemoryWorkingSetPrivateBytes,omitempty"` - - MemoryWorkingSetSharedBytes int32 `json:"MemoryWorkingSetSharedBytes,omitempty"` + ProcessID uint32 `json:"ProcessId,omitempty"` + ImageName string `json:"ImageName,omitempty"` + CreateTimestamp time.Time `json:"CreateTimestamp,omitempty"` + UserTime100ns uint64 `json:"UserTime100ns,omitempty"` + KernelTime100ns uint64 `json:"KernelTime100ns,omitempty"` + MemoryCommitBytes uint64 `json:"MemoryCommitBytes,omitempty"` + MemoryWorkingSetPrivateBytes uint64 `json:"MemoryWorkingSetPrivateBytes,omitempty"` + MemoryWorkingSetSharedBytes uint64 `json:"MemoryWorkingSetSharedBytes,omitempty"` } diff --git a/internal/hcs/schema2/process_dump.go b/internal/hcs/schema2/process_dump.go new file mode 100644 index 0000000000..9146767f0d --- /dev/null +++ b/internal/hcs/schema2/process_dump.go @@ -0,0 +1,23 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// Configuration for a process dump using MiniDumpWriteDump +type ProcessDump struct { + Type_ *ProcessDumpType `json:"Type,omitempty"` + // Custom MINIDUMP_TYPE flags used if Type is ProcessDumpType::Custom + CustomDumpFlags uint32 `json:"CustomDumpFlags,omitempty"` + // Path to create the dump file. The file must not exist. + DumpFileName string `json:"DumpFileName,omitempty"` +} diff --git a/internal/hcs/schema2/process_dump_type.go b/internal/hcs/schema2/process_dump_type.go new file mode 100644 index 0000000000..a21a46843e --- /dev/null +++ b/internal/hcs/schema2/process_dump_type.go @@ -0,0 +1,25 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// ProcessDumpType : Indicates the type of process dump to be captured. +type ProcessDumpType string + +// List of ProcessDumpType +const ( + ProcessDumpType_NONE ProcessDumpType = "None" + ProcessDumpType_HEAP ProcessDumpType = "Heap" + ProcessDumpType_MINI ProcessDumpType = "Mini" + ProcessDumpType_CUSTOM ProcessDumpType = "Custom" +) diff --git a/internal/hcs/schema2/process_modify_request.go b/internal/hcs/schema2/process_modify_request.go index e4ed095c7b..d103695e04 100644 --- a/internal/hcs/schema2/process_modify_request.go +++ b/internal/hcs/schema2/process_modify_request.go @@ -1,19 +1,21 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema -// Passed to HcsRpc_ModifyProcess +// Passed to HcsRpc_ModifyProcess type ProcessModifyRequest struct { - Operation string `json:"Operation,omitempty"` - - ConsoleSize *ConsoleSize `json:"ConsoleSize,omitempty"` - - CloseHandle *CloseHandle `json:"CloseHandle,omitempty"` + Operation *ModifyOperation `json:"Operation,omitempty"` + ConsoleSize *ConsoleSize `json:"ConsoleSize,omitempty"` + CloseHandle *CloseHandle `json:"CloseHandle,omitempty"` } diff --git a/internal/hcs/schema2/process_parameters.go b/internal/hcs/schema2/process_parameters.go index 82b0d0532b..60548bbb92 100644 --- a/internal/hcs/schema2/process_parameters.go +++ b/internal/hcs/schema2/process_parameters.go @@ -1,46 +1,41 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema +// MODIFICATION: updated []int64 to []uint16 for ConsoleSize + type ProcessParameters struct { ApplicationName string `json:"ApplicationName,omitempty"` - - CommandLine string `json:"CommandLine,omitempty"` - - // optional alternative to CommandLine, currently only supported by Linux GCS - CommandArgs []string `json:"CommandArgs,omitempty"` - - User string `json:"User,omitempty"` - - WorkingDirectory string `json:"WorkingDirectory,omitempty"` - - Environment map[string]string `json:"Environment,omitempty"` - - // if set, will run as low-privilege process + CommandLine string `json:"CommandLine,omitempty"` + // optional alternative to CommandLine, currently only supported by Linux GCS + CommandArgs []string `json:"CommandArgs,omitempty"` + User string `json:"User,omitempty"` + WorkingDirectory string `json:"WorkingDirectory,omitempty"` + Environment map[string]string `json:"Environment,omitempty"` + // if set, will run as low-privilege process RestrictedToken bool `json:"RestrictedToken,omitempty"` - - // if set, ignore StdErrPipe - EmulateConsole bool `json:"EmulateConsole,omitempty"` - - CreateStdInPipe bool `json:"CreateStdInPipe,omitempty"` - + // if set, ignore StdErrPipe + EmulateConsole bool `json:"EmulateConsole,omitempty"` + CreateStdInPipe bool `json:"CreateStdInPipe,omitempty"` CreateStdOutPipe bool `json:"CreateStdOutPipe,omitempty"` - CreateStdErrPipe bool `json:"CreateStdErrPipe,omitempty"` - - // height then width - ConsoleSize []int32 `json:"ConsoleSize,omitempty"` - - // if set, find an existing session for the user and create the process in it + // height then width + ConsoleSize []uint16 `json:"ConsoleSize,omitempty"` + // if set, create the process in the utility VM instead of the container + CreateInUtilityVM bool `json:"CreateInUtilityVM,omitempty"` + // if set, find an existing session for the user and create the process in it UseExistingLogin bool `json:"UseExistingLogin,omitempty"` - - // if set, use the legacy console instead of conhost + // if set, use the legacy console instead of conhost UseLegacyConsole bool `json:"UseLegacyConsole,omitempty"` } diff --git a/internal/hcs/schema2/process_signal.go b/internal/hcs/schema2/process_signal.go new file mode 100644 index 0000000000..698fea27ab --- /dev/null +++ b/internal/hcs/schema2/process_signal.go @@ -0,0 +1,25 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type ProcessSignal string + +// List of ProcessSignal +const ( + ProcessSignal_CTRL_C ProcessSignal = "CtrlC" + ProcessSignal_CTRL_BREAK ProcessSignal = "CtrlBreak" + ProcessSignal_CTRL_CLOSE ProcessSignal = "CtrlClose" + ProcessSignal_CTRL_LOG_OFF ProcessSignal = "CtrlLogOff" + ProcessSignal_CTRL_SHUTDOWN ProcessSignal = "CtrlShutdown" +) diff --git a/internal/hcs/schema2/process_status.go b/internal/hcs/schema2/process_status.go index ad9a4fa9ad..7b6af3e91e 100644 --- a/internal/hcs/schema2/process_status.go +++ b/internal/hcs/schema2/process_status.go @@ -1,21 +1,26 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema -// Status of a process running in a container +// Provided in the EventData parameter of an HcsEventProcessExited HCS_EVENT. type ProcessStatus struct { - ProcessId int32 `json:"ProcessId,omitempty"` - + // The process id (PID) of the process. + ProcessID uint32 `json:"ProcessId,omitempty"` + // True if the process has exited, false if it has not exited yet. Exited bool `json:"Exited,omitempty"` - - ExitCode int32 `json:"ExitCode,omitempty"` - + // Exit code of the process. The ExitCode is valid only if LastWaitResult is S_OK and Exited is true. + ExitCode uint32 `json:"ExitCode,omitempty"` + // Status of waiting for process exit. S_OK indicates success. Other HRESULT values on error. LastWaitResult int32 `json:"LastWaitResult,omitempty"` } diff --git a/internal/hcs/schema2/processor.go b/internal/hcs/schema2/processor.go deleted file mode 100644 index bb24e88da1..0000000000 --- a/internal/hcs/schema2/processor.go +++ /dev/null @@ -1,18 +0,0 @@ -/* - * HCS API - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * API version: 2.1 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package hcsschema - -type Processor struct { - Count int32 `json:"Count,omitempty"` - - Maximum int32 `json:"Maximum,omitempty"` - - Weight int32 `json:"Weight,omitempty"` -} diff --git a/internal/hcs/schema2/processor_2.go b/internal/hcs/schema2/processor_2.go deleted file mode 100644 index c64f335ec7..0000000000 --- a/internal/hcs/schema2/processor_2.go +++ /dev/null @@ -1,23 +0,0 @@ -/* - * HCS API - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * API version: 2.5 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package hcsschema - -type Processor2 struct { - Count int32 `json:"Count,omitempty"` - - Limit int32 `json:"Limit,omitempty"` - - Weight int32 `json:"Weight,omitempty"` - - ExposeVirtualizationExtensions bool `json:"ExposeVirtualizationExtensions,omitempty"` - - // An optional object that configures the CPU Group to which a Virtual Machine is going to bind to. - CpuGroup *CpuGroup `json:"CpuGroup,omitempty"` -} diff --git a/internal/hcs/schema2/processor_cache_modify_service_operation.go b/internal/hcs/schema2/processor_cache_modify_service_operation.go new file mode 100644 index 0000000000..4505bacad4 --- /dev/null +++ b/internal/hcs/schema2/processor_cache_modify_service_operation.go @@ -0,0 +1,25 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// ProcessorCacheModifyServiceOperation : Enumeration of different supported service processor cache modification requests +type ProcessorCacheModifyServiceOperation string + +// List of ProcessorCache_ModifyServiceOperation +const ( + ProcessorCacheModifyServiceOperation_SET_COS_BITMASK ProcessorCacheModifyServiceOperation = "SetCosBitmask" + ProcessorCacheModifyServiceOperation_SET_ROOT_COS ProcessorCacheModifyServiceOperation = "SetRootCos" + ProcessorCacheModifyServiceOperation_SET_ROOT_RMID ProcessorCacheModifyServiceOperation = "SetRootRmid" + ProcessorCacheModifyServiceOperation_SET_MBA_COS_THROTTLE_VALUE ProcessorCacheModifyServiceOperation = "SetMbaCosThrottleValue" +) diff --git a/internal/hcs/schema2/processor_capabilities_info.go b/internal/hcs/schema2/processor_capabilities_info.go new file mode 100644 index 0000000000..4dfcc1a6e0 --- /dev/null +++ b/internal/hcs/schema2/processor_capabilities_info.go @@ -0,0 +1,27 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// Host specific processor feature capabilities +type ProcessorCapabilitiesInfo struct { + // Processor features + ProcessorFeatures []ProcessorFeature `json:"ProcessorFeatures,omitempty"` + // Xsave processor features + XsaveProcessorFeatures []XsaveProcessorFeature `json:"XsaveProcessorFeatures,omitempty"` + // Processor cache line flush size + CacheLineFlushSize uint64 `json:"CacheLineFlushSize,omitempty"` + // Processor physical address bits + ImplementedPhysicalAddressBits uint64 `json:"ImplementedPhysicalAddressBits,omitempty"` + NonArchitecturalCoreSharing *NonArchitecturalCoreSharing `json:"NonArchitecturalCoreSharing,omitempty"` +} diff --git a/internal/hcs/schema2/processor_feature.go b/internal/hcs/schema2/processor_feature.go new file mode 100644 index 0000000000..c2522e1b1b --- /dev/null +++ b/internal/hcs/schema2/processor_feature.go @@ -0,0 +1,156 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// ProcessorFeature : Enum for processor features +type ProcessorFeature string + +// List of ProcessorFeature +const ( + ProcessorFeature_SSE3 ProcessorFeature = "Sse3" + ProcessorFeature_LAHF_SAHF ProcessorFeature = "LahfSahf" + ProcessorFeature_SSSE3 ProcessorFeature = "Ssse3" + ProcessorFeature_SSE4_1 ProcessorFeature = "Sse4_1" + ProcessorFeature_SSE4_2 ProcessorFeature = "Sse4_2" + ProcessorFeature_SSE4_A ProcessorFeature = "Sse4A" + ProcessorFeature_XOP ProcessorFeature = "Xop" + ProcessorFeature_POPCNT ProcessorFeature = "Popcnt" + ProcessorFeature_CMPXCHG16_B ProcessorFeature = "Cmpxchg16B" + ProcessorFeature_ALTMOVCR8 ProcessorFeature = "Altmovcr8" + ProcessorFeature_LZCNT ProcessorFeature = "Lzcnt" + ProcessorFeature_MISALIGNSSE ProcessorFeature = "Misalignsse" + ProcessorFeature_MMX_EXT ProcessorFeature = "MmxExt" + ProcessorFeature_AMD3_DNOW ProcessorFeature = "Amd3Dnow" + ProcessorFeature_EXT_AMD3_DNOW ProcessorFeature = "ExtAmd3Dnow" + ProcessorFeature_PAGE1_GB ProcessorFeature = "Page1Gb" + ProcessorFeature_AMD_AES ProcessorFeature = "AmdAes" + ProcessorFeature_PCLMULQDQ ProcessorFeature = "Pclmulqdq" + ProcessorFeature_PCID ProcessorFeature = "Pcid" + ProcessorFeature_FMA4 ProcessorFeature = "Fma4" + ProcessorFeature_F16_C ProcessorFeature = "F16C" + ProcessorFeature_RDRAND ProcessorFeature = "Rdrand" + ProcessorFeature_RDWRFSGS ProcessorFeature = "Rdwrfsgs" + ProcessorFeature_SMEP ProcessorFeature = "Smep" + ProcessorFeature_ENHANCED_FAST_STRING ProcessorFeature = "EnhancedFastString" + ProcessorFeature_BMI1 ProcessorFeature = "Bmi1" + ProcessorFeature_BMI2 ProcessorFeature = "Bmi2" + ProcessorFeature_HLE_DEPRECATED ProcessorFeature = "HleDeprecated" + ProcessorFeature_RTM_DEPRECATED ProcessorFeature = "RtmDeprecated" + ProcessorFeature_MOVBE ProcessorFeature = "Movbe" + ProcessorFeature_NPIEP1 ProcessorFeature = "Npiep1" + ProcessorFeature_DEP_X87_FPU_SAVE ProcessorFeature = "DepX87FpuSave" + ProcessorFeature_RDSEED ProcessorFeature = "Rdseed" + ProcessorFeature_ADX ProcessorFeature = "Adx" + ProcessorFeature_INTEL_PREFETCH ProcessorFeature = "IntelPrefetch" + ProcessorFeature_SMAP ProcessorFeature = "Smap" + ProcessorFeature_HLE ProcessorFeature = "Hle" + ProcessorFeature_RTM ProcessorFeature = "Rtm" + ProcessorFeature_RDTSCP ProcessorFeature = "Rdtscp" + ProcessorFeature_CLFLUSHOPT ProcessorFeature = "Clflushopt" + ProcessorFeature_CLWB ProcessorFeature = "Clwb" + ProcessorFeature_SHA ProcessorFeature = "Sha" + ProcessorFeature_X87_POINTERS_SAVED ProcessorFeature = "X87PointersSaved" + ProcessorFeature_INVPCID ProcessorFeature = "Invpcid" + ProcessorFeature_IBRS ProcessorFeature = "Ibrs" + ProcessorFeature_STIBP ProcessorFeature = "Stibp" + ProcessorFeature_IBPB ProcessorFeature = "Ibpb" + ProcessorFeature_UNRESTRICTED_GUEST ProcessorFeature = "UnrestrictedGuest" + ProcessorFeature_MDD ProcessorFeature = "Mdd" + ProcessorFeature_FAST_SHORT_REP_MOV ProcessorFeature = "FastShortRepMov" + ProcessorFeature_L1_D_CACHE_FLUSH ProcessorFeature = "L1DCacheFlush" + ProcessorFeature_RDCL_NO ProcessorFeature = "RdclNo" + ProcessorFeature_IBRS_ALL ProcessorFeature = "IbrsAll" + ProcessorFeature_SKIP_L1_DF ProcessorFeature = "SkipL1Df" + ProcessorFeature_SSB_NO ProcessorFeature = "SsbNo" + ProcessorFeature_RSBA_NO ProcessorFeature = "RsbaNo" + ProcessorFeature_VIRT_SPEC_CTRL ProcessorFeature = "VirtSpecCtrl" + ProcessorFeature_RDPID ProcessorFeature = "Rdpid" + ProcessorFeature_UMIP ProcessorFeature = "Umip" + ProcessorFeature_MBS_NO ProcessorFeature = "MbsNo" + ProcessorFeature_MB_CLEAR ProcessorFeature = "MbClear" + ProcessorFeature_TAA_NO ProcessorFeature = "TaaNo" + ProcessorFeature_TSX_CTRL ProcessorFeature = "TsxCtrl" + ProcessorFeature_RESERVED ProcessorFeature = "Reserved" + ProcessorFeature_ACOUNT_MCOUNT ProcessorFeature = "AcountMcount" + ProcessorFeature_TSC_INVARIANT ProcessorFeature = "TscInvariant" + ProcessorFeature_CLZERO ProcessorFeature = "Clzero" + ProcessorFeature_RDPRU ProcessorFeature = "Rdpru" + ProcessorFeature_LA57 ProcessorFeature = "La57" + ProcessorFeature_MBEC ProcessorFeature = "Mbec" + ProcessorFeature_NESTED_VIRT ProcessorFeature = "NestedVirt" + ProcessorFeature_PSFD ProcessorFeature = "Psfd" + ProcessorFeature_CET_SS ProcessorFeature = "CetSs" + ProcessorFeature_CET_IBT ProcessorFeature = "CetIbt" + ProcessorFeature_VMX_EXCEPTION_INJECT ProcessorFeature = "VmxExceptionInject" + ProcessorFeature_ENQCMD ProcessorFeature = "Enqcmd" + ProcessorFeature_UMWAIT_TPAUSE ProcessorFeature = "UmwaitTpause" + ProcessorFeature_MOVDIRI ProcessorFeature = "Movdiri" + ProcessorFeature_MOVDIR64B ProcessorFeature = "Movdir64b" + ProcessorFeature_CLDEMOTE ProcessorFeature = "Cldemote" + ProcessorFeature_SERIALIZE ProcessorFeature = "Serialize" + ProcessorFeature_TSC_DEADLINE_TMR ProcessorFeature = "TscDeadlineTmr" + ProcessorFeature_TSC_ADJUST ProcessorFeature = "TscAdjust" + ProcessorFeature_FZL_REP_MOVSB ProcessorFeature = "FZLRepMovsb" + ProcessorFeature_FS_REP_STOSB ProcessorFeature = "FSRepStosb" + ProcessorFeature_FS_REP_CMPSB ProcessorFeature = "FSRepCmpsb" + ProcessorFeature_SENTINEL_AMD ProcessorFeature = "SentinelAmd" + ProcessorFeature_ASID16 ProcessorFeature = "Asid16" + ProcessorFeature_T_GRAN16 ProcessorFeature = "TGran16" + ProcessorFeature_T_GRAN64 ProcessorFeature = "TGran64" + ProcessorFeature_HAF ProcessorFeature = "Haf" + ProcessorFeature_HDBS ProcessorFeature = "Hdbs" + ProcessorFeature_PAN ProcessorFeature = "Pan" + ProcessorFeature_AT_S1_E1 ProcessorFeature = "AtS1E1" + ProcessorFeature_UAO ProcessorFeature = "Uao" + ProcessorFeature_EL0_AARCH32 ProcessorFeature = "El0Aarch32" + ProcessorFeature_FP ProcessorFeature = "Fp" + ProcessorFeature_FP_HP ProcessorFeature = "FpHp" + ProcessorFeature_ADV_SIMD ProcessorFeature = "AdvSimd" + ProcessorFeature_ADV_SIMD_HP ProcessorFeature = "AdvSimdHp" + ProcessorFeature_GIC_V3_V4 ProcessorFeature = "GicV3V4" + ProcessorFeature_GIC_V41 ProcessorFeature = "GicV41" + ProcessorFeature_RAS ProcessorFeature = "Ras" + ProcessorFeature_PMU_V3 ProcessorFeature = "PmuV3" + ProcessorFeature_PMU_V3_ARM_V81 ProcessorFeature = "PmuV3ArmV81" + ProcessorFeature_PMU_V3_ARM_V84 ProcessorFeature = "PmuV3ArmV84" + ProcessorFeature_PMU_V3_ARM_V85 ProcessorFeature = "PmuV3ArmV85" + ProcessorFeature_ARM_AES ProcessorFeature = "ArmAes" + ProcessorFeature_POLY_MUL ProcessorFeature = "PolyMul" + ProcessorFeature_SHA1 ProcessorFeature = "Sha1" + ProcessorFeature_SHA256 ProcessorFeature = "Sha256" + ProcessorFeature_SHA512 ProcessorFeature = "Sha512" + ProcessorFeature_CRC32 ProcessorFeature = "Crc32" + ProcessorFeature_ATOMIC ProcessorFeature = "Atomic" + ProcessorFeature_RDM ProcessorFeature = "Rdm" + ProcessorFeature_SHA3 ProcessorFeature = "Sha3" + ProcessorFeature_SM3 ProcessorFeature = "Sm3" + ProcessorFeature_SM4 ProcessorFeature = "Sm4" + ProcessorFeature_DP ProcessorFeature = "Dp" + ProcessorFeature_FHM ProcessorFeature = "Fhm" + ProcessorFeature_DC_CVAP ProcessorFeature = "DcCvap" + ProcessorFeature_DC_CVADP ProcessorFeature = "DcCvadp" + ProcessorFeature_APA_BASE ProcessorFeature = "ApaBase" + ProcessorFeature_APA_EP ProcessorFeature = "ApaEp" + ProcessorFeature_APA_EP2 ProcessorFeature = "ApaEp2" + ProcessorFeature_APA_EP2_FP ProcessorFeature = "ApaEp2Fp" + ProcessorFeature_APA_EP2_FPC ProcessorFeature = "ApaEp2Fpc" + ProcessorFeature_JSCVT ProcessorFeature = "Jscvt" + ProcessorFeature_FCMA ProcessorFeature = "Fcma" + ProcessorFeature_RCPC_V83 ProcessorFeature = "RcpcV83" + ProcessorFeature_RCPC_V84 ProcessorFeature = "RcpcV84" + ProcessorFeature_GPA ProcessorFeature = "Gpa" + ProcessorFeature_L1IP_PIPT ProcessorFeature = "L1ipPipt" + ProcessorFeature_DZ_PERMITTED ProcessorFeature = "DzPermitted" + ProcessorFeature_SENTINEL_ARM ProcessorFeature = "SentinelArm" +) diff --git a/internal/hcs/schema2/processor_feature_set.go b/internal/hcs/schema2/processor_feature_set.go new file mode 100644 index 0000000000..9c07a09969 --- /dev/null +++ b/internal/hcs/schema2/processor_feature_set.go @@ -0,0 +1,30 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// VM specific processor feature requirements +type ProcessorFeatureSet struct { + // Processor features + ProcessorFeatures []ProcessorFeature `json:"ProcessorFeatures,omitempty"` + // Xsave processor features + XsaveProcessorFeatures []XsaveProcessorFeature `json:"XsaveProcessorFeatures,omitempty"` + // Processor cache line flush size + CacheLineFlushSize uint64 `json:"CacheLineFlushSize,omitempty"` + // Processor physical address bits + ImplementedPhysicalAddressBits uint64 `json:"ImplementedPhysicalAddressBits,omitempty"` + NonArchitecturalCoreSharing *NonArchitecturalCoreSharing `json:"NonArchitecturalCoreSharing,omitempty"` + // Processor enlightenment modifications + EnlightenmentModifications []EnlightenmentModifications `json:"EnlightenmentModifications,omitempty"` + ProcessorFeatureSetMode *ProcessorFeatureSetMode `json:"ProcessorFeatureSetMode,omitempty"` +} diff --git a/internal/hcs/schema2/processor_feature_set_mode.go b/internal/hcs/schema2/processor_feature_set_mode.go new file mode 100644 index 0000000000..0a28cbd3be --- /dev/null +++ b/internal/hcs/schema2/processor_feature_set_mode.go @@ -0,0 +1,23 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// ProcessorFeatureSetMode : Enum for setting ProcessorFeatureSet mode +type ProcessorFeatureSetMode string + +// List of ProcessorFeatureSetMode +const ( + ProcessorFeatureSetMode_STRICT ProcessorFeatureSetMode = "Strict" + ProcessorFeatureSetMode_PERMISSIVE ProcessorFeatureSetMode = "Permissive" +) diff --git a/internal/hcs/schema2/processor_information_for_host.go b/internal/hcs/schema2/processor_information_for_host.go new file mode 100644 index 0000000000..ce5bdd0208 --- /dev/null +++ b/internal/hcs/schema2/processor_information_for_host.go @@ -0,0 +1,22 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// Structure used to return processor information for a Service property query +type ProcessorInformationForHost struct { + // Number of physical NUMA nodes on the host. + NumaNodeCount uint32 `json:"NumaNodeCount,omitempty"` + // Number of processor on each NUMA node + NumaNodes []NumaNodeProcessor `json:"NumaNodes,omitempty"` +} diff --git a/internal/hcs/schema2/vm_processor_limits.go b/internal/hcs/schema2/processor_limits.go similarity index 79% rename from internal/hcs/schema2/vm_processor_limits.go rename to internal/hcs/schema2/processor_limits.go index de1b9cf1ae..90a1a156b5 100644 --- a/internal/hcs/schema2/vm_processor_limits.go +++ b/internal/hcs/schema2/processor_limits.go @@ -1,5 +1,9 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * @@ -9,7 +13,7 @@ package hcsschema -// ProcessorLimits is used when modifying processor scheduling limits of a virtual machine. +// Used when modifying processor scheduling limits of a virtual machine. type ProcessorLimits struct { // Maximum amount of host CPU resources that the virtual machine can use. Limit uint64 `json:"Limit,omitempty"` diff --git a/internal/hcs/schema2/processor_stats.go b/internal/hcs/schema2/processor_stats.go index 6157e25225..850fc9de9f 100644 --- a/internal/hcs/schema2/processor_stats.go +++ b/internal/hcs/schema2/processor_stats.go @@ -1,19 +1,21 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema -// CPU runtime statistics +// CPU runtime statistics type ProcessorStats struct { - TotalRuntime100ns uint64 `json:"TotalRuntime100ns,omitempty"` - - RuntimeUser100ns uint64 `json:"RuntimeUser100ns,omitempty"` - + TotalRuntime100ns uint64 `json:"TotalRuntime100ns,omitempty"` + RuntimeUser100ns uint64 `json:"RuntimeUser100ns,omitempty"` RuntimeKernel100ns uint64 `json:"RuntimeKernel100ns,omitempty"` } diff --git a/internal/hcs/schema2/processor_topology.go b/internal/hcs/schema2/processor_topology.go index 885156e77f..4bc8b9b2b5 100644 --- a/internal/hcs/schema2/processor_topology.go +++ b/internal/hcs/schema2/processor_topology.go @@ -1,5 +1,9 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * @@ -9,6 +13,7 @@ package hcsschema +// Structure used to return processor topology for a Service property query type ProcessorTopology struct { LogicalProcessorCount uint32 `json:"LogicalProcessorCount,omitempty"` LogicalProcessors []LogicalProcessor `json:"LogicalProcessors,omitempty"` diff --git a/internal/hcs/schema2/properties.go b/internal/hcs/schema2/properties.go index 0c7efe8d40..dda0840749 100644 --- a/internal/hcs/schema2/properties.go +++ b/internal/hcs/schema2/properties.go @@ -1,54 +1,64 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema import ( - v1 "github.com/containerd/cgroups/v3/cgroup1/stats" + "github.com/containerd/cgroups/v3/cgroup1/stats" ) -type Properties struct { - Id string `json:"Id,omitempty"` - - SystemType string `json:"SystemType,omitempty"` - - RuntimeOsType string `json:"RuntimeOsType,omitempty"` - - Name string `json:"Name,omitempty"` - - Owner string `json:"Owner,omitempty"` - - RuntimeId string `json:"RuntimeId,omitempty"` - - RuntimeTemplateId string `json:"RuntimeTemplateId,omitempty"` - - State string `json:"State,omitempty"` - - Stopped bool `json:"Stopped,omitempty"` - - ExitType string `json:"ExitType,omitempty"` - - Memory *MemoryInformationForVm `json:"Memory,omitempty"` - - Statistics *Statistics `json:"Statistics,omitempty"` - - ProcessList []ProcessDetails `json:"ProcessList,omitempty"` - - TerminateOnLastHandleClosed bool `json:"TerminateOnLastHandleClosed,omitempty"` - - HostingSystemId string `json:"HostingSystemId,omitempty"` +// MODIFICATION: add Metrics +type Properties struct { + ID string `json:"Id,omitempty"` + SystemType *SystemType `json:"SystemType,omitempty"` + RuntimeOSType *OSType `json:"RuntimeOsType,omitempty"` + Name string `json:"Name,omitempty"` + Owner string `json:"Owner,omitempty"` + ObRoot string `json:"ObRoot,omitempty"` + IsDummy bool `json:"IsDummy,omitempty"` + // Pattern: /^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/ + RuntimeID string `json:"RuntimeId,omitempty"` + RuntimeImagePath string `json:"RuntimeImagePath,omitempty"` + IsRuntimeTemplate bool `json:"IsRuntimeTemplate,omitempty"` + RuntimeTemplateID string `json:"RuntimeTemplateId,omitempty"` + State *State `json:"State,omitempty"` + Stopped bool `json:"Stopped,omitempty"` + ExitType *NotificationType `json:"ExitType,omitempty"` + Memory *MemoryInformationForVm `json:"Memory,omitempty"` + GuestMemoryInfo *GuestMemoryInfo `json:"GuestMemoryInfo,omitempty"` + // Pattern: /^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/ + CpuGroupID string `json:"CpuGroupId,omitempty"` + Statistics *Statistics `json:"Statistics,omitempty"` + ProcessList []ProcessDetails `json:"ProcessList,omitempty"` + TerminateOnLastHandleClosed bool `json:"TerminateOnLastHandleClosed,omitempty"` + // Pattern: /^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/ + SystemGUID string `json:"SystemGUID,omitempty"` + HostingSystemID string `json:"HostingSystemId,omitempty"` SharedMemoryRegionInfo []SharedMemoryRegionInfo `json:"SharedMemoryRegionInfo,omitempty"` - - GuestConnectionInfo *GuestConnectionInfo `json:"GuestConnectionInfo,omitempty"` + GuestConnectionInfo *GuestConnectionInfo `json:"GuestConnectionInfo,omitempty"` + Silo *SiloProperties `json:"Silo,omitempty"` + CosIndex uint32 `json:"CosIndex,omitempty"` + Rmid uint32 `json:"Rmid,omitempty"` + CacheStats *CacheQueryStatsResponse `json:"CacheStats,omitempty"` + IdledProcessorInfo *IdledProcessorResponse `json:"IdledProcessorInfo,omitempty"` + CpuFrequencyPowerCap uint32 `json:"CpuFrequencyPowerCap,omitempty"` + // This is a new response object, introduced in version 2.5, which maps the requested property names to their associated response objects. + PropertyResponses map[string]PropertyResponse `json:"PropertyResponses,omitempty"` + + // TODO: use [PropertyResponse] to store [Metrics] instead of requiring a custom field // Metrics is not part of the API for HCS but this is used for LCOW v2 to // return the full cgroup metrics from the guest. - Metrics *v1.Metrics `json:"LCOWMetrics,omitempty"` + Metrics *stats.Metrics `json:"LCOWMetrics,omitempty"` } diff --git a/internal/hcs/schema2/property_query.go b/internal/hcs/schema2/property_query.go deleted file mode 100644 index d6d80df131..0000000000 --- a/internal/hcs/schema2/property_query.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * HCS API - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * API version: 2.1 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package hcsschema - -// By default the basic properties will be returned. This query provides a way to request specific properties. -type PropertyQuery struct { - PropertyTypes []PropertyType `json:"PropertyTypes,omitempty"` -} diff --git a/internal/hcs/schema2/property_response.go b/internal/hcs/schema2/property_response.go new file mode 100644 index 0000000000..9feeae5cf0 --- /dev/null +++ b/internal/hcs/schema2/property_response.go @@ -0,0 +1,23 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +import ( + "encoding/json" +) + +type PropertyResponse struct { + Error_ *ResultError `json:"Error,omitempty"` + Response *json.RawMessage `json:"Response,omitempty"` +} diff --git a/internal/hcs/schema2/property_type.go b/internal/hcs/schema2/property_type.go deleted file mode 100644 index 98f2c96edb..0000000000 --- a/internal/hcs/schema2/property_type.go +++ /dev/null @@ -1,26 +0,0 @@ -/* - * HCS API - * - * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - * - * API version: 2.1 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package hcsschema - -type PropertyType string - -const ( - PTMemory PropertyType = "Memory" - PTGuestMemory PropertyType = "GuestMemory" - PTStatistics PropertyType = "Statistics" - PTProcessList PropertyType = "ProcessList" - PTTerminateOnLastHandleClosed PropertyType = "TerminateOnLastHandleClosed" - PTSharedMemoryRegion PropertyType = "SharedMemoryRegion" - PTContainerCredentialGuard PropertyType = "ContainerCredentialGuard" // This field is not generated by swagger. This was added manually. - PTGuestConnection PropertyType = "GuestConnection" - PTICHeartbeatStatus PropertyType = "ICHeartbeatStatus" - PTProcessorTopology PropertyType = "ProcessorTopology" - PTCPUGroup PropertyType = "CpuGroup" -) diff --git a/internal/hcs/schema2/qo_s_capabilities.go b/internal/hcs/schema2/qo_s_capabilities.go new file mode 100644 index 0000000000..ecf24d6500 --- /dev/null +++ b/internal/hcs/schema2/qo_s_capabilities.go @@ -0,0 +1,20 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// Quality of Service (QoS) capabilities +type QoSCapabilities struct { + // Whether or not processor QoS is supported + ProcessorQoSSupported bool `json:"ProcessorQoSSupported,omitempty"` +} diff --git a/internal/hcs/schema2/rdp_connection_options.go b/internal/hcs/schema2/rdp_connection_options.go index 8d5f5c1719..48bad058a9 100644 --- a/internal/hcs/schema2/rdp_connection_options.go +++ b/internal/hcs/schema2/rdp_connection_options.go @@ -1,9 +1,13 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ @@ -11,6 +15,5 @@ package hcsschema type RdpConnectionOptions struct { AccessSids []string `json:"AccessSids,omitempty"` - - NamedPipe string `json:"NamedPipe,omitempty"` + NamedPipe string `json:"NamedPipe,omitempty"` } diff --git a/internal/hcs/schema2/registry_changes.go b/internal/hcs/schema2/registry_changes.go index 006906f6e2..b6139b0e34 100644 --- a/internal/hcs/schema2/registry_changes.go +++ b/internal/hcs/schema2/registry_changes.go @@ -1,16 +1,19 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema type RegistryChanges struct { - AddValues []RegistryValue `json:"AddValues,omitempty"` - - DeleteKeys []RegistryKey `json:"DeleteKeys,omitempty"` + AddValues []RegistryValue `json:"AddValues,omitempty"` + DeleteKeys []RegistryKey `json:"DeleteKeys,omitempty"` } diff --git a/internal/hcs/schema2/registry_delete_key.go b/internal/hcs/schema2/registry_delete_key.go new file mode 100644 index 0000000000..fca713a9c1 --- /dev/null +++ b/internal/hcs/schema2/registry_delete_key.go @@ -0,0 +1,18 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type RegistryDeleteKey struct { + Name string `json:"name,omitempty"` +} diff --git a/internal/hcs/schema2/registry_flush_state.go b/internal/hcs/schema2/registry_flush_state.go new file mode 100644 index 0000000000..c3d7ff9cf5 --- /dev/null +++ b/internal/hcs/schema2/registry_flush_state.go @@ -0,0 +1,20 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// Represents the flush state of the registry hive for a Windows container's job object. +type RegistryFlushState struct { + // Determines whether the flush state of the registry hive is enabled or not. When not enabled, flushes are ignored and changes to the registry are not preserved. + Enabled bool `json:"Enabled,omitempty"` +} diff --git a/internal/hcs/schema2/registry_hive.go b/internal/hcs/schema2/registry_hive.go new file mode 100644 index 0000000000..8276b5e369 --- /dev/null +++ b/internal/hcs/schema2/registry_hive.go @@ -0,0 +1,24 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type RegistryHive string + +// List of RegistryHive +const ( + RegistryHive_SYSTEM RegistryHive = "System" + RegistryHive_SOFTWARE RegistryHive = "Software" + RegistryHive_SECURITY RegistryHive = "Security" + RegistryHive_SAM RegistryHive = "Sam" +) diff --git a/internal/hcs/schema2/registry_hive_stack.go b/internal/hcs/schema2/registry_hive_stack.go new file mode 100644 index 0000000000..a67f3a94ef --- /dev/null +++ b/internal/hcs/schema2/registry_hive_stack.go @@ -0,0 +1,21 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type RegistryHiveStack struct { + Hive string `json:"hive,omitempty"` + Layer []RegistryLayer `json:"layer,omitempty"` + Mkkey []RegistryMakeKey `json:"mkkey,omitempty"` + Delkey []RegistryDeleteKey `json:"delkey,omitempty"` +} diff --git a/internal/hcs/schema2/registry_key.go b/internal/hcs/schema2/registry_key.go index 26fde99c74..58b76e9f19 100644 --- a/internal/hcs/schema2/registry_key.go +++ b/internal/hcs/schema2/registry_key.go @@ -1,18 +1,20 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema type RegistryKey struct { - Hive string `json:"Hive,omitempty"` - - Name string `json:"Name,omitempty"` - - Volatile bool `json:"Volatile,omitempty"` + Hive *RegistryHive `json:"Hive,omitempty"` + Name string `json:"Name,omitempty"` + Volatile bool `json:"Volatile,omitempty"` } diff --git a/internal/hcs/schema2/registry_layer.go b/internal/hcs/schema2/registry_layer.go new file mode 100644 index 0000000000..8be8eeabcc --- /dev/null +++ b/internal/hcs/schema2/registry_layer.go @@ -0,0 +1,28 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type RegistryLayer struct { + Hosthive string `json:"hosthive,omitempty"` + Filepath string `json:"filepath,omitempty"` + // Pattern: /^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/ + Identifier string `json:"identifier,omitempty"` + Readonly bool `json:"readonly,omitempty"` + Immutable bool `json:"immutable,omitempty"` + Inherittrustclass bool `json:"inherittrustclass,omitempty"` + Trustedhive bool `json:"trustedhive,omitempty"` + Writethrough bool `json:"writethrough,omitempty"` + // The FileAccessToken field should only be used in-memory and not serialized/deserialized, since it refers to a token handle. + Fileaccesstoken uint64 `json:"fileaccesstoken,omitempty"` +} diff --git a/internal/hcs/schema2/registry_make_key.go b/internal/hcs/schema2/registry_make_key.go new file mode 100644 index 0000000000..1db2d936fa --- /dev/null +++ b/internal/hcs/schema2/registry_make_key.go @@ -0,0 +1,22 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type RegistryMakeKey struct { + Name string `json:"name,omitempty"` + Clonesd string `json:"clonesd,omitempty"` + Mkkey []RegistryMakeKey `json:"mkkey,omitempty"` + Mkvalue []RegistryMakeValue `json:"mkvalue,omitempty"` + Volatile bool `json:"volatile,omitempty"` +} diff --git a/internal/hcs/schema2/registry_make_value.go b/internal/hcs/schema2/registry_make_value.go new file mode 100644 index 0000000000..96e963f77c --- /dev/null +++ b/internal/hcs/schema2/registry_make_value.go @@ -0,0 +1,22 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type RegistryMakeValue struct { + Name string `json:"name,omitempty"` + DataMultistring string `json:"data_multistring,omitempty"` + DataDword uint32 `json:"data_dword,omitempty"` + DataString string `json:"data_string,omitempty"` + DataBinary string `json:"data_binary,omitempty"` +} diff --git a/internal/hcs/schema2/registry_namespace.go b/internal/hcs/schema2/registry_namespace.go new file mode 100644 index 0000000000..18b59b3b8c --- /dev/null +++ b/internal/hcs/schema2/registry_namespace.go @@ -0,0 +1,20 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type RegistryNamespace struct { + Symlink []RegistrySymlink `json:"symlink,omitempty"` + Redirectionnode []RegistryRedirectionNode `json:"redirectionnode,omitempty"` + Hivestack []RegistryHiveStack `json:"hivestack,omitempty"` +} diff --git a/internal/hcs/schema2/registry_redirection_node.go b/internal/hcs/schema2/registry_redirection_node.go new file mode 100644 index 0000000000..3a817badfb --- /dev/null +++ b/internal/hcs/schema2/registry_redirection_node.go @@ -0,0 +1,23 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type RegistryRedirectionNode struct { + Containerpath string `json:"containerpath,omitempty"` + Hostpath string `json:"hostpath,omitempty"` + Hivestack string `json:"hivestack,omitempty"` + AccessMask uint32 `json:"access_mask,omitempty"` + Trustedhive bool `json:"trustedhive,omitempty"` + Exitnode bool `json:"exitnode,omitempty"` +} diff --git a/internal/hcs/schema2/registry_symlink.go b/internal/hcs/schema2/registry_symlink.go new file mode 100644 index 0000000000..e4b581debb --- /dev/null +++ b/internal/hcs/schema2/registry_symlink.go @@ -0,0 +1,19 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type RegistrySymlink struct { + Key string `json:"key,omitempty"` + Target string `json:"target,omitempty"` +} diff --git a/internal/hcs/schema2/registry_value.go b/internal/hcs/schema2/registry_value.go index 3f203176c3..df2805959e 100644 --- a/internal/hcs/schema2/registry_value.go +++ b/internal/hcs/schema2/registry_value.go @@ -1,30 +1,28 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema type RegistryValue struct { - Key *RegistryKey `json:"Key,omitempty"` - - Name string `json:"Name,omitempty"` - - Type_ string `json:"Type,omitempty"` - - // One and only one value type must be set. + Key *RegistryKey `json:"Key,omitempty"` + Name string `json:"Name,omitempty"` + Type_ *RegistryValueType `json:"Type,omitempty"` + // One and only one value type must be set. StringValue string `json:"StringValue,omitempty"` - + // Pattern: /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/ BinaryValue string `json:"BinaryValue,omitempty"` - - DWordValue int32 `json:"DWordValue,omitempty"` - - QWordValue int32 `json:"QWordValue,omitempty"` - - // Only used if RegistryValueType is CustomType The data is in BinaryValue - CustomType int32 `json:"CustomType,omitempty"` + DWordValue uint32 `json:"DWordValue,omitempty"` + QWordValue uint64 `json:"QWordValue,omitempty"` + // Only used if RegistryValueType is CustomType The data is in BinaryValue + CustomType uint32 `json:"CustomType,omitempty"` } diff --git a/internal/hcs/schema2/registry_value_type.go b/internal/hcs/schema2/registry_value_type.go new file mode 100644 index 0000000000..f3524d31d5 --- /dev/null +++ b/internal/hcs/schema2/registry_value_type.go @@ -0,0 +1,28 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type RegistryValueType string + +// List of RegistryValueType +const ( + RegistryValueType_NONE RegistryValueType = "None" + RegistryValueType_STRING_ RegistryValueType = "String" + RegistryValueType_EXPANDED_STRING RegistryValueType = "ExpandedString" + RegistryValueType_MULTI_STRING RegistryValueType = "MultiString" + RegistryValueType_BINARY RegistryValueType = "Binary" + RegistryValueType_D_WORD RegistryValueType = "DWord" + RegistryValueType_Q_WORD RegistryValueType = "QWord" + RegistryValueType_CUSTOM_TYPE RegistryValueType = "CustomType" +) diff --git a/internal/hcs/schema2/resolution_type.go b/internal/hcs/schema2/resolution_type.go new file mode 100644 index 0000000000..a2837d32bb --- /dev/null +++ b/internal/hcs/schema2/resolution_type.go @@ -0,0 +1,25 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// ResolutionType : The resolution type used for VideoMonitor resolution settings +type ResolutionType string + +// List of ResolutionType +const ( + ResolutionType_UNSPECIFIED ResolutionType = "Unspecified" + ResolutionType_MAXIMUM ResolutionType = "Maximum" + ResolutionType_SINGLE ResolutionType = "Single" + ResolutionType_DEFAULT_ ResolutionType = "Default" +) diff --git a/internal/hcs/schema2/resolution_type_lookup.go b/internal/hcs/schema2/resolution_type_lookup.go new file mode 100644 index 0000000000..df37d09a72 --- /dev/null +++ b/internal/hcs/schema2/resolution_type_lookup.go @@ -0,0 +1,10 @@ +package hcsschema + +func (x ResolutionType) Int64() (int64, error) { + return enumLookup(map[ResolutionType]int64{ + ResolutionType_UNSPECIFIED: 0, + ResolutionType_MAXIMUM: 2, + ResolutionType_SINGLE: 3, + ResolutionType_DEFAULT_: 4, + }, x) +} diff --git a/internal/hcs/schema2/restore_state.go b/internal/hcs/schema2/restore_state.go index 778ff58735..5a07a3c98e 100644 --- a/internal/hcs/schema2/restore_state.go +++ b/internal/hcs/schema2/restore_state.go @@ -1,19 +1,23 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema type RestoreState struct { - - // The path to the save state file to restore the system from. + // The path to the runtime state file to start the system from. + RuntimeStateFilePath string `json:"RuntimeStateFilePath,omitempty"` + // The path to the save state file to restore the system from. SaveStateFilePath string `json:"SaveStateFilePath,omitempty"` - - // The ID of the template system to clone this new system off of. An empty string indicates the system should not be cloned from a template. - TemplateSystemId string `json:"TemplateSystemId,omitempty"` + // The ID of the template system to clone this new system off of. An empty string indicates the system should not be cloned from a template. + TemplateSystemID string `json:"TemplateSystemId,omitempty"` } diff --git a/internal/hcs/schema2/result_error.go b/internal/hcs/schema2/result_error.go new file mode 100644 index 0000000000..d469c98cde --- /dev/null +++ b/internal/hcs/schema2/result_error.go @@ -0,0 +1,26 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// Extended error information returned by the HCS +type ResultError struct { + // HRESULT error code + Error_ int32 `json:"Error,omitempty"` + // Error message + ErrorMessage string `json:"ErrorMessage,omitempty"` + // Error event details + ErrorEvents []ErrorEvent `json:"ErrorEvents,omitempty"` + // Attribution record + Attribution []AttributionRecord `json:"Attribution,omitempty"` +} diff --git a/internal/hcs/schema2/root.go b/internal/hcs/schema2/root.go new file mode 100644 index 0000000000..c7dcaa5695 --- /dev/null +++ b/internal/hcs/schema2/root.go @@ -0,0 +1,20 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type Root struct { + Path string `json:"path,omitempty"` + // If we make the actual field name `readonly`, it will produce invalid C#. + Readonly bool `json:"readonly,omitempty"` +} diff --git a/internal/hcs/schema2/rs4_network_modify_setting_request.go b/internal/hcs/schema2/rs4_network_modify_setting_request.go new file mode 100644 index 0000000000..8c9cd655ef --- /dev/null +++ b/internal/hcs/schema2/rs4_network_modify_setting_request.go @@ -0,0 +1,26 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +import ( + "encoding/json" +) + +// This class is only necessary because JSON marshaling complains when we have two fields identical except for capitalization in the same class. Remove this once we stop supporting RS4. +type Rs4NetworkModifySettingRequest struct { + RequestType *NetworkModifyRequestType `json:"RequestType,omitempty"` + // Pattern: /^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/ + AdapterInstanceID string `json:"AdapterInstanceID,omitempty"` + Settings *json.RawMessage `json:"Settings,omitempty"` +} diff --git a/internal/hcs/schema2/save_options.go b/internal/hcs/schema2/save_options.go index e55fa1d98a..dde2c0ff76 100644 --- a/internal/hcs/schema2/save_options.go +++ b/internal/hcs/schema2/save_options.go @@ -1,19 +1,22 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema type SaveOptions struct { - - // The type of save operation to be performed. - SaveType string `json:"SaveType,omitempty"` - - // The path to the file that will container the saved state. + SaveType *SaveType `json:"SaveType,omitempty"` + // The path to the runtime state file. + RuntimeStateFilePath string `json:"RuntimeStateFilePath,omitempty"` + // The path to the file that will container the saved state. SaveStateFilePath string `json:"SaveStateFilePath,omitempty"` } diff --git a/internal/hcs/schema2/save_type.go b/internal/hcs/schema2/save_type.go new file mode 100644 index 0000000000..5072ec850a --- /dev/null +++ b/internal/hcs/schema2/save_type.go @@ -0,0 +1,22 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type SaveType string + +// List of SaveType +const ( + SaveType_TO_FILE SaveType = "ToFile" + SaveType_AS_TEMPLATE SaveType = "AsTemplate" +) diff --git a/internal/hcs/schema2/scsi.go b/internal/hcs/schema2/scsi.go index bf253a470b..8850d9fb26 100644 --- a/internal/hcs/schema2/scsi.go +++ b/internal/hcs/schema2/scsi.go @@ -1,16 +1,22 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema -type Scsi struct { - - // Map of attachments, where the key is the integer LUN number on the controller. +// Object describing a SCSI controller. +type SCSI struct { + // Map of attachments, where the key is the integer LUN number on the controller. Attachments map[string]Attachment `json:"Attachments,omitempty"` + // Disable interrupt batching (MNF) for storage to decrease latency and increase throughput, at per-interrupt processing cost. + DisableInterruptBatching bool `json:"DisableInterruptBatching,omitempty"` } diff --git a/internal/hcs/schema2/secure_nested_paging_cpu_id.go b/internal/hcs/schema2/secure_nested_paging_cpu_id.go new file mode 100644 index 0000000000..5871a7d493 --- /dev/null +++ b/internal/hcs/schema2/secure_nested_paging_cpu_id.go @@ -0,0 +1,20 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// An identifier unique to each physical CPU package. +type SecureNestedPagingCpuID struct { + // Per package CPU identifier. + ID []int64 `json:"Id,omitempty"` +} diff --git a/internal/hcs/schema2/secure_nested_paging_info.go b/internal/hcs/schema2/secure_nested_paging_info.go new file mode 100644 index 0000000000..36489be3a6 --- /dev/null +++ b/internal/hcs/schema2/secure_nested_paging_info.go @@ -0,0 +1,22 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// AMD SEV-SNP (secure nested paging) information required for attestation. +type SecureNestedPagingInfo struct { + // List of IDs per socket. + CpuID []SecureNestedPagingCpuID `json:"CpuId,omitempty"` + // SNP TCB (trusted computing base) version. + TcbVersion uint64 `json:"TcbVersion,omitempty"` +} diff --git a/internal/hcs/schema2/security_settings.go b/internal/hcs/schema2/security_settings.go index 14f0299e32..8bd168dbce 100644 --- a/internal/hcs/schema2/security_settings.go +++ b/internal/hcs/schema2/security_settings.go @@ -1,5 +1,9 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * diff --git a/internal/hcs/schema2/serial_console.go b/internal/hcs/schema2/serial_console.go new file mode 100644 index 0000000000..af783b2523 --- /dev/null +++ b/internal/hcs/schema2/serial_console.go @@ -0,0 +1,24 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type SerialConsole string + +// List of SerialConsole +const ( + SerialConsole_DEFAULT_ SerialConsole = "Default" + SerialConsole_DISABLED SerialConsole = "Disabled" + SerialConsole_COM_PORT1 SerialConsole = "ComPort1" + SerialConsole_COM_PORT2 SerialConsole = "ComPort2" +) diff --git a/internal/hcs/schema2/service_properties.go b/internal/hcs/schema2/service_properties.go index b8142ca6a6..48a2b7e25f 100644 --- a/internal/hcs/schema2/service_properties.go +++ b/internal/hcs/schema2/service_properties.go @@ -1,5 +1,9 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * @@ -9,10 +13,14 @@ package hcsschema -import "encoding/json" +import ( + "encoding/json" +) +// Properties of the host type ServiceProperties struct { - // Changed Properties field to []json.RawMessage from []interface{} to avoid having to - // remarshal sp.Properties[n] and unmarshal into the type(s) we want. + // The service properties will be returned as an array corresponding to the requested property types. Properties []json.RawMessage `json:"Properties,omitempty"` + // This is a response object, introduced in version 2.5, which takes the name of the property and its associated query object if needed + PropertyResponses map[string]PropertyResponse `json:"PropertyResponses,omitempty"` } diff --git a/internal/hcs/schema2/service_property_query.go b/internal/hcs/schema2/service_property_query.go new file mode 100644 index 0000000000..db7672c661 --- /dev/null +++ b/internal/hcs/schema2/service_property_query.go @@ -0,0 +1,27 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +import ( + "encoding/json" +) + +// Structure used to perform property query +type ServicePropertyQuery struct { + // Specifies the property array to query + PropertyTypes []GetPropertyType `json:"PropertyTypes,omitempty"` + // Perform filtered property queries + FilteredQueries []FilteredPropertyQuery `json:"FilteredQueries,omitempty"` + PropertyQueries map[string]json.RawMessage `json:"PropertyQueries,omitempty"` +} diff --git a/internal/hcs/schema2/service_property_type.go b/internal/hcs/schema2/service_property_type.go new file mode 100644 index 0000000000..80fe88cd3a --- /dev/null +++ b/internal/hcs/schema2/service_property_type.go @@ -0,0 +1,33 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// ServicePropertyType : legacy service property types New implementation uses GetPropertyType and ModifyPropertyType +type ServicePropertyType string + +// List of Service_PropertyType +const ( + ServicePropertyType_BASIC ServicePropertyType = "Basic" + ServicePropertyType_MEMORY ServicePropertyType = "Memory" + ServicePropertyType_CPU_GROUP ServicePropertyType = "CpuGroup" + ServicePropertyType_PROCESSOR_TOPOLOGY ServicePropertyType = "ProcessorTopology" + ServicePropertyType_CACHE_ALLOCATION ServicePropertyType = "CacheAllocation" + ServicePropertyType_CACHE_MONITORING ServicePropertyType = "CacheMonitoring" + ServicePropertyType_CONTAINER_CREDENTIAL_GUARD ServicePropertyType = "ContainerCredentialGuard" + ServicePropertyType_QO_S_CAPABILITIES ServicePropertyType = "QoSCapabilities" + ServicePropertyType_MEMORY_BW_ALLOCATION ServicePropertyType = "MemoryBwAllocation" + ServicePropertyType_PROCESSOR ServicePropertyType = "Processor" + ServicePropertyType_SECURE_NESTED_PAGING ServicePropertyType = "SecureNestedPaging" + ServicePropertyType_UNDEFINED ServicePropertyType = "Undefined" +) diff --git a/internal/hcs/schema2/services.go b/internal/hcs/schema2/services.go new file mode 100644 index 0000000000..2d2fe7421d --- /dev/null +++ b/internal/hcs/schema2/services.go @@ -0,0 +1,21 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type Services struct { + Heartbeat *Heartbeat `json:"Heartbeat,omitempty"` + Shutdown *Shutdown `json:"Shutdown,omitempty"` + Timesync *Timesync `json:"Timesync,omitempty"` + KvpExchange *KvpExchange `json:"KvpExchange,omitempty"` +} diff --git a/internal/hcs/schema2/set_mba_cos_throttle_value_request.go b/internal/hcs/schema2/set_mba_cos_throttle_value_request.go new file mode 100644 index 0000000000..5c9da03891 --- /dev/null +++ b/internal/hcs/schema2/set_mba_cos_throttle_value_request.go @@ -0,0 +1,19 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type SetMbaCosThrottleValueRequest struct { + CosIndex uint32 `json:"CosIndex,omitempty"` + CosThrottleValue uint32 `json:"CosThrottleValue,omitempty"` +} diff --git a/internal/hcs/schema2/set_property_operation.go b/internal/hcs/schema2/set_property_operation.go new file mode 100644 index 0000000000..28ce2bd798 --- /dev/null +++ b/internal/hcs/schema2/set_property_operation.go @@ -0,0 +1,22 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// Set properties operation settings +type SetPropertyOperation struct { + // Pattern: /^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/ + GroupID string `json:"GroupId,omitempty"` + PropertyCode uint32 `json:"PropertyCode,omitempty"` + PropertyValue uint64 `json:"PropertyValue,omitempty"` +} diff --git a/internal/hcs/schema2/sgx_launch_control_mode.go b/internal/hcs/schema2/sgx_launch_control_mode.go new file mode 100644 index 0000000000..95db643a5f --- /dev/null +++ b/internal/hcs/schema2/sgx_launch_control_mode.go @@ -0,0 +1,24 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// SgxLaunchControlMode : Flexible launch control (FLC) mode allows the guest's operating system to control which enclaves to be launched on the host. The specified MSR here is IA32_SGXLEPUBKEYHASH +type SgxLaunchControlMode string + +// List of SgxLaunchControlMode +const ( + SgxLaunchControlMode_NO_ACCESS SgxLaunchControlMode = "NoAccess" + SgxLaunchControlMode_READ_ONLY SgxLaunchControlMode = "ReadOnly" + SgxLaunchControlMode_READ_WRITE SgxLaunchControlMode = "ReadWrite" +) diff --git a/internal/hcs/schema2/sgx_memory.go b/internal/hcs/schema2/sgx_memory.go new file mode 100644 index 0000000000..9e63f0575e --- /dev/null +++ b/internal/hcs/schema2/sgx_memory.go @@ -0,0 +1,25 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// Sgx refers to Intel Software Guard Extension. This property allows a fixed amount of enclave page cache memory allocated on the host to be mapped to the guest +type SgxMemory struct { + // Enablement of Sgx memory support in VM + Enabled bool `json:"Enabled,omitempty"` + // The amount of enclave page cache memory to assign to the VM + SizeInMB uint64 `json:"SizeInMB,omitempty"` + LaunchControlMode *SgxLaunchControlMode `json:"LaunchControlMode,omitempty"` + // Flexible launch control mode's MSR values that the guest starts with. The specified MSR here is IA32_SGXLEPUBKEYHASH + LaunchControlDefault string `json:"LaunchControlDefault,omitempty"` +} diff --git a/internal/hcs/schema2/shared_memory_configuration.go b/internal/hcs/schema2/shared_memory_configuration.go index df9baa9219..0c56700d13 100644 --- a/internal/hcs/schema2/shared_memory_configuration.go +++ b/internal/hcs/schema2/shared_memory_configuration.go @@ -1,9 +1,13 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ diff --git a/internal/hcs/schema2/shared_memory_region.go b/internal/hcs/schema2/shared_memory_region.go index 825b71865d..49109fb04a 100644 --- a/internal/hcs/schema2/shared_memory_region.go +++ b/internal/hcs/schema2/shared_memory_region.go @@ -1,22 +1,22 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema type SharedMemoryRegion struct { - SectionName string `json:"SectionName,omitempty"` - - StartOffset int32 `json:"StartOffset,omitempty"` - - Length int32 `json:"Length,omitempty"` - - AllowGuestWrite bool `json:"AllowGuestWrite,omitempty"` - - HiddenFromGuest bool `json:"HiddenFromGuest,omitempty"` + SectionName string `json:"SectionName,omitempty"` + StartOffset uint64 `json:"StartOffset,omitempty"` + Length uint64 `json:"Length,omitempty"` + AllowGuestWrite bool `json:"AllowGuestWrite,omitempty"` + HiddenFromGuest bool `json:"HiddenFromGuest,omitempty"` } diff --git a/internal/hcs/schema2/shared_memory_region_info.go b/internal/hcs/schema2/shared_memory_region_info.go index f67b08eb57..ae75105458 100644 --- a/internal/hcs/schema2/shared_memory_region_info.go +++ b/internal/hcs/schema2/shared_memory_region_info.go @@ -1,16 +1,19 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema type SharedMemoryRegionInfo struct { - SectionName string `json:"SectionName,omitempty"` - - GuestPhysicalAddress int32 `json:"GuestPhysicalAddress,omitempty"` + SectionName string `json:"SectionName,omitempty"` + GuestPhysicalAddress uint64 `json:"GuestPhysicalAddress,omitempty"` } diff --git a/internal/hcs/schema2/model_namespace.go b/internal/hcs/schema2/shutdown.go similarity index 60% rename from internal/hcs/schema2/model_namespace.go rename to internal/hcs/schema2/shutdown.go index 3ab9cf1ecf..e0333c7053 100644 --- a/internal/hcs/schema2/model_namespace.go +++ b/internal/hcs/schema2/shutdown.go @@ -1,5 +1,9 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * @@ -9,7 +13,5 @@ package hcsschema -type DeviceExtensionNamespace struct { - Ob *ObjectNamespace `json:"ob,omitempty"` - Device *DeviceNamespace `json:"device,omitempty"` +type Shutdown struct { } diff --git a/internal/hcs/schema2/shutdown_mechanism.go b/internal/hcs/schema2/shutdown_mechanism.go new file mode 100644 index 0000000000..237c3f180e --- /dev/null +++ b/internal/hcs/schema2/shutdown_mechanism.go @@ -0,0 +1,23 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// ShutdownMechanism : Different mechanisms to perform a shutdown operation +type ShutdownMechanism string + +// List of ShutdownMechanism +const ( + ShutdownMechanism_GUEST_CONNECTION ShutdownMechanism = "GuestConnection" + ShutdownMechanism_INTEGRATION_SERVICE ShutdownMechanism = "IntegrationService" +) diff --git a/internal/hcs/schema2/shutdown_options.go b/internal/hcs/schema2/shutdown_options.go new file mode 100644 index 0000000000..8b8a5c1ddb --- /dev/null +++ b/internal/hcs/schema2/shutdown_options.go @@ -0,0 +1,24 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// Options for HcsShutdownComputeSystem +type ShutdownOptions struct { + Mechanism *ShutdownMechanism `json:"Mechanism,omitempty"` + Type_ *ShutdownType `json:"Type,omitempty"` + // If this shutdown is forceful or not + Force bool `json:"Force,omitempty"` + // Reason for the shutdown + Reason string `json:"Reason,omitempty"` +} diff --git a/internal/hcs/schema2/shutdown_type.go b/internal/hcs/schema2/shutdown_type.go new file mode 100644 index 0000000000..3ce52c0db3 --- /dev/null +++ b/internal/hcs/schema2/shutdown_type.go @@ -0,0 +1,24 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// ShutdownType : Different operations that are related or classified as a type of shutdown +type ShutdownType string + +// List of ShutdownType +const ( + ShutdownType_SHUTDOWN ShutdownType = "Shutdown" + ShutdownType_HIBERNATE ShutdownType = "Hibernate" + ShutdownType_REBOOT ShutdownType = "Reboot" +) diff --git a/internal/hcs/schema2/signal_process_options.go b/internal/hcs/schema2/signal_process_options.go new file mode 100644 index 0000000000..d788f8760c --- /dev/null +++ b/internal/hcs/schema2/signal_process_options.go @@ -0,0 +1,18 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type SignalProcessOptions struct { + Signal *ProcessSignal `json:"Signal,omitempty"` +} diff --git a/internal/hcs/schema2/silo_properties.go b/internal/hcs/schema2/silo_properties.go index 5eaf6a7f4a..0425c94145 100644 --- a/internal/hcs/schema2/silo_properties.go +++ b/internal/hcs/schema2/silo_properties.go @@ -1,17 +1,20 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema -// Silo job information +// Silo job information type SiloProperties struct { - Enabled bool `json:"Enabled,omitempty"` - + Enabled bool `json:"Enabled,omitempty"` JobName string `json:"JobName,omitempty"` } diff --git a/internal/hcs/schema2/silo_settings.go b/internal/hcs/schema2/silo_settings.go new file mode 100644 index 0000000000..165e3feeb3 --- /dev/null +++ b/internal/hcs/schema2/silo_settings.go @@ -0,0 +1,25 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type SiloSettings struct { + // If running this virtual machine inside a silo, the base OS path to use for the silo. + SiloBaseOSPath string `json:"SiloBaseOsPath,omitempty"` + // Request a notification when the job object for the silo is available. + NotifySiloJobCreated bool `json:"NotifySiloJobCreated,omitempty"` + // The filesystem layers to use for the silo. + FileSystemLayers []Layer `json:"FileSystemLayers,omitempty"` + // The bindings to use for the silo. + Bindings []BatchedBinding `json:"Bindings,omitempty"` +} diff --git a/internal/hcs/schema2/state.go b/internal/hcs/schema2/state.go new file mode 100644 index 0000000000..e4af3da778 --- /dev/null +++ b/internal/hcs/schema2/state.go @@ -0,0 +1,27 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// State : Compute system state which is exposed to external clients +type State string + +// List of State +const ( + State_CREATED State = "Created" + State_RUNNING State = "Running" + State_PAUSED State = "Paused" + State_STOPPED State = "Stopped" + State_SAVED_AS_TEMPLATE State = "SavedAsTemplate" + State_UNKNOWN State = "Unknown" +) diff --git a/internal/hcs/schema2/state_override.go b/internal/hcs/schema2/state_override.go new file mode 100644 index 0000000000..737a442757 --- /dev/null +++ b/internal/hcs/schema2/state_override.go @@ -0,0 +1,23 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type StateOverride string + +// List of StateOverride +const ( + StateOverride_DEFAULT_ StateOverride = "Default" + StateOverride_DISABLED StateOverride = "Disabled" + StateOverride_ENABLED StateOverride = "Enabled" +) diff --git a/internal/hcs/schema2/statistics.go b/internal/hcs/schema2/statistics.go index ba7a6b3963..4646760f70 100644 --- a/internal/hcs/schema2/statistics.go +++ b/internal/hcs/schema2/statistics.go @@ -1,9 +1,13 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ @@ -13,17 +17,12 @@ import ( "time" ) -// Runtime statistics for a container +// Runtime statistics for a container type Statistics struct { - Timestamp time.Time `json:"Timestamp,omitempty"` - - ContainerStartTime time.Time `json:"ContainerStartTime,omitempty"` - - Uptime100ns uint64 `json:"Uptime100ns,omitempty"` - - Processor *ProcessorStats `json:"Processor,omitempty"` - - Memory *MemoryStats `json:"Memory,omitempty"` - - Storage *StorageStats `json:"Storage,omitempty"` + Timestamp time.Time `json:"Timestamp,omitempty"` + ContainerStartTime time.Time `json:"ContainerStartTime,omitempty"` + Uptime100ns uint64 `json:"Uptime100ns,omitempty"` + Processor *ProcessorStats `json:"Processor,omitempty"` + Memory *MemoryStats `json:"Memory,omitempty"` + Storage *StorageStats `json:"Storage,omitempty"` } diff --git a/internal/hcs/schema2/std_handle.go b/internal/hcs/schema2/std_handle.go new file mode 100644 index 0000000000..f05a333125 --- /dev/null +++ b/internal/hcs/schema2/std_handle.go @@ -0,0 +1,24 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type StdHandle string + +// List of StdHandle +const ( + StdHandle_STD_IN StdHandle = "StdIn" + StdHandle_STD_OUT StdHandle = "StdOut" + StdHandle_STD_ERR StdHandle = "StdErr" + StdHandle_ALL StdHandle = "All" +) diff --git a/internal/hcs/schema2/storage.go b/internal/hcs/schema2/storage.go index 2627af9132..619d874063 100644 --- a/internal/hcs/schema2/storage.go +++ b/internal/hcs/schema2/storage.go @@ -1,21 +1,22 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema type Storage struct { - - // List of layers that describe the parent hierarchy for a container's storage. These layers combined together, presented as a disposable and/or committable working storage, are used by the container to record all changes done to the parent layers. + // List of layers that describe the parent hierarchy for a container's storage. These layers combined together, presented as a disposable and/or committable working storage, are used by the container to record all changes done to the parent layers. Layers []Layer `json:"Layers,omitempty"` - - // Path that points to the scratch space of a container, where parent layers are combined together to present a new disposable and/or committable layer with the changes done during its runtime. - Path string `json:"Path,omitempty"` - - QoS *StorageQoS `json:"QoS,omitempty"` + // Path that points to the scratch space of a container, where parent layers are combined together to present a new disposable and/or committable layer with the changes done during its runtime. + Path string `json:"Path,omitempty"` + QoS *StorageQoS `json:"QoS,omitempty"` } diff --git a/internal/hcs/schema2/storage_qo_s.go b/internal/hcs/schema2/storage_qo_s.go index 9c5e6eb532..c42eadf080 100644 --- a/internal/hcs/schema2/storage_qo_s.go +++ b/internal/hcs/schema2/storage_qo_s.go @@ -1,16 +1,22 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema +// Describes storage quality of service settings, relative to a storage volume. type StorageQoS struct { - IopsMaximum int32 `json:"IopsMaximum,omitempty"` - - BandwidthMaximum int32 `json:"BandwidthMaximum,omitempty"` + // Defines the maximum allowed Input/Output operations per second in a volume. + IOPSMaximum uint64 `json:"IopsMaximum,omitempty"` + // Defines the maximum bandwidth (bytes per second) allowed in a volume. + BandwidthMaximum uint64 `json:"BandwidthMaximum,omitempty"` } diff --git a/internal/hcs/schema2/storage_stats.go b/internal/hcs/schema2/storage_stats.go index 4f042ffd93..6d07849526 100644 --- a/internal/hcs/schema2/storage_stats.go +++ b/internal/hcs/schema2/storage_stats.go @@ -1,21 +1,22 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema -// Storage runtime statistics +// Storage runtime statistics type StorageStats struct { - ReadCountNormalized uint64 `json:"ReadCountNormalized,omitempty"` - - ReadSizeBytes uint64 `json:"ReadSizeBytes,omitempty"` - + ReadCountNormalized uint64 `json:"ReadCountNormalized,omitempty"` + ReadSizeBytes uint64 `json:"ReadSizeBytes,omitempty"` WriteCountNormalized uint64 `json:"WriteCountNormalized,omitempty"` - - WriteSizeBytes uint64 `json:"WriteSizeBytes,omitempty"` + WriteSizeBytes uint64 `json:"WriteSizeBytes,omitempty"` } diff --git a/internal/hcs/schema2/subnode.go b/internal/hcs/schema2/subnode.go new file mode 100644 index 0000000000..dfa98486e6 --- /dev/null +++ b/internal/hcs/schema2/subnode.go @@ -0,0 +1,19 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type Subnode struct { + Type_ *SubnodeType `json:"Type,omitempty"` + ID uint64 `json:"Id,omitempty"` +} diff --git a/internal/hcs/schema2/subnode_type.go b/internal/hcs/schema2/subnode_type.go new file mode 100644 index 0000000000..be7122e9c7 --- /dev/null +++ b/internal/hcs/schema2/subnode_type.go @@ -0,0 +1,24 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type SubnodeType string + +// List of SubnodeType +const ( + SubnodeType_ANY SubnodeType = "Any" + SubnodeType_SOCKET SubnodeType = "Socket" + SubnodeType_CLUSTER SubnodeType = "Cluster" + SubnodeType_L3 SubnodeType = "L3" +) diff --git a/internal/hcs/schema2/system_exit.go b/internal/hcs/schema2/system_exit.go new file mode 100644 index 0000000000..fecd2aa03d --- /dev/null +++ b/internal/hcs/schema2/system_exit.go @@ -0,0 +1,19 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type SystemExit struct { + Detail *SystemExitDetail `json:"Detail,omitempty"` + Initiator *ExitInitiator `json:"Initiator,omitempty"` +} diff --git a/internal/hcs/schema2/system_exit_detail.go b/internal/hcs/schema2/system_exit_detail.go new file mode 100644 index 0000000000..d6956a62ce --- /dev/null +++ b/internal/hcs/schema2/system_exit_detail.go @@ -0,0 +1,26 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type SystemExitDetail string + +// List of SystemExitDetail +const ( + SystemExitDetail_INVALID SystemExitDetail = "Invalid" + SystemExitDetail_HCS_API_FATAL_ERROR SystemExitDetail = "HcsApiFatalError" + SystemExitDetail_SERVICE_STOP SystemExitDetail = "ServiceStop" + SystemExitDetail_SHUTDOWN SystemExitDetail = "Shutdown" + SystemExitDetail_TERMINATE SystemExitDetail = "Terminate" + SystemExitDetail_UNEXPECTED_EXIT SystemExitDetail = "UnexpectedExit" +) diff --git a/internal/hcs/schema2/system_exit_status.go b/internal/hcs/schema2/system_exit_status.go new file mode 100644 index 0000000000..4b219e9495 --- /dev/null +++ b/internal/hcs/schema2/system_exit_status.go @@ -0,0 +1,22 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// Document provided in the EventData parameter of an HcsEventSystemExited HCS_EVENT. +type SystemExitStatus struct { + // Exit status (HRESULT) for the system. + Status int32 `json:"Status,omitempty"` + ExitType *NotificationType `json:"ExitType,omitempty"` + Attribution []AttributionRecord `json:"Attribution,omitempty"` +} diff --git a/internal/hcs/schema2/system_processor_modification_request.go b/internal/hcs/schema2/system_processor_modification_request.go new file mode 100644 index 0000000000..dab20571f9 --- /dev/null +++ b/internal/hcs/schema2/system_processor_modification_request.go @@ -0,0 +1,20 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// Structure used to request a system processor modification +type SystemProcessorModificationRequest struct { + // Pattern: /^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/ + GroupID string `json:"GroupId,omitempty"` +} diff --git a/internal/hcs/schema2/system_property_query.go b/internal/hcs/schema2/system_property_query.go new file mode 100644 index 0000000000..ccf0175a3d --- /dev/null +++ b/internal/hcs/schema2/system_property_query.go @@ -0,0 +1,25 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +import ( + "encoding/json" +) + +// By default the basic properties will be returned. This query provides a way to request specific properties. +type SystemPropertyQuery struct { + PropertyTypes []SystemPropertyType `json:"PropertyTypes,omitempty"` + // This is a new property request object, introduced in version 2.5, which takes the names of the properties and their associated query objects if needed. + Queries map[string]json.RawMessage `json:"Queries,omitempty"` +} diff --git a/internal/hcs/schema2/system_property_type.go b/internal/hcs/schema2/system_property_type.go new file mode 100644 index 0000000000..c36a53e1fc --- /dev/null +++ b/internal/hcs/schema2/system_property_type.go @@ -0,0 +1,37 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// SystemPropertyType : Compute system property types. The properties will be returned as a Schema.Responses.System.Properties instance. +type SystemPropertyType string + +// List of System_PropertyType +const ( + SystemPropertyType_MEMORY SystemPropertyType = "Memory" + SystemPropertyType_GUEST_MEMORY SystemPropertyType = "GuestMemory" + SystemPropertyType_CONTAINER_MEMORY SystemPropertyType = "ContainerMemory" + SystemPropertyType_CPU_GROUP SystemPropertyType = "CpuGroup" + SystemPropertyType_STATISTICS SystemPropertyType = "Statistics" + SystemPropertyType_PROCESS_LIST SystemPropertyType = "ProcessList" + SystemPropertyType_TERMINATE_ON_LAST_HANDLE_CLOSED SystemPropertyType = "TerminateOnLastHandleClosed" + SystemPropertyType_SYSTEM_GUID SystemPropertyType = "SystemGUID" + SystemPropertyType_SHARED_MEMORY_REGION SystemPropertyType = "SharedMemoryRegion" + SystemPropertyType_SILO SystemPropertyType = "Silo" + SystemPropertyType_GUEST_CONNECTION SystemPropertyType = "GuestConnection" + SystemPropertyType_COS_INDEX SystemPropertyType = "CosIndex" + SystemPropertyType_RMID SystemPropertyType = "Rmid" + SystemPropertyType_CACHE_STATS SystemPropertyType = "CacheStats" + SystemPropertyType_IDLED_PROCESSORS SystemPropertyType = "IdledProcessors" + SystemPropertyType_CPU_FREQUENCY_POWER_CAP SystemPropertyType = "CpuFrequencyPowerCap" +) diff --git a/internal/hcs/schema2/system_query.go b/internal/hcs/schema2/system_query.go new file mode 100644 index 0000000000..7bd24f01a8 --- /dev/null +++ b/internal/hcs/schema2/system_query.go @@ -0,0 +1,21 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type SystemQuery struct { + Ids []string `json:"Ids,omitempty"` + Names []string `json:"Names,omitempty"` + Types []SystemType `json:"Types,omitempty"` + Owners []string `json:"Owners,omitempty"` +} diff --git a/internal/hcs/schema2/system_time.go b/internal/hcs/schema2/system_time.go index 72de801493..cf3e6085bc 100644 --- a/internal/hcs/schema2/system_time.go +++ b/internal/hcs/schema2/system_time.go @@ -1,28 +1,25 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema type SystemTime struct { - Year int32 `json:"Year,omitempty"` - - Month int32 `json:"Month,omitempty"` - - DayOfWeek int32 `json:"DayOfWeek,omitempty"` - - Day int32 `json:"Day,omitempty"` - - Hour int32 `json:"Hour,omitempty"` - - Minute int32 `json:"Minute,omitempty"` - - Second int32 `json:"Second,omitempty"` - - Milliseconds int32 `json:"Milliseconds,omitempty"` + Year uint16 `json:"Year,omitempty"` + Month uint16 `json:"Month,omitempty"` + DayOfWeek uint16 `json:"DayOfWeek,omitempty"` + Day uint16 `json:"Day,omitempty"` + Hour uint16 `json:"Hour,omitempty"` + Minute uint16 `json:"Minute,omitempty"` + Second uint16 `json:"Second,omitempty"` + Milliseconds uint16 `json:"Milliseconds,omitempty"` } diff --git a/internal/hcs/schema2/system_type.go b/internal/hcs/schema2/system_type.go new file mode 100644 index 0000000000..01934f8814 --- /dev/null +++ b/internal/hcs/schema2/system_type.go @@ -0,0 +1,22 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type SystemType string + +// List of SystemType +const ( + SystemType_CONTAINER SystemType = "Container" + SystemType_VIRTUAL_MACHINE SystemType = "VirtualMachine" +) diff --git a/internal/hcs/schema2/system_type_lookup.go b/internal/hcs/schema2/system_type_lookup.go new file mode 100644 index 0000000000..547e40c8cf --- /dev/null +++ b/internal/hcs/schema2/system_type_lookup.go @@ -0,0 +1,10 @@ +package hcsschema + +import "strings" + +func NewSystemType(x string) (SystemType, error) { + return enumLookup(map[string]SystemType{ + strings.ToLower(string(SystemType_CONTAINER)): SystemType_CONTAINER, + strings.ToLower(string(SystemType_VIRTUAL_MACHINE)): SystemType_VIRTUAL_MACHINE, + }, strings.ToLower(x)) +} diff --git a/internal/hcs/schema2/time_zone_information.go b/internal/hcs/schema2/time_zone_information.go index 529743d753..b03757fdac 100644 --- a/internal/hcs/schema2/time_zone_information.go +++ b/internal/hcs/schema2/time_zone_information.go @@ -1,26 +1,24 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema type TimeZoneInformation struct { - Bias int32 `json:"Bias,omitempty"` - - StandardName string `json:"StandardName,omitempty"` - + Bias int32 `json:"Bias,omitempty"` + StandardName string `json:"StandardName,omitempty"` StandardDate *SystemTime `json:"StandardDate,omitempty"` - - StandardBias int32 `json:"StandardBias,omitempty"` - - DaylightName string `json:"DaylightName,omitempty"` - + StandardBias int32 `json:"StandardBias,omitempty"` + DaylightName string `json:"DaylightName,omitempty"` DaylightDate *SystemTime `json:"DaylightDate,omitempty"` - - DaylightBias int32 `json:"DaylightBias,omitempty"` + DaylightBias int32 `json:"DaylightBias,omitempty"` } diff --git a/internal/hcs/schema2/timesync.go b/internal/hcs/schema2/timesync.go new file mode 100644 index 0000000000..12b733ee86 --- /dev/null +++ b/internal/hcs/schema2/timesync.go @@ -0,0 +1,17 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type Timesync struct { +} diff --git a/internal/hcs/schema2/topology.go b/internal/hcs/schema2/topology.go index 8348699403..25ad56642b 100644 --- a/internal/hcs/schema2/topology.go +++ b/internal/hcs/schema2/topology.go @@ -1,16 +1,20 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema type Topology struct { - Memory *Memory2 `json:"Memory,omitempty"` - - Processor *Processor2 `json:"Processor,omitempty"` + Memory *VirtualMachineMemory `json:"Memory,omitempty"` + Processor *VirtualMachineProcessor `json:"Processor,omitempty"` + Numa *Numa `json:"Numa,omitempty"` } diff --git a/internal/hcs/schema2/triple_fault.go b/internal/hcs/schema2/triple_fault.go new file mode 100644 index 0000000000..d2b716d0e5 --- /dev/null +++ b/internal/hcs/schema2/triple_fault.go @@ -0,0 +1,18 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type TripleFault struct { + ErrorType uint64 `json:"ErrorType,omitempty"` +} diff --git a/internal/hcs/schema2/uefi.go b/internal/hcs/schema2/uefi.go index 9228923fe4..d14f13a1d7 100644 --- a/internal/hcs/schema2/uefi.go +++ b/internal/hcs/schema2/uefi.go @@ -1,9 +1,13 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ @@ -11,12 +15,10 @@ package hcsschema type Uefi struct { EnableDebugger bool `json:"EnableDebugger,omitempty"` - - ApplySecureBootTemplate string `json:"ApplySecureBootTemplate,omitempty"` - - SecureBootTemplateId string `json:"SecureBootTemplateId,omitempty"` - - BootThis *UefiBootEntry `json:"BootThis,omitempty"` - - Console string `json:"Console,omitempty"` + // Pattern: /^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/ + SecureBootTemplateID string `json:"SecureBootTemplateId,omitempty"` + ApplySecureBootTemplate *ApplySecureBootTemplateType `json:"ApplySecureBootTemplate,omitempty"` + BootThis *UefiBootEntry `json:"BootThis,omitempty"` + Console *SerialConsole `json:"Console,omitempty"` + StopOnBootFailure bool `json:"StopOnBootFailure,omitempty"` } diff --git a/internal/hcs/schema2/uefi_boot_device.go b/internal/hcs/schema2/uefi_boot_device.go new file mode 100644 index 0000000000..8755d30a44 --- /dev/null +++ b/internal/hcs/schema2/uefi_boot_device.go @@ -0,0 +1,24 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type UefiBootDevice string + +// List of UefiBootDevice +const ( + UefiBootDevice_SCSI_DRIVE UefiBootDevice = "ScsiDrive" + UefiBootDevice_VMB_FS UefiBootDevice = "VmbFs" + UefiBootDevice_NETWORK UefiBootDevice = "Network" + UefiBootDevice_FILE UefiBootDevice = "File" +) diff --git a/internal/hcs/schema2/uefi_boot_entry.go b/internal/hcs/schema2/uefi_boot_entry.go index 3ab409d825..7bd8afd351 100644 --- a/internal/hcs/schema2/uefi_boot_entry.go +++ b/internal/hcs/schema2/uefi_boot_entry.go @@ -1,22 +1,22 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema type UefiBootEntry struct { - DeviceType string `json:"DeviceType,omitempty"` - - DevicePath string `json:"DevicePath,omitempty"` - - DiskNumber int32 `json:"DiskNumber,omitempty"` - - OptionalData string `json:"OptionalData,omitempty"` - - VmbFsRootPath string `json:"VmbFsRootPath,omitempty"` + DeviceType *UefiBootDevice `json:"DeviceType,omitempty"` + DevicePath string `json:"DevicePath,omitempty"` + DiskNumber uint16 `json:"DiskNumber,omitempty"` + OptionalData string `json:"OptionalData,omitempty"` + VmbFsRootPath string `json:"VmbFsRootPath,omitempty"` } diff --git a/internal/hcs/schema2/uefi_system_information.go b/internal/hcs/schema2/uefi_system_information.go new file mode 100644 index 0000000000..9d5ec98d0a --- /dev/null +++ b/internal/hcs/schema2/uefi_system_information.go @@ -0,0 +1,25 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type UefiSystemInformation struct { + Manufacturer string `json:"Manufacturer,omitempty"` + ProductName string `json:"ProductName,omitempty"` + Version string `json:"Version,omitempty"` + SerialNumber string `json:"SerialNumber,omitempty"` + // Pattern: /^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/ + UUID string `json:"UUID,omitempty"` + SKUNumber string `json:"SKUNumber,omitempty"` + Family string `json:"Family,omitempty"` +} diff --git a/internal/hcs/schema2/user.go b/internal/hcs/schema2/user.go new file mode 100644 index 0000000000..bbd883326d --- /dev/null +++ b/internal/hcs/schema2/user.go @@ -0,0 +1,21 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type User struct { + Uid uint32 `json:"uid,omitempty"` + Gid uint32 `json:"gid,omitempty"` + AdditionalGids []int64 `json:"additionalGids,omitempty"` + Username string `json:"username,omitempty"` +} diff --git a/internal/hcs/schema2/v_smb_share_flags.go b/internal/hcs/schema2/v_smb_share_flags.go new file mode 100644 index 0000000000..0894f16049 --- /dev/null +++ b/internal/hcs/schema2/v_smb_share_flags.go @@ -0,0 +1,43 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// VSmbShareFlags : The comment is used for internal only, remove it if publish this enum These correspond to share flags in vm\\dv\\storage\\vsmb\\inc\\vmusrv.h +type VSmbShareFlags string + +// List of VSmbShareFlags +const ( + VSmbShareFlags_NONE VSmbShareFlags = "None" + VSmbShareFlags_READ_ONLY VSmbShareFlags = "ReadOnly" + VSmbShareFlags_SHARE_READ VSmbShareFlags = "ShareRead" + VSmbShareFlags_CACHE_IO VSmbShareFlags = "CacheIO" + VSmbShareFlags_NO_OPLOCKS VSmbShareFlags = "NoOplocks" + VSmbShareFlags_TAKE_BACKUP_PRIVILEGE VSmbShareFlags = "TakeBackupPrivilege" + VSmbShareFlags_USE_SHARE_ROOT_IDENTITY VSmbShareFlags = "UseShareRootIdentity" + VSmbShareFlags_NO_DIRECTMAP VSmbShareFlags = "NoDirectmap" + VSmbShareFlags_NO_LOCKS VSmbShareFlags = "NoLocks" + VSmbShareFlags_NO_DIRNOTIFY VSmbShareFlags = "NoDirnotify" + VSmbShareFlags_TEST VSmbShareFlags = "Test" + VSmbShareFlags_VM_SHARED_MEMORY VSmbShareFlags = "VmSharedMemory" + VSmbShareFlags_RESTRICT_FILE_ACCESS VSmbShareFlags = "RestrictFileAccess" + VSmbShareFlags_FORCE_LEVEL_II_OPLOCKS VSmbShareFlags = "ForceLevelIIOplocks" + VSmbShareFlags_REPARSE_BASE_LAYER VSmbShareFlags = "ReparseBaseLayer" + VSmbShareFlags_PSEUDO_OPLOCKS VSmbShareFlags = "PseudoOplocks" + VSmbShareFlags_NON_CACHE_IO VSmbShareFlags = "NonCacheIO" + VSmbShareFlags_PSEUDO_DIRNOTIFY VSmbShareFlags = "PseudoDirnotify" + VSmbShareFlags_DISABLE_INDEXING VSmbShareFlags = "DisableIndexing" + VSmbShareFlags_HIDE_ALTERNATE_DATA_STREAMS VSmbShareFlags = "HideAlternateDataStreams" + VSmbShareFlags_ENABLE_FSCTL_FILTERING VSmbShareFlags = "EnableFsctlFiltering" + VSmbShareFlags_ALLOW_NEW_CREATES VSmbShareFlags = "AllowNewCreates" +) diff --git a/internal/hcs/schema2/v_smb_share_flags_lookup.go b/internal/hcs/schema2/v_smb_share_flags_lookup.go new file mode 100644 index 0000000000..872af0d946 --- /dev/null +++ b/internal/hcs/schema2/v_smb_share_flags_lookup.go @@ -0,0 +1,28 @@ +package hcsschema + +func (x VSmbShareFlags) Int64() (int64, error) { + return enumLookup(map[VSmbShareFlags]int64{ + VSmbShareFlags_NONE: 0x00000000, + VSmbShareFlags_READ_ONLY: 0x00000001, + VSmbShareFlags_SHARE_READ: 0x00000002, + VSmbShareFlags_CACHE_IO: 0x00000004, + VSmbShareFlags_NO_OPLOCKS: 0x00000008, + VSmbShareFlags_TAKE_BACKUP_PRIVILEGE: 0x00000010, + VSmbShareFlags_USE_SHARE_ROOT_IDENTITY: 0x00000020, + VSmbShareFlags_NO_DIRECTMAP: 0x00000040, + VSmbShareFlags_NO_LOCKS: 0x00000080, + VSmbShareFlags_NO_DIRNOTIFY: 0x00000100, + VSmbShareFlags_TEST: 0x00000200, + VSmbShareFlags_VM_SHARED_MEMORY: 0x00000400, + VSmbShareFlags_RESTRICT_FILE_ACCESS: 0x00000800, + VSmbShareFlags_FORCE_LEVEL_II_OPLOCKS: 0x00001000, + VSmbShareFlags_REPARSE_BASE_LAYER: 0x00002000, + VSmbShareFlags_PSEUDO_OPLOCKS: 0x00004000, + VSmbShareFlags_NON_CACHE_IO: 0x00008000, + VSmbShareFlags_PSEUDO_DIRNOTIFY: 0x00010000, + VSmbShareFlags_DISABLE_INDEXING: 0x00020000, + VSmbShareFlags_HIDE_ALTERNATE_DATA_STREAMS: 0x00040000, + VSmbShareFlags_ENABLE_FSCTL_FILTERING: 0x00080000, + VSmbShareFlags_ALLOW_NEW_CREATES: 0x00100000, + }, x) +} diff --git a/internal/hcs/schema2/version.go b/internal/hcs/schema2/version.go index 2abfccca31..4db486c099 100644 --- a/internal/hcs/schema2/version.go +++ b/internal/hcs/schema2/version.go @@ -1,16 +1,22 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema +// Object that describes a version with a Major.Minor format. type Version struct { - Major int32 `json:"Major,omitempty"` - - Minor int32 `json:"Minor,omitempty"` + // The major version value. Individual major versions are not compatible with one another. + Major uint32 `json:"Major,omitempty"` + // The minor version value. A lower minor version is considered a compatible subset of a higher minor version. + Minor uint32 `json:"Minor,omitempty"` } diff --git a/internal/hcs/schema2/video_monitor.go b/internal/hcs/schema2/video_monitor.go index ec5d0fb936..ced802d3c9 100644 --- a/internal/hcs/schema2/video_monitor.go +++ b/internal/hcs/schema2/video_monitor.go @@ -1,18 +1,21 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema type VideoMonitor struct { - HorizontalResolution int32 `json:"HorizontalResolution,omitempty"` - - VerticalResolution int32 `json:"VerticalResolution,omitempty"` - - ConnectionOptions *RdpConnectionOptions `json:"ConnectionOptions,omitempty"` + HorizontalResolution uint16 `json:"HorizontalResolution,omitempty"` + VerticalResolution uint16 `json:"VerticalResolution,omitempty"` + ConnectionOptions *RdpConnectionOptions `json:"ConnectionOptions,omitempty"` + ResolutionType int64 `json:"ResolutionType,omitempty"` } diff --git a/internal/hcs/schema2/virtio_serial.go b/internal/hcs/schema2/virtio_serial.go new file mode 100644 index 0000000000..6dc668e499 --- /dev/null +++ b/internal/hcs/schema2/virtio_serial.go @@ -0,0 +1,18 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type VirtioSerial struct { + Ports map[string]VirtioSerialPort `json:"Ports,omitempty"` +} diff --git a/internal/hcs/schema2/virtio_serial_port.go b/internal/hcs/schema2/virtio_serial_port.go new file mode 100644 index 0000000000..453cbd32c2 --- /dev/null +++ b/internal/hcs/schema2/virtio_serial_port.go @@ -0,0 +1,19 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type VirtioSerialPort struct { + NamedPipe string `json:"NamedPipe,omitempty"` + Name string `json:"Name,omitempty"` +} diff --git a/internal/hcs/schema2/virtual_device_failure.go b/internal/hcs/schema2/virtual_device_failure.go new file mode 100644 index 0000000000..27d2272b65 --- /dev/null +++ b/internal/hcs/schema2/virtual_device_failure.go @@ -0,0 +1,29 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// Provides information on failures originated by a virtual device. +type VirtualDeviceFailure struct { + Detail *VirtualDeviceFailureDetail `json:"Detail,omitempty"` + // Friendly name of the virtual device. + Name string `json:"Name,omitempty"` + // Id of the virtual device. + // + // Pattern: /^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/ + DeviceID string `json:"DeviceId,omitempty"` + // Instance Id of the virtual device. + // + // Pattern: /^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/ + InstanceID string `json:"InstanceId,omitempty"` +} diff --git a/internal/hcs/schema2/virtual_device_failure_detail.go b/internal/hcs/schema2/virtual_device_failure_detail.go new file mode 100644 index 0000000000..7566e36b46 --- /dev/null +++ b/internal/hcs/schema2/virtual_device_failure_detail.go @@ -0,0 +1,47 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// VirtualDeviceFailureDetail : Provides detail on the context in which a virtual device failed. +type VirtualDeviceFailureDetail string + +// List of VirtualDeviceFailureDetail +const ( + VirtualDeviceFailureDetail_NONE VirtualDeviceFailureDetail = "None" + VirtualDeviceFailureDetail_CREATE VirtualDeviceFailureDetail = "Create" + VirtualDeviceFailureDetail_INITIALIZE VirtualDeviceFailureDetail = "Initialize" + VirtualDeviceFailureDetail_START_RESERVING_RESOURCES VirtualDeviceFailureDetail = "StartReservingResources" + VirtualDeviceFailureDetail_FINISH_RESERVING_RESOURCES VirtualDeviceFailureDetail = "FinishReservingResources" + VirtualDeviceFailureDetail_FREE_RESERVED_RESOURCES VirtualDeviceFailureDetail = "FreeReservedResources" + VirtualDeviceFailureDetail_SAVE_RESERVED_RESOURCES VirtualDeviceFailureDetail = "SaveReservedResources" + VirtualDeviceFailureDetail_POWER_ON_COLD VirtualDeviceFailureDetail = "PowerOnCold" + VirtualDeviceFailureDetail_POWER_ON_RESTORE VirtualDeviceFailureDetail = "PowerOnRestore" + VirtualDeviceFailureDetail_POWER_OFF VirtualDeviceFailureDetail = "PowerOff" + VirtualDeviceFailureDetail_SAVE VirtualDeviceFailureDetail = "Save" + VirtualDeviceFailureDetail_RESUME VirtualDeviceFailureDetail = "Resume" + VirtualDeviceFailureDetail_PAUSE VirtualDeviceFailureDetail = "Pause" + VirtualDeviceFailureDetail_ENABLE_OPTIMIZATIONS VirtualDeviceFailureDetail = "EnableOptimizations" + VirtualDeviceFailureDetail_START_DISABLE_OPTIMIZATIONS VirtualDeviceFailureDetail = "StartDisableOptimizations" + VirtualDeviceFailureDetail_FINISH_DISABLE_OPTIMIZATIONS VirtualDeviceFailureDetail = "FinishDisableOptimizations" + VirtualDeviceFailureDetail_RESET VirtualDeviceFailureDetail = "Reset" + VirtualDeviceFailureDetail_POST_RESET VirtualDeviceFailureDetail = "PostReset" + VirtualDeviceFailureDetail_TEARDOWN VirtualDeviceFailureDetail = "Teardown" + VirtualDeviceFailureDetail_SAVE_COMPATIBILITY_INFO VirtualDeviceFailureDetail = "SaveCompatibilityInfo" + VirtualDeviceFailureDetail_METRIC_RESTORE VirtualDeviceFailureDetail = "MetricRestore" + VirtualDeviceFailureDetail_METRIC_ENUMERATE VirtualDeviceFailureDetail = "MetricEnumerate" + VirtualDeviceFailureDetail_METRIC_ENUMERATE_FOR_SAVE VirtualDeviceFailureDetail = "MetricEnumerateForSave" + VirtualDeviceFailureDetail_METRIC_RESET VirtualDeviceFailureDetail = "MetricReset" + VirtualDeviceFailureDetail_METRIC_ENABLE VirtualDeviceFailureDetail = "MetricEnable" + VirtualDeviceFailureDetail_METRIC_DISABLE VirtualDeviceFailureDetail = "MetricDisable" +) diff --git a/internal/hcs/schema2/virtual_machine.go b/internal/hcs/schema2/virtual_machine.go index 1e0fab2890..7ddd719f9e 100644 --- a/internal/hcs/schema2/virtual_machine.go +++ b/internal/hcs/schema2/virtual_machine.go @@ -1,36 +1,42 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema +// Configuration of a virtual machine, used during its creation to set up and/or use resources. type VirtualMachine struct { - - // StopOnReset is private in the schema. If regenerated need to put back. - StopOnReset bool `json:"StopOnReset,omitempty"` - - Chipset *Chipset `json:"Chipset,omitempty"` - - ComputeTopology *Topology `json:"ComputeTopology,omitempty"` - - Devices *Devices `json:"Devices,omitempty"` - - GuestState *GuestState `json:"GuestState,omitempty"` - - RestoreState *RestoreState `json:"RestoreState,omitempty"` - + Version *Version `json:"Version,omitempty"` + // When set to true, the virtual machine will treat a reset as a stop, releasing resources and cleaning up state. + StopOnReset bool `json:"StopOnReset,omitempty"` + Chipset *Chipset `json:"Chipset,omitempty"` + ComputeTopology *Topology `json:"ComputeTopology,omitempty"` + Devices *Devices `json:"Devices,omitempty"` + Services *Services `json:"Services,omitempty"` + GuestState *GuestState `json:"GuestState,omitempty"` + RestoreState *RestoreState `json:"RestoreState,omitempty"` RegistryChanges *RegistryChanges `json:"RegistryChanges,omitempty"` - - StorageQoS *StorageQoS `json:"StorageQoS,omitempty"` - + StorageQoS *StorageQoS `json:"StorageQoS,omitempty"` + RunInSilo *SiloSettings `json:"RunInSilo,omitempty"` + DebugOptions *DebugOptions `json:"DebugOptions,omitempty"` + LaunchOptions *LaunchOptions `json:"LaunchOptions,omitempty"` GuestConnection *GuestConnection `json:"GuestConnection,omitempty"` - - SecuritySettings *SecuritySettings `json:"SecuritySettings,omitempty"` - - DebugOptions *DebugOptions `json:"DebugOptions,omitempty"` + // Reserved field for VMMS configuration schema (embedded XML). + LegacySettings string `json:"LegacySettings,omitempty"` + // Reserved field for VMMS (VM display name). + DisplayName string `json:"DisplayName,omitempty"` + // Reserved field for VMMS (VM configuration type). + ConfigurationType string `json:"ConfigurationType,omitempty"` + SecuritySettings *SecuritySettings `json:"SecuritySettings,omitempty"` + // An option to allow guest to control the cache types + EnableGuestControlledCacheTypes bool `json:"EnableGuestControlledCacheTypes,omitempty"` } diff --git a/internal/hcs/schema2/hv_socket_2.go b/internal/hcs/schema2/virtual_machine_hv_socket.go similarity index 56% rename from internal/hcs/schema2/hv_socket_2.go rename to internal/hcs/schema2/virtual_machine_hv_socket.go index a017691f02..05a8f7586d 100644 --- a/internal/hcs/schema2/hv_socket_2.go +++ b/internal/hcs/schema2/virtual_machine_hv_socket.go @@ -1,15 +1,19 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema -// HvSocket configuration for a VM -type HvSocket2 struct { +// HvSocket configuration for a VM +type VirtualMachineHvSocket struct { HvSocketConfig *HvSocketSystemConfig `json:"HvSocketConfig,omitempty"` } diff --git a/internal/hcs/schema2/virtual_machine_memory.go b/internal/hcs/schema2/virtual_machine_memory.go new file mode 100644 index 0000000000..81ee14a6e8 --- /dev/null +++ b/internal/hcs/schema2/virtual_machine_memory.go @@ -0,0 +1,51 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type VirtualMachineMemory struct { + SizeInMB uint64 `json:"SizeInMB,omitempty"` + Backing *MemoryBackingType `json:"Backing,omitempty"` + // If enabled, then the VM's memory is backed by the Windows pagefile rather than physically backed, statically allocated memory. + AllowOvercommit bool `json:"AllowOvercommit,omitempty"` + BackingPageSize *MemoryBackingPageSize `json:"BackingPageSize,omitempty"` + // Fault clustering size for primary RAM. + FaultClusterSizeShift uint32 `json:"FaultClusterSizeShift,omitempty"` + // Fault clustering size for direct mapped memory. + DirectMapFaultClusterSizeShift uint32 `json:"DirectMapFaultClusterSizeShift,omitempty"` + // If enabled, then each backing page is physically pinned on first access. + PinBackingPages bool `json:"PinBackingPages,omitempty"` + // If enabled, then backing page chunks smaller than the backing page size are never used unless the system is under extreme memory pressure. If the backing page size is Small, then it is forced to Large when this option is enabled. + ForbidSmallBackingPages bool `json:"ForbidSmallBackingPages,omitempty"` + EnablePrivateCompressionStore bool `json:"EnablePrivateCompressionStore,omitempty"` + // If enabled, then the memory hot hint feature is exposed to the VM, allowing it to prefetch pages into its working set. (if supported by the guest operating system). + EnableHotHint bool `json:"EnableHotHint,omitempty"` + // If enabled, then the memory cold hint feature is exposed to the VM, allowing it to trim zeroed pages from its working set (if supported by the guest operating system). + EnableColdHint bool `json:"EnableColdHint,omitempty"` + // If enabled, then the memory cold discard hint feature is exposed to the VM, allowing it to trim non-zeroed pages from the working set (if supported by the guest operating system). + EnableColdDiscardHint bool `json:"EnableColdDiscardHint,omitempty"` + // If enabled, then the base address of direct-mapped host images is exposed to the guest. + ImageBaseAddressesExposed bool `json:"ImageBaseAddressesExposed,omitempty"` + SharedMemoryMB int64 `json:"SharedMemoryMB,omitempty"` + DisableSharedMemoryMapping bool `json:"DisableSharedMemoryMapping,omitempty"` + SharedMemoryAccessSids []string `json:"SharedMemoryAccessSids,omitempty"` + EnableEpf bool `json:"EnableEpf,omitempty"` + // If enabled, then commit is not charged for each backing page until first access. + EnableDeferredCommit bool `json:"EnableDeferredCommit,omitempty"` + // Low MMIO region allocated below 4GB + LowMMIOGapInMB uint64 `json:"LowMmioGapInMB,omitempty"` + // High MMIO region allocated above 4GB (base and size) + HighMMIOBaseInMB uint64 `json:"HighMmioBaseInMB,omitempty"` + HighMMIOGapInMB uint64 `json:"HighMmioGapInMB,omitempty"` + SgxMemory *SgxMemory `json:"SgxMemory,omitempty"` +} diff --git a/internal/hcs/schema2/virtual_machine_processor.go b/internal/hcs/schema2/virtual_machine_processor.go new file mode 100644 index 0000000000..3b5f22d226 --- /dev/null +++ b/internal/hcs/schema2/virtual_machine_processor.go @@ -0,0 +1,38 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type VirtualMachineProcessor struct { + Count uint32 `json:"Count,omitempty"` + Limit uint64 `json:"Limit,omitempty"` + Weight uint64 `json:"Weight,omitempty"` + Reservation uint64 `json:"Reservation,omitempty"` + // Provides the target maximum CPU frequency, in MHz, for a virtual machine. + MaximumFrequencyMHz uint32 `json:"MaximumFrequencyMHz,omitempty"` + ExposeVirtualizationExtensions bool `json:"ExposeVirtualizationExtensions,omitempty"` + EnablePerfmonPmu bool `json:"EnablePerfmonPmu,omitempty"` + EnablePerfmonPebs bool `json:"EnablePerfmonPebs,omitempty"` + EnablePerfmonLbr bool `json:"EnablePerfmonLbr,omitempty"` + EnablePerfmonIpt bool `json:"EnablePerfmonIpt,omitempty"` + SynchronizeHostFeatures bool `json:"SynchronizeHostFeatures,omitempty"` + EnableSchedulerAssist bool `json:"EnableSchedulerAssist,omitempty"` + DefaultVpCpuPriority uint32 `json:"DefaultVpCpuPriority,omitempty"` + EnableProcessorIdling bool `json:"EnableProcessorIdling,omitempty"` + // Useful to enable if you want to protect against the Intel Processor Machine Check Error vulnerability (CVE-2018-12207). For instance, if you have some virtual machines that you trust that won't cause denial of service on the virtualization hosts and some that you don't trust. Additionally, disabling this may improve guest performance for some workloads. This feature does nothing on non-Intel machines or on Intel machines that are not vulnerable to CVE-2018-12207. + EnablePageShattering bool `json:"EnablePageShattering,omitempty"` + // Hides the presence of speculation controls commonly used by guest operating systems as part of side channel vulnerability mitigations. Additionally, these mitigations are often detrimental to guest operating system performance + DisableSpeculationControls bool `json:"DisableSpeculationControls,omitempty"` + ProcessorFeatureSet *ProcessorFeatureSet `json:"ProcessorFeatureSet,omitempty"` + CpuGroup *CpuGroup `json:"CpuGroup,omitempty"` +} diff --git a/internal/hcs/schema2/virtual_node_info.go b/internal/hcs/schema2/virtual_node_info.go index 91a3c83d4f..be6e226e8a 100644 --- a/internal/hcs/schema2/virtual_node_info.go +++ b/internal/hcs/schema2/virtual_node_info.go @@ -1,20 +1,21 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema type VirtualNodeInfo struct { - VirtualNodeIndex int32 `json:"VirtualNodeIndex,omitempty"` - - PhysicalNodeNumber int32 `json:"PhysicalNodeNumber,omitempty"` - - VirtualProcessorCount int32 `json:"VirtualProcessorCount,omitempty"` - - MemoryUsageInPages int32 `json:"MemoryUsageInPages,omitempty"` + VirtualNodeIndex uint8 `json:"VirtualNodeIndex,omitempty"` + PhysicalNodeNumber uint8 `json:"PhysicalNodeNumber,omitempty"` + VirtualProcessorCount uint32 `json:"VirtualProcessorCount,omitempty"` + MemoryUsageInPages uint64 `json:"MemoryUsageInPages,omitempty"` } diff --git a/internal/hcs/schema2/virtual_p_mem_backing_type.go b/internal/hcs/schema2/virtual_p_mem_backing_type.go new file mode 100644 index 0000000000..8acecf83ec --- /dev/null +++ b/internal/hcs/schema2/virtual_p_mem_backing_type.go @@ -0,0 +1,22 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type VirtualPMemBackingType string + +// List of VirtualPMemBackingType +const ( + VirtualPMemBackingType_VIRTUAL VirtualPMemBackingType = "Virtual" + VirtualPMemBackingType_PHYSICAL VirtualPMemBackingType = "Physical" +) diff --git a/internal/hcs/schema2/virtual_p_mem_controller.go b/internal/hcs/schema2/virtual_p_mem_controller.go index f5b7f3e38c..e6da4ed389 100644 --- a/internal/hcs/schema2/virtual_p_mem_controller.go +++ b/internal/hcs/schema2/virtual_p_mem_controller.go @@ -1,9 +1,13 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ @@ -11,10 +15,8 @@ package hcsschema type VirtualPMemController struct { Devices map[string]VirtualPMemDevice `json:"Devices,omitempty"` - - MaximumCount uint32 `json:"MaximumCount,omitempty"` - - MaximumSizeBytes uint64 `json:"MaximumSizeBytes,omitempty"` - - Backing string `json:"Backing,omitempty"` + // This field indicates how many empty devices to add to the controller. If non-zero, additional VirtualPMemDevice objects with no HostPath and no Mappings will be added to the Devices map to get up to the MaximumCount. These devices will be configured with either the MaximumSizeBytes field if non-zero, or with the default maximum, 512 Mb. + MaximumCount uint8 `json:"MaximumCount,omitempty"` + MaximumSizeBytes uint64 `json:"MaximumSizeBytes,omitempty"` + Backing *VirtualPMemBackingType `json:"Backing,omitempty"` } diff --git a/internal/hcs/schema2/virtual_p_mem_device.go b/internal/hcs/schema2/virtual_p_mem_device.go index 70cf2d90de..cb9fd8d33b 100644 --- a/internal/hcs/schema2/virtual_p_mem_device.go +++ b/internal/hcs/schema2/virtual_p_mem_device.go @@ -1,18 +1,22 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema type VirtualPMemDevice struct { - HostPath string `json:"HostPath,omitempty"` - - ReadOnly bool `json:"ReadOnly,omitempty"` - - ImageFormat string `json:"ImageFormat,omitempty"` + HostPath string `json:"HostPath,omitempty"` + ReadOnly bool `json:"ReadOnly,omitempty"` + ImageFormat *VirtualPMemImageFormat `json:"ImageFormat,omitempty"` + SizeBytes uint64 `json:"SizeBytes,omitempty"` + Mappings map[string]VirtualPMemMapping `json:"Mappings,omitempty"` } diff --git a/internal/hcs/schema2/virtual_p_mem_image_format.go b/internal/hcs/schema2/virtual_p_mem_image_format.go new file mode 100644 index 0000000000..eadbb970bb --- /dev/null +++ b/internal/hcs/schema2/virtual_p_mem_image_format.go @@ -0,0 +1,22 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type VirtualPMemImageFormat string + +// List of VirtualPMemImageFormat +const ( + VirtualPMemImageFormat_VHDX VirtualPMemImageFormat = "Vhdx" + VirtualPMemImageFormat_VHD1 VirtualPMemImageFormat = "Vhd1" +) diff --git a/internal/hcs/schema2/virtual_p_mem_mapping.go b/internal/hcs/schema2/virtual_p_mem_mapping.go index 9ef322f615..b2d2fba8ee 100644 --- a/internal/hcs/schema2/virtual_p_mem_mapping.go +++ b/internal/hcs/schema2/virtual_p_mem_mapping.go @@ -1,5 +1,9 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * @@ -10,6 +14,6 @@ package hcsschema type VirtualPMemMapping struct { - HostPath string `json:"HostPath,omitempty"` - ImageFormat string `json:"ImageFormat,omitempty"` + HostPath string `json:"HostPath,omitempty"` + ImageFormat *VirtualPMemImageFormat `json:"ImageFormat,omitempty"` } diff --git a/internal/hcs/schema2/virtual_pci_device.go b/internal/hcs/schema2/virtual_pci_device.go index f5e05903c5..38316a41a5 100644 --- a/internal/hcs/schema2/virtual_pci_device.go +++ b/internal/hcs/schema2/virtual_pci_device.go @@ -1,16 +1,18 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.3 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema -// TODO: This is pre-release support in schema 2.3. Need to add build number -// docs when a public build with this is out. -type VirtualPciDevice struct { - Functions []VirtualPciFunction `json:",omitempty"` +type VirtualPCIDevice struct { + Functions []VirtualPCIFunction `json:"Functions,omitempty"` } diff --git a/internal/hcs/schema2/virtual_pci_function.go b/internal/hcs/schema2/virtual_pci_function.go index cedb7d18bc..9afe54f2ae 100644 --- a/internal/hcs/schema2/virtual_pci_function.go +++ b/internal/hcs/schema2/virtual_pci_function.go @@ -1,18 +1,20 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.3 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema -// TODO: This is pre-release support in schema 2.3. Need to add build number -// docs when a public build with this is out. -type VirtualPciFunction struct { - DeviceInstancePath string `json:",omitempty"` - - VirtualFunction uint16 `json:",omitempty"` +type VirtualPCIFunction struct { + DeviceInstancePath string `json:"DeviceInstancePath,omitempty"` + VirtualFunction uint16 `json:"VirtualFunction,omitempty"` + AllowDirectTranslatedP2P bool `json:"AllowDirectTranslatedP2P,omitempty"` } diff --git a/internal/hcs/schema2/virtual_smb.go b/internal/hcs/schema2/virtual_smb.go index 362df363e1..8eaa554108 100644 --- a/internal/hcs/schema2/virtual_smb.go +++ b/internal/hcs/schema2/virtual_smb.go @@ -1,16 +1,19 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema type VirtualSmb struct { - Shares []VirtualSmbShare `json:"Shares,omitempty"` - - DirectFileMappingInMB int64 `json:"DirectFileMappingInMB,omitempty"` + Shares []VirtualSmbShare `json:"Shares,omitempty"` + DirectFileMappingInMB int64 `json:"DirectFileMappingInMB,omitempty"` } diff --git a/internal/hcs/schema2/virtual_smb_alternate_data_stream.go b/internal/hcs/schema2/virtual_smb_alternate_data_stream.go new file mode 100644 index 0000000000..a26c738212 --- /dev/null +++ b/internal/hcs/schema2/virtual_smb_alternate_data_stream.go @@ -0,0 +1,23 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type VirtualSmbAlternateDataStream struct { + // Name of the alternate data stream. + Name string `json:"Name,omitempty"` + // Data to be written to the alternate data stream. + // + // Pattern: /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/ + Contents string `json:"Contents,omitempty"` +} diff --git a/internal/hcs/schema2/virtual_smb_share.go b/internal/hcs/schema2/virtual_smb_share.go index 915e9b6386..4d614104c0 100644 --- a/internal/hcs/schema2/virtual_smb_share.go +++ b/internal/hcs/schema2/virtual_smb_share.go @@ -1,20 +1,27 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema -type VirtualSmbShare struct { - Name string `json:"Name,omitempty"` - - Path string `json:"Path,omitempty"` - - AllowedFiles []string `json:"AllowedFiles,omitempty"` +// MODIFICATION: updated []int64 to []uint32 for AllowedFsctls - Options *VirtualSmbShareOptions `json:"Options,omitempty"` +type VirtualSmbShare struct { + Name string `json:"Name,omitempty"` + Path string `json:"Path,omitempty"` + Flags int64 `json:"Flags,omitempty"` + AllowedFiles []string `json:"AllowedFiles,omitempty"` + AllowedFsctls []uint32 `json:"AllowedFsctls,omitempty"` + PrefetchFiles []string `json:"PrefetchFiles,omitempty"` + AutoCreateAlternateDataStreams []VirtualSmbAlternateDataStream `json:"AutoCreateAlternateDataStreams,omitempty"` + Options *VirtualSmbShareOptions `json:"Options,omitempty"` } diff --git a/internal/hcs/schema2/virtual_smb_share_options.go b/internal/hcs/schema2/virtual_smb_share_options.go index 75196bd8c8..fc2c763ab5 100644 --- a/internal/hcs/schema2/virtual_smb_share_options.go +++ b/internal/hcs/schema2/virtual_smb_share_options.go @@ -1,9 +1,13 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ @@ -11,52 +15,50 @@ package hcsschema type VirtualSmbShareOptions struct { ReadOnly bool `json:"ReadOnly,omitempty"` - - // convert exclusive access to shared read access + // convert exclusive access to shared read access ShareRead bool `json:"ShareRead,omitempty"` - - // all opens will use cached I/O - CacheIo bool `json:"CacheIo,omitempty"` - - // disable oplock support + // all opens will use cached I/O + CacheIO bool `json:"CacheIo,omitempty"` + // disable oplock support NoOplocks bool `json:"NoOplocks,omitempty"` - - // Acquire the backup privilege when attempting to open + // Acquire the backup privilege when attempting to open TakeBackupPrivilege bool `json:"TakeBackupPrivilege,omitempty"` - - // Use the identity of the share root when opening + // Use the identity of the share root when opening UseShareRootIdentity bool `json:"UseShareRootIdentity,omitempty"` - - // disable Direct Mapping + // disable Direct Mapping NoDirectmap bool `json:"NoDirectmap,omitempty"` - - // disable Byterange locks + // disable Byterange locks NoLocks bool `json:"NoLocks,omitempty"` - - // disable Directory CHange Notifications + // disable Directory CHange Notifications NoDirnotify bool `json:"NoDirnotify,omitempty"` - - // share is use for VM shared memory + // test mode + Test bool `json:"Test,omitempty"` + // share is use for VM shared memory VmSharedMemory bool `json:"VmSharedMemory,omitempty"` - - // allow access only to the files specified in AllowedFiles + // allow access only to the files specified in AllowedFiles RestrictFileAccess bool `json:"RestrictFileAccess,omitempty"` - - // disable all oplocks except Level II + // disable all oplocks except Level II ForceLevelIIOplocks bool `json:"ForceLevelIIOplocks,omitempty"` - - // Allow the host to reparse this base layer + // Allow the host to reparse this base layer ReparseBaseLayer bool `json:"ReparseBaseLayer,omitempty"` - - // Enable pseudo-oplocks + // Enable pseudo-oplocks PseudoOplocks bool `json:"PseudoOplocks,omitempty"` - - // All opens will use non-cached IO - NonCacheIo bool `json:"NonCacheIo,omitempty"` - - // Enable pseudo directory change notifications + // All opens will use non-cached IO + NonCacheIO bool `json:"NonCacheIo,omitempty"` + // Enable pseudo directory change notifications PseudoDirnotify bool `json:"PseudoDirnotify,omitempty"` - - // Block directory enumeration, renames, and deletes. + // Content indexing disabled by the host for all files in the share + DisableIndexing bool `json:"DisableIndexing,omitempty"` + // Alternate data streams hidden to the guest (open fails, streams are not enumerated, etc.) + HideAlternateDataStreams bool `json:"HideAlternateDataStreams,omitempty"` + // Only FSCTLs listed in AllowedFsctls are allowed against any files in the share + EnableFsctlFiltering bool `json:"EnableFsctlFiltering,omitempty"` + // allow access only to the files specified in AllowedFiles, plus allow creation of new files. + AllowNewCreates bool `json:"AllowNewCreates,omitempty"` + // Block directory enumeration, renames, and deletes. SingleFileMapping bool `json:"SingleFileMapping,omitempty"` + // Support Cloud Files functionality + SupportCloudFiles bool `json:"SupportCloudFiles,omitempty"` + // Filter EFS attributes from the guest + FilterEncryptionAttributes bool `json:"FilterEncryptionAttributes,omitempty"` } diff --git a/internal/hcs/schema2/vm_memory.go b/internal/hcs/schema2/vm_memory.go index 8e1836dd6b..8900aff931 100644 --- a/internal/hcs/schema2/vm_memory.go +++ b/internal/hcs/schema2/vm_memory.go @@ -1,26 +1,24 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema type VmMemory struct { - AvailableMemory int32 `json:"AvailableMemory,omitempty"` - - AvailableMemoryBuffer int32 `json:"AvailableMemoryBuffer,omitempty"` - - ReservedMemory uint64 `json:"ReservedMemory,omitempty"` - - AssignedMemory uint64 `json:"AssignedMemory,omitempty"` - - SlpActive bool `json:"SlpActive,omitempty"` - - BalancingEnabled bool `json:"BalancingEnabled,omitempty"` - - DmOperationInProgress bool `json:"DmOperationInProgress,omitempty"` + AvailableMemory int32 `json:"AvailableMemory,omitempty"` + AvailableMemoryBuffer int32 `json:"AvailableMemoryBuffer,omitempty"` + ReservedMemory uint64 `json:"ReservedMemory,omitempty"` + AssignedMemory uint64 `json:"AssignedMemory,omitempty"` + SlpActive bool `json:"SlpActive,omitempty"` + BalancingEnabled bool `json:"BalancingEnabled,omitempty"` + DmOperationInProgress bool `json:"DmOperationInProgress,omitempty"` } diff --git a/internal/hcs/schema2/vm_memory_modification_request.go b/internal/hcs/schema2/vm_memory_modification_request.go new file mode 100644 index 0000000000..914b89a1f6 --- /dev/null +++ b/internal/hcs/schema2/vm_memory_modification_request.go @@ -0,0 +1,19 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type VmMemoryModificationRequest struct { + Operation *VmMemoryOperation `json:"Operation,omitempty"` + RequestedPageCount uint64 `json:"RequestedPageCount,omitempty"` +} diff --git a/internal/hcs/schema2/vm_memory_operation.go b/internal/hcs/schema2/vm_memory_operation.go new file mode 100644 index 0000000000..d10a47ae66 --- /dev/null +++ b/internal/hcs/schema2/vm_memory_operation.go @@ -0,0 +1,22 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type VmMemoryOperation string + +// List of VmMemoryOperation +const ( + VmMemoryOperation_RESIZE_MEMORY VmMemoryOperation = "ResizeMemory" + VmMemoryOperation_PREPARE_FOR_MIGRATION VmMemoryOperation = "PrepareForMigration" +) diff --git a/internal/hcs/schema2/vm_processor_requirements.go b/internal/hcs/schema2/vm_processor_requirements.go new file mode 100644 index 0000000000..acb97f82c3 --- /dev/null +++ b/internal/hcs/schema2/vm_processor_requirements.go @@ -0,0 +1,27 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// VM specific processor feature requirements +type VmProcessorRequirements struct { + // Processor features + ProcessorFeatures []ProcessorFeature `json:"ProcessorFeatures,omitempty"` + // Xsave processor features + XsaveProcessorFeatures []XsaveProcessorFeature `json:"XsaveProcessorFeatures,omitempty"` + // Processor cache line flush size + CacheLineFlushSize uint64 `json:"CacheLineFlushSize,omitempty"` + // Processor physical address bits + ImplementedPhysicalAddressBits uint64 `json:"ImplementedPhysicalAddressBits,omitempty"` + NonArchitecturalCoreSharing *NonArchitecturalCoreSharing `json:"NonArchitecturalCoreSharing,omitempty"` +} diff --git a/internal/hcs/schema2/windows_crash_dump_type.go b/internal/hcs/schema2/windows_crash_dump_type.go new file mode 100644 index 0000000000..839d080edf --- /dev/null +++ b/internal/hcs/schema2/windows_crash_dump_type.go @@ -0,0 +1,28 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type WindowsCrashDumpType string + +// List of WindowsCrashDumpType +const ( + WindowsCrashDumpType_DISABLED WindowsCrashDumpType = "Disabled" + WindowsCrashDumpType_FULL WindowsCrashDumpType = "Full" + WindowsCrashDumpType_SUMMARY WindowsCrashDumpType = "Summary" + WindowsCrashDumpType_HEADER WindowsCrashDumpType = "Header" + WindowsCrashDumpType_TRIAGE WindowsCrashDumpType = "Triage" + WindowsCrashDumpType_BITMAP_FULL WindowsCrashDumpType = "BitmapFull" + WindowsCrashDumpType_BITMAP_KERNEL WindowsCrashDumpType = "BitmapKernel" + WindowsCrashDumpType_AUTOMATIC WindowsCrashDumpType = "Automatic" +) diff --git a/internal/hcs/schema2/windows_crash_phase.go b/internal/hcs/schema2/windows_crash_phase.go new file mode 100644 index 0000000000..84fdf8cfcd --- /dev/null +++ b/internal/hcs/schema2/windows_crash_phase.go @@ -0,0 +1,27 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// WindowsCrashPhase : Indicated the progress of a Windows memory dump in a WindowsCrashReport. +type WindowsCrashPhase string + +// List of WindowsCrashPhase +const ( + WindowsCrashPhase_INACTIVE WindowsCrashPhase = "Inactive" + WindowsCrashPhase_CRASH_VALUES WindowsCrashPhase = "CrashValues" + WindowsCrashPhase_STARTING WindowsCrashPhase = "Starting" + WindowsCrashPhase_STARTED WindowsCrashPhase = "Started" + WindowsCrashPhase_WRITING WindowsCrashPhase = "Writing" + WindowsCrashPhase_COMPLETE WindowsCrashPhase = "Complete" +) diff --git a/internal/hcs/schema2/windows_crash_report.go b/internal/hcs/schema2/windows_crash_report.go new file mode 100644 index 0000000000..8555a850ae --- /dev/null +++ b/internal/hcs/schema2/windows_crash_report.go @@ -0,0 +1,37 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// Windows specific crash information +type WindowsCrashReport struct { + // Path to a Windows memory dump file. This will contain the same path as the configured in the GuestCrashReporting device. This field is not valid unless the FinalPhase is Complete. + DumpFile string `json:"DumpFile,omitempty"` + // Major version as reported by the guest OS. + OSMajorVersion uint32 `json:"OsMajorVersion,omitempty"` + // Minor version as reported by the guest OS. + OSMinorVersion uint32 `json:"OsMinorVersion,omitempty"` + // Build number as reported by the guest OS. + OSBuildNumber uint32 `json:"OsBuildNumber,omitempty"` + // Service pack major version as reported by the guest OS. + OSServicePackMajorVersion uint32 `json:"OsServicePackMajorVersion,omitempty"` + // Service pack minor version as reported by the guest OS. + OSServicePackMinorVersion uint32 `json:"OsServicePackMinorVersion,omitempty"` + // Suite mask as reported by the guest OS. + OSSuiteMask uint32 `json:"OsSuiteMask,omitempty"` + // Product type as reported by the guest OS. + OSProductType uint32 `json:"OsProductType,omitempty"` + // Status of the crash dump. S_OK indicates success, other HRESULT values on error. + Status int32 `json:"Status,omitempty"` + FinalPhase *WindowsCrashPhase `json:"FinalPhase,omitempty"` +} diff --git a/internal/hcs/schema2/windows_crash_reporting.go b/internal/hcs/schema2/windows_crash_reporting.go index 8ed7e566d6..27237b2a13 100644 --- a/internal/hcs/schema2/windows_crash_reporting.go +++ b/internal/hcs/schema2/windows_crash_reporting.go @@ -1,16 +1,20 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + /* - * HCS API + * Schema Open API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * - * API version: 2.1 + * API version: 2.4 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package hcsschema type WindowsCrashReporting struct { - DumpFileName string `json:"DumpFileName,omitempty"` - - MaxDumpSize int64 `json:"MaxDumpSize,omitempty"` + DumpFileName string `json:"DumpFileName,omitempty"` + MaxDumpSize int64 `json:"MaxDumpSize,omitempty"` + DumpType *WindowsCrashDumpType `json:"DumpType,omitempty"` } diff --git a/internal/hcs/schema2/worker_exit.go b/internal/hcs/schema2/worker_exit.go new file mode 100644 index 0000000000..4399b4d32b --- /dev/null +++ b/internal/hcs/schema2/worker_exit.go @@ -0,0 +1,22 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type WorkerExit struct { + // Exit code of the virtual machine worker process. + ExitCode uint32 `json:"ExitCode,omitempty"` + Type_ *WorkerExitType `json:"Type,omitempty"` + Detail *WorkerExitDetail `json:"Detail,omitempty"` + Initiator *ExitInitiator `json:"Initiator,omitempty"` +} diff --git a/internal/hcs/schema2/worker_exit_detail.go b/internal/hcs/schema2/worker_exit_detail.go new file mode 100644 index 0000000000..fb4e9c5c89 --- /dev/null +++ b/internal/hcs/schema2/worker_exit_detail.go @@ -0,0 +1,51 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// WorkerExitDetail : Detailed reasons for a VM stop +type WorkerExitDetail string + +// List of WorkerExitDetail +const ( + WorkerExitDetail_INVALID WorkerExitDetail = "Invalid" + WorkerExitDetail_POWER_OFF WorkerExitDetail = "PowerOff" + WorkerExitDetail_POWER_OFF_CRITICAL WorkerExitDetail = "PowerOffCritical" + WorkerExitDetail_RESET WorkerExitDetail = "Reset" + WorkerExitDetail_GUEST_CRASH WorkerExitDetail = "GuestCrash" + WorkerExitDetail_GUEST_FIRMWARE_CRASH WorkerExitDetail = "GuestFirmwareCrash" + WorkerExitDetail_TRIPLE_FAULT WorkerExitDetail = "TripleFault" + WorkerExitDetail_DEVICE_FATAL_APIC_REQUEST WorkerExitDetail = "DeviceFatalApicRequest" + WorkerExitDetail_DEVICE_FATAL_MSR_REQUEST WorkerExitDetail = "DeviceFatalMsrRequest" + WorkerExitDetail_DEVICE_FATAL_EXCEPTION WorkerExitDetail = "DeviceFatalException" + WorkerExitDetail_DEVICE_FATAL_ERROR WorkerExitDetail = "DeviceFatalError" + WorkerExitDetail_DEVICE_MACHINE_CHECK WorkerExitDetail = "DeviceMachineCheck" + WorkerExitDetail_EMULATOR_ERROR WorkerExitDetail = "EmulatorError" + WorkerExitDetail_VID_TERMINATE WorkerExitDetail = "VidTerminate" + WorkerExitDetail_PROCESS_UNEXPECTED_EXIT WorkerExitDetail = "ProcessUnexpectedExit" + WorkerExitDetail_INITIALIZATION_FAILURE WorkerExitDetail = "InitializationFailure" + WorkerExitDetail_INITIALIZATION_START_TIMEOUT WorkerExitDetail = "InitializationStartTimeout" + WorkerExitDetail_COLD_START_FAILURE WorkerExitDetail = "ColdStartFailure" + WorkerExitDetail_RESET_START_FAILURE WorkerExitDetail = "ResetStartFailure" + WorkerExitDetail_FAST_RESTORE_START_FAILURE WorkerExitDetail = "FastRestoreStartFailure" + WorkerExitDetail_RESTORE_START_FAILURE WorkerExitDetail = "RestoreStartFailure" + WorkerExitDetail_FAST_SAVE_PRESERVE_PARTITION WorkerExitDetail = "FastSavePreservePartition" + WorkerExitDetail_FAST_SAVE_PRESERVE_PARTITION_HANDLE_TRANSFER WorkerExitDetail = "FastSavePreservePartitionHandleTransfer" + WorkerExitDetail_FAST_SAVE WorkerExitDetail = "FastSave" + WorkerExitDetail_CLONE_TEMPLATE WorkerExitDetail = "CloneTemplate" + WorkerExitDetail_SAVE WorkerExitDetail = "Save" + WorkerExitDetail_MIGRATE WorkerExitDetail = "Migrate" + WorkerExitDetail_MIGRATE_FAILURE WorkerExitDetail = "MigrateFailure" + WorkerExitDetail_CANNOT_REFERENCE_VM WorkerExitDetail = "CannotReferenceVm" + WorkerExitDetail_MGOT_UNREGISTER WorkerExitDetail = "MgotUnregister" +) diff --git a/internal/hcs/schema2/worker_exit_type.go b/internal/hcs/schema2/worker_exit_type.go new file mode 100644 index 0000000000..88821327b3 --- /dev/null +++ b/internal/hcs/schema2/worker_exit_type.go @@ -0,0 +1,28 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type WorkerExitType string + +// List of WorkerExitType +const ( + WorkerExitType_NONE WorkerExitType = "None" + WorkerExitType_INITIALIZATION_FAILED WorkerExitType = "InitializationFailed" + WorkerExitType_STOPPED WorkerExitType = "Stopped" + WorkerExitType_SAVED WorkerExitType = "Saved" + WorkerExitType_STOPPED_ON_RESET WorkerExitType = "StoppedOnReset" + WorkerExitType_UNEXPECTED_STOP WorkerExitType = "UnexpectedStop" + WorkerExitType_RESET_FAILED WorkerExitType = "ResetFailed" + WorkerExitType_UNRECOVERABLE_ERROR WorkerExitType = "UnrecoverableError" +) diff --git a/internal/hcs/schema2/xsave_processor_feature.go b/internal/hcs/schema2/xsave_processor_feature.go new file mode 100644 index 0000000000..edad940acb --- /dev/null +++ b/internal/hcs/schema2/xsave_processor_feature.go @@ -0,0 +1,53 @@ +// Autogenerated code; DO NOT EDIT. + +// Schema retrieved from branch 'fe_release' and build '20348.1.210507-1500'. + +/* + * Schema Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +// XsaveProcessorFeature : Enum for xsave processor features +type XsaveProcessorFeature string + +// List of XsaveProcessorFeature +const ( + XsaveProcessorFeature_XSAVE XsaveProcessorFeature = "Xsave" + XsaveProcessorFeature_XSAVE_OPT XsaveProcessorFeature = "Xsave_Opt" + XsaveProcessorFeature_AVX XsaveProcessorFeature = "Avx" + XsaveProcessorFeature_AVX2 XsaveProcessorFeature = "Avx2" + XsaveProcessorFeature_FMA XsaveProcessorFeature = "Fma" + XsaveProcessorFeature_MPX XsaveProcessorFeature = "Mpx" + XsaveProcessorFeature_AVX512 XsaveProcessorFeature = "Avx512" + XsaveProcessorFeature_AVX512_DQ XsaveProcessorFeature = "Avx512Dq" + XsaveProcessorFeature_AVX512_CD XsaveProcessorFeature = "Avx512Cd" + XsaveProcessorFeature_AVX512_BW XsaveProcessorFeature = "Avx512Bw" + XsaveProcessorFeature_AVX512_VL XsaveProcessorFeature = "Avx512Vl" + XsaveProcessorFeature_XSAVE_COMP XsaveProcessorFeature = "Xsave_Comp" + XsaveProcessorFeature_XSAVE_SUPERVISOR XsaveProcessorFeature = "Xsave_Supervisor" + XsaveProcessorFeature_XCR1 XsaveProcessorFeature = "Xcr1" + XsaveProcessorFeature_AVX512_BITALG XsaveProcessorFeature = "Avx512_Bitalg" + XsaveProcessorFeature_AVX512_IFMA XsaveProcessorFeature = "AVX512_Ifma" + XsaveProcessorFeature_AVX512_VBMI XsaveProcessorFeature = "Avx512_Vbmi" + XsaveProcessorFeature_AVX512_VBMI2 XsaveProcessorFeature = "Avx512_Vbmi2" + XsaveProcessorFeature_AVX512_VNNI XsaveProcessorFeature = "Avx512_Vnni" + XsaveProcessorFeature_GFNI XsaveProcessorFeature = "Gfni" + XsaveProcessorFeature_VAES XsaveProcessorFeature = "Vaes" + XsaveProcessorFeature_AVX512_VPOPCNTDQ XsaveProcessorFeature = "Avx512_Vpopcntdq" + XsaveProcessorFeature_VPCLMULQDQ XsaveProcessorFeature = "Vpclmulqdq" + XsaveProcessorFeature_AVX512_BF16 XsaveProcessorFeature = "Avx512_Bf16" + XsaveProcessorFeature_AVX512_VP2_INTERSECT XsaveProcessorFeature = "Avx512_Vp2Intersect" + XsaveProcessorFeature_AVX512_FP16 XsaveProcessorFeature = "Avx512Fp16" + XsaveProcessorFeature_XFD XsaveProcessorFeature = "Xfd" + XsaveProcessorFeature_AMX_TILE XsaveProcessorFeature = "AmxTile" + XsaveProcessorFeature_AMX_BF16 XsaveProcessorFeature = "AmxBf16" + XsaveProcessorFeature_AMX_INT8 XsaveProcessorFeature = "AmxInt8" + XsaveProcessorFeature_AVX_VNNI XsaveProcessorFeature = "AvxVnni" + XsaveProcessorFeature_SENTINEL_AMD_XSAVE XsaveProcessorFeature = "SentinelAmdXsave" +) From 6d73fb4c3d23d9ba086e51e69785a30cf0e3aa53 Mon Sep 17 00:00:00 2001 From: Hamza El-Saawy Date: Wed, 20 Sep 2023 13:51:04 -0400 Subject: [PATCH 2/2] Use new schema files Update package to use new `hcsshema` (`internal/hcs/schema2`) package. Changes are minimal: - Use new constants (eg, `hcsschema.ModifyRequestType_ADD` instead of `guestrequest.RequestTypeAdd`) - Rename certain structs (eg, `hcsschema.VirtualMachineMemory` instead of `hcsschema.Memory2`) - Update certain field types (eg, `uint16` for `hcsschema.SystemTime` fields) Updates to `internal\protocol\guestrequest` and `internal\protocol\guestresource` are deferred for future work, when guest protocol definitions and logic (in `internal\guest\prot` and `internal\guest\bridge`) can be be fully merged with the host code in `internal\hcs\schema2` and `internal\gcs`. Signed-off-by: Hamza El-Saawy --- cmd/containerd-shim-runhcs-v1/task_hcs.go | 24 ++-- internal/cmd/cmd.go | 10 +- internal/cow/cow.go | 4 +- internal/cpugroup/cpugroup.go | 47 ++++--- internal/credentials/credentials.go | 61 ++++++--- internal/gcs/container.go | 2 +- internal/gcs/protocol.go | 6 +- internal/hcs/service.go | 2 +- internal/hcs/system.go | 50 ++++--- internal/hcsoci/devices.go | 4 +- internal/hcsoci/hcsdoc_wcow.go | 47 ++++--- internal/hcsoci/resources_wcow.go | 2 +- internal/jobcontainers/jobcontainer.go | 4 +- internal/layers/layers.go | 2 +- internal/log/scrub.go | 2 +- internal/processorinfo/host_information.go | 4 +- internal/protocol/guestrequest/types.go | 12 +- internal/protocol/guestresource/resources.go | 28 ++-- internal/uvm/combine_layers.go | 36 +++-- internal/uvm/computeagent.go | 13 +- internal/uvm/cpugroups.go | 16 ++- internal/uvm/cpulimits_update.go | 14 +- internal/uvm/create.go | 8 +- internal/uvm/create_lcow.go | 67 +++++----- internal/uvm/create_wcow.go | 50 ++++--- internal/uvm/guest_request.go | 7 +- internal/uvm/hvsocket.go | 28 ++-- internal/uvm/memory_update.go | 17 ++- internal/uvm/modify.go | 18 +-- internal/uvm/network.go | 132 ++++++++++++------- internal/uvm/pipes.go | 7 +- internal/uvm/plan9.go | 40 +++--- internal/uvm/scsi/attach.go | 4 +- internal/uvm/scsi/backend.go | 45 +++++-- internal/uvm/scsi/manager.go | 7 +- internal/uvm/security_policy.go | 28 ++-- internal/uvm/start.go | 9 +- internal/uvm/stats.go | 4 +- internal/uvm/timezone.go | 32 ++--- internal/uvm/virtual_device.go | 27 ++-- internal/uvm/vpmem.go | 52 ++++---- internal/uvm/vpmem_mapped.go | 54 ++++---- internal/uvm/vsmb.go | 41 +++--- internal/vm/hcs/boot.go | 3 +- internal/vm/hcs/builder.go | 6 +- internal/vm/hcs/hcs.go | 3 +- internal/vm/hcs/network.go | 29 ++-- internal/vm/hcs/pci.go | 26 ++-- internal/vm/hcs/plan9.go | 36 +++-- internal/vm/hcs/processor.go | 2 +- internal/vm/hcs/scsi.go | 45 ++++--- internal/vm/hcs/stats.go | 4 +- internal/vm/hcs/storage.go | 4 +- internal/vm/hcs/vpmem.go | 30 +++-- internal/vm/hcs/vsmb.go | 32 +++-- internal/vm/hcs/windows.go | 2 +- internal/vm/remotevm/windows.go | 2 +- test/cri-containerd/jobcontainer_test.go | 9 +- 58 files changed, 799 insertions(+), 501 deletions(-) diff --git a/cmd/containerd-shim-runhcs-v1/task_hcs.go b/cmd/containerd-shim-runhcs-v1/task_hcs.go index 77d2aee7ca..c3370b411b 100644 --- a/cmd/containerd-shim-runhcs-v1/task_hcs.go +++ b/cmd/containerd-shim-runhcs-v1/task_hcs.go @@ -818,7 +818,7 @@ func hcsPropertiesToWindowsStats(props *hcsschema.Properties) *stats.Statistics_ func (ht *hcsTask) Stats(ctx context.Context) (*stats.Statistics, error) { s := &stats.Statistics{} - props, err := ht.c.PropertiesV2(ctx, hcsschema.PTStatistics) + props, err := ht.c.PropertiesV2(ctx, hcsschema.SystemPropertyType_STATISTICS) if err != nil { if isStatsNotFound(err) { return nil, errors.Wrapf(errdefs.ErrNotFound, "failed to fetch stats: %s", err) @@ -869,22 +869,22 @@ func (ht *hcsTask) updateTaskContainerResources(ctx context.Context, data interf } func (ht *hcsTask) updateWCOWContainerCPU(ctx context.Context, cpu *specs.WindowsCPUResources) error { - // if host is 20h2+ then we can make a request directly to hcs + // if host is 20h2+ then we can make a request directly to HCS if osversion.Get().Build >= osversion.V20H2 { - req := &hcsschema.Processor{} + req := &hcsschema.ContainerProcessor{} if cpu.Count != nil { procCount := int32(*cpu.Count) hostProcs := processorinfo.ProcessorCount() if ht.host != nil { hostProcs = ht.host.ProcessorCount() } - req.Count = hcsoci.NormalizeProcessorCount(ctx, ht.id, procCount, hostProcs) + req.Count = uint32(hcsoci.NormalizeProcessorCount(ctx, ht.id, procCount, hostProcs)) } if cpu.Maximum != nil { - req.Maximum = int32(*cpu.Maximum) + req.Maximum = int64(*cpu.Maximum) } if cpu.Shares != nil { - req.Weight = int32(*cpu.Shares) + req.Weight = int64(*cpu.Shares) } return ht.requestUpdateContainer(ctx, resourcepaths.SiloProcessorResourcePath, req) } @@ -935,10 +935,14 @@ func (ht *hcsTask) updateLCOWResources(ctx context.Context, data interface{}, an func (ht *hcsTask) requestUpdateContainer(ctx context.Context, resourcePath string, settings interface{}) error { var modification interface{} if ht.isWCOW { - modification = &hcsschema.ModifySettingRequest{ - ResourcePath: resourcePath, - RequestType: guestrequest.RequestTypeUpdate, - Settings: settings, + var err error + if modification, err = hcsschema.NewModifySettingRequest( + resourcePath, + hcsschema.ModifyRequestType_UPDATE, + settings, + nil, // guestRequest + ); err != nil { + return err } } else { modification = guestrequest.ModificationRequest{ diff --git a/internal/cmd/cmd.go b/internal/cmd/cmd.go index d7228619eb..6bc9b12768 100644 --- a/internal/cmd/cmd.go +++ b/internal/cmd/cmd.go @@ -90,6 +90,10 @@ func (err *ExitError) Error() string { return fmt.Sprintf("process exited with exit code %d", err.ExitCode()) } +// TODO: replace with [hcsschema.LinuxProcessParameters] +// NOTE: the Linux GCS uses the hcsschema.ProcessParameters field to exec an (external) process +// in the uVM, which is a custom modification to the bridge protocol. + // Additional fields to hcsschema.ProcessParameters used by LCOW type lcowProcessParameters struct { hcsschema.ProcessParameters @@ -167,9 +171,9 @@ func (c *Cmd) Start() error { wpp.Environment = environment if c.Spec.ConsoleSize != nil { - wpp.ConsoleSize = []int32{ - int32(c.Spec.ConsoleSize.Height), - int32(c.Spec.ConsoleSize.Width), + wpp.ConsoleSize = []uint16{ + uint16(c.Spec.ConsoleSize.Height), + uint16(c.Spec.ConsoleSize.Width), } } x = wpp diff --git a/internal/cow/cow.go b/internal/cow/cow.go index b60cd383b6..7cbad1315f 100644 --- a/internal/cow/cow.go +++ b/internal/cow/cow.go @@ -55,7 +55,7 @@ type ProcessHost interface { // (either hcsschema.ProcessParameters or lcow.ProcessParameters). CreateProcess(ctx context.Context, config interface{}) (Process, error) // OS returns the host's operating system, "linux" or "windows". - OS() string + OS() string // TODO: switch to either hcsschema.OSType or a custom enum defined here // IsOCI specifies whether this is an OCI-compliant process host. If true, // then the configuration passed to CreateProcess should have an OCI process // spec (or nil if this is the initial process in an OCI container). @@ -75,7 +75,7 @@ type Container interface { // Properties returns the requested container properties targeting a V1 schema container. Properties(ctx context.Context, types ...schema1.PropertyType) (*schema1.ContainerProperties, error) // PropertiesV2 returns the requested container properties targeting a V2 schema container. - PropertiesV2(ctx context.Context, types ...hcsschema.PropertyType) (*hcsschema.Properties, error) + PropertiesV2(ctx context.Context, types ...hcsschema.SystemPropertyType) (*hcsschema.Properties, error) // Start starts a container. Start(ctx context.Context) error // Shutdown sends a shutdown request to the container (but does not wait for diff --git a/internal/cpugroup/cpugroup.go b/internal/cpugroup/cpugroup.go index 3abaa9c439..3136d55a91 100644 --- a/internal/cpugroup/cpugroup.go +++ b/internal/cpugroup/cpugroup.go @@ -15,62 +15,75 @@ import ( const NullGroupID = "00000000-0000-0000-0000-000000000000" -// ErrHVStatusInvalidCPUGroupState corresponds to the internal error code for HV_STATUS_INVALID_CPU_GROUP_STATE +// ErrHVStatusInvalidCPUGroupState corresponds to the internal error code for HV_STATUS_INVALID_CPU_GROUP_STATE. var ErrHVStatusInvalidCPUGroupState = errors.New("The hypervisor could not perform the operation because the CPU group is entering or in an invalid state.") // Delete deletes the cpugroup from the host func Delete(ctx context.Context, id string) error { - operation := hcsschema.DeleteGroup + operation := hcsschema.ModifyServiceOperation_DELETE_GROUP details := hcsschema.DeleteGroupOperation{ - GroupId: id, + GroupID: id, } return modifyCPUGroupRequest(ctx, operation, details) } -// modifyCPUGroupRequest is a helper function for making modify calls to a cpugroup -func modifyCPUGroupRequest(ctx context.Context, operation hcsschema.CPUGroupOperation, details interface{}) error { - req := hcsschema.ModificationRequest{ - PropertyType: hcsschema.PTCPUGroup, - Settings: &hcsschema.HostProcessorModificationRequest{ - Operation: operation, - OperationDetails: details, +// modifyCPUGroupRequest is a helper function for making modify calls to a cpugroup. +func modifyCPUGroupRequest(ctx context.Context, operation hcsschema.ModifyServiceOperation, details interface{}) error { + d, err := hcsschema.ToRawMessage(details) + if err != nil { + return fmt.Errorf("encode CPU group operation %q details (%+v) to json: %w", operation, details, err) + } + + req, err := hcsschema.NewModificationRequest( + hcsschema.ModifyPropertyType_CPU_GROUP, + hcsschema.HostProcessorModificationRequest{ + Operation: &operation, + OperationDetails: d, }, + ) + if err != nil { + return err } return hcs.ModifyServiceSettings(ctx, req) } -// Create creates a new cpugroup on the host with a prespecified id +// Create creates a new cpugroup on the host with a prespecified id. func Create(ctx context.Context, id string, logicalProcessors []uint32) error { - operation := hcsschema.CreateGroup + operation := hcsschema.ModifyServiceOperation_CREATE_GROUP + details := &hcsschema.CreateGroupOperation{ - GroupId: strings.ToLower(id), + GroupID: strings.ToLower(id), LogicalProcessors: logicalProcessors, LogicalProcessorCount: uint32(len(logicalProcessors)), } + if err := modifyCPUGroupRequest(ctx, operation, details); err != nil { return errors.Wrapf(err, "failed to make cpugroups CreateGroup request for details %+v", details) } return nil } -// GetCPUGroupConfig finds the cpugroup config information for group with `id` +// GetCPUGroupConfig finds the cpugroup config information for group with `id`. func GetCPUGroupConfig(ctx context.Context, id string) (*hcsschema.CpuGroupConfig, error) { - query := hcsschema.PropertyQuery{ - PropertyTypes: []hcsschema.PropertyType{hcsschema.PTCPUGroup}, + query := hcsschema.ServicePropertyQuery{ + PropertyTypes: []hcsschema.GetPropertyType{hcsschema.GetPropertyType_CPU_GROUP}, } cpuGroupsPresent, err := hcs.GetServiceProperties(ctx, query) if err != nil { return nil, err } + if n := len(cpuGroupsPresent.Properties); n != 1 { + return nil, fmt.Errorf("expected exactly one service property, received %d", n) + } groupConfigs := &hcsschema.CpuGroupConfigurations{} if err := json.Unmarshal(cpuGroupsPresent.Properties[0], groupConfigs); err != nil { return nil, errors.Wrap(err, "failed to unmarshal host cpugroups") } for _, c := range groupConfigs.CpuGroups { - if strings.EqualFold(c.GroupId, id) { + if strings.EqualFold(c.GroupID, id) { return &c, nil } } diff --git a/internal/credentials/credentials.go b/internal/credentials/credentials.go index d9ec9a3490..3e94f93b75 100644 --- a/internal/credentials/credentials.go +++ b/internal/credentials/credentials.go @@ -68,27 +68,27 @@ func CreateCredentialGuard(ctx context.Context, id, credSpec string, hypervisorI // to HCS for creation. For pod scenarios currently we don't have the OCI // spec of a container at UVM creation time, therefore the service table entry // for the CCG instance will have to be hot added. - transport := "LRPC" + transport := hcsschema.ContainerCredentialGuardTransport_LRPC if hypervisorIsolated { - transport = "HvSocket" + transport = hcsschema.ContainerCredentialGuardTransport_HV_SOCKET } - req := hcsschema.ModificationRequest{ - PropertyType: hcsschema.PTContainerCredentialGuard, - Settings: &hcsschema.ContainerCredentialGuardOperationRequest{ - Operation: hcsschema.AddInstance, - OperationDetails: &hcsschema.ContainerCredentialGuardAddInstanceRequest{ - Id: id, - CredentialSpec: credSpec, - Transport: transport, - }, + req, err := newCredentialGuardRequest( + hcsschema.ContainerCredentialGuardModifyOperation_ADD_INSTANCE, + hcsschema.ContainerCredentialGuardAddInstanceRequest{ + ID: id, + CredentialSpec: credSpec, + Transport: &transport, }, + ) + if err != nil { + return nil, nil, err } if err := hcs.ModifyServiceSettings(ctx, req); err != nil { return nil, nil, fmt.Errorf("failed to generate container credential guard instance: %s", err) } - q := hcsschema.PropertyQuery{ - PropertyTypes: []hcsschema.PropertyType{hcsschema.PTContainerCredentialGuard}, + q := hcsschema.ServicePropertyQuery{ + PropertyTypes: []hcsschema.GetPropertyType{hcsschema.GetPropertyType_CONTAINER_CREDENTIAL_GUARD}, } serviceProps, err := hcs.GetServiceProperties(ctx, q) if err != nil { @@ -103,7 +103,7 @@ func CreateCredentialGuard(ctx context.Context, id, credSpec string, hypervisorI return nil, nil, fmt.Errorf("failed to unmarshal container credential guard instances: %s", err) } for _, ccgInstance := range ccgSysInfo.Instances { - if ccgInstance.Id == id { + if ccgInstance.ID == id { ccgResource := &CCGResource{ id, } @@ -117,14 +117,33 @@ func CreateCredentialGuard(ctx context.Context, id, credSpec string, hypervisorI func removeCredentialGuard(ctx context.Context, id string) error { log.G(ctx).WithField("containerID", id).Debug("removing container credential guard") - req := hcsschema.ModificationRequest{ - PropertyType: hcsschema.PTContainerCredentialGuard, - Settings: &hcsschema.ContainerCredentialGuardOperationRequest{ - Operation: hcsschema.RemoveInstance, - OperationDetails: &hcsschema.ContainerCredentialGuardRemoveInstanceRequest{ - Id: id, - }, + req, err := newCredentialGuardRequest( + hcsschema.ContainerCredentialGuardModifyOperation_REMOVE_INSTANCE, + hcsschema.ContainerCredentialGuardRemoveInstanceRequest{ + ID: id, }, + ) + if err != nil { + return err } return hcs.ModifyServiceSettings(ctx, req) } + +func newCredentialGuardRequest( + operation hcsschema.ContainerCredentialGuardModifyOperation, + details any, +) (hcsschema.ModificationRequest, error) { + d, err := hcsschema.ToRawMessage(details) + if err != nil { + return hcsschema.ModificationRequest{}, + fmt.Errorf("encode container credential guard operation %q details (%+v) to json: %w", operation, details, err) + } + + return hcsschema.NewModificationRequest( + hcsschema.ModifyPropertyType_CONTAINER_CREDENTIAL_GUARD, + hcsschema.ContainerCredentialGuardOperationRequest{ + Operation: &operation, + OperationDetails: d, + }, + ) +} diff --git a/internal/gcs/container.go b/internal/gcs/container.go index a64408b834..ac0f264b0c 100644 --- a/internal/gcs/container.go +++ b/internal/gcs/container.go @@ -157,7 +157,7 @@ func (c *Container) Properties(ctx context.Context, types ...schema1.PropertyTyp } // PropertiesV2 returns the requested container properties targeting a V2 schema container. -func (c *Container) PropertiesV2(ctx context.Context, types ...hcsschema.PropertyType) (_ *hcsschema.Properties, err error) { +func (c *Container) PropertiesV2(ctx context.Context, types ...hcsschema.SystemPropertyType) (_ *hcsschema.Properties, err error) { ctx, span := oc.StartSpan(ctx, "gcs::Container::PropertiesV2", oc.WithClientSpanKind) defer span.End() defer func() { oc.SetSpanStatus(span, err) }() diff --git a/internal/gcs/protocol.go b/internal/gcs/protocol.go index 94e55e4c1e..ce82d209b1 100644 --- a/internal/gcs/protocol.go +++ b/internal/gcs/protocol.go @@ -291,14 +291,14 @@ func (q *containerPropertiesQuery) UnmarshalText(b []byte) error { return json.Unmarshal(b, (*schema1.PropertyQuery)(q)) } -type containerPropertiesQueryV2 hcsschema.PropertyQuery +type containerPropertiesQueryV2 hcsschema.SystemPropertyQuery func (q *containerPropertiesQueryV2) MarshalText() ([]byte, error) { - return json.Marshal((*hcsschema.PropertyQuery)(q)) + return json.Marshal((*hcsschema.SystemPropertyQuery)(q)) } func (q *containerPropertiesQueryV2) UnmarshalText(b []byte) error { - return json.Unmarshal(b, (*hcsschema.PropertyQuery)(q)) + return json.Unmarshal(b, (*hcsschema.SystemPropertyQuery)(q)) } type containerGetProperties struct { diff --git a/internal/hcs/service.go b/internal/hcs/service.go index a46b0051df..a022978c5e 100644 --- a/internal/hcs/service.go +++ b/internal/hcs/service.go @@ -11,7 +11,7 @@ import ( ) // GetServiceProperties returns properties of the host compute service. -func GetServiceProperties(ctx context.Context, q hcsschema.PropertyQuery) (*hcsschema.ServiceProperties, error) { +func GetServiceProperties(ctx context.Context, q hcsschema.ServicePropertyQuery) (*hcsschema.ServiceProperties, error) { operation := "hcs::GetServiceProperties" queryb, err := json.Marshal(q) diff --git a/internal/hcs/system.go b/internal/hcs/system.go index cf20adefc9..167e968c21 100644 --- a/internal/hcs/system.go +++ b/internal/hcs/system.go @@ -12,6 +12,9 @@ import ( "syscall" "time" + "github.com/sirupsen/logrus" + "go.opencensus.io/trace" + "github.com/Microsoft/hcsshim/internal/cow" "github.com/Microsoft/hcsshim/internal/hcs/schema1" hcsschema "github.com/Microsoft/hcsshim/internal/hcs/schema2" @@ -21,8 +24,6 @@ import ( "github.com/Microsoft/hcsshim/internal/oc" "github.com/Microsoft/hcsshim/internal/timeout" "github.com/Microsoft/hcsshim/internal/vmcompute" - "github.com/sirupsen/logrus" - "go.opencensus.io/trace" ) type System struct { @@ -35,7 +36,9 @@ type System struct { waitBlock chan struct{} waitError error exitError error - os, typ, owner string + os hcsschema.OSType + typ hcsschema.SystemType + owner string startTime time.Time } @@ -142,26 +145,30 @@ func (computeSystem *System) getCachedProperties(ctx context.Context) error { if err != nil { return err } - computeSystem.typ = strings.ToLower(props.SystemType) - computeSystem.os = strings.ToLower(props.RuntimeOSType) + if computeSystem.typ, err = hcsschema.NewSystemType(props.SystemType); err != nil { + return err + } + if computeSystem.os, err = hcsschema.NewOSType(props.RuntimeOSType); err != nil { + return nil + } computeSystem.owner = strings.ToLower(props.Owner) - if computeSystem.os == "" && computeSystem.typ == "container" { + if computeSystem.os == hcsschema.OSType_EMPTY && computeSystem.typ == hcsschema.SystemType_CONTAINER { // Pre-RS5 HCS did not return the OS, but it only supported containers // that ran Windows. - computeSystem.os = "windows" + computeSystem.os = hcsschema.OSType_WINDOWS } return nil } // OS returns the operating system of the compute system, "linux" or "windows". func (computeSystem *System) OS() string { - return computeSystem.os + return strings.ToLower(string(computeSystem.os)) } // IsOCI returns whether processes in the compute system should be created via // OCI. func (computeSystem *System) IsOCI() bool { - return computeSystem.os == "linux" && computeSystem.typ == "container" + return computeSystem.os == hcsschema.OSType_LINUX && computeSystem.typ == hcsschema.SystemType_CONTAINER } // GetComputeSystems gets a list of the compute systems on the system that match the query @@ -373,8 +380,8 @@ func (computeSystem *System) Properties(ctx context.Context, types ...schema1.Pr func (computeSystem *System) queryInProc( ctx context.Context, props *hcsschema.Properties, - types []hcsschema.PropertyType, -) ([]hcsschema.PropertyType, error) { + types []hcsschema.SystemPropertyType, +) ([]hcsschema.SystemPropertyType, error) { // In the future we can make use of some new functionality in the HCS that allows you // to pass a job object for HCS to use for the container. Currently, the only way we'll // be able to open the job/silo is if we're running as SYSTEM. @@ -388,10 +395,10 @@ func (computeSystem *System) queryInProc( } defer job.Close() - var fallbackQueryTypes []hcsschema.PropertyType + var fallbackQueryTypes []hcsschema.SystemPropertyType for _, propType := range types { switch propType { - case hcsschema.PTStatistics: + case hcsschema.SystemPropertyType_STATISTICS: // Handle a bad caller asking for the same type twice. No use in re-querying if this is // filled in already. if props.Statistics == nil { @@ -477,14 +484,14 @@ func (computeSystem *System) statisticsInProc(job *jobobject.JobObject) (*hcssch } // hcsPropertiesV2Query is a helper to make a HcsGetComputeSystemProperties call using the V2 schema property types. -func (computeSystem *System) hcsPropertiesV2Query(ctx context.Context, types []hcsschema.PropertyType) (*hcsschema.Properties, error) { +func (computeSystem *System) hcsPropertiesV2Query(ctx context.Context, types []hcsschema.SystemPropertyType) (*hcsschema.Properties, error) { operation := "hcs::System::PropertiesV2" if computeSystem.handle == 0 { return nil, makeSystemError(computeSystem, operation, ErrAlreadyClosed, nil) } - queryBytes, err := json.Marshal(hcsschema.PropertyQuery{PropertyTypes: types}) + queryBytes, err := json.Marshal(hcsschema.SystemPropertyQuery{PropertyTypes: types}) if err != nil { return nil, makeSystemError(computeSystem, operation, err, nil) } @@ -507,21 +514,24 @@ func (computeSystem *System) hcsPropertiesV2Query(ctx context.Context, types []h } // PropertiesV2 returns the requested compute systems properties targeting a V2 schema compute system. -func (computeSystem *System) PropertiesV2(ctx context.Context, types ...hcsschema.PropertyType) (_ *hcsschema.Properties, err error) { +func (computeSystem *System) PropertiesV2(ctx context.Context, types ...hcsschema.SystemPropertyType) (_ *hcsschema.Properties, err error) { computeSystem.handleLock.RLock() defer computeSystem.handleLock.RUnlock() // Let HCS tally up the total for VM based queries instead of querying ourselves. - if computeSystem.typ != "container" { + if computeSystem.typ == hcsschema.SystemType_VIRTUAL_MACHINE { return computeSystem.hcsPropertiesV2Query(ctx, types) } + // copy these values just in case they somehow get modified during the query + typ := computeSystem.typ + os := computeSystem.os // Define a starter Properties struct with the default fields returned from every // query. Owner is only returned from Statistics but it's harmless to include. properties := &hcsschema.Properties{ - Id: computeSystem.id, - SystemType: computeSystem.typ, - RuntimeOsType: computeSystem.os, + ID: computeSystem.id, + SystemType: &typ, + RuntimeOSType: &os, Owner: computeSystem.owner, } diff --git a/internal/hcsoci/devices.go b/internal/hcsoci/devices.go index 84548eabcf..5dc5160065 100644 --- a/internal/hcsoci/devices.go +++ b/internal/hcsoci/devices.go @@ -61,7 +61,7 @@ func isDeviceExtensionsSupported() bool { // getDeviceExtensions is a helper function to read the files at `extensionPaths` and unmarshal the contents // into a `hcsshema.DeviceExtension` to be added to a container's hcs create document. -func getDeviceExtensions(annotations map[string]string) (*hcsschema.ContainerDefinitionDevice, error) { +func getDeviceExtensions(annotations map[string]string) (*hcsschema.ContainersDefDevice, error) { extensionPaths, err := getDeviceExtensionPaths(annotations) if err != nil { return nil, err @@ -75,7 +75,7 @@ func getDeviceExtensions(annotations map[string]string) (*hcsschema.ContainerDef return nil, fmt.Errorf("device extensions are not supported on this build (%d)", osversion.Build()) } - results := &hcsschema.ContainerDefinitionDevice{ + results := &hcsschema.ContainersDefDevice{ DeviceExtension: []hcsschema.DeviceExtension{}, } for _, extensionPath := range extensionPaths { diff --git a/internal/hcsoci/hcsdoc_wcow.go b/internal/hcsoci/hcsdoc_wcow.go index 22b042bb42..bef6faa24c 100644 --- a/internal/hcsoci/hcsdoc_wcow.go +++ b/internal/hcsoci/hcsdoc_wcow.go @@ -167,7 +167,7 @@ func createWindowsContainerDocument(ctx context.Context, coi *createOptionsInter if coi.Spec.Hostname != "" { v1.HostName = coi.Spec.Hostname - v2Container.GuestOs = &hcsschema.GuestOs{HostName: coi.Spec.Hostname} + v2Container.GuestOS = &hcsschema.GuestOS{HostName: coi.Spec.Hostname} } var ( @@ -234,17 +234,17 @@ func createWindowsContainerDocument(ctx context.Context, coi *createOptionsInter v1.ProcessorMaximum = int64(cpuLimit) v1.ProcessorWeight = uint64(cpuWeight) - v2Container.Processor = &hcsschema.Processor{ - Count: cpuCount, - Maximum: cpuLimit, - Weight: cpuWeight, + v2Container.Processor = &hcsschema.ContainerProcessor{ + Count: uint32(cpuCount), + Maximum: int64(cpuLimit), + Weight: int64(cpuWeight), } // Memory Resources memoryMaxInMB := oci.ParseAnnotationsMemory(ctx, coi.Spec, annotations.ContainerMemorySizeInMB, 0) if memoryMaxInMB > 0 { v1.MemoryMaximumInMB = int64(memoryMaxInMB) - v2Container.Memory = &hcsschema.Memory{ + v2Container.Memory = &hcsschema.ContainerMemory{ SizeInMB: memoryMaxInMB, } } @@ -256,8 +256,8 @@ func createWindowsContainerDocument(ctx context.Context, coi *createOptionsInter v1.StorageBandwidthMaximum = uint64(storageBandwidthMax) v1.StorageIOPSMaximum = uint64(storageIopsMax) v2Container.Storage.QoS = &hcsschema.StorageQoS{ - BandwidthMaximum: storageBandwidthMax, - IopsMaximum: storageIopsMax, + BandwidthMaximum: uint64(storageBandwidthMax), + IOPSMaximum: uint64(storageIopsMax), } } @@ -270,11 +270,11 @@ func createWindowsContainerDocument(ctx context.Context, coi *createOptionsInter v2Container.Networking.Namespace = coi.actualNetworkNamespace v1.AllowUnqualifiedDNSQuery = coi.Spec.Windows.Network.AllowUnqualifiedDNSQuery - v2Container.Networking.AllowUnqualifiedDnsQuery = v1.AllowUnqualifiedDNSQuery + v2Container.Networking.AllowUnqualifiedDNSQuery = v1.AllowUnqualifiedDNSQuery if coi.Spec.Windows.Network.DNSSearchList != nil { v1.DNSSearchList = strings.Join(coi.Spec.Windows.Network.DNSSearchList, ",") - v2Container.Networking.DnsSearchList = v1.DNSSearchList + v2Container.Networking.DNSSearchList = v1.DNSSearchList } v1.NetworkSharedContainerName = coi.Spec.Windows.Network.NetworkSharedContainerName @@ -349,7 +349,7 @@ func createWindowsContainerDocument(ctx context.Context, coi *createOptionsInter return nil, nil, err } v1.Layers = append(v1.Layers, schema1.Layer{ID: layerID.String(), Path: layerPath}) - v2Container.Storage.Layers = append(v2Container.Storage.Layers, hcsschema.Layer{Id: layerID.String(), Path: layerPath}) + v2Container.Storage.Layers = append(v2Container.Storage.Layers, hcsschema.Layer{ID: layerID.String(), Path: layerPath}) } } @@ -403,15 +403,17 @@ func createWindowsContainerDocument(ctx context.Context, coi *createOptionsInter // 'WaitToKillServiceTimeout' reg key value is arbitrarily chosen and set to a // value that is long enough that no one will want to wait longer + system := hcsschema.RegistryHive_SYSTEM + stringType := hcsschema.RegistryValueType_STRING_ registryAdd := []hcsschema.RegistryValue{ { Key: &hcsschema.RegistryKey{ - Hive: "System", + Hive: &system, Name: "ControlSet001\\Control", }, Name: "WaitToKillServiceTimeout", StringValue: strconv.Itoa(math.MaxInt32), - Type_: "String", + Type_: &stringType, }, } @@ -421,26 +423,28 @@ func createWindowsContainerDocument(ctx context.Context, coi *createOptionsInter return nil, nil, err } + software := hcsschema.RegistryHive_SOFTWARE + dwordType := hcsschema.RegistryValueType_D_WORD // Setup WER registry keys for local process dump creation if specified. // https://docs.microsoft.com/en-us/windows/win32/wer/collecting-user-mode-dumps registryAdd = append(registryAdd, []hcsschema.RegistryValue{ { Key: &hcsschema.RegistryKey{ - Hive: "Software", + Hive: &software, Name: "Microsoft\\Windows\\Windows Error Reporting\\LocalDumps", }, Name: "DumpFolder", StringValue: dumpPath, - Type_: "String", + Type_: &stringType, }, { Key: &hcsschema.RegistryKey{ - Hive: "Software", + Hive: &software, Name: "Microsoft\\Windows\\Windows Error Reporting\\LocalDumps", }, Name: "DumpType", - DWordValue: dumpType, - Type_: "DWord", + DWordValue: uint32(dumpType), + Type_: &dwordType, }, }...) } @@ -464,11 +468,12 @@ func parseAssignedDevices(ctx context.Context, coi *createOptionsInternal, v2 *h switch d.IDType { case uvm.VPCILocationPathIDType: v2Dev.LocationPath = d.ID - v2Dev.Type = hcsschema.DeviceInstanceID + dt := hcsschema.DeviceType_DEVICE_INSTANCE + v2Dev.Type_ = &dt case uvm.VPCIClassGUIDTypeLegacy: - v2Dev.InterfaceClassGuid = d.ID + v2Dev.InterfaceClassGUID = d.ID case uvm.VPCIClassGUIDType: - v2Dev.InterfaceClassGuid = d.ID + v2Dev.InterfaceClassGUID = d.ID default: return fmt.Errorf("specified device %s has unsupported type %s", d.ID, d.IDType) } diff --git a/internal/hcsoci/resources_wcow.go b/internal/hcsoci/resources_wcow.go index 7d1ac0adb5..433dcf3c3d 100644 --- a/internal/hcsoci/resources_wcow.go +++ b/internal/hcsoci/resources_wcow.go @@ -97,7 +97,7 @@ func allocateWindowsResources(ctx context.Context, coi *createOptionsInternal, r // must be present in the UVM'S HCS document before being sent over as hot adding // an HvSocket service was not possible. hvSockConfig := ccgInstance.HvSocketConfig - if err := coi.HostingSystem.UpdateHvSocketService(ctx, hvSockConfig.ServiceId, hvSockConfig.ServiceConfig); err != nil { + if err := coi.HostingSystem.UpdateHvSocketService(ctx, hvSockConfig.ServiceID, hvSockConfig.ServiceConfig); err != nil { return errors.Wrap(err, "failed to update hvsocket service") } } diff --git a/internal/jobcontainers/jobcontainer.go b/internal/jobcontainers/jobcontainer.go index 49faafd443..c7173a93b1 100644 --- a/internal/jobcontainers/jobcontainer.go +++ b/internal/jobcontainers/jobcontainer.go @@ -518,11 +518,11 @@ func (c *JobContainer) shutdown(ctx context.Context) error { // PropertiesV2 returns properties relating to the job container. This is an HCS construct but // to adhere to the interface for containers on Windows it is partially implemented. The only // supported property is schema2.PTStatistics. -func (c *JobContainer) PropertiesV2(ctx context.Context, types ...hcsschema.PropertyType) (*hcsschema.Properties, error) { +func (c *JobContainer) PropertiesV2(ctx context.Context, types ...hcsschema.SystemPropertyType) (*hcsschema.Properties, error) { if len(types) == 0 { return nil, errors.New("no property types supplied for PropertiesV2 call") } - if types[0] != hcsschema.PTStatistics { + if types[0] != hcsschema.SystemPropertyType_STATISTICS { return nil, errors.New("PTStatistics is the only supported property type for job containers") } diff --git a/internal/layers/layers.go b/internal/layers/layers.go index c60d4843f2..614b3cbc56 100644 --- a/internal/layers/layers.go +++ b/internal/layers/layers.go @@ -452,7 +452,7 @@ func GetHCSLayers(ctx context.Context, vm *uvm.UtilityVM, paths []string) (layer if err != nil { return nil, err } - layers = append(layers, hcsschema.Layer{Id: layerID.String(), Path: uvmPath}) + layers = append(layers, hcsschema.Layer{ID: layerID.String(), Path: uvmPath}) } return layers, nil } diff --git a/internal/log/scrub.go b/internal/log/scrub.go index 5a960e0d35..d19d7bdde0 100644 --- a/internal/log/scrub.go +++ b/internal/log/scrub.go @@ -41,7 +41,7 @@ func IsScrubbingEnabled() bool { } // ScrubProcessParameters scrubs HCS Create Process requests with config parameters of -// type internal/hcs/schema2.ScrubProcessParameters (aka hcsshema.ScrubProcessParameters) +// type internal/hcs/schema2.ProcessParameters (aka hcsschema.ProcessParameters). func ScrubProcessParameters(s string) (string, error) { // todo: deal with v1 ProcessConfig b := []byte(s) diff --git a/internal/processorinfo/host_information.go b/internal/processorinfo/host_information.go index 0aa766a43e..2aaba1b8a6 100644 --- a/internal/processorinfo/host_information.go +++ b/internal/processorinfo/host_information.go @@ -16,8 +16,8 @@ import ( // and NUMA configuration. This is also used to reliably get the hosts number of logical // processors in multi processor group settings. func HostProcessorInfo(ctx context.Context) (*hcsschema.ProcessorTopology, error) { - q := hcsschema.PropertyQuery{ - PropertyTypes: []hcsschema.PropertyType{hcsschema.PTProcessorTopology}, + q := hcsschema.ServicePropertyQuery{ + PropertyTypes: []hcsschema.GetPropertyType{hcsschema.GetPropertyType_PROCESSOR_TOPOLOGY}, } serviceProps, err := hcs.GetServiceProperties(ctx, q) if err != nil { diff --git a/internal/protocol/guestrequest/types.go b/internal/protocol/guestrequest/types.go index d8d0c20b10..d4416c461b 100644 --- a/internal/protocol/guestrequest/types.go +++ b/internal/protocol/guestrequest/types.go @@ -5,7 +5,9 @@ package guestrequest type RequestType string type ResourceType string -// RequestType const +// TODO: repace with [hcsschema.ModifyRequestType]/[hcsschema.LinuxModifyRequestType] + +// RequestType const. const ( RequestTypeAdd RequestType = "Add" RequestTypeRemove RequestType = "Remove" @@ -13,6 +15,8 @@ const ( RequestTypeUpdate RequestType = "Update" ) +// TODO: replace with [hcsschema.ProcessSignal] + type SignalValueWCOW string const ( @@ -23,6 +27,8 @@ const ( SignalValueWCOWCtrlShutdown SignalValueWCOW = "CtrlShutdown" ) +// TODO: replace with [hcsschema.GuestModifySettingRequest] and [hcsschema.LinuxGuestModifySettingRequest] + // ModificationRequest is for modify commands passed to the guest. type ModificationRequest struct { RequestType RequestType `json:"RequestType,omitempty"` @@ -30,12 +36,16 @@ type ModificationRequest struct { Settings interface{} `json:"Settings,omitempty"` } +// TODO: replace with [hcsschema.NetworkModifySettingRequest] + type NetworkModifyRequest struct { AdapterId string `json:"AdapterId,omitempty"` //nolint:stylecheck RequestType RequestType `json:"RequestType,omitempty"` Settings interface{} `json:"Settings,omitempty"` } +// TODO: replace with [hcsschema.Rs4NetworkModifySettingRequest] + type RS4NetworkModifyRequest struct { AdapterInstanceId string `json:"AdapterInstanceId,omitempty"` //nolint:stylecheck RequestType RequestType `json:"RequestType,omitempty"` diff --git a/internal/protocol/guestresource/resources.go b/internal/protocol/guestresource/resources.go index 8b68bc4d7d..8f774dab3e 100644 --- a/internal/protocol/guestresource/resources.go +++ b/internal/protocol/guestresource/resources.go @@ -12,11 +12,13 @@ import ( // // This will also change package name due to an inbound breaking change. +// TODO: replace with [hcsschema.ModifyResourceType] and [hcschema.LinuxModifyResourceType] constants + const ( // These are constants for v2 schema modify guest requests. // ResourceTypeMappedDirectory is the modify resource type for mapped - // directories + // directories. ResourceTypeMappedDirectory guestrequest.ResourceType = "MappedDirectory" // ResourceTypeSCSIDevice is the modify resources type for SCSI devices. // Note this type is not related to mounting a device in the guest, only @@ -24,30 +26,32 @@ const ( // Currently it only supports Remove, to cleanly remove a SCSI device. ResourceTypeSCSIDevice guestrequest.ResourceType = "SCSIDevice" // ResourceTypeMappedVirtualDisk is the modify resource type for mapped - // virtual disks + // virtual disks. ResourceTypeMappedVirtualDisk guestrequest.ResourceType = "MappedVirtualDisk" // ResourceTypeNetwork is the modify resource type for the `NetworkAdapterV2` // device. ResourceTypeNetwork guestrequest.ResourceType = "Network" ResourceTypeNetworkNamespace guestrequest.ResourceType = "NetworkNamespace" // ResourceTypeCombinedLayers is the modify resource type for combined - // layers + // layers. ResourceTypeCombinedLayers guestrequest.ResourceType = "CombinedLayers" - // ResourceTypeVPMemDevice is the modify resource type for VPMem devices + // ResourceTypeVPMemDevice is the modify resource type for VPMem devices. ResourceTypeVPMemDevice guestrequest.ResourceType = "VPMemDevice" - // ResourceTypeVPCIDevice is the modify resource type for vpci devices + // ResourceTypeVPCIDevice is the modify resource type for vpci devices. ResourceTypeVPCIDevice guestrequest.ResourceType = "VPCIDevice" // ResourceTypeContainerConstraints is the modify resource type for updating - // container constraints + // container constraints. ResourceTypeContainerConstraints guestrequest.ResourceType = "ContainerConstraints" ResourceTypeHvSocket guestrequest.ResourceType = "HvSocket" // ResourceTypeSecurityPolicy is the modify resource type for updating the security - // policy + // policy. ResourceTypeSecurityPolicy guestrequest.ResourceType = "SecurityPolicy" // ResourceTypePolicyFragment is the modify resource type for injecting policy fragments. ResourceTypePolicyFragment guestrequest.ResourceType = "SecurityPolicyFragment" ) +// TODO: replace with [hcsschema.LinuxCombinedLayers] and [hcsschema.CombinedLayers] + // This class is used by a modify request to add or remove a combined layers // structure in the guest. For windows, the GCS applies a filter in ContainerRootPath // using the specified layers as the parent content. Ignores property ScratchPath @@ -75,6 +79,8 @@ type SCSIDevice struct { Lun uint8 `json:"Lun,omitempty"` } +// TODO: replace with [hcsschema.LinuxMappedVirtualDisk] + // LCOWMappedVirtualDisk represents a disk on the host which is mapped into a // directory in the guest in the V2 schema. type LCOWMappedVirtualDisk struct { @@ -91,11 +97,15 @@ type LCOWMappedVirtualDisk struct { Filesystem string `json:"Filesystem,omitempty"` } +// TODO: replace with [hcsschema.MappedVirtualDisk] + type WCOWMappedVirtualDisk struct { ContainerPath string `json:"ContainerPath,omitempty"` Lun int32 `json:"Lun,omitempty"` } +// TODO: replace with [hcsschema.LinuxMappedDirectory] + // LCOWMappedDirectory represents a directory on the host which is mapped to a // directory on the guest through Plan9 in the V2 schema. type LCOWMappedDirectory struct { @@ -105,7 +115,7 @@ type LCOWMappedDirectory struct { ReadOnly bool `json:"ReadOnly,omitempty"` } -// LCOWVPMemMappingInfo is one of potentially multiple read-only layers mapped on a VPMem device +// LCOWVPMemMappingInfo is one of potentially multiple read-only layers mapped on a VPMem device. type LCOWVPMemMappingInfo struct { DeviceOffsetInBytes uint64 `json:"DeviceOffsetInBytes,omitempty"` DeviceSizeInBytes uint64 `json:"DeviceSizeInBytes,omitempty"` @@ -177,6 +187,8 @@ type SignalProcessOptionsLCOW struct { Signal int `json:",omitempty"` } +// TODO: replace with [hcsschema.SignalProcessOptions] + // SignalProcessOptionsWCOW is the options passed to WCOW to signal a given // process. type SignalProcessOptionsWCOW struct { diff --git a/internal/uvm/combine_layers.go b/internal/uvm/combine_layers.go index 468139c0f7..2df92434eb 100644 --- a/internal/uvm/combine_layers.go +++ b/internal/uvm/combine_layers.go @@ -18,8 +18,8 @@ func (uvm *UtilityVM) CombineLayersWCOW(ctx context.Context, layerPaths []hcssch if uvm.operatingSystem != "windows" { return errNotSupported } - msr := &hcsschema.ModifySettingRequest{ - GuestRequest: guestrequest.ModificationRequest{ + msr, err := hcsschema.NewModifySettingGuestRequest( + guestrequest.ModificationRequest{ ResourceType: guestresource.ResourceTypeCombinedLayers, RequestType: guestrequest.RequestTypeAdd, Settings: guestresource.WCOWCombinedLayers{ @@ -27,8 +27,11 @@ func (uvm *UtilityVM) CombineLayersWCOW(ctx context.Context, layerPaths []hcssch Layers: layerPaths, }, }, + ) + if err != nil { + return err } - return uvm.modify(ctx, msr) + return uvm.modify(ctx, &msr) } // CombineLayersLCOW combines `layerPaths` and optionally `scratchPath` into an @@ -46,8 +49,8 @@ func (uvm *UtilityVM) CombineLayersLCOW(ctx context.Context, containerID string, for _, l := range layerPaths { layers = append(layers, hcsschema.Layer{Path: l}) } - msr := &hcsschema.ModifySettingRequest{ - GuestRequest: guestrequest.ModificationRequest{ + msr, err := hcsschema.NewModifySettingGuestRequest( + guestrequest.ModificationRequest{ ResourceType: guestresource.ResourceTypeCombinedLayers, RequestType: guestrequest.RequestTypeAdd, Settings: guestresource.LCOWCombinedLayers{ @@ -57,35 +60,44 @@ func (uvm *UtilityVM) CombineLayersLCOW(ctx context.Context, containerID string, ScratchPath: scratchPath, }, }, + ) + if err != nil { + return err } - return uvm.modify(ctx, msr) + return uvm.modify(ctx, &msr) } // RemoveCombinedLayers removes the previously combined layers at `rootfsPath`. // // NOTE: `rootfsPath` is the path from within the UVM. func (uvm *UtilityVM) RemoveCombinedLayersWCOW(ctx context.Context, rootfsPath string) error { - msr := &hcsschema.ModifySettingRequest{ - GuestRequest: guestrequest.ModificationRequest{ + msr, err := hcsschema.NewModifySettingGuestRequest( + guestrequest.ModificationRequest{ ResourceType: guestresource.ResourceTypeCombinedLayers, RequestType: guestrequest.RequestTypeRemove, Settings: guestresource.WCOWCombinedLayers{ ContainerRootPath: rootfsPath, }, }, + ) + if err != nil { + return err } - return uvm.modify(ctx, msr) + return uvm.modify(ctx, &msr) } func (uvm *UtilityVM) RemoveCombinedLayersLCOW(ctx context.Context, rootfsPath string) error { - msr := &hcsschema.ModifySettingRequest{ - GuestRequest: guestrequest.ModificationRequest{ + msr, err := hcsschema.NewModifySettingGuestRequest( + guestrequest.ModificationRequest{ ResourceType: guestresource.ResourceTypeCombinedLayers, RequestType: guestrequest.RequestTypeRemove, Settings: guestresource.LCOWCombinedLayers{ ContainerRootPath: rootfsPath, }, }, + ) + if err != nil { + return err } - return uvm.modify(ctx, msr) + return uvm.modify(ctx, &msr) } diff --git a/internal/uvm/computeagent.go b/internal/uvm/computeagent.go index 7516cdf6ea..38b000e62b 100644 --- a/internal/uvm/computeagent.go +++ b/internal/uvm/computeagent.go @@ -4,6 +4,7 @@ package uvm import ( "context" + "fmt" "strings" "github.com/Microsoft/go-winio" @@ -163,19 +164,21 @@ func (ca *computeAgent) ModifyNIC(ctx context.Context, req *computeagent.ModifyN return nil, errors.Wrapf(err, "failed to get endpoint with name `%s`", endpt.Name) } - moderationValue := hcsschema.InterruptModerationValue(req.IovPolicySettings.InterruptModeration) - moderationName := hcsschema.InterruptModerationValueToName[moderationValue] + moderationName, err := hcsschema.NewInterruptModerationModeFromInt64(int64(req.IovPolicySettings.InterruptModeration)) + if err != nil { + return nil, fmt.Errorf("unknown interrupt mode: %w", err) + } - iovSettings := &hcsschema.IovSettings{ + iovSettings := &hcsschema.IOVSettings{ OffloadWeight: &req.IovPolicySettings.IovOffloadWeight, QueuePairsRequested: &req.IovPolicySettings.QueuePairsRequested, InterruptModeration: &moderationName, } nic := &hcsschema.NetworkAdapter{ - EndpointId: hnsEndpoint.Id, + EndpointID: hnsEndpoint.Id, MacAddress: hnsEndpoint.MacAddress, - IovSettings: iovSettings, + IOVSettings: iovSettings, } if err := ca.uvm.UpdateNIC(ctx, req.NicID, nic); err != nil { diff --git a/internal/uvm/cpugroups.go b/internal/uvm/cpugroups.go index f93a83ca6e..4f512eaa54 100644 --- a/internal/uvm/cpugroups.go +++ b/internal/uvm/cpugroups.go @@ -33,13 +33,19 @@ func (uvm *UtilityVM) SetCPUGroup(ctx context.Context, id string) error { // setCPUGroup sets the VM's cpugroup func (uvm *UtilityVM) setCPUGroup(ctx context.Context, id string) error { - req := &hcsschema.ModifySettingRequest{ - ResourcePath: resourcepaths.CPUGroupResourcePath, - Settings: &hcsschema.CpuGroup{ - Id: id, + req, err := hcsschema.NewModifySettingRequest( + resourcepaths.CPUGroupResourcePath, + hcsschema.ModifyRequestType_UPDATE, + &hcsschema.CpuGroup{ + ID: id, }, + nil, // guestRequest + ) + if err != nil { + return err } - if err := uvm.modify(ctx, req); err != nil { + req.RequestType = nil // request type is unneeded, so remove it + if err := uvm.modify(ctx, &req); err != nil { return err } return nil diff --git a/internal/uvm/cpulimits_update.go b/internal/uvm/cpulimits_update.go index ea5fccf625..5897c27ca3 100644 --- a/internal/uvm/cpulimits_update.go +++ b/internal/uvm/cpulimits_update.go @@ -11,10 +11,16 @@ import ( // UpdateCPULimits updates the CPU limits of the utility vm func (uvm *UtilityVM) UpdateCPULimits(ctx context.Context, limits *hcsschema.ProcessorLimits) error { - req := &hcsschema.ModifySettingRequest{ - ResourcePath: resourcepaths.CPULimitsResourcePath, - Settings: limits, + req, err := hcsschema.NewModifySettingRequest( + resourcepaths.CPULimitsResourcePath, + hcsschema.ModifyRequestType_UPDATE, + limits, + nil, // guestRequest + ) + if err != nil { + return err } + req.RequestType = nil // request type is unneeded, so remove it - return uvm.modify(ctx, req) + return uvm.modify(ctx, &req) } diff --git a/internal/uvm/create.go b/internal/uvm/create.go index 483feb993b..7ec8b5938b 100644 --- a/internal/uvm/create.go +++ b/internal/uvm/create.go @@ -258,12 +258,16 @@ func (uvm *UtilityVM) CreateContainer(ctx context.Context, id string, settings i } return c, nil } + s, err := hcsschema.ToRawMessage(settings) + if err != nil { + return nil, err + } doc := hcsschema.ComputeSystem{ - HostingSystemId: uvm.id, + HostingSystemID: uvm.id, Owner: uvm.owner, SchemaVersion: schemaversion.SchemaV21(), ShouldTerminateOnLastHandleClosed: true, - HostedSystem: settings, + HostedSystem: s, } c, err := hcs.CreateComputeSystem(ctx, id, &doc) if err != nil { diff --git a/internal/uvm/create_lcow.go b/internal/uvm/create_lcow.go index 37c1ebb0ae..7b8def8313 100644 --- a/internal/uvm/create_lcow.go +++ b/internal/uvm/create_lcow.go @@ -189,7 +189,7 @@ func NewDefaultOptionsLCOW(id, owner string) *OptionsLCOW { } // Get an acceptable number of processors given option and actual constraints. -func fetchProcessor(ctx context.Context, opts *OptionsLCOW, uvm *UtilityVM) (*hcsschema.Processor2, error) { +func fetchProcessor(ctx context.Context, opts *OptionsLCOW, uvm *UtilityVM) (*hcsschema.VirtualMachineProcessor, error) { processorTopology, err := processorinfo.HostProcessorInfo(ctx) if err != nil { return nil, fmt.Errorf("failed to get host processor information: %s", err) @@ -199,17 +199,17 @@ func fetchProcessor(ctx context.Context, opts *OptionsLCOW, uvm *UtilityVM) (*hc // a user CPU count if the setting is not possible. uvm.processorCount = uvm.normalizeProcessorCount(ctx, opts.ProcessorCount, processorTopology) - processor := &hcsschema.Processor2{ - Count: uvm.processorCount, - Limit: opts.ProcessorLimit, - Weight: opts.ProcessorWeight, + processor := &hcsschema.VirtualMachineProcessor{ + Count: uint32(uvm.processorCount), + Limit: uint64(opts.ProcessorLimit), + Weight: uint64(opts.ProcessorWeight), } // We can set a cpu group for the VM at creation time in recent builds. if opts.CPUGroupID != "" { if osversion.Build() < osversion.V21H1 { return nil, errCPUGroupCreateNotSupported } - processor.CpuGroup = &hcsschema.CpuGroup{Id: opts.CPUGroupID} + processor.CpuGroup = &hcsschema.CpuGroup{ID: opts.CPUGroupID} } return processor, nil } @@ -307,7 +307,7 @@ func makeLCOWVMGSDoc(ctx context.Context, opts *OptionsLCOW, uvm *UtilityVM) (_ return nil, fmt.Errorf("cannot override rootfs when using VMGS file") } - var processor *hcsschema.Processor2 + var processor *hcsschema.VirtualMachineProcessor processor, err = fetchProcessor(ctx, opts, uvm) if err != nil { return nil, err @@ -351,7 +351,7 @@ func makeLCOWVMGSDoc(ctx context.Context, opts *OptionsLCOW, uvm *UtilityVM) (_ StopOnReset: true, Chipset: &hcsschema.Chipset{}, ComputeTopology: &hcsschema.Topology{ - Memory: &hcsschema.Memory2{ + Memory: &hcsschema.VirtualMachineMemory{ SizeInMB: memorySizeInMB, AllowOvercommit: opts.AllowOvercommit, EnableDeferredCommit: opts.EnableDeferredCommit, @@ -363,7 +363,7 @@ func makeLCOWVMGSDoc(ctx context.Context, opts *OptionsLCOW, uvm *UtilityVM) (_ Processor: processor, }, Devices: &hcsschema.Devices{ - HvSocket: &hcsschema.HvSocket2{ + HvSocket: &hcsschema.VirtualMachineHvSocket{ HvSocketConfig: &hcsschema.HvSocketSystemConfig{ // Allow administrators and SYSTEM to bind to vsock sockets // so that we can create a GCS log socket. @@ -394,15 +394,15 @@ func makeLCOWVMGSDoc(ctx context.Context, opts *OptionsLCOW, uvm *UtilityVM) (_ // Handle StorageQoS if set if opts.StorageQoSBandwidthMaximum > 0 || opts.StorageQoSIopsMaximum > 0 { doc.VirtualMachine.StorageQoS = &hcsschema.StorageQoS{ - IopsMaximum: opts.StorageQoSIopsMaximum, - BandwidthMaximum: opts.StorageQoSBandwidthMaximum, + IOPSMaximum: uint64(opts.StorageQoSIopsMaximum), + BandwidthMaximum: uint64(opts.StorageQoSBandwidthMaximum), } } if uvm.scsiControllerCount > 0 { - doc.VirtualMachine.Devices.Scsi = map[string]hcsschema.Scsi{} + doc.VirtualMachine.Devices.SCSI = map[string]hcsschema.SCSI{} for i := 0; i < int(uvm.scsiControllerCount); i++ { - doc.VirtualMachine.Devices.Scsi[guestrequest.ScsiControllerGuids[i]] = hcsschema.Scsi{ + doc.VirtualMachine.Devices.SCSI[guestrequest.ScsiControllerGuids[i]] = hcsschema.SCSI{ Attachments: make(map[string]hcsschema.Attachment), } } @@ -410,16 +410,18 @@ func makeLCOWVMGSDoc(ctx context.Context, opts *OptionsLCOW, uvm *UtilityVM) (_ // Required by HCS for the isolated boot scheme, see also https://docs.microsoft.com/en-us/windows-server/virtualization/hyper-v/learn-more/generation-2-virtual-machine-security-settings-for-hyper-v // A complete explanation of the why's and wherefores of starting an encrypted, isolated VM are beond the scope of these comments. + asbt := hcsschema.ApplySecureBootTemplateType_APPLY doc.VirtualMachine.Chipset.Uefi = &hcsschema.Uefi{ - ApplySecureBootTemplate: "Apply", - SecureBootTemplateId: "1734c6e8-3154-4dda-ba5f-a874cc483422", // aka MicrosoftWindowsSecureBootTemplateGUID equivalent to "Microsoft Windows" template from Get-VMHost | select SecureBootTemplates, + ApplySecureBootTemplate: &asbt, + SecureBootTemplateID: "1734c6e8-3154-4dda-ba5f-a874cc483422", // aka MicrosoftWindowsSecureBootTemplateGUID equivalent to "Microsoft Windows" template from Get-VMHost | select SecureBootTemplates, } // Point at the file that contains the linux kernel and initrd images. + gsft := hcsschema.GuestStateFileType_FILE_MODE doc.VirtualMachine.GuestState = &hcsschema.GuestState{ GuestStateFilePath: vmgsFile.Name(), - GuestStateFileType: "FileMode", + GuestStateFileType: &gsft, ForceTransientState: true, // tell HCS that this is just the source of the images, not ongoing state } @@ -453,10 +455,11 @@ func makeLCOWSecurityDoc(ctx context.Context, opts *OptionsLCOW, uvm *UtilityVM) // Put the measurement into the LaunchData field of the HCS creation command. // This will end-up in HOST_DATA of SNP_LAUNCH_FINISH command the and ATTESTATION_REPORT // retrieved by the guest later. + iso := hcsschema.GuestIsolationType_SECURE_NESTED_PAGING doc.VirtualMachine.SecuritySettings = &hcsschema.SecuritySettings{ EnableTpm: false, Isolation: &hcsschema.IsolationSettings{ - IsolationType: "SecureNestedPaging", + IsolationType: &iso, LaunchData: hostData, // HclEnabled: true, /* Not available in schema 2.5 - REQUIRED when using BlockStorage in 2.6 */ HclEnabled: opts.HclEnabled, @@ -521,7 +524,7 @@ func makeLCOWDoc(ctx context.Context, opts *OptionsLCOW, uvm *UtilityVM) (_ *hcs return nil, fmt.Errorf("boot file: '%s' not found", rootfsFullPath) } - var processor *hcsschema.Processor2 + var processor *hcsschema.VirtualMachineProcessor processor, err = fetchProcessor(ctx, opts, uvm) // must happen after the file existence tests above. if err != nil { return nil, err @@ -538,7 +541,7 @@ func makeLCOWDoc(ctx context.Context, opts *OptionsLCOW, uvm *UtilityVM) (_ *hcs StopOnReset: true, Chipset: &hcsschema.Chipset{}, ComputeTopology: &hcsschema.Topology{ - Memory: &hcsschema.Memory2{ + Memory: &hcsschema.VirtualMachineMemory{ SizeInMB: memorySizeInMB, AllowOvercommit: opts.AllowOvercommit, EnableDeferredCommit: opts.EnableDeferredCommit, @@ -550,7 +553,7 @@ func makeLCOWDoc(ctx context.Context, opts *OptionsLCOW, uvm *UtilityVM) (_ *hcs Processor: processor, }, Devices: &hcsschema.Devices{ - HvSocket: &hcsschema.HvSocket2{ + HvSocket: &hcsschema.VirtualMachineHvSocket{ HvSocketConfig: &hcsschema.HvSocketSystemConfig{ // Allow administrators and SYSTEM to bind to vsock sockets // so that we can create a GCS log socket. @@ -565,15 +568,15 @@ func makeLCOWDoc(ctx context.Context, opts *OptionsLCOW, uvm *UtilityVM) (_ *hcs // Handle StorageQoS if set if opts.StorageQoSBandwidthMaximum > 0 || opts.StorageQoSIopsMaximum > 0 { doc.VirtualMachine.StorageQoS = &hcsschema.StorageQoS{ - IopsMaximum: opts.StorageQoSIopsMaximum, - BandwidthMaximum: opts.StorageQoSBandwidthMaximum, + IOPSMaximum: uint64(opts.StorageQoSIopsMaximum), + BandwidthMaximum: uint64(opts.StorageQoSBandwidthMaximum), } } if uvm.scsiControllerCount > 0 { - doc.VirtualMachine.Devices.Scsi = map[string]hcsschema.Scsi{} + doc.VirtualMachine.Devices.SCSI = map[string]hcsschema.SCSI{} for i := 0; i < int(uvm.scsiControllerCount); i++ { - doc.VirtualMachine.Devices.Scsi[guestrequest.ScsiControllerGuids[i]] = hcsschema.Scsi{ + doc.VirtualMachine.Devices.SCSI[guestrequest.ScsiControllerGuids[i]] = hcsschema.SCSI{ Attachments: make(map[string]hcsschema.Attachment), } } @@ -581,7 +584,7 @@ func makeLCOWDoc(ctx context.Context, opts *OptionsLCOW, uvm *UtilityVM) (_ *hcs if uvm.vpmemMaxCount > 0 { doc.VirtualMachine.Devices.VirtualPMem = &hcsschema.VirtualPMemController{ - MaximumCount: uvm.vpmemMaxCount, + MaximumCount: uint8(uvm.vpmemMaxCount), MaximumSizeBytes: uvm.vpmemMaxSizeBytes, } } @@ -596,15 +599,15 @@ func makeLCOWDoc(ctx context.Context, opts *OptionsLCOW, uvm *UtilityVM) (_ *hcs if uvm.vpmemMaxCount > 0 { // Support for VPMem VHD(X) booting rather than initrd.. kernelArgs = "root=/dev/pmem0 ro rootwait init=/init" - imageFormat := "Vhd1" + imageFormat := hcsschema.VirtualPMemImageFormat_VHD1 if strings.ToLower(filepath.Ext(opts.RootFSFile)) == "vhdx" { - imageFormat = "Vhdx" + imageFormat = hcsschema.VirtualPMemImageFormat_VHDX } doc.VirtualMachine.Devices.VirtualPMem.Devices = map[string]hcsschema.VirtualPMemDevice{ "0": { HostPath: rootfsFullPath, ReadOnly: true, - ImageFormat: imageFormat, + ImageFormat: &imageFormat, }, } if uvm.vpmemMultiMapping { @@ -639,8 +642,9 @@ func makeLCOWDoc(ctx context.Context, opts *OptionsLCOW, uvm *UtilityVM) (_ *hcs } } else { kernelArgs = "root=/dev/sda ro rootwait init=/init" - doc.VirtualMachine.Devices.Scsi[guestrequest.ScsiControllerGuids[0]].Attachments["0"] = hcsschema.Attachment{ - Type_: "VirtualDisk", + typ := hcsschema.AttachmentType_VIRTUAL_DISK + doc.VirtualMachine.Devices.SCSI[guestrequest.ScsiControllerGuids[0]].Attachments["0"] = hcsschema.Attachment{ + Type_: &typ, Path: rootfsFullPath, ReadOnly: true, } @@ -722,10 +726,11 @@ func makeLCOWDoc(ctx context.Context, opts *OptionsLCOW, uvm *UtilityVM) (_ *hcs kernelArgs += ` brd.rd_nr=0 pmtmr=0 -- ` + initArgs if !opts.KernelDirect { + dt := hcsschema.UefiBootDevice_VMB_FS doc.VirtualMachine.Chipset.Uefi = &hcsschema.Uefi{ BootThis: &hcsschema.UefiBootEntry{ DevicePath: `\` + opts.KernelFile, - DeviceType: "VmbFs", + DeviceType: &dt, VmbFsRootPath: opts.BootFilesPath, OptionalData: kernelArgs, }, diff --git a/internal/uvm/create_wcow.go b/internal/uvm/create_wcow.go index 5b74a7e4d4..4986aba8db 100644 --- a/internal/uvm/create_wcow.go +++ b/internal/uvm/create_wcow.go @@ -105,25 +105,29 @@ func prepareConfigDoc(ctx context.Context, uvm *UtilityVM, opts *OptionsWCOW, uv // This supposedly should be fixed soon but for now keep this until we know which container images // (1809, 1903/9, 2004 etc.) this went out too. if opts.ProcessDumpLocation != "" { + system := hcsschema.RegistryHive_SYSTEM + software := hcsschema.RegistryHive_SOFTWARE + dwordType := hcsschema.RegistryValueType_D_WORD + uvm.processDumpLocation = opts.ProcessDumpLocation registryChanges.AddValues = append(registryChanges.AddValues, hcsschema.RegistryValue{ Key: &hcsschema.RegistryKey{ - Hive: "System", + Hive: &system, Name: "ControlSet001\\Services\\WerSvc", }, Name: "Start", DWordValue: 2, - Type_: "DWord", + Type_: &dwordType, }, hcsschema.RegistryValue{ Key: &hcsschema.RegistryKey{ - Hive: "Software", + Hive: &software, Name: "Microsoft\\Windows\\Windows Error Reporting", }, Name: "Disabled", DWordValue: 1, - Type_: "DWord", + Type_: &dwordType, }, ) } @@ -133,32 +137,36 @@ func prepareConfigDoc(ctx context.Context, uvm *UtilityVM, opts *OptionsWCOW, uv // with a recent change to fix SMB share access in the UVM, this registry key will be checked to // enable the change in question inside GNS.dll. if !opts.DisableCompartmentNamespace { + system := hcsschema.RegistryHive_SYSTEM + dwordType := hcsschema.RegistryValueType_D_WORD + registryChanges.AddValues = append(registryChanges.AddValues, hcsschema.RegistryValue{ Key: &hcsschema.RegistryKey{ - Hive: "System", + Hive: &system, Name: "CurrentControlSet\\Services\\gns", }, Name: "EnableCompartmentNamespace", DWordValue: 1, - Type_: "DWord", + Type_: &dwordType, }, ) } - processor := &hcsschema.Processor2{ - Count: uvm.processorCount, - Limit: opts.ProcessorLimit, - Weight: opts.ProcessorWeight, + processor := &hcsschema.VirtualMachineProcessor{ + Count: uint32(uvm.processorCount), + Limit: uint64(opts.ProcessorLimit), + Weight: uint64(opts.ProcessorWeight), } // We can set a cpu group for the VM at creation time in recent builds. if opts.CPUGroupID != "" { if osversion.Build() < osversion.V21H1 { return nil, errCPUGroupCreateNotSupported } - processor.CpuGroup = &hcsschema.CpuGroup{Id: opts.CPUGroupID} + processor.CpuGroup = &hcsschema.CpuGroup{ID: opts.CPUGroupID} } + dt := hcsschema.UefiBootDevice_VMB_FS doc := &hcsschema.ComputeSystem{ Owner: uvm.owner, SchemaVersion: schemaversion.SchemaV21(), @@ -169,13 +177,13 @@ func prepareConfigDoc(ctx context.Context, uvm *UtilityVM, opts *OptionsWCOW, uv Uefi: &hcsschema.Uefi{ BootThis: &hcsschema.UefiBootEntry{ DevicePath: `\EFI\Microsoft\Boot\bootmgfw.efi`, - DeviceType: "VmbFs", + DeviceType: &dt, }, }, }, RegistryChanges: ®istryChanges, ComputeTopology: &hcsschema.Topology{ - Memory: &hcsschema.Memory2{ + Memory: &hcsschema.VirtualMachineMemory{ SizeInMB: memorySizeInMB, AllowOvercommit: opts.AllowOvercommit, // EnableHotHint is not compatible with physical. @@ -188,7 +196,7 @@ func prepareConfigDoc(ctx context.Context, uvm *UtilityVM, opts *OptionsWCOW, uv Processor: processor, }, Devices: &hcsschema.Devices{ - HvSocket: &hcsschema.HvSocket2{ + HvSocket: &hcsschema.VirtualMachineHvSocket{ HvSocketConfig: &hcsschema.HvSocketSystemConfig{ // Allow administrators and SYSTEM to bind to vsock sockets // so that we can create a GCS log socket. @@ -203,8 +211,8 @@ func prepareConfigDoc(ctx context.Context, uvm *UtilityVM, opts *OptionsWCOW, uv // Handle StorageQoS if set if opts.StorageQoSBandwidthMaximum > 0 || opts.StorageQoSIopsMaximum > 0 { doc.VirtualMachine.StorageQoS = &hcsschema.StorageQoS{ - IopsMaximum: opts.StorageQoSIopsMaximum, - BandwidthMaximum: opts.StorageQoSBandwidthMaximum, + IOPSMaximum: uint64(opts.StorageQoSIopsMaximum), + BandwidthMaximum: uint64(opts.StorageQoSBandwidthMaximum), } } @@ -312,17 +320,17 @@ func CreateWCOW(ctx context.Context, opts *OptionsWCOW) (_ *UtilityVM, err error } } - doc.VirtualMachine.Devices.Scsi = map[string]hcsschema.Scsi{} + doc.VirtualMachine.Devices.SCSI = map[string]hcsschema.SCSI{} for i := 0; i < int(uvm.scsiControllerCount); i++ { - doc.VirtualMachine.Devices.Scsi[guestrequest.ScsiControllerGuids[i]] = hcsschema.Scsi{ + doc.VirtualMachine.Devices.SCSI[guestrequest.ScsiControllerGuids[i]] = hcsschema.SCSI{ Attachments: make(map[string]hcsschema.Attachment), } } - doc.VirtualMachine.Devices.Scsi[guestrequest.ScsiControllerGuids[0]].Attachments["0"] = hcsschema.Attachment{ - + typ := hcsschema.AttachmentType_VIRTUAL_DISK + doc.VirtualMachine.Devices.SCSI[guestrequest.ScsiControllerGuids[0]].Attachments["0"] = hcsschema.Attachment{ Path: scratchPath, - Type_: "VirtualDisk", + Type_: &typ, } uvm.reservedSCSISlots = append(uvm.reservedSCSISlots, scsi.Slot{Controller: 0, LUN: 0}) diff --git a/internal/uvm/guest_request.go b/internal/uvm/guest_request.go index f097c4f33c..878eb3af1b 100644 --- a/internal/uvm/guest_request.go +++ b/internal/uvm/guest_request.go @@ -10,8 +10,9 @@ import ( // GuestRequest send an arbitrary guest request to the UVM. func (uvm *UtilityVM) GuestRequest(ctx context.Context, guestReq interface{}) error { - msr := &hcsschema.ModifySettingRequest{ - GuestRequest: guestReq, + msr, err := hcsschema.NewModifySettingGuestRequest(guestReq) + if err != nil { + return err } - return uvm.modify(ctx, msr) + return uvm.modify(ctx, &msr) } diff --git a/internal/uvm/hvsocket.go b/internal/uvm/hvsocket.go index 4e439c7894..c90128db31 100644 --- a/internal/uvm/hvsocket.go +++ b/internal/uvm/hvsocket.go @@ -8,7 +8,6 @@ import ( "github.com/Microsoft/hcsshim/internal/hcs/resourcepaths" hcsschema "github.com/Microsoft/hcsshim/internal/hcs/schema2" - "github.com/Microsoft/hcsshim/internal/protocol/guestrequest" ) // UpdateHvSocketService calls HCS to update/create the hvsocket service for @@ -28,19 +27,28 @@ import ( // will behave identically to a call to RemoveHvSocketService. Prefer RemoveHvSocketService for this // behavior as the relevant fields are set on HCS' side. func (uvm *UtilityVM) UpdateHvSocketService(ctx context.Context, sid string, doc *hcsschema.HvSocketServiceConfig) error { - request := &hcsschema.ModifySettingRequest{ - RequestType: guestrequest.RequestTypeUpdate, - ResourcePath: fmt.Sprintf(resourcepaths.HvSocketConfigResourceFormat, sid), - Settings: doc, + request, err := hcsschema.NewModifySettingRequest( + fmt.Sprintf(resourcepaths.HvSocketConfigResourceFormat, sid), + hcsschema.ModifyRequestType_UPDATE, + doc, + nil, // guestRequest + ) + if err != nil { + return err } - return uvm.modify(ctx, request) + return uvm.modify(ctx, &request) } // RemoveHvSocketService will remove an hvsocket service entry if it exists. func (uvm *UtilityVM) RemoveHvSocketService(ctx context.Context, sid string) error { - request := &hcsschema.ModifySettingRequest{ - RequestType: guestrequest.RequestTypeRemove, - ResourcePath: fmt.Sprintf(resourcepaths.HvSocketConfigResourceFormat, sid), + request, err := hcsschema.NewModifySettingRequest( + fmt.Sprintf(resourcepaths.HvSocketConfigResourceFormat, sid), + hcsschema.ModifyRequestType_REMOVE, + nil, + nil, // guestRequest + ) + if err != nil { + return err } - return uvm.modify(ctx, request) + return uvm.modify(ctx, &request) } diff --git a/internal/uvm/memory_update.go b/internal/uvm/memory_update.go index 59444f417e..46d525560e 100644 --- a/internal/uvm/memory_update.go +++ b/internal/uvm/memory_update.go @@ -19,16 +19,23 @@ const bytesPerPage = 4096 func (uvm *UtilityVM) UpdateMemory(ctx context.Context, sizeInBytes uint64) error { requestedSizeInMB := sizeInBytes / memory.MiB actual := uvm.normalizeMemorySize(ctx, requestedSizeInMB) - req := &hcsschema.ModifySettingRequest{ - ResourcePath: resourcepaths.MemoryResourcePath, - Settings: actual, + + req, err := hcsschema.NewModifySettingRequest( + resourcepaths.MemoryResourcePath, + hcsschema.ModifyRequestType_UPDATE, + actual, + nil, // guestRequest + ) + if err != nil { + return err } - return uvm.modify(ctx, req) + req.RequestType = nil // request type is unneeded, so remove it + return uvm.modify(ctx, &req) } // GetAssignedMemoryInBytes returns the amount of assigned memory for the UVM in bytes func (uvm *UtilityVM) GetAssignedMemoryInBytes(ctx context.Context) (uint64, error) { - props, err := uvm.hcsSystem.PropertiesV2(ctx, hcsschema.PTMemory) + props, err := uvm.hcsSystem.PropertiesV2(ctx, hcsschema.SystemPropertyType_MEMORY) if err != nil { return 0, err } diff --git a/internal/uvm/modify.go b/internal/uvm/modify.go index 5a57dce9a6..234d1de4a0 100644 --- a/internal/uvm/modify.go +++ b/internal/uvm/modify.go @@ -8,25 +8,25 @@ import ( hcsschema "github.com/Microsoft/hcsshim/internal/hcs/schema2" "github.com/Microsoft/hcsshim/internal/log" - "github.com/Microsoft/hcsshim/internal/protocol/guestrequest" ) -// Modify modifies the compute system by sending a request to HCS. +// modify modifies the compute system by sending a request to HCS or to the guest connection. func (uvm *UtilityVM) modify(ctx context.Context, doc *hcsschema.ModifySettingRequest) (err error) { - if doc.GuestRequest == nil || uvm.gc == nil { + if !doc.ValidGuestRequest() || uvm.gc == nil { return uvm.hcsSystem.Modify(ctx, doc) } hostdoc := *doc hostdoc.GuestRequest = nil - if doc.ResourcePath != "" && doc.RequestType == guestrequest.RequestTypeAdd { + if doc.ResourcePath != "" && doc.RequestType != nil && *doc.RequestType == hcsschema.ModifyRequestType_ADD { err = uvm.hcsSystem.Modify(ctx, &hostdoc) if err != nil { - return fmt.Errorf("adding VM resources: %s", err) + return fmt.Errorf("adding VM resources: %w", err) } defer func() { if err != nil { - hostdoc.RequestType = guestrequest.RequestTypeRemove + rt := hcsschema.ModifyRequestType_REMOVE + hostdoc.RequestType = &rt rerr := uvm.hcsSystem.Modify(ctx, &hostdoc) if rerr != nil { log.G(ctx).WithError(rerr).Error("failed to roll back resource add") @@ -36,12 +36,12 @@ func (uvm *UtilityVM) modify(ctx context.Context, doc *hcsschema.ModifySettingRe } err = uvm.gc.Modify(ctx, doc.GuestRequest) if err != nil { - return fmt.Errorf("guest modify: %s", err) + return fmt.Errorf("guest modify: %w", err) } - if doc.ResourcePath != "" && doc.RequestType == guestrequest.RequestTypeRemove { + if doc.ResourcePath != "" && doc.RequestType != nil && *doc.RequestType == hcsschema.ModifyRequestType_REMOVE { err = uvm.hcsSystem.Modify(ctx, &hostdoc) if err != nil { - err = fmt.Errorf("removing VM resources: %s", err) + err = fmt.Errorf("removing VM resources: %w", err) log.G(ctx).WithError(err).Error("failed to remove host resources after successful guest request") return err } diff --git a/internal/uvm/network.go b/internal/uvm/network.go index 4b2790e134..4ae9ce42ff 100644 --- a/internal/uvm/network.go +++ b/internal/uvm/network.go @@ -316,12 +316,15 @@ func (uvm *UtilityVM) AddNetNS(ctx context.Context, hcnNamespace *hcn.HostComput // Add a Guest Network namespace. On LCOW we add the adapters // dynamically. if uvm.operatingSystem == "windows" { - guestNamespace := hcsschema.ModifySettingRequest{ - GuestRequest: guestrequest.ModificationRequest{ + guestNamespace, err := hcsschema.NewModifySettingGuestRequest( + guestrequest.ModificationRequest{ ResourceType: guestresource.ResourceTypeNetworkNamespace, RequestType: guestrequest.RequestTypeAdd, Settings: hcnNamespace, }, + ) + if err != nil { + return err } if err := uvm.modify(ctx, &guestNamespace); err != nil { return err @@ -437,12 +440,15 @@ func (uvm *UtilityVM) RemoveNetNS(ctx context.Context, id string) error { if err != nil { return err } - guestNamespace := hcsschema.ModifySettingRequest{ - GuestRequest: guestrequest.ModificationRequest{ + guestNamespace, err := hcsschema.NewModifySettingGuestRequest( + guestrequest.ModificationRequest{ ResourceType: guestresource.ResourceTypeNetworkNamespace, RequestType: guestrequest.RequestTypeRemove, Settings: hcnNamespace, }, + ) + if err != nil { + return err } if err := uvm.modify(ctx, &guestNamespace); err != nil { return err @@ -528,8 +534,8 @@ func getNetworkModifyRequest(adapterID string, requestType guestrequest.RequestT func (uvm *UtilityVM) addNIC(ctx context.Context, id string, endpoint *hns.HNSEndpoint) error { // First a pre-add. This is a guest-only request and is only done on Windows. if uvm.operatingSystem == "windows" { - preAddRequest := hcsschema.ModifySettingRequest{ - GuestRequest: guestrequest.ModificationRequest{ + preAddRequest, err := hcsschema.NewModifySettingGuestRequest( + guestrequest.ModificationRequest{ ResourceType: guestresource.ResourceTypeNetwork, RequestType: guestrequest.RequestTypeAdd, Settings: getNetworkModifyRequest( @@ -537,6 +543,9 @@ func (uvm *UtilityVM) addNIC(ctx context.Context, id string, endpoint *hns.HNSEn guestrequest.RequestTypePreAdd, endpoint), }, + ) + if err != nil { + return err } if err := uvm.modify(ctx, &preAddRequest); err != nil { return err @@ -544,17 +553,10 @@ func (uvm *UtilityVM) addNIC(ctx context.Context, id string, endpoint *hns.HNSEn } // Then the Add itself - request := hcsschema.ModifySettingRequest{ - RequestType: guestrequest.RequestTypeAdd, - ResourcePath: fmt.Sprintf(resourcepaths.NetworkResourceFormat, id), - Settings: hcsschema.NetworkAdapter{ - EndpointId: endpoint.Id, - MacAddress: endpoint.MacAddress, - }, - } + var guestReq *guestrequest.ModificationRequest if uvm.operatingSystem == "windows" { - request.GuestRequest = guestrequest.ModificationRequest{ + guestReq = &guestrequest.ModificationRequest{ ResourceType: guestresource.ResourceTypeNetwork, RequestType: guestrequest.RequestTypeAdd, Settings: getNetworkModifyRequest( @@ -589,7 +591,7 @@ func (uvm *UtilityVM) addNIC(ctx context.Context, id string, endpoint *hns.HNSEn }).Debug("adding IPv6 settings") } if uvm.isNetworkNamespaceSupported() { - request.GuestRequest = guestrequest.ModificationRequest{ + guestReq = &guestrequest.ModificationRequest{ ResourceType: guestresource.ResourceTypeNetwork, RequestType: guestrequest.RequestTypeAdd, Settings: s, @@ -597,6 +599,19 @@ func (uvm *UtilityVM) addNIC(ctx context.Context, id string, endpoint *hns.HNSEn } } + request, err := hcsschema.NewModifySettingRequest( + fmt.Sprintf(resourcepaths.NetworkResourceFormat, id), + hcsschema.ModifyRequestType_ADD, + hcsschema.NetworkAdapter{ + EndpointID: endpoint.Id, + MacAddress: endpoint.MacAddress, + }, + guestReq, + ) + if err != nil { + return err + } + if err := uvm.modify(ctx, &request); err != nil { return err } @@ -605,27 +620,23 @@ func (uvm *UtilityVM) addNIC(ctx context.Context, id string, endpoint *hns.HNSEn } func (uvm *UtilityVM) removeNIC(ctx context.Context, id string, endpoint *hns.HNSEndpoint) error { - request := hcsschema.ModifySettingRequest{ - RequestType: guestrequest.RequestTypeRemove, - ResourcePath: fmt.Sprintf(resourcepaths.NetworkResourceFormat, id), - Settings: hcsschema.NetworkAdapter{ - EndpointId: endpoint.Id, - MacAddress: endpoint.MacAddress, - }, - } - + var guestReq any if uvm.operatingSystem == "windows" { - request.GuestRequest = hcsschema.ModifySettingRequest{ - RequestType: guestrequest.RequestTypeRemove, - Settings: getNetworkModifyRequest( - id, - guestrequest.RequestTypeRemove, - nil), + var err error + guestReq, err = hcsschema.NewModifySettingRequest( + "", + hcsschema.ModifyRequestType_REMOVE, + getNetworkModifyRequest(id, guestrequest.RequestTypeRemove, nil), + nil, // guestRequest - this is a guest request + ) + + if err != nil { + return err } } else { // Verify this version of LCOW supports Network HotRemove if uvm.isNetworkNamespaceSupported() { - request.GuestRequest = guestrequest.ModificationRequest{ + guestReq = guestrequest.ModificationRequest{ ResourceType: guestresource.ResourceTypeNetwork, RequestType: guestrequest.RequestTypeRemove, Settings: &guestresource.LCOWNetworkAdapter{ @@ -636,6 +647,19 @@ func (uvm *UtilityVM) removeNIC(ctx context.Context, id string, endpoint *hns.HN } } + request, err := hcsschema.NewModifySettingRequest( + fmt.Sprintf(resourcepaths.NetworkResourceFormat, id), + hcsschema.ModifyRequestType_REMOVE, + hcsschema.NetworkAdapter{ + EndpointID: endpoint.Id, + MacAddress: endpoint.MacAddress, + }, + guestReq, + ) + if err != nil { + return err + } + if err := uvm.modify(ctx, &request); err != nil { return err } @@ -656,12 +680,17 @@ func (uvm *UtilityVM) RemoveAllNICs(ctx context.Context) error { // UpdateNIC updates a UVM's network adapter. func (uvm *UtilityVM) UpdateNIC(ctx context.Context, id string, settings *hcsschema.NetworkAdapter) error { - req := &hcsschema.ModifySettingRequest{ - RequestType: guestrequest.RequestTypeUpdate, - ResourcePath: fmt.Sprintf(resourcepaths.NetworkResourceFormat, id), - Settings: settings, + req, err := hcsschema.NewModifySettingRequest( + fmt.Sprintf(resourcepaths.NetworkResourceFormat, id), + hcsschema.ModifyRequestType_UPDATE, + settings, + nil, // guestRequest + ) + if err != nil { + return err } - return uvm.modify(ctx, req) + + return uvm.modify(ctx, &req) } // AddNICInGuest makes a request to setup a network adapter's interface inside the lcow guest. @@ -670,11 +699,15 @@ func (uvm *UtilityVM) AddNICInGuest(ctx context.Context, cfg *guestresource.LCOW if !uvm.isNetworkNamespaceSupported() { return fmt.Errorf("guest does not support network namespaces and cannot add VF NIC %+v", cfg) } - request := hcsschema.ModifySettingRequest{} - request.GuestRequest = guestrequest.ModificationRequest{ - ResourceType: guestresource.ResourceTypeNetwork, - RequestType: guestrequest.RequestTypeAdd, - Settings: cfg, + request, err := hcsschema.NewModifySettingGuestRequest( + guestrequest.ModificationRequest{ + ResourceType: guestresource.ResourceTypeNetwork, + RequestType: guestrequest.RequestTypeAdd, + Settings: cfg, + }, + ) + if err != nil { + return err } return uvm.modify(ctx, &request) @@ -686,11 +719,16 @@ func (uvm *UtilityVM) RemoveNICInGuest(ctx context.Context, cfg *guestresource.L if !uvm.isNetworkNamespaceSupported() { return fmt.Errorf("guest does not support network namespaces and cannot remove VF NIC %+v", cfg) } - request := hcsschema.ModifySettingRequest{} - request.GuestRequest = guestrequest.ModificationRequest{ - ResourceType: guestresource.ResourceTypeNetwork, - RequestType: guestrequest.RequestTypeRemove, - Settings: cfg, + + request, err := hcsschema.NewModifySettingGuestRequest( + guestrequest.ModificationRequest{ + ResourceType: guestresource.ResourceTypeNetwork, + RequestType: guestrequest.RequestTypeRemove, + Settings: cfg, + }, + ) + if err != nil { + return err } return uvm.modify(ctx, &request) diff --git a/internal/uvm/pipes.go b/internal/uvm/pipes.go index cc67f9a798..d63fb11b58 100644 --- a/internal/uvm/pipes.go +++ b/internal/uvm/pipes.go @@ -9,7 +9,6 @@ import ( "github.com/Microsoft/hcsshim/internal/hcs/resourcepaths" hcsschema "github.com/Microsoft/hcsshim/internal/hcs/schema2" - "github.com/Microsoft/hcsshim/internal/protocol/guestrequest" specs "github.com/opencontainers/runtime-spec/specs-go" ) @@ -32,8 +31,9 @@ func (pipe *PipeMount) Release(ctx context.Context) error { // AddPipe shares a named pipe into the UVM. func (uvm *UtilityVM) AddPipe(ctx context.Context, hostPath string) (*PipeMount, error) { + rt := hcsschema.ModifyRequestType_ADD modification := &hcsschema.ModifySettingRequest{ - RequestType: guestrequest.RequestTypeAdd, + RequestType: &rt, ResourcePath: fmt.Sprintf(resourcepaths.MappedPipeResourceFormat, hostPath), } if err := uvm.modify(ctx, modification); err != nil { @@ -44,8 +44,9 @@ func (uvm *UtilityVM) AddPipe(ctx context.Context, hostPath string) (*PipeMount, // RemovePipe removes a shared named pipe from the UVM. func (uvm *UtilityVM) RemovePipe(ctx context.Context, hostPath string) error { + rt := hcsschema.ModifyRequestType_REMOVE modification := &hcsschema.ModifySettingRequest{ - RequestType: guestrequest.RequestTypeRemove, + RequestType: &rt, ResourcePath: fmt.Sprintf(resourcepaths.MappedPipeResourceFormat, hostPath), } if err := uvm.modify(ctx, modification); err != nil { diff --git a/internal/uvm/plan9.go b/internal/uvm/plan9.go index d8fce975f8..d1b272d6c4 100644 --- a/internal/uvm/plan9.go +++ b/internal/uvm/plan9.go @@ -51,10 +51,10 @@ func (uvm *UtilityVM) AddPlan9(ctx context.Context, hostPath string, uvmPath str // TODO: JTERRY75 - These are marked private in the schema. For now use them // but when there are public variants we need to switch to them. const ( - shareFlagsReadOnly int32 = 0x00000001 - shareFlagsLinuxMetadata int32 = 0x00000004 - shareFlagsCaseSensitive int32 = 0x00000008 - shareFlagsRestrictFileAccess int32 = 0x00000080 + shareFlagsReadOnly int64 = 0x00000001 + shareFlagsLinuxMetadata int64 = 0x00000004 + shareFlagsCaseSensitive int64 = 0x00000008 + shareFlagsRestrictFileAccess int64 = 0x00000080 ) // TODO: JTERRY75 - `shareFlagsCaseSensitive` only works if the Windows @@ -74,9 +74,10 @@ func (uvm *UtilityVM) AddPlan9(ctx context.Context, hostPath string, uvmPath str uvm.m.Unlock() name := strconv.FormatUint(index, 10) - modification := &hcsschema.ModifySettingRequest{ - RequestType: guestrequest.RequestTypeAdd, - Settings: hcsschema.Plan9Share{ + request, err := hcsschema.NewModifySettingRequest( + resourcepaths.Plan9ShareResourcePath, + hcsschema.ModifyRequestType_ADD, + hcsschema.Plan9Share{ Name: name, AccessName: name, Path: hostPath, @@ -84,8 +85,7 @@ func (uvm *UtilityVM) AddPlan9(ctx context.Context, hostPath string, uvmPath str Flags: flags, AllowedFiles: allowedNames, }, - ResourcePath: resourcepaths.Plan9ShareResourcePath, - GuestRequest: guestrequest.ModificationRequest{ + guestrequest.ModificationRequest{ ResourceType: guestresource.ResourceTypeMappedDirectory, RequestType: guestrequest.RequestTypeAdd, Settings: guestresource.LCOWMappedDirectory{ @@ -95,9 +95,12 @@ func (uvm *UtilityVM) AddPlan9(ctx context.Context, hostPath string, uvmPath str ReadOnly: readOnly, }, }, + ) + if err != nil { + return nil, err } - if err := uvm.modify(ctx, modification); err != nil { + if err := uvm.modify(ctx, &request); err != nil { return nil, err } @@ -115,15 +118,15 @@ func (uvm *UtilityVM) RemovePlan9(ctx context.Context, share *Plan9Share) error return errNotSupported } - modification := &hcsschema.ModifySettingRequest{ - RequestType: guestrequest.RequestTypeRemove, - Settings: hcsschema.Plan9Share{ + request, err := hcsschema.NewModifySettingRequest( + resourcepaths.Plan9ShareResourcePath, + hcsschema.ModifyRequestType_REMOVE, + hcsschema.Plan9Share{ Name: share.name, AccessName: share.name, Port: plan9Port, }, - ResourcePath: resourcepaths.Plan9ShareResourcePath, - GuestRequest: guestrequest.ModificationRequest{ + guestrequest.ModificationRequest{ ResourceType: guestresource.ResourceTypeMappedDirectory, RequestType: guestrequest.RequestTypeRemove, Settings: guestresource.LCOWMappedDirectory{ @@ -132,9 +135,12 @@ func (uvm *UtilityVM) RemovePlan9(ctx context.Context, share *Plan9Share) error Port: plan9Port, }, }, + ) + if err != nil { + return err } - if err := uvm.modify(ctx, modification); err != nil { - return fmt.Errorf("failed to remove plan9 share %s from %s: %+v: %s", share.name, uvm.id, modification, err) + if err := uvm.modify(ctx, &request); err != nil { + return fmt.Errorf("failed to remove plan9 share %s from %s: %+v: %s", share.name, uvm.id, request, err) } return nil } diff --git a/internal/uvm/scsi/attach.go b/internal/uvm/scsi/attach.go index b1450301be..884ec2c706 100644 --- a/internal/uvm/scsi/attach.go +++ b/internal/uvm/scsi/attach.go @@ -5,6 +5,8 @@ import ( "fmt" "reflect" "sync" + + hcsschema "github.com/Microsoft/hcsshim/internal/hcs/schema2" ) type attachManager struct { @@ -49,7 +51,7 @@ type attachment struct { type attachConfig struct { path string readOnly bool - typ string + typ hcsschema.AttachmentType evdType string } diff --git a/internal/uvm/scsi/backend.go b/internal/uvm/scsi/backend.go index af1445f13a..fef9f64937 100644 --- a/internal/uvm/scsi/backend.go +++ b/internal/uvm/scsi/backend.go @@ -58,22 +58,27 @@ func NewHCSHostBackend(system *hcs.System) HostBackend { } func (hhb *hcsHostBackend) attach(ctx context.Context, controller, lun uint, config *attachConfig) error { - req := &hcsschema.ModifySettingRequest{ - RequestType: guestrequest.RequestTypeAdd, - Settings: hcsschema.Attachment{ + req, err := hcsschema.NewModifySettingRequest( + fmt.Sprintf(resourcepaths.SCSIResourceFormat, guestrequest.ScsiControllerGuids[controller], lun), + hcsschema.ModifyRequestType_ADD, + hcsschema.Attachment{ Path: config.path, - Type_: config.typ, + Type_: &config.typ, ReadOnly: config.readOnly, ExtensibleVirtualDiskType: config.evdType, }, - ResourcePath: fmt.Sprintf(resourcepaths.SCSIResourceFormat, guestrequest.ScsiControllerGuids[controller], lun), + nil, // guestRequest + ) + if err != nil { + return err } - return hhb.system.Modify(ctx, req) + return hhb.system.Modify(ctx, &req) } func (hhb *hcsHostBackend) detach(ctx context.Context, controller, lun uint) error { + rt := hcsschema.ModifyRequestType_REMOVE req := &hcsschema.ModifySettingRequest{ - RequestType: guestrequest.RequestTypeRemove, + RequestType: &rt, ResourcePath: fmt.Sprintf(resourcepaths.SCSIResourceFormat, guestrequest.ScsiControllerGuids[controller], lun), } return hhb.system.Modify(ctx, req) @@ -137,30 +142,42 @@ func NewHCSGuestBackend(system *hcs.System, osType string) GuestBackend { } func (hgb *hcsGuestBackend) mount(ctx context.Context, controller, lun uint, path string, config *mountConfig) error { - req, err := mountRequest(controller, lun, path, config, hgb.osType) + gReq, err := mountRequest(controller, lun, path, config, hgb.osType) + if err != nil { + return err + } + req, err := hcsschema.NewModifySettingGuestRequest(gReq) if err != nil { return err } - return hgb.system.Modify(ctx, &hcsschema.ModifySettingRequest{GuestRequest: req}) + return hgb.system.Modify(ctx, &req) } func (hgb *hcsGuestBackend) unmount(ctx context.Context, controller, lun uint, path string, config *mountConfig) error { - req, err := unmountRequest(controller, lun, path, config, hgb.osType) + gReq, err := unmountRequest(controller, lun, path, config, hgb.osType) + if err != nil { + return err + } + req, err := hcsschema.NewModifySettingGuestRequest(gReq) if err != nil { return err } - return hgb.system.Modify(ctx, &hcsschema.ModifySettingRequest{GuestRequest: req}) + return hgb.system.Modify(ctx, &req) } func (hgb *hcsGuestBackend) unplug(ctx context.Context, controller, lun uint) error { - req, err := unplugRequest(controller, lun, hgb.osType) + gReq, err := unplugRequest(controller, lun, hgb.osType) if err != nil { return err } - if req.RequestType == "" { + if gReq.RequestType == "" { return nil } - return hgb.system.Modify(ctx, &hcsschema.ModifySettingRequest{GuestRequest: req}) + req, err := hcsschema.NewModifySettingGuestRequest(gReq) + if err != nil { + return err + } + return hgb.system.Modify(ctx, &req) } func mountRequest(controller, lun uint, path string, config *mountConfig, osType string) (guestrequest.ModificationRequest, error) { diff --git a/internal/uvm/scsi/manager.go b/internal/uvm/scsi/manager.go index bad893d594..6cda4c6528 100644 --- a/internal/uvm/scsi/manager.go +++ b/internal/uvm/scsi/manager.go @@ -7,6 +7,7 @@ import ( "strings" "sync" + hcsschema "github.com/Microsoft/hcsshim/internal/hcs/schema2" "github.com/Microsoft/hcsshim/internal/wclayer" ) @@ -161,7 +162,7 @@ func (m *Manager) AddVirtualDisk( &attachConfig{ path: hostPath, readOnly: readOnly, - typ: "VirtualDisk", + typ: hcsschema.AttachmentType_VIRTUAL_DISK, }, mcInternal) } @@ -206,7 +207,7 @@ func (m *Manager) AddPhysicalDisk( &attachConfig{ path: hostPath, readOnly: readOnly, - typ: "PassThru", + typ: hcsschema.AttachmentType_PASS_THRU, }, mcInternal) } @@ -250,7 +251,7 @@ func (m *Manager) AddExtensibleVirtualDisk( &attachConfig{ path: mountPath, readOnly: readOnly, - typ: "ExtensibleVirtualDisk", + typ: hcsschema.AttachmentType_EXTENSIBLE_VIRTUAL_DISK, evdType: evdType, }, mcInternal) diff --git a/internal/uvm/security_policy.go b/internal/uvm/security_policy.go index a07979d48a..5fd7a37b5b 100644 --- a/internal/uvm/security_policy.go +++ b/internal/uvm/security_policy.go @@ -87,16 +87,22 @@ func (uvm *UtilityVM) SetConfidentialUVMOptions(ctx context.Context, opts ...Con return err } } - modification := &hcsschema.ModifySettingRequest{ - RequestType: guestrequest.RequestTypeAdd, - GuestRequest: guestrequest.ModificationRequest{ + + request, err := hcsschema.NewModifySettingRequest( + "", + hcsschema.ModifyRequestType_ADD, + nil, // settings + guestrequest.ModificationRequest{ ResourceType: guestresource.ResourceTypeSecurityPolicy, RequestType: guestrequest.RequestTypeAdd, Settings: *confOpts, }, + ) + if err != nil { + return err } - if err := uvm.modify(ctx, modification); err != nil { + if err := uvm.modify(ctx, &request); err != nil { return fmt.Errorf("uvm::Policy: failed to modify utility VM configuration: %s", err) } @@ -108,15 +114,21 @@ func (uvm *UtilityVM) InjectPolicyFragment(ctx context.Context, fragment *ctrdta if uvm.operatingSystem != "linux" { return errNotSupported } - mod := &hcsschema.ModifySettingRequest{ - RequestType: guestrequest.RequestTypeUpdate, - GuestRequest: guestrequest.ModificationRequest{ + request, err := hcsschema.NewModifySettingRequest( + "", + hcsschema.ModifyRequestType_UPDATE, + nil, // settings + guestrequest.ModificationRequest{ ResourceType: guestresource.ResourceTypePolicyFragment, RequestType: guestrequest.RequestTypeAdd, Settings: guestresource.LCOWSecurityPolicyFragment{ Fragment: fragment.Fragment, }, }, + ) + if err != nil { + return err } - return uvm.modify(ctx, mod) + + return uvm.modify(ctx, &request) } diff --git a/internal/uvm/start.go b/internal/uvm/start.go index 79716ab80c..ae85300a53 100644 --- a/internal/uvm/start.go +++ b/internal/uvm/start.go @@ -137,15 +137,18 @@ func (uvm *UtilityVM) configureHvSocketForGCS(ctx context.Context) (err error) { ParentAddress: gcs.WindowsGcsHvHostID.String(), } - conSetupReq := &hcsschema.ModifySettingRequest{ - GuestRequest: guestrequest.ModificationRequest{ + req, err := hcsschema.NewModifySettingGuestRequest( + guestrequest.ModificationRequest{ RequestType: guestrequest.RequestTypeUpdate, ResourceType: guestresource.ResourceTypeHvSocket, Settings: hvsocketAddress, }, + ) + if err != nil { + return err } - if err = uvm.modify(ctx, conSetupReq); err != nil { + if err = uvm.modify(ctx, &req); err != nil { return fmt.Errorf("failed to configure HVSOCK for external GCS: %s", err) } diff --git a/internal/uvm/stats.go b/internal/uvm/stats.go index 2cd5c24ce0..f307212135 100644 --- a/internal/uvm/stats.go +++ b/internal/uvm/stats.go @@ -112,7 +112,7 @@ func (uvm *UtilityVM) getVMMEMProcess(ctx context.Context) (windows.Handle, erro // Stats returns various UVM statistics. func (uvm *UtilityVM) Stats(ctx context.Context) (*stats.VirtualMachineStatistics, error) { s := &stats.VirtualMachineStatistics{} - props, err := uvm.hcsSystem.PropertiesV2(ctx, hcsschema.PTStatistics, hcsschema.PTMemory) + props, err := uvm.hcsSystem.PropertiesV2(ctx, hcsschema.SystemPropertyType_STATISTICS, hcsschema.SystemPropertyType_MEMORY) if err != nil { return nil, err } @@ -144,7 +144,7 @@ func (uvm *UtilityVM) Stats(ctx context.Context) (*stats.VirtualMachineStatistic } if props.Memory != nil { - s.Memory.VirtualNodeCount = props.Memory.VirtualNodeCount + s.Memory.VirtualNodeCount = uint32(props.Memory.VirtualNodeCount) s.Memory.VmMemory = &stats.VirtualMachineMemory{} s.Memory.VmMemory.AvailableMemory = props.Memory.VirtualMachineMemory.AvailableMemory s.Memory.VmMemory.AvailableMemoryBuffer = props.Memory.VirtualMachineMemory.AvailableMemoryBuffer diff --git a/internal/uvm/timezone.go b/internal/uvm/timezone.go index 3ce7b9764f..9519c1ac26 100644 --- a/internal/uvm/timezone.go +++ b/internal/uvm/timezone.go @@ -34,26 +34,26 @@ func tziToHCSSchema(tzi *windows.Timezoneinformation) *hcsschema.TimeZoneInforma Bias: tzi.Bias, StandardName: windows.UTF16ToString(tzi.StandardName[:]), StandardDate: &hcsschema.SystemTime{ - Year: int32(tzi.StandardDate.Year), - Month: int32(tzi.StandardDate.Month), - DayOfWeek: int32(tzi.StandardDate.DayOfWeek), - Day: int32(tzi.StandardDate.Day), - Hour: int32(tzi.StandardDate.Hour), - Second: int32(tzi.StandardDate.Second), - Minute: int32(tzi.StandardDate.Minute), - Milliseconds: int32(tzi.StandardDate.Milliseconds), + Year: uint16(tzi.StandardDate.Year), + Month: uint16(tzi.StandardDate.Month), + DayOfWeek: uint16(tzi.StandardDate.DayOfWeek), + Day: uint16(tzi.StandardDate.Day), + Hour: uint16(tzi.StandardDate.Hour), + Second: uint16(tzi.StandardDate.Second), + Minute: uint16(tzi.StandardDate.Minute), + Milliseconds: uint16(tzi.StandardDate.Milliseconds), }, StandardBias: tzi.StandardBias, DaylightName: windows.UTF16ToString(tzi.DaylightName[:]), DaylightDate: &hcsschema.SystemTime{ - Year: int32(tzi.DaylightDate.Year), - Month: int32(tzi.DaylightDate.Month), - DayOfWeek: int32(tzi.DaylightDate.DayOfWeek), - Day: int32(tzi.DaylightDate.Day), - Hour: int32(tzi.DaylightDate.Hour), - Second: int32(tzi.DaylightDate.Second), - Minute: int32(tzi.DaylightDate.Minute), - Milliseconds: int32(tzi.DaylightDate.Milliseconds), + Year: uint16(tzi.DaylightDate.Year), + Month: uint16(tzi.DaylightDate.Month), + DayOfWeek: uint16(tzi.DaylightDate.DayOfWeek), + Day: uint16(tzi.DaylightDate.Day), + Hour: uint16(tzi.DaylightDate.Hour), + Second: uint16(tzi.DaylightDate.Second), + Minute: uint16(tzi.DaylightDate.Minute), + Milliseconds: uint16(tzi.DaylightDate.Milliseconds), }, DaylightBias: tzi.DaylightBias, } diff --git a/internal/uvm/virtual_device.go b/internal/uvm/virtual_device.go index 3bd6e187a9..38cee8980d 100644 --- a/internal/uvm/virtual_device.go +++ b/internal/uvm/virtual_device.go @@ -102,8 +102,8 @@ func (uvm *UtilityVM) AssignDevice(ctx context.Context, deviceID string, index u return existingVPCIDevice, nil } - targetDevice := hcsschema.VirtualPciDevice{ - Functions: []hcsschema.VirtualPciFunction{ + targetDevice := hcsschema.VirtualPCIDevice{ + Functions: []hcsschema.VirtualPCIFunction{ { DeviceInstancePath: deviceID, VirtualFunction: index, @@ -111,19 +111,14 @@ func (uvm *UtilityVM) AssignDevice(ctx context.Context, deviceID string, index u }, } - request := &hcsschema.ModifySettingRequest{ - ResourcePath: fmt.Sprintf(resourcepaths.VirtualPCIResourceFormat, vmBusGUID), - RequestType: guestrequest.RequestTypeAdd, - Settings: targetDevice, - } - // WCOW (when supported) does not require a guest request as part of the // device assignment + var guestReq *guestrequest.ModificationRequest if uvm.operatingSystem != "windows" { // for LCOW, we need to make sure that specific paths relating to the // device exist so they are ready to be used by later // work in openGCS - request.GuestRequest = guestrequest.ModificationRequest{ + guestReq = &guestrequest.ModificationRequest{ ResourceType: guestresource.ResourceTypeVPCIDevice, RequestType: guestrequest.RequestTypeAdd, Settings: guestresource.LCOWMappedVPCIDevice{ @@ -131,8 +126,17 @@ func (uvm *UtilityVM) AssignDevice(ctx context.Context, deviceID string, index u }, } } + request, err := hcsschema.NewModifySettingRequest( + fmt.Sprintf(resourcepaths.VirtualPCIResourceFormat, vmBusGUID), + hcsschema.ModifyRequestType_ADD, + targetDevice, + guestReq, + ) + if err != nil { + return nil, err + } - if err := uvm.modify(ctx, request); err != nil { + if err := uvm.modify(ctx, &request); err != nil { return nil, err } result := &VPCIDevice{ @@ -166,9 +170,10 @@ func (uvm *UtilityVM) RemoveDevice(ctx context.Context, deviceInstanceID string, vpci.refCount-- if vpci.refCount == 0 { delete(uvm.vpciDevices, key) + rt := hcsschema.ModifyRequestType_REMOVE return uvm.modify(ctx, &hcsschema.ModifySettingRequest{ ResourcePath: fmt.Sprintf(resourcepaths.VirtualPCIResourceFormat, vpci.VMBusGUID), - RequestType: guestrequest.RequestTypeRemove, + RequestType: &rt, }) } return nil diff --git a/internal/uvm/vpmem.go b/internal/uvm/vpmem.go index c04f523d1c..1e71afec18 100644 --- a/internal/uvm/vpmem.go +++ b/internal/uvm/vpmem.go @@ -111,29 +111,30 @@ func (uvm *UtilityVM) addVPMemDefault(ctx context.Context, hostPath string) (_ s return "", err } - modification := &hcsschema.ModifySettingRequest{ - RequestType: guestrequest.RequestTypeAdd, - Settings: hcsschema.VirtualPMemDevice{ + uvmPath := fmt.Sprintf(lcowDefaultVPMemLayerFmt, deviceNumber) + img := hcsschema.VirtualPMemImageFormat_VHD1 + request, err := hcsschema.NewModifySettingRequest( + fmt.Sprintf(resourcepaths.VPMemControllerResourceFormat, deviceNumber), + hcsschema.ModifyRequestType_ADD, + hcsschema.VirtualPMemDevice{ HostPath: hostPath, ReadOnly: true, - ImageFormat: "Vhd1", + ImageFormat: &img, }, - ResourcePath: fmt.Sprintf(resourcepaths.VPMemControllerResourceFormat, deviceNumber), - } - - uvmPath := fmt.Sprintf(lcowDefaultVPMemLayerFmt, deviceNumber) - guestSettings := guestresource.LCOWMappedVPMemDevice{ - DeviceNumber: deviceNumber, - MountPath: uvmPath, - } - - modification.GuestRequest = guestrequest.ModificationRequest{ - ResourceType: guestresource.ResourceTypeVPMemDevice, - RequestType: guestrequest.RequestTypeAdd, - Settings: guestSettings, + guestrequest.ModificationRequest{ + ResourceType: guestresource.ResourceTypeVPMemDevice, + RequestType: guestrequest.RequestTypeAdd, + Settings: guestresource.LCOWMappedVPMemDevice{ + DeviceNumber: deviceNumber, + MountPath: uvmPath, + }, + }, + ) + if err != nil { + return "", err } - if err := uvm.modify(ctx, modification); err != nil { + if err := uvm.modify(ctx, &request); err != nil { return "", errors.Errorf("uvm::addVPMemDefault: failed to modify utility VM configuration: %s", err) } @@ -155,10 +156,11 @@ func (uvm *UtilityVM) removeVPMemDefault(ctx context.Context, hostPath string) e return nil } - modification := &hcsschema.ModifySettingRequest{ - RequestType: guestrequest.RequestTypeRemove, - ResourcePath: fmt.Sprintf(resourcepaths.VPMemControllerResourceFormat, deviceNumber), - GuestRequest: guestrequest.ModificationRequest{ + request, err := hcsschema.NewModifySettingRequest( + fmt.Sprintf(resourcepaths.VPMemControllerResourceFormat, deviceNumber), + hcsschema.ModifyRequestType_REMOVE, + nil, // settings + guestrequest.ModificationRequest{ ResourceType: guestresource.ResourceTypeVPMemDevice, RequestType: guestrequest.RequestTypeRemove, Settings: guestresource.LCOWMappedVPMemDevice{ @@ -166,8 +168,12 @@ func (uvm *UtilityVM) removeVPMemDefault(ctx context.Context, hostPath string) e MountPath: device.uvmPath, }, }, + ) + if err != nil { + return err } - if err := uvm.modify(ctx, modification); err != nil { + + if err := uvm.modify(ctx, &request); err != nil { return errors.Errorf("failed to remove VPMEM %s from utility VM %s: %s", hostPath, uvm.id, err) } log.G(ctx).WithFields(logrus.Fields{ diff --git a/internal/uvm/vpmem_mapped.go b/internal/uvm/vpmem_mapped.go index 3513873e8b..6a0659e1ae 100644 --- a/internal/uvm/vpmem_mapped.go +++ b/internal/uvm/vpmem_mapped.go @@ -70,7 +70,7 @@ func pageAlign(t uint64) uint64 { // for the multi-mapping setup func newMappedVPMemModifyRequest( ctx context.Context, - rType guestrequest.RequestType, + rType hcsschema.ModifyRequestType, deviceNumber uint32, md *mappedDeviceInfo, uvm *UtilityVM, @@ -84,47 +84,55 @@ func newMappedVPMemModifyRequest( }, } - request := &hcsschema.ModifySettingRequest{ - RequestType: rType, - GuestRequest: guestrequest.ModificationRequest{ - ResourceType: guestresource.ResourceTypeVPMemDevice, - RequestType: rType, - Settings: guestSettings, - }, - } - + var rp string + var settings any pmem := uvm.vpmemDevicesMultiMapped[deviceNumber] switch rType { - case guestrequest.RequestTypeAdd: + case hcsschema.ModifyRequestType_ADD: if pmem == nil { - request.Settings = hcsschema.VirtualPMemDevice{ + img := hcsschema.VirtualPMemImageFormat_VHD1 + settings = hcsschema.VirtualPMemDevice{ ReadOnly: true, HostPath: md.hostPath, - ImageFormat: "Vhd1", + ImageFormat: &img, } - request.ResourcePath = fmt.Sprintf(resourcepaths.VPMemControllerResourceFormat, deviceNumber) + rp = fmt.Sprintf(resourcepaths.VPMemControllerResourceFormat, deviceNumber) } else { - request.Settings = hcsschema.VirtualPMemMapping{ + img := hcsschema.VirtualPMemImageFormat_VHD1 + settings = hcsschema.VirtualPMemMapping{ HostPath: md.hostPath, - ImageFormat: "Vhd1", + ImageFormat: &img, } - request.ResourcePath = fmt.Sprintf(resourcepaths.VPMemDeviceResourceFormat, deviceNumber, md.mappedRegion.Offset()) + rp = fmt.Sprintf(resourcepaths.VPMemDeviceResourceFormat, deviceNumber, md.mappedRegion.Offset()) } - case guestrequest.RequestTypeRemove: + case hcsschema.ModifyRequestType_REMOVE: if pmem == nil { return nil, errors.Errorf("no device found at location %d", deviceNumber) } - request.ResourcePath = fmt.Sprintf(resourcepaths.VPMemDeviceResourceFormat, deviceNumber, md.mappedRegion.Offset()) + rp = fmt.Sprintf(resourcepaths.VPMemDeviceResourceFormat, deviceNumber, md.mappedRegion.Offset()) default: return nil, errors.New("unsupported request type") } + request, err := hcsschema.NewModifySettingRequest( + rp, + rType, + settings, + guestrequest.ModificationRequest{ + ResourceType: guestresource.ResourceTypeVPMemDevice, + RequestType: guestrequest.RequestType(string(rType)), + Settings: guestSettings, + }, + ) + if err != nil { + return nil, err + } log.G(ctx).WithFields(logrus.Fields{ "deviceNumber": deviceNumber, "hostPath": md.hostPath, "uvmPath": md.uvmPath, }).Debugf("new mapped VPMem modify request: %v", request) - return request, nil + return &request, nil } // mapVHDLayer adds `device` to mappings @@ -253,13 +261,13 @@ func (uvm *UtilityVM) addVPMemMappedDevice(ctx context.Context, hostPath string) uvmPath := fmt.Sprintf(lcowPackedVPMemLayerFmt, deviceNumber, memReg.Offset(), devSize) md := newVPMemMappedDevice(hostPath, uvmPath, devSize, memReg) - modification, err := newMappedVPMemModifyRequest(ctx, guestrequest.RequestTypeAdd, deviceNumber, md, uvm) + modification, err := newMappedVPMemModifyRequest(ctx, hcsschema.ModifyRequestType_ADD, deviceNumber, md, uvm) if err := uvm.modify(ctx, modification); err != nil { return "", errors.Errorf("uvm::addVPMemMappedDevice: failed to modify utility VM configuration: %s", err) } defer func() { if err != nil { - rmRequest, _ := newMappedVPMemModifyRequest(ctx, guestrequest.RequestTypeRemove, deviceNumber, md, uvm) + rmRequest, _ := newMappedVPMemModifyRequest(ctx, hcsschema.ModifyRequestType_REMOVE, deviceNumber, md, uvm) if err := uvm.modify(ctx, rmRequest); err != nil { log.G(ctx).WithError(err).Debugf("failed to rollback modification") } @@ -297,7 +305,7 @@ func (uvm *UtilityVM) removeVPMemMappedDevice(ctx context.Context, hostPath stri return nil } - modification, err := newMappedVPMemModifyRequest(ctx, guestrequest.RequestTypeRemove, devNum, md, uvm) + modification, err := newMappedVPMemModifyRequest(ctx, hcsschema.ModifyRequestType_REMOVE, devNum, md, uvm) if err != nil { return err } diff --git a/internal/uvm/vsmb.go b/internal/uvm/vsmb.go index 05480df74c..d27fb94efd 100644 --- a/internal/uvm/vsmb.go +++ b/internal/uvm/vsmb.go @@ -17,7 +17,6 @@ import ( "github.com/Microsoft/hcsshim/internal/hcs/resourcepaths" hcsschema "github.com/Microsoft/hcsshim/internal/hcs/schema2" "github.com/Microsoft/hcsshim/internal/log" - "github.com/Microsoft/hcsshim/internal/protocol/guestrequest" "github.com/Microsoft/hcsshim/internal/winapi" "github.com/Microsoft/hcsshim/osversion" ) @@ -54,7 +53,7 @@ func (uvm *UtilityVM) DefaultVSMBOptions(readOnly bool) *hcsschema.VirtualSmbSha } if readOnly { opts.ShareRead = true - opts.CacheIo = true + opts.CacheIO = true opts.ReadOnly = true opts.PseudoOplocks = true } @@ -178,11 +177,11 @@ func (uvm *UtilityVM) AddVSMB(ctx context.Context, hostPath string, options *hcs options.NoDirectmap = true } - var requestType = guestrequest.RequestTypeUpdate + var requestType = hcsschema.ModifyRequestType_UPDATE shareKey := getVSMBShareKey(hostPath, options.ReadOnly) share, err := uvm.findVSMBShare(ctx, m, shareKey) if err == ErrNotAttached { - requestType = guestrequest.RequestTypeAdd + requestType = hcsschema.ModifyRequestType_ADD uvm.vsmbCounter++ shareName := "s" + strconv.FormatUint(uvm.vsmbCounter, 16) @@ -202,24 +201,29 @@ func (uvm *UtilityVM) AddVSMB(ctx context.Context, hostPath string, options *hcs // AllowedFileList, and in fact will return an error if RestrictFileAccess // isn't set (e.g. if used on an unrestricted share). So we only call Modify // if we are either doing an Add, or if RestrictFileAccess is set. - if requestType == guestrequest.RequestTypeAdd || options.RestrictFileAccess { + if requestType == hcsschema.ModifyRequestType_ADD || options.RestrictFileAccess { log.G(ctx).WithFields(logrus.Fields{ "name": share.name, "path": hostPath, "options": fmt.Sprintf("%+#v", options), "operation": requestType, }).Info("Modifying VSMB share") - modification := &hcsschema.ModifySettingRequest{ - RequestType: requestType, - Settings: hcsschema.VirtualSmbShare{ + + request, err := hcsschema.NewModifySettingRequest( + resourcepaths.VSMBShareResourcePath, + requestType, + hcsschema.VirtualSmbShare{ Name: share.name, Options: options, Path: hostPath, AllowedFiles: newAllowedFiles, }, - ResourcePath: resourcepaths.VSMBShareResourcePath, + nil, // guestRequest + ) + if err != nil { + return nil, err } - if err := uvm.modify(ctx, modification); err != nil { + if err := uvm.modify(ctx, &request); err != nil { return nil, err } } @@ -262,13 +266,18 @@ func (uvm *UtilityVM) RemoveVSMB(ctx context.Context, hostPath string, readOnly return nil } - modification := &hcsschema.ModifySettingRequest{ - RequestType: guestrequest.RequestTypeRemove, - Settings: hcsschema.VirtualSmbShare{Name: share.name}, - ResourcePath: resourcepaths.VSMBShareResourcePath, + request, err := hcsschema.NewModifySettingRequest( + resourcepaths.VSMBShareResourcePath, + hcsschema.ModifyRequestType_REMOVE, + hcsschema.VirtualSmbShare{Name: share.name}, + nil, // guestRequest + ) + if err != nil { + return err } - if err := uvm.modify(ctx, modification); err != nil { - return fmt.Errorf("failed to remove vsmb share %s from %s: %+v: %s", hostPath, uvm.id, modification, err) + + if err := uvm.modify(ctx, &request); err != nil { + return fmt.Errorf("failed to remove vsmb share %s from %s: %+v: %s", hostPath, uvm.id, request, err) } delete(m, shareKey) diff --git a/internal/vm/hcs/boot.go b/internal/vm/hcs/boot.go index a1794a4f2c..35fbf05a8b 100644 --- a/internal/vm/hcs/boot.go +++ b/internal/vm/hcs/boot.go @@ -9,10 +9,11 @@ import ( ) func (uvmb *utilityVMBuilder) SetUEFIBoot(dir string, path string, args string) error { + dt := hcsschema.UefiBootDevice_VMB_FS uvmb.doc.VirtualMachine.Chipset.Uefi = &hcsschema.Uefi{ BootThis: &hcsschema.UefiBootEntry{ DevicePath: path, - DeviceType: "VmbFs", + DeviceType: &dt, VmbFsRootPath: dir, OptionalData: args, }, diff --git a/internal/vm/hcs/builder.go b/internal/vm/hcs/builder.go index 960f50e40c..2abc480044 100644 --- a/internal/vm/hcs/builder.go +++ b/internal/vm/hcs/builder.go @@ -29,13 +29,13 @@ func NewUVMBuilder(id string, owner string, guestOS vm.GuestOS) (vm.UVMBuilder, StopOnReset: true, Chipset: &hcsschema.Chipset{}, ComputeTopology: &hcsschema.Topology{ - Memory: &hcsschema.Memory2{ + Memory: &hcsschema.VirtualMachineMemory{ AllowOvercommit: true, }, - Processor: &hcsschema.Processor2{}, + Processor: &hcsschema.VirtualMachineProcessor{}, }, Devices: &hcsschema.Devices{ - HvSocket: &hcsschema.HvSocket2{ + HvSocket: &hcsschema.VirtualMachineHvSocket{ HvSocketConfig: &hcsschema.HvSocketSystemConfig{ // Allow administrators and SYSTEM to bind to vsock sockets // so that we can create a GCS log socket. diff --git a/internal/vm/hcs/hcs.go b/internal/vm/hcs/hcs.go index ebf56a7cb6..f2d50f3d2a 100644 --- a/internal/vm/hcs/hcs.go +++ b/internal/vm/hcs/hcs.go @@ -60,8 +60,9 @@ func (uvm *utilityVM) Resume(ctx context.Context) error { } func (uvm *utilityVM) Save(ctx context.Context) error { + st := hcsschema.SaveType_AS_TEMPLATE saveOptions := hcsschema.SaveOptions{ - SaveType: "AsTemplate", + SaveType: &st, } if err := uvm.cs.Save(ctx, saveOptions); err != nil { return errors.Wrap(err, "failed to save utility VM state") diff --git a/internal/vm/hcs/network.go b/internal/vm/hcs/network.go index f61f6bb4ed..d4178df66f 100644 --- a/internal/vm/hcs/network.go +++ b/internal/vm/hcs/network.go @@ -8,29 +8,36 @@ import ( "github.com/Microsoft/hcsshim/internal/hcs/resourcepaths" hcsschema "github.com/Microsoft/hcsshim/internal/hcs/schema2" - "github.com/Microsoft/hcsshim/internal/protocol/guestrequest" ) func (uvm *utilityVM) AddNIC(ctx context.Context, nicID, endpointID, macAddr string) error { - request := hcsschema.ModifySettingRequest{ - RequestType: guestrequest.RequestTypeAdd, - ResourcePath: fmt.Sprintf(resourcepaths.NetworkResourceFormat, nicID), - Settings: hcsschema.NetworkAdapter{ - EndpointId: endpointID, + request, err := hcsschema.NewModifySettingRequest( + fmt.Sprintf(resourcepaths.NetworkResourceFormat, nicID), + hcsschema.ModifyRequestType_ADD, + hcsschema.NetworkAdapter{ + EndpointID: endpointID, MacAddress: macAddr, }, + nil, // guestRequest + ) + if err != nil { + return err } return uvm.cs.Modify(ctx, request) } func (uvm *utilityVM) RemoveNIC(ctx context.Context, nicID, endpointID, macAddr string) error { - request := hcsschema.ModifySettingRequest{ - RequestType: guestrequest.RequestTypeRemove, - ResourcePath: fmt.Sprintf(resourcepaths.NetworkResourceFormat, nicID), - Settings: hcsschema.NetworkAdapter{ - EndpointId: endpointID, + request, err := hcsschema.NewModifySettingRequest( + fmt.Sprintf(resourcepaths.NetworkResourceFormat, nicID), + hcsschema.ModifyRequestType_REMOVE, + hcsschema.NetworkAdapter{ + EndpointID: endpointID, MacAddress: macAddr, }, + nil, // guestRequest + ) + if err != nil { + return err } return uvm.cs.Modify(ctx, request) } diff --git a/internal/vm/hcs/pci.go b/internal/vm/hcs/pci.go index 35e97e1de8..fae11d672d 100644 --- a/internal/vm/hcs/pci.go +++ b/internal/vm/hcs/pci.go @@ -8,28 +8,36 @@ import ( "github.com/Microsoft/hcsshim/internal/hcs/resourcepaths" hcsschema "github.com/Microsoft/hcsshim/internal/hcs/schema2" - "github.com/Microsoft/hcsshim/internal/protocol/guestrequest" ) func (uvm *utilityVM) AddDevice(ctx context.Context, instanceID, vmbusGUID string) error { - request := &hcsschema.ModifySettingRequest{ - ResourcePath: fmt.Sprintf(resourcepaths.VirtualPCIResourceFormat, vmbusGUID), - RequestType: guestrequest.RequestTypeAdd, - Settings: hcsschema.VirtualPciDevice{ - Functions: []hcsschema.VirtualPciFunction{ + request, err := hcsschema.NewModifySettingRequest( + fmt.Sprintf(resourcepaths.VirtualPCIResourceFormat, vmbusGUID), + hcsschema.ModifyRequestType_ADD, + hcsschema.VirtualPCIDevice{ + Functions: []hcsschema.VirtualPCIFunction{ { DeviceInstancePath: instanceID, }, }, }, + nil, // guestRequest + ) + if err != nil { + return err } return uvm.cs.Modify(ctx, request) } func (uvm *utilityVM) RemoveDevice(ctx context.Context, instanceID, vmbusGUID string) error { - request := &hcsschema.ModifySettingRequest{ - ResourcePath: fmt.Sprintf(resourcepaths.VirtualPCIResourceFormat, vmbusGUID), - RequestType: guestrequest.RequestTypeRemove, + request, err := hcsschema.NewModifySettingRequest( + fmt.Sprintf(resourcepaths.VirtualPCIResourceFormat, vmbusGUID), + hcsschema.ModifyRequestType_REMOVE, + nil, + nil, // guestRequest + ) + if err != nil { + return err } return uvm.cs.Modify(ctx, request) } diff --git a/internal/vm/hcs/plan9.go b/internal/vm/hcs/plan9.go index 23cd7cc030..b5072abe71 100644 --- a/internal/vm/hcs/plan9.go +++ b/internal/vm/hcs/plan9.go @@ -7,34 +7,42 @@ import ( "github.com/Microsoft/hcsshim/internal/hcs/resourcepaths" hcsschema "github.com/Microsoft/hcsshim/internal/hcs/schema2" - "github.com/Microsoft/hcsshim/internal/protocol/guestrequest" ) func (uvm *utilityVM) AddPlan9(ctx context.Context, path, name string, port int32, flags int32, allowed []string) error { - modification := &hcsschema.ModifySettingRequest{ - RequestType: guestrequest.RequestTypeAdd, - Settings: hcsschema.Plan9Share{ + + request, err := hcsschema.NewModifySettingRequest( + resourcepaths.Plan9ShareResourcePath, + hcsschema.ModifyRequestType_ADD, + hcsschema.Plan9Share{ Name: name, AccessName: name, Path: path, - Port: port, - Flags: flags, + Port: uint32(port), + Flags: int64(flags), AllowedFiles: allowed, }, - ResourcePath: resourcepaths.Plan9ShareResourcePath, + nil, // guestRequest + ) + if err != nil { + return err } - return uvm.cs.Modify(ctx, modification) + return uvm.cs.Modify(ctx, request) } func (uvm *utilityVM) RemovePlan9(ctx context.Context, name string, port int32) error { - modification := &hcsschema.ModifySettingRequest{ - RequestType: guestrequest.RequestTypeRemove, - Settings: hcsschema.Plan9Share{ + request, err := hcsschema.NewModifySettingRequest( + resourcepaths.Plan9ShareResourcePath, + hcsschema.ModifyRequestType_REMOVE, + hcsschema.Plan9Share{ Name: name, AccessName: name, - Port: port, + Port: uint32(port), }, - ResourcePath: resourcepaths.Plan9ShareResourcePath, + nil, // guestRequest + ) + if err != nil { + return err } - return uvm.cs.Modify(ctx, modification) + return uvm.cs.Modify(ctx, request) } diff --git a/internal/vm/hcs/processor.go b/internal/vm/hcs/processor.go index 27bfbc61d3..c073b8dc20 100644 --- a/internal/vm/hcs/processor.go +++ b/internal/vm/hcs/processor.go @@ -3,6 +3,6 @@ package hcs func (uvmb *utilityVMBuilder) SetProcessorCount(count uint32) error { - uvmb.doc.VirtualMachine.ComputeTopology.Processor.Count = int32(count) + uvmb.doc.VirtualMachine.ComputeTopology.Processor.Count = uint32(count) return nil } diff --git a/internal/vm/hcs/scsi.go b/internal/vm/hcs/scsi.go index ad2582d16e..c78023bbcd 100644 --- a/internal/vm/hcs/scsi.go +++ b/internal/vm/hcs/scsi.go @@ -11,33 +11,37 @@ import ( "github.com/Microsoft/hcsshim/internal/hcs/resourcepaths" hcsschema "github.com/Microsoft/hcsshim/internal/hcs/schema2" - "github.com/Microsoft/hcsshim/internal/protocol/guestrequest" "github.com/Microsoft/hcsshim/internal/vm" ) func (uvmb *utilityVMBuilder) AddSCSIController(id uint32) error { - if uvmb.doc.VirtualMachine.Devices.Scsi == nil { - uvmb.doc.VirtualMachine.Devices.Scsi = make(map[string]hcsschema.Scsi, 1) + if uvmb.doc.VirtualMachine.Devices.SCSI == nil { + uvmb.doc.VirtualMachine.Devices.SCSI = make(map[string]hcsschema.SCSI, 1) } - uvmb.doc.VirtualMachine.Devices.Scsi[strconv.Itoa(int(id))] = hcsschema.Scsi{ + uvmb.doc.VirtualMachine.Devices.SCSI[strconv.Itoa(int(id))] = hcsschema.SCSI{ Attachments: make(map[string]hcsschema.Attachment), } return nil } func (uvmb *utilityVMBuilder) AddSCSIDisk(ctx context.Context, controller uint32, lun uint32, path string, typ vm.SCSIDiskType, readOnly bool) error { - if uvmb.doc.VirtualMachine.Devices.Scsi == nil { + diskType, err := getSCSIDiskTypeString(typ) + if err != nil { + return err + } + + if uvmb.doc.VirtualMachine.Devices.SCSI == nil { return errors.New("no SCSI controller found") } - ctrl, ok := uvmb.doc.VirtualMachine.Devices.Scsi[strconv.Itoa(int(controller))] + ctrl, ok := uvmb.doc.VirtualMachine.Devices.SCSI[strconv.Itoa(int(controller))] if !ok { return fmt.Errorf("no scsi controller with index %d found", controller) } ctrl.Attachments[strconv.Itoa(int(lun))] = hcsschema.Attachment{ Path: path, - Type_: string(typ), + Type_: &diskType, ReadOnly: readOnly, } @@ -53,39 +57,46 @@ func (uvm *utilityVM) AddSCSIController(id uint32) error { } func (uvm *utilityVM) AddSCSIDisk(ctx context.Context, controller uint32, lun uint32, path string, typ vm.SCSIDiskType, readOnly bool) error { - diskTypeString, err := getSCSIDiskTypeString(typ) + diskType, err := getSCSIDiskTypeString(typ) if err != nil { return err } - request := &hcsschema.ModifySettingRequest{ - RequestType: guestrequest.RequestTypeAdd, - Settings: hcsschema.Attachment{ + + request, err := hcsschema.NewModifySettingRequest( + fmt.Sprintf(resourcepaths.SCSIResourceFormat, strconv.Itoa(int(controller)), lun), + hcsschema.ModifyRequestType_ADD, + hcsschema.Attachment{ Path: path, - Type_: diskTypeString, + Type_: &diskType, ReadOnly: readOnly, }, - ResourcePath: fmt.Sprintf(resourcepaths.SCSIResourceFormat, strconv.Itoa(int(controller)), lun), + nil, // guestRequest + ) + if err != nil { + return err } + return uvm.cs.Modify(ctx, request) } func (uvm *utilityVM) RemoveSCSIDisk(ctx context.Context, controller uint32, lun uint32, path string) error { + rt := hcsschema.ModifyRequestType_REMOVE request := &hcsschema.ModifySettingRequest{ - RequestType: guestrequest.RequestTypeRemove, + RequestType: &rt, ResourcePath: fmt.Sprintf(resourcepaths.SCSIResourceFormat, strconv.Itoa(int(controller)), lun), } return uvm.cs.Modify(ctx, request) } -func getSCSIDiskTypeString(typ vm.SCSIDiskType) (string, error) { +func getSCSIDiskTypeString(typ vm.SCSIDiskType) (hcsschema.AttachmentType, error) { switch typ { case vm.SCSIDiskTypeVHD1: fallthrough case vm.SCSIDiskTypeVHDX: - return "VirtualDisk", nil + return hcsschema.AttachmentType_VIRTUAL_DISK, nil case vm.SCSIDiskTypePassThrough: - return "PassThru", nil + return hcsschema.AttachmentType_PASS_THRU, nil default: return "", fmt.Errorf("unsupported SCSI disk type: %d", typ) } diff --git a/internal/vm/hcs/stats.go b/internal/vm/hcs/stats.go index 8cd3edbc3e..17b381b18f 100644 --- a/internal/vm/hcs/stats.go +++ b/internal/vm/hcs/stats.go @@ -113,7 +113,7 @@ func (uvm *utilityVM) getVMMEMProcess(ctx context.Context) (windows.Handle, erro func (uvm *utilityVM) Stats(ctx context.Context) (*stats.VirtualMachineStatistics, error) { s := &stats.VirtualMachineStatistics{} - props, err := uvm.cs.PropertiesV2(ctx, hcsschema.PTStatistics, hcsschema.PTMemory) + props, err := uvm.cs.PropertiesV2(ctx, hcsschema.SystemPropertyType_STATISTICS, hcsschema.SystemPropertyType_MEMORY) if err != nil { return nil, err } @@ -146,7 +146,7 @@ func (uvm *utilityVM) Stats(ctx context.Context) (*stats.VirtualMachineStatistic } if props.Memory != nil { - s.Memory.VirtualNodeCount = props.Memory.VirtualNodeCount + s.Memory.VirtualNodeCount = uint32(props.Memory.VirtualNodeCount) s.Memory.VmMemory = &stats.VirtualMachineMemory{} s.Memory.VmMemory.AvailableMemory = props.Memory.VirtualMachineMemory.AvailableMemory s.Memory.VmMemory.AvailableMemoryBuffer = props.Memory.VirtualMachineMemory.AvailableMemoryBuffer diff --git a/internal/vm/hcs/storage.go b/internal/vm/hcs/storage.go index edc7d4dd6e..7313833058 100644 --- a/internal/vm/hcs/storage.go +++ b/internal/vm/hcs/storage.go @@ -3,7 +3,7 @@ package hcs func (uvmb *utilityVMBuilder) SetStorageQos(iopsMaximum int64, bandwidthMaximum int64) error { - uvmb.doc.VirtualMachine.StorageQoS.BandwidthMaximum = int32(bandwidthMaximum) - uvmb.doc.VirtualMachine.StorageQoS.IopsMaximum = int32(iopsMaximum) + uvmb.doc.VirtualMachine.StorageQoS.BandwidthMaximum = uint64(bandwidthMaximum) + uvmb.doc.VirtualMachine.StorageQoS.IOPSMaximum = uint64(iopsMaximum) return nil } diff --git a/internal/vm/hcs/vpmem.go b/internal/vm/hcs/vpmem.go index 915a10e7f7..ce750cc275 100644 --- a/internal/vm/hcs/vpmem.go +++ b/internal/vm/hcs/vpmem.go @@ -11,13 +11,12 @@ import ( "github.com/Microsoft/hcsshim/internal/hcs/resourcepaths" hcsschema "github.com/Microsoft/hcsshim/internal/hcs/schema2" - "github.com/Microsoft/hcsshim/internal/protocol/guestrequest" "github.com/Microsoft/hcsshim/internal/vm" ) func (uvmb *utilityVMBuilder) AddVPMemController(maximumDevices uint32, maximumSizeBytes uint64) error { uvmb.doc.VirtualMachine.Devices.VirtualPMem = &hcsschema.VirtualPMemController{ - MaximumCount: maximumDevices, + MaximumCount: uint8(maximumDevices), MaximumSizeBytes: maximumSizeBytes, } uvmb.doc.VirtualMachine.Devices.VirtualPMem.Devices = make(map[string]hcsschema.VirtualPMemDevice) @@ -35,7 +34,7 @@ func (uvmb *utilityVMBuilder) AddVPMemDevice(ctx context.Context, id uint32, pat uvmb.doc.VirtualMachine.Devices.VirtualPMem.Devices[strconv.Itoa(int(id))] = hcsschema.VirtualPMemDevice{ HostPath: path, ReadOnly: readOnly, - ImageFormat: imageFormatString, + ImageFormat: &imageFormatString, } return nil } @@ -53,32 +52,37 @@ func (uvm *utilityVM) AddVPMemDevice(ctx context.Context, id uint32, path string if err != nil { return err } - request := &hcsschema.ModifySettingRequest{ - RequestType: guestrequest.RequestTypeAdd, - Settings: hcsschema.VirtualPMemDevice{ + request, err := hcsschema.NewModifySettingRequest( + fmt.Sprintf(resourcepaths.VPMemControllerResourceFormat, id), + hcsschema.ModifyRequestType_ADD, + hcsschema.VirtualPMemDevice{ HostPath: path, ReadOnly: readOnly, - ImageFormat: imageFormatString, + ImageFormat: &imageFormatString, }, - ResourcePath: fmt.Sprintf(resourcepaths.VPMemControllerResourceFormat, id), + nil, // guestRequest + ) + if err != nil { + return err } - return uvm.cs.Modify(ctx, request) + return uvm.cs.Modify(ctx, &request) } func (uvm *utilityVM) RemoveVPMemDevice(ctx context.Context, id uint32, path string) error { + rt := hcsschema.ModifyRequestType_REMOVE request := &hcsschema.ModifySettingRequest{ - RequestType: guestrequest.RequestTypeRemove, + RequestType: &rt, ResourcePath: fmt.Sprintf(resourcepaths.VPMemControllerResourceFormat, id), } return uvm.cs.Modify(ctx, request) } -func getVPMemImageFormatString(imageFormat vm.VPMemImageFormat) (string, error) { +func getVPMemImageFormatString(imageFormat vm.VPMemImageFormat) (hcsschema.VirtualPMemImageFormat, error) { switch imageFormat { case vm.VPMemImageFormatVHD1: - return "Vhd1", nil + return hcsschema.VirtualPMemImageFormat_VHD1, nil case vm.VPMemImageFormatVHDX: - return "Vhdx", nil + return hcsschema.VirtualPMemImageFormat_VHDX, nil default: return "", fmt.Errorf("unsupported VPMem image format: %d", imageFormat) } diff --git a/internal/vm/hcs/vsmb.go b/internal/vm/hcs/vsmb.go index 3cb1696c50..b1b71be551 100644 --- a/internal/vm/hcs/vsmb.go +++ b/internal/vm/hcs/vsmb.go @@ -7,7 +7,6 @@ import ( "github.com/Microsoft/hcsshim/internal/hcs/resourcepaths" hcsschema "github.com/Microsoft/hcsshim/internal/hcs/schema2" - "github.com/Microsoft/hcsshim/internal/protocol/guestrequest" "github.com/Microsoft/hcsshim/internal/vm" ) @@ -34,7 +33,7 @@ func vmVSMBOptionsToHCS(options *vm.VSMBOptions) *hcsschema.VirtualSmbShareOptio return &hcsschema.VirtualSmbShareOptions{ ReadOnly: options.ReadOnly, ShareRead: options.ShareRead, - CacheIo: options.CacheIo, + CacheIO: options.CacheIo, NoOplocks: options.NoOplocks, NoDirectmap: options.NoDirectMap, TakeBackupPrivilege: options.TakeBackupPrivilege, @@ -44,24 +43,33 @@ func vmVSMBOptionsToHCS(options *vm.VSMBOptions) *hcsschema.VirtualSmbShareOptio } func (uvm *utilityVM) AddVSMB(ctx context.Context, path string, name string, allowed []string, options *vm.VSMBOptions) error { - modification := &hcsschema.ModifySettingRequest{ - RequestType: guestrequest.RequestTypeAdd, - Settings: hcsschema.VirtualSmbShare{ + request, err := hcsschema.NewModifySettingRequest( + resourcepaths.VSMBShareResourcePath, + hcsschema.ModifyRequestType_ADD, + hcsschema.VirtualSmbShare{ Name: name, Options: vmVSMBOptionsToHCS(options), Path: path, AllowedFiles: allowed, }, - ResourcePath: resourcepaths.VSMBShareResourcePath, + nil, // guestRequest + ) + if err != nil { + return err } - return uvm.cs.Modify(ctx, modification) + + return uvm.cs.Modify(ctx, &request) } func (uvm *utilityVM) RemoveVSMB(ctx context.Context, name string) error { - modification := &hcsschema.ModifySettingRequest{ - RequestType: guestrequest.RequestTypeRemove, - Settings: hcsschema.VirtualSmbShare{Name: name}, - ResourcePath: resourcepaths.VSMBShareResourcePath, + request, err := hcsschema.NewModifySettingRequest( + resourcepaths.VSMBShareResourcePath, + hcsschema.ModifyRequestType_REMOVE, + hcsschema.VirtualSmbShare{Name: name}, + nil, // guestRequest + ) + if err != nil { + return err } - return uvm.cs.Modify(ctx, modification) + return uvm.cs.Modify(ctx, &request) } diff --git a/internal/vm/hcs/windows.go b/internal/vm/hcs/windows.go index 40ab8629c6..5467ec2b0e 100644 --- a/internal/vm/hcs/windows.go +++ b/internal/vm/hcs/windows.go @@ -9,6 +9,6 @@ import ( ) func (uvmb *utilityVMBuilder) SetCPUGroup(ctx context.Context, id string) error { - uvmb.doc.VirtualMachine.ComputeTopology.Processor.CpuGroup = &hcsschema.CpuGroup{Id: id} + uvmb.doc.VirtualMachine.ComputeTopology.Processor.CpuGroup = &hcsschema.CpuGroup{ID: id} return nil } diff --git a/internal/vm/remotevm/windows.go b/internal/vm/remotevm/windows.go index 9e1ef7fb18..599c8a865a 100644 --- a/internal/vm/remotevm/windows.go +++ b/internal/vm/remotevm/windows.go @@ -18,6 +18,6 @@ func (uvmb *utilityVMBuilder) SetCPUGroup(ctx context.Context, id string) error if err != nil { return err } - uvmb.config.WindowsOptions.CpuGroupID = conf.HypervisorGroupId + uvmb.config.WindowsOptions.CpuGroupID = conf.HypervisorGroupID return nil } diff --git a/test/cri-containerd/jobcontainer_test.go b/test/cri-containerd/jobcontainer_test.go index 421f195223..252c3751bb 100644 --- a/test/cri-containerd/jobcontainer_test.go +++ b/test/cri-containerd/jobcontainer_test.go @@ -544,7 +544,8 @@ func Test_RunContainer_JobContainer_Environment(t *testing.T) { Key: "PATH", Value: "C:\\Windows\\system32;C:\\Windows", }, }, - exec: []string{"cmd", "/c", "IF", "%PATH%", "==", "C:\\Windows\\system32;C:\\Windows", "( exit 0 )", "ELSE", "(exit -1)"}, + exec: []string{"cmd", "/c", + `IF "%PATH%"=="C:\Windows\system32;C:\Windows" (exit 0) ELSE ( ECHO "%PATH%" && exit -1)`}, }, { name: "JobContainer_VolumeMount_WithMountPoint", @@ -556,7 +557,8 @@ func Test_RunContainer_JobContainer_Environment(t *testing.T) { Key: "PATH", Value: "%CONTAINER_SANDBOX_MOUNT_POINT%\\apps\\vim\\;C:\\Windows\\system32;C:\\Windows", }, }, - exec: []string{"cmd", "/c", "IF", "%PATH%", "==", "%CONTAINER_SANDBOX_MOUNT_POINT%\\apps\\vim\\;C:\\Windows\\system32;C:\\Windows", "( exit -1 )", "ELSE", "(exit 0)"}, + exec: []string{"cmd", "/c", + `IF "%PATH%"=="%CONTAINER_SANDBOX_MOUNT_POINT%\apps\vim\;C:\Windows\system32;C:\Windows" ( exit 0 ) ELSE ( ECHO "%PATH%" && exit -1)`}, }, } @@ -587,6 +589,9 @@ func Test_RunContainer_JobContainer_Environment(t *testing.T) { Cmd: test.exec, }) if r.ExitCode != 0 { + if len(r.Stdout) > 0 { + t.Logf("stdout: %s", string(r.Stdout)) + } t.Fatalf("failed with exit code %d checking for job container mount: %s", r.ExitCode, string(r.Stderr)) } })