From d4c29fc94df358d451b0331f735cba7902e08199 Mon Sep 17 00:00:00 2001 From: lostbean Date: Thu, 9 Nov 2023 15:37:07 -0300 Subject: [PATCH 01/95] add initial http api --- .../api_container_service.gen.go | 3161 +++++++++++++++++ .../engine_service.go | 1710 +++++++++ api/golang/go.mod | 8 + api/golang/go.sum | 26 + api/openapi/core/api_container_service.yaml | 904 +++++ api/openapi/engine/engine_service.yaml | 432 +++ flake.nix | 1 + go.work.sum | 9 + protobuf2swagger.config.js | 32 + 9 files changed, 6283 insertions(+) create mode 100644 api/golang/core/kurtosis_core_http_api_bindings/api_container_service.gen.go create mode 100644 api/golang/engine/kurtosis_engine_http_api_bindings/engine_service.go create mode 100644 api/openapi/core/api_container_service.yaml create mode 100644 api/openapi/engine/engine_service.yaml create mode 100644 protobuf2swagger.config.js diff --git a/api/golang/core/kurtosis_core_http_api_bindings/api_container_service.gen.go b/api/golang/core/kurtosis_core_http_api_bindings/api_container_service.gen.go new file mode 100644 index 0000000000..d46c2fd6eb --- /dev/null +++ b/api/golang/core/kurtosis_core_http_api_bindings/api_container_service.gen.go @@ -0,0 +1,3161 @@ +// Package api_container_service provides primitives to interact with the openapi HTTP API. +// +// Code generated by github.com/deepmap/oapi-codegen version (devel) DO NOT EDIT. +package api_container_service + +import ( + "bytes" + "compress/gzip" + "context" + "encoding/base64" + "encoding/json" + "fmt" + "io" + "net/http" + "net/url" + "path" + "strings" + + "github.com/getkin/kin-openapi/openapi3" + "github.com/labstack/echo/v4" +) + +// Defines values for ApiContainerApiConnect. +const ( + CONNECT ApiContainerApiConnect = "CONNECT" + NOCONNECT ApiContainerApiConnect = "NO_CONNECT" +) + +// Defines values for ApiContainerApiContainerStatus. +const ( + ApiContainerApiContainerStatusRUNNING ApiContainerApiContainerStatus = "RUNNING" + ApiContainerApiContainerStatusSTOPPED ApiContainerApiContainerStatus = "STOPPED" + ApiContainerApiContainerStatusUNKNOWN ApiContainerApiContainerStatus = "UNKNOWN" +) + +// Defines values for ApiContainerApiImageDownloadMode. +const ( + Always ApiContainerApiImageDownloadMode = "always" + Missing ApiContainerApiImageDownloadMode = "missing" +) + +// Defines values for ApiContainerApiKurtosisFeatureFlag. +const ( + NOINSTRUCTIONSCACHING ApiContainerApiKurtosisFeatureFlag = "NO_INSTRUCTIONS_CACHING" +) + +// Defines values for ApiContainerApiPortTransportProtocol. +const ( + SCTP ApiContainerApiPortTransportProtocol = "SCTP" + TCP ApiContainerApiPortTransportProtocol = "TCP" + UDP ApiContainerApiPortTransportProtocol = "UDP" +) + +// Defines values for ApiContainerApiRestartPolicy. +const ( + ALWAYS ApiContainerApiRestartPolicy = "ALWAYS" + NEVER ApiContainerApiRestartPolicy = "NEVER" +) + +// Defines values for ApiContainerApiServiceStatus. +const ( + ApiContainerApiServiceStatusRUNNING ApiContainerApiServiceStatus = "RUNNING" + ApiContainerApiServiceStatusSTOPPED ApiContainerApiServiceStatus = "STOPPED" + ApiContainerApiServiceStatusUNKNOWN ApiContainerApiServiceStatus = "UNKNOWN" +) + +// ApiContainerApiConnect 0 - CONNECT // Best effort port forwarding +// 1 - NO_CONNECT // Port forwarding disabled +type ApiContainerApiConnect string + +// ApiContainerApiConnectServicesArgs defines model for api_container_api.ConnectServicesArgs. +type ApiContainerApiConnectServicesArgs struct { + // Connect 0 - CONNECT // Best effort port forwarding + // 1 - NO_CONNECT // Port forwarding disabled + Connect *ApiContainerApiConnect `json:"connect,omitempty"` +} + +// ApiContainerApiConnectServicesResponse defines model for api_container_api.ConnectServicesResponse. +type ApiContainerApiConnectServicesResponse = map[string]interface{} + +// ApiContainerApiContainer defines model for api_container_api.Container. +type ApiContainerApiContainer struct { + CmdArgs *[]string `json:"cmd_args,omitempty"` + EntrypointArgs *[]string `json:"entrypoint_args,omitempty"` + EnvVars *map[string]string `json:"env_vars,omitempty"` + ImageName *string `json:"image_name,omitempty"` + + // Status 0 - STOPPED + // 1 - RUNNING + // 2 - UNKNOWN + Status *ApiContainerApiContainerStatus `json:"status,omitempty"` +} + +// ApiContainerApiContainerStatus 0 - STOPPED +// 1 - RUNNING +// 2 - UNKNOWN +type ApiContainerApiContainerStatus string + +// ApiContainerApiDataChunkMetadata defines model for api_container_api.DataChunkMetadata. +type ApiContainerApiDataChunkMetadata struct { + Name *string `json:"name,omitempty"` +} + +// ApiContainerApiDownloadFilesArtifactArgs ============================================================================================== +// Download Files Artifact +// ============================================================================================== +type ApiContainerApiDownloadFilesArtifactArgs struct { + // Identifier Files identifier to get bytes for + Identifier *string `json:"identifier,omitempty"` +} + +// ApiContainerApiExecCommandArgs ============================================================================================== +// Exec Command +// ============================================================================================== +type ApiContainerApiExecCommandArgs struct { + CommandArgs *[]string `json:"command_args,omitempty"` + + // ServiceIdentifier The service identifier of the container that the command should be executed in + ServiceIdentifier *string `json:"service_identifier,omitempty"` +} + +// ApiContainerApiExecCommandResponse defines model for api_container_api.ExecCommandResponse. +type ApiContainerApiExecCommandResponse struct { + ExitCode *int32 `json:"exit_code,omitempty"` + + // LogOutput Assumes UTF-8 encoding + LogOutput *string `json:"log_output,omitempty"` +} + +// ApiContainerApiFileArtifactContentsFileDescription defines model for api_container_api.FileArtifactContentsFileDescription. +type ApiContainerApiFileArtifactContentsFileDescription struct { + // Path Path relative to the file artifact + Path *string `json:"path,omitempty"` + + // Size Size of the file, in bytes + Size *int64 `json:"size,omitempty"` + + // TextPreview A bit of text content, if the file allows (similar to UNIX's 'head') + TextPreview *string `json:"text_preview,omitempty"` +} + +// ApiContainerApiFilesArtifactNameAndUuid defines model for api_container_api.FilesArtifactNameAndUuid. +type ApiContainerApiFilesArtifactNameAndUuid struct { + // FileName A string representing the name of the file + FileName *string `json:"fileName,omitempty"` + + // FileUuid A string representing the uuid of the file + FileUuid *string `json:"fileUuid,omitempty"` +} + +// ApiContainerApiGetExistingAndHistoricalServiceIdentifiersResponse defines model for api_container_api.GetExistingAndHistoricalServiceIdentifiersResponse. +type ApiContainerApiGetExistingAndHistoricalServiceIdentifiersResponse struct { + AllIdentifiers *[]ApiContainerApiServiceIdentifiers `json:"allIdentifiers,omitempty"` +} + +// ApiContainerApiGetServicesArgs ============================================================================================== +// Get Services +// ============================================================================================== +type ApiContainerApiGetServicesArgs struct { + // ServiceIdentifiers "Set" of identifiers to fetch info for + // If empty, will fetch info for all services + ServiceIdentifiers *map[string]string `json:"service_identifiers,omitempty"` +} + +// ApiContainerApiGetServicesResponse defines model for api_container_api.GetServicesResponse. +type ApiContainerApiGetServicesResponse struct { + ServiceInfo *ApiContainerApiServiceInfo `json:"service_info,omitempty"` +} + +// ApiContainerApiGetStarlarkRunResponse defines model for api_container_api.GetStarlarkRunResponse. +type ApiContainerApiGetStarlarkRunResponse struct { + ExperimentalFeatures *[]ApiContainerApiKurtosisFeatureFlag `json:"experimental_features,omitempty"` + MainFunctionName *string `json:"main_function_name,omitempty"` + PackageId *string `json:"package_id,omitempty"` + Parallelism *int32 `json:"parallelism,omitempty"` + RelativePathToMainFile *string `json:"relative_path_to_main_file,omitempty"` + + // RestartPolicy 0 - NEVER + // 1 - ALWAYS + RestartPolicy *ApiContainerApiRestartPolicy `json:"restart_policy,omitempty"` + SerializedParams *string `json:"serialized_params,omitempty"` + SerializedScript *string `json:"serialized_script,omitempty"` +} + +// ApiContainerApiImageDownloadMode 0 - always +// 1 - missing +type ApiContainerApiImageDownloadMode string + +// ApiContainerApiInspectFilesArtifactContentsRequest defines model for api_container_api.InspectFilesArtifactContentsRequest. +type ApiContainerApiInspectFilesArtifactContentsRequest struct { + FileNamesAndUuid *ApiContainerApiFilesArtifactNameAndUuid `json:"file_names_and_uuid,omitempty"` +} + +// ApiContainerApiInspectFilesArtifactContentsResponse defines model for api_container_api.InspectFilesArtifactContentsResponse. +type ApiContainerApiInspectFilesArtifactContentsResponse struct { + FileDescriptions *[]ApiContainerApiFileArtifactContentsFileDescription `json:"file_descriptions,omitempty"` +} + +// ApiContainerApiKurtosisFeatureFlag 0 - NO_INSTRUCTIONS_CACHING +type ApiContainerApiKurtosisFeatureFlag string + +// ApiContainerApiListFilesArtifactNamesAndUuidsResponse defines model for api_container_api.ListFilesArtifactNamesAndUuidsResponse. +type ApiContainerApiListFilesArtifactNamesAndUuidsResponse struct { + FileNamesAndUuids *[]ApiContainerApiFilesArtifactNameAndUuid `json:"file_names_and_uuids,omitempty"` +} + +// ApiContainerApiPort ============================================================================================== +// Shared Objects (Used By Multiple Endpoints) +// ============================================================================================== +type ApiContainerApiPort struct { + MaybeApplicationProtocol *string `json:"maybe_application_protocol,omitempty"` + + // MaybeWaitTimeout The wait timeout duration in string + MaybeWaitTimeout *string `json:"maybe_wait_timeout,omitempty"` + Number *int32 `json:"number,omitempty"` + + // TransportProtocol 0 - TCP + // 1 - SCTP + // 2 - UDP + TransportProtocol *ApiContainerApiPortTransportProtocol `json:"transport_protocol,omitempty"` +} + +// ApiContainerApiPortTransportProtocol 0 - TCP +// 1 - SCTP +// 2 - UDP +type ApiContainerApiPortTransportProtocol string + +// ApiContainerApiRestartPolicy 0 - NEVER +// 1 - ALWAYS +type ApiContainerApiRestartPolicy string + +// ApiContainerApiRunStarlarkPackageArgs defines model for api_container_api.RunStarlarkPackageArgs. +type ApiContainerApiRunStarlarkPackageArgs struct { + // ClonePackage Whether the package should be cloned or not. + // If false, then the package will be pulled from the APIC local package store. If it's a local package then is must + // have been uploaded using UploadStarlarkPackage prior to calling RunStarlarkPackage. + // If true, then the package will be cloned from GitHub before execution starts + ClonePackage *bool `json:"clone_package,omitempty"` + + // CloudInstanceId Defaults to empty + CloudInstanceId *string `json:"cloud_instance_id,omitempty"` + + // CloudUserId Defaults to empty + CloudUserId *string `json:"cloud_user_id,omitempty"` + + // DryRun Defaults to false + DryRun *bool `json:"dry_run,omitempty"` + ExperimentalFeatures *[]ApiContainerApiKurtosisFeatureFlag `json:"experimental_features,omitempty"` + + // ImageDownloadMode 0 - always + // 1 - missing + ImageDownloadMode *ApiContainerApiImageDownloadMode `json:"image_download_mode,omitempty"` + + // Local the payload of the local module + Local *[]byte `json:"local,omitempty"` + + // MainFunctionName The name of the main function, the default value is "run" + MainFunctionName *string `json:"main_function_name,omitempty"` + PackageId *string `json:"package_id,omitempty"` + + // Parallelism Defaults to 4 + Parallelism *int32 `json:"parallelism,omitempty"` + + // RelativePathToMainFile The relative main file filepath, the default value is the "main.star" file in the root of a package + RelativePathToMainFile *string `json:"relative_path_to_main_file,omitempty"` + + // Remote just a flag to indicate the module must be cloned inside the API + Remote *bool `json:"remote,omitempty"` + + // SerializedParams Serialized parameters data for the Starlark package main function + // This should be a valid JSON string + SerializedParams *string `json:"serialized_params,omitempty"` +} + +// ApiContainerApiRunStarlarkScriptArgs defines model for api_container_api.RunStarlarkScriptArgs. +type ApiContainerApiRunStarlarkScriptArgs struct { + // CloudInstanceId Defaults to empty + CloudInstanceId *string `json:"cloud_instance_id,omitempty"` + + // CloudUserId Defaults to empty + CloudUserId *string `json:"cloud_user_id,omitempty"` + + // DryRun Defaults to false + DryRun *bool `json:"dry_run,omitempty"` + ExperimentalFeatures *[]ApiContainerApiKurtosisFeatureFlag `json:"experimental_features,omitempty"` + + // ImageDownloadMode 0 - always + // 1 - missing + ImageDownloadMode *ApiContainerApiImageDownloadMode `json:"image_download_mode,omitempty"` + + // MainFunctionName The name of the main function, the default value is "run" + MainFunctionName *string `json:"main_function_name,omitempty"` + + // Parallelism Defaults to 4 + Parallelism *int32 `json:"parallelism,omitempty"` + SerializedParams *string `json:"serialized_params,omitempty"` + SerializedScript *string `json:"serialized_script,omitempty"` +} + +// ApiContainerApiServiceIdentifiers An service identifier is a collection of uuid, name and shortened uuid +type ApiContainerApiServiceIdentifiers struct { + // Name Name of the service + Name *string `json:"name,omitempty"` + + // ServiceUuid UUID of the service + ServiceUuid *string `json:"service_uuid,omitempty"` + + // ShortenedUuid The shortened uuid of the service + ShortenedUuid *string `json:"shortened_uuid,omitempty"` +} + +// ApiContainerApiServiceInfo defines model for api_container_api.ServiceInfo. +type ApiContainerApiServiceInfo struct { + Container *ApiContainerApiContainer `json:"container,omitempty"` + + // MaybePublicIpAddr Public IP address *outside* the enclave where the service is reachable + // NOTE: Will be empty if the service isn't running, the service didn't define any ports, or the backend doesn't support reporting public service info + MaybePublicIpAddr *string `json:"maybe_public_ip_addr,omitempty"` + + // MaybePublicPorts ============================================================================================== + // Shared Objects (Used By Multiple Endpoints) + // ============================================================================================== + MaybePublicPorts *ApiContainerApiPort `json:"maybe_public_ports,omitempty"` + + // Name Name of the service + Name *string `json:"name,omitempty"` + + // PrivateIpAddr The IP address of the service inside the enclave + PrivateIpAddr *string `json:"private_ip_addr,omitempty"` + + // PrivatePorts ============================================================================================== + // Shared Objects (Used By Multiple Endpoints) + // ============================================================================================== + PrivatePorts *ApiContainerApiPort `json:"private_ports,omitempty"` + + // ServiceStatus 0 - STOPPED + // 1 - RUNNING + // 2 - UNKNOWN + ServiceStatus *ApiContainerApiServiceStatus `json:"service_status,omitempty"` + + // ServiceUuid UUID of the service + ServiceUuid *string `json:"service_uuid,omitempty"` + + // ShortenedUuid Shortened uuid of the service + ShortenedUuid *string `json:"shortened_uuid,omitempty"` +} + +// ApiContainerApiServiceStatus 0 - STOPPED +// 1 - RUNNING +// 2 - UNKNOWN +type ApiContainerApiServiceStatus string + +// ApiContainerApiStarlarkError defines model for api_container_api.StarlarkError. +type ApiContainerApiStarlarkError struct { + ExecutionError *ApiContainerApiStarlarkExecutionError `json:"execution_error,omitempty"` + InterpretationError *ApiContainerApiStarlarkInterpretationError `json:"interpretation_error,omitempty"` + ValidationError *ApiContainerApiStarlarkValidationError `json:"validation_error,omitempty"` +} + +// ApiContainerApiStarlarkExecutionError defines model for api_container_api.StarlarkExecutionError. +type ApiContainerApiStarlarkExecutionError struct { + ErrorMessage *string `json:"error_message,omitempty"` +} + +// ApiContainerApiStarlarkInfo defines model for api_container_api.StarlarkInfo. +type ApiContainerApiStarlarkInfo struct { + InfoMessage *string `json:"info_message,omitempty"` +} + +// ApiContainerApiStarlarkInstruction defines model for api_container_api.StarlarkInstruction. +type ApiContainerApiStarlarkInstruction struct { + Arguments *[]ApiContainerApiStarlarkInstructionArg `json:"arguments,omitempty"` + ExecutableInstruction *string `json:"executable_instruction,omitempty"` + InstructionName *string `json:"instruction_name,omitempty"` + IsSkipped *bool `json:"is_skipped,omitempty"` + Position *ApiContainerApiStarlarkInstructionPosition `json:"position,omitempty"` +} + +// ApiContainerApiStarlarkInstructionArg defines model for api_container_api.StarlarkInstructionArg. +type ApiContainerApiStarlarkInstructionArg struct { + ArgName *string `json:"arg_name,omitempty"` + IsRepresentative *bool `json:"is_representative,omitempty"` + SerializedArgValue *string `json:"serialized_arg_value,omitempty"` +} + +// ApiContainerApiStarlarkInstructionPosition defines model for api_container_api.StarlarkInstructionPosition. +type ApiContainerApiStarlarkInstructionPosition struct { + Column *int32 `json:"column,omitempty"` + Filename *string `json:"filename,omitempty"` + Line *int32 `json:"line,omitempty"` +} + +// ApiContainerApiStarlarkInstructionResult defines model for api_container_api.StarlarkInstructionResult. +type ApiContainerApiStarlarkInstructionResult struct { + SerializedInstructionResult *string `json:"serialized_instruction_result,omitempty"` +} + +// ApiContainerApiStarlarkInterpretationError defines model for api_container_api.StarlarkInterpretationError. +type ApiContainerApiStarlarkInterpretationError struct { + ErrorMessage *string `json:"error_message,omitempty"` +} + +// ApiContainerApiStarlarkRunFinishedEvent defines model for api_container_api.StarlarkRunFinishedEvent. +type ApiContainerApiStarlarkRunFinishedEvent struct { + IsRunSuccessful *bool `json:"is_run_successful,omitempty"` + SerializedOutput *string `json:"serialized_output,omitempty"` +} + +// ApiContainerApiStarlarkRunProgress defines model for api_container_api.StarlarkRunProgress. +type ApiContainerApiStarlarkRunProgress struct { + CurrentStepInfo *[]string `json:"current_step_info,omitempty"` + CurrentStepNumber *int32 `json:"current_step_number,omitempty"` + TotalSteps *int32 `json:"total_steps,omitempty"` +} + +// ApiContainerApiStarlarkRunResponseLine ============================================================================================== +// Starlark Execution Response +// ============================================================================================== +type ApiContainerApiStarlarkRunResponseLine struct { + Error *ApiContainerApiStarlarkError `json:"error,omitempty"` + Info *ApiContainerApiStarlarkInfo `json:"info,omitempty"` + Instruction *ApiContainerApiStarlarkInstruction `json:"instruction,omitempty"` + InstructionResult *ApiContainerApiStarlarkInstructionResult `json:"instruction_result,omitempty"` + ProgressInfo *ApiContainerApiStarlarkRunProgress `json:"progress_info,omitempty"` + RunFinishedEvent *ApiContainerApiStarlarkRunFinishedEvent `json:"run_finished_event,omitempty"` + Warning *ApiContainerApiStarlarkWarning `json:"warning,omitempty"` +} + +// ApiContainerApiStarlarkValidationError defines model for api_container_api.StarlarkValidationError. +type ApiContainerApiStarlarkValidationError struct { + ErrorMessage *string `json:"error_message,omitempty"` +} + +// ApiContainerApiStarlarkWarning defines model for api_container_api.StarlarkWarning. +type ApiContainerApiStarlarkWarning struct { + WarningMessage *string `json:"warning_message,omitempty"` +} + +// ApiContainerApiStoreFilesArtifactFromServiceArgs defines model for api_container_api.StoreFilesArtifactFromServiceArgs. +type ApiContainerApiStoreFilesArtifactFromServiceArgs struct { + // Name The name of the files artifact + Name *string `json:"name,omitempty"` + + // ServiceIdentifier Identifier that will be used to identify the service where the source files will be copied from + ServiceIdentifier *string `json:"service_identifier,omitempty"` + + // SourcePath The absolute source path where the source files will be copied from + SourcePath *string `json:"source_path,omitempty"` +} + +// ApiContainerApiStoreFilesArtifactFromServiceResponse defines model for api_container_api.StoreFilesArtifactFromServiceResponse. +type ApiContainerApiStoreFilesArtifactFromServiceResponse struct { + // Uuid UUID of the files artifact, for use when referencing it in the future + Uuid *string `json:"uuid,omitempty"` +} + +// ApiContainerApiStoreWebFilesArtifactArgs ============================================================================================== +// Store Web Files Artifact +// ============================================================================================== +type ApiContainerApiStoreWebFilesArtifactArgs struct { + // Name The name of the files artifact + Name *string `json:"name,omitempty"` + + // Url URL to download the artifact from + Url *string `json:"url,omitempty"` +} + +// ApiContainerApiStoreWebFilesArtifactResponse defines model for api_container_api.StoreWebFilesArtifactResponse. +type ApiContainerApiStoreWebFilesArtifactResponse struct { + // Uuid UUID of the files artifact, for use when referencing it in the future + Uuid *string `json:"uuid,omitempty"` +} + +// ApiContainerApiStreamedDataChunk ============================================================================================== +// Streamed Data Chunk +// ============================================================================================== +type ApiContainerApiStreamedDataChunk struct { + // Data Chunk of the overall files artifact bytes + Data *[]byte `json:"data,omitempty"` + Metadata *ApiContainerApiDataChunkMetadata `json:"metadata,omitempty"` + + // PreviousChunkHash Hash of the PREVIOUS chunk, or empty string is this is the first chunk + // Referencing the previous chunk via its hash allows Kurtosis to validate + // the consistency of the data in case some chunk were not received + PreviousChunkHash *string `json:"previous_chunk_hash,omitempty"` +} + +// ApiContainerApiUploadFilesArtifactResponse ============================================================================================== +// Upload Files Artifact +// ============================================================================================== +type ApiContainerApiUploadFilesArtifactResponse struct { + // Name UUID of the files artifact, for use when referencing it in the future + Name *string `json:"name,omitempty"` + + // Uuid UUID of the files artifact, for use when referencing it in the future + Uuid *string `json:"uuid,omitempty"` +} + +// ApiContainerApiWaitForHttpGetEndpointAvailabilityArgs ============================================================================================== +// Wait For HTTP Get Endpoint Availability +// ============================================================================================== +type ApiContainerApiWaitForHttpGetEndpointAvailabilityArgs struct { + // BodyText If the endpoint returns this value, the service will be marked as available (e.g. Hello World). + BodyText *string `json:"body_text,omitempty"` + + // InitialDelayMilliseconds The number of milliseconds to wait until executing the first HTTP call + InitialDelayMilliseconds *int32 `json:"initial_delay_milliseconds,omitempty"` + + // Path The path of the service to check. It mustn't start with the first slash. For instance `service/health` + Path *string `json:"path,omitempty"` + + // Port The port of the service to check. For instance 8080 + Port *int32 `json:"port,omitempty"` + + // Retries Max number of HTTP call attempts that this will execute until giving up and returning an error + Retries *int32 `json:"retries,omitempty"` + + // RetriesDelayMilliseconds Number of milliseconds to wait between retries + RetriesDelayMilliseconds *int32 `json:"retries_delay_milliseconds,omitempty"` + + // ServiceIdentifier The identifier of the service to check. + ServiceIdentifier *string `json:"service_identifier,omitempty"` +} + +// ApiContainerApiWaitForHttpPostEndpointAvailabilityArgs ============================================================================================== +// Wait For HTTP Post Endpoint Availability +// ============================================================================================== +type ApiContainerApiWaitForHttpPostEndpointAvailabilityArgs struct { + // BodyText If the endpoint returns this value, the service will be marked as available (e.g. Hello World). + BodyText *string `json:"body_text,omitempty"` + + // InitialDelayMilliseconds The number of milliseconds to wait until executing the first HTTP call + InitialDelayMilliseconds *int32 `json:"initial_delay_milliseconds,omitempty"` + + // Path The path of the service to check. It mustn't start with the first slash. For instance `service/health` + Path *string `json:"path,omitempty"` + + // Port The port of the service to check. For instance 8080 + Port *int32 `json:"port,omitempty"` + + // RequestBody The content of the request body. + RequestBody *string `json:"request_body,omitempty"` + + // Retries Max number of HTTP call attempts that this will execute until giving up and returning an error + Retries *int32 `json:"retries,omitempty"` + + // RetriesDelayMilliseconds Number of milliseconds to wait between retries + RetriesDelayMilliseconds *int32 `json:"retries_delay_milliseconds,omitempty"` + + // ServiceIdentifier The identifier of the service to check. + ServiceIdentifier *string `json:"service_identifier,omitempty"` +} + +// GoogleProtobufEmpty defines model for google.protobuf.Empty. +type GoogleProtobufEmpty = map[string]interface{} + +// ApiContainerApiApiContainerServiceConnectServicesJSONRequestBody defines body for ApiContainerApiApiContainerServiceConnectServices for application/json ContentType. +type ApiContainerApiApiContainerServiceConnectServicesJSONRequestBody = ApiContainerApiConnectServicesArgs + +// ApiContainerApiApiContainerServiceDownloadFilesArtifactJSONRequestBody defines body for ApiContainerApiApiContainerServiceDownloadFilesArtifact for application/json ContentType. +type ApiContainerApiApiContainerServiceDownloadFilesArtifactJSONRequestBody = ApiContainerApiDownloadFilesArtifactArgs + +// ApiContainerApiApiContainerServiceExecCommandJSONRequestBody defines body for ApiContainerApiApiContainerServiceExecCommand for application/json ContentType. +type ApiContainerApiApiContainerServiceExecCommandJSONRequestBody = ApiContainerApiExecCommandArgs + +// ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersJSONRequestBody defines body for ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiers for application/json ContentType. +type ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersJSONRequestBody = GoogleProtobufEmpty + +// ApiContainerApiApiContainerServiceGetServicesJSONRequestBody defines body for ApiContainerApiApiContainerServiceGetServices for application/json ContentType. +type ApiContainerApiApiContainerServiceGetServicesJSONRequestBody = ApiContainerApiGetServicesArgs + +// ApiContainerApiApiContainerServiceGetStarlarkRunJSONRequestBody defines body for ApiContainerApiApiContainerServiceGetStarlarkRun for application/json ContentType. +type ApiContainerApiApiContainerServiceGetStarlarkRunJSONRequestBody = GoogleProtobufEmpty + +// ApiContainerApiApiContainerServiceInspectFilesArtifactContentsJSONRequestBody defines body for ApiContainerApiApiContainerServiceInspectFilesArtifactContents for application/json ContentType. +type ApiContainerApiApiContainerServiceInspectFilesArtifactContentsJSONRequestBody = ApiContainerApiInspectFilesArtifactContentsRequest + +// ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsJSONRequestBody defines body for ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuids for application/json ContentType. +type ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsJSONRequestBody = GoogleProtobufEmpty + +// ApiContainerApiApiContainerServiceRunStarlarkPackageJSONRequestBody defines body for ApiContainerApiApiContainerServiceRunStarlarkPackage for application/json ContentType. +type ApiContainerApiApiContainerServiceRunStarlarkPackageJSONRequestBody = ApiContainerApiRunStarlarkPackageArgs + +// ApiContainerApiApiContainerServiceRunStarlarkScriptJSONRequestBody defines body for ApiContainerApiApiContainerServiceRunStarlarkScript for application/json ContentType. +type ApiContainerApiApiContainerServiceRunStarlarkScriptJSONRequestBody = ApiContainerApiRunStarlarkScriptArgs + +// ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceJSONRequestBody defines body for ApiContainerApiApiContainerServiceStoreFilesArtifactFromService for application/json ContentType. +type ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceJSONRequestBody = ApiContainerApiStoreFilesArtifactFromServiceArgs + +// ApiContainerApiApiContainerServiceStoreWebFilesArtifactJSONRequestBody defines body for ApiContainerApiApiContainerServiceStoreWebFilesArtifact for application/json ContentType. +type ApiContainerApiApiContainerServiceStoreWebFilesArtifactJSONRequestBody = ApiContainerApiStoreWebFilesArtifactArgs + +// ApiContainerApiApiContainerServiceUploadFilesArtifactJSONRequestBody defines body for ApiContainerApiApiContainerServiceUploadFilesArtifact for application/json ContentType. +type ApiContainerApiApiContainerServiceUploadFilesArtifactJSONRequestBody = ApiContainerApiStreamedDataChunk + +// ApiContainerApiApiContainerServiceUploadStarlarkPackageJSONRequestBody defines body for ApiContainerApiApiContainerServiceUploadStarlarkPackage for application/json ContentType. +type ApiContainerApiApiContainerServiceUploadStarlarkPackageJSONRequestBody = ApiContainerApiStreamedDataChunk + +// ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityJSONRequestBody defines body for ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailability for application/json ContentType. +type ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityJSONRequestBody = ApiContainerApiWaitForHttpGetEndpointAvailabilityArgs + +// ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityJSONRequestBody defines body for ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailability for application/json ContentType. +type ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityJSONRequestBody = ApiContainerApiWaitForHttpPostEndpointAvailabilityArgs + +// RequestEditorFn is the function signature for the RequestEditor callback function +type RequestEditorFn func(ctx context.Context, req *http.Request) error + +// Doer performs HTTP requests. +// +// The standard http.Client implements this interface. +type HttpRequestDoer interface { + Do(req *http.Request) (*http.Response, error) +} + +// Client which conforms to the OpenAPI3 specification for this service. +type Client struct { + // The endpoint of the server conforming to this interface, with scheme, + // https://api.deepmap.com for example. This can contain a path relative + // to the server, such as https://api.deepmap.com/dev-test, and all the + // paths in the swagger spec will be appended to the server. + Server string + + // Doer for performing requests, typically a *http.Client with any + // customized settings, such as certificate chains. + Client HttpRequestDoer + + // A list of callbacks for modifying requests which are generated before sending over + // the network. + RequestEditors []RequestEditorFn +} + +// ClientOption allows setting custom parameters during construction +type ClientOption func(*Client) error + +// Creates a new Client, with reasonable defaults +func NewClient(server string, opts ...ClientOption) (*Client, error) { + // create a client with sane default values + client := Client{ + Server: server, + } + // mutate client and add all optional params + for _, o := range opts { + if err := o(&client); err != nil { + return nil, err + } + } + // ensure the server URL always has a trailing slash + if !strings.HasSuffix(client.Server, "/") { + client.Server += "/" + } + // create httpClient, if not already present + if client.Client == nil { + client.Client = &http.Client{} + } + return &client, nil +} + +// WithHTTPClient allows overriding the default Doer, which is +// automatically created using http.Client. This is useful for tests. +func WithHTTPClient(doer HttpRequestDoer) ClientOption { + return func(c *Client) error { + c.Client = doer + return nil + } +} + +// WithRequestEditorFn allows setting up a callback function, which will be +// called right before sending the request. This can be used to mutate the request. +func WithRequestEditorFn(fn RequestEditorFn) ClientOption { + return func(c *Client) error { + c.RequestEditors = append(c.RequestEditors, fn) + return nil + } +} + +// The interface specification for the client above. +type ClientInterface interface { + // ApiContainerApiApiContainerServiceConnectServicesWithBody request with any body + ApiContainerApiApiContainerServiceConnectServicesWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + ApiContainerApiApiContainerServiceConnectServices(ctx context.Context, body ApiContainerApiApiContainerServiceConnectServicesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ApiContainerApiApiContainerServiceDownloadFilesArtifactWithBody request with any body + ApiContainerApiApiContainerServiceDownloadFilesArtifactWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + ApiContainerApiApiContainerServiceDownloadFilesArtifact(ctx context.Context, body ApiContainerApiApiContainerServiceDownloadFilesArtifactJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ApiContainerApiApiContainerServiceExecCommandWithBody request with any body + ApiContainerApiApiContainerServiceExecCommandWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + ApiContainerApiApiContainerServiceExecCommand(ctx context.Context, body ApiContainerApiApiContainerServiceExecCommandJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersWithBody request with any body + ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiers(ctx context.Context, body ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ApiContainerApiApiContainerServiceGetServicesWithBody request with any body + ApiContainerApiApiContainerServiceGetServicesWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + ApiContainerApiApiContainerServiceGetServices(ctx context.Context, body ApiContainerApiApiContainerServiceGetServicesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ApiContainerApiApiContainerServiceGetStarlarkRunWithBody request with any body + ApiContainerApiApiContainerServiceGetStarlarkRunWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + ApiContainerApiApiContainerServiceGetStarlarkRun(ctx context.Context, body ApiContainerApiApiContainerServiceGetStarlarkRunJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ApiContainerApiApiContainerServiceInspectFilesArtifactContentsWithBody request with any body + ApiContainerApiApiContainerServiceInspectFilesArtifactContentsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + ApiContainerApiApiContainerServiceInspectFilesArtifactContents(ctx context.Context, body ApiContainerApiApiContainerServiceInspectFilesArtifactContentsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsWithBody request with any body + ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuids(ctx context.Context, body ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ApiContainerApiApiContainerServiceRunStarlarkPackageWithBody request with any body + ApiContainerApiApiContainerServiceRunStarlarkPackageWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + ApiContainerApiApiContainerServiceRunStarlarkPackage(ctx context.Context, body ApiContainerApiApiContainerServiceRunStarlarkPackageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ApiContainerApiApiContainerServiceRunStarlarkScriptWithBody request with any body + ApiContainerApiApiContainerServiceRunStarlarkScriptWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + ApiContainerApiApiContainerServiceRunStarlarkScript(ctx context.Context, body ApiContainerApiApiContainerServiceRunStarlarkScriptJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceWithBody request with any body + ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + ApiContainerApiApiContainerServiceStoreFilesArtifactFromService(ctx context.Context, body ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ApiContainerApiApiContainerServiceStoreWebFilesArtifactWithBody request with any body + ApiContainerApiApiContainerServiceStoreWebFilesArtifactWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + ApiContainerApiApiContainerServiceStoreWebFilesArtifact(ctx context.Context, body ApiContainerApiApiContainerServiceStoreWebFilesArtifactJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ApiContainerApiApiContainerServiceUploadFilesArtifactWithBody request with any body + ApiContainerApiApiContainerServiceUploadFilesArtifactWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + ApiContainerApiApiContainerServiceUploadFilesArtifact(ctx context.Context, body ApiContainerApiApiContainerServiceUploadFilesArtifactJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ApiContainerApiApiContainerServiceUploadStarlarkPackageWithBody request with any body + ApiContainerApiApiContainerServiceUploadStarlarkPackageWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + ApiContainerApiApiContainerServiceUploadStarlarkPackage(ctx context.Context, body ApiContainerApiApiContainerServiceUploadStarlarkPackageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityWithBody request with any body + ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailability(ctx context.Context, body ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityWithBody request with any body + ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailability(ctx context.Context, body ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) +} + +func (c *Client) ApiContainerApiApiContainerServiceConnectServicesWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewApiContainerApiApiContainerServiceConnectServicesRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ApiContainerApiApiContainerServiceConnectServices(ctx context.Context, body ApiContainerApiApiContainerServiceConnectServicesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewApiContainerApiApiContainerServiceConnectServicesRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ApiContainerApiApiContainerServiceDownloadFilesArtifactWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewApiContainerApiApiContainerServiceDownloadFilesArtifactRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ApiContainerApiApiContainerServiceDownloadFilesArtifact(ctx context.Context, body ApiContainerApiApiContainerServiceDownloadFilesArtifactJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewApiContainerApiApiContainerServiceDownloadFilesArtifactRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ApiContainerApiApiContainerServiceExecCommandWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewApiContainerApiApiContainerServiceExecCommandRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ApiContainerApiApiContainerServiceExecCommand(ctx context.Context, body ApiContainerApiApiContainerServiceExecCommandJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewApiContainerApiApiContainerServiceExecCommandRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiers(ctx context.Context, body ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ApiContainerApiApiContainerServiceGetServicesWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewApiContainerApiApiContainerServiceGetServicesRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ApiContainerApiApiContainerServiceGetServices(ctx context.Context, body ApiContainerApiApiContainerServiceGetServicesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewApiContainerApiApiContainerServiceGetServicesRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ApiContainerApiApiContainerServiceGetStarlarkRunWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewApiContainerApiApiContainerServiceGetStarlarkRunRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ApiContainerApiApiContainerServiceGetStarlarkRun(ctx context.Context, body ApiContainerApiApiContainerServiceGetStarlarkRunJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewApiContainerApiApiContainerServiceGetStarlarkRunRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ApiContainerApiApiContainerServiceInspectFilesArtifactContentsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewApiContainerApiApiContainerServiceInspectFilesArtifactContentsRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ApiContainerApiApiContainerServiceInspectFilesArtifactContents(ctx context.Context, body ApiContainerApiApiContainerServiceInspectFilesArtifactContentsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewApiContainerApiApiContainerServiceInspectFilesArtifactContentsRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuids(ctx context.Context, body ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ApiContainerApiApiContainerServiceRunStarlarkPackageWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewApiContainerApiApiContainerServiceRunStarlarkPackageRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ApiContainerApiApiContainerServiceRunStarlarkPackage(ctx context.Context, body ApiContainerApiApiContainerServiceRunStarlarkPackageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewApiContainerApiApiContainerServiceRunStarlarkPackageRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ApiContainerApiApiContainerServiceRunStarlarkScriptWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewApiContainerApiApiContainerServiceRunStarlarkScriptRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ApiContainerApiApiContainerServiceRunStarlarkScript(ctx context.Context, body ApiContainerApiApiContainerServiceRunStarlarkScriptJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewApiContainerApiApiContainerServiceRunStarlarkScriptRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ApiContainerApiApiContainerServiceStoreFilesArtifactFromService(ctx context.Context, body ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ApiContainerApiApiContainerServiceStoreWebFilesArtifactWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewApiContainerApiApiContainerServiceStoreWebFilesArtifactRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ApiContainerApiApiContainerServiceStoreWebFilesArtifact(ctx context.Context, body ApiContainerApiApiContainerServiceStoreWebFilesArtifactJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewApiContainerApiApiContainerServiceStoreWebFilesArtifactRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ApiContainerApiApiContainerServiceUploadFilesArtifactWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewApiContainerApiApiContainerServiceUploadFilesArtifactRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ApiContainerApiApiContainerServiceUploadFilesArtifact(ctx context.Context, body ApiContainerApiApiContainerServiceUploadFilesArtifactJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewApiContainerApiApiContainerServiceUploadFilesArtifactRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ApiContainerApiApiContainerServiceUploadStarlarkPackageWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewApiContainerApiApiContainerServiceUploadStarlarkPackageRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ApiContainerApiApiContainerServiceUploadStarlarkPackage(ctx context.Context, body ApiContainerApiApiContainerServiceUploadStarlarkPackageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewApiContainerApiApiContainerServiceUploadStarlarkPackageRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailability(ctx context.Context, body ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailability(ctx context.Context, body ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// NewApiContainerApiApiContainerServiceConnectServicesRequest calls the generic ApiContainerApiApiContainerServiceConnectServices builder with application/json body +func NewApiContainerApiApiContainerServiceConnectServicesRequest(server string, body ApiContainerApiApiContainerServiceConnectServicesJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewApiContainerApiApiContainerServiceConnectServicesRequestWithBody(server, "application/json", bodyReader) +} + +// NewApiContainerApiApiContainerServiceConnectServicesRequestWithBody generates requests for ApiContainerApiApiContainerServiceConnectServices with any type of body +func NewApiContainerApiApiContainerServiceConnectServicesRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api_container_api.ApiContainerService/ConnectServices") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewApiContainerApiApiContainerServiceDownloadFilesArtifactRequest calls the generic ApiContainerApiApiContainerServiceDownloadFilesArtifact builder with application/json body +func NewApiContainerApiApiContainerServiceDownloadFilesArtifactRequest(server string, body ApiContainerApiApiContainerServiceDownloadFilesArtifactJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewApiContainerApiApiContainerServiceDownloadFilesArtifactRequestWithBody(server, "application/json", bodyReader) +} + +// NewApiContainerApiApiContainerServiceDownloadFilesArtifactRequestWithBody generates requests for ApiContainerApiApiContainerServiceDownloadFilesArtifact with any type of body +func NewApiContainerApiApiContainerServiceDownloadFilesArtifactRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api_container_api.ApiContainerService/DownloadFilesArtifact") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewApiContainerApiApiContainerServiceExecCommandRequest calls the generic ApiContainerApiApiContainerServiceExecCommand builder with application/json body +func NewApiContainerApiApiContainerServiceExecCommandRequest(server string, body ApiContainerApiApiContainerServiceExecCommandJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewApiContainerApiApiContainerServiceExecCommandRequestWithBody(server, "application/json", bodyReader) +} + +// NewApiContainerApiApiContainerServiceExecCommandRequestWithBody generates requests for ApiContainerApiApiContainerServiceExecCommand with any type of body +func NewApiContainerApiApiContainerServiceExecCommandRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api_container_api.ApiContainerService/ExecCommand") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersRequest calls the generic ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiers builder with application/json body +func NewApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersRequest(server string, body ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersRequestWithBody(server, "application/json", bodyReader) +} + +// NewApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersRequestWithBody generates requests for ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiers with any type of body +func NewApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api_container_api.ApiContainerService/GetExistingAndHistoricalServiceIdentifiers") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewApiContainerApiApiContainerServiceGetServicesRequest calls the generic ApiContainerApiApiContainerServiceGetServices builder with application/json body +func NewApiContainerApiApiContainerServiceGetServicesRequest(server string, body ApiContainerApiApiContainerServiceGetServicesJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewApiContainerApiApiContainerServiceGetServicesRequestWithBody(server, "application/json", bodyReader) +} + +// NewApiContainerApiApiContainerServiceGetServicesRequestWithBody generates requests for ApiContainerApiApiContainerServiceGetServices with any type of body +func NewApiContainerApiApiContainerServiceGetServicesRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api_container_api.ApiContainerService/GetServices") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewApiContainerApiApiContainerServiceGetStarlarkRunRequest calls the generic ApiContainerApiApiContainerServiceGetStarlarkRun builder with application/json body +func NewApiContainerApiApiContainerServiceGetStarlarkRunRequest(server string, body ApiContainerApiApiContainerServiceGetStarlarkRunJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewApiContainerApiApiContainerServiceGetStarlarkRunRequestWithBody(server, "application/json", bodyReader) +} + +// NewApiContainerApiApiContainerServiceGetStarlarkRunRequestWithBody generates requests for ApiContainerApiApiContainerServiceGetStarlarkRun with any type of body +func NewApiContainerApiApiContainerServiceGetStarlarkRunRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api_container_api.ApiContainerService/GetStarlarkRun") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewApiContainerApiApiContainerServiceInspectFilesArtifactContentsRequest calls the generic ApiContainerApiApiContainerServiceInspectFilesArtifactContents builder with application/json body +func NewApiContainerApiApiContainerServiceInspectFilesArtifactContentsRequest(server string, body ApiContainerApiApiContainerServiceInspectFilesArtifactContentsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewApiContainerApiApiContainerServiceInspectFilesArtifactContentsRequestWithBody(server, "application/json", bodyReader) +} + +// NewApiContainerApiApiContainerServiceInspectFilesArtifactContentsRequestWithBody generates requests for ApiContainerApiApiContainerServiceInspectFilesArtifactContents with any type of body +func NewApiContainerApiApiContainerServiceInspectFilesArtifactContentsRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api_container_api.ApiContainerService/InspectFilesArtifactContents") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsRequest calls the generic ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuids builder with application/json body +func NewApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsRequest(server string, body ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsRequestWithBody(server, "application/json", bodyReader) +} + +// NewApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsRequestWithBody generates requests for ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuids with any type of body +func NewApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api_container_api.ApiContainerService/ListFilesArtifactNamesAndUuids") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewApiContainerApiApiContainerServiceRunStarlarkPackageRequest calls the generic ApiContainerApiApiContainerServiceRunStarlarkPackage builder with application/json body +func NewApiContainerApiApiContainerServiceRunStarlarkPackageRequest(server string, body ApiContainerApiApiContainerServiceRunStarlarkPackageJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewApiContainerApiApiContainerServiceRunStarlarkPackageRequestWithBody(server, "application/json", bodyReader) +} + +// NewApiContainerApiApiContainerServiceRunStarlarkPackageRequestWithBody generates requests for ApiContainerApiApiContainerServiceRunStarlarkPackage with any type of body +func NewApiContainerApiApiContainerServiceRunStarlarkPackageRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api_container_api.ApiContainerService/RunStarlarkPackage") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewApiContainerApiApiContainerServiceRunStarlarkScriptRequest calls the generic ApiContainerApiApiContainerServiceRunStarlarkScript builder with application/json body +func NewApiContainerApiApiContainerServiceRunStarlarkScriptRequest(server string, body ApiContainerApiApiContainerServiceRunStarlarkScriptJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewApiContainerApiApiContainerServiceRunStarlarkScriptRequestWithBody(server, "application/json", bodyReader) +} + +// NewApiContainerApiApiContainerServiceRunStarlarkScriptRequestWithBody generates requests for ApiContainerApiApiContainerServiceRunStarlarkScript with any type of body +func NewApiContainerApiApiContainerServiceRunStarlarkScriptRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api_container_api.ApiContainerService/RunStarlarkScript") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceRequest calls the generic ApiContainerApiApiContainerServiceStoreFilesArtifactFromService builder with application/json body +func NewApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceRequest(server string, body ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceRequestWithBody(server, "application/json", bodyReader) +} + +// NewApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceRequestWithBody generates requests for ApiContainerApiApiContainerServiceStoreFilesArtifactFromService with any type of body +func NewApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api_container_api.ApiContainerService/StoreFilesArtifactFromService") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewApiContainerApiApiContainerServiceStoreWebFilesArtifactRequest calls the generic ApiContainerApiApiContainerServiceStoreWebFilesArtifact builder with application/json body +func NewApiContainerApiApiContainerServiceStoreWebFilesArtifactRequest(server string, body ApiContainerApiApiContainerServiceStoreWebFilesArtifactJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewApiContainerApiApiContainerServiceStoreWebFilesArtifactRequestWithBody(server, "application/json", bodyReader) +} + +// NewApiContainerApiApiContainerServiceStoreWebFilesArtifactRequestWithBody generates requests for ApiContainerApiApiContainerServiceStoreWebFilesArtifact with any type of body +func NewApiContainerApiApiContainerServiceStoreWebFilesArtifactRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api_container_api.ApiContainerService/StoreWebFilesArtifact") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewApiContainerApiApiContainerServiceUploadFilesArtifactRequest calls the generic ApiContainerApiApiContainerServiceUploadFilesArtifact builder with application/json body +func NewApiContainerApiApiContainerServiceUploadFilesArtifactRequest(server string, body ApiContainerApiApiContainerServiceUploadFilesArtifactJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewApiContainerApiApiContainerServiceUploadFilesArtifactRequestWithBody(server, "application/json", bodyReader) +} + +// NewApiContainerApiApiContainerServiceUploadFilesArtifactRequestWithBody generates requests for ApiContainerApiApiContainerServiceUploadFilesArtifact with any type of body +func NewApiContainerApiApiContainerServiceUploadFilesArtifactRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api_container_api.ApiContainerService/UploadFilesArtifact") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewApiContainerApiApiContainerServiceUploadStarlarkPackageRequest calls the generic ApiContainerApiApiContainerServiceUploadStarlarkPackage builder with application/json body +func NewApiContainerApiApiContainerServiceUploadStarlarkPackageRequest(server string, body ApiContainerApiApiContainerServiceUploadStarlarkPackageJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewApiContainerApiApiContainerServiceUploadStarlarkPackageRequestWithBody(server, "application/json", bodyReader) +} + +// NewApiContainerApiApiContainerServiceUploadStarlarkPackageRequestWithBody generates requests for ApiContainerApiApiContainerServiceUploadStarlarkPackage with any type of body +func NewApiContainerApiApiContainerServiceUploadStarlarkPackageRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api_container_api.ApiContainerService/UploadStarlarkPackage") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityRequest calls the generic ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailability builder with application/json body +func NewApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityRequest(server string, body ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityRequestWithBody(server, "application/json", bodyReader) +} + +// NewApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityRequestWithBody generates requests for ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailability with any type of body +func NewApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api_container_api.ApiContainerService/WaitForHttpGetEndpointAvailability") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityRequest calls the generic ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailability builder with application/json body +func NewApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityRequest(server string, body ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityRequestWithBody(server, "application/json", bodyReader) +} + +// NewApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityRequestWithBody generates requests for ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailability with any type of body +func NewApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api_container_api.ApiContainerService/WaitForHttpPostEndpointAvailability") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error { + for _, r := range c.RequestEditors { + if err := r(ctx, req); err != nil { + return err + } + } + for _, r := range additionalEditors { + if err := r(ctx, req); err != nil { + return err + } + } + return nil +} + +// ClientWithResponses builds on ClientInterface to offer response payloads +type ClientWithResponses struct { + ClientInterface +} + +// NewClientWithResponses creates a new ClientWithResponses, which wraps +// Client with return type handling +func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error) { + client, err := NewClient(server, opts...) + if err != nil { + return nil, err + } + return &ClientWithResponses{client}, nil +} + +// WithBaseURL overrides the baseURL. +func WithBaseURL(baseURL string) ClientOption { + return func(c *Client) error { + newBaseURL, err := url.Parse(baseURL) + if err != nil { + return err + } + c.Server = newBaseURL.String() + return nil + } +} + +// ClientWithResponsesInterface is the interface specification for the client with responses above. +type ClientWithResponsesInterface interface { + // ApiContainerApiApiContainerServiceConnectServicesWithBodyWithResponse request with any body + ApiContainerApiApiContainerServiceConnectServicesWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceConnectServicesResponse, error) + + ApiContainerApiApiContainerServiceConnectServicesWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceConnectServicesJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceConnectServicesResponse, error) + + // ApiContainerApiApiContainerServiceDownloadFilesArtifactWithBodyWithResponse request with any body + ApiContainerApiApiContainerServiceDownloadFilesArtifactWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceDownloadFilesArtifactResponse, error) + + ApiContainerApiApiContainerServiceDownloadFilesArtifactWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceDownloadFilesArtifactJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceDownloadFilesArtifactResponse, error) + + // ApiContainerApiApiContainerServiceExecCommandWithBodyWithResponse request with any body + ApiContainerApiApiContainerServiceExecCommandWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceExecCommandResponse, error) + + ApiContainerApiApiContainerServiceExecCommandWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceExecCommandJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceExecCommandResponse, error) + + // ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersWithBodyWithResponse request with any body + ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersResponse, error) + + ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersResponse, error) + + // ApiContainerApiApiContainerServiceGetServicesWithBodyWithResponse request with any body + ApiContainerApiApiContainerServiceGetServicesWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceGetServicesResponse, error) + + ApiContainerApiApiContainerServiceGetServicesWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceGetServicesJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceGetServicesResponse, error) + + // ApiContainerApiApiContainerServiceGetStarlarkRunWithBodyWithResponse request with any body + ApiContainerApiApiContainerServiceGetStarlarkRunWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceGetStarlarkRunResponse, error) + + ApiContainerApiApiContainerServiceGetStarlarkRunWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceGetStarlarkRunJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceGetStarlarkRunResponse, error) + + // ApiContainerApiApiContainerServiceInspectFilesArtifactContentsWithBodyWithResponse request with any body + ApiContainerApiApiContainerServiceInspectFilesArtifactContentsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceInspectFilesArtifactContentsResponse, error) + + ApiContainerApiApiContainerServiceInspectFilesArtifactContentsWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceInspectFilesArtifactContentsJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceInspectFilesArtifactContentsResponse, error) + + // ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsWithBodyWithResponse request with any body + ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsResponse, error) + + ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsResponse, error) + + // ApiContainerApiApiContainerServiceRunStarlarkPackageWithBodyWithResponse request with any body + ApiContainerApiApiContainerServiceRunStarlarkPackageWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceRunStarlarkPackageResponse, error) + + ApiContainerApiApiContainerServiceRunStarlarkPackageWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceRunStarlarkPackageJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceRunStarlarkPackageResponse, error) + + // ApiContainerApiApiContainerServiceRunStarlarkScriptWithBodyWithResponse request with any body + ApiContainerApiApiContainerServiceRunStarlarkScriptWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceRunStarlarkScriptResponse, error) + + ApiContainerApiApiContainerServiceRunStarlarkScriptWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceRunStarlarkScriptJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceRunStarlarkScriptResponse, error) + + // ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceWithBodyWithResponse request with any body + ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceResponse, error) + + ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceResponse, error) + + // ApiContainerApiApiContainerServiceStoreWebFilesArtifactWithBodyWithResponse request with any body + ApiContainerApiApiContainerServiceStoreWebFilesArtifactWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceStoreWebFilesArtifactResponse, error) + + ApiContainerApiApiContainerServiceStoreWebFilesArtifactWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceStoreWebFilesArtifactJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceStoreWebFilesArtifactResponse, error) + + // ApiContainerApiApiContainerServiceUploadFilesArtifactWithBodyWithResponse request with any body + ApiContainerApiApiContainerServiceUploadFilesArtifactWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceUploadFilesArtifactResponse, error) + + ApiContainerApiApiContainerServiceUploadFilesArtifactWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceUploadFilesArtifactJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceUploadFilesArtifactResponse, error) + + // ApiContainerApiApiContainerServiceUploadStarlarkPackageWithBodyWithResponse request with any body + ApiContainerApiApiContainerServiceUploadStarlarkPackageWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceUploadStarlarkPackageResponse, error) + + ApiContainerApiApiContainerServiceUploadStarlarkPackageWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceUploadStarlarkPackageJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceUploadStarlarkPackageResponse, error) + + // ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityWithBodyWithResponse request with any body + ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityResponse, error) + + ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityResponse, error) + + // ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityWithBodyWithResponse request with any body + ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityResponse, error) + + ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityResponse, error) +} + +type ApiContainerApiApiContainerServiceConnectServicesResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r ApiContainerApiApiContainerServiceConnectServicesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ApiContainerApiApiContainerServiceConnectServicesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ApiContainerApiApiContainerServiceDownloadFilesArtifactResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r ApiContainerApiApiContainerServiceDownloadFilesArtifactResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ApiContainerApiApiContainerServiceDownloadFilesArtifactResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ApiContainerApiApiContainerServiceExecCommandResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r ApiContainerApiApiContainerServiceExecCommandResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ApiContainerApiApiContainerServiceExecCommandResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ApiContainerApiApiContainerServiceGetServicesResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r ApiContainerApiApiContainerServiceGetServicesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ApiContainerApiApiContainerServiceGetServicesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ApiContainerApiApiContainerServiceGetStarlarkRunResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r ApiContainerApiApiContainerServiceGetStarlarkRunResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ApiContainerApiApiContainerServiceGetStarlarkRunResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ApiContainerApiApiContainerServiceInspectFilesArtifactContentsResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r ApiContainerApiApiContainerServiceInspectFilesArtifactContentsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ApiContainerApiApiContainerServiceInspectFilesArtifactContentsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ApiContainerApiApiContainerServiceRunStarlarkPackageResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r ApiContainerApiApiContainerServiceRunStarlarkPackageResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ApiContainerApiApiContainerServiceRunStarlarkPackageResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ApiContainerApiApiContainerServiceRunStarlarkScriptResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r ApiContainerApiApiContainerServiceRunStarlarkScriptResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ApiContainerApiApiContainerServiceRunStarlarkScriptResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ApiContainerApiApiContainerServiceStoreWebFilesArtifactResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r ApiContainerApiApiContainerServiceStoreWebFilesArtifactResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ApiContainerApiApiContainerServiceStoreWebFilesArtifactResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ApiContainerApiApiContainerServiceUploadFilesArtifactResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r ApiContainerApiApiContainerServiceUploadFilesArtifactResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ApiContainerApiApiContainerServiceUploadFilesArtifactResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ApiContainerApiApiContainerServiceUploadStarlarkPackageResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r ApiContainerApiApiContainerServiceUploadStarlarkPackageResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ApiContainerApiApiContainerServiceUploadStarlarkPackageResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ApiContainerApiApiContainerServiceConnectServicesWithBodyWithResponse request with arbitrary body returning *ApiContainerApiApiContainerServiceConnectServicesResponse +func (c *ClientWithResponses) ApiContainerApiApiContainerServiceConnectServicesWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceConnectServicesResponse, error) { + rsp, err := c.ApiContainerApiApiContainerServiceConnectServicesWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseApiContainerApiApiContainerServiceConnectServicesResponse(rsp) +} + +func (c *ClientWithResponses) ApiContainerApiApiContainerServiceConnectServicesWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceConnectServicesJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceConnectServicesResponse, error) { + rsp, err := c.ApiContainerApiApiContainerServiceConnectServices(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseApiContainerApiApiContainerServiceConnectServicesResponse(rsp) +} + +// ApiContainerApiApiContainerServiceDownloadFilesArtifactWithBodyWithResponse request with arbitrary body returning *ApiContainerApiApiContainerServiceDownloadFilesArtifactResponse +func (c *ClientWithResponses) ApiContainerApiApiContainerServiceDownloadFilesArtifactWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceDownloadFilesArtifactResponse, error) { + rsp, err := c.ApiContainerApiApiContainerServiceDownloadFilesArtifactWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseApiContainerApiApiContainerServiceDownloadFilesArtifactResponse(rsp) +} + +func (c *ClientWithResponses) ApiContainerApiApiContainerServiceDownloadFilesArtifactWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceDownloadFilesArtifactJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceDownloadFilesArtifactResponse, error) { + rsp, err := c.ApiContainerApiApiContainerServiceDownloadFilesArtifact(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseApiContainerApiApiContainerServiceDownloadFilesArtifactResponse(rsp) +} + +// ApiContainerApiApiContainerServiceExecCommandWithBodyWithResponse request with arbitrary body returning *ApiContainerApiApiContainerServiceExecCommandResponse +func (c *ClientWithResponses) ApiContainerApiApiContainerServiceExecCommandWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceExecCommandResponse, error) { + rsp, err := c.ApiContainerApiApiContainerServiceExecCommandWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseApiContainerApiApiContainerServiceExecCommandResponse(rsp) +} + +func (c *ClientWithResponses) ApiContainerApiApiContainerServiceExecCommandWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceExecCommandJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceExecCommandResponse, error) { + rsp, err := c.ApiContainerApiApiContainerServiceExecCommand(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseApiContainerApiApiContainerServiceExecCommandResponse(rsp) +} + +// ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersWithBodyWithResponse request with arbitrary body returning *ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersResponse +func (c *ClientWithResponses) ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersResponse, error) { + rsp, err := c.ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersResponse(rsp) +} + +func (c *ClientWithResponses) ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersResponse, error) { + rsp, err := c.ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiers(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersResponse(rsp) +} + +// ApiContainerApiApiContainerServiceGetServicesWithBodyWithResponse request with arbitrary body returning *ApiContainerApiApiContainerServiceGetServicesResponse +func (c *ClientWithResponses) ApiContainerApiApiContainerServiceGetServicesWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceGetServicesResponse, error) { + rsp, err := c.ApiContainerApiApiContainerServiceGetServicesWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseApiContainerApiApiContainerServiceGetServicesResponse(rsp) +} + +func (c *ClientWithResponses) ApiContainerApiApiContainerServiceGetServicesWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceGetServicesJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceGetServicesResponse, error) { + rsp, err := c.ApiContainerApiApiContainerServiceGetServices(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseApiContainerApiApiContainerServiceGetServicesResponse(rsp) +} + +// ApiContainerApiApiContainerServiceGetStarlarkRunWithBodyWithResponse request with arbitrary body returning *ApiContainerApiApiContainerServiceGetStarlarkRunResponse +func (c *ClientWithResponses) ApiContainerApiApiContainerServiceGetStarlarkRunWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceGetStarlarkRunResponse, error) { + rsp, err := c.ApiContainerApiApiContainerServiceGetStarlarkRunWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseApiContainerApiApiContainerServiceGetStarlarkRunResponse(rsp) +} + +func (c *ClientWithResponses) ApiContainerApiApiContainerServiceGetStarlarkRunWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceGetStarlarkRunJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceGetStarlarkRunResponse, error) { + rsp, err := c.ApiContainerApiApiContainerServiceGetStarlarkRun(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseApiContainerApiApiContainerServiceGetStarlarkRunResponse(rsp) +} + +// ApiContainerApiApiContainerServiceInspectFilesArtifactContentsWithBodyWithResponse request with arbitrary body returning *ApiContainerApiApiContainerServiceInspectFilesArtifactContentsResponse +func (c *ClientWithResponses) ApiContainerApiApiContainerServiceInspectFilesArtifactContentsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceInspectFilesArtifactContentsResponse, error) { + rsp, err := c.ApiContainerApiApiContainerServiceInspectFilesArtifactContentsWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseApiContainerApiApiContainerServiceInspectFilesArtifactContentsResponse(rsp) +} + +func (c *ClientWithResponses) ApiContainerApiApiContainerServiceInspectFilesArtifactContentsWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceInspectFilesArtifactContentsJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceInspectFilesArtifactContentsResponse, error) { + rsp, err := c.ApiContainerApiApiContainerServiceInspectFilesArtifactContents(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseApiContainerApiApiContainerServiceInspectFilesArtifactContentsResponse(rsp) +} + +// ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsWithBodyWithResponse request with arbitrary body returning *ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsResponse +func (c *ClientWithResponses) ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsResponse, error) { + rsp, err := c.ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsResponse(rsp) +} + +func (c *ClientWithResponses) ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsResponse, error) { + rsp, err := c.ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuids(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsResponse(rsp) +} + +// ApiContainerApiApiContainerServiceRunStarlarkPackageWithBodyWithResponse request with arbitrary body returning *ApiContainerApiApiContainerServiceRunStarlarkPackageResponse +func (c *ClientWithResponses) ApiContainerApiApiContainerServiceRunStarlarkPackageWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceRunStarlarkPackageResponse, error) { + rsp, err := c.ApiContainerApiApiContainerServiceRunStarlarkPackageWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseApiContainerApiApiContainerServiceRunStarlarkPackageResponse(rsp) +} + +func (c *ClientWithResponses) ApiContainerApiApiContainerServiceRunStarlarkPackageWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceRunStarlarkPackageJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceRunStarlarkPackageResponse, error) { + rsp, err := c.ApiContainerApiApiContainerServiceRunStarlarkPackage(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseApiContainerApiApiContainerServiceRunStarlarkPackageResponse(rsp) +} + +// ApiContainerApiApiContainerServiceRunStarlarkScriptWithBodyWithResponse request with arbitrary body returning *ApiContainerApiApiContainerServiceRunStarlarkScriptResponse +func (c *ClientWithResponses) ApiContainerApiApiContainerServiceRunStarlarkScriptWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceRunStarlarkScriptResponse, error) { + rsp, err := c.ApiContainerApiApiContainerServiceRunStarlarkScriptWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseApiContainerApiApiContainerServiceRunStarlarkScriptResponse(rsp) +} + +func (c *ClientWithResponses) ApiContainerApiApiContainerServiceRunStarlarkScriptWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceRunStarlarkScriptJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceRunStarlarkScriptResponse, error) { + rsp, err := c.ApiContainerApiApiContainerServiceRunStarlarkScript(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseApiContainerApiApiContainerServiceRunStarlarkScriptResponse(rsp) +} + +// ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceWithBodyWithResponse request with arbitrary body returning *ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceResponse +func (c *ClientWithResponses) ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceResponse, error) { + rsp, err := c.ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceResponse(rsp) +} + +func (c *ClientWithResponses) ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceResponse, error) { + rsp, err := c.ApiContainerApiApiContainerServiceStoreFilesArtifactFromService(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceResponse(rsp) +} + +// ApiContainerApiApiContainerServiceStoreWebFilesArtifactWithBodyWithResponse request with arbitrary body returning *ApiContainerApiApiContainerServiceStoreWebFilesArtifactResponse +func (c *ClientWithResponses) ApiContainerApiApiContainerServiceStoreWebFilesArtifactWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceStoreWebFilesArtifactResponse, error) { + rsp, err := c.ApiContainerApiApiContainerServiceStoreWebFilesArtifactWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseApiContainerApiApiContainerServiceStoreWebFilesArtifactResponse(rsp) +} + +func (c *ClientWithResponses) ApiContainerApiApiContainerServiceStoreWebFilesArtifactWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceStoreWebFilesArtifactJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceStoreWebFilesArtifactResponse, error) { + rsp, err := c.ApiContainerApiApiContainerServiceStoreWebFilesArtifact(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseApiContainerApiApiContainerServiceStoreWebFilesArtifactResponse(rsp) +} + +// ApiContainerApiApiContainerServiceUploadFilesArtifactWithBodyWithResponse request with arbitrary body returning *ApiContainerApiApiContainerServiceUploadFilesArtifactResponse +func (c *ClientWithResponses) ApiContainerApiApiContainerServiceUploadFilesArtifactWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceUploadFilesArtifactResponse, error) { + rsp, err := c.ApiContainerApiApiContainerServiceUploadFilesArtifactWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseApiContainerApiApiContainerServiceUploadFilesArtifactResponse(rsp) +} + +func (c *ClientWithResponses) ApiContainerApiApiContainerServiceUploadFilesArtifactWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceUploadFilesArtifactJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceUploadFilesArtifactResponse, error) { + rsp, err := c.ApiContainerApiApiContainerServiceUploadFilesArtifact(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseApiContainerApiApiContainerServiceUploadFilesArtifactResponse(rsp) +} + +// ApiContainerApiApiContainerServiceUploadStarlarkPackageWithBodyWithResponse request with arbitrary body returning *ApiContainerApiApiContainerServiceUploadStarlarkPackageResponse +func (c *ClientWithResponses) ApiContainerApiApiContainerServiceUploadStarlarkPackageWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceUploadStarlarkPackageResponse, error) { + rsp, err := c.ApiContainerApiApiContainerServiceUploadStarlarkPackageWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseApiContainerApiApiContainerServiceUploadStarlarkPackageResponse(rsp) +} + +func (c *ClientWithResponses) ApiContainerApiApiContainerServiceUploadStarlarkPackageWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceUploadStarlarkPackageJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceUploadStarlarkPackageResponse, error) { + rsp, err := c.ApiContainerApiApiContainerServiceUploadStarlarkPackage(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseApiContainerApiApiContainerServiceUploadStarlarkPackageResponse(rsp) +} + +// ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityWithBodyWithResponse request with arbitrary body returning *ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityResponse +func (c *ClientWithResponses) ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityResponse, error) { + rsp, err := c.ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityResponse(rsp) +} + +func (c *ClientWithResponses) ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityResponse, error) { + rsp, err := c.ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailability(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityResponse(rsp) +} + +// ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityWithBodyWithResponse request with arbitrary body returning *ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityResponse +func (c *ClientWithResponses) ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityResponse, error) { + rsp, err := c.ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityResponse(rsp) +} + +func (c *ClientWithResponses) ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityResponse, error) { + rsp, err := c.ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailability(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityResponse(rsp) +} + +// ParseApiContainerApiApiContainerServiceConnectServicesResponse parses an HTTP response from a ApiContainerApiApiContainerServiceConnectServicesWithResponse call +func ParseApiContainerApiApiContainerServiceConnectServicesResponse(rsp *http.Response) (*ApiContainerApiApiContainerServiceConnectServicesResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ApiContainerApiApiContainerServiceConnectServicesResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + +// ParseApiContainerApiApiContainerServiceDownloadFilesArtifactResponse parses an HTTP response from a ApiContainerApiApiContainerServiceDownloadFilesArtifactWithResponse call +func ParseApiContainerApiApiContainerServiceDownloadFilesArtifactResponse(rsp *http.Response) (*ApiContainerApiApiContainerServiceDownloadFilesArtifactResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ApiContainerApiApiContainerServiceDownloadFilesArtifactResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + +// ParseApiContainerApiApiContainerServiceExecCommandResponse parses an HTTP response from a ApiContainerApiApiContainerServiceExecCommandWithResponse call +func ParseApiContainerApiApiContainerServiceExecCommandResponse(rsp *http.Response) (*ApiContainerApiApiContainerServiceExecCommandResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ApiContainerApiApiContainerServiceExecCommandResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + +// ParseApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersResponse parses an HTTP response from a ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersWithResponse call +func ParseApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersResponse(rsp *http.Response) (*ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + +// ParseApiContainerApiApiContainerServiceGetServicesResponse parses an HTTP response from a ApiContainerApiApiContainerServiceGetServicesWithResponse call +func ParseApiContainerApiApiContainerServiceGetServicesResponse(rsp *http.Response) (*ApiContainerApiApiContainerServiceGetServicesResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ApiContainerApiApiContainerServiceGetServicesResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + +// ParseApiContainerApiApiContainerServiceGetStarlarkRunResponse parses an HTTP response from a ApiContainerApiApiContainerServiceGetStarlarkRunWithResponse call +func ParseApiContainerApiApiContainerServiceGetStarlarkRunResponse(rsp *http.Response) (*ApiContainerApiApiContainerServiceGetStarlarkRunResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ApiContainerApiApiContainerServiceGetStarlarkRunResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + +// ParseApiContainerApiApiContainerServiceInspectFilesArtifactContentsResponse parses an HTTP response from a ApiContainerApiApiContainerServiceInspectFilesArtifactContentsWithResponse call +func ParseApiContainerApiApiContainerServiceInspectFilesArtifactContentsResponse(rsp *http.Response) (*ApiContainerApiApiContainerServiceInspectFilesArtifactContentsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ApiContainerApiApiContainerServiceInspectFilesArtifactContentsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + +// ParseApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsResponse parses an HTTP response from a ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsWithResponse call +func ParseApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsResponse(rsp *http.Response) (*ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + +// ParseApiContainerApiApiContainerServiceRunStarlarkPackageResponse parses an HTTP response from a ApiContainerApiApiContainerServiceRunStarlarkPackageWithResponse call +func ParseApiContainerApiApiContainerServiceRunStarlarkPackageResponse(rsp *http.Response) (*ApiContainerApiApiContainerServiceRunStarlarkPackageResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ApiContainerApiApiContainerServiceRunStarlarkPackageResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + +// ParseApiContainerApiApiContainerServiceRunStarlarkScriptResponse parses an HTTP response from a ApiContainerApiApiContainerServiceRunStarlarkScriptWithResponse call +func ParseApiContainerApiApiContainerServiceRunStarlarkScriptResponse(rsp *http.Response) (*ApiContainerApiApiContainerServiceRunStarlarkScriptResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ApiContainerApiApiContainerServiceRunStarlarkScriptResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + +// ParseApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceResponse parses an HTTP response from a ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceWithResponse call +func ParseApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceResponse(rsp *http.Response) (*ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + +// ParseApiContainerApiApiContainerServiceStoreWebFilesArtifactResponse parses an HTTP response from a ApiContainerApiApiContainerServiceStoreWebFilesArtifactWithResponse call +func ParseApiContainerApiApiContainerServiceStoreWebFilesArtifactResponse(rsp *http.Response) (*ApiContainerApiApiContainerServiceStoreWebFilesArtifactResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ApiContainerApiApiContainerServiceStoreWebFilesArtifactResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + +// ParseApiContainerApiApiContainerServiceUploadFilesArtifactResponse parses an HTTP response from a ApiContainerApiApiContainerServiceUploadFilesArtifactWithResponse call +func ParseApiContainerApiApiContainerServiceUploadFilesArtifactResponse(rsp *http.Response) (*ApiContainerApiApiContainerServiceUploadFilesArtifactResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ApiContainerApiApiContainerServiceUploadFilesArtifactResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + +// ParseApiContainerApiApiContainerServiceUploadStarlarkPackageResponse parses an HTTP response from a ApiContainerApiApiContainerServiceUploadStarlarkPackageWithResponse call +func ParseApiContainerApiApiContainerServiceUploadStarlarkPackageResponse(rsp *http.Response) (*ApiContainerApiApiContainerServiceUploadStarlarkPackageResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ApiContainerApiApiContainerServiceUploadStarlarkPackageResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + +// ParseApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityResponse parses an HTTP response from a ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityWithResponse call +func ParseApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityResponse(rsp *http.Response) (*ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + +// ParseApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityResponse parses an HTTP response from a ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityWithResponse call +func ParseApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityResponse(rsp *http.Response) (*ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + +// ServerInterface represents all server handlers. +type ServerInterface interface { + + // (POST /api_container_api.ApiContainerService/ConnectServices) + ApiContainerApiApiContainerServiceConnectServices(ctx echo.Context) error + + // (POST /api_container_api.ApiContainerService/DownloadFilesArtifact) + ApiContainerApiApiContainerServiceDownloadFilesArtifact(ctx echo.Context) error + + // (POST /api_container_api.ApiContainerService/ExecCommand) + ApiContainerApiApiContainerServiceExecCommand(ctx echo.Context) error + + // (POST /api_container_api.ApiContainerService/GetExistingAndHistoricalServiceIdentifiers) + ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiers(ctx echo.Context) error + + // (POST /api_container_api.ApiContainerService/GetServices) + ApiContainerApiApiContainerServiceGetServices(ctx echo.Context) error + + // (POST /api_container_api.ApiContainerService/GetStarlarkRun) + ApiContainerApiApiContainerServiceGetStarlarkRun(ctx echo.Context) error + + // (POST /api_container_api.ApiContainerService/InspectFilesArtifactContents) + ApiContainerApiApiContainerServiceInspectFilesArtifactContents(ctx echo.Context) error + + // (POST /api_container_api.ApiContainerService/ListFilesArtifactNamesAndUuids) + ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuids(ctx echo.Context) error + + // (POST /api_container_api.ApiContainerService/RunStarlarkPackage) + ApiContainerApiApiContainerServiceRunStarlarkPackage(ctx echo.Context) error + + // (POST /api_container_api.ApiContainerService/RunStarlarkScript) + ApiContainerApiApiContainerServiceRunStarlarkScript(ctx echo.Context) error + + // (POST /api_container_api.ApiContainerService/StoreFilesArtifactFromService) + ApiContainerApiApiContainerServiceStoreFilesArtifactFromService(ctx echo.Context) error + + // (POST /api_container_api.ApiContainerService/StoreWebFilesArtifact) + ApiContainerApiApiContainerServiceStoreWebFilesArtifact(ctx echo.Context) error + + // (POST /api_container_api.ApiContainerService/UploadFilesArtifact) + ApiContainerApiApiContainerServiceUploadFilesArtifact(ctx echo.Context) error + + // (POST /api_container_api.ApiContainerService/UploadStarlarkPackage) + ApiContainerApiApiContainerServiceUploadStarlarkPackage(ctx echo.Context) error + + // (POST /api_container_api.ApiContainerService/WaitForHttpGetEndpointAvailability) + ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailability(ctx echo.Context) error + + // (POST /api_container_api.ApiContainerService/WaitForHttpPostEndpointAvailability) + ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailability(ctx echo.Context) error +} + +// ServerInterfaceWrapper converts echo contexts to parameters. +type ServerInterfaceWrapper struct { + Handler ServerInterface +} + +// ApiContainerApiApiContainerServiceConnectServices converts echo context to params. +func (w *ServerInterfaceWrapper) ApiContainerApiApiContainerServiceConnectServices(ctx echo.Context) error { + var err error + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.ApiContainerApiApiContainerServiceConnectServices(ctx) + return err +} + +// ApiContainerApiApiContainerServiceDownloadFilesArtifact converts echo context to params. +func (w *ServerInterfaceWrapper) ApiContainerApiApiContainerServiceDownloadFilesArtifact(ctx echo.Context) error { + var err error + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.ApiContainerApiApiContainerServiceDownloadFilesArtifact(ctx) + return err +} + +// ApiContainerApiApiContainerServiceExecCommand converts echo context to params. +func (w *ServerInterfaceWrapper) ApiContainerApiApiContainerServiceExecCommand(ctx echo.Context) error { + var err error + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.ApiContainerApiApiContainerServiceExecCommand(ctx) + return err +} + +// ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiers converts echo context to params. +func (w *ServerInterfaceWrapper) ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiers(ctx echo.Context) error { + var err error + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiers(ctx) + return err +} + +// ApiContainerApiApiContainerServiceGetServices converts echo context to params. +func (w *ServerInterfaceWrapper) ApiContainerApiApiContainerServiceGetServices(ctx echo.Context) error { + var err error + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.ApiContainerApiApiContainerServiceGetServices(ctx) + return err +} + +// ApiContainerApiApiContainerServiceGetStarlarkRun converts echo context to params. +func (w *ServerInterfaceWrapper) ApiContainerApiApiContainerServiceGetStarlarkRun(ctx echo.Context) error { + var err error + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.ApiContainerApiApiContainerServiceGetStarlarkRun(ctx) + return err +} + +// ApiContainerApiApiContainerServiceInspectFilesArtifactContents converts echo context to params. +func (w *ServerInterfaceWrapper) ApiContainerApiApiContainerServiceInspectFilesArtifactContents(ctx echo.Context) error { + var err error + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.ApiContainerApiApiContainerServiceInspectFilesArtifactContents(ctx) + return err +} + +// ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuids converts echo context to params. +func (w *ServerInterfaceWrapper) ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuids(ctx echo.Context) error { + var err error + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuids(ctx) + return err +} + +// ApiContainerApiApiContainerServiceRunStarlarkPackage converts echo context to params. +func (w *ServerInterfaceWrapper) ApiContainerApiApiContainerServiceRunStarlarkPackage(ctx echo.Context) error { + var err error + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.ApiContainerApiApiContainerServiceRunStarlarkPackage(ctx) + return err +} + +// ApiContainerApiApiContainerServiceRunStarlarkScript converts echo context to params. +func (w *ServerInterfaceWrapper) ApiContainerApiApiContainerServiceRunStarlarkScript(ctx echo.Context) error { + var err error + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.ApiContainerApiApiContainerServiceRunStarlarkScript(ctx) + return err +} + +// ApiContainerApiApiContainerServiceStoreFilesArtifactFromService converts echo context to params. +func (w *ServerInterfaceWrapper) ApiContainerApiApiContainerServiceStoreFilesArtifactFromService(ctx echo.Context) error { + var err error + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.ApiContainerApiApiContainerServiceStoreFilesArtifactFromService(ctx) + return err +} + +// ApiContainerApiApiContainerServiceStoreWebFilesArtifact converts echo context to params. +func (w *ServerInterfaceWrapper) ApiContainerApiApiContainerServiceStoreWebFilesArtifact(ctx echo.Context) error { + var err error + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.ApiContainerApiApiContainerServiceStoreWebFilesArtifact(ctx) + return err +} + +// ApiContainerApiApiContainerServiceUploadFilesArtifact converts echo context to params. +func (w *ServerInterfaceWrapper) ApiContainerApiApiContainerServiceUploadFilesArtifact(ctx echo.Context) error { + var err error + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.ApiContainerApiApiContainerServiceUploadFilesArtifact(ctx) + return err +} + +// ApiContainerApiApiContainerServiceUploadStarlarkPackage converts echo context to params. +func (w *ServerInterfaceWrapper) ApiContainerApiApiContainerServiceUploadStarlarkPackage(ctx echo.Context) error { + var err error + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.ApiContainerApiApiContainerServiceUploadStarlarkPackage(ctx) + return err +} + +// ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailability converts echo context to params. +func (w *ServerInterfaceWrapper) ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailability(ctx echo.Context) error { + var err error + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailability(ctx) + return err +} + +// ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailability converts echo context to params. +func (w *ServerInterfaceWrapper) ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailability(ctx echo.Context) error { + var err error + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailability(ctx) + return err +} + +// This is a simple interface which specifies echo.Route addition functions which +// are present on both echo.Echo and echo.Group, since we want to allow using +// either of them for path registration +type EchoRouter interface { + CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route +} + +// RegisterHandlers adds each server route to the EchoRouter. +func RegisterHandlers(router EchoRouter, si ServerInterface) { + RegisterHandlersWithBaseURL(router, si, "") +} + +// Registers handlers, and prepends BaseURL to the paths, so that the paths +// can be served under a prefix. +func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string) { + + wrapper := ServerInterfaceWrapper{ + Handler: si, + } + + router.POST(baseURL+"/api_container_api.ApiContainerService/ConnectServices", wrapper.ApiContainerApiApiContainerServiceConnectServices) + router.POST(baseURL+"/api_container_api.ApiContainerService/DownloadFilesArtifact", wrapper.ApiContainerApiApiContainerServiceDownloadFilesArtifact) + router.POST(baseURL+"/api_container_api.ApiContainerService/ExecCommand", wrapper.ApiContainerApiApiContainerServiceExecCommand) + router.POST(baseURL+"/api_container_api.ApiContainerService/GetExistingAndHistoricalServiceIdentifiers", wrapper.ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiers) + router.POST(baseURL+"/api_container_api.ApiContainerService/GetServices", wrapper.ApiContainerApiApiContainerServiceGetServices) + router.POST(baseURL+"/api_container_api.ApiContainerService/GetStarlarkRun", wrapper.ApiContainerApiApiContainerServiceGetStarlarkRun) + router.POST(baseURL+"/api_container_api.ApiContainerService/InspectFilesArtifactContents", wrapper.ApiContainerApiApiContainerServiceInspectFilesArtifactContents) + router.POST(baseURL+"/api_container_api.ApiContainerService/ListFilesArtifactNamesAndUuids", wrapper.ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuids) + router.POST(baseURL+"/api_container_api.ApiContainerService/RunStarlarkPackage", wrapper.ApiContainerApiApiContainerServiceRunStarlarkPackage) + router.POST(baseURL+"/api_container_api.ApiContainerService/RunStarlarkScript", wrapper.ApiContainerApiApiContainerServiceRunStarlarkScript) + router.POST(baseURL+"/api_container_api.ApiContainerService/StoreFilesArtifactFromService", wrapper.ApiContainerApiApiContainerServiceStoreFilesArtifactFromService) + router.POST(baseURL+"/api_container_api.ApiContainerService/StoreWebFilesArtifact", wrapper.ApiContainerApiApiContainerServiceStoreWebFilesArtifact) + router.POST(baseURL+"/api_container_api.ApiContainerService/UploadFilesArtifact", wrapper.ApiContainerApiApiContainerServiceUploadFilesArtifact) + router.POST(baseURL+"/api_container_api.ApiContainerService/UploadStarlarkPackage", wrapper.ApiContainerApiApiContainerServiceUploadStarlarkPackage) + router.POST(baseURL+"/api_container_api.ApiContainerService/WaitForHttpGetEndpointAvailability", wrapper.ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailability) + router.POST(baseURL+"/api_container_api.ApiContainerService/WaitForHttpPostEndpointAvailability", wrapper.ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailability) + +} + +// Base64 encoded, gzipped, json marshaled Swagger object +var swaggerSpec = []string{ + + "H4sIAAAAAAAC/+w9f2/jNpZfhdAdMG3hOrPdxaIIcH+kSWbGt61jxElzh/NBS0tPNhuK1PGHE7fIdz+Q", + "omTJphxZduz0bvaP3Y1FPj6+3+/xkfNHEPE04wyYksH5H4GA/9Eg1U88JmB/wBkJI84UJgxEiDPSHysB", + "OIX4Cit8Odfs0QwzQ4CpfEZGSYQV4ezsN8mZ+U1Gc0ix+X//KiAJzoN/OVute5Z/lWdt1np5eekFMchI", + "kMwsEZwH//am/5mwAglksEAWjQl720WDnuUEERAH50poeOkFM85nFPqZ4IpPddK/TjO1PBjt/dAttdcw", + "eek5kA3ycckZg8iiU+fTR/Q9urwZDq8v79DZGfoJpEKQJFwolJn/Srh4wiImbDZhf0Hfo+FNWBk+qg9B", + "MZF4SiEOegEwnQbn/xW40UEvWE0N/rsXqGUGwXkglSBsFrz0mpEeg1iQCOSFmNndZYJnIJTThWi1s93E", + "uCCJoZ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vNdwLllfbFjh", + "jVvVW+13tTLtrT/f3w+u2gApEGwAYw+Gapt4FehuVHeFvo2Wg9VhfsfD7VV+lOkpJVFIshDHsefwa2S/", + "o8EIme8gJfqOa2Ws/Xd2p8AiaiLPpzkIqO7dCIAAHM3xlMKEDW/urs/Rg4sarckqzkFWE9gHhYRmjLBZ", + "r/YpJrH5FkNCmBGepW0PkT3k3MIUR4/AYhRzsECkzmz/iADzPya8zfe5WsuQtteUNDqi2DW6JWs2S9xH", + "gDNBFlhBM2OM8FW4wtdouXLIjkPbFtlzo4Wyde25cOJeNFwcSXvHb6i576oHpAhbroXgwle9d3laCMWA", + "XTvyHPwCUL6QceVMgcgEKHwI+IMatHIRG+EdZIFfS0gOeEue+/e/SWjzc5iClK7C0E3CSmr4nIOxawdc", + "QiqhI//ZPBYznRY9ol0PRjcXuhD+njFLW+NKbGxdwWpDASrfmw+FiAzlI8kyqKaDldg345IUK+y9p1EB", + "rDv9DVl8LNi6w/J03aaW/o1WQkUDzsa0hxScUYWQ63EM1SlrWUQ1uW3jVilh7RpeOu/iFqSmynskW1Cv", + "KnaiHL4nGTcN3htblVvNPhFG5Bzi64XrIF6zMNLklKHUUQRSJpq+KlerBqN9URsJPjPRjkeYtBDAVCgV", + "ZOUBefs2sNr03ar73GTHZp58AxGsHLv/7IT82I3urt5SOjdUIHT08599w5NVVNKpf6Lqd+tu5iBOYt11", + "rWzI3qCd9bIBf65A4X40qKriSy8w9iBxViOEwmx0Bl03QC+94AkLkxJ2B/rgAOyofevx4Bvb3ofVNuvL", + "uP0fYCEuoHZO/Unw1KUs/nJmuyJZYtuat3ZftuizHVTaoudYlUdMWkJs69D592Ut0a3UHbgWUYFLeTzF", + "M+KOp7xo2Tmhv8/U7BJPJadaldDNyL3WPACnmlsaXs+X65zq2bq6lpaMDAlIQACLCJshooqjhEQrLWCv", + "nTzA9B1cELCooAeYnvqGwKGUSgvP8dz97c9GWYr6uQVVANlfJtc5+SeTRc81xf8PFwfrnCmuAdV3bn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4w9/", + "R/NyjerLCrtK+A54byiAj+y1hxCbXsd7aw53eNjkEALweph1W6aDgAZXZUOy66xZBWCumrnqSu7A1qPH", + "XuvvrpzAcB355ZUjGy7fAygHkdtVW0mz6BrSUizV6naZ0KyjZFbW+1MZFd9DL3szYNsLGFV27ErorXCP", + "ZRPaPExyivys1bMje7N2+6sb+zD3Fch/Hq1q+TDJ3qzYvLnfIrvAK2OXf0c8d8xagvgg0RTmmCYdjKAH", + "m2NpZMNTD6dQwqYG3kMye1xe7XwHvHbInIDVldvY/6c4vbUHsJnrd0CpLG7iV18n5Sji2bKhWIarteID", + "Vs62b+JY0vJ64+tpJKdNk+dh5Gi9b6+T/JQ9hc0F1yeYvoUEbaB/VMnxtq+e5F8dOFkD6ylUo7HXdG+V", + "8HTIbTk/yhpOGQ4r5z6cOsS6rQrZb82+bR2IB2Je64h3xb71t2P6KH8tRkGWP1aQi3jxflX1tasIs9oz", + "3vbc3hvpdmP7qxHzu2T8ln8gZB8Gv96q2MztnyiPHt3p/+oAxfYNbDSulO0ovfIRNKKQmguuZ3OEVx2J", + "jtAduNtiK8fyZC0bQE/g1t5PC+iberm315amHrcjqottZTuIvjRu5gQKs7V58OQac9L2wXekMi8v/xsA", + "AP//vgZ8abtsAAA=", +} + +// GetSwagger returns the content of the embedded swagger specification file +// or error if failed to decode +func decodeSpec() ([]byte, error) { + zipped, err := base64.StdEncoding.DecodeString(strings.Join(swaggerSpec, "")) + if err != nil { + return nil, fmt.Errorf("error base64 decoding spec: %w", err) + } + zr, err := gzip.NewReader(bytes.NewReader(zipped)) + if err != nil { + return nil, fmt.Errorf("error decompressing spec: %w", err) + } + var buf bytes.Buffer + _, err = buf.ReadFrom(zr) + if err != nil { + return nil, fmt.Errorf("error decompressing spec: %w", err) + } + + return buf.Bytes(), nil +} + +var rawSpec = decodeSpecCached() + +// a naive cached of a decoded swagger spec +func decodeSpecCached() func() ([]byte, error) { + data, err := decodeSpec() + return func() ([]byte, error) { + return data, err + } +} + +// Constructs a synthetic filesystem for resolving external references when loading openapi specifications. +func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error) { + res := make(map[string]func() ([]byte, error)) + if len(pathToFile) > 0 { + res[pathToFile] = rawSpec + } + + return res +} + +// GetSwagger returns the Swagger specification corresponding to the generated code +// in this file. The external references of Swagger specification are resolved. +// The logic of resolving external references is tightly connected to "import-mapping" feature. +// Externally referenced files must be embedded in the corresponding golang packages. +// Urls can be supported but this task was out of the scope. +func GetSwagger() (swagger *openapi3.T, err error) { + resolvePath := PathToRawSpec("") + + loader := openapi3.NewLoader() + loader.IsExternalRefsAllowed = true + loader.ReadFromURIFunc = func(loader *openapi3.Loader, url *url.URL) ([]byte, error) { + pathToFile := url.String() + pathToFile = path.Clean(pathToFile) + getSpec, ok := resolvePath[pathToFile] + if !ok { + err1 := fmt.Errorf("path not found: %s", pathToFile) + return nil, err1 + } + return getSpec() + } + var specData []byte + specData, err = rawSpec() + if err != nil { + return + } + swagger, err = loader.LoadFromData(specData) + if err != nil { + return + } + return +} diff --git a/api/golang/engine/kurtosis_engine_http_api_bindings/engine_service.go b/api/golang/engine/kurtosis_engine_http_api_bindings/engine_service.go new file mode 100644 index 0000000000..bc6ac87e06 --- /dev/null +++ b/api/golang/engine/kurtosis_engine_http_api_bindings/engine_service.go @@ -0,0 +1,1710 @@ +// Package engine_service provides primitives to interact with the openapi HTTP API. +// +// Code generated by github.com/deepmap/oapi-codegen version (devel) DO NOT EDIT. +package engine_service + +import ( + "bytes" + "compress/gzip" + "context" + "encoding/base64" + "encoding/json" + "fmt" + "io" + "net/http" + "net/url" + "path" + "strings" + + "github.com/getkin/kin-openapi/openapi3" + "github.com/labstack/echo/v4" +) + +// Defines values for EngineApiEnclaveAPIContainerStatus. +const ( + EnclaveAPIContainerStatusNONEXISTENT EngineApiEnclaveAPIContainerStatus = "EnclaveAPIContainerStatus_NONEXISTENT" + EnclaveAPIContainerStatusRUNNING EngineApiEnclaveAPIContainerStatus = "EnclaveAPIContainerStatus_RUNNING" + EnclaveAPIContainerStatusSTOPPED EngineApiEnclaveAPIContainerStatus = "EnclaveAPIContainerStatus_STOPPED" +) + +// Defines values for EngineApiEnclaveContainersStatus. +const ( + EnclaveContainersStatusEMPTY EngineApiEnclaveContainersStatus = "EnclaveContainersStatus_EMPTY" + EnclaveContainersStatusRUNNING EngineApiEnclaveContainersStatus = "EnclaveContainersStatus_RUNNING" + EnclaveContainersStatusSTOPPED EngineApiEnclaveContainersStatus = "EnclaveContainersStatus_STOPPED" +) + +// Defines values for EngineApiEnclaveMode. +const ( + PRODUCTION EngineApiEnclaveMode = "PRODUCTION" + TEST EngineApiEnclaveMode = "TEST" +) + +// Defines values for EngineApiLogLineOperator. +const ( + LogLineOperatorDOESCONTAINMATCHREGEX EngineApiLogLineOperator = "LogLineOperator_DOES_CONTAIN_MATCH_REGEX" + LogLineOperatorDOESCONTAINTEXT EngineApiLogLineOperator = "LogLineOperator_DOES_CONTAIN_TEXT" + LogLineOperatorDOESNOTCONTAINMATCHREGEX EngineApiLogLineOperator = "LogLineOperator_DOES_NOT_CONTAIN_MATCH_REGEX" + LogLineOperatorDOESNOTCONTAINTEXT EngineApiLogLineOperator = "LogLineOperator_DOES_NOT_CONTAIN_TEXT" +) + +// EngineApiCleanArgs ============================================================================================== +// Create Enclave +// ============================================================================================== +type EngineApiCleanArgs struct { + // ShouldCleanAll If true, It will clean even the running enclaves + ShouldCleanAll *bool `json:"should_clean_all,omitempty"` +} + +// EngineApiCleanResponse defines model for engine_api.CleanResponse. +type EngineApiCleanResponse struct { + // RemovedEnclaveNameAndUuids removed enclave name and uuids + RemovedEnclaveNameAndUuids *[]EngineApiEnclaveNameAndUuid `json:"removed_enclave_name_and_uuids,omitempty"` +} + +// EngineApiCreateEnclaveArgs ============================================================================================== +// Create Enclave +// ============================================================================================== +type EngineApiCreateEnclaveArgs struct { + // ApiContainerLogLevel The API container log level + ApiContainerLogLevel *string `json:"api_container_log_level,omitempty"` + + // ApiContainerVersionTag The image tag of the API container that should be used inside the enclave + // If blank, will use the default version that the engine server uses + ApiContainerVersionTag *string `json:"api_container_version_tag,omitempty"` + + // EnclaveName The name of the new Kurtosis Enclave + EnclaveName *string `json:"enclave_name,omitempty"` + + // Mode 0 - TEST + // 1 - PRODUCTION + Mode *EngineApiEnclaveMode `json:"mode,omitempty"` +} + +// EngineApiCreateEnclaveResponse defines model for engine_api.CreateEnclaveResponse. +type EngineApiCreateEnclaveResponse struct { + // EnclaveInfo Enclaves are defined by a network in the container system, which is why there's a bunch of network information here + EnclaveInfo *EngineApiEnclaveInfo `json:"enclave_info,omitempty"` +} + +// EngineApiDestroyEnclaveArgs ============================================================================================== +// Destroy Enclave +// ============================================================================================== +type EngineApiDestroyEnclaveArgs struct { + // EnclaveIdentifier The identifier(uuid, shortened uuid, name) of the Kurtosis enclave to destroy + EnclaveIdentifier *string `json:"enclave_identifier,omitempty"` +} + +// EngineApiEnclaveAPIContainerHostMachineInfo Will only be present if the API container is running +type EngineApiEnclaveAPIContainerHostMachineInfo struct { + // GrpcPortOnHostMachine The grpc port on the container engine host machine where the API container can be reached + GrpcPortOnHostMachine *int32 `json:"grpc_port_on_host_machine,omitempty"` + + // IpOnHostMachine The interface IP on the container engine host machine where the API container can be reached + IpOnHostMachine *string `json:"ip_on_host_machine,omitempty"` +} + +// EngineApiEnclaveAPIContainerInfo defines model for engine_api.EnclaveAPIContainerInfo. +type EngineApiEnclaveAPIContainerInfo struct { + // BridgeIpAddress this is the bridge ip address that gets assigned to api container + BridgeIpAddress *string `json:"bridge_ip_address,omitempty"` + + // ContainerId The container engine ID of the API container + ContainerId *string `json:"container_id,omitempty"` + + // GrpcPortInsideEnclave The grpc port inside the enclave network that the API container is listening on + GrpcPortInsideEnclave *int32 `json:"grpc_port_inside_enclave,omitempty"` + + // IpInsideEnclave The IP inside the enclave network of the API container (i.e. how services inside the network can reach the API container) + IpInsideEnclave *string `json:"ip_inside_enclave,omitempty"` +} + +// EngineApiEnclaveAPIContainerStatus 0 - EnclaveAPIContainerStatus_NONEXISTENT // No API container exists in the enclave +// This is the only valid value when the enclave containers status is "EMPTY" +// 1 - EnclaveAPIContainerStatus_RUNNING // An API container exists and is running +// NOTE: this does NOT say that the server inside the API container is available, because checking if it's available requires making a call to the API container +// If we have a lot of API containers, we'd be making tons of calls +// 2 - EnclaveAPIContainerStatus_STOPPED // An API container exists, but isn't running +type EngineApiEnclaveAPIContainerStatus string + +// EngineApiEnclaveContainersStatus 0 - EnclaveContainersStatus_EMPTY // The enclave has been created, but there are no containers inside it +// 1 - EnclaveContainersStatus_RUNNING // One or more containers are running in the enclave (which may or may not include the API container, depending on if the user was manually stopping/removing containers) +// 2 - EnclaveContainersStatus_STOPPED // There are >= 1 container in the enclave, but they're all stopped +type EngineApiEnclaveContainersStatus string + +// EngineApiEnclaveIdentifiers An enclave identifier is a collection of uuid, name and shortened uuid +type EngineApiEnclaveIdentifiers struct { + // EnclaveUuid UUID of the enclave + EnclaveUuid *string `json:"enclave_uuid,omitempty"` + + // Name Name of the enclave + Name *string `json:"name,omitempty"` + + // ShortenedUuid The shortened uuid of the enclave + ShortenedUuid *string `json:"shortened_uuid,omitempty"` +} + +// EngineApiEnclaveInfo Enclaves are defined by a network in the container system, which is why there's a bunch of network information here +type EngineApiEnclaveInfo struct { + // ApiContainerHostMachineInfo Will only be present if the API container is running + ApiContainerHostMachineInfo *EngineApiEnclaveAPIContainerHostMachineInfo `json:"api_container_host_machine_info,omitempty"` + ApiContainerInfo *EngineApiEnclaveAPIContainerInfo `json:"api_container_info,omitempty"` + + // ApiContainerStatus 0 - EnclaveAPIContainerStatus_NONEXISTENT // No API container exists in the enclave + // This is the only valid value when the enclave containers status is "EMPTY" + // 1 - EnclaveAPIContainerStatus_RUNNING // An API container exists and is running + // NOTE: this does NOT say that the server inside the API container is available, because checking if it's available requires making a call to the API container + // If we have a lot of API containers, we'd be making tons of calls + // 2 - EnclaveAPIContainerStatus_STOPPED // An API container exists, but isn't running + ApiContainerStatus *EngineApiEnclaveAPIContainerStatus `json:"api_container_status,omitempty"` + + // ContainersStatus 0 - EnclaveContainersStatus_EMPTY // The enclave has been created, but there are no containers inside it + // 1 - EnclaveContainersStatus_RUNNING // One or more containers are running in the enclave (which may or may not include the API container, depending on if the user was manually stopping/removing containers) + // 2 - EnclaveContainersStatus_STOPPED // There are >= 1 container in the enclave, but they're all stopped + ContainersStatus *EngineApiEnclaveContainersStatus `json:"containers_status,omitempty"` + CreationTime *GoogleProtobufTimestamp `json:"creation_time,omitempty"` + + // EnclaveUuid UUID of the enclave + EnclaveUuid *string `json:"enclave_uuid,omitempty"` + + // Mode 0 - TEST + // 1 - PRODUCTION + Mode *EngineApiEnclaveMode `json:"mode,omitempty"` + + // Name Name of the enclave + Name *string `json:"name,omitempty"` + + // ShortenedUuid The shortened uuid of the enclave + ShortenedUuid *string `json:"shortened_uuid,omitempty"` +} + +// EngineApiEnclaveMode 0 - TEST +// 1 - PRODUCTION +type EngineApiEnclaveMode string + +// EngineApiEnclaveNameAndUuid defines model for engine_api.EnclaveNameAndUuid. +type EngineApiEnclaveNameAndUuid struct { + Name *string `json:"name,omitempty"` + Uuid *string `json:"uuid,omitempty"` +} + +// EngineApiGetEnclavesResponse defines model for engine_api.GetEnclavesResponse. +type EngineApiGetEnclavesResponse struct { + // EnclaveInfo Enclaves are defined by a network in the container system, which is why there's a bunch of network information here + EnclaveInfo *EngineApiEnclaveInfo `json:"enclave_info,omitempty"` +} + +// EngineApiGetEngineInfoResponse ============================================================================================== +// Get Engine Info +// ============================================================================================== +type EngineApiGetEngineInfoResponse struct { + // EngineVersion Version of the engine server + EngineVersion *string `json:"engine_version,omitempty"` +} + +// EngineApiGetExistingAndHistoricalEnclaveIdentifiersResponse defines model for engine_api.GetExistingAndHistoricalEnclaveIdentifiersResponse. +type EngineApiGetExistingAndHistoricalEnclaveIdentifiersResponse struct { + AllIdentifiers *[]EngineApiEnclaveIdentifiers `json:"allIdentifiers,omitempty"` +} + +// EngineApiGetServiceLogsArgs ============================================================================================== +// Get User Service Logs +// ============================================================================================== +type EngineApiGetServiceLogsArgs struct { + // ConjunctiveFilters The conjunctive log lines filters, the first filter is applied over the found log lines, the second filter is applied over the filter one result and so on (like grep) + ConjunctiveFilters *[]EngineApiLogLineFilter `json:"conjunctive_filters,omitempty"` + + // EnclaveIdentifier The identifier of the user service's Kurtosis Enclave + EnclaveIdentifier *string `json:"enclave_identifier,omitempty"` + + // FollowLogs If true, It will follow the container logs + FollowLogs *bool `json:"follow_logs,omitempty"` + + // NumLogLines If [return_all_logs] is false, return [num_log_lines] + NumLogLines *int32 `json:"num_log_lines,omitempty"` + + // ReturnAllLogs If true, return all log lines + ReturnAllLogs *bool `json:"return_all_logs,omitempty"` + + // ServiceUuidSet "Set" of service UUIDs in the enclave + ServiceUuidSet *map[string]string `json:"service_uuid_set,omitempty"` +} + +// EngineApiGetServiceLogsResponse defines model for engine_api.GetServiceLogsResponse. +type EngineApiGetServiceLogsResponse struct { + // NotFoundServiceUuidSet A set of service GUIDs requested by the user that were not found in the logs database, could be related that users send + // a wrong GUID or a right GUID for a service that has not sent any logs so far + NotFoundServiceUuidSet *map[string]string `json:"not_found_service_uuid_set,omitempty"` + + // ServiceLogsByServiceUuid TODO add timestamp as well, for when we do timestamp-handling on the client side + ServiceLogsByServiceUuid *EngineApiLogLine `json:"service_logs_by_service_uuid,omitempty"` +} + +// EngineApiLogLine TODO add timestamp as well, for when we do timestamp-handling on the client side +type EngineApiLogLine struct { + Line *[]string `json:"line,omitempty"` +} + +// EngineApiLogLineFilter defines model for engine_api.LogLineFilter. +type EngineApiLogLineFilter struct { + // Operator 0 - LogLineOperator_DOES_CONTAIN_TEXT + // 1 - LogLineOperator_DOES_NOT_CONTAIN_TEXT + // 2 - LogLineOperator_DOES_CONTAIN_MATCH_REGEX + // 3 - LogLineOperator_DOES_NOT_CONTAIN_MATCH_REGEX + Operator *EngineApiLogLineOperator `json:"operator,omitempty"` + TextPattern *string `json:"text_pattern,omitempty"` +} + +// EngineApiLogLineOperator 0 - LogLineOperator_DOES_CONTAIN_TEXT +// 1 - LogLineOperator_DOES_NOT_CONTAIN_TEXT +// 2 - LogLineOperator_DOES_CONTAIN_MATCH_REGEX +// 3 - LogLineOperator_DOES_NOT_CONTAIN_MATCH_REGEX +type EngineApiLogLineOperator string + +// EngineApiStopEnclaveArgs ============================================================================================== +// Stop Enclave +// ============================================================================================== +type EngineApiStopEnclaveArgs struct { + // EnclaveIdentifier The identifier(uuid, shortened uuid, name) of the Kurtosis enclave to stop + EnclaveIdentifier *string `json:"enclave_identifier,omitempty"` +} + +// GoogleProtobufEmpty defines model for google.protobuf.Empty. +type GoogleProtobufEmpty = map[string]interface{} + +// GoogleProtobufTimestamp defines model for google.protobuf.Timestamp. +type GoogleProtobufTimestamp struct { + Nanos *int32 `json:"nanos,omitempty"` + Seconds *int64 `json:"seconds,omitempty"` +} + +// EngineApiEngineServiceCleanJSONRequestBody defines body for EngineApiEngineServiceClean for application/json ContentType. +type EngineApiEngineServiceCleanJSONRequestBody = EngineApiCleanArgs + +// EngineApiEngineServiceCreateEnclaveJSONRequestBody defines body for EngineApiEngineServiceCreateEnclave for application/json ContentType. +type EngineApiEngineServiceCreateEnclaveJSONRequestBody = EngineApiCreateEnclaveArgs + +// EngineApiEngineServiceDestroyEnclaveJSONRequestBody defines body for EngineApiEngineServiceDestroyEnclave for application/json ContentType. +type EngineApiEngineServiceDestroyEnclaveJSONRequestBody = EngineApiDestroyEnclaveArgs + +// EngineApiEngineServiceGetEnclavesJSONRequestBody defines body for EngineApiEngineServiceGetEnclaves for application/json ContentType. +type EngineApiEngineServiceGetEnclavesJSONRequestBody = GoogleProtobufEmpty + +// EngineApiEngineServiceGetEngineInfoJSONRequestBody defines body for EngineApiEngineServiceGetEngineInfo for application/json ContentType. +type EngineApiEngineServiceGetEngineInfoJSONRequestBody = GoogleProtobufEmpty + +// EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersJSONRequestBody defines body for EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiers for application/json ContentType. +type EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersJSONRequestBody = GoogleProtobufEmpty + +// EngineApiEngineServiceGetServiceLogsJSONRequestBody defines body for EngineApiEngineServiceGetServiceLogs for application/json ContentType. +type EngineApiEngineServiceGetServiceLogsJSONRequestBody = EngineApiGetServiceLogsArgs + +// EngineApiEngineServiceStopEnclaveJSONRequestBody defines body for EngineApiEngineServiceStopEnclave for application/json ContentType. +type EngineApiEngineServiceStopEnclaveJSONRequestBody = EngineApiStopEnclaveArgs + +// RequestEditorFn is the function signature for the RequestEditor callback function +type RequestEditorFn func(ctx context.Context, req *http.Request) error + +// Doer performs HTTP requests. +// +// The standard http.Client implements this interface. +type HttpRequestDoer interface { + Do(req *http.Request) (*http.Response, error) +} + +// Client which conforms to the OpenAPI3 specification for this service. +type Client struct { + // The endpoint of the server conforming to this interface, with scheme, + // https://api.deepmap.com for example. This can contain a path relative + // to the server, such as https://api.deepmap.com/dev-test, and all the + // paths in the swagger spec will be appended to the server. + Server string + + // Doer for performing requests, typically a *http.Client with any + // customized settings, such as certificate chains. + Client HttpRequestDoer + + // A list of callbacks for modifying requests which are generated before sending over + // the network. + RequestEditors []RequestEditorFn +} + +// ClientOption allows setting custom parameters during construction +type ClientOption func(*Client) error + +// Creates a new Client, with reasonable defaults +func NewClient(server string, opts ...ClientOption) (*Client, error) { + // create a client with sane default values + client := Client{ + Server: server, + } + // mutate client and add all optional params + for _, o := range opts { + if err := o(&client); err != nil { + return nil, err + } + } + // ensure the server URL always has a trailing slash + if !strings.HasSuffix(client.Server, "/") { + client.Server += "/" + } + // create httpClient, if not already present + if client.Client == nil { + client.Client = &http.Client{} + } + return &client, nil +} + +// WithHTTPClient allows overriding the default Doer, which is +// automatically created using http.Client. This is useful for tests. +func WithHTTPClient(doer HttpRequestDoer) ClientOption { + return func(c *Client) error { + c.Client = doer + return nil + } +} + +// WithRequestEditorFn allows setting up a callback function, which will be +// called right before sending the request. This can be used to mutate the request. +func WithRequestEditorFn(fn RequestEditorFn) ClientOption { + return func(c *Client) error { + c.RequestEditors = append(c.RequestEditors, fn) + return nil + } +} + +// The interface specification for the client above. +type ClientInterface interface { + // EngineApiEngineServiceCleanWithBody request with any body + EngineApiEngineServiceCleanWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + EngineApiEngineServiceClean(ctx context.Context, body EngineApiEngineServiceCleanJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // EngineApiEngineServiceCreateEnclaveWithBody request with any body + EngineApiEngineServiceCreateEnclaveWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + EngineApiEngineServiceCreateEnclave(ctx context.Context, body EngineApiEngineServiceCreateEnclaveJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // EngineApiEngineServiceDestroyEnclaveWithBody request with any body + EngineApiEngineServiceDestroyEnclaveWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + EngineApiEngineServiceDestroyEnclave(ctx context.Context, body EngineApiEngineServiceDestroyEnclaveJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // EngineApiEngineServiceGetEnclavesWithBody request with any body + EngineApiEngineServiceGetEnclavesWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + EngineApiEngineServiceGetEnclaves(ctx context.Context, body EngineApiEngineServiceGetEnclavesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // EngineApiEngineServiceGetEngineInfoWithBody request with any body + EngineApiEngineServiceGetEngineInfoWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + EngineApiEngineServiceGetEngineInfo(ctx context.Context, body EngineApiEngineServiceGetEngineInfoJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersWithBody request with any body + EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiers(ctx context.Context, body EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // EngineApiEngineServiceGetServiceLogsWithBody request with any body + EngineApiEngineServiceGetServiceLogsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + EngineApiEngineServiceGetServiceLogs(ctx context.Context, body EngineApiEngineServiceGetServiceLogsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // EngineApiEngineServiceStopEnclaveWithBody request with any body + EngineApiEngineServiceStopEnclaveWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + EngineApiEngineServiceStopEnclave(ctx context.Context, body EngineApiEngineServiceStopEnclaveJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) +} + +func (c *Client) EngineApiEngineServiceCleanWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewEngineApiEngineServiceCleanRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) EngineApiEngineServiceClean(ctx context.Context, body EngineApiEngineServiceCleanJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewEngineApiEngineServiceCleanRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) EngineApiEngineServiceCreateEnclaveWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewEngineApiEngineServiceCreateEnclaveRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) EngineApiEngineServiceCreateEnclave(ctx context.Context, body EngineApiEngineServiceCreateEnclaveJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewEngineApiEngineServiceCreateEnclaveRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) EngineApiEngineServiceDestroyEnclaveWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewEngineApiEngineServiceDestroyEnclaveRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) EngineApiEngineServiceDestroyEnclave(ctx context.Context, body EngineApiEngineServiceDestroyEnclaveJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewEngineApiEngineServiceDestroyEnclaveRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) EngineApiEngineServiceGetEnclavesWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewEngineApiEngineServiceGetEnclavesRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) EngineApiEngineServiceGetEnclaves(ctx context.Context, body EngineApiEngineServiceGetEnclavesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewEngineApiEngineServiceGetEnclavesRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) EngineApiEngineServiceGetEngineInfoWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewEngineApiEngineServiceGetEngineInfoRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) EngineApiEngineServiceGetEngineInfo(ctx context.Context, body EngineApiEngineServiceGetEngineInfoJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewEngineApiEngineServiceGetEngineInfoRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewEngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiers(ctx context.Context, body EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewEngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) EngineApiEngineServiceGetServiceLogsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewEngineApiEngineServiceGetServiceLogsRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) EngineApiEngineServiceGetServiceLogs(ctx context.Context, body EngineApiEngineServiceGetServiceLogsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewEngineApiEngineServiceGetServiceLogsRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) EngineApiEngineServiceStopEnclaveWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewEngineApiEngineServiceStopEnclaveRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) EngineApiEngineServiceStopEnclave(ctx context.Context, body EngineApiEngineServiceStopEnclaveJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewEngineApiEngineServiceStopEnclaveRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// NewEngineApiEngineServiceCleanRequest calls the generic EngineApiEngineServiceClean builder with application/json body +func NewEngineApiEngineServiceCleanRequest(server string, body EngineApiEngineServiceCleanJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewEngineApiEngineServiceCleanRequestWithBody(server, "application/json", bodyReader) +} + +// NewEngineApiEngineServiceCleanRequestWithBody generates requests for EngineApiEngineServiceClean with any type of body +func NewEngineApiEngineServiceCleanRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/engine_api.EngineService/Clean") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewEngineApiEngineServiceCreateEnclaveRequest calls the generic EngineApiEngineServiceCreateEnclave builder with application/json body +func NewEngineApiEngineServiceCreateEnclaveRequest(server string, body EngineApiEngineServiceCreateEnclaveJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewEngineApiEngineServiceCreateEnclaveRequestWithBody(server, "application/json", bodyReader) +} + +// NewEngineApiEngineServiceCreateEnclaveRequestWithBody generates requests for EngineApiEngineServiceCreateEnclave with any type of body +func NewEngineApiEngineServiceCreateEnclaveRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/engine_api.EngineService/CreateEnclave") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewEngineApiEngineServiceDestroyEnclaveRequest calls the generic EngineApiEngineServiceDestroyEnclave builder with application/json body +func NewEngineApiEngineServiceDestroyEnclaveRequest(server string, body EngineApiEngineServiceDestroyEnclaveJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewEngineApiEngineServiceDestroyEnclaveRequestWithBody(server, "application/json", bodyReader) +} + +// NewEngineApiEngineServiceDestroyEnclaveRequestWithBody generates requests for EngineApiEngineServiceDestroyEnclave with any type of body +func NewEngineApiEngineServiceDestroyEnclaveRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/engine_api.EngineService/DestroyEnclave") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewEngineApiEngineServiceGetEnclavesRequest calls the generic EngineApiEngineServiceGetEnclaves builder with application/json body +func NewEngineApiEngineServiceGetEnclavesRequest(server string, body EngineApiEngineServiceGetEnclavesJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewEngineApiEngineServiceGetEnclavesRequestWithBody(server, "application/json", bodyReader) +} + +// NewEngineApiEngineServiceGetEnclavesRequestWithBody generates requests for EngineApiEngineServiceGetEnclaves with any type of body +func NewEngineApiEngineServiceGetEnclavesRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/engine_api.EngineService/GetEnclaves") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewEngineApiEngineServiceGetEngineInfoRequest calls the generic EngineApiEngineServiceGetEngineInfo builder with application/json body +func NewEngineApiEngineServiceGetEngineInfoRequest(server string, body EngineApiEngineServiceGetEngineInfoJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewEngineApiEngineServiceGetEngineInfoRequestWithBody(server, "application/json", bodyReader) +} + +// NewEngineApiEngineServiceGetEngineInfoRequestWithBody generates requests for EngineApiEngineServiceGetEngineInfo with any type of body +func NewEngineApiEngineServiceGetEngineInfoRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/engine_api.EngineService/GetEngineInfo") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewEngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersRequest calls the generic EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiers builder with application/json body +func NewEngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersRequest(server string, body EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewEngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersRequestWithBody(server, "application/json", bodyReader) +} + +// NewEngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersRequestWithBody generates requests for EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiers with any type of body +func NewEngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/engine_api.EngineService/GetExistingAndHistoricalEnclaveIdentifiers") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewEngineApiEngineServiceGetServiceLogsRequest calls the generic EngineApiEngineServiceGetServiceLogs builder with application/json body +func NewEngineApiEngineServiceGetServiceLogsRequest(server string, body EngineApiEngineServiceGetServiceLogsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewEngineApiEngineServiceGetServiceLogsRequestWithBody(server, "application/json", bodyReader) +} + +// NewEngineApiEngineServiceGetServiceLogsRequestWithBody generates requests for EngineApiEngineServiceGetServiceLogs with any type of body +func NewEngineApiEngineServiceGetServiceLogsRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/engine_api.EngineService/GetServiceLogs") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewEngineApiEngineServiceStopEnclaveRequest calls the generic EngineApiEngineServiceStopEnclave builder with application/json body +func NewEngineApiEngineServiceStopEnclaveRequest(server string, body EngineApiEngineServiceStopEnclaveJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewEngineApiEngineServiceStopEnclaveRequestWithBody(server, "application/json", bodyReader) +} + +// NewEngineApiEngineServiceStopEnclaveRequestWithBody generates requests for EngineApiEngineServiceStopEnclave with any type of body +func NewEngineApiEngineServiceStopEnclaveRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/engine_api.EngineService/StopEnclave") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error { + for _, r := range c.RequestEditors { + if err := r(ctx, req); err != nil { + return err + } + } + for _, r := range additionalEditors { + if err := r(ctx, req); err != nil { + return err + } + } + return nil +} + +// ClientWithResponses builds on ClientInterface to offer response payloads +type ClientWithResponses struct { + ClientInterface +} + +// NewClientWithResponses creates a new ClientWithResponses, which wraps +// Client with return type handling +func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error) { + client, err := NewClient(server, opts...) + if err != nil { + return nil, err + } + return &ClientWithResponses{client}, nil +} + +// WithBaseURL overrides the baseURL. +func WithBaseURL(baseURL string) ClientOption { + return func(c *Client) error { + newBaseURL, err := url.Parse(baseURL) + if err != nil { + return err + } + c.Server = newBaseURL.String() + return nil + } +} + +// ClientWithResponsesInterface is the interface specification for the client with responses above. +type ClientWithResponsesInterface interface { + // EngineApiEngineServiceCleanWithBodyWithResponse request with any body + EngineApiEngineServiceCleanWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceCleanResponse, error) + + EngineApiEngineServiceCleanWithResponse(ctx context.Context, body EngineApiEngineServiceCleanJSONRequestBody, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceCleanResponse, error) + + // EngineApiEngineServiceCreateEnclaveWithBodyWithResponse request with any body + EngineApiEngineServiceCreateEnclaveWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceCreateEnclaveResponse, error) + + EngineApiEngineServiceCreateEnclaveWithResponse(ctx context.Context, body EngineApiEngineServiceCreateEnclaveJSONRequestBody, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceCreateEnclaveResponse, error) + + // EngineApiEngineServiceDestroyEnclaveWithBodyWithResponse request with any body + EngineApiEngineServiceDestroyEnclaveWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceDestroyEnclaveResponse, error) + + EngineApiEngineServiceDestroyEnclaveWithResponse(ctx context.Context, body EngineApiEngineServiceDestroyEnclaveJSONRequestBody, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceDestroyEnclaveResponse, error) + + // EngineApiEngineServiceGetEnclavesWithBodyWithResponse request with any body + EngineApiEngineServiceGetEnclavesWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceGetEnclavesResponse, error) + + EngineApiEngineServiceGetEnclavesWithResponse(ctx context.Context, body EngineApiEngineServiceGetEnclavesJSONRequestBody, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceGetEnclavesResponse, error) + + // EngineApiEngineServiceGetEngineInfoWithBodyWithResponse request with any body + EngineApiEngineServiceGetEngineInfoWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceGetEngineInfoResponse, error) + + EngineApiEngineServiceGetEngineInfoWithResponse(ctx context.Context, body EngineApiEngineServiceGetEngineInfoJSONRequestBody, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceGetEngineInfoResponse, error) + + // EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersWithBodyWithResponse request with any body + EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersResponse, error) + + EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersWithResponse(ctx context.Context, body EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersJSONRequestBody, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersResponse, error) + + // EngineApiEngineServiceGetServiceLogsWithBodyWithResponse request with any body + EngineApiEngineServiceGetServiceLogsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceGetServiceLogsResponse, error) + + EngineApiEngineServiceGetServiceLogsWithResponse(ctx context.Context, body EngineApiEngineServiceGetServiceLogsJSONRequestBody, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceGetServiceLogsResponse, error) + + // EngineApiEngineServiceStopEnclaveWithBodyWithResponse request with any body + EngineApiEngineServiceStopEnclaveWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceStopEnclaveResponse, error) + + EngineApiEngineServiceStopEnclaveWithResponse(ctx context.Context, body EngineApiEngineServiceStopEnclaveJSONRequestBody, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceStopEnclaveResponse, error) +} + +type EngineApiEngineServiceCleanResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r EngineApiEngineServiceCleanResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r EngineApiEngineServiceCleanResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type EngineApiEngineServiceCreateEnclaveResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r EngineApiEngineServiceCreateEnclaveResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r EngineApiEngineServiceCreateEnclaveResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type EngineApiEngineServiceDestroyEnclaveResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r EngineApiEngineServiceDestroyEnclaveResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r EngineApiEngineServiceDestroyEnclaveResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type EngineApiEngineServiceGetEnclavesResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r EngineApiEngineServiceGetEnclavesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r EngineApiEngineServiceGetEnclavesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type EngineApiEngineServiceGetEngineInfoResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r EngineApiEngineServiceGetEngineInfoResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r EngineApiEngineServiceGetEngineInfoResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type EngineApiEngineServiceGetServiceLogsResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r EngineApiEngineServiceGetServiceLogsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r EngineApiEngineServiceGetServiceLogsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type EngineApiEngineServiceStopEnclaveResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r EngineApiEngineServiceStopEnclaveResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r EngineApiEngineServiceStopEnclaveResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// EngineApiEngineServiceCleanWithBodyWithResponse request with arbitrary body returning *EngineApiEngineServiceCleanResponse +func (c *ClientWithResponses) EngineApiEngineServiceCleanWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceCleanResponse, error) { + rsp, err := c.EngineApiEngineServiceCleanWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseEngineApiEngineServiceCleanResponse(rsp) +} + +func (c *ClientWithResponses) EngineApiEngineServiceCleanWithResponse(ctx context.Context, body EngineApiEngineServiceCleanJSONRequestBody, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceCleanResponse, error) { + rsp, err := c.EngineApiEngineServiceClean(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseEngineApiEngineServiceCleanResponse(rsp) +} + +// EngineApiEngineServiceCreateEnclaveWithBodyWithResponse request with arbitrary body returning *EngineApiEngineServiceCreateEnclaveResponse +func (c *ClientWithResponses) EngineApiEngineServiceCreateEnclaveWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceCreateEnclaveResponse, error) { + rsp, err := c.EngineApiEngineServiceCreateEnclaveWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseEngineApiEngineServiceCreateEnclaveResponse(rsp) +} + +func (c *ClientWithResponses) EngineApiEngineServiceCreateEnclaveWithResponse(ctx context.Context, body EngineApiEngineServiceCreateEnclaveJSONRequestBody, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceCreateEnclaveResponse, error) { + rsp, err := c.EngineApiEngineServiceCreateEnclave(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseEngineApiEngineServiceCreateEnclaveResponse(rsp) +} + +// EngineApiEngineServiceDestroyEnclaveWithBodyWithResponse request with arbitrary body returning *EngineApiEngineServiceDestroyEnclaveResponse +func (c *ClientWithResponses) EngineApiEngineServiceDestroyEnclaveWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceDestroyEnclaveResponse, error) { + rsp, err := c.EngineApiEngineServiceDestroyEnclaveWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseEngineApiEngineServiceDestroyEnclaveResponse(rsp) +} + +func (c *ClientWithResponses) EngineApiEngineServiceDestroyEnclaveWithResponse(ctx context.Context, body EngineApiEngineServiceDestroyEnclaveJSONRequestBody, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceDestroyEnclaveResponse, error) { + rsp, err := c.EngineApiEngineServiceDestroyEnclave(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseEngineApiEngineServiceDestroyEnclaveResponse(rsp) +} + +// EngineApiEngineServiceGetEnclavesWithBodyWithResponse request with arbitrary body returning *EngineApiEngineServiceGetEnclavesResponse +func (c *ClientWithResponses) EngineApiEngineServiceGetEnclavesWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceGetEnclavesResponse, error) { + rsp, err := c.EngineApiEngineServiceGetEnclavesWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseEngineApiEngineServiceGetEnclavesResponse(rsp) +} + +func (c *ClientWithResponses) EngineApiEngineServiceGetEnclavesWithResponse(ctx context.Context, body EngineApiEngineServiceGetEnclavesJSONRequestBody, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceGetEnclavesResponse, error) { + rsp, err := c.EngineApiEngineServiceGetEnclaves(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseEngineApiEngineServiceGetEnclavesResponse(rsp) +} + +// EngineApiEngineServiceGetEngineInfoWithBodyWithResponse request with arbitrary body returning *EngineApiEngineServiceGetEngineInfoResponse +func (c *ClientWithResponses) EngineApiEngineServiceGetEngineInfoWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceGetEngineInfoResponse, error) { + rsp, err := c.EngineApiEngineServiceGetEngineInfoWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseEngineApiEngineServiceGetEngineInfoResponse(rsp) +} + +func (c *ClientWithResponses) EngineApiEngineServiceGetEngineInfoWithResponse(ctx context.Context, body EngineApiEngineServiceGetEngineInfoJSONRequestBody, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceGetEngineInfoResponse, error) { + rsp, err := c.EngineApiEngineServiceGetEngineInfo(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseEngineApiEngineServiceGetEngineInfoResponse(rsp) +} + +// EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersWithBodyWithResponse request with arbitrary body returning *EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersResponse +func (c *ClientWithResponses) EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersResponse, error) { + rsp, err := c.EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseEngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersResponse(rsp) +} + +func (c *ClientWithResponses) EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersWithResponse(ctx context.Context, body EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersJSONRequestBody, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersResponse, error) { + rsp, err := c.EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiers(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseEngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersResponse(rsp) +} + +// EngineApiEngineServiceGetServiceLogsWithBodyWithResponse request with arbitrary body returning *EngineApiEngineServiceGetServiceLogsResponse +func (c *ClientWithResponses) EngineApiEngineServiceGetServiceLogsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceGetServiceLogsResponse, error) { + rsp, err := c.EngineApiEngineServiceGetServiceLogsWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseEngineApiEngineServiceGetServiceLogsResponse(rsp) +} + +func (c *ClientWithResponses) EngineApiEngineServiceGetServiceLogsWithResponse(ctx context.Context, body EngineApiEngineServiceGetServiceLogsJSONRequestBody, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceGetServiceLogsResponse, error) { + rsp, err := c.EngineApiEngineServiceGetServiceLogs(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseEngineApiEngineServiceGetServiceLogsResponse(rsp) +} + +// EngineApiEngineServiceStopEnclaveWithBodyWithResponse request with arbitrary body returning *EngineApiEngineServiceStopEnclaveResponse +func (c *ClientWithResponses) EngineApiEngineServiceStopEnclaveWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceStopEnclaveResponse, error) { + rsp, err := c.EngineApiEngineServiceStopEnclaveWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseEngineApiEngineServiceStopEnclaveResponse(rsp) +} + +func (c *ClientWithResponses) EngineApiEngineServiceStopEnclaveWithResponse(ctx context.Context, body EngineApiEngineServiceStopEnclaveJSONRequestBody, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceStopEnclaveResponse, error) { + rsp, err := c.EngineApiEngineServiceStopEnclave(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseEngineApiEngineServiceStopEnclaveResponse(rsp) +} + +// ParseEngineApiEngineServiceCleanResponse parses an HTTP response from a EngineApiEngineServiceCleanWithResponse call +func ParseEngineApiEngineServiceCleanResponse(rsp *http.Response) (*EngineApiEngineServiceCleanResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &EngineApiEngineServiceCleanResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + +// ParseEngineApiEngineServiceCreateEnclaveResponse parses an HTTP response from a EngineApiEngineServiceCreateEnclaveWithResponse call +func ParseEngineApiEngineServiceCreateEnclaveResponse(rsp *http.Response) (*EngineApiEngineServiceCreateEnclaveResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &EngineApiEngineServiceCreateEnclaveResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + +// ParseEngineApiEngineServiceDestroyEnclaveResponse parses an HTTP response from a EngineApiEngineServiceDestroyEnclaveWithResponse call +func ParseEngineApiEngineServiceDestroyEnclaveResponse(rsp *http.Response) (*EngineApiEngineServiceDestroyEnclaveResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &EngineApiEngineServiceDestroyEnclaveResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + +// ParseEngineApiEngineServiceGetEnclavesResponse parses an HTTP response from a EngineApiEngineServiceGetEnclavesWithResponse call +func ParseEngineApiEngineServiceGetEnclavesResponse(rsp *http.Response) (*EngineApiEngineServiceGetEnclavesResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &EngineApiEngineServiceGetEnclavesResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + +// ParseEngineApiEngineServiceGetEngineInfoResponse parses an HTTP response from a EngineApiEngineServiceGetEngineInfoWithResponse call +func ParseEngineApiEngineServiceGetEngineInfoResponse(rsp *http.Response) (*EngineApiEngineServiceGetEngineInfoResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &EngineApiEngineServiceGetEngineInfoResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + +// ParseEngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersResponse parses an HTTP response from a EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersWithResponse call +func ParseEngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersResponse(rsp *http.Response) (*EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + +// ParseEngineApiEngineServiceGetServiceLogsResponse parses an HTTP response from a EngineApiEngineServiceGetServiceLogsWithResponse call +func ParseEngineApiEngineServiceGetServiceLogsResponse(rsp *http.Response) (*EngineApiEngineServiceGetServiceLogsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &EngineApiEngineServiceGetServiceLogsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + +// ParseEngineApiEngineServiceStopEnclaveResponse parses an HTTP response from a EngineApiEngineServiceStopEnclaveWithResponse call +func ParseEngineApiEngineServiceStopEnclaveResponse(rsp *http.Response) (*EngineApiEngineServiceStopEnclaveResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &EngineApiEngineServiceStopEnclaveResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + +// ServerInterface represents all server handlers. +type ServerInterface interface { + + // (POST /engine_api.EngineService/Clean) + EngineApiEngineServiceClean(ctx echo.Context) error + + // (POST /engine_api.EngineService/CreateEnclave) + EngineApiEngineServiceCreateEnclave(ctx echo.Context) error + + // (POST /engine_api.EngineService/DestroyEnclave) + EngineApiEngineServiceDestroyEnclave(ctx echo.Context) error + + // (POST /engine_api.EngineService/GetEnclaves) + EngineApiEngineServiceGetEnclaves(ctx echo.Context) error + + // (POST /engine_api.EngineService/GetEngineInfo) + EngineApiEngineServiceGetEngineInfo(ctx echo.Context) error + + // (POST /engine_api.EngineService/GetExistingAndHistoricalEnclaveIdentifiers) + EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiers(ctx echo.Context) error + + // (POST /engine_api.EngineService/GetServiceLogs) + EngineApiEngineServiceGetServiceLogs(ctx echo.Context) error + + // (POST /engine_api.EngineService/StopEnclave) + EngineApiEngineServiceStopEnclave(ctx echo.Context) error +} + +// ServerInterfaceWrapper converts echo contexts to parameters. +type ServerInterfaceWrapper struct { + Handler ServerInterface +} + +// EngineApiEngineServiceClean converts echo context to params. +func (w *ServerInterfaceWrapper) EngineApiEngineServiceClean(ctx echo.Context) error { + var err error + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.EngineApiEngineServiceClean(ctx) + return err +} + +// EngineApiEngineServiceCreateEnclave converts echo context to params. +func (w *ServerInterfaceWrapper) EngineApiEngineServiceCreateEnclave(ctx echo.Context) error { + var err error + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.EngineApiEngineServiceCreateEnclave(ctx) + return err +} + +// EngineApiEngineServiceDestroyEnclave converts echo context to params. +func (w *ServerInterfaceWrapper) EngineApiEngineServiceDestroyEnclave(ctx echo.Context) error { + var err error + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.EngineApiEngineServiceDestroyEnclave(ctx) + return err +} + +// EngineApiEngineServiceGetEnclaves converts echo context to params. +func (w *ServerInterfaceWrapper) EngineApiEngineServiceGetEnclaves(ctx echo.Context) error { + var err error + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.EngineApiEngineServiceGetEnclaves(ctx) + return err +} + +// EngineApiEngineServiceGetEngineInfo converts echo context to params. +func (w *ServerInterfaceWrapper) EngineApiEngineServiceGetEngineInfo(ctx echo.Context) error { + var err error + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.EngineApiEngineServiceGetEngineInfo(ctx) + return err +} + +// EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiers converts echo context to params. +func (w *ServerInterfaceWrapper) EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiers(ctx echo.Context) error { + var err error + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiers(ctx) + return err +} + +// EngineApiEngineServiceGetServiceLogs converts echo context to params. +func (w *ServerInterfaceWrapper) EngineApiEngineServiceGetServiceLogs(ctx echo.Context) error { + var err error + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.EngineApiEngineServiceGetServiceLogs(ctx) + return err +} + +// EngineApiEngineServiceStopEnclave converts echo context to params. +func (w *ServerInterfaceWrapper) EngineApiEngineServiceStopEnclave(ctx echo.Context) error { + var err error + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.EngineApiEngineServiceStopEnclave(ctx) + return err +} + +// This is a simple interface which specifies echo.Route addition functions which +// are present on both echo.Echo and echo.Group, since we want to allow using +// either of them for path registration +type EchoRouter interface { + CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route +} + +// RegisterHandlers adds each server route to the EchoRouter. +func RegisterHandlers(router EchoRouter, si ServerInterface) { + RegisterHandlersWithBaseURL(router, si, "") +} + +// Registers handlers, and prepends BaseURL to the paths, so that the paths +// can be served under a prefix. +func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string) { + + wrapper := ServerInterfaceWrapper{ + Handler: si, + } + + router.POST(baseURL+"/engine_api.EngineService/Clean", wrapper.EngineApiEngineServiceClean) + router.POST(baseURL+"/engine_api.EngineService/CreateEnclave", wrapper.EngineApiEngineServiceCreateEnclave) + router.POST(baseURL+"/engine_api.EngineService/DestroyEnclave", wrapper.EngineApiEngineServiceDestroyEnclave) + router.POST(baseURL+"/engine_api.EngineService/GetEnclaves", wrapper.EngineApiEngineServiceGetEnclaves) + router.POST(baseURL+"/engine_api.EngineService/GetEngineInfo", wrapper.EngineApiEngineServiceGetEngineInfo) + router.POST(baseURL+"/engine_api.EngineService/GetExistingAndHistoricalEnclaveIdentifiers", wrapper.EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiers) + router.POST(baseURL+"/engine_api.EngineService/GetServiceLogs", wrapper.EngineApiEngineServiceGetServiceLogs) + router.POST(baseURL+"/engine_api.EngineService/StopEnclave", wrapper.EngineApiEngineServiceStopEnclave) + +} + +// Base64 encoded, gzipped, json marshaled Swagger object +var swaggerSpec = []string{ + + "H4sIAAAAAAAC/+xaX2/jNhL/KgPdAbtbqEm6e+hDgD7kNr7UuMYONs5dD3Uh0NJYYpcmdSQV1yjy3Q9D", + "UbJkyX93s7lebx8WjjgcDmd+M5wZ8rcgVotcSZTWBJe/BRr/XaCxf1UJR/chVSoVeJZrZdWsmJ8NFrld", + "0UCspEVp6SfLc8FjZrmS578YJembiTNcMPr1Z43z4DL40/l6pfNy1Jz3c396egqdJFxjElxaXSB98ZOI", + "J8qUS4xYzs/eC2TySqfue4Im1jwnSYLL4Ltn/TeV7zUyizCQsWCPOJXPu14QBrlWOWrrTWMyVYgkikkB", + "EROiq4DhHEh5IQwtLLkQ4GgBH1GCzRB0ISWXKWC5AxOEgV3lGFwGM6WINCC9+09q9gvGNngKO9r/gCZX", + "0iAJ0BZR40I9YhL5BSLJFhgxmURFwZMei3n6SiAgemAygZI+DLjFhdmHqoZ83jYjtsArmTwUPAnWO2Ja", + "s9X+LTore0Z/SKCxnEfk7oxL1JFQaSTwEXvwNskQru6GUBODUCmUxLWSjdVcpqTkNt9H1IYrGVmW9nPm", + "C5YiWJaCmjv4tpeyGbNQ+gTMEAqDCXBpeIKOGCvlDecwE0x+DEuXKEw5nuCcFcKCF6NkV04kKIBB/Yia", + "yE3fXpoI7xffYdlLLnEJfy+0VYabyqx9XBcqwePRfkuzjoL1dg+u9sXlXB0vyZBm7ZPkGo3VavWiHuZl", + "eDEXq9WcoLR8zlFv8YF6/DWFxJAAry1KLENk6FD2poJZDbEqnlo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qHKULOfBZfDu7OLsgszEbOYkaBcJ", + "9NMfwefuPZDbqTK2a7YbtAZ02QFQImk+PCpDI1dymLjuGnG9ynmLfck9bLxS+3xP0XqflDnF/Y+/9dl4", + "aEcfyhzKmfrtxcWGir86/+p0rdb5WY9m6dtTuAtczScr20H23BbyAsAtkyzFBUr73FaqUGFcd7n36dBB", + "7tPS3/O7Uefh3P/d6TO6U+/7rVPcqv3+artfeToDTK5vzeoLOiommbZ8zuLylYeKuatdltxmwO2BGN0Q", + "5tlB2vP47AVQ+uWfnz0rTHc86z4Sm40m+HZgfnDtDNO6L2MzVfj3m76Remyy0Vy6A8O+3bfezm/TwbPF", + "g77rgpM1njae9PXrfCCTXHFpXRWeorXl44BeAzh2jWtPJoyCZdkNKd/fKnhEzeerzqvb8sVDrBa4frpy", + "jP3qjfxeLNi5aDnVhoddH5ziVBTpa6eaFhcXb7+FrF7jFDc7UNbfiQ2PvLg50cCNpufOeqvuA/qO9YE2", + "abJ/9kO455boBQ7hl7on+lIZ45ZO+Sn4azSotoOPiIyLFq1HaY308UA4Nld7dixu9t5eAIhfuPv2X5QK", + "Pj39JwAA//9424DrkTgAAA==", +} + +// GetSwagger returns the content of the embedded swagger specification file +// or error if failed to decode +func decodeSpec() ([]byte, error) { + zipped, err := base64.StdEncoding.DecodeString(strings.Join(swaggerSpec, "")) + if err != nil { + return nil, fmt.Errorf("error base64 decoding spec: %w", err) + } + zr, err := gzip.NewReader(bytes.NewReader(zipped)) + if err != nil { + return nil, fmt.Errorf("error decompressing spec: %w", err) + } + var buf bytes.Buffer + _, err = buf.ReadFrom(zr) + if err != nil { + return nil, fmt.Errorf("error decompressing spec: %w", err) + } + + return buf.Bytes(), nil +} + +var rawSpec = decodeSpecCached() + +// a naive cached of a decoded swagger spec +func decodeSpecCached() func() ([]byte, error) { + data, err := decodeSpec() + return func() ([]byte, error) { + return data, err + } +} + +// Constructs a synthetic filesystem for resolving external references when loading openapi specifications. +func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error) { + res := make(map[string]func() ([]byte, error)) + if len(pathToFile) > 0 { + res[pathToFile] = rawSpec + } + + return res +} + +// GetSwagger returns the Swagger specification corresponding to the generated code +// in this file. The external references of Swagger specification are resolved. +// The logic of resolving external references is tightly connected to "import-mapping" feature. +// Externally referenced files must be embedded in the corresponding golang packages. +// Urls can be supported but this task was out of the scope. +func GetSwagger() (swagger *openapi3.T, err error) { + resolvePath := PathToRawSpec("") + + loader := openapi3.NewLoader() + loader.IsExternalRefsAllowed = true + loader.ReadFromURIFunc = func(loader *openapi3.Loader, url *url.URL) ([]byte, error) { + pathToFile := url.String() + pathToFile = path.Clean(pathToFile) + getSpec, ok := resolvePath[pathToFile] + if !ok { + err1 := fmt.Errorf("path not found: %s", pathToFile) + return nil, err1 + } + return getSpec() + } + var specData []byte + specData, err = rawSpec() + if err != nil { + return + } + swagger, err = loader.LoadFromData(specData) + if err != nil { + return + } + return +} diff --git a/api/golang/go.mod b/api/golang/go.mod index 4a9e8dec11..35295612f9 100644 --- a/api/golang/go.mod +++ b/api/golang/go.mod @@ -26,18 +26,26 @@ require ( github.com/andybalholm/brotli v1.0.4 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5 // indirect + github.com/getkin/kin-openapi v0.120.0 // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/uuid v1.3.0 // indirect github.com/klauspost/compress v1.16.7 // indirect github.com/klauspost/pgzip v1.2.5 // indirect github.com/kr/text v0.2.0 // indirect + github.com/labstack/echo/v4 v4.11.3 // indirect + github.com/labstack/gommon v0.4.0 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.19 // indirect github.com/nwaples/rardecode v1.1.3 // indirect github.com/pierrec/lz4/v4 v4.1.15 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/stretchr/objx v0.5.0 // indirect github.com/ulikunitz/xz v0.5.10 // indirect + github.com/valyala/bytebufferpool v1.0.0 // indirect + github.com/valyala/fasttemplate v1.2.2 // indirect github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect + golang.org/x/crypto v0.14.0 // indirect golang.org/x/net v0.17.0 // indirect golang.org/x/sys v0.13.0 // indirect golang.org/x/text v0.13.0 // indirect diff --git a/api/golang/go.sum b/api/golang/go.sum index e65d42e76d..66e98011cd 100644 --- a/api/golang/go.sum +++ b/api/golang/go.sum @@ -14,6 +14,8 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5 h1:iFaUwBSo5Svw6L7HYpRu/0lE3e0BaElwnNO1qkNQxBY= github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5/go.mod h1:qssHWj60/X5sZFNxpG4HBPDHVqxNm4DfnCKgrbZOT+s= github.com/dsnet/golib v0.0.0-20171103203638-1ea166775780/go.mod h1:Lj+Z9rebOhdfkVLjJ8T6VcRQv3SXugXy999NBtR9aFY= +github.com/getkin/kin-openapi v0.120.0 h1:MqJcNJFrMDFNc07iwE8iFC5eT2k/NPUFDIpNeiZv8Jg= +github.com/getkin/kin-openapi v0.120.0/go.mod h1:PCWw/lfBrJY4HcdqE3jj+QFkaFK8ABoqo7PvqVhXXqw= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-yaml/yaml v2.1.0+incompatible h1:RYi2hDdss1u4YE7GwixGzWwVo47T8UQwnTLB6vQiq+o= @@ -46,6 +48,17 @@ github.com/kurtosis-tech/kurtosis/contexts-config-store v0.0.0-20230818184218-f4 github.com/kurtosis-tech/kurtosis/contexts-config-store v0.0.0-20230818184218-f4e3e773463b/go.mod h1:4pFdrRwDz5R+Fov2ZuTaPhAVgjA2jhGh1Izf832sX7A= github.com/kurtosis-tech/stacktrace v0.0.0-20211028211901-1c67a77b5409 h1:YQTATifMUwZEtZYb0LVA7DK2pj8s71iY8rzweuUQ5+g= github.com/kurtosis-tech/stacktrace v0.0.0-20211028211901-1c67a77b5409/go.mod h1:y5weVs5d9wXXHcDA1awRxkIhhHC1xxYJN8a7aXnE6S8= +github.com/labstack/echo/v4 v4.11.3 h1:Upyu3olaqSHkCjs1EJJwQ3WId8b8b1hxbogyommKktM= +github.com/labstack/echo/v4 v4.11.3/go.mod h1:UcGuQ8V6ZNRmSweBIJkPvGfwCMIlFmiqrPqiEBfPYws= +github.com/labstack/gommon v0.4.0 h1:y7cvthEAEbU0yHOf4axH8ZG2NH8knB9iNSoTO8dyIk8= +github.com/labstack/gommon v0.4.0/go.mod h1:uW6kP17uPlLJsD3ijUYn3/M5bAxtlZhMI6m3MFxTMTM= +github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= +github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mholt/archiver/v3 v3.5.1 h1:rDjOBX9JSF5BvoJGvjqK479aL70qh9DIpZCl+k7Clwo= github.com/mholt/archiver/v3 v3.5.1/go.mod h1:e3dqJ7H78uzsRSEACH1joayhuSyhnonssnDhppzS1L4= github.com/nwaples/rardecode v1.1.0/go.mod h1:5DzqNKiOdpKKBH87u8VlvAnPZMXcGRhxWkRpHbbfGS0= @@ -72,12 +85,24 @@ github.com/ulikunitz/xz v0.5.8/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oW github.com/ulikunitz/xz v0.5.9/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/ulikunitz/xz v0.5.10 h1:t92gobL9l3HE202wg3rlk19F6X+JOxl9BBrCCMYEYd8= github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= +github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= +github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= +github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= +github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo= +github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 h1:nIPpBwaJSVYIxUFsDv3M8ofmx9yWTog9BfvIu0q41lo= github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8/go.mod h1:HUYIGzjTL3rfEspMxjDjgmT5uz5wzYJKVo23qUhYTos= +golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= +golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211103235746-7861aae1554b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= @@ -100,5 +125,6 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntN gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/api/openapi/core/api_container_service.yaml b/api/openapi/core/api_container_service.yaml new file mode 100644 index 0000000000..c91511a8a2 --- /dev/null +++ b/api/openapi/core/api_container_service.yaml @@ -0,0 +1,904 @@ +openapi: 3.0.0 +info: + title: api_container_service + description: '' + version: '1' +paths: + /api_container_api.ApiContainerService/RunStarlarkScript: + post: + operationId: api_container_api.ApiContainerService.RunStarlarkScript + description: Executes a Starlark script on the user's behalf + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/api_container_api.RunStarlarkScriptArgs' + required: true + responses: + '200': + description: '' + content: + '*/*': + schema: + $ref: '#/components/schemas/api_container_api.StarlarkRunResponseLine' + /api_container_api.ApiContainerService/UploadStarlarkPackage: + post: + operationId: api_container_api.ApiContainerService.UploadStarlarkPackage + description: Uploads a Starlark package. This step is required before the package can be executed with RunStarlarkPackage + requestBody: + $ref: '#/components/requestBodies/api_container_api.StreamedDataChunk' + responses: + '200': + description: '' + content: + '*/*': + schema: + $ref: '#/components/schemas/google.protobuf.Empty' + /api_container_api.ApiContainerService/RunStarlarkPackage: + post: + operationId: api_container_api.ApiContainerService.RunStarlarkPackage + description: Executes a Starlark script on the user's behalf + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/api_container_api.RunStarlarkPackageArgs' + required: true + responses: + '200': + description: '' + content: + '*/*': + schema: + $ref: '#/components/schemas/api_container_api.StarlarkRunResponseLine' + /api_container_api.ApiContainerService/GetServices: + post: + operationId: api_container_api.ApiContainerService.GetServices + description: Returns the IDs of the current services in the enclave + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/api_container_api.GetServicesArgs' + description: |- + ============================================================================================== + Get Services + ============================================================================================== + required: true + responses: + '200': + description: '' + content: + '*/*': + schema: + $ref: '#/components/schemas/api_container_api.GetServicesResponse' + /api_container_api.ApiContainerService/GetExistingAndHistoricalServiceIdentifiers: + post: + operationId: api_container_api.ApiContainerService.GetExistingAndHistoricalServiceIdentifiers + description: Returns information about all existing & historical services + requestBody: + $ref: '#/components/requestBodies/google.protobuf.Empty' + responses: + '200': + description: '' + content: + '*/*': + schema: + $ref: '#/components/schemas/api_container_api.GetExistingAndHistoricalServiceIdentifiersResponse' + /api_container_api.ApiContainerService/ExecCommand: + post: + operationId: api_container_api.ApiContainerService.ExecCommand + description: Executes the given command inside a running container + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/api_container_api.ExecCommandArgs' + description: |- + ============================================================================================== + Exec Command + ============================================================================================== + required: true + responses: + '200': + description: '' + content: + '*/*': + schema: + $ref: '#/components/schemas/api_container_api.ExecCommandResponse' + /api_container_api.ApiContainerService/WaitForHttpGetEndpointAvailability: + post: + operationId: api_container_api.ApiContainerService.WaitForHttpGetEndpointAvailability + description: Block until the given HTTP endpoint returns available, calling it through a HTTP Get request + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/api_container_api.WaitForHttpGetEndpointAvailabilityArgs' + description: |- + ============================================================================================== + Wait For HTTP Get Endpoint Availability + ============================================================================================== + required: true + responses: + '200': + description: '' + content: + '*/*': + schema: + $ref: '#/components/schemas/google.protobuf.Empty' + /api_container_api.ApiContainerService/WaitForHttpPostEndpointAvailability: + post: + operationId: api_container_api.ApiContainerService.WaitForHttpPostEndpointAvailability + description: Block until the given HTTP endpoint returns available, calling it through a HTTP Post request + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/api_container_api.WaitForHttpPostEndpointAvailabilityArgs' + description: |- + ============================================================================================== + Wait For HTTP Post Endpoint Availability + ============================================================================================== + required: true + responses: + '200': + description: '' + content: + '*/*': + schema: + $ref: '#/components/schemas/google.protobuf.Empty' + /api_container_api.ApiContainerService/UploadFilesArtifact: + post: + operationId: api_container_api.ApiContainerService.UploadFilesArtifact + description: Uploads a files artifact to the Kurtosis File System + requestBody: + $ref: '#/components/requestBodies/api_container_api.StreamedDataChunk' + responses: + '200': + description: '' + content: + '*/*': + schema: + $ref: '#/components/schemas/api_container_api.UploadFilesArtifactResponse' + /api_container_api.ApiContainerService/DownloadFilesArtifact: + post: + operationId: api_container_api.ApiContainerService.DownloadFilesArtifact + description: Downloads a files artifact from the Kurtosis File System + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/api_container_api.DownloadFilesArtifactArgs' + description: |- + ============================================================================================== + Download Files Artifact + ============================================================================================== + required: true + responses: + '200': + description: '' + content: + '*/*': + schema: + $ref: '#/components/schemas/api_container_api.StreamedDataChunk' + /api_container_api.ApiContainerService/StoreWebFilesArtifact: + post: + operationId: api_container_api.ApiContainerService.StoreWebFilesArtifact + description: Tells the API container to download a files artifact from the web to the Kurtosis File System + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/api_container_api.StoreWebFilesArtifactArgs' + description: |- + ============================================================================================== + Store Web Files Artifact + ============================================================================================== + required: true + responses: + '200': + description: '' + content: + '*/*': + schema: + $ref: '#/components/schemas/api_container_api.StoreWebFilesArtifactResponse' + /api_container_api.ApiContainerService/StoreFilesArtifactFromService: + post: + operationId: api_container_api.ApiContainerService.StoreFilesArtifactFromService + description: Tells the API container to copy a files artifact from a service to the Kurtosis File System + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/api_container_api.StoreFilesArtifactFromServiceArgs' + required: true + responses: + '200': + description: '' + content: + '*/*': + schema: + $ref: '#/components/schemas/api_container_api.StoreFilesArtifactFromServiceResponse' + /api_container_api.ApiContainerService/ListFilesArtifactNamesAndUuids: + post: + operationId: api_container_api.ApiContainerService.ListFilesArtifactNamesAndUuids + description: '' + requestBody: + $ref: '#/components/requestBodies/google.protobuf.Empty' + responses: + '200': + description: '' + content: + '*/*': + schema: + $ref: '#/components/schemas/api_container_api.ListFilesArtifactNamesAndUuidsResponse' + /api_container_api.ApiContainerService/InspectFilesArtifactContents: + post: + operationId: api_container_api.ApiContainerService.InspectFilesArtifactContents + description: '' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/api_container_api.InspectFilesArtifactContentsRequest' + required: true + responses: + '200': + description: '' + content: + '*/*': + schema: + $ref: '#/components/schemas/api_container_api.InspectFilesArtifactContentsResponse' + /api_container_api.ApiContainerService/ConnectServices: + post: + operationId: api_container_api.ApiContainerService.ConnectServices + description: User services port forwarding + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/api_container_api.ConnectServicesArgs' + required: true + responses: + '200': + description: '' + content: + '*/*': + schema: + $ref: '#/components/schemas/api_container_api.ConnectServicesResponse' + /api_container_api.ApiContainerService/GetStarlarkRun: + post: + operationId: api_container_api.ApiContainerService.GetStarlarkRun + description: Get last Starlark run + requestBody: + $ref: '#/components/requestBodies/google.protobuf.Empty' + responses: + '200': + description: '' + content: + '*/*': + schema: + $ref: '#/components/schemas/api_container_api.GetStarlarkRunResponse' +components: + requestBodies: + api_container_api.StreamedDataChunk: + content: + application/json: + schema: + $ref: '#/components/schemas/api_container_api.StreamedDataChunk' + description: |- + ============================================================================================== + Streamed Data Chunk + ============================================================================================== + required: true + google.protobuf.Empty: + content: + application/json: + schema: + $ref: '#/components/schemas/google.protobuf.Empty' + required: true + schemas: + api_container_api.Port: + type: object + properties: + number: + type: integer + format: int32 + transport_protocol: + $ref: '#/components/schemas/api_container_api.Port.TransportProtocol' + maybe_application_protocol: + type: string + maybe_wait_timeout: + type: string + description: The wait timeout duration in string + description: |- + ============================================================================================== + Shared Objects (Used By Multiple Endpoints) + ============================================================================================== + api_container_api.Container: + type: object + properties: + status: + $ref: '#/components/schemas/api_container_api.Container.Status' + image_name: + type: string + entrypoint_args: + type: array + items: + type: string + cmd_args: + type: array + items: + type: string + env_vars: + type: object + additionalProperties: + type: string + api_container_api.ServiceStatus: + type: string + enum: + - STOPPED + - RUNNING + - UNKNOWN + description: |- + 0 - STOPPED + 1 - RUNNING + 2 - UNKNOWN + api_container_api.ImageDownloadMode: + type: string + enum: + - always + - missing + description: |- + 0 - always + 1 - missing + api_container_api.ServiceInfo: + type: object + properties: + service_uuid: + type: string + description: UUID of the service + private_ip_addr: + type: string + description: The IP address of the service inside the enclave + private_ports: + $ref: '#/components/schemas/api_container_api.Port' + maybe_public_ip_addr: + type: string + description: |- + Public IP address *outside* the enclave where the service is reachable + NOTE: Will be empty if the service isn't running, the service didn't define any ports, or the backend doesn't support reporting public service info + maybe_public_ports: + $ref: '#/components/schemas/api_container_api.Port' + name: + type: string + description: Name of the service + shortened_uuid: + type: string + description: Shortened uuid of the service + service_status: + $ref: '#/components/schemas/api_container_api.ServiceStatus' + container: + $ref: '#/components/schemas/api_container_api.Container' + api_container_api.Connect: + type: string + enum: + - CONNECT + - NO_CONNECT + description: |- + 0 - CONNECT // Best effort port forwarding + 1 - NO_CONNECT // Port forwarding disabled + api_container_api.RunStarlarkScriptArgs: + type: object + properties: + serialized_script: + type: string + serialized_params: + type: string + dry_run: + type: boolean + description: Defaults to false + parallelism: + type: integer + format: int32 + description: Defaults to 4 + main_function_name: + type: string + description: The name of the main function, the default value is "run" + experimental_features: + type: array + items: + $ref: '#/components/schemas/api_container_api.KurtosisFeatureFlag' + cloud_instance_id: + type: string + description: Defaults to empty + cloud_user_id: + type: string + description: Defaults to empty + image_download_mode: + $ref: '#/components/schemas/api_container_api.ImageDownloadMode' + api_container_api.RunStarlarkPackageArgs: + type: object + properties: + package_id: + type: string + local: + type: string + format: byte + description: the payload of the local module + remote: + type: boolean + description: just a flag to indicate the module must be cloned inside the API + serialized_params: + type: string + description: |- + Serialized parameters data for the Starlark package main function + This should be a valid JSON string + dry_run: + type: boolean + description: Defaults to false + parallelism: + type: integer + format: int32 + description: Defaults to 4 + clone_package: + type: boolean + description: |- + Whether the package should be cloned or not. + If false, then the package will be pulled from the APIC local package store. If it's a local package then is must + have been uploaded using UploadStarlarkPackage prior to calling RunStarlarkPackage. + If true, then the package will be cloned from GitHub before execution starts + relative_path_to_main_file: + type: string + description: The relative main file filepath, the default value is the "main.star" file in the root of a package + main_function_name: + type: string + description: The name of the main function, the default value is "run" + experimental_features: + type: array + items: + $ref: '#/components/schemas/api_container_api.KurtosisFeatureFlag' + cloud_instance_id: + type: string + description: Defaults to empty + cloud_user_id: + type: string + description: Defaults to empty + image_download_mode: + $ref: '#/components/schemas/api_container_api.ImageDownloadMode' + api_container_api.KurtosisFeatureFlag: + type: string + enum: + - NO_INSTRUCTIONS_CACHING + description: '0 - NO_INSTRUCTIONS_CACHING ' + api_container_api.StarlarkRunResponseLine: + type: object + properties: + instruction: + $ref: '#/components/schemas/api_container_api.StarlarkInstruction' + error: + $ref: '#/components/schemas/api_container_api.StarlarkError' + progress_info: + $ref: '#/components/schemas/api_container_api.StarlarkRunProgress' + instruction_result: + $ref: '#/components/schemas/api_container_api.StarlarkInstructionResult' + run_finished_event: + $ref: '#/components/schemas/api_container_api.StarlarkRunFinishedEvent' + warning: + $ref: '#/components/schemas/api_container_api.StarlarkWarning' + info: + $ref: '#/components/schemas/api_container_api.StarlarkInfo' + description: |- + ============================================================================================== + Starlark Execution Response + ============================================================================================== + api_container_api.StarlarkInfo: + type: object + properties: + info_message: + type: string + api_container_api.StarlarkWarning: + type: object + properties: + warning_message: + type: string + api_container_api.StarlarkInstruction: + type: object + properties: + position: + $ref: '#/components/schemas/api_container_api.StarlarkInstructionPosition' + instruction_name: + type: string + arguments: + type: array + items: + $ref: '#/components/schemas/api_container_api.StarlarkInstructionArg' + executable_instruction: + type: string + is_skipped: + type: boolean + api_container_api.StarlarkInstructionResult: + type: object + properties: + serialized_instruction_result: + type: string + api_container_api.StarlarkInstructionArg: + type: object + properties: + serialized_arg_value: + type: string + arg_name: + type: string + is_representative: + type: boolean + api_container_api.StarlarkInstructionPosition: + type: object + properties: + filename: + type: string + line: + type: integer + format: int32 + column: + type: integer + format: int32 + api_container_api.StarlarkError: + type: object + properties: + interpretation_error: + $ref: '#/components/schemas/api_container_api.StarlarkInterpretationError' + validation_error: + $ref: '#/components/schemas/api_container_api.StarlarkValidationError' + execution_error: + $ref: '#/components/schemas/api_container_api.StarlarkExecutionError' + api_container_api.StarlarkInterpretationError: + type: object + properties: + error_message: + type: string + api_container_api.StarlarkValidationError: + type: object + properties: + error_message: + type: string + api_container_api.StarlarkExecutionError: + type: object + properties: + error_message: + type: string + api_container_api.StarlarkRunProgress: + type: object + properties: + current_step_info: + type: array + items: + type: string + total_steps: + type: integer + format: int32 + current_step_number: + type: integer + format: int32 + api_container_api.StarlarkRunFinishedEvent: + type: object + properties: + is_run_successful: + type: boolean + serialized_output: + type: string + api_container_api.GetServicesArgs: + type: object + properties: + service_identifiers: + type: object + description: |- + "Set" of identifiers to fetch info for + If empty, will fetch info for all services + additionalProperties: + type: string + description: |- + ============================================================================================== + Get Services + ============================================================================================== + api_container_api.GetServicesResponse: + type: object + properties: + service_info: + $ref: '#/components/schemas/api_container_api.ServiceInfo' + api_container_api.ServiceIdentifiers: + type: object + properties: + service_uuid: + type: string + description: UUID of the service + name: + type: string + description: Name of the service + shortened_uuid: + type: string + description: The shortened uuid of the service + description: An service identifier is a collection of uuid, name and shortened uuid + api_container_api.GetExistingAndHistoricalServiceIdentifiersResponse: + type: object + properties: + allIdentifiers: + type: array + items: + $ref: '#/components/schemas/api_container_api.ServiceIdentifiers' + api_container_api.ExecCommandArgs: + type: object + properties: + service_identifier: + type: string + description: The service identifier of the container that the command should be executed in + command_args: + type: array + items: + type: string + description: |- + ============================================================================================== + Exec Command + ============================================================================================== + api_container_api.ExecCommandResponse: + type: object + properties: + exit_code: + type: integer + format: int32 + log_output: + type: string + description: Assumes UTF-8 encoding + api_container_api.WaitForHttpGetEndpointAvailabilityArgs: + type: object + properties: + service_identifier: + type: string + description: The identifier of the service to check. + port: + type: integer + format: int32 + description: The port of the service to check. For instance 8080 + path: + type: string + description: The path of the service to check. It mustn't start with the first slash. For instance `service/health` + initial_delay_milliseconds: + type: integer + format: int32 + description: The number of milliseconds to wait until executing the first HTTP call + retries: + type: integer + format: int32 + description: Max number of HTTP call attempts that this will execute until giving up and returning an error + retries_delay_milliseconds: + type: integer + format: int32 + description: Number of milliseconds to wait between retries + body_text: + type: string + description: If the endpoint returns this value, the service will be marked as available (e.g. Hello World). + description: |- + ============================================================================================== + Wait For HTTP Get Endpoint Availability + ============================================================================================== + api_container_api.WaitForHttpPostEndpointAvailabilityArgs: + type: object + properties: + service_identifier: + type: string + description: The identifier of the service to check. + port: + type: integer + format: int32 + description: The port of the service to check. For instance 8080 + path: + type: string + description: The path of the service to check. It mustn't start with the first slash. For instance `service/health` + request_body: + type: string + description: The content of the request body. + initial_delay_milliseconds: + type: integer + format: int32 + description: The number of milliseconds to wait until executing the first HTTP call + retries: + type: integer + format: int32 + description: Max number of HTTP call attempts that this will execute until giving up and returning an error + retries_delay_milliseconds: + type: integer + format: int32 + description: Number of milliseconds to wait between retries + body_text: + type: string + description: If the endpoint returns this value, the service will be marked as available (e.g. Hello World). + description: |- + ============================================================================================== + Wait For HTTP Post Endpoint Availability + ============================================================================================== + api_container_api.StreamedDataChunk: + type: object + properties: + data: + type: string + format: byte + description: Chunk of the overall files artifact bytes + previous_chunk_hash: + type: string + description: |- + Hash of the PREVIOUS chunk, or empty string is this is the first chunk + Referencing the previous chunk via its hash allows Kurtosis to validate + the consistency of the data in case some chunk were not received + metadata: + $ref: '#/components/schemas/api_container_api.DataChunkMetadata' + description: |- + ============================================================================================== + Streamed Data Chunk + ============================================================================================== + api_container_api.DataChunkMetadata: + type: object + properties: + name: + type: string + api_container_api.UploadFilesArtifactResponse: + type: object + properties: + uuid: + type: string + description: UUID of the files artifact, for use when referencing it in the future + name: + type: string + description: UUID of the files artifact, for use when referencing it in the future + description: |- + ============================================================================================== + Upload Files Artifact + ============================================================================================== + api_container_api.DownloadFilesArtifactArgs: + type: object + properties: + identifier: + type: string + description: Files identifier to get bytes for + description: |- + ============================================================================================== + Download Files Artifact + ============================================================================================== + api_container_api.StoreWebFilesArtifactArgs: + type: object + properties: + url: + type: string + description: URL to download the artifact from + name: + type: string + description: The name of the files artifact + description: |- + ============================================================================================== + Store Web Files Artifact + ============================================================================================== + api_container_api.StoreWebFilesArtifactResponse: + type: object + properties: + uuid: + type: string + description: UUID of the files artifact, for use when referencing it in the future + api_container_api.StoreFilesArtifactFromServiceArgs: + type: object + properties: + service_identifier: + type: string + description: Identifier that will be used to identify the service where the source files will be copied from + source_path: + type: string + description: The absolute source path where the source files will be copied from + name: + type: string + description: The name of the files artifact + api_container_api.StoreFilesArtifactFromServiceResponse: + type: object + properties: + uuid: + type: string + description: UUID of the files artifact, for use when referencing it in the future + api_container_api.FilesArtifactNameAndUuid: + type: object + properties: + fileName: + type: string + description: A string representing the name of the file + fileUuid: + type: string + description: A string representing the uuid of the file + api_container_api.ListFilesArtifactNamesAndUuidsResponse: + type: object + properties: + file_names_and_uuids: + type: array + items: + $ref: '#/components/schemas/api_container_api.FilesArtifactNameAndUuid' + api_container_api.InspectFilesArtifactContentsRequest: + type: object + properties: + file_names_and_uuid: + $ref: '#/components/schemas/api_container_api.FilesArtifactNameAndUuid' + api_container_api.InspectFilesArtifactContentsResponse: + type: object + properties: + file_descriptions: + type: array + items: + $ref: '#/components/schemas/api_container_api.FileArtifactContentsFileDescription' + api_container_api.FileArtifactContentsFileDescription: + type: object + properties: + path: + type: string + description: Path relative to the file artifact + size: + type: integer + format: int64 + description: Size of the file, in bytes + text_preview: + type: string + description: A bit of text content, if the file allows (similar to UNIX's 'head') + api_container_api.ConnectServicesArgs: + type: object + properties: + connect: + $ref: '#/components/schemas/api_container_api.Connect' + api_container_api.ConnectServicesResponse: + type: object + properties: {} + api_container_api.RestartPolicy: + type: string + enum: + - NEVER + - ALWAYS + description: |- + 0 - NEVER + 1 - ALWAYS + api_container_api.GetStarlarkRunResponse: + type: object + properties: + package_id: + type: string + serialized_script: + type: string + serialized_params: + type: string + parallelism: + type: integer + format: int32 + relative_path_to_main_file: + type: string + main_function_name: + type: string + experimental_features: + type: array + items: + $ref: '#/components/schemas/api_container_api.KurtosisFeatureFlag' + restart_policy: + $ref: '#/components/schemas/api_container_api.RestartPolicy' + api_container_api.Port.TransportProtocol: + type: string + enum: + - TCP + - SCTP + - UDP + description: |- + 0 - TCP + 1 - SCTP + 2 - UDP + api_container_api.Container.Status: + type: string + enum: + - STOPPED + - RUNNING + - UNKNOWN + description: |- + 0 - STOPPED + 1 - RUNNING + 2 - UNKNOWN + google.protobuf.Empty: + type: object + properties: {} diff --git a/api/openapi/engine/engine_service.yaml b/api/openapi/engine/engine_service.yaml new file mode 100644 index 0000000000..fdd18ab722 --- /dev/null +++ b/api/openapi/engine/engine_service.yaml @@ -0,0 +1,432 @@ +openapi: 3.0.0 +info: + title: engine_service + description: '' + version: '1' +paths: + /engine_api.EngineService/GetEngineInfo: + post: + operationId: engine_api.EngineService.GetEngineInfo + description: Endpoint for getting information about the engine, which is also what we use to verify that the engine has become available + requestBody: + $ref: '#/components/requestBodies/google.protobuf.Empty' + responses: + '200': + description: '' + content: + '*/*': + schema: + $ref: '#/components/schemas/engine_api.GetEngineInfoResponse' + /engine_api.EngineService/CreateEnclave: + post: + operationId: engine_api.EngineService.CreateEnclave + description: |- + ============================================================================================== + Enclave Management + ============================================================================================== + Creates a new Kurtosis Enclave + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/engine_api.CreateEnclaveArgs' + description: |- + ============================================================================================== + Create Enclave + ============================================================================================== + required: true + responses: + '200': + description: '' + content: + '*/*': + schema: + $ref: '#/components/schemas/engine_api.CreateEnclaveResponse' + /engine_api.EngineService/GetEnclaves: + post: + operationId: engine_api.EngineService.GetEnclaves + description: Returns information about the existing enclaves + requestBody: + $ref: '#/components/requestBodies/google.protobuf.Empty' + responses: + '200': + description: '' + content: + '*/*': + schema: + $ref: '#/components/schemas/engine_api.GetEnclavesResponse' + /engine_api.EngineService/GetExistingAndHistoricalEnclaveIdentifiers: + post: + operationId: engine_api.EngineService.GetExistingAndHistoricalEnclaveIdentifiers + description: Returns information about all existing & historical enclaves + requestBody: + $ref: '#/components/requestBodies/google.protobuf.Empty' + responses: + '200': + description: '' + content: + '*/*': + schema: + $ref: '#/components/schemas/engine_api.GetExistingAndHistoricalEnclaveIdentifiersResponse' + /engine_api.EngineService/StopEnclave: + post: + operationId: engine_api.EngineService.StopEnclave + description: Stops all containers in an enclave + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/engine_api.StopEnclaveArgs' + description: |- + ============================================================================================== + Stop Enclave + ============================================================================================== + required: true + responses: + '200': + description: '' + content: + '*/*': + schema: + $ref: '#/components/schemas/google.protobuf.Empty' + /engine_api.EngineService/DestroyEnclave: + post: + operationId: engine_api.EngineService.DestroyEnclave + description: Destroys an enclave, removing all artifacts associated with it + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/engine_api.DestroyEnclaveArgs' + description: |- + ============================================================================================== + Destroy Enclave + ============================================================================================== + required: true + responses: + '200': + description: '' + content: + '*/*': + schema: + $ref: '#/components/schemas/google.protobuf.Empty' + /engine_api.EngineService/Clean: + post: + operationId: engine_api.EngineService.Clean + description: Gets rid of old enclaves + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/engine_api.CleanArgs' + description: |- + ============================================================================================== + Create Enclave + ============================================================================================== + required: true + responses: + '200': + description: '' + content: + '*/*': + schema: + $ref: '#/components/schemas/engine_api.CleanResponse' + /engine_api.EngineService/GetServiceLogs: + post: + operationId: engine_api.EngineService.GetServiceLogs + description: Get service logs + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/engine_api.GetServiceLogsArgs' + description: |- + ============================================================================================== + Get User Service Logs + ============================================================================================== + required: true + responses: + '200': + description: '' + content: + '*/*': + schema: + $ref: '#/components/schemas/engine_api.GetServiceLogsResponse' +components: + requestBodies: + google.protobuf.Empty: + content: + application/json: + schema: + $ref: '#/components/schemas/google.protobuf.Empty' + required: true + schemas: + engine_api.GetEngineInfoResponse: + type: object + properties: + engine_version: + type: string + description: Version of the engine server + description: |- + ============================================================================================== + Get Engine Info + ============================================================================================== + engine_api.CreateEnclaveArgs: + type: object + properties: + enclave_name: + type: string + description: The name of the new Kurtosis Enclave + api_container_version_tag: + type: string + description: |- + The image tag of the API container that should be used inside the enclave + If blank, will use the default version that the engine server uses + api_container_log_level: + type: string + description: The API container log level + mode: + $ref: '#/components/schemas/engine_api.EnclaveMode' + description: |- + ============================================================================================== + Create Enclave + ============================================================================================== + engine_api.EnclaveMode: + type: string + enum: + - TEST + - PRODUCTION + description: |- + 0 - TEST + 1 - PRODUCTION + engine_api.CreateEnclaveResponse: + type: object + properties: + enclave_info: + $ref: '#/components/schemas/engine_api.EnclaveInfo' + engine_api.EnclaveContainersStatus: + type: string + enum: + - EnclaveContainersStatus_EMPTY + - EnclaveContainersStatus_RUNNING + - EnclaveContainersStatus_STOPPED + description: |- + 0 - EnclaveContainersStatus_EMPTY // The enclave has been created, but there are no containers inside it + 1 - EnclaveContainersStatus_RUNNING // One or more containers are running in the enclave (which may or may not include the API container, depending on if the user was manually stopping/removing containers) + 2 - EnclaveContainersStatus_STOPPED // There are >= 1 container in the enclave, but they're all stopped + engine_api.EnclaveAPIContainerStatus: + type: string + enum: + - EnclaveAPIContainerStatus_NONEXISTENT + - EnclaveAPIContainerStatus_RUNNING + - EnclaveAPIContainerStatus_STOPPED + description: |- + 0 - EnclaveAPIContainerStatus_NONEXISTENT // No API container exists in the enclave + This is the only valid value when the enclave containers status is "EMPTY" + 1 - EnclaveAPIContainerStatus_RUNNING // An API container exists and is running + NOTE: this does NOT say that the server inside the API container is available, because checking if it's available requires making a call to the API container + If we have a lot of API containers, we'd be making tons of calls + 2 - EnclaveAPIContainerStatus_STOPPED // An API container exists, but isn't running + engine_api.EnclaveAPIContainerInfo: + type: object + properties: + container_id: + type: string + description: The container engine ID of the API container + ip_inside_enclave: + type: string + description: The IP inside the enclave network of the API container (i.e. how services inside the network can reach the API container) + grpc_port_inside_enclave: + type: integer + format: int32 + description: The grpc port inside the enclave network that the API container is listening on + bridge_ip_address: + type: string + description: this is the bridge ip address that gets assigned to api container + engine_api.EnclaveAPIContainerHostMachineInfo: + type: object + properties: + ip_on_host_machine: + type: string + description: The interface IP on the container engine host machine where the API container can be reached + grpc_port_on_host_machine: + type: integer + format: int32 + description: The grpc port on the container engine host machine where the API container can be reached + description: Will only be present if the API container is running + engine_api.EnclaveInfo: + type: object + properties: + enclave_uuid: + type: string + description: UUID of the enclave + name: + type: string + description: Name of the enclave + shortened_uuid: + type: string + description: The shortened uuid of the enclave + containers_status: + $ref: '#/components/schemas/engine_api.EnclaveContainersStatus' + api_container_status: + $ref: '#/components/schemas/engine_api.EnclaveAPIContainerStatus' + api_container_info: + $ref: '#/components/schemas/engine_api.EnclaveAPIContainerInfo' + api_container_host_machine_info: + $ref: '#/components/schemas/engine_api.EnclaveAPIContainerHostMachineInfo' + creation_time: + $ref: '#/components/schemas/google.protobuf.Timestamp' + mode: + $ref: '#/components/schemas/engine_api.EnclaveMode' + description: Enclaves are defined by a network in the container system, which is why there's a bunch of network information here + engine_api.GetEnclavesResponse: + type: object + properties: + enclave_info: + $ref: '#/components/schemas/engine_api.EnclaveInfo' + engine_api.EnclaveIdentifiers: + type: object + properties: + enclave_uuid: + type: string + description: UUID of the enclave + name: + type: string + description: Name of the enclave + shortened_uuid: + type: string + description: The shortened uuid of the enclave + description: An enclave identifier is a collection of uuid, name and shortened uuid + engine_api.GetExistingAndHistoricalEnclaveIdentifiersResponse: + type: object + properties: + allIdentifiers: + type: array + items: + $ref: '#/components/schemas/engine_api.EnclaveIdentifiers' + engine_api.StopEnclaveArgs: + type: object + properties: + enclave_identifier: + type: string + description: The identifier(uuid, shortened uuid, name) of the Kurtosis enclave to stop + description: |- + ============================================================================================== + Stop Enclave + ============================================================================================== + engine_api.DestroyEnclaveArgs: + type: object + properties: + enclave_identifier: + type: string + description: The identifier(uuid, shortened uuid, name) of the Kurtosis enclave to destroy + description: |- + ============================================================================================== + Destroy Enclave + ============================================================================================== + engine_api.CleanArgs: + type: object + properties: + should_clean_all: + type: boolean + description: If true, It will clean even the running enclaves + description: |- + ============================================================================================== + Create Enclave + ============================================================================================== + engine_api.EnclaveNameAndUuid: + type: object + properties: + name: + type: string + uuid: + type: string + engine_api.CleanResponse: + type: object + properties: + removed_enclave_name_and_uuids: + type: array + items: + $ref: '#/components/schemas/engine_api.EnclaveNameAndUuid' + description: removed enclave name and uuids + engine_api.GetServiceLogsArgs: + type: object + properties: + enclave_identifier: + type: string + description: The identifier of the user service's Kurtosis Enclave + service_uuid_set: + type: object + description: '"Set" of service UUIDs in the enclave' + additionalProperties: + type: string + follow_logs: + type: boolean + description: If true, It will follow the container logs + conjunctive_filters: + type: array + items: + $ref: '#/components/schemas/engine_api.LogLineFilter' + description: The conjunctive log lines filters, the first filter is applied over the found log lines, the second filter is applied over the filter one result and so on (like grep) + return_all_logs: + type: boolean + description: If true, return all log lines + num_log_lines: + type: integer + format: int32 + description: If [return_all_logs] is false, return [num_log_lines] + description: |- + ============================================================================================== + Get User Service Logs + ============================================================================================== + engine_api.GetServiceLogsResponse: + type: object + properties: + service_logs_by_service_uuid: + $ref: '#/components/schemas/engine_api.LogLine' + not_found_service_uuid_set: + type: object + description: |- + A set of service GUIDs requested by the user that were not found in the logs database, could be related that users send + a wrong GUID or a right GUID for a service that has not sent any logs so far + additionalProperties: + type: string + engine_api.LogLine: + type: object + properties: + line: + type: array + items: + type: string + description: TODO add timestamp as well, for when we do timestamp-handling on the client side + engine_api.LogLineFilter: + type: object + properties: + operator: + $ref: '#/components/schemas/engine_api.LogLineOperator' + text_pattern: + type: string + engine_api.LogLineOperator: + type: string + enum: + - LogLineOperator_DOES_CONTAIN_TEXT + - LogLineOperator_DOES_NOT_CONTAIN_TEXT + - LogLineOperator_DOES_CONTAIN_MATCH_REGEX + - LogLineOperator_DOES_NOT_CONTAIN_MATCH_REGEX + description: |- + 0 - LogLineOperator_DOES_CONTAIN_TEXT + 1 - LogLineOperator_DOES_NOT_CONTAIN_TEXT + 2 - LogLineOperator_DOES_CONTAIN_MATCH_REGEX + 3 - LogLineOperator_DOES_NOT_CONTAIN_MATCH_REGEX + google.protobuf.Empty: + type: object + properties: {} + google.protobuf.Timestamp: + type: object + properties: + seconds: + type: integer + format: int64 + nanos: + type: integer + format: int32 diff --git a/flake.nix b/flake.nix index d4cf271ab5..4fefaf4234 100644 --- a/flake.nix +++ b/flake.nix @@ -67,6 +67,7 @@ protoc-gen-connect-go protoc-gen-grpc-web grpc-tools + oapi-codegen rustc cargo rustfmt diff --git a/go.work.sum b/go.work.sum index a359e4be31..145167678f 100644 --- a/go.work.sum +++ b/go.work.sum @@ -1,6 +1,15 @@ github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= +github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU= +github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= +github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY= +github.com/invopop/yaml v0.2.0 h1:7zky/qH+O0DwAyoobXUqvVBwgBFRxKoQ/3FjcVpjTMY= +github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= +github.com/perimeterx/marshmallow v1.1.5 h1:a2LALqQ1BlHM8PZblsDdidgv1mWi1DgC2UmX50IvK2s= +github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo= +github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/protobuf2swagger.config.js b/protobuf2swagger.config.js new file mode 100644 index 0000000000..e621b3d7ed --- /dev/null +++ b/protobuf2swagger.config.js @@ -0,0 +1,32 @@ +const rootFolder = './api/protobuf/core/'; +const fileNames = ['api_container_service.proto']; + +module.exports = { + files: fileNames.map(f => `${rootFolder}/${f}`), + dist: `${rootFolder}/topic-specifications.schema.json`, + long: 'number', + transform(type, result, args) { + switch (type) { + case 'enum': { + const [Enum] = args; + // console.log('enum:', Enum); + return { ...result, type: 'string', enum: Object.keys(Enum.values) }; + } + case 'message': { + const [Type] = args; + // looking for Map fields and converting them to { [key: string]: type; } + const map = Object.values(Type.fields || {}).filter(f => f.map && f.keyType === 'string'); + const newResult = { ...result }; + map.forEach(field => { + newResult.properties[field.name].type = 'object'; + newResult.properties[field.name].additionalProperties = { type: 'string' }; + }); + + // console.log('result', newResult); + return newResult; + } + } + return result; + } +}; + From e05ca91c5d88da99600ea7837f0b242319b7801e Mon Sep 17 00:00:00 2001 From: lostbean Date: Thu, 9 Nov 2023 18:41:20 -0300 Subject: [PATCH 02/95] make it restful --- .../api_container_service.gen.go | 2056 +++++++---------- ...ngine_service.go => engine_service.gen.go} | 0 api/golang/go.mod | 54 +- api/golang/go.sum | 158 ++ api/openapi/core/api_container_service.yaml | 607 +++-- go.work.sum | 19 +- 6 files changed, 1369 insertions(+), 1525 deletions(-) rename api/golang/engine/kurtosis_engine_http_api_bindings/{engine_service.go => engine_service.gen.go} (100%) diff --git a/api/golang/core/kurtosis_core_http_api_bindings/api_container_service.gen.go b/api/golang/core/kurtosis_core_http_api_bindings/api_container_service.gen.go index d46c2fd6eb..3777282d2a 100644 --- a/api/golang/core/kurtosis_core_http_api_bindings/api_container_service.gen.go +++ b/api/golang/core/kurtosis_core_http_api_bindings/api_container_service.gen.go @@ -16,70 +16,77 @@ import ( "path" "strings" + "github.com/deepmap/oapi-codegen/pkg/runtime" "github.com/getkin/kin-openapi/openapi3" "github.com/labstack/echo/v4" ) -// Defines values for ApiContainerApiConnect. +// Defines values for Connect. const ( - CONNECT ApiContainerApiConnect = "CONNECT" - NOCONNECT ApiContainerApiConnect = "NO_CONNECT" + CONNECT Connect = "CONNECT" + NOCONNECT Connect = "NO_CONNECT" ) -// Defines values for ApiContainerApiContainerStatus. +// Defines values for ContainerStatus. const ( - ApiContainerApiContainerStatusRUNNING ApiContainerApiContainerStatus = "RUNNING" - ApiContainerApiContainerStatusSTOPPED ApiContainerApiContainerStatus = "STOPPED" - ApiContainerApiContainerStatusUNKNOWN ApiContainerApiContainerStatus = "UNKNOWN" + ContainerStatusRUNNING ContainerStatus = "RUNNING" + ContainerStatusSTOPPED ContainerStatus = "STOPPED" + ContainerStatusUNKNOWN ContainerStatus = "UNKNOWN" ) -// Defines values for ApiContainerApiImageDownloadMode. +// Defines values for ImageDownloadMode. const ( - Always ApiContainerApiImageDownloadMode = "always" - Missing ApiContainerApiImageDownloadMode = "missing" + Always ImageDownloadMode = "always" + Missing ImageDownloadMode = "missing" ) -// Defines values for ApiContainerApiKurtosisFeatureFlag. +// Defines values for KurtosisFeatureFlag. const ( - NOINSTRUCTIONSCACHING ApiContainerApiKurtosisFeatureFlag = "NO_INSTRUCTIONS_CACHING" + NOINSTRUCTIONSCACHING KurtosisFeatureFlag = "NO_INSTRUCTIONS_CACHING" ) -// Defines values for ApiContainerApiPortTransportProtocol. +// Defines values for PortTransportProtocol. const ( - SCTP ApiContainerApiPortTransportProtocol = "SCTP" - TCP ApiContainerApiPortTransportProtocol = "TCP" - UDP ApiContainerApiPortTransportProtocol = "UDP" + SCTP PortTransportProtocol = "SCTP" + TCP PortTransportProtocol = "TCP" + UDP PortTransportProtocol = "UDP" ) -// Defines values for ApiContainerApiRestartPolicy. +// Defines values for RestartPolicy. const ( - ALWAYS ApiContainerApiRestartPolicy = "ALWAYS" - NEVER ApiContainerApiRestartPolicy = "NEVER" + ALWAYS RestartPolicy = "ALWAYS" + NEVER RestartPolicy = "NEVER" ) -// Defines values for ApiContainerApiServiceStatus. +// Defines values for ServiceStatus. const ( - ApiContainerApiServiceStatusRUNNING ApiContainerApiServiceStatus = "RUNNING" - ApiContainerApiServiceStatusSTOPPED ApiContainerApiServiceStatus = "STOPPED" - ApiContainerApiServiceStatusUNKNOWN ApiContainerApiServiceStatus = "UNKNOWN" + ServiceStatusRUNNING ServiceStatus = "RUNNING" + ServiceStatusSTOPPED ServiceStatus = "STOPPED" + ServiceStatusUNKNOWN ServiceStatus = "UNKNOWN" ) -// ApiContainerApiConnect 0 - CONNECT // Best effort port forwarding +// Defines values for WaitForEndpointAvailabilityArgsHttpMethod. +const ( + GET WaitForEndpointAvailabilityArgsHttpMethod = "GET" + POST WaitForEndpointAvailabilityArgsHttpMethod = "POST" +) + +// Connect 0 - CONNECT // Best effort port forwarding // 1 - NO_CONNECT // Port forwarding disabled -type ApiContainerApiConnect string +type Connect string -// ApiContainerApiConnectServicesArgs defines model for api_container_api.ConnectServicesArgs. -type ApiContainerApiConnectServicesArgs struct { +// ConnectServicesArgs defines model for ConnectServicesArgs. +type ConnectServicesArgs struct { // Connect 0 - CONNECT // Best effort port forwarding // 1 - NO_CONNECT // Port forwarding disabled - Connect *ApiContainerApiConnect `json:"connect,omitempty"` + Connect *Connect `json:"connect,omitempty"` } -// ApiContainerApiConnectServicesResponse defines model for api_container_api.ConnectServicesResponse. -type ApiContainerApiConnectServicesResponse = map[string]interface{} +// ConnectServicesResponse defines model for ConnectServicesResponse. +type ConnectServicesResponse = map[string]interface{} -// ApiContainerApiContainer defines model for api_container_api.Container. -type ApiContainerApiContainer struct { +// Container defines model for Container. +type Container struct { CmdArgs *[]string `json:"cmd_args,omitempty"` EntrypointArgs *[]string `json:"entrypoint_args,omitempty"` EnvVars *map[string]string `json:"env_vars,omitempty"` @@ -88,47 +95,36 @@ type ApiContainerApiContainer struct { // Status 0 - STOPPED // 1 - RUNNING // 2 - UNKNOWN - Status *ApiContainerApiContainerStatus `json:"status,omitempty"` + Status *ContainerStatus `json:"status,omitempty"` } -// ApiContainerApiContainerStatus 0 - STOPPED +// ContainerStatus 0 - STOPPED // 1 - RUNNING // 2 - UNKNOWN -type ApiContainerApiContainerStatus string +type ContainerStatus string -// ApiContainerApiDataChunkMetadata defines model for api_container_api.DataChunkMetadata. -type ApiContainerApiDataChunkMetadata struct { +// DataChunkMetadata defines model for DataChunkMetadata. +type DataChunkMetadata struct { Name *string `json:"name,omitempty"` } -// ApiContainerApiDownloadFilesArtifactArgs ============================================================================================== -// Download Files Artifact -// ============================================================================================== -type ApiContainerApiDownloadFilesArtifactArgs struct { - // Identifier Files identifier to get bytes for - Identifier *string `json:"identifier,omitempty"` -} - -// ApiContainerApiExecCommandArgs ============================================================================================== +// ExecCommandArgs ============================================================================================== // Exec Command // ============================================================================================== -type ApiContainerApiExecCommandArgs struct { +type ExecCommandArgs struct { CommandArgs *[]string `json:"command_args,omitempty"` - - // ServiceIdentifier The service identifier of the container that the command should be executed in - ServiceIdentifier *string `json:"service_identifier,omitempty"` } -// ApiContainerApiExecCommandResponse defines model for api_container_api.ExecCommandResponse. -type ApiContainerApiExecCommandResponse struct { +// ExecCommandResponse defines model for ExecCommandResponse. +type ExecCommandResponse struct { ExitCode *int32 `json:"exit_code,omitempty"` // LogOutput Assumes UTF-8 encoding LogOutput *string `json:"log_output,omitempty"` } -// ApiContainerApiFileArtifactContentsFileDescription defines model for api_container_api.FileArtifactContentsFileDescription. -type ApiContainerApiFileArtifactContentsFileDescription struct { +// FileArtifactContentsFileDescription defines model for FileArtifactContentsFileDescription. +type FileArtifactContentsFileDescription struct { // Path Path relative to the file artifact Path *string `json:"path,omitempty"` @@ -139,8 +135,8 @@ type ApiContainerApiFileArtifactContentsFileDescription struct { TextPreview *string `json:"text_preview,omitempty"` } -// ApiContainerApiFilesArtifactNameAndUuid defines model for api_container_api.FilesArtifactNameAndUuid. -type ApiContainerApiFilesArtifactNameAndUuid struct { +// FilesArtifactNameAndUuid defines model for FilesArtifactNameAndUuid. +type FilesArtifactNameAndUuid struct { // FileName A string representing the name of the file FileName *string `json:"fileName,omitempty"` @@ -148,66 +144,50 @@ type ApiContainerApiFilesArtifactNameAndUuid struct { FileUuid *string `json:"fileUuid,omitempty"` } -// ApiContainerApiGetExistingAndHistoricalServiceIdentifiersResponse defines model for api_container_api.GetExistingAndHistoricalServiceIdentifiersResponse. -type ApiContainerApiGetExistingAndHistoricalServiceIdentifiersResponse struct { - AllIdentifiers *[]ApiContainerApiServiceIdentifiers `json:"allIdentifiers,omitempty"` -} - -// ApiContainerApiGetServicesArgs ============================================================================================== -// Get Services -// ============================================================================================== -type ApiContainerApiGetServicesArgs struct { - // ServiceIdentifiers "Set" of identifiers to fetch info for - // If empty, will fetch info for all services - ServiceIdentifiers *map[string]string `json:"service_identifiers,omitempty"` +// GetExistingAndHistoricalServiceIdentifiersResponse defines model for GetExistingAndHistoricalServiceIdentifiersResponse. +type GetExistingAndHistoricalServiceIdentifiersResponse struct { + AllIdentifiers *[]ServiceIdentifiers `json:"allIdentifiers,omitempty"` } -// ApiContainerApiGetServicesResponse defines model for api_container_api.GetServicesResponse. -type ApiContainerApiGetServicesResponse struct { - ServiceInfo *ApiContainerApiServiceInfo `json:"service_info,omitempty"` +// GetServicesResponse defines model for GetServicesResponse. +type GetServicesResponse struct { + ServiceInfo *ServiceInfo `json:"service_info,omitempty"` } -// ApiContainerApiGetStarlarkRunResponse defines model for api_container_api.GetStarlarkRunResponse. -type ApiContainerApiGetStarlarkRunResponse struct { - ExperimentalFeatures *[]ApiContainerApiKurtosisFeatureFlag `json:"experimental_features,omitempty"` - MainFunctionName *string `json:"main_function_name,omitempty"` - PackageId *string `json:"package_id,omitempty"` - Parallelism *int32 `json:"parallelism,omitempty"` - RelativePathToMainFile *string `json:"relative_path_to_main_file,omitempty"` +// GetStarlarkRunResponse defines model for GetStarlarkRunResponse. +type GetStarlarkRunResponse struct { + ExperimentalFeatures *[]KurtosisFeatureFlag `json:"experimental_features,omitempty"` + MainFunctionName *string `json:"main_function_name,omitempty"` + PackageId *string `json:"package_id,omitempty"` + Parallelism *int32 `json:"parallelism,omitempty"` + RelativePathToMainFile *string `json:"relative_path_to_main_file,omitempty"` // RestartPolicy 0 - NEVER // 1 - ALWAYS - RestartPolicy *ApiContainerApiRestartPolicy `json:"restart_policy,omitempty"` - SerializedParams *string `json:"serialized_params,omitempty"` - SerializedScript *string `json:"serialized_script,omitempty"` + RestartPolicy *RestartPolicy `json:"restart_policy,omitempty"` + SerializedParams *string `json:"serialized_params,omitempty"` + SerializedScript *string `json:"serialized_script,omitempty"` } -// ApiContainerApiImageDownloadMode 0 - always +// ImageDownloadMode 0 - always // 1 - missing -type ApiContainerApiImageDownloadMode string - -// ApiContainerApiInspectFilesArtifactContentsRequest defines model for api_container_api.InspectFilesArtifactContentsRequest. -type ApiContainerApiInspectFilesArtifactContentsRequest struct { - FileNamesAndUuid *ApiContainerApiFilesArtifactNameAndUuid `json:"file_names_and_uuid,omitempty"` -} +type ImageDownloadMode string -// ApiContainerApiInspectFilesArtifactContentsResponse defines model for api_container_api.InspectFilesArtifactContentsResponse. -type ApiContainerApiInspectFilesArtifactContentsResponse struct { - FileDescriptions *[]ApiContainerApiFileArtifactContentsFileDescription `json:"file_descriptions,omitempty"` +// InspectFilesArtifactContentsResponse defines model for InspectFilesArtifactContentsResponse. +type InspectFilesArtifactContentsResponse struct { + FileDescriptions *[]FileArtifactContentsFileDescription `json:"file_descriptions,omitempty"` } -// ApiContainerApiKurtosisFeatureFlag 0 - NO_INSTRUCTIONS_CACHING -type ApiContainerApiKurtosisFeatureFlag string +// KurtosisFeatureFlag 0 - NO_INSTRUCTIONS_CACHING +type KurtosisFeatureFlag string -// ApiContainerApiListFilesArtifactNamesAndUuidsResponse defines model for api_container_api.ListFilesArtifactNamesAndUuidsResponse. -type ApiContainerApiListFilesArtifactNamesAndUuidsResponse struct { - FileNamesAndUuids *[]ApiContainerApiFilesArtifactNameAndUuid `json:"file_names_and_uuids,omitempty"` +// ListFilesArtifactNamesAndUuidsResponse defines model for ListFilesArtifactNamesAndUuidsResponse. +type ListFilesArtifactNamesAndUuidsResponse struct { + FileNamesAndUuids *[]FilesArtifactNameAndUuid `json:"file_names_and_uuids,omitempty"` } -// ApiContainerApiPort ============================================================================================== -// Shared Objects (Used By Multiple Endpoints) -// ============================================================================================== -type ApiContainerApiPort struct { +// Port Shared Objects (Used By Multiple Endpoints) +type Port struct { MaybeApplicationProtocol *string `json:"maybe_application_protocol,omitempty"` // MaybeWaitTimeout The wait timeout duration in string @@ -217,20 +197,20 @@ type ApiContainerApiPort struct { // TransportProtocol 0 - TCP // 1 - SCTP // 2 - UDP - TransportProtocol *ApiContainerApiPortTransportProtocol `json:"transport_protocol,omitempty"` + TransportProtocol *PortTransportProtocol `json:"transport_protocol,omitempty"` } -// ApiContainerApiPortTransportProtocol 0 - TCP +// PortTransportProtocol 0 - TCP // 1 - SCTP // 2 - UDP -type ApiContainerApiPortTransportProtocol string +type PortTransportProtocol string -// ApiContainerApiRestartPolicy 0 - NEVER +// RestartPolicy 0 - NEVER // 1 - ALWAYS -type ApiContainerApiRestartPolicy string +type RestartPolicy string -// ApiContainerApiRunStarlarkPackageArgs defines model for api_container_api.RunStarlarkPackageArgs. -type ApiContainerApiRunStarlarkPackageArgs struct { +// RunStarlarkPackageArgs defines model for RunStarlarkPackageArgs. +type RunStarlarkPackageArgs struct { // ClonePackage Whether the package should be cloned or not. // If false, then the package will be pulled from the APIC local package store. If it's a local package then is must // have been uploaded using UploadStarlarkPackage prior to calling RunStarlarkPackage. @@ -244,12 +224,12 @@ type ApiContainerApiRunStarlarkPackageArgs struct { CloudUserId *string `json:"cloud_user_id,omitempty"` // DryRun Defaults to false - DryRun *bool `json:"dry_run,omitempty"` - ExperimentalFeatures *[]ApiContainerApiKurtosisFeatureFlag `json:"experimental_features,omitempty"` + DryRun *bool `json:"dry_run,omitempty"` + ExperimentalFeatures *[]KurtosisFeatureFlag `json:"experimental_features,omitempty"` // ImageDownloadMode 0 - always // 1 - missing - ImageDownloadMode *ApiContainerApiImageDownloadMode `json:"image_download_mode,omitempty"` + ImageDownloadMode *ImageDownloadMode `json:"image_download_mode,omitempty"` // Local the payload of the local module Local *[]byte `json:"local,omitempty"` @@ -272,8 +252,8 @@ type ApiContainerApiRunStarlarkPackageArgs struct { SerializedParams *string `json:"serialized_params,omitempty"` } -// ApiContainerApiRunStarlarkScriptArgs defines model for api_container_api.RunStarlarkScriptArgs. -type ApiContainerApiRunStarlarkScriptArgs struct { +// RunStarlarkScriptArgs defines model for RunStarlarkScriptArgs. +type RunStarlarkScriptArgs struct { // CloudInstanceId Defaults to empty CloudInstanceId *string `json:"cloud_instance_id,omitempty"` @@ -281,12 +261,12 @@ type ApiContainerApiRunStarlarkScriptArgs struct { CloudUserId *string `json:"cloud_user_id,omitempty"` // DryRun Defaults to false - DryRun *bool `json:"dry_run,omitempty"` - ExperimentalFeatures *[]ApiContainerApiKurtosisFeatureFlag `json:"experimental_features,omitempty"` + DryRun *bool `json:"dry_run,omitempty"` + ExperimentalFeatures *[]KurtosisFeatureFlag `json:"experimental_features,omitempty"` // ImageDownloadMode 0 - always // 1 - missing - ImageDownloadMode *ApiContainerApiImageDownloadMode `json:"image_download_mode,omitempty"` + ImageDownloadMode *ImageDownloadMode `json:"image_download_mode,omitempty"` // MainFunctionName The name of the main function, the default value is "run" MainFunctionName *string `json:"main_function_name,omitempty"` @@ -297,8 +277,8 @@ type ApiContainerApiRunStarlarkScriptArgs struct { SerializedScript *string `json:"serialized_script,omitempty"` } -// ApiContainerApiServiceIdentifiers An service identifier is a collection of uuid, name and shortened uuid -type ApiContainerApiServiceIdentifiers struct { +// ServiceIdentifiers An service identifier is a collection of uuid, name and shortened uuid +type ServiceIdentifiers struct { // Name Name of the service Name *string `json:"name,omitempty"` @@ -309,18 +289,16 @@ type ApiContainerApiServiceIdentifiers struct { ShortenedUuid *string `json:"shortened_uuid,omitempty"` } -// ApiContainerApiServiceInfo defines model for api_container_api.ServiceInfo. -type ApiContainerApiServiceInfo struct { - Container *ApiContainerApiContainer `json:"container,omitempty"` +// ServiceInfo defines model for ServiceInfo. +type ServiceInfo struct { + Container *Container `json:"container,omitempty"` // MaybePublicIpAddr Public IP address *outside* the enclave where the service is reachable // NOTE: Will be empty if the service isn't running, the service didn't define any ports, or the backend doesn't support reporting public service info MaybePublicIpAddr *string `json:"maybe_public_ip_addr,omitempty"` - // MaybePublicPorts ============================================================================================== - // Shared Objects (Used By Multiple Endpoints) - // ============================================================================================== - MaybePublicPorts *ApiContainerApiPort `json:"maybe_public_ports,omitempty"` + // MaybePublicPorts Shared Objects (Used By Multiple Endpoints) + MaybePublicPorts *Port `json:"maybe_public_ports,omitempty"` // Name Name of the service Name *string `json:"name,omitempty"` @@ -328,15 +306,13 @@ type ApiContainerApiServiceInfo struct { // PrivateIpAddr The IP address of the service inside the enclave PrivateIpAddr *string `json:"private_ip_addr,omitempty"` - // PrivatePorts ============================================================================================== - // Shared Objects (Used By Multiple Endpoints) - // ============================================================================================== - PrivatePorts *ApiContainerApiPort `json:"private_ports,omitempty"` + // PrivatePorts Shared Objects (Used By Multiple Endpoints) + PrivatePorts *Port `json:"private_ports,omitempty"` // ServiceStatus 0 - STOPPED // 1 - RUNNING // 2 - UNKNOWN - ServiceStatus *ApiContainerApiServiceStatus `json:"service_status,omitempty"` + ServiceStatus *ServiceStatus `json:"service_status,omitempty"` // ServiceUuid UUID of the service ServiceUuid *string `json:"service_uuid,omitempty"` @@ -345,119 +321,116 @@ type ApiContainerApiServiceInfo struct { ShortenedUuid *string `json:"shortened_uuid,omitempty"` } -// ApiContainerApiServiceStatus 0 - STOPPED +// ServiceStatus 0 - STOPPED // 1 - RUNNING // 2 - UNKNOWN -type ApiContainerApiServiceStatus string +type ServiceStatus string -// ApiContainerApiStarlarkError defines model for api_container_api.StarlarkError. -type ApiContainerApiStarlarkError struct { - ExecutionError *ApiContainerApiStarlarkExecutionError `json:"execution_error,omitempty"` - InterpretationError *ApiContainerApiStarlarkInterpretationError `json:"interpretation_error,omitempty"` - ValidationError *ApiContainerApiStarlarkValidationError `json:"validation_error,omitempty"` +// StarlarkError defines model for StarlarkError. +type StarlarkError struct { + ExecutionError *StarlarkExecutionError `json:"execution_error,omitempty"` + InterpretationError *StarlarkInterpretationError `json:"interpretation_error,omitempty"` + ValidationError *StarlarkValidationError `json:"validation_error,omitempty"` } -// ApiContainerApiStarlarkExecutionError defines model for api_container_api.StarlarkExecutionError. -type ApiContainerApiStarlarkExecutionError struct { +// StarlarkExecutionError defines model for StarlarkExecutionError. +type StarlarkExecutionError struct { ErrorMessage *string `json:"error_message,omitempty"` } -// ApiContainerApiStarlarkInfo defines model for api_container_api.StarlarkInfo. -type ApiContainerApiStarlarkInfo struct { +// StarlarkInfo defines model for StarlarkInfo. +type StarlarkInfo struct { InfoMessage *string `json:"info_message,omitempty"` } -// ApiContainerApiStarlarkInstruction defines model for api_container_api.StarlarkInstruction. -type ApiContainerApiStarlarkInstruction struct { - Arguments *[]ApiContainerApiStarlarkInstructionArg `json:"arguments,omitempty"` - ExecutableInstruction *string `json:"executable_instruction,omitempty"` - InstructionName *string `json:"instruction_name,omitempty"` - IsSkipped *bool `json:"is_skipped,omitempty"` - Position *ApiContainerApiStarlarkInstructionPosition `json:"position,omitempty"` +// StarlarkInstruction defines model for StarlarkInstruction. +type StarlarkInstruction struct { + Arguments *[]StarlarkInstructionArg `json:"arguments,omitempty"` + ExecutableInstruction *string `json:"executable_instruction,omitempty"` + InstructionName *string `json:"instruction_name,omitempty"` + IsSkipped *bool `json:"is_skipped,omitempty"` + Position *StarlarkInstructionPosition `json:"position,omitempty"` } -// ApiContainerApiStarlarkInstructionArg defines model for api_container_api.StarlarkInstructionArg. -type ApiContainerApiStarlarkInstructionArg struct { +// StarlarkInstructionArg defines model for StarlarkInstructionArg. +type StarlarkInstructionArg struct { ArgName *string `json:"arg_name,omitempty"` IsRepresentative *bool `json:"is_representative,omitempty"` SerializedArgValue *string `json:"serialized_arg_value,omitempty"` } -// ApiContainerApiStarlarkInstructionPosition defines model for api_container_api.StarlarkInstructionPosition. -type ApiContainerApiStarlarkInstructionPosition struct { +// StarlarkInstructionPosition defines model for StarlarkInstructionPosition. +type StarlarkInstructionPosition struct { Column *int32 `json:"column,omitempty"` Filename *string `json:"filename,omitempty"` Line *int32 `json:"line,omitempty"` } -// ApiContainerApiStarlarkInstructionResult defines model for api_container_api.StarlarkInstructionResult. -type ApiContainerApiStarlarkInstructionResult struct { +// StarlarkInstructionResult defines model for StarlarkInstructionResult. +type StarlarkInstructionResult struct { SerializedInstructionResult *string `json:"serialized_instruction_result,omitempty"` } -// ApiContainerApiStarlarkInterpretationError defines model for api_container_api.StarlarkInterpretationError. -type ApiContainerApiStarlarkInterpretationError struct { +// StarlarkInterpretationError defines model for StarlarkInterpretationError. +type StarlarkInterpretationError struct { ErrorMessage *string `json:"error_message,omitempty"` } -// ApiContainerApiStarlarkRunFinishedEvent defines model for api_container_api.StarlarkRunFinishedEvent. -type ApiContainerApiStarlarkRunFinishedEvent struct { +// StarlarkRunFinishedEvent defines model for StarlarkRunFinishedEvent. +type StarlarkRunFinishedEvent struct { IsRunSuccessful *bool `json:"is_run_successful,omitempty"` SerializedOutput *string `json:"serialized_output,omitempty"` } -// ApiContainerApiStarlarkRunProgress defines model for api_container_api.StarlarkRunProgress. -type ApiContainerApiStarlarkRunProgress struct { +// StarlarkRunProgress defines model for StarlarkRunProgress. +type StarlarkRunProgress struct { CurrentStepInfo *[]string `json:"current_step_info,omitempty"` CurrentStepNumber *int32 `json:"current_step_number,omitempty"` TotalSteps *int32 `json:"total_steps,omitempty"` } -// ApiContainerApiStarlarkRunResponseLine ============================================================================================== +// StarlarkRunResponseLine ============================================================================================== // Starlark Execution Response // ============================================================================================== -type ApiContainerApiStarlarkRunResponseLine struct { - Error *ApiContainerApiStarlarkError `json:"error,omitempty"` - Info *ApiContainerApiStarlarkInfo `json:"info,omitempty"` - Instruction *ApiContainerApiStarlarkInstruction `json:"instruction,omitempty"` - InstructionResult *ApiContainerApiStarlarkInstructionResult `json:"instruction_result,omitempty"` - ProgressInfo *ApiContainerApiStarlarkRunProgress `json:"progress_info,omitempty"` - RunFinishedEvent *ApiContainerApiStarlarkRunFinishedEvent `json:"run_finished_event,omitempty"` - Warning *ApiContainerApiStarlarkWarning `json:"warning,omitempty"` -} - -// ApiContainerApiStarlarkValidationError defines model for api_container_api.StarlarkValidationError. -type ApiContainerApiStarlarkValidationError struct { +type StarlarkRunResponseLine struct { + Error *StarlarkError `json:"error,omitempty"` + Info *StarlarkInfo `json:"info,omitempty"` + Instruction *StarlarkInstruction `json:"instruction,omitempty"` + InstructionResult *StarlarkInstructionResult `json:"instruction_result,omitempty"` + ProgressInfo *StarlarkRunProgress `json:"progress_info,omitempty"` + RunFinishedEvent *StarlarkRunFinishedEvent `json:"run_finished_event,omitempty"` + Warning *StarlarkWarning `json:"warning,omitempty"` +} + +// StarlarkValidationError defines model for StarlarkValidationError. +type StarlarkValidationError struct { ErrorMessage *string `json:"error_message,omitempty"` } -// ApiContainerApiStarlarkWarning defines model for api_container_api.StarlarkWarning. -type ApiContainerApiStarlarkWarning struct { +// StarlarkWarning defines model for StarlarkWarning. +type StarlarkWarning struct { WarningMessage *string `json:"warning_message,omitempty"` } -// ApiContainerApiStoreFilesArtifactFromServiceArgs defines model for api_container_api.StoreFilesArtifactFromServiceArgs. -type ApiContainerApiStoreFilesArtifactFromServiceArgs struct { +// StoreFilesArtifactFromServiceArgs defines model for StoreFilesArtifactFromServiceArgs. +type StoreFilesArtifactFromServiceArgs struct { // Name The name of the files artifact Name *string `json:"name,omitempty"` - // ServiceIdentifier Identifier that will be used to identify the service where the source files will be copied from - ServiceIdentifier *string `json:"service_identifier,omitempty"` - // SourcePath The absolute source path where the source files will be copied from SourcePath *string `json:"source_path,omitempty"` } -// ApiContainerApiStoreFilesArtifactFromServiceResponse defines model for api_container_api.StoreFilesArtifactFromServiceResponse. -type ApiContainerApiStoreFilesArtifactFromServiceResponse struct { +// StoreFilesArtifactFromServiceResponse defines model for StoreFilesArtifactFromServiceResponse. +type StoreFilesArtifactFromServiceResponse struct { // Uuid UUID of the files artifact, for use when referencing it in the future Uuid *string `json:"uuid,omitempty"` } -// ApiContainerApiStoreWebFilesArtifactArgs ============================================================================================== +// StoreWebFilesArtifactArgs ============================================================================================== // Store Web Files Artifact // ============================================================================================== -type ApiContainerApiStoreWebFilesArtifactArgs struct { +type StoreWebFilesArtifactArgs struct { // Name The name of the files artifact Name *string `json:"name,omitempty"` @@ -465,19 +438,19 @@ type ApiContainerApiStoreWebFilesArtifactArgs struct { Url *string `json:"url,omitempty"` } -// ApiContainerApiStoreWebFilesArtifactResponse defines model for api_container_api.StoreWebFilesArtifactResponse. -type ApiContainerApiStoreWebFilesArtifactResponse struct { +// StoreWebFilesArtifactResponse defines model for StoreWebFilesArtifactResponse. +type StoreWebFilesArtifactResponse struct { // Uuid UUID of the files artifact, for use when referencing it in the future Uuid *string `json:"uuid,omitempty"` } -// ApiContainerApiStreamedDataChunk ============================================================================================== +// StreamedDataChunk ============================================================================================== // Streamed Data Chunk // ============================================================================================== -type ApiContainerApiStreamedDataChunk struct { +type StreamedDataChunk struct { // Data Chunk of the overall files artifact bytes - Data *[]byte `json:"data,omitempty"` - Metadata *ApiContainerApiDataChunkMetadata `json:"metadata,omitempty"` + Data *[]byte `json:"data,omitempty"` + Metadata *DataChunkMetadata `json:"metadata,omitempty"` // PreviousChunkHash Hash of the PREVIOUS chunk, or empty string is this is the first chunk // Referencing the previous chunk via its hash allows Kurtosis to validate @@ -485,10 +458,10 @@ type ApiContainerApiStreamedDataChunk struct { PreviousChunkHash *string `json:"previous_chunk_hash,omitempty"` } -// ApiContainerApiUploadFilesArtifactResponse ============================================================================================== +// UploadFilesArtifactResponse ============================================================================================== // Upload Files Artifact // ============================================================================================== -type ApiContainerApiUploadFilesArtifactResponse struct { +type UploadFilesArtifactResponse struct { // Name UUID of the files artifact, for use when referencing it in the future Name *string `json:"name,omitempty"` @@ -496,12 +469,11 @@ type ApiContainerApiUploadFilesArtifactResponse struct { Uuid *string `json:"uuid,omitempty"` } -// ApiContainerApiWaitForHttpGetEndpointAvailabilityArgs ============================================================================================== -// Wait For HTTP Get Endpoint Availability -// ============================================================================================== -type ApiContainerApiWaitForHttpGetEndpointAvailabilityArgs struct { +// WaitForEndpointAvailabilityArgs Wait For HTTP Endpoint Availability +type WaitForEndpointAvailabilityArgs struct { // BodyText If the endpoint returns this value, the service will be marked as available (e.g. Hello World). - BodyText *string `json:"body_text,omitempty"` + BodyText *string `json:"body_text,omitempty"` + HttpMethod *WaitForEndpointAvailabilityArgsHttpMethod `json:"http_method,omitempty"` // InitialDelayMilliseconds The number of milliseconds to wait until executing the first HTTP call InitialDelayMilliseconds *int32 `json:"initial_delay_milliseconds,omitempty"` @@ -509,98 +481,56 @@ type ApiContainerApiWaitForHttpGetEndpointAvailabilityArgs struct { // Path The path of the service to check. It mustn't start with the first slash. For instance `service/health` Path *string `json:"path,omitempty"` - // Port The port of the service to check. For instance 8080 - Port *int32 `json:"port,omitempty"` - // Retries Max number of HTTP call attempts that this will execute until giving up and returning an error Retries *int32 `json:"retries,omitempty"` // RetriesDelayMilliseconds Number of milliseconds to wait between retries RetriesDelayMilliseconds *int32 `json:"retries_delay_milliseconds,omitempty"` - - // ServiceIdentifier The identifier of the service to check. - ServiceIdentifier *string `json:"service_identifier,omitempty"` } -// ApiContainerApiWaitForHttpPostEndpointAvailabilityArgs ============================================================================================== -// Wait For HTTP Post Endpoint Availability -// ============================================================================================== -type ApiContainerApiWaitForHttpPostEndpointAvailabilityArgs struct { - // BodyText If the endpoint returns this value, the service will be marked as available (e.g. Hello World). - BodyText *string `json:"body_text,omitempty"` - - // InitialDelayMilliseconds The number of milliseconds to wait until executing the first HTTP call - InitialDelayMilliseconds *int32 `json:"initial_delay_milliseconds,omitempty"` - - // Path The path of the service to check. It mustn't start with the first slash. For instance `service/health` - Path *string `json:"path,omitempty"` - - // Port The port of the service to check. For instance 8080 - Port *int32 `json:"port,omitempty"` - - // RequestBody The content of the request body. - RequestBody *string `json:"request_body,omitempty"` - - // Retries Max number of HTTP call attempts that this will execute until giving up and returning an error - Retries *int32 `json:"retries,omitempty"` - - // RetriesDelayMilliseconds Number of milliseconds to wait between retries - RetriesDelayMilliseconds *int32 `json:"retries_delay_milliseconds,omitempty"` - - // ServiceIdentifier The identifier of the service to check. - ServiceIdentifier *string `json:"service_identifier,omitempty"` -} +// WaitForEndpointAvailabilityArgsHttpMethod defines model for WaitForEndpointAvailabilityArgs.HttpMethod. +type WaitForEndpointAvailabilityArgsHttpMethod string // GoogleProtobufEmpty defines model for google.protobuf.Empty. type GoogleProtobufEmpty = map[string]interface{} -// ApiContainerApiApiContainerServiceConnectServicesJSONRequestBody defines body for ApiContainerApiApiContainerServiceConnectServices for application/json ContentType. -type ApiContainerApiApiContainerServiceConnectServicesJSONRequestBody = ApiContainerApiConnectServicesArgs - -// ApiContainerApiApiContainerServiceDownloadFilesArtifactJSONRequestBody defines body for ApiContainerApiApiContainerServiceDownloadFilesArtifact for application/json ContentType. -type ApiContainerApiApiContainerServiceDownloadFilesArtifactJSONRequestBody = ApiContainerApiDownloadFilesArtifactArgs - -// ApiContainerApiApiContainerServiceExecCommandJSONRequestBody defines body for ApiContainerApiApiContainerServiceExecCommand for application/json ContentType. -type ApiContainerApiApiContainerServiceExecCommandJSONRequestBody = ApiContainerApiExecCommandArgs - -// ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersJSONRequestBody defines body for ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiers for application/json ContentType. -type ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersJSONRequestBody = GoogleProtobufEmpty - -// ApiContainerApiApiContainerServiceGetServicesJSONRequestBody defines body for ApiContainerApiApiContainerServiceGetServices for application/json ContentType. -type ApiContainerApiApiContainerServiceGetServicesJSONRequestBody = ApiContainerApiGetServicesArgs - -// ApiContainerApiApiContainerServiceGetStarlarkRunJSONRequestBody defines body for ApiContainerApiApiContainerServiceGetStarlarkRun for application/json ContentType. -type ApiContainerApiApiContainerServiceGetStarlarkRunJSONRequestBody = GoogleProtobufEmpty +// StreamedDataBody ============================================================================================== +// Streamed Data Chunk +// ============================================================================================== +type StreamedDataBody = StreamedDataChunk -// ApiContainerApiApiContainerServiceInspectFilesArtifactContentsJSONRequestBody defines body for ApiContainerApiApiContainerServiceInspectFilesArtifactContents for application/json ContentType. -type ApiContainerApiApiContainerServiceInspectFilesArtifactContentsJSONRequestBody = ApiContainerApiInspectFilesArtifactContentsRequest +// GetServiceServiceIdentifierParams defines parameters for GetServiceServiceIdentifier. +type GetServiceServiceIdentifierParams struct { + // AdditionalProperties Additional properties + AdditionalProperties *string `form:"additional-properties,omitempty" json:"additional-properties,omitempty"` +} -// ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsJSONRequestBody defines body for ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuids for application/json ContentType. -type ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsJSONRequestBody = GoogleProtobufEmpty +// PutArtifactLocalFileJSONRequestBody defines body for PutArtifactLocalFile for application/json ContentType. +type PutArtifactLocalFileJSONRequestBody = StreamedDataChunk -// ApiContainerApiApiContainerServiceRunStarlarkPackageJSONRequestBody defines body for ApiContainerApiApiContainerServiceRunStarlarkPackage for application/json ContentType. -type ApiContainerApiApiContainerServiceRunStarlarkPackageJSONRequestBody = ApiContainerApiRunStarlarkPackageArgs +// PutArtifactRemoteFileJSONRequestBody defines body for PutArtifactRemoteFile for application/json ContentType. +type PutArtifactRemoteFileJSONRequestBody = StoreWebFilesArtifactArgs -// ApiContainerApiApiContainerServiceRunStarlarkScriptJSONRequestBody defines body for ApiContainerApiApiContainerServiceRunStarlarkScript for application/json ContentType. -type ApiContainerApiApiContainerServiceRunStarlarkScriptJSONRequestBody = ApiContainerApiRunStarlarkScriptArgs +// PutArtifactServiceServiceIdentifierJSONRequestBody defines body for PutArtifactServiceServiceIdentifier for application/json ContentType. +type PutArtifactServiceServiceIdentifierJSONRequestBody = StoreFilesArtifactFromServiceArgs -// ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceJSONRequestBody defines body for ApiContainerApiApiContainerServiceStoreFilesArtifactFromService for application/json ContentType. -type ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceJSONRequestBody = ApiContainerApiStoreFilesArtifactFromServiceArgs +// PostServiceConnectionJSONRequestBody defines body for PostServiceConnection for application/json ContentType. +type PostServiceConnectionJSONRequestBody = ConnectServicesArgs -// ApiContainerApiApiContainerServiceStoreWebFilesArtifactJSONRequestBody defines body for ApiContainerApiApiContainerServiceStoreWebFilesArtifact for application/json ContentType. -type ApiContainerApiApiContainerServiceStoreWebFilesArtifactJSONRequestBody = ApiContainerApiStoreWebFilesArtifactArgs +// PostServiceServiceIdentifierCommandJSONRequestBody defines body for PostServiceServiceIdentifierCommand for application/json ContentType. +type PostServiceServiceIdentifierCommandJSONRequestBody = ExecCommandArgs -// ApiContainerApiApiContainerServiceUploadFilesArtifactJSONRequestBody defines body for ApiContainerApiApiContainerServiceUploadFilesArtifact for application/json ContentType. -type ApiContainerApiApiContainerServiceUploadFilesArtifactJSONRequestBody = ApiContainerApiStreamedDataChunk +// PostServiceServiceIdentifierEndpointPortNumberAvailabilityJSONRequestBody defines body for PostServiceServiceIdentifierEndpointPortNumberAvailability for application/json ContentType. +type PostServiceServiceIdentifierEndpointPortNumberAvailabilityJSONRequestBody = WaitForEndpointAvailabilityArgs -// ApiContainerApiApiContainerServiceUploadStarlarkPackageJSONRequestBody defines body for ApiContainerApiApiContainerServiceUploadStarlarkPackage for application/json ContentType. -type ApiContainerApiApiContainerServiceUploadStarlarkPackageJSONRequestBody = ApiContainerApiStreamedDataChunk +// PutStarlarkPackageJSONRequestBody defines body for PutStarlarkPackage for application/json ContentType. +type PutStarlarkPackageJSONRequestBody = StreamedDataChunk -// ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityJSONRequestBody defines body for ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailability for application/json ContentType. -type ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityJSONRequestBody = ApiContainerApiWaitForHttpGetEndpointAvailabilityArgs +// PostStarlarkPackagePackageIdJSONRequestBody defines body for PostStarlarkPackagePackageId for application/json ContentType. +type PostStarlarkPackagePackageIdJSONRequestBody = RunStarlarkPackageArgs -// ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityJSONRequestBody defines body for ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailability for application/json ContentType. -type ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityJSONRequestBody = ApiContainerApiWaitForHttpPostEndpointAvailabilityArgs +// PostStarlarkScriptJSONRequestBody defines body for PostStarlarkScript for application/json ContentType. +type PostStarlarkScriptJSONRequestBody = RunStarlarkScriptArgs // RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error @@ -675,137 +605,72 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { - // ApiContainerApiApiContainerServiceConnectServicesWithBody request with any body - ApiContainerApiApiContainerServiceConnectServicesWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - ApiContainerApiApiContainerServiceConnectServices(ctx context.Context, body ApiContainerApiApiContainerServiceConnectServicesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // ApiContainerApiApiContainerServiceDownloadFilesArtifactWithBody request with any body - ApiContainerApiApiContainerServiceDownloadFilesArtifactWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - ApiContainerApiApiContainerServiceDownloadFilesArtifact(ctx context.Context, body ApiContainerApiApiContainerServiceDownloadFilesArtifactJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetArtifact request + GetArtifact(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - // ApiContainerApiApiContainerServiceExecCommandWithBody request with any body - ApiContainerApiApiContainerServiceExecCommandWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // PutArtifactLocalFile request with any body + PutArtifactLocalFileWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - ApiContainerApiApiContainerServiceExecCommand(ctx context.Context, body ApiContainerApiApiContainerServiceExecCommandJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + PutArtifactLocalFile(ctx context.Context, body PutArtifactLocalFileJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersWithBody request with any body - ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // PutArtifactRemoteFile request with any body + PutArtifactRemoteFileWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiers(ctx context.Context, body ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + PutArtifactRemoteFile(ctx context.Context, body PutArtifactRemoteFileJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // ApiContainerApiApiContainerServiceGetServicesWithBody request with any body - ApiContainerApiApiContainerServiceGetServicesWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // PutArtifactServiceServiceIdentifier request with any body + PutArtifactServiceServiceIdentifierWithBody(ctx context.Context, serviceIdentifier string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - ApiContainerApiApiContainerServiceGetServices(ctx context.Context, body ApiContainerApiApiContainerServiceGetServicesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + PutArtifactServiceServiceIdentifier(ctx context.Context, serviceIdentifier string, body PutArtifactServiceServiceIdentifierJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // ApiContainerApiApiContainerServiceGetStarlarkRunWithBody request with any body - ApiContainerApiApiContainerServiceGetStarlarkRunWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetArtifactArtifactIdentifier request + GetArtifactArtifactIdentifier(ctx context.Context, artifactIdentifier string, reqEditors ...RequestEditorFn) (*http.Response, error) - ApiContainerApiApiContainerServiceGetStarlarkRun(ctx context.Context, body ApiContainerApiApiContainerServiceGetStarlarkRunJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetArtifactArtifactIdentifierDownload request + GetArtifactArtifactIdentifierDownload(ctx context.Context, artifactIdentifier string, reqEditors ...RequestEditorFn) (*http.Response, error) - // ApiContainerApiApiContainerServiceInspectFilesArtifactContentsWithBody request with any body - ApiContainerApiApiContainerServiceInspectFilesArtifactContentsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetService request + GetService(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - ApiContainerApiApiContainerServiceInspectFilesArtifactContents(ctx context.Context, body ApiContainerApiApiContainerServiceInspectFilesArtifactContentsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // PostServiceConnection request with any body + PostServiceConnectionWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - // ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsWithBody request with any body - ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + PostServiceConnection(ctx context.Context, body PostServiceConnectionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuids(ctx context.Context, body ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetServiceServiceIdentifier request + GetServiceServiceIdentifier(ctx context.Context, serviceIdentifier string, params *GetServiceServiceIdentifierParams, reqEditors ...RequestEditorFn) (*http.Response, error) - // ApiContainerApiApiContainerServiceRunStarlarkPackageWithBody request with any body - ApiContainerApiApiContainerServiceRunStarlarkPackageWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // PostServiceServiceIdentifierCommand request with any body + PostServiceServiceIdentifierCommandWithBody(ctx context.Context, serviceIdentifier string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - ApiContainerApiApiContainerServiceRunStarlarkPackage(ctx context.Context, body ApiContainerApiApiContainerServiceRunStarlarkPackageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + PostServiceServiceIdentifierCommand(ctx context.Context, serviceIdentifier string, body PostServiceServiceIdentifierCommandJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // ApiContainerApiApiContainerServiceRunStarlarkScriptWithBody request with any body - ApiContainerApiApiContainerServiceRunStarlarkScriptWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // PostServiceServiceIdentifierEndpointPortNumberAvailability request with any body + PostServiceServiceIdentifierEndpointPortNumberAvailabilityWithBody(ctx context.Context, serviceIdentifier string, portNumber int, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - ApiContainerApiApiContainerServiceRunStarlarkScript(ctx context.Context, body ApiContainerApiApiContainerServiceRunStarlarkScriptJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + PostServiceServiceIdentifierEndpointPortNumberAvailability(ctx context.Context, serviceIdentifier string, portNumber int, body PostServiceServiceIdentifierEndpointPortNumberAvailabilityJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceWithBody request with any body - ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetStarlark request + GetStarlark(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - ApiContainerApiApiContainerServiceStoreFilesArtifactFromService(ctx context.Context, body ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // PutStarlarkPackage request with any body + PutStarlarkPackageWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - // ApiContainerApiApiContainerServiceStoreWebFilesArtifactWithBody request with any body - ApiContainerApiApiContainerServiceStoreWebFilesArtifactWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + PutStarlarkPackage(ctx context.Context, body PutStarlarkPackageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - ApiContainerApiApiContainerServiceStoreWebFilesArtifact(ctx context.Context, body ApiContainerApiApiContainerServiceStoreWebFilesArtifactJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // PostStarlarkPackagePackageId request with any body + PostStarlarkPackagePackageIdWithBody(ctx context.Context, packageId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - // ApiContainerApiApiContainerServiceUploadFilesArtifactWithBody request with any body - ApiContainerApiApiContainerServiceUploadFilesArtifactWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + PostStarlarkPackagePackageId(ctx context.Context, packageId string, body PostStarlarkPackagePackageIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - ApiContainerApiApiContainerServiceUploadFilesArtifact(ctx context.Context, body ApiContainerApiApiContainerServiceUploadFilesArtifactJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // PostStarlarkScript request with any body + PostStarlarkScriptWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - // ApiContainerApiApiContainerServiceUploadStarlarkPackageWithBody request with any body - ApiContainerApiApiContainerServiceUploadStarlarkPackageWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - ApiContainerApiApiContainerServiceUploadStarlarkPackage(ctx context.Context, body ApiContainerApiApiContainerServiceUploadStarlarkPackageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityWithBody request with any body - ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailability(ctx context.Context, body ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityWithBody request with any body - ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailability(ctx context.Context, body ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) -} - -func (c *Client) ApiContainerApiApiContainerServiceConnectServicesWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewApiContainerApiApiContainerServiceConnectServicesRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) ApiContainerApiApiContainerServiceConnectServices(ctx context.Context, body ApiContainerApiApiContainerServiceConnectServicesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewApiContainerApiApiContainerServiceConnectServicesRequest(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) ApiContainerApiApiContainerServiceDownloadFilesArtifactWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewApiContainerApiApiContainerServiceDownloadFilesArtifactRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) ApiContainerApiApiContainerServiceDownloadFilesArtifact(ctx context.Context, body ApiContainerApiApiContainerServiceDownloadFilesArtifactJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewApiContainerApiApiContainerServiceDownloadFilesArtifactRequest(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) + PostStarlarkScript(ctx context.Context, body PostStarlarkScriptJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) } -func (c *Client) ApiContainerApiApiContainerServiceExecCommandWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewApiContainerApiApiContainerServiceExecCommandRequestWithBody(c.Server, contentType, body) +func (c *Client) GetArtifact(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetArtifactRequest(c.Server) if err != nil { return nil, err } @@ -816,8 +681,8 @@ func (c *Client) ApiContainerApiApiContainerServiceExecCommandWithBody(ctx conte return c.Client.Do(req) } -func (c *Client) ApiContainerApiApiContainerServiceExecCommand(ctx context.Context, body ApiContainerApiApiContainerServiceExecCommandJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewApiContainerApiApiContainerServiceExecCommandRequest(c.Server, body) +func (c *Client) PutArtifactLocalFileWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPutArtifactLocalFileRequestWithBody(c.Server, contentType, body) if err != nil { return nil, err } @@ -828,8 +693,8 @@ func (c *Client) ApiContainerApiApiContainerServiceExecCommand(ctx context.Conte return c.Client.Do(req) } -func (c *Client) ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersRequestWithBody(c.Server, contentType, body) +func (c *Client) PutArtifactLocalFile(ctx context.Context, body PutArtifactLocalFileJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPutArtifactLocalFileRequest(c.Server, body) if err != nil { return nil, err } @@ -840,8 +705,8 @@ func (c *Client) ApiContainerApiApiContainerServiceGetExistingAndHistoricalServi return c.Client.Do(req) } -func (c *Client) ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiers(ctx context.Context, body ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersRequest(c.Server, body) +func (c *Client) PutArtifactRemoteFileWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPutArtifactRemoteFileRequestWithBody(c.Server, contentType, body) if err != nil { return nil, err } @@ -852,8 +717,8 @@ func (c *Client) ApiContainerApiApiContainerServiceGetExistingAndHistoricalServi return c.Client.Do(req) } -func (c *Client) ApiContainerApiApiContainerServiceGetServicesWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewApiContainerApiApiContainerServiceGetServicesRequestWithBody(c.Server, contentType, body) +func (c *Client) PutArtifactRemoteFile(ctx context.Context, body PutArtifactRemoteFileJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPutArtifactRemoteFileRequest(c.Server, body) if err != nil { return nil, err } @@ -864,8 +729,8 @@ func (c *Client) ApiContainerApiApiContainerServiceGetServicesWithBody(ctx conte return c.Client.Do(req) } -func (c *Client) ApiContainerApiApiContainerServiceGetServices(ctx context.Context, body ApiContainerApiApiContainerServiceGetServicesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewApiContainerApiApiContainerServiceGetServicesRequest(c.Server, body) +func (c *Client) PutArtifactServiceServiceIdentifierWithBody(ctx context.Context, serviceIdentifier string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPutArtifactServiceServiceIdentifierRequestWithBody(c.Server, serviceIdentifier, contentType, body) if err != nil { return nil, err } @@ -876,8 +741,8 @@ func (c *Client) ApiContainerApiApiContainerServiceGetServices(ctx context.Conte return c.Client.Do(req) } -func (c *Client) ApiContainerApiApiContainerServiceGetStarlarkRunWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewApiContainerApiApiContainerServiceGetStarlarkRunRequestWithBody(c.Server, contentType, body) +func (c *Client) PutArtifactServiceServiceIdentifier(ctx context.Context, serviceIdentifier string, body PutArtifactServiceServiceIdentifierJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPutArtifactServiceServiceIdentifierRequest(c.Server, serviceIdentifier, body) if err != nil { return nil, err } @@ -888,8 +753,8 @@ func (c *Client) ApiContainerApiApiContainerServiceGetStarlarkRunWithBody(ctx co return c.Client.Do(req) } -func (c *Client) ApiContainerApiApiContainerServiceGetStarlarkRun(ctx context.Context, body ApiContainerApiApiContainerServiceGetStarlarkRunJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewApiContainerApiApiContainerServiceGetStarlarkRunRequest(c.Server, body) +func (c *Client) GetArtifactArtifactIdentifier(ctx context.Context, artifactIdentifier string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetArtifactArtifactIdentifierRequest(c.Server, artifactIdentifier) if err != nil { return nil, err } @@ -900,8 +765,8 @@ func (c *Client) ApiContainerApiApiContainerServiceGetStarlarkRun(ctx context.Co return c.Client.Do(req) } -func (c *Client) ApiContainerApiApiContainerServiceInspectFilesArtifactContentsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewApiContainerApiApiContainerServiceInspectFilesArtifactContentsRequestWithBody(c.Server, contentType, body) +func (c *Client) GetArtifactArtifactIdentifierDownload(ctx context.Context, artifactIdentifier string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetArtifactArtifactIdentifierDownloadRequest(c.Server, artifactIdentifier) if err != nil { return nil, err } @@ -912,8 +777,8 @@ func (c *Client) ApiContainerApiApiContainerServiceInspectFilesArtifactContentsW return c.Client.Do(req) } -func (c *Client) ApiContainerApiApiContainerServiceInspectFilesArtifactContents(ctx context.Context, body ApiContainerApiApiContainerServiceInspectFilesArtifactContentsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewApiContainerApiApiContainerServiceInspectFilesArtifactContentsRequest(c.Server, body) +func (c *Client) GetService(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetServiceRequest(c.Server) if err != nil { return nil, err } @@ -924,8 +789,8 @@ func (c *Client) ApiContainerApiApiContainerServiceInspectFilesArtifactContents( return c.Client.Do(req) } -func (c *Client) ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsRequestWithBody(c.Server, contentType, body) +func (c *Client) PostServiceConnectionWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostServiceConnectionRequestWithBody(c.Server, contentType, body) if err != nil { return nil, err } @@ -936,8 +801,8 @@ func (c *Client) ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuid return c.Client.Do(req) } -func (c *Client) ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuids(ctx context.Context, body ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsRequest(c.Server, body) +func (c *Client) PostServiceConnection(ctx context.Context, body PostServiceConnectionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostServiceConnectionRequest(c.Server, body) if err != nil { return nil, err } @@ -948,8 +813,8 @@ func (c *Client) ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuid return c.Client.Do(req) } -func (c *Client) ApiContainerApiApiContainerServiceRunStarlarkPackageWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewApiContainerApiApiContainerServiceRunStarlarkPackageRequestWithBody(c.Server, contentType, body) +func (c *Client) GetServiceServiceIdentifier(ctx context.Context, serviceIdentifier string, params *GetServiceServiceIdentifierParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetServiceServiceIdentifierRequest(c.Server, serviceIdentifier, params) if err != nil { return nil, err } @@ -960,8 +825,8 @@ func (c *Client) ApiContainerApiApiContainerServiceRunStarlarkPackageWithBody(ct return c.Client.Do(req) } -func (c *Client) ApiContainerApiApiContainerServiceRunStarlarkPackage(ctx context.Context, body ApiContainerApiApiContainerServiceRunStarlarkPackageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewApiContainerApiApiContainerServiceRunStarlarkPackageRequest(c.Server, body) +func (c *Client) PostServiceServiceIdentifierCommandWithBody(ctx context.Context, serviceIdentifier string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostServiceServiceIdentifierCommandRequestWithBody(c.Server, serviceIdentifier, contentType, body) if err != nil { return nil, err } @@ -972,8 +837,8 @@ func (c *Client) ApiContainerApiApiContainerServiceRunStarlarkPackage(ctx contex return c.Client.Do(req) } -func (c *Client) ApiContainerApiApiContainerServiceRunStarlarkScriptWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewApiContainerApiApiContainerServiceRunStarlarkScriptRequestWithBody(c.Server, contentType, body) +func (c *Client) PostServiceServiceIdentifierCommand(ctx context.Context, serviceIdentifier string, body PostServiceServiceIdentifierCommandJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostServiceServiceIdentifierCommandRequest(c.Server, serviceIdentifier, body) if err != nil { return nil, err } @@ -984,8 +849,8 @@ func (c *Client) ApiContainerApiApiContainerServiceRunStarlarkScriptWithBody(ctx return c.Client.Do(req) } -func (c *Client) ApiContainerApiApiContainerServiceRunStarlarkScript(ctx context.Context, body ApiContainerApiApiContainerServiceRunStarlarkScriptJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewApiContainerApiApiContainerServiceRunStarlarkScriptRequest(c.Server, body) +func (c *Client) PostServiceServiceIdentifierEndpointPortNumberAvailabilityWithBody(ctx context.Context, serviceIdentifier string, portNumber int, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostServiceServiceIdentifierEndpointPortNumberAvailabilityRequestWithBody(c.Server, serviceIdentifier, portNumber, contentType, body) if err != nil { return nil, err } @@ -996,8 +861,8 @@ func (c *Client) ApiContainerApiApiContainerServiceRunStarlarkScript(ctx context return c.Client.Do(req) } -func (c *Client) ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceRequestWithBody(c.Server, contentType, body) +func (c *Client) PostServiceServiceIdentifierEndpointPortNumberAvailability(ctx context.Context, serviceIdentifier string, portNumber int, body PostServiceServiceIdentifierEndpointPortNumberAvailabilityJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostServiceServiceIdentifierEndpointPortNumberAvailabilityRequest(c.Server, serviceIdentifier, portNumber, body) if err != nil { return nil, err } @@ -1008,8 +873,8 @@ func (c *Client) ApiContainerApiApiContainerServiceStoreFilesArtifactFromService return c.Client.Do(req) } -func (c *Client) ApiContainerApiApiContainerServiceStoreFilesArtifactFromService(ctx context.Context, body ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceRequest(c.Server, body) +func (c *Client) GetStarlark(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetStarlarkRequest(c.Server) if err != nil { return nil, err } @@ -1020,8 +885,8 @@ func (c *Client) ApiContainerApiApiContainerServiceStoreFilesArtifactFromService return c.Client.Do(req) } -func (c *Client) ApiContainerApiApiContainerServiceStoreWebFilesArtifactWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewApiContainerApiApiContainerServiceStoreWebFilesArtifactRequestWithBody(c.Server, contentType, body) +func (c *Client) PutStarlarkPackageWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPutStarlarkPackageRequestWithBody(c.Server, contentType, body) if err != nil { return nil, err } @@ -1032,8 +897,8 @@ func (c *Client) ApiContainerApiApiContainerServiceStoreWebFilesArtifactWithBody return c.Client.Do(req) } -func (c *Client) ApiContainerApiApiContainerServiceStoreWebFilesArtifact(ctx context.Context, body ApiContainerApiApiContainerServiceStoreWebFilesArtifactJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewApiContainerApiApiContainerServiceStoreWebFilesArtifactRequest(c.Server, body) +func (c *Client) PutStarlarkPackage(ctx context.Context, body PutStarlarkPackageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPutStarlarkPackageRequest(c.Server, body) if err != nil { return nil, err } @@ -1044,8 +909,8 @@ func (c *Client) ApiContainerApiApiContainerServiceStoreWebFilesArtifact(ctx con return c.Client.Do(req) } -func (c *Client) ApiContainerApiApiContainerServiceUploadFilesArtifactWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewApiContainerApiApiContainerServiceUploadFilesArtifactRequestWithBody(c.Server, contentType, body) +func (c *Client) PostStarlarkPackagePackageIdWithBody(ctx context.Context, packageId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostStarlarkPackagePackageIdRequestWithBody(c.Server, packageId, contentType, body) if err != nil { return nil, err } @@ -1056,8 +921,8 @@ func (c *Client) ApiContainerApiApiContainerServiceUploadFilesArtifactWithBody(c return c.Client.Do(req) } -func (c *Client) ApiContainerApiApiContainerServiceUploadFilesArtifact(ctx context.Context, body ApiContainerApiApiContainerServiceUploadFilesArtifactJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewApiContainerApiApiContainerServiceUploadFilesArtifactRequest(c.Server, body) +func (c *Client) PostStarlarkPackagePackageId(ctx context.Context, packageId string, body PostStarlarkPackagePackageIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostStarlarkPackagePackageIdRequest(c.Server, packageId, body) if err != nil { return nil, err } @@ -1068,8 +933,8 @@ func (c *Client) ApiContainerApiApiContainerServiceUploadFilesArtifact(ctx conte return c.Client.Do(req) } -func (c *Client) ApiContainerApiApiContainerServiceUploadStarlarkPackageWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewApiContainerApiApiContainerServiceUploadStarlarkPackageRequestWithBody(c.Server, contentType, body) +func (c *Client) PostStarlarkScriptWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostStarlarkScriptRequestWithBody(c.Server, contentType, body) if err != nil { return nil, err } @@ -1080,8 +945,8 @@ func (c *Client) ApiContainerApiApiContainerServiceUploadStarlarkPackageWithBody return c.Client.Do(req) } -func (c *Client) ApiContainerApiApiContainerServiceUploadStarlarkPackage(ctx context.Context, body ApiContainerApiApiContainerServiceUploadStarlarkPackageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewApiContainerApiApiContainerServiceUploadStarlarkPackageRequest(c.Server, body) +func (c *Client) PostStarlarkScript(ctx context.Context, body PostStarlarkScriptJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostStarlarkScriptRequest(c.Server, body) if err != nil { return nil, err } @@ -1092,67 +957,8 @@ func (c *Client) ApiContainerApiApiContainerServiceUploadStarlarkPackage(ctx con return c.Client.Do(req) } -func (c *Client) ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailability(ctx context.Context, body ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityRequest(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailability(ctx context.Context, body ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityRequest(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -// NewApiContainerApiApiContainerServiceConnectServicesRequest calls the generic ApiContainerApiApiContainerServiceConnectServices builder with application/json body -func NewApiContainerApiApiContainerServiceConnectServicesRequest(server string, body ApiContainerApiApiContainerServiceConnectServicesJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewApiContainerApiApiContainerServiceConnectServicesRequestWithBody(server, "application/json", bodyReader) -} - -// NewApiContainerApiApiContainerServiceConnectServicesRequestWithBody generates requests for ApiContainerApiApiContainerServiceConnectServices with any type of body -func NewApiContainerApiApiContainerServiceConnectServicesRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { +// NewGetArtifactRequest generates requests for GetArtifact +func NewGetArtifactRequest(server string) (*http.Request, error) { var err error serverURL, err := url.Parse(server) @@ -1160,7 +966,7 @@ func NewApiContainerApiApiContainerServiceConnectServicesRequestWithBody(server return nil, err } - operationPath := fmt.Sprintf("/api_container_api.ApiContainerService/ConnectServices") + operationPath := fmt.Sprintf("/artifact") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -1170,29 +976,27 @@ func NewApiContainerApiApiContainerServiceConnectServicesRequestWithBody(server return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewApiContainerApiApiContainerServiceDownloadFilesArtifactRequest calls the generic ApiContainerApiApiContainerServiceDownloadFilesArtifact builder with application/json body -func NewApiContainerApiApiContainerServiceDownloadFilesArtifactRequest(server string, body ApiContainerApiApiContainerServiceDownloadFilesArtifactJSONRequestBody) (*http.Request, error) { +// NewPutArtifactLocalFileRequest calls the generic PutArtifactLocalFile builder with application/json body +func NewPutArtifactLocalFileRequest(server string, body PutArtifactLocalFileJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewApiContainerApiApiContainerServiceDownloadFilesArtifactRequestWithBody(server, "application/json", bodyReader) + return NewPutArtifactLocalFileRequestWithBody(server, "application/json", bodyReader) } -// NewApiContainerApiApiContainerServiceDownloadFilesArtifactRequestWithBody generates requests for ApiContainerApiApiContainerServiceDownloadFilesArtifact with any type of body -func NewApiContainerApiApiContainerServiceDownloadFilesArtifactRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { +// NewPutArtifactLocalFileRequestWithBody generates requests for PutArtifactLocalFile with any type of body +func NewPutArtifactLocalFileRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) @@ -1200,7 +1004,7 @@ func NewApiContainerApiApiContainerServiceDownloadFilesArtifactRequestWithBody(s return nil, err } - operationPath := fmt.Sprintf("/api_container_api.ApiContainerService/DownloadFilesArtifact") + operationPath := fmt.Sprintf("/artifact/local-file") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -1210,7 +1014,7 @@ func NewApiContainerApiApiContainerServiceDownloadFilesArtifactRequestWithBody(s return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) + req, err := http.NewRequest("PUT", queryURL.String(), body) if err != nil { return nil, err } @@ -1220,19 +1024,19 @@ func NewApiContainerApiApiContainerServiceDownloadFilesArtifactRequestWithBody(s return req, nil } -// NewApiContainerApiApiContainerServiceExecCommandRequest calls the generic ApiContainerApiApiContainerServiceExecCommand builder with application/json body -func NewApiContainerApiApiContainerServiceExecCommandRequest(server string, body ApiContainerApiApiContainerServiceExecCommandJSONRequestBody) (*http.Request, error) { +// NewPutArtifactRemoteFileRequest calls the generic PutArtifactRemoteFile builder with application/json body +func NewPutArtifactRemoteFileRequest(server string, body PutArtifactRemoteFileJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewApiContainerApiApiContainerServiceExecCommandRequestWithBody(server, "application/json", bodyReader) + return NewPutArtifactRemoteFileRequestWithBody(server, "application/json", bodyReader) } -// NewApiContainerApiApiContainerServiceExecCommandRequestWithBody generates requests for ApiContainerApiApiContainerServiceExecCommand with any type of body -func NewApiContainerApiApiContainerServiceExecCommandRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { +// NewPutArtifactRemoteFileRequestWithBody generates requests for PutArtifactRemoteFile with any type of body +func NewPutArtifactRemoteFileRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) @@ -1240,7 +1044,7 @@ func NewApiContainerApiApiContainerServiceExecCommandRequestWithBody(server stri return nil, err } - operationPath := fmt.Sprintf("/api_container_api.ApiContainerService/ExecCommand") + operationPath := fmt.Sprintf("/artifact/remote-file") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -1250,7 +1054,7 @@ func NewApiContainerApiApiContainerServiceExecCommandRequestWithBody(server stri return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) + req, err := http.NewRequest("PUT", queryURL.String(), body) if err != nil { return nil, err } @@ -1260,27 +1064,34 @@ func NewApiContainerApiApiContainerServiceExecCommandRequestWithBody(server stri return req, nil } -// NewApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersRequest calls the generic ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiers builder with application/json body -func NewApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersRequest(server string, body ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersJSONRequestBody) (*http.Request, error) { +// NewPutArtifactServiceServiceIdentifierRequest calls the generic PutArtifactServiceServiceIdentifier builder with application/json body +func NewPutArtifactServiceServiceIdentifierRequest(server string, serviceIdentifier string, body PutArtifactServiceServiceIdentifierJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersRequestWithBody(server, "application/json", bodyReader) + return NewPutArtifactServiceServiceIdentifierRequestWithBody(server, serviceIdentifier, "application/json", bodyReader) } -// NewApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersRequestWithBody generates requests for ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiers with any type of body -func NewApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { +// NewPutArtifactServiceServiceIdentifierRequestWithBody generates requests for PutArtifactServiceServiceIdentifier with any type of body +func NewPutArtifactServiceServiceIdentifierRequestWithBody(server string, serviceIdentifier string, contentType string, body io.Reader) (*http.Request, error) { var err error + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "service_identifier", runtime.ParamLocationPath, serviceIdentifier) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/api_container_api.ApiContainerService/GetExistingAndHistoricalServiceIdentifiers") + operationPath := fmt.Sprintf("/artifact/service/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -1290,7 +1101,7 @@ func NewApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentif return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) + req, err := http.NewRequest("PUT", queryURL.String(), body) if err != nil { return nil, err } @@ -1300,27 +1111,23 @@ func NewApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentif return req, nil } -// NewApiContainerApiApiContainerServiceGetServicesRequest calls the generic ApiContainerApiApiContainerServiceGetServices builder with application/json body -func NewApiContainerApiApiContainerServiceGetServicesRequest(server string, body ApiContainerApiApiContainerServiceGetServicesJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) +// NewGetArtifactArtifactIdentifierRequest generates requests for GetArtifactArtifactIdentifier +func NewGetArtifactArtifactIdentifierRequest(server string, artifactIdentifier string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "artifact_identifier", runtime.ParamLocationPath, artifactIdentifier) if err != nil { return nil, err } - bodyReader = bytes.NewReader(buf) - return NewApiContainerApiApiContainerServiceGetServicesRequestWithBody(server, "application/json", bodyReader) -} - -// NewApiContainerApiApiContainerServiceGetServicesRequestWithBody generates requests for ApiContainerApiApiContainerServiceGetServices with any type of body -func NewApiContainerApiApiContainerServiceGetServicesRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/api_container_api.ApiContainerService/GetServices") + operationPath := fmt.Sprintf("/artifact/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -1330,37 +1137,31 @@ func NewApiContainerApiApiContainerServiceGetServicesRequestWithBody(server stri return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewApiContainerApiApiContainerServiceGetStarlarkRunRequest calls the generic ApiContainerApiApiContainerServiceGetStarlarkRun builder with application/json body -func NewApiContainerApiApiContainerServiceGetStarlarkRunRequest(server string, body ApiContainerApiApiContainerServiceGetStarlarkRunJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) +// NewGetArtifactArtifactIdentifierDownloadRequest generates requests for GetArtifactArtifactIdentifierDownload +func NewGetArtifactArtifactIdentifierDownloadRequest(server string, artifactIdentifier string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "artifact_identifier", runtime.ParamLocationPath, artifactIdentifier) if err != nil { return nil, err } - bodyReader = bytes.NewReader(buf) - return NewApiContainerApiApiContainerServiceGetStarlarkRunRequestWithBody(server, "application/json", bodyReader) -} - -// NewApiContainerApiApiContainerServiceGetStarlarkRunRequestWithBody generates requests for ApiContainerApiApiContainerServiceGetStarlarkRun with any type of body -func NewApiContainerApiApiContainerServiceGetStarlarkRunRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/api_container_api.ApiContainerService/GetStarlarkRun") + operationPath := fmt.Sprintf("/artifact/%s/download", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -1370,29 +1171,16 @@ func NewApiContainerApiApiContainerServiceGetStarlarkRunRequestWithBody(server s return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewApiContainerApiApiContainerServiceInspectFilesArtifactContentsRequest calls the generic ApiContainerApiApiContainerServiceInspectFilesArtifactContents builder with application/json body -func NewApiContainerApiApiContainerServiceInspectFilesArtifactContentsRequest(server string, body ApiContainerApiApiContainerServiceInspectFilesArtifactContentsJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewApiContainerApiApiContainerServiceInspectFilesArtifactContentsRequestWithBody(server, "application/json", bodyReader) -} - -// NewApiContainerApiApiContainerServiceInspectFilesArtifactContentsRequestWithBody generates requests for ApiContainerApiApiContainerServiceInspectFilesArtifactContents with any type of body -func NewApiContainerApiApiContainerServiceInspectFilesArtifactContentsRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { +// NewGetServiceRequest generates requests for GetService +func NewGetServiceRequest(server string) (*http.Request, error) { var err error serverURL, err := url.Parse(server) @@ -1400,7 +1188,7 @@ func NewApiContainerApiApiContainerServiceInspectFilesArtifactContentsRequestWit return nil, err } - operationPath := fmt.Sprintf("/api_container_api.ApiContainerService/InspectFilesArtifactContents") + operationPath := fmt.Sprintf("/service") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -1410,29 +1198,27 @@ func NewApiContainerApiApiContainerServiceInspectFilesArtifactContentsRequestWit return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsRequest calls the generic ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuids builder with application/json body -func NewApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsRequest(server string, body ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsJSONRequestBody) (*http.Request, error) { +// NewPostServiceConnectionRequest calls the generic PostServiceConnection builder with application/json body +func NewPostServiceConnectionRequest(server string, body PostServiceConnectionJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsRequestWithBody(server, "application/json", bodyReader) + return NewPostServiceConnectionRequestWithBody(server, "application/json", bodyReader) } -// NewApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsRequestWithBody generates requests for ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuids with any type of body -func NewApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { +// NewPostServiceConnectionRequestWithBody generates requests for PostServiceConnection with any type of body +func NewPostServiceConnectionRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) @@ -1440,7 +1226,7 @@ func NewApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsRequestW return nil, err } - operationPath := fmt.Sprintf("/api_container_api.ApiContainerService/ListFilesArtifactNamesAndUuids") + operationPath := fmt.Sprintf("/service/connection") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -1460,27 +1246,23 @@ func NewApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsRequestW return req, nil } -// NewApiContainerApiApiContainerServiceRunStarlarkPackageRequest calls the generic ApiContainerApiApiContainerServiceRunStarlarkPackage builder with application/json body -func NewApiContainerApiApiContainerServiceRunStarlarkPackageRequest(server string, body ApiContainerApiApiContainerServiceRunStarlarkPackageJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) +// NewGetServiceServiceIdentifierRequest generates requests for GetServiceServiceIdentifier +func NewGetServiceServiceIdentifierRequest(server string, serviceIdentifier string, params *GetServiceServiceIdentifierParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "service_identifier", runtime.ParamLocationPath, serviceIdentifier) if err != nil { return nil, err } - bodyReader = bytes.NewReader(buf) - return NewApiContainerApiApiContainerServiceRunStarlarkPackageRequestWithBody(server, "application/json", bodyReader) -} - -// NewApiContainerApiApiContainerServiceRunStarlarkPackageRequestWithBody generates requests for ApiContainerApiApiContainerServiceRunStarlarkPackage with any type of body -func NewApiContainerApiApiContainerServiceRunStarlarkPackageRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/api_container_api.ApiContainerService/RunStarlarkPackage") + operationPath := fmt.Sprintf("/service/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -1490,37 +1272,62 @@ func NewApiContainerApiApiContainerServiceRunStarlarkPackageRequestWithBody(serv return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) + queryValues := queryURL.Query() + + if params.AdditionalProperties != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "additional-properties", runtime.ParamLocationQuery, *params.AdditionalProperties); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewApiContainerApiApiContainerServiceRunStarlarkScriptRequest calls the generic ApiContainerApiApiContainerServiceRunStarlarkScript builder with application/json body -func NewApiContainerApiApiContainerServiceRunStarlarkScriptRequest(server string, body ApiContainerApiApiContainerServiceRunStarlarkScriptJSONRequestBody) (*http.Request, error) { +// NewPostServiceServiceIdentifierCommandRequest calls the generic PostServiceServiceIdentifierCommand builder with application/json body +func NewPostServiceServiceIdentifierCommandRequest(server string, serviceIdentifier string, body PostServiceServiceIdentifierCommandJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewApiContainerApiApiContainerServiceRunStarlarkScriptRequestWithBody(server, "application/json", bodyReader) + return NewPostServiceServiceIdentifierCommandRequestWithBody(server, serviceIdentifier, "application/json", bodyReader) } -// NewApiContainerApiApiContainerServiceRunStarlarkScriptRequestWithBody generates requests for ApiContainerApiApiContainerServiceRunStarlarkScript with any type of body -func NewApiContainerApiApiContainerServiceRunStarlarkScriptRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { +// NewPostServiceServiceIdentifierCommandRequestWithBody generates requests for PostServiceServiceIdentifierCommand with any type of body +func NewPostServiceServiceIdentifierCommandRequestWithBody(server string, serviceIdentifier string, contentType string, body io.Reader) (*http.Request, error) { var err error + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "service_identifier", runtime.ParamLocationPath, serviceIdentifier) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/api_container_api.ApiContainerService/RunStarlarkScript") + operationPath := fmt.Sprintf("/service/%s/command", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -1540,67 +1347,41 @@ func NewApiContainerApiApiContainerServiceRunStarlarkScriptRequestWithBody(serve return req, nil } -// NewApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceRequest calls the generic ApiContainerApiApiContainerServiceStoreFilesArtifactFromService builder with application/json body -func NewApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceRequest(server string, body ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceJSONRequestBody) (*http.Request, error) { +// NewPostServiceServiceIdentifierEndpointPortNumberAvailabilityRequest calls the generic PostServiceServiceIdentifierEndpointPortNumberAvailability builder with application/json body +func NewPostServiceServiceIdentifierEndpointPortNumberAvailabilityRequest(server string, serviceIdentifier string, portNumber int, body PostServiceServiceIdentifierEndpointPortNumberAvailabilityJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceRequestWithBody(server, "application/json", bodyReader) + return NewPostServiceServiceIdentifierEndpointPortNumberAvailabilityRequestWithBody(server, serviceIdentifier, portNumber, "application/json", bodyReader) } -// NewApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceRequestWithBody generates requests for ApiContainerApiApiContainerServiceStoreFilesArtifactFromService with any type of body -func NewApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { +// NewPostServiceServiceIdentifierEndpointPortNumberAvailabilityRequestWithBody generates requests for PostServiceServiceIdentifierEndpointPortNumberAvailability with any type of body +func NewPostServiceServiceIdentifierEndpointPortNumberAvailabilityRequestWithBody(server string, serviceIdentifier string, portNumber int, contentType string, body io.Reader) (*http.Request, error) { var err error - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } + var pathParam0 string - operationPath := fmt.Sprintf("/api_container_api.ApiContainerService/StoreFilesArtifactFromService") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "service_identifier", runtime.ParamLocationPath, serviceIdentifier) if err != nil { return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } + var pathParam1 string - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewApiContainerApiApiContainerServiceStoreWebFilesArtifactRequest calls the generic ApiContainerApiApiContainerServiceStoreWebFilesArtifact builder with application/json body -func NewApiContainerApiApiContainerServiceStoreWebFilesArtifactRequest(server string, body ApiContainerApiApiContainerServiceStoreWebFilesArtifactJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "port_number", runtime.ParamLocationPath, portNumber) if err != nil { return nil, err } - bodyReader = bytes.NewReader(buf) - return NewApiContainerApiApiContainerServiceStoreWebFilesArtifactRequestWithBody(server, "application/json", bodyReader) -} - -// NewApiContainerApiApiContainerServiceStoreWebFilesArtifactRequestWithBody generates requests for ApiContainerApiApiContainerServiceStoreWebFilesArtifact with any type of body -func NewApiContainerApiApiContainerServiceStoreWebFilesArtifactRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/api_container_api.ApiContainerService/StoreWebFilesArtifact") + operationPath := fmt.Sprintf("/service/%s/endpoint/%s/availability", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -1620,19 +1401,8 @@ func NewApiContainerApiApiContainerServiceStoreWebFilesArtifactRequestWithBody(s return req, nil } -// NewApiContainerApiApiContainerServiceUploadFilesArtifactRequest calls the generic ApiContainerApiApiContainerServiceUploadFilesArtifact builder with application/json body -func NewApiContainerApiApiContainerServiceUploadFilesArtifactRequest(server string, body ApiContainerApiApiContainerServiceUploadFilesArtifactJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewApiContainerApiApiContainerServiceUploadFilesArtifactRequestWithBody(server, "application/json", bodyReader) -} - -// NewApiContainerApiApiContainerServiceUploadFilesArtifactRequestWithBody generates requests for ApiContainerApiApiContainerServiceUploadFilesArtifact with any type of body -func NewApiContainerApiApiContainerServiceUploadFilesArtifactRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { +// NewGetStarlarkRequest generates requests for GetStarlark +func NewGetStarlarkRequest(server string) (*http.Request, error) { var err error serverURL, err := url.Parse(server) @@ -1640,7 +1410,7 @@ func NewApiContainerApiApiContainerServiceUploadFilesArtifactRequestWithBody(ser return nil, err } - operationPath := fmt.Sprintf("/api_container_api.ApiContainerService/UploadFilesArtifact") + operationPath := fmt.Sprintf("/starlark") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -1650,29 +1420,27 @@ func NewApiContainerApiApiContainerServiceUploadFilesArtifactRequestWithBody(ser return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewApiContainerApiApiContainerServiceUploadStarlarkPackageRequest calls the generic ApiContainerApiApiContainerServiceUploadStarlarkPackage builder with application/json body -func NewApiContainerApiApiContainerServiceUploadStarlarkPackageRequest(server string, body ApiContainerApiApiContainerServiceUploadStarlarkPackageJSONRequestBody) (*http.Request, error) { +// NewPutStarlarkPackageRequest calls the generic PutStarlarkPackage builder with application/json body +func NewPutStarlarkPackageRequest(server string, body PutStarlarkPackageJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewApiContainerApiApiContainerServiceUploadStarlarkPackageRequestWithBody(server, "application/json", bodyReader) + return NewPutStarlarkPackageRequestWithBody(server, "application/json", bodyReader) } -// NewApiContainerApiApiContainerServiceUploadStarlarkPackageRequestWithBody generates requests for ApiContainerApiApiContainerServiceUploadStarlarkPackage with any type of body -func NewApiContainerApiApiContainerServiceUploadStarlarkPackageRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { +// NewPutStarlarkPackageRequestWithBody generates requests for PutStarlarkPackage with any type of body +func NewPutStarlarkPackageRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) @@ -1680,7 +1448,7 @@ func NewApiContainerApiApiContainerServiceUploadStarlarkPackageRequestWithBody(s return nil, err } - operationPath := fmt.Sprintf("/api_container_api.ApiContainerService/UploadStarlarkPackage") + operationPath := fmt.Sprintf("/starlark/package") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -1690,7 +1458,7 @@ func NewApiContainerApiApiContainerServiceUploadStarlarkPackageRequestWithBody(s return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) + req, err := http.NewRequest("PUT", queryURL.String(), body) if err != nil { return nil, err } @@ -1700,27 +1468,34 @@ func NewApiContainerApiApiContainerServiceUploadStarlarkPackageRequestWithBody(s return req, nil } -// NewApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityRequest calls the generic ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailability builder with application/json body -func NewApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityRequest(server string, body ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityJSONRequestBody) (*http.Request, error) { +// NewPostStarlarkPackagePackageIdRequest calls the generic PostStarlarkPackagePackageId builder with application/json body +func NewPostStarlarkPackagePackageIdRequest(server string, packageId string, body PostStarlarkPackagePackageIdJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityRequestWithBody(server, "application/json", bodyReader) + return NewPostStarlarkPackagePackageIdRequestWithBody(server, packageId, "application/json", bodyReader) } -// NewApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityRequestWithBody generates requests for ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailability with any type of body -func NewApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { +// NewPostStarlarkPackagePackageIdRequestWithBody generates requests for PostStarlarkPackagePackageId with any type of body +func NewPostStarlarkPackagePackageIdRequestWithBody(server string, packageId string, contentType string, body io.Reader) (*http.Request, error) { var err error + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "package_id", runtime.ParamLocationPath, packageId) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/api_container_api.ApiContainerService/WaitForHttpGetEndpointAvailability") + operationPath := fmt.Sprintf("/starlark/package/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -1740,19 +1515,19 @@ func NewApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityRequ return req, nil } -// NewApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityRequest calls the generic ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailability builder with application/json body -func NewApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityRequest(server string, body ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityJSONRequestBody) (*http.Request, error) { +// NewPostStarlarkScriptRequest calls the generic PostStarlarkScript builder with application/json body +func NewPostStarlarkScriptRequest(server string, body PostStarlarkScriptJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityRequestWithBody(server, "application/json", bodyReader) + return NewPostStarlarkScriptRequestWithBody(server, "application/json", bodyReader) } -// NewApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityRequestWithBody generates requests for ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailability with any type of body -func NewApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { +// NewPostStarlarkScriptRequestWithBody generates requests for PostStarlarkScript with any type of body +func NewPostStarlarkScriptRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) @@ -1760,7 +1535,7 @@ func NewApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityReq return nil, err } - operationPath := fmt.Sprintf("/api_container_api.ApiContainerService/WaitForHttpPostEndpointAvailability") + operationPath := fmt.Sprintf("/starlark/script") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -1823,94 +1598,77 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // ApiContainerApiApiContainerServiceConnectServicesWithBodyWithResponse request with any body - ApiContainerApiApiContainerServiceConnectServicesWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceConnectServicesResponse, error) - - ApiContainerApiApiContainerServiceConnectServicesWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceConnectServicesJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceConnectServicesResponse, error) - - // ApiContainerApiApiContainerServiceDownloadFilesArtifactWithBodyWithResponse request with any body - ApiContainerApiApiContainerServiceDownloadFilesArtifactWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceDownloadFilesArtifactResponse, error) - - ApiContainerApiApiContainerServiceDownloadFilesArtifactWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceDownloadFilesArtifactJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceDownloadFilesArtifactResponse, error) - - // ApiContainerApiApiContainerServiceExecCommandWithBodyWithResponse request with any body - ApiContainerApiApiContainerServiceExecCommandWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceExecCommandResponse, error) + // GetArtifact request + GetArtifactWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetArtifactResponse, error) - ApiContainerApiApiContainerServiceExecCommandWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceExecCommandJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceExecCommandResponse, error) + // PutArtifactLocalFile request with any body + PutArtifactLocalFileWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutArtifactLocalFileResponse, error) - // ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersWithBodyWithResponse request with any body - ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersResponse, error) + PutArtifactLocalFileWithResponse(ctx context.Context, body PutArtifactLocalFileJSONRequestBody, reqEditors ...RequestEditorFn) (*PutArtifactLocalFileResponse, error) - ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersResponse, error) + // PutArtifactRemoteFile request with any body + PutArtifactRemoteFileWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutArtifactRemoteFileResponse, error) - // ApiContainerApiApiContainerServiceGetServicesWithBodyWithResponse request with any body - ApiContainerApiApiContainerServiceGetServicesWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceGetServicesResponse, error) + PutArtifactRemoteFileWithResponse(ctx context.Context, body PutArtifactRemoteFileJSONRequestBody, reqEditors ...RequestEditorFn) (*PutArtifactRemoteFileResponse, error) - ApiContainerApiApiContainerServiceGetServicesWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceGetServicesJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceGetServicesResponse, error) + // PutArtifactServiceServiceIdentifier request with any body + PutArtifactServiceServiceIdentifierWithBodyWithResponse(ctx context.Context, serviceIdentifier string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutArtifactServiceServiceIdentifierResponse, error) - // ApiContainerApiApiContainerServiceGetStarlarkRunWithBodyWithResponse request with any body - ApiContainerApiApiContainerServiceGetStarlarkRunWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceGetStarlarkRunResponse, error) + PutArtifactServiceServiceIdentifierWithResponse(ctx context.Context, serviceIdentifier string, body PutArtifactServiceServiceIdentifierJSONRequestBody, reqEditors ...RequestEditorFn) (*PutArtifactServiceServiceIdentifierResponse, error) - ApiContainerApiApiContainerServiceGetStarlarkRunWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceGetStarlarkRunJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceGetStarlarkRunResponse, error) + // GetArtifactArtifactIdentifier request + GetArtifactArtifactIdentifierWithResponse(ctx context.Context, artifactIdentifier string, reqEditors ...RequestEditorFn) (*GetArtifactArtifactIdentifierResponse, error) - // ApiContainerApiApiContainerServiceInspectFilesArtifactContentsWithBodyWithResponse request with any body - ApiContainerApiApiContainerServiceInspectFilesArtifactContentsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceInspectFilesArtifactContentsResponse, error) + // GetArtifactArtifactIdentifierDownload request + GetArtifactArtifactIdentifierDownloadWithResponse(ctx context.Context, artifactIdentifier string, reqEditors ...RequestEditorFn) (*GetArtifactArtifactIdentifierDownloadResponse, error) - ApiContainerApiApiContainerServiceInspectFilesArtifactContentsWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceInspectFilesArtifactContentsJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceInspectFilesArtifactContentsResponse, error) + // GetService request + GetServiceWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetServiceResponse, error) - // ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsWithBodyWithResponse request with any body - ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsResponse, error) + // PostServiceConnection request with any body + PostServiceConnectionWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostServiceConnectionResponse, error) - ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsResponse, error) + PostServiceConnectionWithResponse(ctx context.Context, body PostServiceConnectionJSONRequestBody, reqEditors ...RequestEditorFn) (*PostServiceConnectionResponse, error) - // ApiContainerApiApiContainerServiceRunStarlarkPackageWithBodyWithResponse request with any body - ApiContainerApiApiContainerServiceRunStarlarkPackageWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceRunStarlarkPackageResponse, error) + // GetServiceServiceIdentifier request + GetServiceServiceIdentifierWithResponse(ctx context.Context, serviceIdentifier string, params *GetServiceServiceIdentifierParams, reqEditors ...RequestEditorFn) (*GetServiceServiceIdentifierResponse, error) - ApiContainerApiApiContainerServiceRunStarlarkPackageWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceRunStarlarkPackageJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceRunStarlarkPackageResponse, error) + // PostServiceServiceIdentifierCommand request with any body + PostServiceServiceIdentifierCommandWithBodyWithResponse(ctx context.Context, serviceIdentifier string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostServiceServiceIdentifierCommandResponse, error) - // ApiContainerApiApiContainerServiceRunStarlarkScriptWithBodyWithResponse request with any body - ApiContainerApiApiContainerServiceRunStarlarkScriptWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceRunStarlarkScriptResponse, error) + PostServiceServiceIdentifierCommandWithResponse(ctx context.Context, serviceIdentifier string, body PostServiceServiceIdentifierCommandJSONRequestBody, reqEditors ...RequestEditorFn) (*PostServiceServiceIdentifierCommandResponse, error) - ApiContainerApiApiContainerServiceRunStarlarkScriptWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceRunStarlarkScriptJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceRunStarlarkScriptResponse, error) + // PostServiceServiceIdentifierEndpointPortNumberAvailability request with any body + PostServiceServiceIdentifierEndpointPortNumberAvailabilityWithBodyWithResponse(ctx context.Context, serviceIdentifier string, portNumber int, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostServiceServiceIdentifierEndpointPortNumberAvailabilityResponse, error) - // ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceWithBodyWithResponse request with any body - ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceResponse, error) + PostServiceServiceIdentifierEndpointPortNumberAvailabilityWithResponse(ctx context.Context, serviceIdentifier string, portNumber int, body PostServiceServiceIdentifierEndpointPortNumberAvailabilityJSONRequestBody, reqEditors ...RequestEditorFn) (*PostServiceServiceIdentifierEndpointPortNumberAvailabilityResponse, error) - ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceResponse, error) + // GetStarlark request + GetStarlarkWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetStarlarkResponse, error) - // ApiContainerApiApiContainerServiceStoreWebFilesArtifactWithBodyWithResponse request with any body - ApiContainerApiApiContainerServiceStoreWebFilesArtifactWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceStoreWebFilesArtifactResponse, error) + // PutStarlarkPackage request with any body + PutStarlarkPackageWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutStarlarkPackageResponse, error) - ApiContainerApiApiContainerServiceStoreWebFilesArtifactWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceStoreWebFilesArtifactJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceStoreWebFilesArtifactResponse, error) + PutStarlarkPackageWithResponse(ctx context.Context, body PutStarlarkPackageJSONRequestBody, reqEditors ...RequestEditorFn) (*PutStarlarkPackageResponse, error) - // ApiContainerApiApiContainerServiceUploadFilesArtifactWithBodyWithResponse request with any body - ApiContainerApiApiContainerServiceUploadFilesArtifactWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceUploadFilesArtifactResponse, error) + // PostStarlarkPackagePackageId request with any body + PostStarlarkPackagePackageIdWithBodyWithResponse(ctx context.Context, packageId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostStarlarkPackagePackageIdResponse, error) - ApiContainerApiApiContainerServiceUploadFilesArtifactWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceUploadFilesArtifactJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceUploadFilesArtifactResponse, error) + PostStarlarkPackagePackageIdWithResponse(ctx context.Context, packageId string, body PostStarlarkPackagePackageIdJSONRequestBody, reqEditors ...RequestEditorFn) (*PostStarlarkPackagePackageIdResponse, error) - // ApiContainerApiApiContainerServiceUploadStarlarkPackageWithBodyWithResponse request with any body - ApiContainerApiApiContainerServiceUploadStarlarkPackageWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceUploadStarlarkPackageResponse, error) + // PostStarlarkScript request with any body + PostStarlarkScriptWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostStarlarkScriptResponse, error) - ApiContainerApiApiContainerServiceUploadStarlarkPackageWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceUploadStarlarkPackageJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceUploadStarlarkPackageResponse, error) - - // ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityWithBodyWithResponse request with any body - ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityResponse, error) - - ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityResponse, error) - - // ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityWithBodyWithResponse request with any body - ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityResponse, error) - - ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityResponse, error) + PostStarlarkScriptWithResponse(ctx context.Context, body PostStarlarkScriptJSONRequestBody, reqEditors ...RequestEditorFn) (*PostStarlarkScriptResponse, error) } -type ApiContainerApiApiContainerServiceConnectServicesResponse struct { +type GetArtifactResponse struct { Body []byte HTTPResponse *http.Response } // Status returns HTTPResponse.Status -func (r ApiContainerApiApiContainerServiceConnectServicesResponse) Status() string { +func (r GetArtifactResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -1918,20 +1676,20 @@ func (r ApiContainerApiApiContainerServiceConnectServicesResponse) Status() stri } // StatusCode returns HTTPResponse.StatusCode -func (r ApiContainerApiApiContainerServiceConnectServicesResponse) StatusCode() int { +func (r GetArtifactResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type ApiContainerApiApiContainerServiceDownloadFilesArtifactResponse struct { +type PutArtifactLocalFileResponse struct { Body []byte HTTPResponse *http.Response } // Status returns HTTPResponse.Status -func (r ApiContainerApiApiContainerServiceDownloadFilesArtifactResponse) Status() string { +func (r PutArtifactLocalFileResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -1939,20 +1697,20 @@ func (r ApiContainerApiApiContainerServiceDownloadFilesArtifactResponse) Status( } // StatusCode returns HTTPResponse.StatusCode -func (r ApiContainerApiApiContainerServiceDownloadFilesArtifactResponse) StatusCode() int { +func (r PutArtifactLocalFileResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type ApiContainerApiApiContainerServiceExecCommandResponse struct { +type PutArtifactRemoteFileResponse struct { Body []byte HTTPResponse *http.Response } // Status returns HTTPResponse.Status -func (r ApiContainerApiApiContainerServiceExecCommandResponse) Status() string { +func (r PutArtifactRemoteFileResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -1960,20 +1718,20 @@ func (r ApiContainerApiApiContainerServiceExecCommandResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ApiContainerApiApiContainerServiceExecCommandResponse) StatusCode() int { +func (r PutArtifactRemoteFileResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersResponse struct { +type PutArtifactServiceServiceIdentifierResponse struct { Body []byte HTTPResponse *http.Response } // Status returns HTTPResponse.Status -func (r ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersResponse) Status() string { +func (r PutArtifactServiceServiceIdentifierResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -1981,20 +1739,20 @@ func (r ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentif } // StatusCode returns HTTPResponse.StatusCode -func (r ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersResponse) StatusCode() int { +func (r PutArtifactServiceServiceIdentifierResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type ApiContainerApiApiContainerServiceGetServicesResponse struct { +type GetArtifactArtifactIdentifierResponse struct { Body []byte HTTPResponse *http.Response } // Status returns HTTPResponse.Status -func (r ApiContainerApiApiContainerServiceGetServicesResponse) Status() string { +func (r GetArtifactArtifactIdentifierResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -2002,20 +1760,20 @@ func (r ApiContainerApiApiContainerServiceGetServicesResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ApiContainerApiApiContainerServiceGetServicesResponse) StatusCode() int { +func (r GetArtifactArtifactIdentifierResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type ApiContainerApiApiContainerServiceGetStarlarkRunResponse struct { +type GetArtifactArtifactIdentifierDownloadResponse struct { Body []byte HTTPResponse *http.Response } // Status returns HTTPResponse.Status -func (r ApiContainerApiApiContainerServiceGetStarlarkRunResponse) Status() string { +func (r GetArtifactArtifactIdentifierDownloadResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -2023,20 +1781,20 @@ func (r ApiContainerApiApiContainerServiceGetStarlarkRunResponse) Status() strin } // StatusCode returns HTTPResponse.StatusCode -func (r ApiContainerApiApiContainerServiceGetStarlarkRunResponse) StatusCode() int { +func (r GetArtifactArtifactIdentifierDownloadResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type ApiContainerApiApiContainerServiceInspectFilesArtifactContentsResponse struct { +type GetServiceResponse struct { Body []byte HTTPResponse *http.Response } // Status returns HTTPResponse.Status -func (r ApiContainerApiApiContainerServiceInspectFilesArtifactContentsResponse) Status() string { +func (r GetServiceResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -2044,20 +1802,20 @@ func (r ApiContainerApiApiContainerServiceInspectFilesArtifactContentsResponse) } // StatusCode returns HTTPResponse.StatusCode -func (r ApiContainerApiApiContainerServiceInspectFilesArtifactContentsResponse) StatusCode() int { +func (r GetServiceResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsResponse struct { +type PostServiceConnectionResponse struct { Body []byte HTTPResponse *http.Response } // Status returns HTTPResponse.Status -func (r ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsResponse) Status() string { +func (r PostServiceConnectionResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -2065,20 +1823,20 @@ func (r ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsResponse } // StatusCode returns HTTPResponse.StatusCode -func (r ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsResponse) StatusCode() int { +func (r PostServiceConnectionResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type ApiContainerApiApiContainerServiceRunStarlarkPackageResponse struct { +type GetServiceServiceIdentifierResponse struct { Body []byte HTTPResponse *http.Response } // Status returns HTTPResponse.Status -func (r ApiContainerApiApiContainerServiceRunStarlarkPackageResponse) Status() string { +func (r GetServiceServiceIdentifierResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -2086,20 +1844,20 @@ func (r ApiContainerApiApiContainerServiceRunStarlarkPackageResponse) Status() s } // StatusCode returns HTTPResponse.StatusCode -func (r ApiContainerApiApiContainerServiceRunStarlarkPackageResponse) StatusCode() int { +func (r GetServiceServiceIdentifierResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type ApiContainerApiApiContainerServiceRunStarlarkScriptResponse struct { +type PostServiceServiceIdentifierCommandResponse struct { Body []byte HTTPResponse *http.Response } // Status returns HTTPResponse.Status -func (r ApiContainerApiApiContainerServiceRunStarlarkScriptResponse) Status() string { +func (r PostServiceServiceIdentifierCommandResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -2107,20 +1865,20 @@ func (r ApiContainerApiApiContainerServiceRunStarlarkScriptResponse) Status() st } // StatusCode returns HTTPResponse.StatusCode -func (r ApiContainerApiApiContainerServiceRunStarlarkScriptResponse) StatusCode() int { +func (r PostServiceServiceIdentifierCommandResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceResponse struct { +type PostServiceServiceIdentifierEndpointPortNumberAvailabilityResponse struct { Body []byte HTTPResponse *http.Response } // Status returns HTTPResponse.Status -func (r ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceResponse) Status() string { +func (r PostServiceServiceIdentifierEndpointPortNumberAvailabilityResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -2128,20 +1886,20 @@ func (r ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceResponse) } // StatusCode returns HTTPResponse.StatusCode -func (r ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceResponse) StatusCode() int { +func (r PostServiceServiceIdentifierEndpointPortNumberAvailabilityResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type ApiContainerApiApiContainerServiceStoreWebFilesArtifactResponse struct { +type GetStarlarkResponse struct { Body []byte HTTPResponse *http.Response } // Status returns HTTPResponse.Status -func (r ApiContainerApiApiContainerServiceStoreWebFilesArtifactResponse) Status() string { +func (r GetStarlarkResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -2149,20 +1907,20 @@ func (r ApiContainerApiApiContainerServiceStoreWebFilesArtifactResponse) Status( } // StatusCode returns HTTPResponse.StatusCode -func (r ApiContainerApiApiContainerServiceStoreWebFilesArtifactResponse) StatusCode() int { +func (r GetStarlarkResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type ApiContainerApiApiContainerServiceUploadFilesArtifactResponse struct { +type PutStarlarkPackageResponse struct { Body []byte HTTPResponse *http.Response } // Status returns HTTPResponse.Status -func (r ApiContainerApiApiContainerServiceUploadFilesArtifactResponse) Status() string { +func (r PutStarlarkPackageResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -2170,20 +1928,20 @@ func (r ApiContainerApiApiContainerServiceUploadFilesArtifactResponse) Status() } // StatusCode returns HTTPResponse.StatusCode -func (r ApiContainerApiApiContainerServiceUploadFilesArtifactResponse) StatusCode() int { +func (r PutStarlarkPackageResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type ApiContainerApiApiContainerServiceUploadStarlarkPackageResponse struct { +type PostStarlarkPackagePackageIdResponse struct { Body []byte HTTPResponse *http.Response } // Status returns HTTPResponse.Status -func (r ApiContainerApiApiContainerServiceUploadStarlarkPackageResponse) Status() string { +func (r PostStarlarkPackagePackageIdResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -2191,20 +1949,20 @@ func (r ApiContainerApiApiContainerServiceUploadStarlarkPackageResponse) Status( } // StatusCode returns HTTPResponse.StatusCode -func (r ApiContainerApiApiContainerServiceUploadStarlarkPackageResponse) StatusCode() int { +func (r PostStarlarkPackagePackageIdResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityResponse struct { +type PostStarlarkScriptResponse struct { Body []byte HTTPResponse *http.Response } // Status returns HTTPResponse.Status -func (r ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityResponse) Status() string { +func (r PostStarlarkScriptResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -2212,315 +1970,229 @@ func (r ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityResp } // StatusCode returns HTTPResponse.StatusCode -func (r ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityResponse) StatusCode() int { +func (r PostStarlarkScriptResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityResponse struct { - Body []byte - HTTPResponse *http.Response -} - -// Status returns HTTPResponse.Status -func (r ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -// ApiContainerApiApiContainerServiceConnectServicesWithBodyWithResponse request with arbitrary body returning *ApiContainerApiApiContainerServiceConnectServicesResponse -func (c *ClientWithResponses) ApiContainerApiApiContainerServiceConnectServicesWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceConnectServicesResponse, error) { - rsp, err := c.ApiContainerApiApiContainerServiceConnectServicesWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseApiContainerApiApiContainerServiceConnectServicesResponse(rsp) -} - -func (c *ClientWithResponses) ApiContainerApiApiContainerServiceConnectServicesWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceConnectServicesJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceConnectServicesResponse, error) { - rsp, err := c.ApiContainerApiApiContainerServiceConnectServices(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseApiContainerApiApiContainerServiceConnectServicesResponse(rsp) -} - -// ApiContainerApiApiContainerServiceDownloadFilesArtifactWithBodyWithResponse request with arbitrary body returning *ApiContainerApiApiContainerServiceDownloadFilesArtifactResponse -func (c *ClientWithResponses) ApiContainerApiApiContainerServiceDownloadFilesArtifactWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceDownloadFilesArtifactResponse, error) { - rsp, err := c.ApiContainerApiApiContainerServiceDownloadFilesArtifactWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseApiContainerApiApiContainerServiceDownloadFilesArtifactResponse(rsp) -} - -func (c *ClientWithResponses) ApiContainerApiApiContainerServiceDownloadFilesArtifactWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceDownloadFilesArtifactJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceDownloadFilesArtifactResponse, error) { - rsp, err := c.ApiContainerApiApiContainerServiceDownloadFilesArtifact(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseApiContainerApiApiContainerServiceDownloadFilesArtifactResponse(rsp) -} - -// ApiContainerApiApiContainerServiceExecCommandWithBodyWithResponse request with arbitrary body returning *ApiContainerApiApiContainerServiceExecCommandResponse -func (c *ClientWithResponses) ApiContainerApiApiContainerServiceExecCommandWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceExecCommandResponse, error) { - rsp, err := c.ApiContainerApiApiContainerServiceExecCommandWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseApiContainerApiApiContainerServiceExecCommandResponse(rsp) -} - -func (c *ClientWithResponses) ApiContainerApiApiContainerServiceExecCommandWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceExecCommandJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceExecCommandResponse, error) { - rsp, err := c.ApiContainerApiApiContainerServiceExecCommand(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseApiContainerApiApiContainerServiceExecCommandResponse(rsp) -} - -// ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersWithBodyWithResponse request with arbitrary body returning *ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersResponse -func (c *ClientWithResponses) ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersResponse, error) { - rsp, err := c.ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersResponse(rsp) -} - -func (c *ClientWithResponses) ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersResponse, error) { - rsp, err := c.ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiers(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersResponse(rsp) -} - -// ApiContainerApiApiContainerServiceGetServicesWithBodyWithResponse request with arbitrary body returning *ApiContainerApiApiContainerServiceGetServicesResponse -func (c *ClientWithResponses) ApiContainerApiApiContainerServiceGetServicesWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceGetServicesResponse, error) { - rsp, err := c.ApiContainerApiApiContainerServiceGetServicesWithBody(ctx, contentType, body, reqEditors...) +// GetArtifactWithResponse request returning *GetArtifactResponse +func (c *ClientWithResponses) GetArtifactWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetArtifactResponse, error) { + rsp, err := c.GetArtifact(ctx, reqEditors...) if err != nil { return nil, err } - return ParseApiContainerApiApiContainerServiceGetServicesResponse(rsp) + return ParseGetArtifactResponse(rsp) } -func (c *ClientWithResponses) ApiContainerApiApiContainerServiceGetServicesWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceGetServicesJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceGetServicesResponse, error) { - rsp, err := c.ApiContainerApiApiContainerServiceGetServices(ctx, body, reqEditors...) +// PutArtifactLocalFileWithBodyWithResponse request with arbitrary body returning *PutArtifactLocalFileResponse +func (c *ClientWithResponses) PutArtifactLocalFileWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutArtifactLocalFileResponse, error) { + rsp, err := c.PutArtifactLocalFileWithBody(ctx, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseApiContainerApiApiContainerServiceGetServicesResponse(rsp) + return ParsePutArtifactLocalFileResponse(rsp) } -// ApiContainerApiApiContainerServiceGetStarlarkRunWithBodyWithResponse request with arbitrary body returning *ApiContainerApiApiContainerServiceGetStarlarkRunResponse -func (c *ClientWithResponses) ApiContainerApiApiContainerServiceGetStarlarkRunWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceGetStarlarkRunResponse, error) { - rsp, err := c.ApiContainerApiApiContainerServiceGetStarlarkRunWithBody(ctx, contentType, body, reqEditors...) +func (c *ClientWithResponses) PutArtifactLocalFileWithResponse(ctx context.Context, body PutArtifactLocalFileJSONRequestBody, reqEditors ...RequestEditorFn) (*PutArtifactLocalFileResponse, error) { + rsp, err := c.PutArtifactLocalFile(ctx, body, reqEditors...) if err != nil { return nil, err } - return ParseApiContainerApiApiContainerServiceGetStarlarkRunResponse(rsp) + return ParsePutArtifactLocalFileResponse(rsp) } -func (c *ClientWithResponses) ApiContainerApiApiContainerServiceGetStarlarkRunWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceGetStarlarkRunJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceGetStarlarkRunResponse, error) { - rsp, err := c.ApiContainerApiApiContainerServiceGetStarlarkRun(ctx, body, reqEditors...) +// PutArtifactRemoteFileWithBodyWithResponse request with arbitrary body returning *PutArtifactRemoteFileResponse +func (c *ClientWithResponses) PutArtifactRemoteFileWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutArtifactRemoteFileResponse, error) { + rsp, err := c.PutArtifactRemoteFileWithBody(ctx, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseApiContainerApiApiContainerServiceGetStarlarkRunResponse(rsp) + return ParsePutArtifactRemoteFileResponse(rsp) } -// ApiContainerApiApiContainerServiceInspectFilesArtifactContentsWithBodyWithResponse request with arbitrary body returning *ApiContainerApiApiContainerServiceInspectFilesArtifactContentsResponse -func (c *ClientWithResponses) ApiContainerApiApiContainerServiceInspectFilesArtifactContentsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceInspectFilesArtifactContentsResponse, error) { - rsp, err := c.ApiContainerApiApiContainerServiceInspectFilesArtifactContentsWithBody(ctx, contentType, body, reqEditors...) +func (c *ClientWithResponses) PutArtifactRemoteFileWithResponse(ctx context.Context, body PutArtifactRemoteFileJSONRequestBody, reqEditors ...RequestEditorFn) (*PutArtifactRemoteFileResponse, error) { + rsp, err := c.PutArtifactRemoteFile(ctx, body, reqEditors...) if err != nil { return nil, err } - return ParseApiContainerApiApiContainerServiceInspectFilesArtifactContentsResponse(rsp) + return ParsePutArtifactRemoteFileResponse(rsp) } -func (c *ClientWithResponses) ApiContainerApiApiContainerServiceInspectFilesArtifactContentsWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceInspectFilesArtifactContentsJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceInspectFilesArtifactContentsResponse, error) { - rsp, err := c.ApiContainerApiApiContainerServiceInspectFilesArtifactContents(ctx, body, reqEditors...) +// PutArtifactServiceServiceIdentifierWithBodyWithResponse request with arbitrary body returning *PutArtifactServiceServiceIdentifierResponse +func (c *ClientWithResponses) PutArtifactServiceServiceIdentifierWithBodyWithResponse(ctx context.Context, serviceIdentifier string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutArtifactServiceServiceIdentifierResponse, error) { + rsp, err := c.PutArtifactServiceServiceIdentifierWithBody(ctx, serviceIdentifier, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseApiContainerApiApiContainerServiceInspectFilesArtifactContentsResponse(rsp) + return ParsePutArtifactServiceServiceIdentifierResponse(rsp) } -// ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsWithBodyWithResponse request with arbitrary body returning *ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsResponse -func (c *ClientWithResponses) ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsResponse, error) { - rsp, err := c.ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsWithBody(ctx, contentType, body, reqEditors...) +func (c *ClientWithResponses) PutArtifactServiceServiceIdentifierWithResponse(ctx context.Context, serviceIdentifier string, body PutArtifactServiceServiceIdentifierJSONRequestBody, reqEditors ...RequestEditorFn) (*PutArtifactServiceServiceIdentifierResponse, error) { + rsp, err := c.PutArtifactServiceServiceIdentifier(ctx, serviceIdentifier, body, reqEditors...) if err != nil { return nil, err } - return ParseApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsResponse(rsp) + return ParsePutArtifactServiceServiceIdentifierResponse(rsp) } -func (c *ClientWithResponses) ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsResponse, error) { - rsp, err := c.ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuids(ctx, body, reqEditors...) +// GetArtifactArtifactIdentifierWithResponse request returning *GetArtifactArtifactIdentifierResponse +func (c *ClientWithResponses) GetArtifactArtifactIdentifierWithResponse(ctx context.Context, artifactIdentifier string, reqEditors ...RequestEditorFn) (*GetArtifactArtifactIdentifierResponse, error) { + rsp, err := c.GetArtifactArtifactIdentifier(ctx, artifactIdentifier, reqEditors...) if err != nil { return nil, err } - return ParseApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsResponse(rsp) + return ParseGetArtifactArtifactIdentifierResponse(rsp) } -// ApiContainerApiApiContainerServiceRunStarlarkPackageWithBodyWithResponse request with arbitrary body returning *ApiContainerApiApiContainerServiceRunStarlarkPackageResponse -func (c *ClientWithResponses) ApiContainerApiApiContainerServiceRunStarlarkPackageWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceRunStarlarkPackageResponse, error) { - rsp, err := c.ApiContainerApiApiContainerServiceRunStarlarkPackageWithBody(ctx, contentType, body, reqEditors...) +// GetArtifactArtifactIdentifierDownloadWithResponse request returning *GetArtifactArtifactIdentifierDownloadResponse +func (c *ClientWithResponses) GetArtifactArtifactIdentifierDownloadWithResponse(ctx context.Context, artifactIdentifier string, reqEditors ...RequestEditorFn) (*GetArtifactArtifactIdentifierDownloadResponse, error) { + rsp, err := c.GetArtifactArtifactIdentifierDownload(ctx, artifactIdentifier, reqEditors...) if err != nil { return nil, err } - return ParseApiContainerApiApiContainerServiceRunStarlarkPackageResponse(rsp) + return ParseGetArtifactArtifactIdentifierDownloadResponse(rsp) } -func (c *ClientWithResponses) ApiContainerApiApiContainerServiceRunStarlarkPackageWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceRunStarlarkPackageJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceRunStarlarkPackageResponse, error) { - rsp, err := c.ApiContainerApiApiContainerServiceRunStarlarkPackage(ctx, body, reqEditors...) +// GetServiceWithResponse request returning *GetServiceResponse +func (c *ClientWithResponses) GetServiceWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetServiceResponse, error) { + rsp, err := c.GetService(ctx, reqEditors...) if err != nil { return nil, err } - return ParseApiContainerApiApiContainerServiceRunStarlarkPackageResponse(rsp) + return ParseGetServiceResponse(rsp) } -// ApiContainerApiApiContainerServiceRunStarlarkScriptWithBodyWithResponse request with arbitrary body returning *ApiContainerApiApiContainerServiceRunStarlarkScriptResponse -func (c *ClientWithResponses) ApiContainerApiApiContainerServiceRunStarlarkScriptWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceRunStarlarkScriptResponse, error) { - rsp, err := c.ApiContainerApiApiContainerServiceRunStarlarkScriptWithBody(ctx, contentType, body, reqEditors...) +// PostServiceConnectionWithBodyWithResponse request with arbitrary body returning *PostServiceConnectionResponse +func (c *ClientWithResponses) PostServiceConnectionWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostServiceConnectionResponse, error) { + rsp, err := c.PostServiceConnectionWithBody(ctx, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseApiContainerApiApiContainerServiceRunStarlarkScriptResponse(rsp) + return ParsePostServiceConnectionResponse(rsp) } -func (c *ClientWithResponses) ApiContainerApiApiContainerServiceRunStarlarkScriptWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceRunStarlarkScriptJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceRunStarlarkScriptResponse, error) { - rsp, err := c.ApiContainerApiApiContainerServiceRunStarlarkScript(ctx, body, reqEditors...) +func (c *ClientWithResponses) PostServiceConnectionWithResponse(ctx context.Context, body PostServiceConnectionJSONRequestBody, reqEditors ...RequestEditorFn) (*PostServiceConnectionResponse, error) { + rsp, err := c.PostServiceConnection(ctx, body, reqEditors...) if err != nil { return nil, err } - return ParseApiContainerApiApiContainerServiceRunStarlarkScriptResponse(rsp) + return ParsePostServiceConnectionResponse(rsp) } -// ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceWithBodyWithResponse request with arbitrary body returning *ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceResponse -func (c *ClientWithResponses) ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceResponse, error) { - rsp, err := c.ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceWithBody(ctx, contentType, body, reqEditors...) +// GetServiceServiceIdentifierWithResponse request returning *GetServiceServiceIdentifierResponse +func (c *ClientWithResponses) GetServiceServiceIdentifierWithResponse(ctx context.Context, serviceIdentifier string, params *GetServiceServiceIdentifierParams, reqEditors ...RequestEditorFn) (*GetServiceServiceIdentifierResponse, error) { + rsp, err := c.GetServiceServiceIdentifier(ctx, serviceIdentifier, params, reqEditors...) if err != nil { return nil, err } - return ParseApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceResponse(rsp) + return ParseGetServiceServiceIdentifierResponse(rsp) } -func (c *ClientWithResponses) ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceResponse, error) { - rsp, err := c.ApiContainerApiApiContainerServiceStoreFilesArtifactFromService(ctx, body, reqEditors...) +// PostServiceServiceIdentifierCommandWithBodyWithResponse request with arbitrary body returning *PostServiceServiceIdentifierCommandResponse +func (c *ClientWithResponses) PostServiceServiceIdentifierCommandWithBodyWithResponse(ctx context.Context, serviceIdentifier string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostServiceServiceIdentifierCommandResponse, error) { + rsp, err := c.PostServiceServiceIdentifierCommandWithBody(ctx, serviceIdentifier, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceResponse(rsp) + return ParsePostServiceServiceIdentifierCommandResponse(rsp) } -// ApiContainerApiApiContainerServiceStoreWebFilesArtifactWithBodyWithResponse request with arbitrary body returning *ApiContainerApiApiContainerServiceStoreWebFilesArtifactResponse -func (c *ClientWithResponses) ApiContainerApiApiContainerServiceStoreWebFilesArtifactWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceStoreWebFilesArtifactResponse, error) { - rsp, err := c.ApiContainerApiApiContainerServiceStoreWebFilesArtifactWithBody(ctx, contentType, body, reqEditors...) +func (c *ClientWithResponses) PostServiceServiceIdentifierCommandWithResponse(ctx context.Context, serviceIdentifier string, body PostServiceServiceIdentifierCommandJSONRequestBody, reqEditors ...RequestEditorFn) (*PostServiceServiceIdentifierCommandResponse, error) { + rsp, err := c.PostServiceServiceIdentifierCommand(ctx, serviceIdentifier, body, reqEditors...) if err != nil { return nil, err } - return ParseApiContainerApiApiContainerServiceStoreWebFilesArtifactResponse(rsp) + return ParsePostServiceServiceIdentifierCommandResponse(rsp) } -func (c *ClientWithResponses) ApiContainerApiApiContainerServiceStoreWebFilesArtifactWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceStoreWebFilesArtifactJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceStoreWebFilesArtifactResponse, error) { - rsp, err := c.ApiContainerApiApiContainerServiceStoreWebFilesArtifact(ctx, body, reqEditors...) +// PostServiceServiceIdentifierEndpointPortNumberAvailabilityWithBodyWithResponse request with arbitrary body returning *PostServiceServiceIdentifierEndpointPortNumberAvailabilityResponse +func (c *ClientWithResponses) PostServiceServiceIdentifierEndpointPortNumberAvailabilityWithBodyWithResponse(ctx context.Context, serviceIdentifier string, portNumber int, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostServiceServiceIdentifierEndpointPortNumberAvailabilityResponse, error) { + rsp, err := c.PostServiceServiceIdentifierEndpointPortNumberAvailabilityWithBody(ctx, serviceIdentifier, portNumber, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseApiContainerApiApiContainerServiceStoreWebFilesArtifactResponse(rsp) + return ParsePostServiceServiceIdentifierEndpointPortNumberAvailabilityResponse(rsp) } -// ApiContainerApiApiContainerServiceUploadFilesArtifactWithBodyWithResponse request with arbitrary body returning *ApiContainerApiApiContainerServiceUploadFilesArtifactResponse -func (c *ClientWithResponses) ApiContainerApiApiContainerServiceUploadFilesArtifactWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceUploadFilesArtifactResponse, error) { - rsp, err := c.ApiContainerApiApiContainerServiceUploadFilesArtifactWithBody(ctx, contentType, body, reqEditors...) +func (c *ClientWithResponses) PostServiceServiceIdentifierEndpointPortNumberAvailabilityWithResponse(ctx context.Context, serviceIdentifier string, portNumber int, body PostServiceServiceIdentifierEndpointPortNumberAvailabilityJSONRequestBody, reqEditors ...RequestEditorFn) (*PostServiceServiceIdentifierEndpointPortNumberAvailabilityResponse, error) { + rsp, err := c.PostServiceServiceIdentifierEndpointPortNumberAvailability(ctx, serviceIdentifier, portNumber, body, reqEditors...) if err != nil { return nil, err } - return ParseApiContainerApiApiContainerServiceUploadFilesArtifactResponse(rsp) + return ParsePostServiceServiceIdentifierEndpointPortNumberAvailabilityResponse(rsp) } -func (c *ClientWithResponses) ApiContainerApiApiContainerServiceUploadFilesArtifactWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceUploadFilesArtifactJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceUploadFilesArtifactResponse, error) { - rsp, err := c.ApiContainerApiApiContainerServiceUploadFilesArtifact(ctx, body, reqEditors...) +// GetStarlarkWithResponse request returning *GetStarlarkResponse +func (c *ClientWithResponses) GetStarlarkWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetStarlarkResponse, error) { + rsp, err := c.GetStarlark(ctx, reqEditors...) if err != nil { return nil, err } - return ParseApiContainerApiApiContainerServiceUploadFilesArtifactResponse(rsp) + return ParseGetStarlarkResponse(rsp) } -// ApiContainerApiApiContainerServiceUploadStarlarkPackageWithBodyWithResponse request with arbitrary body returning *ApiContainerApiApiContainerServiceUploadStarlarkPackageResponse -func (c *ClientWithResponses) ApiContainerApiApiContainerServiceUploadStarlarkPackageWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceUploadStarlarkPackageResponse, error) { - rsp, err := c.ApiContainerApiApiContainerServiceUploadStarlarkPackageWithBody(ctx, contentType, body, reqEditors...) +// PutStarlarkPackageWithBodyWithResponse request with arbitrary body returning *PutStarlarkPackageResponse +func (c *ClientWithResponses) PutStarlarkPackageWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutStarlarkPackageResponse, error) { + rsp, err := c.PutStarlarkPackageWithBody(ctx, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseApiContainerApiApiContainerServiceUploadStarlarkPackageResponse(rsp) + return ParsePutStarlarkPackageResponse(rsp) } -func (c *ClientWithResponses) ApiContainerApiApiContainerServiceUploadStarlarkPackageWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceUploadStarlarkPackageJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceUploadStarlarkPackageResponse, error) { - rsp, err := c.ApiContainerApiApiContainerServiceUploadStarlarkPackage(ctx, body, reqEditors...) +func (c *ClientWithResponses) PutStarlarkPackageWithResponse(ctx context.Context, body PutStarlarkPackageJSONRequestBody, reqEditors ...RequestEditorFn) (*PutStarlarkPackageResponse, error) { + rsp, err := c.PutStarlarkPackage(ctx, body, reqEditors...) if err != nil { return nil, err } - return ParseApiContainerApiApiContainerServiceUploadStarlarkPackageResponse(rsp) + return ParsePutStarlarkPackageResponse(rsp) } -// ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityWithBodyWithResponse request with arbitrary body returning *ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityResponse -func (c *ClientWithResponses) ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityResponse, error) { - rsp, err := c.ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityWithBody(ctx, contentType, body, reqEditors...) +// PostStarlarkPackagePackageIdWithBodyWithResponse request with arbitrary body returning *PostStarlarkPackagePackageIdResponse +func (c *ClientWithResponses) PostStarlarkPackagePackageIdWithBodyWithResponse(ctx context.Context, packageId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostStarlarkPackagePackageIdResponse, error) { + rsp, err := c.PostStarlarkPackagePackageIdWithBody(ctx, packageId, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityResponse(rsp) + return ParsePostStarlarkPackagePackageIdResponse(rsp) } -func (c *ClientWithResponses) ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityResponse, error) { - rsp, err := c.ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailability(ctx, body, reqEditors...) +func (c *ClientWithResponses) PostStarlarkPackagePackageIdWithResponse(ctx context.Context, packageId string, body PostStarlarkPackagePackageIdJSONRequestBody, reqEditors ...RequestEditorFn) (*PostStarlarkPackagePackageIdResponse, error) { + rsp, err := c.PostStarlarkPackagePackageId(ctx, packageId, body, reqEditors...) if err != nil { return nil, err } - return ParseApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityResponse(rsp) + return ParsePostStarlarkPackagePackageIdResponse(rsp) } -// ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityWithBodyWithResponse request with arbitrary body returning *ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityResponse -func (c *ClientWithResponses) ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityResponse, error) { - rsp, err := c.ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityWithBody(ctx, contentType, body, reqEditors...) +// PostStarlarkScriptWithBodyWithResponse request with arbitrary body returning *PostStarlarkScriptResponse +func (c *ClientWithResponses) PostStarlarkScriptWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostStarlarkScriptResponse, error) { + rsp, err := c.PostStarlarkScriptWithBody(ctx, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityResponse(rsp) + return ParsePostStarlarkScriptResponse(rsp) } -func (c *ClientWithResponses) ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityWithResponse(ctx context.Context, body ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityJSONRequestBody, reqEditors ...RequestEditorFn) (*ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityResponse, error) { - rsp, err := c.ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailability(ctx, body, reqEditors...) +func (c *ClientWithResponses) PostStarlarkScriptWithResponse(ctx context.Context, body PostStarlarkScriptJSONRequestBody, reqEditors ...RequestEditorFn) (*PostStarlarkScriptResponse, error) { + rsp, err := c.PostStarlarkScript(ctx, body, reqEditors...) if err != nil { return nil, err } - return ParseApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityResponse(rsp) + return ParsePostStarlarkScriptResponse(rsp) } -// ParseApiContainerApiApiContainerServiceConnectServicesResponse parses an HTTP response from a ApiContainerApiApiContainerServiceConnectServicesWithResponse call -func ParseApiContainerApiApiContainerServiceConnectServicesResponse(rsp *http.Response) (*ApiContainerApiApiContainerServiceConnectServicesResponse, error) { +// ParseGetArtifactResponse parses an HTTP response from a GetArtifactWithResponse call +func ParseGetArtifactResponse(rsp *http.Response) (*GetArtifactResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ApiContainerApiApiContainerServiceConnectServicesResponse{ + response := &GetArtifactResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -2528,15 +2200,15 @@ func ParseApiContainerApiApiContainerServiceConnectServicesResponse(rsp *http.Re return response, nil } -// ParseApiContainerApiApiContainerServiceDownloadFilesArtifactResponse parses an HTTP response from a ApiContainerApiApiContainerServiceDownloadFilesArtifactWithResponse call -func ParseApiContainerApiApiContainerServiceDownloadFilesArtifactResponse(rsp *http.Response) (*ApiContainerApiApiContainerServiceDownloadFilesArtifactResponse, error) { +// ParsePutArtifactLocalFileResponse parses an HTTP response from a PutArtifactLocalFileWithResponse call +func ParsePutArtifactLocalFileResponse(rsp *http.Response) (*PutArtifactLocalFileResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ApiContainerApiApiContainerServiceDownloadFilesArtifactResponse{ + response := &PutArtifactLocalFileResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -2544,15 +2216,15 @@ func ParseApiContainerApiApiContainerServiceDownloadFilesArtifactResponse(rsp *h return response, nil } -// ParseApiContainerApiApiContainerServiceExecCommandResponse parses an HTTP response from a ApiContainerApiApiContainerServiceExecCommandWithResponse call -func ParseApiContainerApiApiContainerServiceExecCommandResponse(rsp *http.Response) (*ApiContainerApiApiContainerServiceExecCommandResponse, error) { +// ParsePutArtifactRemoteFileResponse parses an HTTP response from a PutArtifactRemoteFileWithResponse call +func ParsePutArtifactRemoteFileResponse(rsp *http.Response) (*PutArtifactRemoteFileResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ApiContainerApiApiContainerServiceExecCommandResponse{ + response := &PutArtifactRemoteFileResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -2560,15 +2232,15 @@ func ParseApiContainerApiApiContainerServiceExecCommandResponse(rsp *http.Respon return response, nil } -// ParseApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersResponse parses an HTTP response from a ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersWithResponse call -func ParseApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersResponse(rsp *http.Response) (*ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersResponse, error) { +// ParsePutArtifactServiceServiceIdentifierResponse parses an HTTP response from a PutArtifactServiceServiceIdentifierWithResponse call +func ParsePutArtifactServiceServiceIdentifierResponse(rsp *http.Response) (*PutArtifactServiceServiceIdentifierResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiersResponse{ + response := &PutArtifactServiceServiceIdentifierResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -2576,15 +2248,15 @@ func ParseApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdent return response, nil } -// ParseApiContainerApiApiContainerServiceGetServicesResponse parses an HTTP response from a ApiContainerApiApiContainerServiceGetServicesWithResponse call -func ParseApiContainerApiApiContainerServiceGetServicesResponse(rsp *http.Response) (*ApiContainerApiApiContainerServiceGetServicesResponse, error) { +// ParseGetArtifactArtifactIdentifierResponse parses an HTTP response from a GetArtifactArtifactIdentifierWithResponse call +func ParseGetArtifactArtifactIdentifierResponse(rsp *http.Response) (*GetArtifactArtifactIdentifierResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ApiContainerApiApiContainerServiceGetServicesResponse{ + response := &GetArtifactArtifactIdentifierResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -2592,15 +2264,15 @@ func ParseApiContainerApiApiContainerServiceGetServicesResponse(rsp *http.Respon return response, nil } -// ParseApiContainerApiApiContainerServiceGetStarlarkRunResponse parses an HTTP response from a ApiContainerApiApiContainerServiceGetStarlarkRunWithResponse call -func ParseApiContainerApiApiContainerServiceGetStarlarkRunResponse(rsp *http.Response) (*ApiContainerApiApiContainerServiceGetStarlarkRunResponse, error) { +// ParseGetArtifactArtifactIdentifierDownloadResponse parses an HTTP response from a GetArtifactArtifactIdentifierDownloadWithResponse call +func ParseGetArtifactArtifactIdentifierDownloadResponse(rsp *http.Response) (*GetArtifactArtifactIdentifierDownloadResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ApiContainerApiApiContainerServiceGetStarlarkRunResponse{ + response := &GetArtifactArtifactIdentifierDownloadResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -2608,15 +2280,15 @@ func ParseApiContainerApiApiContainerServiceGetStarlarkRunResponse(rsp *http.Res return response, nil } -// ParseApiContainerApiApiContainerServiceInspectFilesArtifactContentsResponse parses an HTTP response from a ApiContainerApiApiContainerServiceInspectFilesArtifactContentsWithResponse call -func ParseApiContainerApiApiContainerServiceInspectFilesArtifactContentsResponse(rsp *http.Response) (*ApiContainerApiApiContainerServiceInspectFilesArtifactContentsResponse, error) { +// ParseGetServiceResponse parses an HTTP response from a GetServiceWithResponse call +func ParseGetServiceResponse(rsp *http.Response) (*GetServiceResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ApiContainerApiApiContainerServiceInspectFilesArtifactContentsResponse{ + response := &GetServiceResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -2624,15 +2296,15 @@ func ParseApiContainerApiApiContainerServiceInspectFilesArtifactContentsResponse return response, nil } -// ParseApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsResponse parses an HTTP response from a ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsWithResponse call -func ParseApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsResponse(rsp *http.Response) (*ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsResponse, error) { +// ParsePostServiceConnectionResponse parses an HTTP response from a PostServiceConnectionWithResponse call +func ParsePostServiceConnectionResponse(rsp *http.Response) (*PostServiceConnectionResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsResponse{ + response := &PostServiceConnectionResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -2640,15 +2312,15 @@ func ParseApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuidsRespon return response, nil } -// ParseApiContainerApiApiContainerServiceRunStarlarkPackageResponse parses an HTTP response from a ApiContainerApiApiContainerServiceRunStarlarkPackageWithResponse call -func ParseApiContainerApiApiContainerServiceRunStarlarkPackageResponse(rsp *http.Response) (*ApiContainerApiApiContainerServiceRunStarlarkPackageResponse, error) { +// ParseGetServiceServiceIdentifierResponse parses an HTTP response from a GetServiceServiceIdentifierWithResponse call +func ParseGetServiceServiceIdentifierResponse(rsp *http.Response) (*GetServiceServiceIdentifierResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ApiContainerApiApiContainerServiceRunStarlarkPackageResponse{ + response := &GetServiceServiceIdentifierResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -2656,15 +2328,15 @@ func ParseApiContainerApiApiContainerServiceRunStarlarkPackageResponse(rsp *http return response, nil } -// ParseApiContainerApiApiContainerServiceRunStarlarkScriptResponse parses an HTTP response from a ApiContainerApiApiContainerServiceRunStarlarkScriptWithResponse call -func ParseApiContainerApiApiContainerServiceRunStarlarkScriptResponse(rsp *http.Response) (*ApiContainerApiApiContainerServiceRunStarlarkScriptResponse, error) { +// ParsePostServiceServiceIdentifierCommandResponse parses an HTTP response from a PostServiceServiceIdentifierCommandWithResponse call +func ParsePostServiceServiceIdentifierCommandResponse(rsp *http.Response) (*PostServiceServiceIdentifierCommandResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ApiContainerApiApiContainerServiceRunStarlarkScriptResponse{ + response := &PostServiceServiceIdentifierCommandResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -2672,15 +2344,15 @@ func ParseApiContainerApiApiContainerServiceRunStarlarkScriptResponse(rsp *http. return response, nil } -// ParseApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceResponse parses an HTTP response from a ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceWithResponse call -func ParseApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceResponse(rsp *http.Response) (*ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceResponse, error) { +// ParsePostServiceServiceIdentifierEndpointPortNumberAvailabilityResponse parses an HTTP response from a PostServiceServiceIdentifierEndpointPortNumberAvailabilityWithResponse call +func ParsePostServiceServiceIdentifierEndpointPortNumberAvailabilityResponse(rsp *http.Response) (*PostServiceServiceIdentifierEndpointPortNumberAvailabilityResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceResponse{ + response := &PostServiceServiceIdentifierEndpointPortNumberAvailabilityResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -2688,15 +2360,15 @@ func ParseApiContainerApiApiContainerServiceStoreFilesArtifactFromServiceRespons return response, nil } -// ParseApiContainerApiApiContainerServiceStoreWebFilesArtifactResponse parses an HTTP response from a ApiContainerApiApiContainerServiceStoreWebFilesArtifactWithResponse call -func ParseApiContainerApiApiContainerServiceStoreWebFilesArtifactResponse(rsp *http.Response) (*ApiContainerApiApiContainerServiceStoreWebFilesArtifactResponse, error) { +// ParseGetStarlarkResponse parses an HTTP response from a GetStarlarkWithResponse call +func ParseGetStarlarkResponse(rsp *http.Response) (*GetStarlarkResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ApiContainerApiApiContainerServiceStoreWebFilesArtifactResponse{ + response := &GetStarlarkResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -2704,15 +2376,15 @@ func ParseApiContainerApiApiContainerServiceStoreWebFilesArtifactResponse(rsp *h return response, nil } -// ParseApiContainerApiApiContainerServiceUploadFilesArtifactResponse parses an HTTP response from a ApiContainerApiApiContainerServiceUploadFilesArtifactWithResponse call -func ParseApiContainerApiApiContainerServiceUploadFilesArtifactResponse(rsp *http.Response) (*ApiContainerApiApiContainerServiceUploadFilesArtifactResponse, error) { +// ParsePutStarlarkPackageResponse parses an HTTP response from a PutStarlarkPackageWithResponse call +func ParsePutStarlarkPackageResponse(rsp *http.Response) (*PutStarlarkPackageResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ApiContainerApiApiContainerServiceUploadFilesArtifactResponse{ + response := &PutStarlarkPackageResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -2720,15 +2392,15 @@ func ParseApiContainerApiApiContainerServiceUploadFilesArtifactResponse(rsp *htt return response, nil } -// ParseApiContainerApiApiContainerServiceUploadStarlarkPackageResponse parses an HTTP response from a ApiContainerApiApiContainerServiceUploadStarlarkPackageWithResponse call -func ParseApiContainerApiApiContainerServiceUploadStarlarkPackageResponse(rsp *http.Response) (*ApiContainerApiApiContainerServiceUploadStarlarkPackageResponse, error) { +// ParsePostStarlarkPackagePackageIdResponse parses an HTTP response from a PostStarlarkPackagePackageIdWithResponse call +func ParsePostStarlarkPackagePackageIdResponse(rsp *http.Response) (*PostStarlarkPackagePackageIdResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ApiContainerApiApiContainerServiceUploadStarlarkPackageResponse{ + response := &PostStarlarkPackagePackageIdResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -2736,31 +2408,15 @@ func ParseApiContainerApiApiContainerServiceUploadStarlarkPackageResponse(rsp *h return response, nil } -// ParseApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityResponse parses an HTTP response from a ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityWithResponse call -func ParseApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityResponse(rsp *http.Response) (*ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityResponse, error) { +// ParsePostStarlarkScriptResponse parses an HTTP response from a PostStarlarkScriptWithResponse call +func ParsePostStarlarkScriptResponse(rsp *http.Response) (*PostStarlarkScriptResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailabilityResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - return response, nil -} - -// ParseApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityResponse parses an HTTP response from a ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityWithResponse call -func ParseApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityResponse(rsp *http.Response) (*ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityResponse{ + response := &PostStarlarkScriptResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -2771,53 +2427,50 @@ func ParseApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailabilityR // ServerInterface represents all server handlers. type ServerInterface interface { - // (POST /api_container_api.ApiContainerService/ConnectServices) - ApiContainerApiApiContainerServiceConnectServices(ctx echo.Context) error - - // (POST /api_container_api.ApiContainerService/DownloadFilesArtifact) - ApiContainerApiApiContainerServiceDownloadFilesArtifact(ctx echo.Context) error + // (GET /artifact) + GetArtifact(ctx echo.Context) error - // (POST /api_container_api.ApiContainerService/ExecCommand) - ApiContainerApiApiContainerServiceExecCommand(ctx echo.Context) error + // (PUT /artifact/local-file) + PutArtifactLocalFile(ctx echo.Context) error - // (POST /api_container_api.ApiContainerService/GetExistingAndHistoricalServiceIdentifiers) - ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiers(ctx echo.Context) error + // (PUT /artifact/remote-file) + PutArtifactRemoteFile(ctx echo.Context) error - // (POST /api_container_api.ApiContainerService/GetServices) - ApiContainerApiApiContainerServiceGetServices(ctx echo.Context) error + // (PUT /artifact/service/{service_identifier}) + PutArtifactServiceServiceIdentifier(ctx echo.Context, serviceIdentifier string) error - // (POST /api_container_api.ApiContainerService/GetStarlarkRun) - ApiContainerApiApiContainerServiceGetStarlarkRun(ctx echo.Context) error + // (GET /artifact/{artifact_identifier}) + GetArtifactArtifactIdentifier(ctx echo.Context, artifactIdentifier string) error - // (POST /api_container_api.ApiContainerService/InspectFilesArtifactContents) - ApiContainerApiApiContainerServiceInspectFilesArtifactContents(ctx echo.Context) error + // (GET /artifact/{artifact_identifier}/download) + GetArtifactArtifactIdentifierDownload(ctx echo.Context, artifactIdentifier string) error - // (POST /api_container_api.ApiContainerService/ListFilesArtifactNamesAndUuids) - ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuids(ctx echo.Context) error + // (GET /service) + GetService(ctx echo.Context) error - // (POST /api_container_api.ApiContainerService/RunStarlarkPackage) - ApiContainerApiApiContainerServiceRunStarlarkPackage(ctx echo.Context) error + // (POST /service/connection) + PostServiceConnection(ctx echo.Context) error - // (POST /api_container_api.ApiContainerService/RunStarlarkScript) - ApiContainerApiApiContainerServiceRunStarlarkScript(ctx echo.Context) error + // (GET /service/{service_identifier}) + GetServiceServiceIdentifier(ctx echo.Context, serviceIdentifier string, params GetServiceServiceIdentifierParams) error - // (POST /api_container_api.ApiContainerService/StoreFilesArtifactFromService) - ApiContainerApiApiContainerServiceStoreFilesArtifactFromService(ctx echo.Context) error + // (POST /service/{service_identifier}/command) + PostServiceServiceIdentifierCommand(ctx echo.Context, serviceIdentifier string) error - // (POST /api_container_api.ApiContainerService/StoreWebFilesArtifact) - ApiContainerApiApiContainerServiceStoreWebFilesArtifact(ctx echo.Context) error + // (POST /service/{service_identifier}/endpoint/{port_number}/availability) + PostServiceServiceIdentifierEndpointPortNumberAvailability(ctx echo.Context, serviceIdentifier string, portNumber int) error - // (POST /api_container_api.ApiContainerService/UploadFilesArtifact) - ApiContainerApiApiContainerServiceUploadFilesArtifact(ctx echo.Context) error + // (GET /starlark) + GetStarlark(ctx echo.Context) error - // (POST /api_container_api.ApiContainerService/UploadStarlarkPackage) - ApiContainerApiApiContainerServiceUploadStarlarkPackage(ctx echo.Context) error + // (PUT /starlark/package) + PutStarlarkPackage(ctx echo.Context) error - // (POST /api_container_api.ApiContainerService/WaitForHttpGetEndpointAvailability) - ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailability(ctx echo.Context) error + // (POST /starlark/package/{package_id}) + PostStarlarkPackagePackageId(ctx echo.Context, packageId string) error - // (POST /api_container_api.ApiContainerService/WaitForHttpPostEndpointAvailability) - ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailability(ctx echo.Context) error + // (POST /starlark/script) + PostStarlarkScript(ctx echo.Context) error } // ServerInterfaceWrapper converts echo contexts to parameters. @@ -2825,147 +2478,204 @@ type ServerInterfaceWrapper struct { Handler ServerInterface } -// ApiContainerApiApiContainerServiceConnectServices converts echo context to params. -func (w *ServerInterfaceWrapper) ApiContainerApiApiContainerServiceConnectServices(ctx echo.Context) error { +// GetArtifact converts echo context to params. +func (w *ServerInterfaceWrapper) GetArtifact(ctx echo.Context) error { var err error - // Invoke the callback with all the unmarshaled arguments - err = w.Handler.ApiContainerApiApiContainerServiceConnectServices(ctx) + // Invoke the callback with all the unmarshalled arguments + err = w.Handler.GetArtifact(ctx) return err } -// ApiContainerApiApiContainerServiceDownloadFilesArtifact converts echo context to params. -func (w *ServerInterfaceWrapper) ApiContainerApiApiContainerServiceDownloadFilesArtifact(ctx echo.Context) error { +// PutArtifactLocalFile converts echo context to params. +func (w *ServerInterfaceWrapper) PutArtifactLocalFile(ctx echo.Context) error { var err error - // Invoke the callback with all the unmarshaled arguments - err = w.Handler.ApiContainerApiApiContainerServiceDownloadFilesArtifact(ctx) + // Invoke the callback with all the unmarshalled arguments + err = w.Handler.PutArtifactLocalFile(ctx) return err } -// ApiContainerApiApiContainerServiceExecCommand converts echo context to params. -func (w *ServerInterfaceWrapper) ApiContainerApiApiContainerServiceExecCommand(ctx echo.Context) error { +// PutArtifactRemoteFile converts echo context to params. +func (w *ServerInterfaceWrapper) PutArtifactRemoteFile(ctx echo.Context) error { var err error - // Invoke the callback with all the unmarshaled arguments - err = w.Handler.ApiContainerApiApiContainerServiceExecCommand(ctx) + // Invoke the callback with all the unmarshalled arguments + err = w.Handler.PutArtifactRemoteFile(ctx) return err } -// ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiers converts echo context to params. -func (w *ServerInterfaceWrapper) ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiers(ctx echo.Context) error { +// PutArtifactServiceServiceIdentifier converts echo context to params. +func (w *ServerInterfaceWrapper) PutArtifactServiceServiceIdentifier(ctx echo.Context) error { var err error + // ------------- Path parameter "service_identifier" ------------- + var serviceIdentifier string + + err = runtime.BindStyledParameterWithLocation("simple", false, "service_identifier", runtime.ParamLocationPath, ctx.Param("service_identifier"), &serviceIdentifier) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter service_identifier: %s", err)) + } - // Invoke the callback with all the unmarshaled arguments - err = w.Handler.ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiers(ctx) + // Invoke the callback with all the unmarshalled arguments + err = w.Handler.PutArtifactServiceServiceIdentifier(ctx, serviceIdentifier) return err } -// ApiContainerApiApiContainerServiceGetServices converts echo context to params. -func (w *ServerInterfaceWrapper) ApiContainerApiApiContainerServiceGetServices(ctx echo.Context) error { +// GetArtifactArtifactIdentifier converts echo context to params. +func (w *ServerInterfaceWrapper) GetArtifactArtifactIdentifier(ctx echo.Context) error { var err error + // ------------- Path parameter "artifact_identifier" ------------- + var artifactIdentifier string - // Invoke the callback with all the unmarshaled arguments - err = w.Handler.ApiContainerApiApiContainerServiceGetServices(ctx) + err = runtime.BindStyledParameterWithLocation("simple", false, "artifact_identifier", runtime.ParamLocationPath, ctx.Param("artifact_identifier"), &artifactIdentifier) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter artifact_identifier: %s", err)) + } + + // Invoke the callback with all the unmarshalled arguments + err = w.Handler.GetArtifactArtifactIdentifier(ctx, artifactIdentifier) return err } -// ApiContainerApiApiContainerServiceGetStarlarkRun converts echo context to params. -func (w *ServerInterfaceWrapper) ApiContainerApiApiContainerServiceGetStarlarkRun(ctx echo.Context) error { +// GetArtifactArtifactIdentifierDownload converts echo context to params. +func (w *ServerInterfaceWrapper) GetArtifactArtifactIdentifierDownload(ctx echo.Context) error { var err error + // ------------- Path parameter "artifact_identifier" ------------- + var artifactIdentifier string - // Invoke the callback with all the unmarshaled arguments - err = w.Handler.ApiContainerApiApiContainerServiceGetStarlarkRun(ctx) + err = runtime.BindStyledParameterWithLocation("simple", false, "artifact_identifier", runtime.ParamLocationPath, ctx.Param("artifact_identifier"), &artifactIdentifier) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter artifact_identifier: %s", err)) + } + + // Invoke the callback with all the unmarshalled arguments + err = w.Handler.GetArtifactArtifactIdentifierDownload(ctx, artifactIdentifier) return err } -// ApiContainerApiApiContainerServiceInspectFilesArtifactContents converts echo context to params. -func (w *ServerInterfaceWrapper) ApiContainerApiApiContainerServiceInspectFilesArtifactContents(ctx echo.Context) error { +// GetService converts echo context to params. +func (w *ServerInterfaceWrapper) GetService(ctx echo.Context) error { var err error - // Invoke the callback with all the unmarshaled arguments - err = w.Handler.ApiContainerApiApiContainerServiceInspectFilesArtifactContents(ctx) + // Invoke the callback with all the unmarshalled arguments + err = w.Handler.GetService(ctx) return err } -// ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuids converts echo context to params. -func (w *ServerInterfaceWrapper) ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuids(ctx echo.Context) error { +// PostServiceConnection converts echo context to params. +func (w *ServerInterfaceWrapper) PostServiceConnection(ctx echo.Context) error { var err error - // Invoke the callback with all the unmarshaled arguments - err = w.Handler.ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuids(ctx) + // Invoke the callback with all the unmarshalled arguments + err = w.Handler.PostServiceConnection(ctx) return err } -// ApiContainerApiApiContainerServiceRunStarlarkPackage converts echo context to params. -func (w *ServerInterfaceWrapper) ApiContainerApiApiContainerServiceRunStarlarkPackage(ctx echo.Context) error { +// GetServiceServiceIdentifier converts echo context to params. +func (w *ServerInterfaceWrapper) GetServiceServiceIdentifier(ctx echo.Context) error { var err error + // ------------- Path parameter "service_identifier" ------------- + var serviceIdentifier string - // Invoke the callback with all the unmarshaled arguments - err = w.Handler.ApiContainerApiApiContainerServiceRunStarlarkPackage(ctx) - return err -} + err = runtime.BindStyledParameterWithLocation("simple", false, "service_identifier", runtime.ParamLocationPath, ctx.Param("service_identifier"), &serviceIdentifier) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter service_identifier: %s", err)) + } -// ApiContainerApiApiContainerServiceRunStarlarkScript converts echo context to params. -func (w *ServerInterfaceWrapper) ApiContainerApiApiContainerServiceRunStarlarkScript(ctx echo.Context) error { - var err error + // Parameter object where we will unmarshal all parameters from the context + var params GetServiceServiceIdentifierParams + // ------------- Optional query parameter "additional-properties" ------------- - // Invoke the callback with all the unmarshaled arguments - err = w.Handler.ApiContainerApiApiContainerServiceRunStarlarkScript(ctx) + err = runtime.BindQueryParameter("form", true, false, "additional-properties", ctx.QueryParams(), ¶ms.AdditionalProperties) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter additional-properties: %s", err)) + } + + // Invoke the callback with all the unmarshalled arguments + err = w.Handler.GetServiceServiceIdentifier(ctx, serviceIdentifier, params) return err } -// ApiContainerApiApiContainerServiceStoreFilesArtifactFromService converts echo context to params. -func (w *ServerInterfaceWrapper) ApiContainerApiApiContainerServiceStoreFilesArtifactFromService(ctx echo.Context) error { +// PostServiceServiceIdentifierCommand converts echo context to params. +func (w *ServerInterfaceWrapper) PostServiceServiceIdentifierCommand(ctx echo.Context) error { var err error + // ------------- Path parameter "service_identifier" ------------- + var serviceIdentifier string + + err = runtime.BindStyledParameterWithLocation("simple", false, "service_identifier", runtime.ParamLocationPath, ctx.Param("service_identifier"), &serviceIdentifier) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter service_identifier: %s", err)) + } - // Invoke the callback with all the unmarshaled arguments - err = w.Handler.ApiContainerApiApiContainerServiceStoreFilesArtifactFromService(ctx) + // Invoke the callback with all the unmarshalled arguments + err = w.Handler.PostServiceServiceIdentifierCommand(ctx, serviceIdentifier) return err } -// ApiContainerApiApiContainerServiceStoreWebFilesArtifact converts echo context to params. -func (w *ServerInterfaceWrapper) ApiContainerApiApiContainerServiceStoreWebFilesArtifact(ctx echo.Context) error { +// PostServiceServiceIdentifierEndpointPortNumberAvailability converts echo context to params. +func (w *ServerInterfaceWrapper) PostServiceServiceIdentifierEndpointPortNumberAvailability(ctx echo.Context) error { var err error + // ------------- Path parameter "service_identifier" ------------- + var serviceIdentifier string + + err = runtime.BindStyledParameterWithLocation("simple", false, "service_identifier", runtime.ParamLocationPath, ctx.Param("service_identifier"), &serviceIdentifier) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter service_identifier: %s", err)) + } + + // ------------- Path parameter "port_number" ------------- + var portNumber int - // Invoke the callback with all the unmarshaled arguments - err = w.Handler.ApiContainerApiApiContainerServiceStoreWebFilesArtifact(ctx) + err = runtime.BindStyledParameterWithLocation("simple", false, "port_number", runtime.ParamLocationPath, ctx.Param("port_number"), &portNumber) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter port_number: %s", err)) + } + + // Invoke the callback with all the unmarshalled arguments + err = w.Handler.PostServiceServiceIdentifierEndpointPortNumberAvailability(ctx, serviceIdentifier, portNumber) return err } -// ApiContainerApiApiContainerServiceUploadFilesArtifact converts echo context to params. -func (w *ServerInterfaceWrapper) ApiContainerApiApiContainerServiceUploadFilesArtifact(ctx echo.Context) error { +// GetStarlark converts echo context to params. +func (w *ServerInterfaceWrapper) GetStarlark(ctx echo.Context) error { var err error - // Invoke the callback with all the unmarshaled arguments - err = w.Handler.ApiContainerApiApiContainerServiceUploadFilesArtifact(ctx) + // Invoke the callback with all the unmarshalled arguments + err = w.Handler.GetStarlark(ctx) return err } -// ApiContainerApiApiContainerServiceUploadStarlarkPackage converts echo context to params. -func (w *ServerInterfaceWrapper) ApiContainerApiApiContainerServiceUploadStarlarkPackage(ctx echo.Context) error { +// PutStarlarkPackage converts echo context to params. +func (w *ServerInterfaceWrapper) PutStarlarkPackage(ctx echo.Context) error { var err error - // Invoke the callback with all the unmarshaled arguments - err = w.Handler.ApiContainerApiApiContainerServiceUploadStarlarkPackage(ctx) + // Invoke the callback with all the unmarshalled arguments + err = w.Handler.PutStarlarkPackage(ctx) return err } -// ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailability converts echo context to params. -func (w *ServerInterfaceWrapper) ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailability(ctx echo.Context) error { +// PostStarlarkPackagePackageId converts echo context to params. +func (w *ServerInterfaceWrapper) PostStarlarkPackagePackageId(ctx echo.Context) error { var err error + // ------------- Path parameter "package_id" ------------- + var packageId string + + err = runtime.BindStyledParameterWithLocation("simple", false, "package_id", runtime.ParamLocationPath, ctx.Param("package_id"), &packageId) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter package_id: %s", err)) + } - // Invoke the callback with all the unmarshaled arguments - err = w.Handler.ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailability(ctx) + // Invoke the callback with all the unmarshalled arguments + err = w.Handler.PostStarlarkPackagePackageId(ctx, packageId) return err } -// ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailability converts echo context to params. -func (w *ServerInterfaceWrapper) ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailability(ctx echo.Context) error { +// PostStarlarkScript converts echo context to params. +func (w *ServerInterfaceWrapper) PostStarlarkScript(ctx echo.Context) error { var err error - // Invoke the callback with all the unmarshaled arguments - err = w.Handler.ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailability(ctx) + // Invoke the callback with all the unmarshalled arguments + err = w.Handler.PostStarlarkScript(ctx) return err } @@ -2997,95 +2707,91 @@ func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL Handler: si, } - router.POST(baseURL+"/api_container_api.ApiContainerService/ConnectServices", wrapper.ApiContainerApiApiContainerServiceConnectServices) - router.POST(baseURL+"/api_container_api.ApiContainerService/DownloadFilesArtifact", wrapper.ApiContainerApiApiContainerServiceDownloadFilesArtifact) - router.POST(baseURL+"/api_container_api.ApiContainerService/ExecCommand", wrapper.ApiContainerApiApiContainerServiceExecCommand) - router.POST(baseURL+"/api_container_api.ApiContainerService/GetExistingAndHistoricalServiceIdentifiers", wrapper.ApiContainerApiApiContainerServiceGetExistingAndHistoricalServiceIdentifiers) - router.POST(baseURL+"/api_container_api.ApiContainerService/GetServices", wrapper.ApiContainerApiApiContainerServiceGetServices) - router.POST(baseURL+"/api_container_api.ApiContainerService/GetStarlarkRun", wrapper.ApiContainerApiApiContainerServiceGetStarlarkRun) - router.POST(baseURL+"/api_container_api.ApiContainerService/InspectFilesArtifactContents", wrapper.ApiContainerApiApiContainerServiceInspectFilesArtifactContents) - router.POST(baseURL+"/api_container_api.ApiContainerService/ListFilesArtifactNamesAndUuids", wrapper.ApiContainerApiApiContainerServiceListFilesArtifactNamesAndUuids) - router.POST(baseURL+"/api_container_api.ApiContainerService/RunStarlarkPackage", wrapper.ApiContainerApiApiContainerServiceRunStarlarkPackage) - router.POST(baseURL+"/api_container_api.ApiContainerService/RunStarlarkScript", wrapper.ApiContainerApiApiContainerServiceRunStarlarkScript) - router.POST(baseURL+"/api_container_api.ApiContainerService/StoreFilesArtifactFromService", wrapper.ApiContainerApiApiContainerServiceStoreFilesArtifactFromService) - router.POST(baseURL+"/api_container_api.ApiContainerService/StoreWebFilesArtifact", wrapper.ApiContainerApiApiContainerServiceStoreWebFilesArtifact) - router.POST(baseURL+"/api_container_api.ApiContainerService/UploadFilesArtifact", wrapper.ApiContainerApiApiContainerServiceUploadFilesArtifact) - router.POST(baseURL+"/api_container_api.ApiContainerService/UploadStarlarkPackage", wrapper.ApiContainerApiApiContainerServiceUploadStarlarkPackage) - router.POST(baseURL+"/api_container_api.ApiContainerService/WaitForHttpGetEndpointAvailability", wrapper.ApiContainerApiApiContainerServiceWaitForHttpGetEndpointAvailability) - router.POST(baseURL+"/api_container_api.ApiContainerService/WaitForHttpPostEndpointAvailability", wrapper.ApiContainerApiApiContainerServiceWaitForHttpPostEndpointAvailability) + router.GET(baseURL+"/artifact", wrapper.GetArtifact) + router.PUT(baseURL+"/artifact/local-file", wrapper.PutArtifactLocalFile) + router.PUT(baseURL+"/artifact/remote-file", wrapper.PutArtifactRemoteFile) + router.PUT(baseURL+"/artifact/service/:service_identifier", wrapper.PutArtifactServiceServiceIdentifier) + router.GET(baseURL+"/artifact/:artifact_identifier", wrapper.GetArtifactArtifactIdentifier) + router.GET(baseURL+"/artifact/:artifact_identifier/download", wrapper.GetArtifactArtifactIdentifierDownload) + router.GET(baseURL+"/service", wrapper.GetService) + router.POST(baseURL+"/service/connection", wrapper.PostServiceConnection) + router.GET(baseURL+"/service/:service_identifier", wrapper.GetServiceServiceIdentifier) + router.POST(baseURL+"/service/:service_identifier/command", wrapper.PostServiceServiceIdentifierCommand) + router.POST(baseURL+"/service/:service_identifier/endpoint/:port_number/availability", wrapper.PostServiceServiceIdentifierEndpointPortNumberAvailability) + router.GET(baseURL+"/starlark", wrapper.GetStarlark) + router.PUT(baseURL+"/starlark/package", wrapper.PutStarlarkPackage) + router.POST(baseURL+"/starlark/package/:package_id", wrapper.PostStarlarkPackagePackageId) + router.POST(baseURL+"/starlark/script", wrapper.PostStarlarkScript) } // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sI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mynskW1Cv", - "KnaiHL4nGTcN3htblVvNPhFG5Bzi64XrIF6zMNLklKHUUQRSJpq+KlerBqN9URsJPjPRjkeYtBDAVCgV", - "ZOUBefs2sNr03ar73GTHZp58AxGsHLv/7IT82I3urt5SOjdUIHT08599w5NVVNKpf6Lqd+tu5iBOYt11", - "rWzI3qCd9bIBf65A4X40qKriSy8w9iBxViOEwmx0Bl03QC+94AkLkxJ2B/rgAOyofevx4Bvb3ofVNuvL", - "uP0fYCEuoHZO/Unw1KUs/nJmuyJZYtuat3ZftuizHVTaoudYlUdMWkJs69D592Ut0a3UHbgWUYFLeTzF", - "M+KOp7xo2Tmhv8/U7BJPJadaldDNyL3WPACnmlsaXs+X65zq2bq6lpaMDAlIQACLCJshooqjhEQrLWCv", - "nTzA9B1cELCooAeYnvqGwKGUSgvP8dz97c9GWYr6uQVVANlfJtc5+SeTRc81xf8PFwfrnCmuAdV3bnEp", - "WMMXIDClayzabIxvPOCt3DbazWVvXliyYQssCNcyjMyXcI6lx1x/wXJe4D+6vf51cHM/RnaCLRPnJWfX", - "d27PT4kszlETIqTKx07YbUXy7Fm3Wzz/jhYEI6IkMkgU3fvFyZZRPFeOgglzt0MkkQpYtCxws+eZhKEI", - "S+NAUnCAn4xTYVwhARGQhb3G2EnM84aPRjU9rsDnyLxPi/tGxqj3Hm3fAybqExdflMo+gyq6+C4WmFA8", - "JZSo5WmcssELfeICfbm7G6HPoMoOQ1RF7ugSM+XxMlTw7GkaHCTuXMXhKUBpwZxFsQW0+uFVERemWDxC", - "jLBEON8ZBfQN9Gd99AUo5eiBCxp/2/cJFGFEEUzDGChehimhlEiIOItlQxxhSxhG2KpjjXmy3Y6aKUKL", - "Bi1n5nIbaLkQYUrbHUc3B842UF47lFIcRXOIHvtooGwHiT2qU1iYWF/NK2hIiuW8b+WiaKVA/3RgzuaA", - "qZr/03ug5W2atfhwoZrxqS3048cfP7bt8lGicKq1FX/BzxUelERFWCnjh2RxV5C4rMHdD3SMmZGF4YrO", - "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H/EfH/8/AAD//2pzqPofTwAA", } // GetSwagger returns the content of the embedded swagger specification file @@ -3093,16 +2799,16 @@ var swaggerSpec = []string{ func decodeSpec() ([]byte, error) { zipped, err := base64.StdEncoding.DecodeString(strings.Join(swaggerSpec, "")) if err != nil { - return nil, fmt.Errorf("error base64 decoding spec: %w", err) + return nil, fmt.Errorf("error base64 decoding spec: %s", err) } zr, err := gzip.NewReader(bytes.NewReader(zipped)) if err != nil { - return nil, fmt.Errorf("error decompressing spec: %w", err) + return nil, fmt.Errorf("error decompressing spec: %s", err) } var buf bytes.Buffer _, err = buf.ReadFrom(zr) if err != nil { - return nil, fmt.Errorf("error decompressing spec: %w", err) + return nil, fmt.Errorf("error decompressing spec: %s", err) } return buf.Bytes(), nil @@ -3120,7 +2826,7 @@ func decodeSpecCached() func() ([]byte, error) { // Constructs a synthetic filesystem for resolving external references when loading openapi specifications. func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error) { - res := make(map[string]func() ([]byte, error)) + var res = make(map[string]func() ([]byte, error)) if len(pathToFile) > 0 { res[pathToFile] = rawSpec } @@ -3134,12 +2840,12 @@ func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error) { // Externally referenced files must be embedded in the corresponding golang packages. // Urls can be supported but this task was out of the scope. func GetSwagger() (swagger *openapi3.T, err error) { - resolvePath := PathToRawSpec("") + var resolvePath = PathToRawSpec("") loader := openapi3.NewLoader() loader.IsExternalRefsAllowed = true loader.ReadFromURIFunc = func(loader *openapi3.Loader, url *url.URL) ([]byte, error) { - pathToFile := url.String() + var pathToFile = url.String() pathToFile = path.Clean(pathToFile) getSpec, ok := resolvePath[pathToFile] if !ok { diff --git a/api/golang/engine/kurtosis_engine_http_api_bindings/engine_service.go b/api/golang/engine/kurtosis_engine_http_api_bindings/engine_service.gen.go similarity index 100% rename from api/golang/engine/kurtosis_engine_http_api_bindings/engine_service.go rename to api/golang/engine/kurtosis_engine_http_api_bindings/engine_service.gen.go diff --git a/api/golang/go.mod b/api/golang/go.mod index 35295612f9..7ddc768cf3 100644 --- a/api/golang/go.mod +++ b/api/golang/go.mod @@ -22,36 +22,86 @@ require ( ) require ( + github.com/BurntSushi/toml v1.3.2 // indirect + github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53 // indirect + github.com/CloudyKit/jet/v6 v6.2.0 // indirect + github.com/Joker/jade v1.1.3 // indirect + github.com/Shopify/goreferrer v0.0.0-20220729165902-8cddb4f5de06 // indirect github.com/adrg/xdg v0.4.0 // indirect - github.com/andybalholm/brotli v1.0.4 // indirect + github.com/andybalholm/brotli v1.0.5 // indirect + github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect + github.com/aymerick/douceur v0.2.0 // indirect + github.com/bytedance/sonic v1.9.1 // indirect + github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect github.com/davecgh/go-spew v1.1.1 // indirect + github.com/deepmap/oapi-codegen v1.16.2 // indirect github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5 // indirect + github.com/fatih/structs v1.1.0 // indirect + github.com/flosch/pongo2/v4 v4.0.2 // indirect + github.com/gabriel-vasile/mimetype v1.4.2 // indirect github.com/getkin/kin-openapi v0.120.0 // indirect + github.com/gin-contrib/sse v0.1.0 // indirect + github.com/gin-gonic/gin v1.9.1 // indirect + github.com/go-playground/locales v0.14.1 // indirect + github.com/go-playground/universal-translator v0.18.1 // indirect + github.com/go-playground/validator/v10 v10.14.0 // indirect + github.com/goccy/go-json v0.10.2 // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/golang/snappy v0.0.4 // indirect - github.com/google/uuid v1.3.0 // indirect + github.com/gomarkdown/markdown v0.0.0-20230716120725-531d2d74bc12 // indirect + github.com/google/uuid v1.3.1 // indirect + github.com/gorilla/css v1.0.0 // indirect + github.com/iris-contrib/schema v0.0.6 // indirect + github.com/josharian/intern v1.0.0 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/kataras/blocks v0.0.7 // indirect + github.com/kataras/golog v0.1.9 // indirect + github.com/kataras/iris/v12 v12.2.6-0.20230908161203-24ba4e8933b9 // indirect + github.com/kataras/pio v0.0.12 // indirect + github.com/kataras/sitemap v0.0.6 // indirect + github.com/kataras/tunnel v0.0.4 // indirect github.com/klauspost/compress v1.16.7 // indirect + github.com/klauspost/cpuid/v2 v2.2.4 // indirect github.com/klauspost/pgzip v1.2.5 // indirect github.com/kr/text v0.2.0 // indirect github.com/labstack/echo/v4 v4.11.3 // indirect github.com/labstack/gommon v0.4.0 // indirect + github.com/leodido/go-urn v1.2.4 // indirect + github.com/mailgun/raymond/v2 v2.0.48 // indirect + github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.19 // indirect + github.com/microcosm-cc/bluemonday v1.0.25 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect github.com/nwaples/rardecode v1.1.3 // indirect + github.com/pelletier/go-toml/v2 v2.0.8 // indirect github.com/pierrec/lz4/v4 v4.1.15 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/russross/blackfriday/v2 v2.1.0 // indirect + github.com/schollz/closestmatch v2.1.0+incompatible // indirect github.com/stretchr/objx v0.5.0 // indirect + github.com/tdewolff/minify/v2 v2.12.9 // indirect + github.com/tdewolff/parse/v2 v2.6.8 // indirect + github.com/twitchyliquid64/golang-asm v0.15.1 // indirect + github.com/ugorji/go/codec v1.2.11 // indirect github.com/ulikunitz/xz v0.5.10 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasttemplate v1.2.2 // indirect + github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect + github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect + github.com/yosssi/ace v0.0.5 // indirect + golang.org/x/arch v0.3.0 // indirect golang.org/x/crypto v0.14.0 // indirect golang.org/x/net v0.17.0 // indirect golang.org/x/sys v0.13.0 // indirect golang.org/x/text v0.13.0 // indirect + golang.org/x/time v0.3.0 // indirect google.golang.org/genproto v0.0.0-20230706204954-ccb25ca9f130 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230706204954-ccb25ca9f130 // indirect + gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/api/golang/go.sum b/api/golang/go.sum index 66e98011cd..a2b5d8639e 100644 --- a/api/golang/go.sum +++ b/api/golang/go.sum @@ -1,43 +1,121 @@ connectrpc.com/connect v1.11.1 h1:dqRwblixqkVh+OFBOOL1yIf1jS/yP0MSJLijRj29bFg= connectrpc.com/connect v1.11.1/go.mod h1:3AGaO6RRGMx5IKFfqbe3hvK1NqLosFNP2BxDYTPmNPo= +github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8= +github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= +github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53 h1:sR+/8Yb4slttB4vD+b9btVEnWgL3Q00OBTzVT8B9C0c= +github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno= +github.com/CloudyKit/jet/v6 v6.2.0 h1:EpcZ6SR9n28BUGtNJSvlBqf90IpjeFr36Tizxhn/oME= +github.com/CloudyKit/jet/v6 v6.2.0/go.mod h1:d3ypHeIRNo2+XyqnGA8s+aphtcVpjP5hPwP/Lzo7Ro4= +github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= +github.com/Joker/jade v1.1.3 h1:Qbeh12Vq6BxURXT1qZBRHsDxeURB8ztcL6f3EXSGeHk= +github.com/Joker/jade v1.1.3/go.mod h1:T+2WLyt7VH6Lp0TRxQrUYEs64nRc83wkMQrfeIQKduM= github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= +github.com/RaveNoX/go-jsoncommentstrip v1.0.0/go.mod h1:78ihd09MekBnJnxpICcwzCMzGrKSKYe4AqU6PDYYpjk= +github.com/Shopify/goreferrer v0.0.0-20220729165902-8cddb4f5de06 h1:KkH3I3sJuOLP3TjA/dfr4NAY8bghDwnXiU7cTKxQqo0= +github.com/Shopify/goreferrer v0.0.0-20220729165902-8cddb4f5de06/go.mod h1:7erjKLwalezA0k99cWs5L11HWOAPNjdUZ6RxH1BXbbM= github.com/adrg/xdg v0.4.0 h1:RzRqFcjH4nE5C6oTAxhBtoE2IRyjBSa62SCbyPidvls= github.com/adrg/xdg v0.4.0/go.mod h1:N6ag73EX4wyxeaoeHctc1mas01KZgsj5tYiAIwqJE/E= github.com/andybalholm/brotli v1.0.1/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY= github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= +github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs= +github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= +github.com/apapsch/go-jsonmerge/v2 v2.0.0 h1:axGnT1gRIfimI7gJifB699GoE/oq+F2MU7Dml6nw9rQ= +github.com/apapsch/go-jsonmerge/v2 v2.0.0/go.mod h1:lvDnEdqiQrp0O42VQGgmlKpxL1AP2+08jFMw88y4klk= +github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk= +github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= +github.com/bmatcuk/doublestar v1.1.1/go.mod h1:UD6OnuiIn0yFxxA2le/rnRU1G4RaI4UvFv1sNto9p6w= +github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= +github.com/bytedance/sonic v1.9.1 h1:6iJ6NqdoxCDr6mbY8h18oSO+cShGSMRGCEo7F2h0x8s= +github.com/bytedance/sonic v1.9.1/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= +github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= +github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams= +github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/deepmap/oapi-codegen v1.16.2 h1:xGHx0dNqYfy9gE8a7AVgVM8Sd5oF9SEgePzP+UPAUXI= +github.com/deepmap/oapi-codegen v1.16.2/go.mod h1:rdYoEA2GE+riuZ91DvpmBX9hJbQpuY9wchXpfQ3n+ho= github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5 h1:iFaUwBSo5Svw6L7HYpRu/0lE3e0BaElwnNO1qkNQxBY= github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5/go.mod h1:qssHWj60/X5sZFNxpG4HBPDHVqxNm4DfnCKgrbZOT+s= github.com/dsnet/golib v0.0.0-20171103203638-1ea166775780/go.mod h1:Lj+Z9rebOhdfkVLjJ8T6VcRQv3SXugXy999NBtR9aFY= +github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= +github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= +github.com/flosch/pongo2/v4 v4.0.2 h1:gv+5Pe3vaSVmiJvh/BZa82b7/00YUGm0PIyVVLop0Hw= +github.com/flosch/pongo2/v4 v4.0.2/go.mod h1:B5ObFANs/36VwxxlgKpdchIJHMvHB562PW+BWPhwZD8= +github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= +github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= github.com/getkin/kin-openapi v0.120.0 h1:MqJcNJFrMDFNc07iwE8iFC5eT2k/NPUFDIpNeiZv8Jg= github.com/getkin/kin-openapi v0.120.0/go.mod h1:PCWw/lfBrJY4HcdqE3jj+QFkaFK8ABoqo7PvqVhXXqw= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= +github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= +github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= +github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= +github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= +github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= +github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= +github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= +github.com/go-playground/validator/v10 v10.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg/+t63MyGU2n5js= +github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= github.com/go-yaml/yaml v2.1.0+incompatible h1:RYi2hDdss1u4YE7GwixGzWwVo47T8UQwnTLB6vQiq+o= github.com/go-yaml/yaml v2.1.0+incompatible/go.mod h1:w2MrLa16VYP0jy6N7M5kHaCkaLENm+P+Tv+MfurjSw0= +github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= +github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.2/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/gomarkdown/markdown v0.0.0-20230716120725-531d2d74bc12 h1:uK3X/2mt4tbSGoHvbLBHUny7CKiuwUip3MArtukol4E= +github.com/gomarkdown/markdown v0.0.0-20230716120725-531d2d74bc12/go.mod h1:JDGcbDT52eL4fju3sZ4TeHGsQwhG9nbDV21aMyhwPoA= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= +github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/gorilla/css v1.0.0 h1:BQqNyPTi50JCFMTw/b67hByjMVXZRwGha6wxVGkeihY= +github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c= +github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/iris-contrib/schema v0.0.6 h1:CPSBLyx2e91H2yJzPuhGuifVRnZBBJ3pCOMbOvPZaTw= +github.com/iris-contrib/schema v0.0.6/go.mod h1:iYszG0IOsuIsfzjymw1kMzTL8YQcCWlm65f3wX8J5iA= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d/go.mod h1:2PavIy+JPciBPrBUjwbNvtwB6RQlve+hkpll6QSNmOE= +github.com/kataras/blocks v0.0.7 h1:cF3RDY/vxnSRezc7vLFlQFTYXG/yAr1o7WImJuZbzC4= +github.com/kataras/blocks v0.0.7/go.mod h1:UJIU97CluDo0f+zEjbnbkeMRlvYORtmc1304EeyXf4I= +github.com/kataras/golog v0.1.9 h1:vLvSDpP7kihFGKFAvBSofYo7qZNULYSHOH2D7rPTKJk= +github.com/kataras/golog v0.1.9/go.mod h1:jlpk/bOaYCyqDqH18pgDHdaJab72yBE6i0O3s30hpWY= +github.com/kataras/iris/v12 v12.2.6-0.20230908161203-24ba4e8933b9 h1:Vx8kDVhO2qepK8w44lBtp+RzN3ld743i+LYPzODJSpQ= +github.com/kataras/iris/v12 v12.2.6-0.20230908161203-24ba4e8933b9/go.mod h1:ldkoR3iXABBeqlTibQ3MYaviA1oSlPvim6f55biwBh4= +github.com/kataras/pio v0.0.12 h1:o52SfVYauS3J5X08fNjlGS5arXHjW/ItLkyLcKjoH6w= +github.com/kataras/pio v0.0.12/go.mod h1:ODK/8XBhhQ5WqrAhKy+9lTPS7sBf6O3KcLhc9klfRcY= +github.com/kataras/sitemap v0.0.6 h1:w71CRMMKYMJh6LR2wTgnk5hSgjVNB9KL60n5e2KHvLY= +github.com/kataras/sitemap v0.0.6/go.mod h1:dW4dOCNs896OR1HmG+dMLdT7JjDk7mYBzoIRwuj5jA4= +github.com/kataras/tunnel v0.0.4 h1:sCAqWuJV7nPzGrlb0os3j49lk2JhILT0rID38NHNLpA= +github.com/kataras/tunnel v0.0.4/go.mod h1:9FkU4LaeifdMWqZu7o20ojmW4B7hdhv2CMLwfnHGpYw= github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.11.4/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I= github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/cpuid v1.2.0 h1:NMpwD2G9JSFOE1/TJjGSo5zG7Yb2bTe7eq1jH+irmeE= github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= +github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZXnvk= +github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= github.com/klauspost/pgzip v1.2.5 h1:qnWYvvKqedOF2ulHpMG72XQol4ILEJ8k2wwRl/Km8oE= github.com/klauspost/pgzip v1.2.5/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kurtosis-tech/kurtosis-portal/api/golang v0.0.0-20230818182330-1a86869414d2 h1:izciXrFyFR+ihJ7nLTOkoIX5GzBPIp8gVKlw94gIc98= @@ -52,6 +130,12 @@ github.com/labstack/echo/v4 v4.11.3 h1:Upyu3olaqSHkCjs1EJJwQ3WId8b8b1hxbogyommKk github.com/labstack/echo/v4 v4.11.3/go.mod h1:UcGuQ8V6ZNRmSweBIJkPvGfwCMIlFmiqrPqiEBfPYws= github.com/labstack/gommon v0.4.0 h1:y7cvthEAEbU0yHOf4axH8ZG2NH8knB9iNSoTO8dyIk8= github.com/labstack/gommon v0.4.0/go.mod h1:uW6kP17uPlLJsD3ijUYn3/M5bAxtlZhMI6m3MFxTMTM= +github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= +github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= +github.com/mailgun/raymond/v2 v2.0.48 h1:5dmlB680ZkFG2RN/0lvTAghrSxIESeu9/2aeDqACtjw= +github.com/mailgun/raymond/v2 v2.0.48/go.mod h1:lsgvL50kgt1ylcFJYZiULi5fjPBkkhNfj4KA0W54Z18= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= @@ -61,26 +145,58 @@ github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APP github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mholt/archiver/v3 v3.5.1 h1:rDjOBX9JSF5BvoJGvjqK479aL70qh9DIpZCl+k7Clwo= github.com/mholt/archiver/v3 v3.5.1/go.mod h1:e3dqJ7H78uzsRSEACH1joayhuSyhnonssnDhppzS1L4= +github.com/microcosm-cc/bluemonday v1.0.25 h1:4NEwSfiJ+Wva0VxN5B8OwMicaJvD8r9tlJWm9rtloEg= +github.com/microcosm-cc/bluemonday v1.0.25/go.mod h1:ZIOjCQp1OrzBBPIJmfX4qDYFuhU02nx4bn030ixfHLE= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nwaples/rardecode v1.1.0/go.mod h1:5DzqNKiOdpKKBH87u8VlvAnPZMXcGRhxWkRpHbbfGS0= github.com/nwaples/rardecode v1.1.3 h1:cWCaZwfM5H7nAD6PyEdcVnczzV8i/JtotnyW/dD9lEc= github.com/nwaples/rardecode v1.1.3/go.mod h1:5DzqNKiOdpKKBH87u8VlvAnPZMXcGRhxWkRpHbbfGS0= +github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= +github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= github.com/pierrec/lz4/v4 v4.1.2/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pierrec/lz4/v4 v4.1.15 h1:MO0/ucJhngq7299dKLwIMtgTfbkoSPF6AoMYDd8Q4q0= github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/schollz/closestmatch v2.1.0+incompatible h1:Uel2GXEpJqOWBrlyI+oY9LTiyyjYS17cCYRqP13/SHk= +github.com/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= +github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad/go.mod h1:qLr4V1qq6nMqFKkMo8ZTx3f+BZEkzsRUY10Xsm2mwU0= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/tdewolff/minify/v2 v2.12.9 h1:dvn5MtmuQ/DFMwqf5j8QhEVpPX6fi3WGImhv8RUB4zA= +github.com/tdewolff/minify/v2 v2.12.9/go.mod h1:qOqdlDfL+7v0/fyymB+OP497nIxJYSvX4MQWA8OoiXU= +github.com/tdewolff/parse/v2 v2.6.8 h1:mhNZXYCx//xG7Yq2e/kVLNZw4YfYmeHbhx+Zc0OvFMA= +github.com/tdewolff/parse/v2 v2.6.8/go.mod h1:XHDhaU6IBgsryfdnpzUXBlT6leW/l25yrFBTEb4eIyM= +github.com/tdewolff/test v1.0.9/go.mod h1:6DAvZliBAAnD7rhVgwaM7DE5/d9NMOAJ09SqYqeK4QE= +github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= +github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= +github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= +github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/ulikunitz/xz v0.5.8/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/ulikunitz/xz v0.5.9/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/ulikunitz/xz v0.5.10 h1:t92gobL9l3HE202wg3rlk19F6X+JOxl9BBrCCMYEYd8= @@ -90,24 +206,62 @@ github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyC github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo= github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= +github.com/vmihailenco/msgpack/v5 v5.3.5 h1:5gO0H1iULLWGhs2H5tbAHIZTV8/cYafcFOr9znI5mJU= +github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc= +github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= +github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 h1:nIPpBwaJSVYIxUFsDv3M8ofmx9yWTog9BfvIu0q41lo= github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8/go.mod h1:HUYIGzjTL3rfEspMxjDjgmT5uz5wzYJKVo23qUhYTos= +github.com/yosssi/ace v0.0.5 h1:tUkIP/BLdKqrlrPwcmH0shwEEhTRHoGnc1wFIWmaBUA= +github.com/yosssi/ace v0.0.5/go.mod h1:ALfIzm2vT7t5ZE7uoIZqF3TQ7SAOyupFZnkrF5id+K0= +github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= +golang.org/x/arch v0.3.0 h1:02VY4/ZcO/gBOH6PUaoiptASxtXU10jazRCP865E97k= +golang.org/x/arch v0.3.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= +golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= +golang.org/x/net v0.0.0-20190327091125-710a502c58a2/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211103235746-7861aae1554b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= +golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/genproto v0.0.0-20230706204954-ccb25ca9f130 h1:Au6te5hbKUV8pIYWHqOUZ1pva5qK/rwbIhoXEUB9Lu8= google.golang.org/genproto v0.0.0-20230706204954-ccb25ca9f130/go.mod h1:O9kGHb51iE/nOGvQaDUuadVYqovW56s5emA88lQnj6Y= google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98 h1:FmF5cCW94Ij59cfpoLiwTgodWmm60eEV0CjlsVg2fuw= @@ -121,10 +275,14 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= +gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= diff --git a/api/openapi/core/api_container_service.yaml b/api/openapi/core/api_container_service.yaml index c91511a8a2..7729f979b3 100644 --- a/api/openapi/core/api_container_service.yaml +++ b/api/openapi/core/api_container_service.yaml @@ -1,326 +1,301 @@ openapi: 3.0.0 info: title: api_container_service - description: '' - version: '1' + description: "" + version: "1" paths: - /api_container_api.ApiContainerService/RunStarlarkScript: - post: - operationId: api_container_api.ApiContainerService.RunStarlarkScript - description: Executes a Starlark script on the user's behalf - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/api_container_api.RunStarlarkScriptArgs' - required: true + /starlark: + get: + description: Get last Starlark run responses: - '200': - description: '' + "200": + description: "" content: - '*/*': + "*/*": schema: - $ref: '#/components/schemas/api_container_api.StarlarkRunResponseLine' - /api_container_api.ApiContainerService/UploadStarlarkPackage: - post: - operationId: api_container_api.ApiContainerService.UploadStarlarkPackage + $ref: "#/components/schemas/GetStarlarkRunResponse" + /starlark/package: + put: description: Uploads a Starlark package. This step is required before the package can be executed with RunStarlarkPackage requestBody: - $ref: '#/components/requestBodies/api_container_api.StreamedDataChunk' + $ref: "#/components/requestBodies/StreamedDataBody" responses: - '200': - description: '' + "200": + description: "" content: - '*/*': + "*/*": schema: - $ref: '#/components/schemas/google.protobuf.Empty' - /api_container_api.ApiContainerService/RunStarlarkPackage: + $ref: "#/components/schemas/google.protobuf.Empty" + /starlark/package/{package_id}: post: - operationId: api_container_api.ApiContainerService.RunStarlarkPackage description: Executes a Starlark script on the user's behalf requestBody: content: application/json: schema: - $ref: '#/components/schemas/api_container_api.RunStarlarkPackageArgs' + $ref: "#/components/schemas/RunStarlarkPackageArgs" required: true + parameters: + - in: path + name: package_id + schema: + type: string + description: The package identifier that will be executed + required: true responses: - '200': - description: '' + "200": + description: "" content: - '*/*': + "*/*": schema: - $ref: '#/components/schemas/api_container_api.StarlarkRunResponseLine' - /api_container_api.ApiContainerService/GetServices: + $ref: "#/components/schemas/StarlarkRunResponseLine" + /starlark/script: post: - operationId: api_container_api.ApiContainerService.GetServices - description: Returns the IDs of the current services in the enclave + description: Executes a Starlark script on the user's behalf requestBody: content: application/json: schema: - $ref: '#/components/schemas/api_container_api.GetServicesArgs' - description: |- - ============================================================================================== - Get Services - ============================================================================================== + $ref: "#/components/schemas/RunStarlarkScriptArgs" required: true responses: - '200': - description: '' + "200": + description: "" content: - '*/*': + "*/*": schema: - $ref: '#/components/schemas/api_container_api.GetServicesResponse' - /api_container_api.ApiContainerService/GetExistingAndHistoricalServiceIdentifiers: - post: - operationId: api_container_api.ApiContainerService.GetExistingAndHistoricalServiceIdentifiers + $ref: "#/components/schemas/StarlarkRunResponseLine" + /service: + get: description: Returns information about all existing & historical services - requestBody: - $ref: '#/components/requestBodies/google.protobuf.Empty' responses: - '200': - description: '' + "200": + description: "" content: - '*/*': + "*/*": schema: - $ref: '#/components/schemas/api_container_api.GetExistingAndHistoricalServiceIdentifiersResponse' - /api_container_api.ApiContainerService/ExecCommand: + $ref: "#/components/schemas/GetExistingAndHistoricalServiceIdentifiersResponse" + /service/{service_identifier}: + get: + parameters: + - in: path + name: service_identifier + schema: + type: string + required: true + description: Service identifier to fetch info + - in: query + name: additional-properties + schema: + type: string + description: Additional properties + responses: + "200": + description: "" + content: + "*/*": + schema: + $ref: "#/components/schemas/GetServicesResponse" + /service/{service_identifier}/command: post: - operationId: api_container_api.ApiContainerService.ExecCommand description: Executes the given command inside a running container requestBody: content: application/json: schema: - $ref: '#/components/schemas/api_container_api.ExecCommandArgs' - description: |- - ============================================================================================== - Exec Command - ============================================================================================== + $ref: "#/components/schemas/ExecCommandArgs" + description: Exec Command required: true + parameters: + - in: path + name: service_identifier + schema: + type: string + description: The service identifier of the container that the command should be executed in + required: true responses: - '200': - description: '' + "200": + description: "" content: - '*/*': + "*/*": schema: - $ref: '#/components/schemas/api_container_api.ExecCommandResponse' - /api_container_api.ApiContainerService/WaitForHttpGetEndpointAvailability: + $ref: "#/components/schemas/ExecCommandResponse" + /service/{service_identifier}/endpoint/{port_number}/availability: post: - operationId: api_container_api.ApiContainerService.WaitForHttpGetEndpointAvailability description: Block until the given HTTP endpoint returns available, calling it through a HTTP Get request requestBody: content: application/json: schema: - $ref: '#/components/schemas/api_container_api.WaitForHttpGetEndpointAvailabilityArgs' - description: |- - ============================================================================================== - Wait For HTTP Get Endpoint Availability - ============================================================================================== + $ref: "#/components/schemas/WaitForEndpointAvailabilityArgs" + description: Wait For HTTP Get Endpoint Availability required: true + parameters: + - in: path + name: service_identifier + schema: + type: string + description: The service identifier of the container that the command should be executed in + required: true + - in: path + name: port_number + schema: + type: integer + description: The port number to check availability + required: true responses: - '200': - description: '' + "200": + description: "" content: - '*/*': + "*/*": schema: - $ref: '#/components/schemas/google.protobuf.Empty' - /api_container_api.ApiContainerService/WaitForHttpPostEndpointAvailability: - post: - operationId: api_container_api.ApiContainerService.WaitForHttpPostEndpointAvailability - description: Block until the given HTTP endpoint returns available, calling it through a HTTP Post request - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/api_container_api.WaitForHttpPostEndpointAvailabilityArgs' - description: |- - ============================================================================================== - Wait For HTTP Post Endpoint Availability - ============================================================================================== - required: true + $ref: "#/components/schemas/google.protobuf.Empty" + /artifact: + get: responses: - '200': - description: '' + "200": + description: "" content: - '*/*': + "*/*": schema: - $ref: '#/components/schemas/google.protobuf.Empty' - /api_container_api.ApiContainerService/UploadFilesArtifact: - post: - operationId: api_container_api.ApiContainerService.UploadFilesArtifact - description: Uploads a files artifact to the Kurtosis File System - requestBody: - $ref: '#/components/requestBodies/api_container_api.StreamedDataChunk' + $ref: "#/components/schemas/ListFilesArtifactNamesAndUuidsResponse" + /artifact/{artifact_identifier}: + get: + description: "" + parameters: + - in: path + name: artifact_identifier + schema: + type: string + description: The artifact name or uuid + required: true responses: - '200': - description: '' + "200": + description: "" content: - '*/*': + "*/*": schema: - $ref: '#/components/schemas/api_container_api.UploadFilesArtifactResponse' - /api_container_api.ApiContainerService/DownloadFilesArtifact: - post: - operationId: api_container_api.ApiContainerService.DownloadFilesArtifact + $ref: "#/components/schemas/InspectFilesArtifactContentsResponse" + /artifact/{artifact_identifier}/download: + get: description: Downloads a files artifact from the Kurtosis File System - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/api_container_api.DownloadFilesArtifactArgs' - description: |- - ============================================================================================== - Download Files Artifact - ============================================================================================== - required: true responses: - '200': - description: '' + "200": + description: "" content: - '*/*': + "*/*": schema: - $ref: '#/components/schemas/api_container_api.StreamedDataChunk' - /api_container_api.ApiContainerService/StoreWebFilesArtifact: - post: - operationId: api_container_api.ApiContainerService.StoreWebFilesArtifact - description: Tells the API container to download a files artifact from the web to the Kurtosis File System + $ref: "#/components/schemas/StreamedDataChunk" + parameters: + - in: path + name: artifact_identifier + schema: + type: string + required: true + description: Numeric ID of the user to get + /artifact/local-file: + put: + description: Uploads a files artifact to the Kurtosis File System requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/api_container_api.StoreWebFilesArtifactArgs' - description: |- - ============================================================================================== - Store Web Files Artifact - ============================================================================================== - required: true + $ref: "#/components/requestBodies/StreamedDataBody" responses: - '200': - description: '' + "200": + description: "" content: - '*/*': + "*/*": schema: - $ref: '#/components/schemas/api_container_api.StoreWebFilesArtifactResponse' - /api_container_api.ApiContainerService/StoreFilesArtifactFromService: - post: - operationId: api_container_api.ApiContainerService.StoreFilesArtifactFromService - description: Tells the API container to copy a files artifact from a service to the Kurtosis File System + $ref: "#/components/schemas/UploadFilesArtifactResponse" + /artifact/remote-file: + put: + description: Tells the API container to download a files artifact from the web to the Kurtosis File System requestBody: content: application/json: schema: - $ref: '#/components/schemas/api_container_api.StoreFilesArtifactFromServiceArgs' + $ref: "#/components/schemas/StoreWebFilesArtifactArgs" + description: Store Web Files Artifact required: true responses: - '200': - description: '' - content: - '*/*': - schema: - $ref: '#/components/schemas/api_container_api.StoreFilesArtifactFromServiceResponse' - /api_container_api.ApiContainerService/ListFilesArtifactNamesAndUuids: - post: - operationId: api_container_api.ApiContainerService.ListFilesArtifactNamesAndUuids - description: '' - requestBody: - $ref: '#/components/requestBodies/google.protobuf.Empty' - responses: - '200': - description: '' + "200": + description: "" content: - '*/*': + "*/*": schema: - $ref: '#/components/schemas/api_container_api.ListFilesArtifactNamesAndUuidsResponse' - /api_container_api.ApiContainerService/InspectFilesArtifactContents: - post: - operationId: api_container_api.ApiContainerService.InspectFilesArtifactContents - description: '' + $ref: "#/components/schemas/StoreWebFilesArtifactResponse" + /artifact/service/{service_identifier}: + put: + description: Tells the API container to copy a files artifact from a service to the Kurtosis File System requestBody: content: application/json: schema: - $ref: '#/components/schemas/api_container_api.InspectFilesArtifactContentsRequest' + $ref: "#/components/schemas/StoreFilesArtifactFromServiceArgs" required: true + parameters: + - in: path + name: service_identifier + schema: + type: string + required: true + description: Numeric ID of the user to get responses: - '200': - description: '' + "200": + description: "" content: - '*/*': + "*/*": schema: - $ref: '#/components/schemas/api_container_api.InspectFilesArtifactContentsResponse' - /api_container_api.ApiContainerService/ConnectServices: + $ref: "#/components/schemas/StoreFilesArtifactFromServiceResponse" + /service/connection: post: - operationId: api_container_api.ApiContainerService.ConnectServices description: User services port forwarding requestBody: content: application/json: schema: - $ref: '#/components/schemas/api_container_api.ConnectServicesArgs' + $ref: "#/components/schemas/ConnectServicesArgs" required: true responses: - '200': - description: '' - content: - '*/*': - schema: - $ref: '#/components/schemas/api_container_api.ConnectServicesResponse' - /api_container_api.ApiContainerService/GetStarlarkRun: - post: - operationId: api_container_api.ApiContainerService.GetStarlarkRun - description: Get last Starlark run - requestBody: - $ref: '#/components/requestBodies/google.protobuf.Empty' - responses: - '200': - description: '' + "200": + description: "" content: - '*/*': + "*/*": schema: - $ref: '#/components/schemas/api_container_api.GetStarlarkRunResponse' + $ref: "#/components/schemas/ConnectServicesResponse" components: requestBodies: - api_container_api.StreamedDataChunk: + StreamedDataBody: content: application/json: schema: - $ref: '#/components/schemas/api_container_api.StreamedDataChunk' - description: |- - ============================================================================================== - Streamed Data Chunk - ============================================================================================== + $ref: "#/components/schemas/StreamedDataChunk" + description: Streamed Data Chunk required: true google.protobuf.Empty: content: application/json: schema: - $ref: '#/components/schemas/google.protobuf.Empty' + $ref: "#/components/schemas/google.protobuf.Empty" required: true schemas: - api_container_api.Port: + Port: type: object properties: number: type: integer format: int32 transport_protocol: - $ref: '#/components/schemas/api_container_api.Port.TransportProtocol' + $ref: "#/components/schemas/Port.TransportProtocol" maybe_application_protocol: type: string maybe_wait_timeout: type: string description: The wait timeout duration in string - description: |- - ============================================================================================== - Shared Objects (Used By Multiple Endpoints) - ============================================================================================== - api_container_api.Container: + description: Shared Objects (Used By Multiple Endpoints) + Container: type: object properties: status: - $ref: '#/components/schemas/api_container_api.Container.Status' + $ref: "#/components/schemas/Container.Status" image_name: type: string entrypoint_args: @@ -335,7 +310,7 @@ components: type: object additionalProperties: type: string - api_container_api.ServiceStatus: + ServiceStatus: type: string enum: - STOPPED @@ -344,16 +319,16 @@ components: description: |- 0 - STOPPED 1 - RUNNING - 2 - UNKNOWN - api_container_api.ImageDownloadMode: + 2 - UNKNOWN + ImageDownloadMode: type: string enum: - always - missing description: |- 0 - always - 1 - missing - api_container_api.ServiceInfo: + 1 - missing + ServiceInfo: type: object properties: service_uuid: @@ -363,14 +338,14 @@ components: type: string description: The IP address of the service inside the enclave private_ports: - $ref: '#/components/schemas/api_container_api.Port' + $ref: "#/components/schemas/Port" maybe_public_ip_addr: type: string description: |- Public IP address *outside* the enclave where the service is reachable NOTE: Will be empty if the service isn't running, the service didn't define any ports, or the backend doesn't support reporting public service info maybe_public_ports: - $ref: '#/components/schemas/api_container_api.Port' + $ref: "#/components/schemas/Port" name: type: string description: Name of the service @@ -378,10 +353,10 @@ components: type: string description: Shortened uuid of the service service_status: - $ref: '#/components/schemas/api_container_api.ServiceStatus' + $ref: "#/components/schemas/ServiceStatus" container: - $ref: '#/components/schemas/api_container_api.Container' - api_container_api.Connect: + $ref: "#/components/schemas/Container" + Connect: type: string enum: - CONNECT @@ -389,7 +364,7 @@ components: description: |- 0 - CONNECT // Best effort port forwarding 1 - NO_CONNECT // Port forwarding disabled - api_container_api.RunStarlarkScriptArgs: + RunStarlarkScriptArgs: type: object properties: serialized_script: @@ -409,7 +384,7 @@ components: experimental_features: type: array items: - $ref: '#/components/schemas/api_container_api.KurtosisFeatureFlag' + $ref: "#/components/schemas/KurtosisFeatureFlag" cloud_instance_id: type: string description: Defaults to empty @@ -417,8 +392,8 @@ components: type: string description: Defaults to empty image_download_mode: - $ref: '#/components/schemas/api_container_api.ImageDownloadMode' - api_container_api.RunStarlarkPackageArgs: + $ref: "#/components/schemas/ImageDownloadMode" + RunStarlarkPackageArgs: type: object properties: package_id: @@ -458,7 +433,7 @@ components: experimental_features: type: array items: - $ref: '#/components/schemas/api_container_api.KurtosisFeatureFlag' + $ref: "#/components/schemas/KurtosisFeatureFlag" cloud_instance_id: type: string description: Defaults to empty @@ -466,64 +441,64 @@ components: type: string description: Defaults to empty image_download_mode: - $ref: '#/components/schemas/api_container_api.ImageDownloadMode' - api_container_api.KurtosisFeatureFlag: + $ref: "#/components/schemas/ImageDownloadMode" + KurtosisFeatureFlag: type: string enum: - NO_INSTRUCTIONS_CACHING - description: '0 - NO_INSTRUCTIONS_CACHING ' - api_container_api.StarlarkRunResponseLine: + description: "0 - NO_INSTRUCTIONS_CACHING " + StarlarkRunResponseLine: type: object properties: instruction: - $ref: '#/components/schemas/api_container_api.StarlarkInstruction' + $ref: "#/components/schemas/StarlarkInstruction" error: - $ref: '#/components/schemas/api_container_api.StarlarkError' + $ref: "#/components/schemas/StarlarkError" progress_info: - $ref: '#/components/schemas/api_container_api.StarlarkRunProgress' + $ref: "#/components/schemas/StarlarkRunProgress" instruction_result: - $ref: '#/components/schemas/api_container_api.StarlarkInstructionResult' + $ref: "#/components/schemas/StarlarkInstructionResult" run_finished_event: - $ref: '#/components/schemas/api_container_api.StarlarkRunFinishedEvent' + $ref: "#/components/schemas/StarlarkRunFinishedEvent" warning: - $ref: '#/components/schemas/api_container_api.StarlarkWarning' + $ref: "#/components/schemas/StarlarkWarning" info: - $ref: '#/components/schemas/api_container_api.StarlarkInfo' + $ref: "#/components/schemas/StarlarkInfo" description: |- ============================================================================================== Starlark Execution Response ============================================================================================== - api_container_api.StarlarkInfo: + StarlarkInfo: type: object properties: info_message: type: string - api_container_api.StarlarkWarning: + StarlarkWarning: type: object properties: warning_message: type: string - api_container_api.StarlarkInstruction: + StarlarkInstruction: type: object properties: position: - $ref: '#/components/schemas/api_container_api.StarlarkInstructionPosition' + $ref: "#/components/schemas/StarlarkInstructionPosition" instruction_name: type: string arguments: type: array items: - $ref: '#/components/schemas/api_container_api.StarlarkInstructionArg' + $ref: "#/components/schemas/StarlarkInstructionArg" executable_instruction: type: string is_skipped: type: boolean - api_container_api.StarlarkInstructionResult: + StarlarkInstructionResult: type: object properties: serialized_instruction_result: type: string - api_container_api.StarlarkInstructionArg: + StarlarkInstructionArg: type: object properties: serialized_arg_value: @@ -532,7 +507,7 @@ components: type: string is_representative: type: boolean - api_container_api.StarlarkInstructionPosition: + StarlarkInstructionPosition: type: object properties: filename: @@ -543,31 +518,31 @@ components: column: type: integer format: int32 - api_container_api.StarlarkError: + StarlarkError: type: object properties: interpretation_error: - $ref: '#/components/schemas/api_container_api.StarlarkInterpretationError' + $ref: "#/components/schemas/StarlarkInterpretationError" validation_error: - $ref: '#/components/schemas/api_container_api.StarlarkValidationError' + $ref: "#/components/schemas/StarlarkValidationError" execution_error: - $ref: '#/components/schemas/api_container_api.StarlarkExecutionError' - api_container_api.StarlarkInterpretationError: + $ref: "#/components/schemas/StarlarkExecutionError" + StarlarkInterpretationError: type: object properties: error_message: type: string - api_container_api.StarlarkValidationError: + StarlarkValidationError: type: object properties: error_message: type: string - api_container_api.StarlarkExecutionError: + StarlarkExecutionError: type: object properties: error_message: type: string - api_container_api.StarlarkRunProgress: + StarlarkRunProgress: type: object properties: current_step_info: @@ -580,33 +555,19 @@ components: current_step_number: type: integer format: int32 - api_container_api.StarlarkRunFinishedEvent: + StarlarkRunFinishedEvent: type: object properties: is_run_successful: type: boolean serialized_output: type: string - api_container_api.GetServicesArgs: - type: object - properties: - service_identifiers: - type: object - description: |- - "Set" of identifiers to fetch info for - If empty, will fetch info for all services - additionalProperties: - type: string - description: |- - ============================================================================================== - Get Services - ============================================================================================== - api_container_api.GetServicesResponse: + GetServicesResponse: type: object properties: service_info: - $ref: '#/components/schemas/api_container_api.ServiceInfo' - api_container_api.ServiceIdentifiers: + $ref: "#/components/schemas/ServiceInfo" + ServiceIdentifiers: type: object properties: service_uuid: @@ -619,19 +580,16 @@ components: type: string description: The shortened uuid of the service description: An service identifier is a collection of uuid, name and shortened uuid - api_container_api.GetExistingAndHistoricalServiceIdentifiersResponse: + GetExistingAndHistoricalServiceIdentifiersResponse: type: object properties: allIdentifiers: type: array items: - $ref: '#/components/schemas/api_container_api.ServiceIdentifiers' - api_container_api.ExecCommandArgs: + $ref: "#/components/schemas/ServiceIdentifiers" + ExecCommandArgs: type: object properties: - service_identifier: - type: string - description: The service identifier of the container that the command should be executed in command_args: type: array items: @@ -640,7 +598,7 @@ components: ============================================================================================== Exec Command ============================================================================================== - api_container_api.ExecCommandResponse: + ExecCommandResponse: type: object properties: exit_code: @@ -649,16 +607,12 @@ components: log_output: type: string description: Assumes UTF-8 encoding - api_container_api.WaitForHttpGetEndpointAvailabilityArgs: + WaitForEndpointAvailabilityArgs: type: object properties: - service_identifier: + http_method: type: string - description: The identifier of the service to check. - port: - type: integer - format: int32 - description: The port of the service to check. For instance 8080 + enum: [GET, POST] path: type: string description: The path of the service to check. It mustn't start with the first slash. For instance `service/health` @@ -677,46 +631,8 @@ components: body_text: type: string description: If the endpoint returns this value, the service will be marked as available (e.g. Hello World). - description: |- - ============================================================================================== - Wait For HTTP Get Endpoint Availability - ============================================================================================== - api_container_api.WaitForHttpPostEndpointAvailabilityArgs: - type: object - properties: - service_identifier: - type: string - description: The identifier of the service to check. - port: - type: integer - format: int32 - description: The port of the service to check. For instance 8080 - path: - type: string - description: The path of the service to check. It mustn't start with the first slash. For instance `service/health` - request_body: - type: string - description: The content of the request body. - initial_delay_milliseconds: - type: integer - format: int32 - description: The number of milliseconds to wait until executing the first HTTP call - retries: - type: integer - format: int32 - description: Max number of HTTP call attempts that this will execute until giving up and returning an error - retries_delay_milliseconds: - type: integer - format: int32 - description: Number of milliseconds to wait between retries - body_text: - type: string - description: If the endpoint returns this value, the service will be marked as available (e.g. Hello World). - description: |- - ============================================================================================== - Wait For HTTP Post Endpoint Availability - ============================================================================================== - api_container_api.StreamedDataChunk: + description: Wait For HTTP Endpoint Availability + StreamedDataChunk: type: object properties: data: @@ -730,17 +646,17 @@ components: Referencing the previous chunk via its hash allows Kurtosis to validate the consistency of the data in case some chunk were not received metadata: - $ref: '#/components/schemas/api_container_api.DataChunkMetadata' + $ref: "#/components/schemas/DataChunkMetadata" description: |- ============================================================================================== Streamed Data Chunk ============================================================================================== - api_container_api.DataChunkMetadata: + DataChunkMetadata: type: object properties: name: type: string - api_container_api.UploadFilesArtifactResponse: + UploadFilesArtifactResponse: type: object properties: uuid: @@ -753,7 +669,7 @@ components: ============================================================================================== Upload Files Artifact ============================================================================================== - api_container_api.DownloadFilesArtifactArgs: + DownloadFilesArtifactArgs: type: object properties: identifier: @@ -763,7 +679,7 @@ components: ============================================================================================== Download Files Artifact ============================================================================================== - api_container_api.StoreWebFilesArtifactArgs: + StoreWebFilesArtifactArgs: type: object properties: url: @@ -776,31 +692,28 @@ components: ============================================================================================== Store Web Files Artifact ============================================================================================== - api_container_api.StoreWebFilesArtifactResponse: + StoreWebFilesArtifactResponse: type: object properties: uuid: type: string description: UUID of the files artifact, for use when referencing it in the future - api_container_api.StoreFilesArtifactFromServiceArgs: + StoreFilesArtifactFromServiceArgs: type: object properties: - service_identifier: - type: string - description: Identifier that will be used to identify the service where the source files will be copied from source_path: type: string description: The absolute source path where the source files will be copied from name: type: string description: The name of the files artifact - api_container_api.StoreFilesArtifactFromServiceResponse: + StoreFilesArtifactFromServiceResponse: type: object properties: uuid: type: string description: UUID of the files artifact, for use when referencing it in the future - api_container_api.FilesArtifactNameAndUuid: + FilesArtifactNameAndUuid: type: object properties: fileName: @@ -809,26 +722,26 @@ components: fileUuid: type: string description: A string representing the uuid of the file - api_container_api.ListFilesArtifactNamesAndUuidsResponse: + ListFilesArtifactNamesAndUuidsResponse: type: object properties: file_names_and_uuids: type: array items: - $ref: '#/components/schemas/api_container_api.FilesArtifactNameAndUuid' - api_container_api.InspectFilesArtifactContentsRequest: + $ref: "#/components/schemas/FilesArtifactNameAndUuid" + InspectFilesArtifactContentsRequest: type: object properties: file_names_and_uuid: - $ref: '#/components/schemas/api_container_api.FilesArtifactNameAndUuid' - api_container_api.InspectFilesArtifactContentsResponse: + $ref: "#/components/schemas/FilesArtifactNameAndUuid" + InspectFilesArtifactContentsResponse: type: object properties: file_descriptions: type: array items: - $ref: '#/components/schemas/api_container_api.FileArtifactContentsFileDescription' - api_container_api.FileArtifactContentsFileDescription: + $ref: "#/components/schemas/FileArtifactContentsFileDescription" + FileArtifactContentsFileDescription: type: object properties: path: @@ -841,23 +754,23 @@ components: text_preview: type: string description: A bit of text content, if the file allows (similar to UNIX's 'head') - api_container_api.ConnectServicesArgs: + ConnectServicesArgs: type: object properties: connect: - $ref: '#/components/schemas/api_container_api.Connect' - api_container_api.ConnectServicesResponse: + $ref: "#/components/schemas/Connect" + ConnectServicesResponse: type: object properties: {} - api_container_api.RestartPolicy: + RestartPolicy: type: string enum: - NEVER - ALWAYS description: |- 0 - NEVER - 1 - ALWAYS - api_container_api.GetStarlarkRunResponse: + 1 - ALWAYS + GetStarlarkRunResponse: type: object properties: package_id: @@ -876,10 +789,10 @@ components: experimental_features: type: array items: - $ref: '#/components/schemas/api_container_api.KurtosisFeatureFlag' + $ref: "#/components/schemas/KurtosisFeatureFlag" restart_policy: - $ref: '#/components/schemas/api_container_api.RestartPolicy' - api_container_api.Port.TransportProtocol: + $ref: "#/components/schemas/RestartPolicy" + Port.TransportProtocol: type: string enum: - TCP @@ -888,8 +801,8 @@ components: description: |- 0 - TCP 1 - SCTP - 2 - UDP - api_container_api.Container.Status: + 2 - UDP + Container.Status: type: string enum: - STOPPED @@ -898,7 +811,7 @@ components: description: |- 0 - STOPPED 1 - RUNNING - 2 - UNKNOWN + 2 - UNKNOWN google.protobuf.Empty: type: object properties: {} diff --git a/go.work.sum b/go.work.sum index 145167678f..b7dcb8d999 100644 --- a/go.work.sum +++ b/go.work.sum @@ -1,15 +1,32 @@ github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= +github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= +github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= +github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= +github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU= github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= +github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY= github.com/invopop/yaml v0.2.0 h1:7zky/qH+O0DwAyoobXUqvVBwgBFRxKoQ/3FjcVpjTMY= +github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= github.com/perimeterx/marshmallow v1.1.5 h1:a2LALqQ1BlHM8PZblsDdidgv1mWi1DgC2UmX50IvK2s= github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo= -github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +go.etcd.io/bbolt v1.3.7 h1:j+zJOnnEjF/kyHlDDgGnVL/AIqIJPq8UoB2GSNfkUfQ= +go.etcd.io/bbolt v1.3.7/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= +go.etcd.io/gofail v0.1.0/go.mod h1:VZBCXYGZhHAinaBiiqYvuDynvahNsAyLFwB3kEHKz1M= +golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= +golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= From 52034b611bc6c091aabaeea21170426dfef4bc58 Mon Sep 17 00:00:00 2001 From: lostbean Date: Fri, 10 Nov 2023 10:20:16 -0300 Subject: [PATCH 03/95] add generated golang bindings code for new REST api --- .../api_container_server.gen.go | 489 +++ .../api_container_service.gen.go | 2867 ----------------- .../api_container_types.gen.go | 500 +++ .../engine_server.gen.go | 298 ++ .../engine_service.gen.go | 1710 ---------- .../engine_types.gen.go | 141 + api/openapi/core/api_container_service.yaml | 159 +- api/openapi/core/server.cfg.yaml | 5 + api/openapi/core/types.cfg.yaml | 4 + api/openapi/engine/engine_service.yaml | 487 ++- api/openapi/engine/server.cfg.yaml | 5 + api/openapi/engine/types.cfg.yaml | 4 + 12 files changed, 1735 insertions(+), 4934 deletions(-) create mode 100644 api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go delete mode 100644 api/golang/core/kurtosis_core_http_api_bindings/api_container_service.gen.go create mode 100644 api/golang/core/kurtosis_core_http_api_bindings/api_container_types.gen.go create mode 100644 api/golang/engine/kurtosis_engine_http_api_bindings/engine_server.gen.go delete mode 100644 api/golang/engine/kurtosis_engine_http_api_bindings/engine_service.gen.go create mode 100644 api/golang/engine/kurtosis_engine_http_api_bindings/engine_types.gen.go create mode 100644 api/openapi/core/server.cfg.yaml create mode 100644 api/openapi/core/types.cfg.yaml create mode 100644 api/openapi/engine/server.cfg.yaml create mode 100644 api/openapi/engine/types.cfg.yaml diff --git a/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go b/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go new file mode 100644 index 0000000000..db8b2efaef --- /dev/null +++ b/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go @@ -0,0 +1,489 @@ +// Package kurtosis_core_http_api_bindings provides primitives to interact with the openapi HTTP API. +// +// Code generated by github.com/deepmap/oapi-codegen version (devel) DO NOT EDIT. +package kurtosis_core_http_api_bindings + +import ( + "bytes" + "compress/gzip" + "context" + "encoding/base64" + "encoding/json" + "fmt" + "io" + "net/http" + "net/url" + "path" + "strings" + + "github.com/getkin/kin-openapi/openapi3" +) + +type SuccessAsteriskResponse struct { + Body io.Reader + + ContentType string + ContentLength int64 +} + +type GetArtifactsRequestObject struct { +} + +type GetArtifactsResponseObject interface { + VisitGetArtifactsResponse(w http.ResponseWriter) error +} + +type GetArtifacts200JSONResponse ListFilesArtifactNamesAndUuidsResponse + +func (response GetArtifacts200JSONResponse) VisitGetArtifactsResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PutArtifactsLocalFileRequestObject struct { + Body *PutArtifactsLocalFileJSONRequestBody +} + +type PutArtifactsLocalFileResponseObject interface { + VisitPutArtifactsLocalFileResponse(w http.ResponseWriter) error +} + +type PutArtifactsLocalFile200JSONResponse UploadFilesArtifactResponse + +func (response PutArtifactsLocalFile200JSONResponse) VisitPutArtifactsLocalFileResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PutArtifactsRemoteFileRequestObject struct { + Body *PutArtifactsRemoteFileJSONRequestBody +} + +type PutArtifactsRemoteFileResponseObject interface { + VisitPutArtifactsRemoteFileResponse(w http.ResponseWriter) error +} + +type PutArtifactsRemoteFile200JSONResponse StoreWebFilesArtifactResponse + +func (response PutArtifactsRemoteFile200JSONResponse) VisitPutArtifactsRemoteFileResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PutArtifactsServicesServiceIdentifierRequestObject struct { + ServiceIdentifier string `json:"service_identifier"` + Body *PutArtifactsServicesServiceIdentifierJSONRequestBody +} + +type PutArtifactsServicesServiceIdentifierResponseObject interface { + VisitPutArtifactsServicesServiceIdentifierResponse(w http.ResponseWriter) error +} + +type PutArtifactsServicesServiceIdentifier200JSONResponse StoreFilesArtifactFromServiceResponse + +func (response PutArtifactsServicesServiceIdentifier200JSONResponse) VisitPutArtifactsServicesServiceIdentifierResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type GetArtifactsArtifactIdentifierRequestObject struct { + ArtifactIdentifier string `json:"artifact_identifier"` +} + +type GetArtifactsArtifactIdentifierResponseObject interface { + VisitGetArtifactsArtifactIdentifierResponse(w http.ResponseWriter) error +} + +type GetArtifactsArtifactIdentifier200JSONResponse InspectFilesArtifactContentsResponse + +func (response GetArtifactsArtifactIdentifier200JSONResponse) VisitGetArtifactsArtifactIdentifierResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type GetArtifactsArtifactIdentifierDownloadRequestObject struct { + ArtifactIdentifier string `json:"artifact_identifier"` +} + +type GetArtifactsArtifactIdentifierDownloadResponseObject interface { + VisitGetArtifactsArtifactIdentifierDownloadResponse(w http.ResponseWriter) error +} + +type GetArtifactsArtifactIdentifierDownload200JSONResponse StreamedDataChunk + +func (response GetArtifactsArtifactIdentifierDownload200JSONResponse) VisitGetArtifactsArtifactIdentifierDownloadResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type GetServicesRequestObject struct { +} + +type GetServicesResponseObject interface { + VisitGetServicesResponse(w http.ResponseWriter) error +} + +type GetServices200JSONResponse GetExistingAndHistoricalServiceIdentifiersResponse + +func (response GetServices200JSONResponse) VisitGetServicesResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PostServicesConnectionRequestObject struct { + Body *PostServicesConnectionJSONRequestBody +} + +type PostServicesConnectionResponseObject interface { + VisitPostServicesConnectionResponse(w http.ResponseWriter) error +} + +type PostServicesConnection200JSONResponse ConnectServicesResponse + +func (response PostServicesConnection200JSONResponse) VisitPostServicesConnectionResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type GetServicesServiceIdentifierRequestObject struct { + ServiceIdentifier string `json:"service_identifier"` + Params GetServicesServiceIdentifierParams +} + +type GetServicesServiceIdentifierResponseObject interface { + VisitGetServicesServiceIdentifierResponse(w http.ResponseWriter) error +} + +type GetServicesServiceIdentifier200JSONResponse GetServicesResponse + +func (response GetServicesServiceIdentifier200JSONResponse) VisitGetServicesServiceIdentifierResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PostServicesServiceIdentifierCommandRequestObject struct { + ServiceIdentifier string `json:"service_identifier"` + Body *PostServicesServiceIdentifierCommandJSONRequestBody +} + +type PostServicesServiceIdentifierCommandResponseObject interface { + VisitPostServicesServiceIdentifierCommandResponse(w http.ResponseWriter) error +} + +type PostServicesServiceIdentifierCommand200JSONResponse ExecCommandResponse + +func (response PostServicesServiceIdentifierCommand200JSONResponse) VisitPostServicesServiceIdentifierCommandResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PostServicesServiceIdentifierEndpointsPortNumberAvailabilityRequestObject struct { + ServiceIdentifier string `json:"service_identifier"` + PortNumber int `json:"port_number"` + Body *PostServicesServiceIdentifierEndpointsPortNumberAvailabilityJSONRequestBody +} + +type PostServicesServiceIdentifierEndpointsPortNumberAvailabilityResponseObject interface { + VisitPostServicesServiceIdentifierEndpointsPortNumberAvailabilityResponse(w http.ResponseWriter) error +} + +type PostServicesServiceIdentifierEndpointsPortNumberAvailability200AsteriskResponse struct{ SuccessAsteriskResponse } + +func (response PostServicesServiceIdentifierEndpointsPortNumberAvailability200AsteriskResponse) VisitPostServicesServiceIdentifierEndpointsPortNumberAvailabilityResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", response.ContentType) + if response.ContentLength != 0 { + w.Header().Set("Content-Length", fmt.Sprint(response.ContentLength)) + } + w.WriteHeader(200) + + if closer, ok := response.Body.(io.ReadCloser); ok { + defer closer.Close() + } + _, err := io.Copy(w, response.Body) + return err +} + +type GetStarlarkRequestObject struct { +} + +type GetStarlarkResponseObject interface { + VisitGetStarlarkResponse(w http.ResponseWriter) error +} + +type GetStarlark200JSONResponse GetStarlarkRunResponse + +func (response GetStarlark200JSONResponse) VisitGetStarlarkResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PutStarlarkPackagesRequestObject struct { + Body *PutStarlarkPackagesJSONRequestBody +} + +type PutStarlarkPackagesResponseObject interface { + VisitPutStarlarkPackagesResponse(w http.ResponseWriter) error +} + +type PutStarlarkPackages200AsteriskResponse struct{ SuccessAsteriskResponse } + +func (response PutStarlarkPackages200AsteriskResponse) VisitPutStarlarkPackagesResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", response.ContentType) + if response.ContentLength != 0 { + w.Header().Set("Content-Length", fmt.Sprint(response.ContentLength)) + } + w.WriteHeader(200) + + if closer, ok := response.Body.(io.ReadCloser); ok { + defer closer.Close() + } + _, err := io.Copy(w, response.Body) + return err +} + +type PostStarlarkPackagesPackageIdRequestObject struct { + PackageId string `json:"package_id"` + Body *PostStarlarkPackagesPackageIdJSONRequestBody +} + +type PostStarlarkPackagesPackageIdResponseObject interface { + VisitPostStarlarkPackagesPackageIdResponse(w http.ResponseWriter) error +} + +type PostStarlarkPackagesPackageId200JSONResponse StarlarkRunResponseLine + +func (response PostStarlarkPackagesPackageId200JSONResponse) VisitPostStarlarkPackagesPackageIdResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PostStarlarkScriptsRequestObject struct { + Body *PostStarlarkScriptsJSONRequestBody +} + +type PostStarlarkScriptsResponseObject interface { + VisitPostStarlarkScriptsResponse(w http.ResponseWriter) error +} + +type PostStarlarkScripts200JSONResponse StarlarkRunResponseLine + +func (response PostStarlarkScripts200JSONResponse) VisitPostStarlarkScriptsResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +// StrictServerInterface represents all server handlers. +type StrictServerInterface interface { + + // (GET /artifacts) + GetArtifacts(ctx context.Context, request GetArtifactsRequestObject) (GetArtifactsResponseObject, error) + + // (PUT /artifacts/local-file) + PutArtifactsLocalFile(ctx context.Context, request PutArtifactsLocalFileRequestObject) (PutArtifactsLocalFileResponseObject, error) + + // (PUT /artifacts/remote-file) + PutArtifactsRemoteFile(ctx context.Context, request PutArtifactsRemoteFileRequestObject) (PutArtifactsRemoteFileResponseObject, error) + + // (PUT /artifacts/services/{service_identifier}) + PutArtifactsServicesServiceIdentifier(ctx context.Context, request PutArtifactsServicesServiceIdentifierRequestObject) (PutArtifactsServicesServiceIdentifierResponseObject, error) + + // (GET /artifacts/{artifact_identifier}) + GetArtifactsArtifactIdentifier(ctx context.Context, request GetArtifactsArtifactIdentifierRequestObject) (GetArtifactsArtifactIdentifierResponseObject, error) + + // (GET /artifacts/{artifact_identifier}/download) + GetArtifactsArtifactIdentifierDownload(ctx context.Context, request GetArtifactsArtifactIdentifierDownloadRequestObject) (GetArtifactsArtifactIdentifierDownloadResponseObject, error) + + // (GET /services) + GetServices(ctx context.Context, request GetServicesRequestObject) (GetServicesResponseObject, error) + + // (POST /services/connection) + PostServicesConnection(ctx context.Context, request PostServicesConnectionRequestObject) (PostServicesConnectionResponseObject, error) + + // (GET /services/{service_identifier}) + GetServicesServiceIdentifier(ctx context.Context, request GetServicesServiceIdentifierRequestObject) (GetServicesServiceIdentifierResponseObject, error) + + // (POST /services/{service_identifier}/command) + PostServicesServiceIdentifierCommand(ctx context.Context, request PostServicesServiceIdentifierCommandRequestObject) (PostServicesServiceIdentifierCommandResponseObject, error) + + // (POST /services/{service_identifier}/endpoints/{port_number}/availability) + PostServicesServiceIdentifierEndpointsPortNumberAvailability(ctx context.Context, request PostServicesServiceIdentifierEndpointsPortNumberAvailabilityRequestObject) (PostServicesServiceIdentifierEndpointsPortNumberAvailabilityResponseObject, error) + + // (GET /starlark) + GetStarlark(ctx context.Context, request GetStarlarkRequestObject) (GetStarlarkResponseObject, error) + + // (PUT /starlark/packages) + PutStarlarkPackages(ctx context.Context, request PutStarlarkPackagesRequestObject) (PutStarlarkPackagesResponseObject, error) + + // (POST /starlark/packages/{package_id}) + PostStarlarkPackagesPackageId(ctx context.Context, request PostStarlarkPackagesPackageIdRequestObject) (PostStarlarkPackagesPackageIdResponseObject, error) + + // (POST /starlark/scripts) + PostStarlarkScripts(ctx context.Context, request PostStarlarkScriptsRequestObject) (PostStarlarkScriptsResponseObject, error) +} + +// Base64 encoded, gzipped, json marshaled Swagger object +var swaggerSpec = []string{ + + "H4sIAAAAAAAC/+w8f2/bOJZfhdAd0J2BG3dnF4tD/kvTpPV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3ve0aLpLTv0UcOCiWkV0uVWlHLzpHdLzJqQuf4c4t6fKjI9vRgXdg", + "f39BJT1YSnh0L9m+qQ4+ebQfpItfwp/7OvhkAAt/DFeIRfNg7A7eKnQDRJQhQtnzteGFJDCoO/x4AYyD", + "X29IYq93xAPoA55/kKkfFmlY5gVs/fcs3kEvXIMsgzvvldW1P1NhpokpKpOC0KWsDJ7hCfhnPOSuevPm", + "p7+Qdf2Wh9SYI0Kb78ZejA1HPDIawKexf74artakjuWUqD5hxv4j3G68krpmyPkO+8uEg9gT3W8cAPoe", + "7w7hfl/S0efwj47/826bmJFkBSZbh66dr58CjDr9avULYdIoivil/1mB2jZcUg37ugX7fZxQ7L3csQIe", + "+ze3/Qbn7vfAZZj3bAOC+DmhKYmGjq5d8nnQEDsK03gP/FSaEGkx9HGlkfi6egXUdO46eH3tAkn/d0o0", + "959VR6S997D627mc2EPro7UxlBv1+It9deTqUo9j2qxi9qrqWy6zT74utdNWW9Hq1DHr6uSofo/CUGuU", + "rO7XhLpZ7wEnWHk+T6Prl2AzqYwrWO0XYv/NNX0UrWxiOPa1xFDRJLS98QgpDVEPoWFXt3shc3uq9h5R", + "73b1HfWmrwI/yDLj1SwPN979X0ycSfmL8t48E8nhVJvdewdViWjuGDC9cPSKvL0+5DI8+Ni/0tADCo77", + "LztOiHvLYaB0bctOCOHlWPOdWUZFy4Bs/b37Vi1WG9kD0S9ZpjxKRWoWjr/snjA9Dgj+DY66cSJFfZx7", + "pckS1pSv4k5yjyn+38mgeB+E0swV0emF66YgpR7Hsnum9TuI4j3vQr95jSje4TXEAN2g/jb6MveLvbgw", + "Gk+yfueyeHz8vwAAAP//MYxsmN1LAAA=", +} + +// GetSwagger returns the content of the embedded swagger specification file +// or error if failed to decode +func decodeSpec() ([]byte, error) { + zipped, err := base64.StdEncoding.DecodeString(strings.Join(swaggerSpec, "")) + if err != nil { + return nil, fmt.Errorf("error base64 decoding spec: %s", err) + } + zr, err := gzip.NewReader(bytes.NewReader(zipped)) + if err != nil { + return nil, fmt.Errorf("error decompressing spec: %s", err) + } + var buf bytes.Buffer + _, err = buf.ReadFrom(zr) + if err != nil { + return nil, fmt.Errorf("error decompressing spec: %s", err) + } + + return buf.Bytes(), nil +} + +var rawSpec = decodeSpecCached() + +// a naive cached of a decoded swagger spec +func decodeSpecCached() func() ([]byte, error) { + data, err := decodeSpec() + return func() ([]byte, error) { + return data, err + } +} + +// Constructs a synthetic filesystem for resolving external references when loading openapi specifications. +func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error) { + var res = make(map[string]func() ([]byte, error)) + if len(pathToFile) > 0 { + res[pathToFile] = rawSpec + } + + return res +} + +// GetSwagger returns the Swagger specification corresponding to the generated code +// in this file. The external references of Swagger specification are resolved. +// The logic of resolving external references is tightly connected to "import-mapping" feature. +// Externally referenced files must be embedded in the corresponding golang packages. +// Urls can be supported but this task was out of the scope. +func GetSwagger() (swagger *openapi3.T, err error) { + var resolvePath = PathToRawSpec("") + + loader := openapi3.NewLoader() + loader.IsExternalRefsAllowed = true + loader.ReadFromURIFunc = func(loader *openapi3.Loader, url *url.URL) ([]byte, error) { + var pathToFile = url.String() + pathToFile = path.Clean(pathToFile) + getSpec, ok := resolvePath[pathToFile] + if !ok { + err1 := fmt.Errorf("path not found: %s", pathToFile) + return nil, err1 + } + return getSpec() + } + var specData []byte + specData, err = rawSpec() + if err != nil { + return + } + swagger, err = loader.LoadFromData(specData) + if err != nil { + return + } + return +} diff --git a/api/golang/core/kurtosis_core_http_api_bindings/api_container_service.gen.go b/api/golang/core/kurtosis_core_http_api_bindings/api_container_service.gen.go deleted file mode 100644 index 3777282d2a..0000000000 --- a/api/golang/core/kurtosis_core_http_api_bindings/api_container_service.gen.go +++ /dev/null @@ -1,2867 +0,0 @@ -// Package api_container_service provides primitives to interact with the openapi HTTP API. -// -// Code generated by github.com/deepmap/oapi-codegen version (devel) DO NOT EDIT. -package api_container_service - -import ( - "bytes" - "compress/gzip" - "context" - "encoding/base64" - "encoding/json" - "fmt" - "io" - "net/http" - "net/url" - "path" - "strings" - - "github.com/deepmap/oapi-codegen/pkg/runtime" - "github.com/getkin/kin-openapi/openapi3" - "github.com/labstack/echo/v4" -) - -// Defines values for Connect. -const ( - CONNECT Connect = "CONNECT" - NOCONNECT Connect = "NO_CONNECT" -) - -// Defines values for ContainerStatus. -const ( - ContainerStatusRUNNING ContainerStatus = "RUNNING" - ContainerStatusSTOPPED ContainerStatus = "STOPPED" - ContainerStatusUNKNOWN ContainerStatus = "UNKNOWN" -) - -// Defines values for ImageDownloadMode. -const ( - Always ImageDownloadMode = "always" - Missing ImageDownloadMode = "missing" -) - -// Defines values for KurtosisFeatureFlag. -const ( - NOINSTRUCTIONSCACHING KurtosisFeatureFlag = "NO_INSTRUCTIONS_CACHING" -) - -// Defines values for PortTransportProtocol. -const ( - SCTP PortTransportProtocol = "SCTP" - TCP PortTransportProtocol = "TCP" - UDP PortTransportProtocol = "UDP" -) - -// Defines values for RestartPolicy. -const ( - ALWAYS RestartPolicy = "ALWAYS" - NEVER RestartPolicy = "NEVER" -) - -// Defines values for ServiceStatus. -const ( - ServiceStatusRUNNING ServiceStatus = "RUNNING" - ServiceStatusSTOPPED ServiceStatus = "STOPPED" - ServiceStatusUNKNOWN ServiceStatus = "UNKNOWN" -) - -// Defines values for WaitForEndpointAvailabilityArgsHttpMethod. -const ( - GET WaitForEndpointAvailabilityArgsHttpMethod = "GET" - POST WaitForEndpointAvailabilityArgsHttpMethod = "POST" -) - -// Connect 0 - CONNECT // Best effort port forwarding -// 1 - NO_CONNECT // Port forwarding disabled -type Connect string - -// ConnectServicesArgs defines model for ConnectServicesArgs. -type ConnectServicesArgs struct { - // Connect 0 - CONNECT // Best effort port forwarding - // 1 - NO_CONNECT // Port forwarding disabled - Connect *Connect `json:"connect,omitempty"` -} - -// ConnectServicesResponse defines model for ConnectServicesResponse. -type ConnectServicesResponse = map[string]interface{} - -// Container defines model for Container. -type Container struct { - CmdArgs *[]string `json:"cmd_args,omitempty"` - EntrypointArgs *[]string `json:"entrypoint_args,omitempty"` - EnvVars *map[string]string `json:"env_vars,omitempty"` - ImageName *string `json:"image_name,omitempty"` - - // Status 0 - STOPPED - // 1 - RUNNING - // 2 - UNKNOWN - Status *ContainerStatus `json:"status,omitempty"` -} - -// ContainerStatus 0 - STOPPED -// 1 - RUNNING -// 2 - UNKNOWN -type ContainerStatus string - -// DataChunkMetadata defines model for DataChunkMetadata. -type DataChunkMetadata struct { - Name *string `json:"name,omitempty"` -} - -// ExecCommandArgs ============================================================================================== -// Exec Command -// ============================================================================================== -type ExecCommandArgs struct { - CommandArgs *[]string `json:"command_args,omitempty"` -} - -// ExecCommandResponse defines model for ExecCommandResponse. -type ExecCommandResponse struct { - ExitCode *int32 `json:"exit_code,omitempty"` - - // LogOutput Assumes UTF-8 encoding - LogOutput *string `json:"log_output,omitempty"` -} - -// FileArtifactContentsFileDescription defines model for FileArtifactContentsFileDescription. -type FileArtifactContentsFileDescription struct { - // Path Path relative to the file artifact - Path *string `json:"path,omitempty"` - - // Size Size of the file, in bytes - Size *int64 `json:"size,omitempty"` - - // TextPreview A bit of text content, if the file allows (similar to UNIX's 'head') - TextPreview *string `json:"text_preview,omitempty"` -} - -// FilesArtifactNameAndUuid defines model for FilesArtifactNameAndUuid. -type FilesArtifactNameAndUuid struct { - // FileName A string representing the name of the file - FileName *string `json:"fileName,omitempty"` - - // FileUuid A string representing the uuid of the file - FileUuid *string `json:"fileUuid,omitempty"` -} - -// GetExistingAndHistoricalServiceIdentifiersResponse defines model for GetExistingAndHistoricalServiceIdentifiersResponse. -type GetExistingAndHistoricalServiceIdentifiersResponse struct { - AllIdentifiers *[]ServiceIdentifiers `json:"allIdentifiers,omitempty"` -} - -// GetServicesResponse defines model for GetServicesResponse. -type GetServicesResponse struct { - ServiceInfo *ServiceInfo `json:"service_info,omitempty"` -} - -// GetStarlarkRunResponse defines model for GetStarlarkRunResponse. -type GetStarlarkRunResponse struct { - ExperimentalFeatures *[]KurtosisFeatureFlag `json:"experimental_features,omitempty"` - MainFunctionName *string `json:"main_function_name,omitempty"` - PackageId *string `json:"package_id,omitempty"` - Parallelism *int32 `json:"parallelism,omitempty"` - RelativePathToMainFile *string `json:"relative_path_to_main_file,omitempty"` - - // RestartPolicy 0 - NEVER - // 1 - ALWAYS - RestartPolicy *RestartPolicy `json:"restart_policy,omitempty"` - SerializedParams *string `json:"serialized_params,omitempty"` - SerializedScript *string `json:"serialized_script,omitempty"` -} - -// ImageDownloadMode 0 - always -// 1 - missing -type ImageDownloadMode string - -// InspectFilesArtifactContentsResponse defines model for InspectFilesArtifactContentsResponse. -type InspectFilesArtifactContentsResponse struct { - FileDescriptions *[]FileArtifactContentsFileDescription `json:"file_descriptions,omitempty"` -} - -// KurtosisFeatureFlag 0 - NO_INSTRUCTIONS_CACHING -type KurtosisFeatureFlag string - -// ListFilesArtifactNamesAndUuidsResponse defines model for ListFilesArtifactNamesAndUuidsResponse. -type ListFilesArtifactNamesAndUuidsResponse struct { - FileNamesAndUuids *[]FilesArtifactNameAndUuid `json:"file_names_and_uuids,omitempty"` -} - -// Port Shared Objects (Used By Multiple Endpoints) -type Port struct { - MaybeApplicationProtocol *string `json:"maybe_application_protocol,omitempty"` - - // MaybeWaitTimeout The wait timeout duration in string - MaybeWaitTimeout *string `json:"maybe_wait_timeout,omitempty"` - Number *int32 `json:"number,omitempty"` - - // TransportProtocol 0 - TCP - // 1 - SCTP - // 2 - UDP - TransportProtocol *PortTransportProtocol `json:"transport_protocol,omitempty"` -} - -// PortTransportProtocol 0 - TCP -// 1 - SCTP -// 2 - UDP -type PortTransportProtocol string - -// RestartPolicy 0 - NEVER -// 1 - ALWAYS -type RestartPolicy string - -// RunStarlarkPackageArgs defines model for RunStarlarkPackageArgs. -type RunStarlarkPackageArgs struct { - // ClonePackage Whether the package should be cloned or not. - // If false, then the package will be pulled from the APIC local package store. If it's a local package then is must - // have been uploaded using UploadStarlarkPackage prior to calling RunStarlarkPackage. - // If true, then the package will be cloned from GitHub before execution starts - ClonePackage *bool `json:"clone_package,omitempty"` - - // CloudInstanceId Defaults to empty - CloudInstanceId *string `json:"cloud_instance_id,omitempty"` - - // CloudUserId Defaults to empty - CloudUserId *string `json:"cloud_user_id,omitempty"` - - // DryRun Defaults to false - DryRun *bool `json:"dry_run,omitempty"` - ExperimentalFeatures *[]KurtosisFeatureFlag `json:"experimental_features,omitempty"` - - // ImageDownloadMode 0 - always - // 1 - missing - ImageDownloadMode *ImageDownloadMode `json:"image_download_mode,omitempty"` - - // Local the payload of the local module - Local *[]byte `json:"local,omitempty"` - - // MainFunctionName The name of the main function, the default value is "run" - MainFunctionName *string `json:"main_function_name,omitempty"` - PackageId *string `json:"package_id,omitempty"` - - // Parallelism Defaults to 4 - Parallelism *int32 `json:"parallelism,omitempty"` - - // RelativePathToMainFile The relative main file filepath, the default value is the "main.star" file in the root of a package - RelativePathToMainFile *string `json:"relative_path_to_main_file,omitempty"` - - // Remote just a flag to indicate the module must be cloned inside the API - Remote *bool `json:"remote,omitempty"` - - // SerializedParams Serialized parameters data for the Starlark package main function - // This should be a valid JSON string - SerializedParams *string `json:"serialized_params,omitempty"` -} - -// RunStarlarkScriptArgs defines model for RunStarlarkScriptArgs. -type RunStarlarkScriptArgs struct { - // CloudInstanceId Defaults to empty - CloudInstanceId *string `json:"cloud_instance_id,omitempty"` - - // CloudUserId Defaults to empty - CloudUserId *string `json:"cloud_user_id,omitempty"` - - // DryRun Defaults to false - DryRun *bool `json:"dry_run,omitempty"` - ExperimentalFeatures *[]KurtosisFeatureFlag `json:"experimental_features,omitempty"` - - // ImageDownloadMode 0 - always - // 1 - missing - ImageDownloadMode *ImageDownloadMode `json:"image_download_mode,omitempty"` - - // MainFunctionName The name of the main function, the default value is "run" - MainFunctionName *string `json:"main_function_name,omitempty"` - - // Parallelism Defaults to 4 - Parallelism *int32 `json:"parallelism,omitempty"` - SerializedParams *string `json:"serialized_params,omitempty"` - SerializedScript *string `json:"serialized_script,omitempty"` -} - -// ServiceIdentifiers An service identifier is a collection of uuid, name and shortened uuid -type ServiceIdentifiers struct { - // Name Name of the service - Name *string `json:"name,omitempty"` - - // ServiceUuid UUID of the service - ServiceUuid *string `json:"service_uuid,omitempty"` - - // ShortenedUuid The shortened uuid of the service - ShortenedUuid *string `json:"shortened_uuid,omitempty"` -} - -// ServiceInfo defines model for ServiceInfo. -type ServiceInfo struct { - Container *Container `json:"container,omitempty"` - - // MaybePublicIpAddr Public IP address *outside* the enclave where the service is reachable - // NOTE: Will be empty if the service isn't running, the service didn't define any ports, or the backend doesn't support reporting public service info - MaybePublicIpAddr *string `json:"maybe_public_ip_addr,omitempty"` - - // MaybePublicPorts Shared Objects (Used By Multiple Endpoints) - MaybePublicPorts *Port `json:"maybe_public_ports,omitempty"` - - // Name Name of the service - Name *string `json:"name,omitempty"` - - // PrivateIpAddr The IP address of the service inside the enclave - PrivateIpAddr *string `json:"private_ip_addr,omitempty"` - - // PrivatePorts Shared Objects (Used By Multiple Endpoints) - PrivatePorts *Port `json:"private_ports,omitempty"` - - // ServiceStatus 0 - STOPPED - // 1 - RUNNING - // 2 - UNKNOWN - ServiceStatus *ServiceStatus `json:"service_status,omitempty"` - - // ServiceUuid UUID of the service - ServiceUuid *string `json:"service_uuid,omitempty"` - - // ShortenedUuid Shortened uuid of the service - ShortenedUuid *string `json:"shortened_uuid,omitempty"` -} - -// ServiceStatus 0 - STOPPED -// 1 - RUNNING -// 2 - UNKNOWN -type ServiceStatus string - -// StarlarkError defines model for StarlarkError. -type StarlarkError struct { - ExecutionError *StarlarkExecutionError `json:"execution_error,omitempty"` - InterpretationError *StarlarkInterpretationError `json:"interpretation_error,omitempty"` - ValidationError *StarlarkValidationError `json:"validation_error,omitempty"` -} - -// StarlarkExecutionError defines model for StarlarkExecutionError. -type StarlarkExecutionError struct { - ErrorMessage *string `json:"error_message,omitempty"` -} - -// StarlarkInfo defines model for StarlarkInfo. -type StarlarkInfo struct { - InfoMessage *string `json:"info_message,omitempty"` -} - -// StarlarkInstruction defines model for StarlarkInstruction. -type StarlarkInstruction struct { - Arguments *[]StarlarkInstructionArg `json:"arguments,omitempty"` - ExecutableInstruction *string `json:"executable_instruction,omitempty"` - InstructionName *string `json:"instruction_name,omitempty"` - IsSkipped *bool `json:"is_skipped,omitempty"` - Position *StarlarkInstructionPosition `json:"position,omitempty"` -} - -// StarlarkInstructionArg defines model for StarlarkInstructionArg. -type StarlarkInstructionArg struct { - ArgName *string `json:"arg_name,omitempty"` - IsRepresentative *bool `json:"is_representative,omitempty"` - SerializedArgValue *string `json:"serialized_arg_value,omitempty"` -} - -// StarlarkInstructionPosition defines model for StarlarkInstructionPosition. -type StarlarkInstructionPosition struct { - Column *int32 `json:"column,omitempty"` - Filename *string `json:"filename,omitempty"` - Line *int32 `json:"line,omitempty"` -} - -// StarlarkInstructionResult defines model for StarlarkInstructionResult. -type StarlarkInstructionResult struct { - SerializedInstructionResult *string `json:"serialized_instruction_result,omitempty"` -} - -// StarlarkInterpretationError defines model for StarlarkInterpretationError. -type StarlarkInterpretationError struct { - ErrorMessage *string `json:"error_message,omitempty"` -} - -// StarlarkRunFinishedEvent defines model for StarlarkRunFinishedEvent. -type StarlarkRunFinishedEvent struct { - IsRunSuccessful *bool `json:"is_run_successful,omitempty"` - SerializedOutput *string `json:"serialized_output,omitempty"` -} - -// StarlarkRunProgress defines model for StarlarkRunProgress. -type StarlarkRunProgress struct { - CurrentStepInfo *[]string `json:"current_step_info,omitempty"` - CurrentStepNumber *int32 `json:"current_step_number,omitempty"` - TotalSteps *int32 `json:"total_steps,omitempty"` -} - -// StarlarkRunResponseLine ============================================================================================== -// Starlark Execution Response -// ============================================================================================== -type StarlarkRunResponseLine struct { - Error *StarlarkError `json:"error,omitempty"` - Info *StarlarkInfo `json:"info,omitempty"` - Instruction *StarlarkInstruction `json:"instruction,omitempty"` - InstructionResult *StarlarkInstructionResult `json:"instruction_result,omitempty"` - ProgressInfo *StarlarkRunProgress `json:"progress_info,omitempty"` - RunFinishedEvent *StarlarkRunFinishedEvent `json:"run_finished_event,omitempty"` - Warning *StarlarkWarning `json:"warning,omitempty"` -} - -// StarlarkValidationError defines model for StarlarkValidationError. -type StarlarkValidationError struct { - ErrorMessage *string `json:"error_message,omitempty"` -} - -// StarlarkWarning defines model for StarlarkWarning. -type StarlarkWarning struct { - WarningMessage *string `json:"warning_message,omitempty"` -} - -// StoreFilesArtifactFromServiceArgs defines model for StoreFilesArtifactFromServiceArgs. -type StoreFilesArtifactFromServiceArgs struct { - // Name The name of the files artifact - Name *string `json:"name,omitempty"` - - // SourcePath The absolute source path where the source files will be copied from - SourcePath *string `json:"source_path,omitempty"` -} - -// StoreFilesArtifactFromServiceResponse defines model for StoreFilesArtifactFromServiceResponse. -type StoreFilesArtifactFromServiceResponse struct { - // Uuid UUID of the files artifact, for use when referencing it in the future - Uuid *string `json:"uuid,omitempty"` -} - -// StoreWebFilesArtifactArgs ============================================================================================== -// Store Web Files Artifact -// ============================================================================================== -type StoreWebFilesArtifactArgs struct { - // Name The name of the files artifact - Name *string `json:"name,omitempty"` - - // Url URL to download the artifact from - Url *string `json:"url,omitempty"` -} - -// StoreWebFilesArtifactResponse defines model for StoreWebFilesArtifactResponse. -type StoreWebFilesArtifactResponse struct { - // Uuid UUID of the files artifact, for use when referencing it in the future - Uuid *string `json:"uuid,omitempty"` -} - -// StreamedDataChunk ============================================================================================== -// Streamed Data Chunk -// ============================================================================================== -type StreamedDataChunk struct { - // Data Chunk of the overall files artifact bytes - Data *[]byte `json:"data,omitempty"` - Metadata *DataChunkMetadata `json:"metadata,omitempty"` - - // PreviousChunkHash Hash of the PREVIOUS chunk, or empty string is this is the first chunk - // Referencing the previous chunk via its hash allows Kurtosis to validate - // the consistency of the data in case some chunk were not received - PreviousChunkHash *string `json:"previous_chunk_hash,omitempty"` -} - -// UploadFilesArtifactResponse ============================================================================================== -// Upload Files Artifact -// ============================================================================================== -type UploadFilesArtifactResponse struct { - // Name UUID of the files artifact, for use when referencing it in the future - Name *string `json:"name,omitempty"` - - // Uuid UUID of the files artifact, for use when referencing it in the future - Uuid *string `json:"uuid,omitempty"` -} - -// WaitForEndpointAvailabilityArgs Wait For HTTP Endpoint Availability -type WaitForEndpointAvailabilityArgs struct { - // BodyText If the endpoint returns this value, the service will be marked as available (e.g. Hello World). - BodyText *string `json:"body_text,omitempty"` - HttpMethod *WaitForEndpointAvailabilityArgsHttpMethod `json:"http_method,omitempty"` - - // InitialDelayMilliseconds The number of milliseconds to wait until executing the first HTTP call - InitialDelayMilliseconds *int32 `json:"initial_delay_milliseconds,omitempty"` - - // Path The path of the service to check. It mustn't start with the first slash. For instance `service/health` - Path *string `json:"path,omitempty"` - - // Retries Max number of HTTP call attempts that this will execute until giving up and returning an error - Retries *int32 `json:"retries,omitempty"` - - // RetriesDelayMilliseconds Number of milliseconds to wait between retries - RetriesDelayMilliseconds *int32 `json:"retries_delay_milliseconds,omitempty"` -} - -// WaitForEndpointAvailabilityArgsHttpMethod defines model for WaitForEndpointAvailabilityArgs.HttpMethod. -type WaitForEndpointAvailabilityArgsHttpMethod string - -// GoogleProtobufEmpty defines model for google.protobuf.Empty. -type GoogleProtobufEmpty = map[string]interface{} - -// StreamedDataBody ============================================================================================== -// Streamed Data Chunk -// ============================================================================================== -type StreamedDataBody = StreamedDataChunk - -// GetServiceServiceIdentifierParams defines parameters for GetServiceServiceIdentifier. -type GetServiceServiceIdentifierParams struct { - // AdditionalProperties Additional properties - AdditionalProperties *string `form:"additional-properties,omitempty" json:"additional-properties,omitempty"` -} - -// PutArtifactLocalFileJSONRequestBody defines body for PutArtifactLocalFile for application/json ContentType. -type PutArtifactLocalFileJSONRequestBody = StreamedDataChunk - -// PutArtifactRemoteFileJSONRequestBody defines body for PutArtifactRemoteFile for application/json ContentType. -type PutArtifactRemoteFileJSONRequestBody = StoreWebFilesArtifactArgs - -// PutArtifactServiceServiceIdentifierJSONRequestBody defines body for PutArtifactServiceServiceIdentifier for application/json ContentType. -type PutArtifactServiceServiceIdentifierJSONRequestBody = StoreFilesArtifactFromServiceArgs - -// PostServiceConnectionJSONRequestBody defines body for PostServiceConnection for application/json ContentType. -type PostServiceConnectionJSONRequestBody = ConnectServicesArgs - -// PostServiceServiceIdentifierCommandJSONRequestBody defines body for PostServiceServiceIdentifierCommand for application/json ContentType. -type PostServiceServiceIdentifierCommandJSONRequestBody = ExecCommandArgs - -// PostServiceServiceIdentifierEndpointPortNumberAvailabilityJSONRequestBody defines body for PostServiceServiceIdentifierEndpointPortNumberAvailability for application/json ContentType. -type PostServiceServiceIdentifierEndpointPortNumberAvailabilityJSONRequestBody = WaitForEndpointAvailabilityArgs - -// PutStarlarkPackageJSONRequestBody defines body for PutStarlarkPackage for application/json ContentType. -type PutStarlarkPackageJSONRequestBody = StreamedDataChunk - -// PostStarlarkPackagePackageIdJSONRequestBody defines body for PostStarlarkPackagePackageId for application/json ContentType. -type PostStarlarkPackagePackageIdJSONRequestBody = RunStarlarkPackageArgs - -// PostStarlarkScriptJSONRequestBody defines body for PostStarlarkScript for application/json ContentType. -type PostStarlarkScriptJSONRequestBody = RunStarlarkScriptArgs - -// RequestEditorFn is the function signature for the RequestEditor callback function -type RequestEditorFn func(ctx context.Context, req *http.Request) error - -// Doer performs HTTP requests. -// -// The standard http.Client implements this interface. -type HttpRequestDoer interface { - Do(req *http.Request) (*http.Response, error) -} - -// Client which conforms to the OpenAPI3 specification for this service. -type Client struct { - // The endpoint of the server conforming to this interface, with scheme, - // https://api.deepmap.com for example. This can contain a path relative - // to the server, such as https://api.deepmap.com/dev-test, and all the - // paths in the swagger spec will be appended to the server. - Server string - - // Doer for performing requests, typically a *http.Client with any - // customized settings, such as certificate chains. - Client HttpRequestDoer - - // A list of callbacks for modifying requests which are generated before sending over - // the network. - RequestEditors []RequestEditorFn -} - -// ClientOption allows setting custom parameters during construction -type ClientOption func(*Client) error - -// Creates a new Client, with reasonable defaults -func NewClient(server string, opts ...ClientOption) (*Client, error) { - // create a client with sane default values - client := Client{ - Server: server, - } - // mutate client and add all optional params - for _, o := range opts { - if err := o(&client); err != nil { - return nil, err - } - } - // ensure the server URL always has a trailing slash - if !strings.HasSuffix(client.Server, "/") { - client.Server += "/" - } - // create httpClient, if not already present - if client.Client == nil { - client.Client = &http.Client{} - } - return &client, nil -} - -// WithHTTPClient allows overriding the default Doer, which is -// automatically created using http.Client. This is useful for tests. -func WithHTTPClient(doer HttpRequestDoer) ClientOption { - return func(c *Client) error { - c.Client = doer - return nil - } -} - -// WithRequestEditorFn allows setting up a callback function, which will be -// called right before sending the request. This can be used to mutate the request. -func WithRequestEditorFn(fn RequestEditorFn) ClientOption { - return func(c *Client) error { - c.RequestEditors = append(c.RequestEditors, fn) - return nil - } -} - -// The interface specification for the client above. -type ClientInterface interface { - // GetArtifact request - GetArtifact(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - - // PutArtifactLocalFile request with any body - PutArtifactLocalFileWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - PutArtifactLocalFile(ctx context.Context, body PutArtifactLocalFileJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // PutArtifactRemoteFile request with any body - PutArtifactRemoteFileWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - PutArtifactRemoteFile(ctx context.Context, body PutArtifactRemoteFileJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // PutArtifactServiceServiceIdentifier request with any body - PutArtifactServiceServiceIdentifierWithBody(ctx context.Context, serviceIdentifier string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - PutArtifactServiceServiceIdentifier(ctx context.Context, serviceIdentifier string, body PutArtifactServiceServiceIdentifierJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetArtifactArtifactIdentifier request - GetArtifactArtifactIdentifier(ctx context.Context, artifactIdentifier string, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetArtifactArtifactIdentifierDownload request - GetArtifactArtifactIdentifierDownload(ctx context.Context, artifactIdentifier string, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetService request - GetService(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - - // PostServiceConnection request with any body - PostServiceConnectionWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - PostServiceConnection(ctx context.Context, body PostServiceConnectionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetServiceServiceIdentifier request - GetServiceServiceIdentifier(ctx context.Context, serviceIdentifier string, params *GetServiceServiceIdentifierParams, reqEditors ...RequestEditorFn) (*http.Response, error) - - // PostServiceServiceIdentifierCommand request with any body - PostServiceServiceIdentifierCommandWithBody(ctx context.Context, serviceIdentifier string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - PostServiceServiceIdentifierCommand(ctx context.Context, serviceIdentifier string, body PostServiceServiceIdentifierCommandJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // PostServiceServiceIdentifierEndpointPortNumberAvailability request with any body - PostServiceServiceIdentifierEndpointPortNumberAvailabilityWithBody(ctx context.Context, serviceIdentifier string, portNumber int, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - PostServiceServiceIdentifierEndpointPortNumberAvailability(ctx context.Context, serviceIdentifier string, portNumber int, body PostServiceServiceIdentifierEndpointPortNumberAvailabilityJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetStarlark request - GetStarlark(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - - // PutStarlarkPackage request with any body - PutStarlarkPackageWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - PutStarlarkPackage(ctx context.Context, body PutStarlarkPackageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // PostStarlarkPackagePackageId request with any body - PostStarlarkPackagePackageIdWithBody(ctx context.Context, packageId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - PostStarlarkPackagePackageId(ctx context.Context, packageId string, body PostStarlarkPackagePackageIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // PostStarlarkScript request with any body - PostStarlarkScriptWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - PostStarlarkScript(ctx context.Context, body PostStarlarkScriptJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) -} - -func (c *Client) GetArtifact(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetArtifactRequest(c.Server) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) PutArtifactLocalFileWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPutArtifactLocalFileRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) PutArtifactLocalFile(ctx context.Context, body PutArtifactLocalFileJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPutArtifactLocalFileRequest(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) PutArtifactRemoteFileWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPutArtifactRemoteFileRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) PutArtifactRemoteFile(ctx context.Context, body PutArtifactRemoteFileJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPutArtifactRemoteFileRequest(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) PutArtifactServiceServiceIdentifierWithBody(ctx context.Context, serviceIdentifier string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPutArtifactServiceServiceIdentifierRequestWithBody(c.Server, serviceIdentifier, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) PutArtifactServiceServiceIdentifier(ctx context.Context, serviceIdentifier string, body PutArtifactServiceServiceIdentifierJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPutArtifactServiceServiceIdentifierRequest(c.Server, serviceIdentifier, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) GetArtifactArtifactIdentifier(ctx context.Context, artifactIdentifier string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetArtifactArtifactIdentifierRequest(c.Server, artifactIdentifier) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) GetArtifactArtifactIdentifierDownload(ctx context.Context, artifactIdentifier string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetArtifactArtifactIdentifierDownloadRequest(c.Server, artifactIdentifier) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) GetService(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetServiceRequest(c.Server) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) PostServiceConnectionWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPostServiceConnectionRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) PostServiceConnection(ctx context.Context, body PostServiceConnectionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPostServiceConnectionRequest(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) GetServiceServiceIdentifier(ctx context.Context, serviceIdentifier string, params *GetServiceServiceIdentifierParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetServiceServiceIdentifierRequest(c.Server, serviceIdentifier, params) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) PostServiceServiceIdentifierCommandWithBody(ctx context.Context, serviceIdentifier string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPostServiceServiceIdentifierCommandRequestWithBody(c.Server, serviceIdentifier, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) PostServiceServiceIdentifierCommand(ctx context.Context, serviceIdentifier string, body PostServiceServiceIdentifierCommandJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPostServiceServiceIdentifierCommandRequest(c.Server, serviceIdentifier, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) PostServiceServiceIdentifierEndpointPortNumberAvailabilityWithBody(ctx context.Context, serviceIdentifier string, portNumber int, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPostServiceServiceIdentifierEndpointPortNumberAvailabilityRequestWithBody(c.Server, serviceIdentifier, portNumber, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) PostServiceServiceIdentifierEndpointPortNumberAvailability(ctx context.Context, serviceIdentifier string, portNumber int, body PostServiceServiceIdentifierEndpointPortNumberAvailabilityJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPostServiceServiceIdentifierEndpointPortNumberAvailabilityRequest(c.Server, serviceIdentifier, portNumber, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) GetStarlark(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetStarlarkRequest(c.Server) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) PutStarlarkPackageWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPutStarlarkPackageRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) PutStarlarkPackage(ctx context.Context, body PutStarlarkPackageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPutStarlarkPackageRequest(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) PostStarlarkPackagePackageIdWithBody(ctx context.Context, packageId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPostStarlarkPackagePackageIdRequestWithBody(c.Server, packageId, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) PostStarlarkPackagePackageId(ctx context.Context, packageId string, body PostStarlarkPackagePackageIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPostStarlarkPackagePackageIdRequest(c.Server, packageId, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) PostStarlarkScriptWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPostStarlarkScriptRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) PostStarlarkScript(ctx context.Context, body PostStarlarkScriptJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPostStarlarkScriptRequest(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -// NewGetArtifactRequest generates requests for GetArtifact -func NewGetArtifactRequest(server string) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/artifact") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewPutArtifactLocalFileRequest calls the generic PutArtifactLocalFile builder with application/json body -func NewPutArtifactLocalFileRequest(server string, body PutArtifactLocalFileJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewPutArtifactLocalFileRequestWithBody(server, "application/json", bodyReader) -} - -// NewPutArtifactLocalFileRequestWithBody generates requests for PutArtifactLocalFile with any type of body -func NewPutArtifactLocalFileRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/artifact/local-file") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("PUT", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewPutArtifactRemoteFileRequest calls the generic PutArtifactRemoteFile builder with application/json body -func NewPutArtifactRemoteFileRequest(server string, body PutArtifactRemoteFileJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewPutArtifactRemoteFileRequestWithBody(server, "application/json", bodyReader) -} - -// NewPutArtifactRemoteFileRequestWithBody generates requests for PutArtifactRemoteFile with any type of body -func NewPutArtifactRemoteFileRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/artifact/remote-file") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("PUT", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewPutArtifactServiceServiceIdentifierRequest calls the generic PutArtifactServiceServiceIdentifier builder with application/json body -func NewPutArtifactServiceServiceIdentifierRequest(server string, serviceIdentifier string, body PutArtifactServiceServiceIdentifierJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewPutArtifactServiceServiceIdentifierRequestWithBody(server, serviceIdentifier, "application/json", bodyReader) -} - -// NewPutArtifactServiceServiceIdentifierRequestWithBody generates requests for PutArtifactServiceServiceIdentifier with any type of body -func NewPutArtifactServiceServiceIdentifierRequestWithBody(server string, serviceIdentifier string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "service_identifier", runtime.ParamLocationPath, serviceIdentifier) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/artifact/service/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("PUT", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewGetArtifactArtifactIdentifierRequest generates requests for GetArtifactArtifactIdentifier -func NewGetArtifactArtifactIdentifierRequest(server string, artifactIdentifier string) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "artifact_identifier", runtime.ParamLocationPath, artifactIdentifier) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/artifact/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewGetArtifactArtifactIdentifierDownloadRequest generates requests for GetArtifactArtifactIdentifierDownload -func NewGetArtifactArtifactIdentifierDownloadRequest(server string, artifactIdentifier string) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "artifact_identifier", runtime.ParamLocationPath, artifactIdentifier) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/artifact/%s/download", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewGetServiceRequest generates requests for GetService -func NewGetServiceRequest(server string) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/service") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewPostServiceConnectionRequest calls the generic PostServiceConnection builder with application/json body -func NewPostServiceConnectionRequest(server string, body PostServiceConnectionJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewPostServiceConnectionRequestWithBody(server, "application/json", bodyReader) -} - -// NewPostServiceConnectionRequestWithBody generates requests for PostServiceConnection with any type of body -func NewPostServiceConnectionRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/service/connection") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewGetServiceServiceIdentifierRequest generates requests for GetServiceServiceIdentifier -func NewGetServiceServiceIdentifierRequest(server string, serviceIdentifier string, params *GetServiceServiceIdentifierParams) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "service_identifier", runtime.ParamLocationPath, serviceIdentifier) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/service/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - queryValues := queryURL.Query() - - if params.AdditionalProperties != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "additional-properties", runtime.ParamLocationQuery, *params.AdditionalProperties); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewPostServiceServiceIdentifierCommandRequest calls the generic PostServiceServiceIdentifierCommand builder with application/json body -func NewPostServiceServiceIdentifierCommandRequest(server string, serviceIdentifier string, body PostServiceServiceIdentifierCommandJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewPostServiceServiceIdentifierCommandRequestWithBody(server, serviceIdentifier, "application/json", bodyReader) -} - -// NewPostServiceServiceIdentifierCommandRequestWithBody generates requests for PostServiceServiceIdentifierCommand with any type of body -func NewPostServiceServiceIdentifierCommandRequestWithBody(server string, serviceIdentifier string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "service_identifier", runtime.ParamLocationPath, serviceIdentifier) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/service/%s/command", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewPostServiceServiceIdentifierEndpointPortNumberAvailabilityRequest calls the generic PostServiceServiceIdentifierEndpointPortNumberAvailability builder with application/json body -func NewPostServiceServiceIdentifierEndpointPortNumberAvailabilityRequest(server string, serviceIdentifier string, portNumber int, body PostServiceServiceIdentifierEndpointPortNumberAvailabilityJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewPostServiceServiceIdentifierEndpointPortNumberAvailabilityRequestWithBody(server, serviceIdentifier, portNumber, "application/json", bodyReader) -} - -// NewPostServiceServiceIdentifierEndpointPortNumberAvailabilityRequestWithBody generates requests for PostServiceServiceIdentifierEndpointPortNumberAvailability with any type of body -func NewPostServiceServiceIdentifierEndpointPortNumberAvailabilityRequestWithBody(server string, serviceIdentifier string, portNumber int, contentType string, body io.Reader) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "service_identifier", runtime.ParamLocationPath, serviceIdentifier) - if err != nil { - return nil, err - } - - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "port_number", runtime.ParamLocationPath, portNumber) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/service/%s/endpoint/%s/availability", pathParam0, pathParam1) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewGetStarlarkRequest generates requests for GetStarlark -func NewGetStarlarkRequest(server string) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/starlark") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewPutStarlarkPackageRequest calls the generic PutStarlarkPackage builder with application/json body -func NewPutStarlarkPackageRequest(server string, body PutStarlarkPackageJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewPutStarlarkPackageRequestWithBody(server, "application/json", bodyReader) -} - -// NewPutStarlarkPackageRequestWithBody generates requests for PutStarlarkPackage with any type of body -func NewPutStarlarkPackageRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/starlark/package") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("PUT", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewPostStarlarkPackagePackageIdRequest calls the generic PostStarlarkPackagePackageId builder with application/json body -func NewPostStarlarkPackagePackageIdRequest(server string, packageId string, body PostStarlarkPackagePackageIdJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewPostStarlarkPackagePackageIdRequestWithBody(server, packageId, "application/json", bodyReader) -} - -// NewPostStarlarkPackagePackageIdRequestWithBody generates requests for PostStarlarkPackagePackageId with any type of body -func NewPostStarlarkPackagePackageIdRequestWithBody(server string, packageId string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "package_id", runtime.ParamLocationPath, packageId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/starlark/package/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewPostStarlarkScriptRequest calls the generic PostStarlarkScript builder with application/json body -func NewPostStarlarkScriptRequest(server string, body PostStarlarkScriptJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewPostStarlarkScriptRequestWithBody(server, "application/json", bodyReader) -} - -// NewPostStarlarkScriptRequestWithBody generates requests for PostStarlarkScript with any type of body -func NewPostStarlarkScriptRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/starlark/script") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error { - for _, r := range c.RequestEditors { - if err := r(ctx, req); err != nil { - return err - } - } - for _, r := range additionalEditors { - if err := r(ctx, req); err != nil { - return err - } - } - return nil -} - -// ClientWithResponses builds on ClientInterface to offer response payloads -type ClientWithResponses struct { - ClientInterface -} - -// NewClientWithResponses creates a new ClientWithResponses, which wraps -// Client with return type handling -func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error) { - client, err := NewClient(server, opts...) - if err != nil { - return nil, err - } - return &ClientWithResponses{client}, nil -} - -// WithBaseURL overrides the baseURL. -func WithBaseURL(baseURL string) ClientOption { - return func(c *Client) error { - newBaseURL, err := url.Parse(baseURL) - if err != nil { - return err - } - c.Server = newBaseURL.String() - return nil - } -} - -// ClientWithResponsesInterface is the interface specification for the client with responses above. -type ClientWithResponsesInterface interface { - // GetArtifact request - GetArtifactWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetArtifactResponse, error) - - // PutArtifactLocalFile request with any body - PutArtifactLocalFileWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutArtifactLocalFileResponse, error) - - PutArtifactLocalFileWithResponse(ctx context.Context, body PutArtifactLocalFileJSONRequestBody, reqEditors ...RequestEditorFn) (*PutArtifactLocalFileResponse, error) - - // PutArtifactRemoteFile request with any body - PutArtifactRemoteFileWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutArtifactRemoteFileResponse, error) - - PutArtifactRemoteFileWithResponse(ctx context.Context, body PutArtifactRemoteFileJSONRequestBody, reqEditors ...RequestEditorFn) (*PutArtifactRemoteFileResponse, error) - - // PutArtifactServiceServiceIdentifier request with any body - PutArtifactServiceServiceIdentifierWithBodyWithResponse(ctx context.Context, serviceIdentifier string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutArtifactServiceServiceIdentifierResponse, error) - - PutArtifactServiceServiceIdentifierWithResponse(ctx context.Context, serviceIdentifier string, body PutArtifactServiceServiceIdentifierJSONRequestBody, reqEditors ...RequestEditorFn) (*PutArtifactServiceServiceIdentifierResponse, error) - - // GetArtifactArtifactIdentifier request - GetArtifactArtifactIdentifierWithResponse(ctx context.Context, artifactIdentifier string, reqEditors ...RequestEditorFn) (*GetArtifactArtifactIdentifierResponse, error) - - // GetArtifactArtifactIdentifierDownload request - GetArtifactArtifactIdentifierDownloadWithResponse(ctx context.Context, artifactIdentifier string, reqEditors ...RequestEditorFn) (*GetArtifactArtifactIdentifierDownloadResponse, error) - - // GetService request - GetServiceWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetServiceResponse, error) - - // PostServiceConnection request with any body - PostServiceConnectionWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostServiceConnectionResponse, error) - - PostServiceConnectionWithResponse(ctx context.Context, body PostServiceConnectionJSONRequestBody, reqEditors ...RequestEditorFn) (*PostServiceConnectionResponse, error) - - // GetServiceServiceIdentifier request - GetServiceServiceIdentifierWithResponse(ctx context.Context, serviceIdentifier string, params *GetServiceServiceIdentifierParams, reqEditors ...RequestEditorFn) (*GetServiceServiceIdentifierResponse, error) - - // PostServiceServiceIdentifierCommand request with any body - PostServiceServiceIdentifierCommandWithBodyWithResponse(ctx context.Context, serviceIdentifier string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostServiceServiceIdentifierCommandResponse, error) - - PostServiceServiceIdentifierCommandWithResponse(ctx context.Context, serviceIdentifier string, body PostServiceServiceIdentifierCommandJSONRequestBody, reqEditors ...RequestEditorFn) (*PostServiceServiceIdentifierCommandResponse, error) - - // PostServiceServiceIdentifierEndpointPortNumberAvailability request with any body - PostServiceServiceIdentifierEndpointPortNumberAvailabilityWithBodyWithResponse(ctx context.Context, serviceIdentifier string, portNumber int, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostServiceServiceIdentifierEndpointPortNumberAvailabilityResponse, error) - - PostServiceServiceIdentifierEndpointPortNumberAvailabilityWithResponse(ctx context.Context, serviceIdentifier string, portNumber int, body PostServiceServiceIdentifierEndpointPortNumberAvailabilityJSONRequestBody, reqEditors ...RequestEditorFn) (*PostServiceServiceIdentifierEndpointPortNumberAvailabilityResponse, error) - - // GetStarlark request - GetStarlarkWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetStarlarkResponse, error) - - // PutStarlarkPackage request with any body - PutStarlarkPackageWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutStarlarkPackageResponse, error) - - PutStarlarkPackageWithResponse(ctx context.Context, body PutStarlarkPackageJSONRequestBody, reqEditors ...RequestEditorFn) (*PutStarlarkPackageResponse, error) - - // PostStarlarkPackagePackageId request with any body - PostStarlarkPackagePackageIdWithBodyWithResponse(ctx context.Context, packageId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostStarlarkPackagePackageIdResponse, error) - - PostStarlarkPackagePackageIdWithResponse(ctx context.Context, packageId string, body PostStarlarkPackagePackageIdJSONRequestBody, reqEditors ...RequestEditorFn) (*PostStarlarkPackagePackageIdResponse, error) - - // PostStarlarkScript request with any body - PostStarlarkScriptWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostStarlarkScriptResponse, error) - - PostStarlarkScriptWithResponse(ctx context.Context, body PostStarlarkScriptJSONRequestBody, reqEditors ...RequestEditorFn) (*PostStarlarkScriptResponse, error) -} - -type GetArtifactResponse struct { - Body []byte - HTTPResponse *http.Response -} - -// Status returns HTTPResponse.Status -func (r GetArtifactResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetArtifactResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type PutArtifactLocalFileResponse struct { - Body []byte - HTTPResponse *http.Response -} - -// Status returns HTTPResponse.Status -func (r PutArtifactLocalFileResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r PutArtifactLocalFileResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type PutArtifactRemoteFileResponse struct { - Body []byte - HTTPResponse *http.Response -} - -// Status returns HTTPResponse.Status -func (r PutArtifactRemoteFileResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r PutArtifactRemoteFileResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type PutArtifactServiceServiceIdentifierResponse struct { - Body []byte - HTTPResponse *http.Response -} - -// Status returns HTTPResponse.Status -func (r PutArtifactServiceServiceIdentifierResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r PutArtifactServiceServiceIdentifierResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GetArtifactArtifactIdentifierResponse struct { - Body []byte - HTTPResponse *http.Response -} - -// Status returns HTTPResponse.Status -func (r GetArtifactArtifactIdentifierResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetArtifactArtifactIdentifierResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GetArtifactArtifactIdentifierDownloadResponse struct { - Body []byte - HTTPResponse *http.Response -} - -// Status returns HTTPResponse.Status -func (r GetArtifactArtifactIdentifierDownloadResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetArtifactArtifactIdentifierDownloadResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GetServiceResponse struct { - Body []byte - HTTPResponse *http.Response -} - -// Status returns HTTPResponse.Status -func (r GetServiceResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetServiceResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type PostServiceConnectionResponse struct { - Body []byte - HTTPResponse *http.Response -} - -// Status returns HTTPResponse.Status -func (r PostServiceConnectionResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r PostServiceConnectionResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GetServiceServiceIdentifierResponse struct { - Body []byte - HTTPResponse *http.Response -} - -// Status returns HTTPResponse.Status -func (r GetServiceServiceIdentifierResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetServiceServiceIdentifierResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type PostServiceServiceIdentifierCommandResponse struct { - Body []byte - HTTPResponse *http.Response -} - -// Status returns HTTPResponse.Status -func (r PostServiceServiceIdentifierCommandResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r PostServiceServiceIdentifierCommandResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type PostServiceServiceIdentifierEndpointPortNumberAvailabilityResponse struct { - Body []byte - HTTPResponse *http.Response -} - -// Status returns HTTPResponse.Status -func (r PostServiceServiceIdentifierEndpointPortNumberAvailabilityResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r PostServiceServiceIdentifierEndpointPortNumberAvailabilityResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GetStarlarkResponse struct { - Body []byte - HTTPResponse *http.Response -} - -// Status returns HTTPResponse.Status -func (r GetStarlarkResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetStarlarkResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type PutStarlarkPackageResponse struct { - Body []byte - HTTPResponse *http.Response -} - -// Status returns HTTPResponse.Status -func (r PutStarlarkPackageResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r PutStarlarkPackageResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type PostStarlarkPackagePackageIdResponse struct { - Body []byte - HTTPResponse *http.Response -} - -// Status returns HTTPResponse.Status -func (r PostStarlarkPackagePackageIdResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r PostStarlarkPackagePackageIdResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type PostStarlarkScriptResponse struct { - Body []byte - HTTPResponse *http.Response -} - -// Status returns HTTPResponse.Status -func (r PostStarlarkScriptResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r PostStarlarkScriptResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -// GetArtifactWithResponse request returning *GetArtifactResponse -func (c *ClientWithResponses) GetArtifactWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetArtifactResponse, error) { - rsp, err := c.GetArtifact(ctx, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetArtifactResponse(rsp) -} - -// PutArtifactLocalFileWithBodyWithResponse request with arbitrary body returning *PutArtifactLocalFileResponse -func (c *ClientWithResponses) PutArtifactLocalFileWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutArtifactLocalFileResponse, error) { - rsp, err := c.PutArtifactLocalFileWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParsePutArtifactLocalFileResponse(rsp) -} - -func (c *ClientWithResponses) PutArtifactLocalFileWithResponse(ctx context.Context, body PutArtifactLocalFileJSONRequestBody, reqEditors ...RequestEditorFn) (*PutArtifactLocalFileResponse, error) { - rsp, err := c.PutArtifactLocalFile(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParsePutArtifactLocalFileResponse(rsp) -} - -// PutArtifactRemoteFileWithBodyWithResponse request with arbitrary body returning *PutArtifactRemoteFileResponse -func (c *ClientWithResponses) PutArtifactRemoteFileWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutArtifactRemoteFileResponse, error) { - rsp, err := c.PutArtifactRemoteFileWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParsePutArtifactRemoteFileResponse(rsp) -} - -func (c *ClientWithResponses) PutArtifactRemoteFileWithResponse(ctx context.Context, body PutArtifactRemoteFileJSONRequestBody, reqEditors ...RequestEditorFn) (*PutArtifactRemoteFileResponse, error) { - rsp, err := c.PutArtifactRemoteFile(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParsePutArtifactRemoteFileResponse(rsp) -} - -// PutArtifactServiceServiceIdentifierWithBodyWithResponse request with arbitrary body returning *PutArtifactServiceServiceIdentifierResponse -func (c *ClientWithResponses) PutArtifactServiceServiceIdentifierWithBodyWithResponse(ctx context.Context, serviceIdentifier string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutArtifactServiceServiceIdentifierResponse, error) { - rsp, err := c.PutArtifactServiceServiceIdentifierWithBody(ctx, serviceIdentifier, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParsePutArtifactServiceServiceIdentifierResponse(rsp) -} - -func (c *ClientWithResponses) PutArtifactServiceServiceIdentifierWithResponse(ctx context.Context, serviceIdentifier string, body PutArtifactServiceServiceIdentifierJSONRequestBody, reqEditors ...RequestEditorFn) (*PutArtifactServiceServiceIdentifierResponse, error) { - rsp, err := c.PutArtifactServiceServiceIdentifier(ctx, serviceIdentifier, body, reqEditors...) - if err != nil { - return nil, err - } - return ParsePutArtifactServiceServiceIdentifierResponse(rsp) -} - -// GetArtifactArtifactIdentifierWithResponse request returning *GetArtifactArtifactIdentifierResponse -func (c *ClientWithResponses) GetArtifactArtifactIdentifierWithResponse(ctx context.Context, artifactIdentifier string, reqEditors ...RequestEditorFn) (*GetArtifactArtifactIdentifierResponse, error) { - rsp, err := c.GetArtifactArtifactIdentifier(ctx, artifactIdentifier, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetArtifactArtifactIdentifierResponse(rsp) -} - -// GetArtifactArtifactIdentifierDownloadWithResponse request returning *GetArtifactArtifactIdentifierDownloadResponse -func (c *ClientWithResponses) GetArtifactArtifactIdentifierDownloadWithResponse(ctx context.Context, artifactIdentifier string, reqEditors ...RequestEditorFn) (*GetArtifactArtifactIdentifierDownloadResponse, error) { - rsp, err := c.GetArtifactArtifactIdentifierDownload(ctx, artifactIdentifier, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetArtifactArtifactIdentifierDownloadResponse(rsp) -} - -// GetServiceWithResponse request returning *GetServiceResponse -func (c *ClientWithResponses) GetServiceWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetServiceResponse, error) { - rsp, err := c.GetService(ctx, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetServiceResponse(rsp) -} - -// PostServiceConnectionWithBodyWithResponse request with arbitrary body returning *PostServiceConnectionResponse -func (c *ClientWithResponses) PostServiceConnectionWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostServiceConnectionResponse, error) { - rsp, err := c.PostServiceConnectionWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParsePostServiceConnectionResponse(rsp) -} - -func (c *ClientWithResponses) PostServiceConnectionWithResponse(ctx context.Context, body PostServiceConnectionJSONRequestBody, reqEditors ...RequestEditorFn) (*PostServiceConnectionResponse, error) { - rsp, err := c.PostServiceConnection(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParsePostServiceConnectionResponse(rsp) -} - -// GetServiceServiceIdentifierWithResponse request returning *GetServiceServiceIdentifierResponse -func (c *ClientWithResponses) GetServiceServiceIdentifierWithResponse(ctx context.Context, serviceIdentifier string, params *GetServiceServiceIdentifierParams, reqEditors ...RequestEditorFn) (*GetServiceServiceIdentifierResponse, error) { - rsp, err := c.GetServiceServiceIdentifier(ctx, serviceIdentifier, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetServiceServiceIdentifierResponse(rsp) -} - -// PostServiceServiceIdentifierCommandWithBodyWithResponse request with arbitrary body returning *PostServiceServiceIdentifierCommandResponse -func (c *ClientWithResponses) PostServiceServiceIdentifierCommandWithBodyWithResponse(ctx context.Context, serviceIdentifier string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostServiceServiceIdentifierCommandResponse, error) { - rsp, err := c.PostServiceServiceIdentifierCommandWithBody(ctx, serviceIdentifier, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParsePostServiceServiceIdentifierCommandResponse(rsp) -} - -func (c *ClientWithResponses) PostServiceServiceIdentifierCommandWithResponse(ctx context.Context, serviceIdentifier string, body PostServiceServiceIdentifierCommandJSONRequestBody, reqEditors ...RequestEditorFn) (*PostServiceServiceIdentifierCommandResponse, error) { - rsp, err := c.PostServiceServiceIdentifierCommand(ctx, serviceIdentifier, body, reqEditors...) - if err != nil { - return nil, err - } - return ParsePostServiceServiceIdentifierCommandResponse(rsp) -} - -// PostServiceServiceIdentifierEndpointPortNumberAvailabilityWithBodyWithResponse request with arbitrary body returning *PostServiceServiceIdentifierEndpointPortNumberAvailabilityResponse -func (c *ClientWithResponses) PostServiceServiceIdentifierEndpointPortNumberAvailabilityWithBodyWithResponse(ctx context.Context, serviceIdentifier string, portNumber int, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostServiceServiceIdentifierEndpointPortNumberAvailabilityResponse, error) { - rsp, err := c.PostServiceServiceIdentifierEndpointPortNumberAvailabilityWithBody(ctx, serviceIdentifier, portNumber, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParsePostServiceServiceIdentifierEndpointPortNumberAvailabilityResponse(rsp) -} - -func (c *ClientWithResponses) PostServiceServiceIdentifierEndpointPortNumberAvailabilityWithResponse(ctx context.Context, serviceIdentifier string, portNumber int, body PostServiceServiceIdentifierEndpointPortNumberAvailabilityJSONRequestBody, reqEditors ...RequestEditorFn) (*PostServiceServiceIdentifierEndpointPortNumberAvailabilityResponse, error) { - rsp, err := c.PostServiceServiceIdentifierEndpointPortNumberAvailability(ctx, serviceIdentifier, portNumber, body, reqEditors...) - if err != nil { - return nil, err - } - return ParsePostServiceServiceIdentifierEndpointPortNumberAvailabilityResponse(rsp) -} - -// GetStarlarkWithResponse request returning *GetStarlarkResponse -func (c *ClientWithResponses) GetStarlarkWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetStarlarkResponse, error) { - rsp, err := c.GetStarlark(ctx, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetStarlarkResponse(rsp) -} - -// PutStarlarkPackageWithBodyWithResponse request with arbitrary body returning *PutStarlarkPackageResponse -func (c *ClientWithResponses) PutStarlarkPackageWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutStarlarkPackageResponse, error) { - rsp, err := c.PutStarlarkPackageWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParsePutStarlarkPackageResponse(rsp) -} - -func (c *ClientWithResponses) PutStarlarkPackageWithResponse(ctx context.Context, body PutStarlarkPackageJSONRequestBody, reqEditors ...RequestEditorFn) (*PutStarlarkPackageResponse, error) { - rsp, err := c.PutStarlarkPackage(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParsePutStarlarkPackageResponse(rsp) -} - -// PostStarlarkPackagePackageIdWithBodyWithResponse request with arbitrary body returning *PostStarlarkPackagePackageIdResponse -func (c *ClientWithResponses) PostStarlarkPackagePackageIdWithBodyWithResponse(ctx context.Context, packageId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostStarlarkPackagePackageIdResponse, error) { - rsp, err := c.PostStarlarkPackagePackageIdWithBody(ctx, packageId, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParsePostStarlarkPackagePackageIdResponse(rsp) -} - -func (c *ClientWithResponses) PostStarlarkPackagePackageIdWithResponse(ctx context.Context, packageId string, body PostStarlarkPackagePackageIdJSONRequestBody, reqEditors ...RequestEditorFn) (*PostStarlarkPackagePackageIdResponse, error) { - rsp, err := c.PostStarlarkPackagePackageId(ctx, packageId, body, reqEditors...) - if err != nil { - return nil, err - } - return ParsePostStarlarkPackagePackageIdResponse(rsp) -} - -// PostStarlarkScriptWithBodyWithResponse request with arbitrary body returning *PostStarlarkScriptResponse -func (c *ClientWithResponses) PostStarlarkScriptWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostStarlarkScriptResponse, error) { - rsp, err := c.PostStarlarkScriptWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParsePostStarlarkScriptResponse(rsp) -} - -func (c *ClientWithResponses) PostStarlarkScriptWithResponse(ctx context.Context, body PostStarlarkScriptJSONRequestBody, reqEditors ...RequestEditorFn) (*PostStarlarkScriptResponse, error) { - rsp, err := c.PostStarlarkScript(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParsePostStarlarkScriptResponse(rsp) -} - -// ParseGetArtifactResponse parses an HTTP response from a GetArtifactWithResponse call -func ParseGetArtifactResponse(rsp *http.Response) (*GetArtifactResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetArtifactResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - return response, nil -} - -// ParsePutArtifactLocalFileResponse parses an HTTP response from a PutArtifactLocalFileWithResponse call -func ParsePutArtifactLocalFileResponse(rsp *http.Response) (*PutArtifactLocalFileResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &PutArtifactLocalFileResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - return response, nil -} - -// ParsePutArtifactRemoteFileResponse parses an HTTP response from a PutArtifactRemoteFileWithResponse call -func ParsePutArtifactRemoteFileResponse(rsp *http.Response) (*PutArtifactRemoteFileResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &PutArtifactRemoteFileResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - return response, nil -} - -// ParsePutArtifactServiceServiceIdentifierResponse parses an HTTP response from a PutArtifactServiceServiceIdentifierWithResponse call -func ParsePutArtifactServiceServiceIdentifierResponse(rsp *http.Response) (*PutArtifactServiceServiceIdentifierResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &PutArtifactServiceServiceIdentifierResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - return response, nil -} - -// ParseGetArtifactArtifactIdentifierResponse parses an HTTP response from a GetArtifactArtifactIdentifierWithResponse call -func ParseGetArtifactArtifactIdentifierResponse(rsp *http.Response) (*GetArtifactArtifactIdentifierResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetArtifactArtifactIdentifierResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - return response, nil -} - -// ParseGetArtifactArtifactIdentifierDownloadResponse parses an HTTP response from a GetArtifactArtifactIdentifierDownloadWithResponse call -func ParseGetArtifactArtifactIdentifierDownloadResponse(rsp *http.Response) (*GetArtifactArtifactIdentifierDownloadResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetArtifactArtifactIdentifierDownloadResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - return response, nil -} - -// ParseGetServiceResponse parses an HTTP response from a GetServiceWithResponse call -func ParseGetServiceResponse(rsp *http.Response) (*GetServiceResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetServiceResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - return response, nil -} - -// ParsePostServiceConnectionResponse parses an HTTP response from a PostServiceConnectionWithResponse call -func ParsePostServiceConnectionResponse(rsp *http.Response) (*PostServiceConnectionResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &PostServiceConnectionResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - return response, nil -} - -// ParseGetServiceServiceIdentifierResponse parses an HTTP response from a GetServiceServiceIdentifierWithResponse call -func ParseGetServiceServiceIdentifierResponse(rsp *http.Response) (*GetServiceServiceIdentifierResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetServiceServiceIdentifierResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - return response, nil -} - -// ParsePostServiceServiceIdentifierCommandResponse parses an HTTP response from a PostServiceServiceIdentifierCommandWithResponse call -func ParsePostServiceServiceIdentifierCommandResponse(rsp *http.Response) (*PostServiceServiceIdentifierCommandResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &PostServiceServiceIdentifierCommandResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - return response, nil -} - -// ParsePostServiceServiceIdentifierEndpointPortNumberAvailabilityResponse parses an HTTP response from a PostServiceServiceIdentifierEndpointPortNumberAvailabilityWithResponse call -func ParsePostServiceServiceIdentifierEndpointPortNumberAvailabilityResponse(rsp *http.Response) (*PostServiceServiceIdentifierEndpointPortNumberAvailabilityResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &PostServiceServiceIdentifierEndpointPortNumberAvailabilityResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - return response, nil -} - -// ParseGetStarlarkResponse parses an HTTP response from a GetStarlarkWithResponse call -func ParseGetStarlarkResponse(rsp *http.Response) (*GetStarlarkResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetStarlarkResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - return response, nil -} - -// ParsePutStarlarkPackageResponse parses an HTTP response from a PutStarlarkPackageWithResponse call -func ParsePutStarlarkPackageResponse(rsp *http.Response) (*PutStarlarkPackageResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &PutStarlarkPackageResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - return response, nil -} - -// ParsePostStarlarkPackagePackageIdResponse parses an HTTP response from a PostStarlarkPackagePackageIdWithResponse call -func ParsePostStarlarkPackagePackageIdResponse(rsp *http.Response) (*PostStarlarkPackagePackageIdResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &PostStarlarkPackagePackageIdResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - return response, nil -} - -// ParsePostStarlarkScriptResponse parses an HTTP response from a PostStarlarkScriptWithResponse call -func ParsePostStarlarkScriptResponse(rsp *http.Response) (*PostStarlarkScriptResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &PostStarlarkScriptResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - return response, nil -} - -// ServerInterface represents all server handlers. -type ServerInterface interface { - - // (GET /artifact) - GetArtifact(ctx echo.Context) error - - // (PUT /artifact/local-file) - PutArtifactLocalFile(ctx echo.Context) error - - // (PUT /artifact/remote-file) - PutArtifactRemoteFile(ctx echo.Context) error - - // (PUT /artifact/service/{service_identifier}) - PutArtifactServiceServiceIdentifier(ctx echo.Context, serviceIdentifier string) error - - // (GET /artifact/{artifact_identifier}) - GetArtifactArtifactIdentifier(ctx echo.Context, artifactIdentifier string) error - - // (GET /artifact/{artifact_identifier}/download) - GetArtifactArtifactIdentifierDownload(ctx echo.Context, artifactIdentifier string) error - - // (GET /service) - GetService(ctx echo.Context) error - - // (POST /service/connection) - PostServiceConnection(ctx echo.Context) error - - // (GET /service/{service_identifier}) - GetServiceServiceIdentifier(ctx echo.Context, serviceIdentifier string, params GetServiceServiceIdentifierParams) error - - // (POST /service/{service_identifier}/command) - PostServiceServiceIdentifierCommand(ctx echo.Context, serviceIdentifier string) error - - // (POST /service/{service_identifier}/endpoint/{port_number}/availability) - PostServiceServiceIdentifierEndpointPortNumberAvailability(ctx echo.Context, serviceIdentifier string, portNumber int) error - - // (GET /starlark) - GetStarlark(ctx echo.Context) error - - // (PUT /starlark/package) - PutStarlarkPackage(ctx echo.Context) error - - // (POST /starlark/package/{package_id}) - PostStarlarkPackagePackageId(ctx echo.Context, packageId string) error - - // (POST /starlark/script) - PostStarlarkScript(ctx echo.Context) error -} - -// ServerInterfaceWrapper converts echo contexts to parameters. -type ServerInterfaceWrapper struct { - Handler ServerInterface -} - -// GetArtifact converts echo context to params. -func (w *ServerInterfaceWrapper) GetArtifact(ctx echo.Context) error { - var err error - - // Invoke the callback with all the unmarshalled arguments - err = w.Handler.GetArtifact(ctx) - return err -} - -// PutArtifactLocalFile converts echo context to params. -func (w *ServerInterfaceWrapper) PutArtifactLocalFile(ctx echo.Context) error { - var err error - - // Invoke the callback with all the unmarshalled arguments - err = w.Handler.PutArtifactLocalFile(ctx) - return err -} - -// PutArtifactRemoteFile converts echo context to params. -func (w *ServerInterfaceWrapper) PutArtifactRemoteFile(ctx echo.Context) error { - var err error - - // Invoke the callback with all the unmarshalled arguments - err = w.Handler.PutArtifactRemoteFile(ctx) - return err -} - -// PutArtifactServiceServiceIdentifier converts echo context to params. -func (w *ServerInterfaceWrapper) PutArtifactServiceServiceIdentifier(ctx echo.Context) error { - var err error - // ------------- Path parameter "service_identifier" ------------- - var serviceIdentifier string - - err = runtime.BindStyledParameterWithLocation("simple", false, "service_identifier", runtime.ParamLocationPath, ctx.Param("service_identifier"), &serviceIdentifier) - if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter service_identifier: %s", err)) - } - - // Invoke the callback with all the unmarshalled arguments - err = w.Handler.PutArtifactServiceServiceIdentifier(ctx, serviceIdentifier) - return err -} - -// GetArtifactArtifactIdentifier converts echo context to params. -func (w *ServerInterfaceWrapper) GetArtifactArtifactIdentifier(ctx echo.Context) error { - var err error - // ------------- Path parameter "artifact_identifier" ------------- - var artifactIdentifier string - - err = runtime.BindStyledParameterWithLocation("simple", false, "artifact_identifier", runtime.ParamLocationPath, ctx.Param("artifact_identifier"), &artifactIdentifier) - if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter artifact_identifier: %s", err)) - } - - // Invoke the callback with all the unmarshalled arguments - err = w.Handler.GetArtifactArtifactIdentifier(ctx, artifactIdentifier) - return err -} - -// GetArtifactArtifactIdentifierDownload converts echo context to params. -func (w *ServerInterfaceWrapper) GetArtifactArtifactIdentifierDownload(ctx echo.Context) error { - var err error - // ------------- Path parameter "artifact_identifier" ------------- - var artifactIdentifier string - - err = runtime.BindStyledParameterWithLocation("simple", false, "artifact_identifier", runtime.ParamLocationPath, ctx.Param("artifact_identifier"), &artifactIdentifier) - if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter artifact_identifier: %s", err)) - } - - // Invoke the callback with all the unmarshalled arguments - err = w.Handler.GetArtifactArtifactIdentifierDownload(ctx, artifactIdentifier) - return err -} - -// GetService converts echo context to params. -func (w *ServerInterfaceWrapper) GetService(ctx echo.Context) error { - var err error - - // Invoke the callback with all the unmarshalled arguments - err = w.Handler.GetService(ctx) - return err -} - -// PostServiceConnection converts echo context to params. -func (w *ServerInterfaceWrapper) PostServiceConnection(ctx echo.Context) error { - var err error - - // Invoke the callback with all the unmarshalled arguments - err = w.Handler.PostServiceConnection(ctx) - return err -} - -// GetServiceServiceIdentifier converts echo context to params. -func (w *ServerInterfaceWrapper) GetServiceServiceIdentifier(ctx echo.Context) error { - var err error - // ------------- Path parameter "service_identifier" ------------- - var serviceIdentifier string - - err = runtime.BindStyledParameterWithLocation("simple", false, "service_identifier", runtime.ParamLocationPath, ctx.Param("service_identifier"), &serviceIdentifier) - if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter service_identifier: %s", err)) - } - - // Parameter object where we will unmarshal all parameters from the context - var params GetServiceServiceIdentifierParams - // ------------- Optional query parameter "additional-properties" ------------- - - err = runtime.BindQueryParameter("form", true, false, "additional-properties", ctx.QueryParams(), ¶ms.AdditionalProperties) - if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter additional-properties: %s", err)) - } - - // Invoke the callback with all the unmarshalled arguments - err = w.Handler.GetServiceServiceIdentifier(ctx, serviceIdentifier, params) - return err -} - -// PostServiceServiceIdentifierCommand converts echo context to params. -func (w *ServerInterfaceWrapper) PostServiceServiceIdentifierCommand(ctx echo.Context) error { - var err error - // ------------- Path parameter "service_identifier" ------------- - var serviceIdentifier string - - err = runtime.BindStyledParameterWithLocation("simple", false, "service_identifier", runtime.ParamLocationPath, ctx.Param("service_identifier"), &serviceIdentifier) - if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter service_identifier: %s", err)) - } - - // Invoke the callback with all the unmarshalled arguments - err = w.Handler.PostServiceServiceIdentifierCommand(ctx, serviceIdentifier) - return err -} - -// PostServiceServiceIdentifierEndpointPortNumberAvailability converts echo context to params. -func (w *ServerInterfaceWrapper) PostServiceServiceIdentifierEndpointPortNumberAvailability(ctx echo.Context) error { - var err error - // ------------- Path parameter "service_identifier" ------------- - var serviceIdentifier string - - err = runtime.BindStyledParameterWithLocation("simple", false, "service_identifier", runtime.ParamLocationPath, ctx.Param("service_identifier"), &serviceIdentifier) - if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter service_identifier: %s", err)) - } - - // ------------- Path parameter "port_number" ------------- - var portNumber int - - err = runtime.BindStyledParameterWithLocation("simple", false, "port_number", runtime.ParamLocationPath, ctx.Param("port_number"), &portNumber) - if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter port_number: %s", err)) - } - - // Invoke the callback with all the unmarshalled arguments - err = w.Handler.PostServiceServiceIdentifierEndpointPortNumberAvailability(ctx, serviceIdentifier, portNumber) - return err -} - -// GetStarlark converts echo context to params. -func (w *ServerInterfaceWrapper) GetStarlark(ctx echo.Context) error { - var err error - - // Invoke the callback with all the unmarshalled arguments - err = w.Handler.GetStarlark(ctx) - return err -} - -// PutStarlarkPackage converts echo context to params. -func (w *ServerInterfaceWrapper) PutStarlarkPackage(ctx echo.Context) error { - var err error - - // Invoke the callback with all the unmarshalled arguments - err = w.Handler.PutStarlarkPackage(ctx) - return err -} - -// PostStarlarkPackagePackageId converts echo context to params. -func (w *ServerInterfaceWrapper) PostStarlarkPackagePackageId(ctx echo.Context) error { - var err error - // ------------- Path parameter "package_id" ------------- - var packageId string - - err = runtime.BindStyledParameterWithLocation("simple", false, "package_id", runtime.ParamLocationPath, ctx.Param("package_id"), &packageId) - if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter package_id: %s", err)) - } - - // Invoke the callback with all the unmarshalled arguments - err = w.Handler.PostStarlarkPackagePackageId(ctx, packageId) - return err -} - -// PostStarlarkScript converts echo context to params. -func (w *ServerInterfaceWrapper) PostStarlarkScript(ctx echo.Context) error { - var err error - - // Invoke the callback with all the unmarshalled arguments - err = w.Handler.PostStarlarkScript(ctx) - return err -} - -// This is a simple interface which specifies echo.Route addition functions which -// are present on both echo.Echo and echo.Group, since we want to allow using -// either of them for path registration -type EchoRouter interface { - CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route - DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route - GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route - HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route - OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route - PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route - POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route - PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route - TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route -} - -// RegisterHandlers adds each server route to the EchoRouter. -func RegisterHandlers(router EchoRouter, si ServerInterface) { - RegisterHandlersWithBaseURL(router, si, "") -} - -// Registers handlers, and prepends BaseURL to the paths, so that the paths -// can be served under a prefix. -func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string) { - - wrapper := ServerInterfaceWrapper{ - Handler: si, - } - - router.GET(baseURL+"/artifact", wrapper.GetArtifact) - router.PUT(baseURL+"/artifact/local-file", wrapper.PutArtifactLocalFile) - router.PUT(baseURL+"/artifact/remote-file", wrapper.PutArtifactRemoteFile) - router.PUT(baseURL+"/artifact/service/:service_identifier", wrapper.PutArtifactServiceServiceIdentifier) - router.GET(baseURL+"/artifact/:artifact_identifier", wrapper.GetArtifactArtifactIdentifier) - router.GET(baseURL+"/artifact/:artifact_identifier/download", wrapper.GetArtifactArtifactIdentifierDownload) - router.GET(baseURL+"/service", wrapper.GetService) - router.POST(baseURL+"/service/connection", wrapper.PostServiceConnection) - router.GET(baseURL+"/service/:service_identifier", wrapper.GetServiceServiceIdentifier) - router.POST(baseURL+"/service/:service_identifier/command", wrapper.PostServiceServiceIdentifierCommand) - router.POST(baseURL+"/service/:service_identifier/endpoint/:port_number/availability", wrapper.PostServiceServiceIdentifierEndpointPortNumberAvailability) - router.GET(baseURL+"/starlark", wrapper.GetStarlark) - router.PUT(baseURL+"/starlark/package", wrapper.PutStarlarkPackage) - router.POST(baseURL+"/starlark/package/:package_id", wrapper.PostStarlarkPackagePackageId) - router.POST(baseURL+"/starlark/script", wrapper.PostStarlarkScript) - -} - -// Base64 encoded, gzipped, json marshaled Swagger object -var swaggerSpec = []string{ - - "H4sIAAAAAAAC/+w8a28bOZJ/heg7IDMDxcrOLhYHA/fBcexEtxlZsOTxHdaLXqq7JHHCJnv5kK0J/N8P", - "fLW61Wy5pbWdLLDzYRw3yWKx3lUs+muS8aLkDJiSyenXRMA/NEj1nucE7IepEoALyD9ghd/zfGO+ZZwp", - "YMr8E5clJRlWhLPhb5Iz801mKyiw+dd/Clgkp8l/DLebDN2oHNYBn680+5I8Pj4OkhxkJkhpACan1e7I", - "zEJu2sAiSQTkyakSGswqD9Tsec4Zg8wi14T1Dr1F51fj8cX5DA2H6D1IhWCx4EKh0vxvwcU9Fjlhyzv2", - "B/QWja/S2vRJcwrKicRzCnkySIDpIjn9a+JnJ4NkuzT52yBRmxKS00QqQdgyeRwEFKcg1iQDeSaWFvNS", - "8BKE8oTPtufYR8ZwXEMFvxGf/2a/tDa6BllyJsHAjM1VmDAQEVSKPMUeS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HB361+HdKuVuisGFgUuyBob8mtA+h0Pv4TZC", - "3KdqLQnxD8r7+PZIL6z3DbXg1BUWoEJz22ruiwwG83+lcHD37xdEeF3/CwMvnYzE/gjAseIXKoHDr/Y9", - "nKsYPQ5xvb7YKZrvKc+++IrRVjptralVYazqhoPqpRQxYiK4Xq4Qdqs+gllgGXiQBIe66IQL5QpJuwXS", - "f3HBHkQrjsa9+hpfqDQi3Dx4BJUao/vgsK2nvZB2PVUTj4h2sypupKarMv6iihivJu5TRd880RlkmqNQ", - "LNX2DY/QLBo4BkjP79kif0Kgx5GGtRefT5QEd98nnSD3IklB6ZrvHcvC+8f6a8kMs4a62Sp6+8VlrLjR", - "nvLdFRKPlqdA/OHX7RO+xx4hRY0XbhxxVmV6bySawwrTRdwUN8npf4x6RRGBm/WQ09jWcNsU2Nthv7av", - "FL+D2KDjWfRr1IfiPY19xGX7TOrlBcQ9DUxenPq1J4jfH/EfH/8/AAD//2pzqPofTwAA", -} - -// GetSwagger returns the content of the embedded swagger specification file -// or error if failed to decode -func decodeSpec() ([]byte, error) { - zipped, err := base64.StdEncoding.DecodeString(strings.Join(swaggerSpec, "")) - if err != nil { - return nil, fmt.Errorf("error base64 decoding spec: %s", err) - } - zr, err := gzip.NewReader(bytes.NewReader(zipped)) - if err != nil { - return nil, fmt.Errorf("error decompressing spec: %s", err) - } - var buf bytes.Buffer - _, err = buf.ReadFrom(zr) - if err != nil { - return nil, fmt.Errorf("error decompressing spec: %s", err) - } - - return buf.Bytes(), nil -} - -var rawSpec = decodeSpecCached() - -// a naive cached of a decoded swagger spec -func decodeSpecCached() func() ([]byte, error) { - data, err := decodeSpec() - return func() ([]byte, error) { - return data, err - } -} - -// Constructs a synthetic filesystem for resolving external references when loading openapi specifications. -func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error) { - var res = make(map[string]func() ([]byte, error)) - if len(pathToFile) > 0 { - res[pathToFile] = rawSpec - } - - return res -} - -// GetSwagger returns the Swagger specification corresponding to the generated code -// in this file. The external references of Swagger specification are resolved. -// The logic of resolving external references is tightly connected to "import-mapping" feature. -// Externally referenced files must be embedded in the corresponding golang packages. -// Urls can be supported but this task was out of the scope. -func GetSwagger() (swagger *openapi3.T, err error) { - var resolvePath = PathToRawSpec("") - - loader := openapi3.NewLoader() - loader.IsExternalRefsAllowed = true - loader.ReadFromURIFunc = func(loader *openapi3.Loader, url *url.URL) ([]byte, error) { - var pathToFile = url.String() - pathToFile = path.Clean(pathToFile) - getSpec, ok := resolvePath[pathToFile] - if !ok { - err1 := fmt.Errorf("path not found: %s", pathToFile) - return nil, err1 - } - return getSpec() - } - var specData []byte - specData, err = rawSpec() - if err != nil { - return - } - swagger, err = loader.LoadFromData(specData) - if err != nil { - return - } - return -} diff --git a/api/golang/core/kurtosis_core_http_api_bindings/api_container_types.gen.go b/api/golang/core/kurtosis_core_http_api_bindings/api_container_types.gen.go new file mode 100644 index 0000000000..3c347e3809 --- /dev/null +++ b/api/golang/core/kurtosis_core_http_api_bindings/api_container_types.gen.go @@ -0,0 +1,500 @@ +// Package kurtosis_core_http_api_bindings provides primitives to interact with the openapi HTTP API. +// +// Code generated by github.com/deepmap/oapi-codegen version (devel) DO NOT EDIT. +package kurtosis_core_http_api_bindings + +// Defines values for Connect. +const ( + CONNECT Connect = "CONNECT" + NOCONNECT Connect = "NO_CONNECT" +) + +// Defines values for ContainerStatus. +const ( + ContainerStatusRUNNING ContainerStatus = "RUNNING" + ContainerStatusSTOPPED ContainerStatus = "STOPPED" + ContainerStatusUNKNOWN ContainerStatus = "UNKNOWN" +) + +// Defines values for ImageDownloadMode. +const ( + Always ImageDownloadMode = "always" + Missing ImageDownloadMode = "missing" +) + +// Defines values for KurtosisFeatureFlag. +const ( + NOINSTRUCTIONSCACHING KurtosisFeatureFlag = "NO_INSTRUCTIONS_CACHING" +) + +// Defines values for PortTransportProtocol. +const ( + SCTP PortTransportProtocol = "SCTP" + TCP PortTransportProtocol = "TCP" + UDP PortTransportProtocol = "UDP" +) + +// Defines values for RestartPolicy. +const ( + ALWAYS RestartPolicy = "ALWAYS" + NEVER RestartPolicy = "NEVER" +) + +// Defines values for ServiceStatus. +const ( + ServiceStatusRUNNING ServiceStatus = "RUNNING" + ServiceStatusSTOPPED ServiceStatus = "STOPPED" + ServiceStatusUNKNOWN ServiceStatus = "UNKNOWN" +) + +// Defines values for WaitForEndpointAvailabilityArgsHttpMethod. +const ( + GET WaitForEndpointAvailabilityArgsHttpMethod = "GET" + POST WaitForEndpointAvailabilityArgsHttpMethod = "POST" +) + +// Connect 0 - CONNECT // Best effort port forwarding +// 1 - NO_CONNECT // Port forwarding disabled +type Connect string + +// ConnectServicesArgs defines model for ConnectServicesArgs. +type ConnectServicesArgs struct { + // Connect 0 - CONNECT // Best effort port forwarding + // 1 - NO_CONNECT // Port forwarding disabled + Connect *Connect `json:"connect,omitempty"` +} + +// ConnectServicesResponse defines model for ConnectServicesResponse. +type ConnectServicesResponse = map[string]interface{} + +// Container defines model for Container. +type Container struct { + CmdArgs *[]string `json:"cmd_args,omitempty"` + EntrypointArgs *[]string `json:"entrypoint_args,omitempty"` + EnvVars *map[string]string `json:"env_vars,omitempty"` + ImageName *string `json:"image_name,omitempty"` + + // Status 0 - STOPPED + // 1 - RUNNING + // 2 - UNKNOWN + Status *ContainerStatus `json:"status,omitempty"` +} + +// ContainerStatus 0 - STOPPED +// 1 - RUNNING +// 2 - UNKNOWN +type ContainerStatus string + +// DataChunkMetadata defines model for DataChunkMetadata. +type DataChunkMetadata struct { + Name *string `json:"name,omitempty"` +} + +// ExecCommandArgs Exec Command +type ExecCommandArgs struct { + CommandArgs *[]string `json:"command_args,omitempty"` +} + +// ExecCommandResponse defines model for ExecCommandResponse. +type ExecCommandResponse struct { + ExitCode *int32 `json:"exit_code,omitempty"` + + // LogOutput Assumes UTF-8 encoding + LogOutput *string `json:"log_output,omitempty"` +} + +// FileArtifactContentsFileDescription defines model for FileArtifactContentsFileDescription. +type FileArtifactContentsFileDescription struct { + // Path Path relative to the file artifact + Path *string `json:"path,omitempty"` + + // Size Size of the file, in bytes + Size *int64 `json:"size,omitempty"` + + // TextPreview A bit of text content, if the file allows (similar to UNIX's 'head') + TextPreview *string `json:"text_preview,omitempty"` +} + +// FilesArtifactNameAndUuid defines model for FilesArtifactNameAndUuid. +type FilesArtifactNameAndUuid struct { + // FileName A string representing the name of the file + FileName *string `json:"fileName,omitempty"` + + // FileUuid A string representing the uuid of the file + FileUuid *string `json:"fileUuid,omitempty"` +} + +// GetExistingAndHistoricalServiceIdentifiersResponse defines model for GetExistingAndHistoricalServiceIdentifiersResponse. +type GetExistingAndHistoricalServiceIdentifiersResponse struct { + AllIdentifiers *[]ServiceIdentifiers `json:"allIdentifiers,omitempty"` +} + +// GetServicesResponse defines model for GetServicesResponse. +type GetServicesResponse struct { + ServiceInfo *ServiceInfo `json:"service_info,omitempty"` +} + +// GetStarlarkRunResponse defines model for GetStarlarkRunResponse. +type GetStarlarkRunResponse struct { + ExperimentalFeatures *[]KurtosisFeatureFlag `json:"experimental_features,omitempty"` + MainFunctionName *string `json:"main_function_name,omitempty"` + PackageId *string `json:"package_id,omitempty"` + Parallelism *int32 `json:"parallelism,omitempty"` + RelativePathToMainFile *string `json:"relative_path_to_main_file,omitempty"` + + // RestartPolicy 0 - NEVER + // 1 - ALWAYS + RestartPolicy *RestartPolicy `json:"restart_policy,omitempty"` + SerializedParams *string `json:"serialized_params,omitempty"` + SerializedScript *string `json:"serialized_script,omitempty"` +} + +// ImageDownloadMode 0 - always +// 1 - missing +type ImageDownloadMode string + +// InspectFilesArtifactContentsResponse defines model for InspectFilesArtifactContentsResponse. +type InspectFilesArtifactContentsResponse struct { + FileDescriptions *[]FileArtifactContentsFileDescription `json:"file_descriptions,omitempty"` +} + +// KurtosisFeatureFlag 0 - NO_INSTRUCTIONS_CACHING +type KurtosisFeatureFlag string + +// ListFilesArtifactNamesAndUuidsResponse defines model for ListFilesArtifactNamesAndUuidsResponse. +type ListFilesArtifactNamesAndUuidsResponse struct { + FileNamesAndUuids *[]FilesArtifactNameAndUuid `json:"file_names_and_uuids,omitempty"` +} + +// Port Shared Objects (Used By Multiple Endpoints) +type Port struct { + MaybeApplicationProtocol *string `json:"maybe_application_protocol,omitempty"` + + // MaybeWaitTimeout The wait timeout duration in string + MaybeWaitTimeout *string `json:"maybe_wait_timeout,omitempty"` + Number *int32 `json:"number,omitempty"` + + // TransportProtocol 0 - TCP + // 1 - SCTP + // 2 - UDP + TransportProtocol *PortTransportProtocol `json:"transport_protocol,omitempty"` +} + +// PortTransportProtocol 0 - TCP +// 1 - SCTP +// 2 - UDP +type PortTransportProtocol string + +// RestartPolicy 0 - NEVER +// 1 - ALWAYS +type RestartPolicy string + +// RunStarlarkPackageArgs defines model for RunStarlarkPackageArgs. +type RunStarlarkPackageArgs struct { + // ClonePackage Whether the package should be cloned or not. + // If false, then the package will be pulled from the APIC local package store. If it's a local package then is must + // have been uploaded using UploadStarlarkPackage prior to calling RunStarlarkPackage. + // If true, then the package will be cloned from GitHub before execution starts + ClonePackage *bool `json:"clone_package,omitempty"` + + // CloudInstanceId Defaults to empty + CloudInstanceId *string `json:"cloud_instance_id,omitempty"` + + // CloudUserId Defaults to empty + CloudUserId *string `json:"cloud_user_id,omitempty"` + + // DryRun Defaults to false + DryRun *bool `json:"dry_run,omitempty"` + ExperimentalFeatures *[]KurtosisFeatureFlag `json:"experimental_features,omitempty"` + + // ImageDownloadMode 0 - always + // 1 - missing + ImageDownloadMode *ImageDownloadMode `json:"image_download_mode,omitempty"` + + // Local the payload of the local module + Local *[]byte `json:"local,omitempty"` + + // MainFunctionName The name of the main function, the default value is "run" + MainFunctionName *string `json:"main_function_name,omitempty"` + PackageId *string `json:"package_id,omitempty"` + + // Parallelism Defaults to 4 + Parallelism *int32 `json:"parallelism,omitempty"` + + // RelativePathToMainFile The relative main file filepath, the default value is the "main.star" file in the root of a package + RelativePathToMainFile *string `json:"relative_path_to_main_file,omitempty"` + + // Remote just a flag to indicate the module must be cloned inside the API + Remote *bool `json:"remote,omitempty"` + + // SerializedParams Serialized parameters data for the Starlark package main function + // This should be a valid JSON string + SerializedParams *string `json:"serialized_params,omitempty"` +} + +// RunStarlarkScriptArgs defines model for RunStarlarkScriptArgs. +type RunStarlarkScriptArgs struct { + // CloudInstanceId Defaults to empty + CloudInstanceId *string `json:"cloud_instance_id,omitempty"` + + // CloudUserId Defaults to empty + CloudUserId *string `json:"cloud_user_id,omitempty"` + + // DryRun Defaults to false + DryRun *bool `json:"dry_run,omitempty"` + ExperimentalFeatures *[]KurtosisFeatureFlag `json:"experimental_features,omitempty"` + + // ImageDownloadMode 0 - always + // 1 - missing + ImageDownloadMode *ImageDownloadMode `json:"image_download_mode,omitempty"` + + // MainFunctionName The name of the main function, the default value is "run" + MainFunctionName *string `json:"main_function_name,omitempty"` + + // Parallelism Defaults to 4 + Parallelism *int32 `json:"parallelism,omitempty"` + SerializedParams *string `json:"serialized_params,omitempty"` + SerializedScript *string `json:"serialized_script,omitempty"` +} + +// ServiceIdentifiers An service identifier is a collection of uuid, name and shortened uuid +type ServiceIdentifiers struct { + // Name Name of the service + Name *string `json:"name,omitempty"` + + // ServiceUuid UUID of the service + ServiceUuid *string `json:"service_uuid,omitempty"` + + // ShortenedUuid The shortened uuid of the service + ShortenedUuid *string `json:"shortened_uuid,omitempty"` +} + +// ServiceInfo defines model for ServiceInfo. +type ServiceInfo struct { + Container *Container `json:"container,omitempty"` + + // MaybePublicIpAddr Public IP address *outside* the enclave where the service is reachable + // NOTE: Will be empty if the service isn't running, the service didn't define any ports, or the backend doesn't support reporting public service info + MaybePublicIpAddr *string `json:"maybe_public_ip_addr,omitempty"` + + // MaybePublicPorts Shared Objects (Used By Multiple Endpoints) + MaybePublicPorts *Port `json:"maybe_public_ports,omitempty"` + + // Name Name of the service + Name *string `json:"name,omitempty"` + + // PrivateIpAddr The IP address of the service inside the enclave + PrivateIpAddr *string `json:"private_ip_addr,omitempty"` + + // PrivatePorts Shared Objects (Used By Multiple Endpoints) + PrivatePorts *Port `json:"private_ports,omitempty"` + + // ServiceStatus 0 - STOPPED + // 1 - RUNNING + // 2 - UNKNOWN + ServiceStatus *ServiceStatus `json:"service_status,omitempty"` + + // ServiceUuid UUID of the service + ServiceUuid *string `json:"service_uuid,omitempty"` + + // ShortenedUuid Shortened uuid of the service + ShortenedUuid *string `json:"shortened_uuid,omitempty"` +} + +// ServiceStatus 0 - STOPPED +// 1 - RUNNING +// 2 - UNKNOWN +type ServiceStatus string + +// StarlarkError defines model for StarlarkError. +type StarlarkError struct { + ExecutionError *StarlarkExecutionError `json:"execution_error,omitempty"` + InterpretationError *StarlarkInterpretationError `json:"interpretation_error,omitempty"` + ValidationError *StarlarkValidationError `json:"validation_error,omitempty"` +} + +// StarlarkExecutionError defines model for StarlarkExecutionError. +type StarlarkExecutionError struct { + ErrorMessage *string `json:"error_message,omitempty"` +} + +// StarlarkInfo defines model for StarlarkInfo. +type StarlarkInfo struct { + InfoMessage *string `json:"info_message,omitempty"` +} + +// StarlarkInstruction defines model for StarlarkInstruction. +type StarlarkInstruction struct { + Arguments *[]StarlarkInstructionArg `json:"arguments,omitempty"` + ExecutableInstruction *string `json:"executable_instruction,omitempty"` + InstructionName *string `json:"instruction_name,omitempty"` + IsSkipped *bool `json:"is_skipped,omitempty"` + Position *StarlarkInstructionPosition `json:"position,omitempty"` +} + +// StarlarkInstructionArg defines model for StarlarkInstructionArg. +type StarlarkInstructionArg struct { + ArgName *string `json:"arg_name,omitempty"` + IsRepresentative *bool `json:"is_representative,omitempty"` + SerializedArgValue *string `json:"serialized_arg_value,omitempty"` +} + +// StarlarkInstructionPosition defines model for StarlarkInstructionPosition. +type StarlarkInstructionPosition struct { + Column *int32 `json:"column,omitempty"` + Filename *string `json:"filename,omitempty"` + Line *int32 `json:"line,omitempty"` +} + +// StarlarkInstructionResult defines model for StarlarkInstructionResult. +type StarlarkInstructionResult struct { + SerializedInstructionResult *string `json:"serialized_instruction_result,omitempty"` +} + +// StarlarkInterpretationError defines model for StarlarkInterpretationError. +type StarlarkInterpretationError struct { + ErrorMessage *string `json:"error_message,omitempty"` +} + +// StarlarkRunFinishedEvent defines model for StarlarkRunFinishedEvent. +type StarlarkRunFinishedEvent struct { + IsRunSuccessful *bool `json:"is_run_successful,omitempty"` + SerializedOutput *string `json:"serialized_output,omitempty"` +} + +// StarlarkRunProgress defines model for StarlarkRunProgress. +type StarlarkRunProgress struct { + CurrentStepInfo *[]string `json:"current_step_info,omitempty"` + CurrentStepNumber *int32 `json:"current_step_number,omitempty"` + TotalSteps *int32 `json:"total_steps,omitempty"` +} + +// StarlarkRunResponseLine Starlark Execution Response +type StarlarkRunResponseLine struct { + Error *StarlarkError `json:"error,omitempty"` + Info *StarlarkInfo `json:"info,omitempty"` + Instruction *StarlarkInstruction `json:"instruction,omitempty"` + InstructionResult *StarlarkInstructionResult `json:"instruction_result,omitempty"` + ProgressInfo *StarlarkRunProgress `json:"progress_info,omitempty"` + RunFinishedEvent *StarlarkRunFinishedEvent `json:"run_finished_event,omitempty"` + Warning *StarlarkWarning `json:"warning,omitempty"` +} + +// StarlarkValidationError defines model for StarlarkValidationError. +type StarlarkValidationError struct { + ErrorMessage *string `json:"error_message,omitempty"` +} + +// StarlarkWarning defines model for StarlarkWarning. +type StarlarkWarning struct { + WarningMessage *string `json:"warning_message,omitempty"` +} + +// StoreFilesArtifactFromServiceArgs defines model for StoreFilesArtifactFromServiceArgs. +type StoreFilesArtifactFromServiceArgs struct { + // Name The name of the files artifact + Name *string `json:"name,omitempty"` + + // SourcePath The absolute source path where the source files will be copied from + SourcePath *string `json:"source_path,omitempty"` +} + +// StoreFilesArtifactFromServiceResponse defines model for StoreFilesArtifactFromServiceResponse. +type StoreFilesArtifactFromServiceResponse struct { + // Uuid UUID of the files artifact, for use when referencing it in the future + Uuid *string `json:"uuid,omitempty"` +} + +// StoreWebFilesArtifactArgs Store Web Files Artifact +type StoreWebFilesArtifactArgs struct { + // Name The name of the files artifact + Name *string `json:"name,omitempty"` + + // Url URL to download the artifact from + Url *string `json:"url,omitempty"` +} + +// StoreWebFilesArtifactResponse defines model for StoreWebFilesArtifactResponse. +type StoreWebFilesArtifactResponse struct { + // Uuid UUID of the files artifact, for use when referencing it in the future + Uuid *string `json:"uuid,omitempty"` +} + +// StreamedDataChunk Streamed Data Chunk +type StreamedDataChunk struct { + // Data Chunk of the overall files artifact bytes + Data *[]byte `json:"data,omitempty"` + Metadata *DataChunkMetadata `json:"metadata,omitempty"` + + // PreviousChunkHash Hash of the PREVIOUS chunk, or empty string is this is the first chunk + // Referencing the previous chunk via its hash allows Kurtosis to validate + // the consistency of the data in case some chunk were not received + PreviousChunkHash *string `json:"previous_chunk_hash,omitempty"` +} + +// UploadFilesArtifactResponse Upload Files Artifact +type UploadFilesArtifactResponse struct { + // Name UUID of the files artifact, for use when referencing it in the future + Name *string `json:"name,omitempty"` + + // Uuid UUID of the files artifact, for use when referencing it in the future + Uuid *string `json:"uuid,omitempty"` +} + +// WaitForEndpointAvailabilityArgs Wait For HTTP Endpoint Availability +type WaitForEndpointAvailabilityArgs struct { + // BodyText If the endpoint returns this value, the service will be marked as available (e.g. Hello World). + BodyText *string `json:"body_text,omitempty"` + HttpMethod *WaitForEndpointAvailabilityArgsHttpMethod `json:"http_method,omitempty"` + + // InitialDelayMilliseconds The number of milliseconds to wait until executing the first HTTP call + InitialDelayMilliseconds *int32 `json:"initial_delay_milliseconds,omitempty"` + + // Path The path of the service to check. It mustn't start with the first slash. For instance `service/health` + Path *string `json:"path,omitempty"` + + // Retries Max number of HTTP call attempts that this will execute until giving up and returning an error + Retries *int32 `json:"retries,omitempty"` + + // RetriesDelayMilliseconds Number of milliseconds to wait between retries + RetriesDelayMilliseconds *int32 `json:"retries_delay_milliseconds,omitempty"` +} + +// WaitForEndpointAvailabilityArgsHttpMethod defines model for WaitForEndpointAvailabilityArgs.HttpMethod. +type WaitForEndpointAvailabilityArgsHttpMethod string + +// StreamedDataBody Streamed Data Chunk +type StreamedDataBody = StreamedDataChunk + +// GetServicesServiceIdentifierParams defines parameters for GetServicesServiceIdentifier. +type GetServicesServiceIdentifierParams struct { + // AdditionalProperties Additional properties + AdditionalProperties *string `form:"additional-properties,omitempty" json:"additional-properties,omitempty"` +} + +// PutArtifactsLocalFileJSONRequestBody defines body for PutArtifactsLocalFile for application/json ContentType. +type PutArtifactsLocalFileJSONRequestBody = StreamedDataChunk + +// PutArtifactsRemoteFileJSONRequestBody defines body for PutArtifactsRemoteFile for application/json ContentType. +type PutArtifactsRemoteFileJSONRequestBody = StoreWebFilesArtifactArgs + +// PutArtifactsServicesServiceIdentifierJSONRequestBody defines body for PutArtifactsServicesServiceIdentifier for application/json ContentType. +type PutArtifactsServicesServiceIdentifierJSONRequestBody = StoreFilesArtifactFromServiceArgs + +// PostServicesConnectionJSONRequestBody defines body for PostServicesConnection for application/json ContentType. +type PostServicesConnectionJSONRequestBody = ConnectServicesArgs + +// PostServicesServiceIdentifierCommandJSONRequestBody defines body for PostServicesServiceIdentifierCommand for application/json ContentType. +type PostServicesServiceIdentifierCommandJSONRequestBody = ExecCommandArgs + +// PostServicesServiceIdentifierEndpointsPortNumberAvailabilityJSONRequestBody defines body for PostServicesServiceIdentifierEndpointsPortNumberAvailability for application/json ContentType. +type PostServicesServiceIdentifierEndpointsPortNumberAvailabilityJSONRequestBody = WaitForEndpointAvailabilityArgs + +// PutStarlarkPackagesJSONRequestBody defines body for PutStarlarkPackages for application/json ContentType. +type PutStarlarkPackagesJSONRequestBody = StreamedDataChunk + +// PostStarlarkPackagesPackageIdJSONRequestBody defines body for PostStarlarkPackagesPackageId for application/json ContentType. +type PostStarlarkPackagesPackageIdJSONRequestBody = RunStarlarkPackageArgs + +// PostStarlarkScriptsJSONRequestBody defines body for PostStarlarkScripts for application/json ContentType. +type PostStarlarkScriptsJSONRequestBody = RunStarlarkScriptArgs diff --git a/api/golang/engine/kurtosis_engine_http_api_bindings/engine_server.gen.go b/api/golang/engine/kurtosis_engine_http_api_bindings/engine_server.gen.go new file mode 100644 index 0000000000..a8ccffdcb7 --- /dev/null +++ b/api/golang/engine/kurtosis_engine_http_api_bindings/engine_server.gen.go @@ -0,0 +1,298 @@ +// Package kurtosis_engine_http_api_bindings provides primitives to interact with the openapi HTTP API. +// +// Code generated by github.com/deepmap/oapi-codegen version (devel) DO NOT EDIT. +package kurtosis_engine_http_api_bindings + +import ( + "bytes" + "compress/gzip" + "context" + "encoding/base64" + "encoding/json" + "fmt" + "net/http" + "net/url" + "path" + "strings" + + "github.com/getkin/kin-openapi/openapi3" +) + +type DeleteEnclavesRequestObject struct { + Params DeleteEnclavesParams +} + +type DeleteEnclavesResponseObject interface { + VisitDeleteEnclavesResponse(w http.ResponseWriter) error +} + +type DeleteEnclaves200JSONResponse CleanResponse + +func (response DeleteEnclaves200JSONResponse) VisitDeleteEnclavesResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type GetEnclavesRequestObject struct { +} + +type GetEnclavesResponseObject interface { + VisitGetEnclavesResponse(w http.ResponseWriter) error +} + +type GetEnclaves200JSONResponse GetEnclavesResponse + +func (response GetEnclaves200JSONResponse) VisitGetEnclavesResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PostEnclavesRequestObject struct { + Body *PostEnclavesJSONRequestBody +} + +type PostEnclavesResponseObject interface { + VisitPostEnclavesResponse(w http.ResponseWriter) error +} + +type PostEnclaves200JSONResponse CreateEnclaveResponse + +func (response PostEnclaves200JSONResponse) VisitPostEnclavesResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type GetEnclavesHistoricalRequestObject struct { +} + +type GetEnclavesHistoricalResponseObject interface { + VisitGetEnclavesHistoricalResponse(w http.ResponseWriter) error +} + +type GetEnclavesHistorical200JSONResponse GetExistingAndHistoricalEnclaveIdentifiersResponse + +func (response GetEnclavesHistorical200JSONResponse) VisitGetEnclavesHistoricalResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type DeleteEnclavesEnclaveIdentifierRequestObject struct { + EnclaveIdentifier string `json:"enclave_identifier"` +} + +type DeleteEnclavesEnclaveIdentifierResponseObject interface { + VisitDeleteEnclavesEnclaveIdentifierResponse(w http.ResponseWriter) error +} + +type DeleteEnclavesEnclaveIdentifier200JSONResponse map[string]interface{} + +func (response DeleteEnclavesEnclaveIdentifier200JSONResponse) VisitDeleteEnclavesEnclaveIdentifierResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type GetEnclavesEnclaveIdentifierRequestObject struct { + EnclaveIdentifier string `json:"enclave_identifier"` +} + +type GetEnclavesEnclaveIdentifierResponseObject interface { + VisitGetEnclavesEnclaveIdentifierResponse(w http.ResponseWriter) error +} + +type GetEnclavesEnclaveIdentifier200JSONResponse EnclaveInfo + +func (response GetEnclavesEnclaveIdentifier200JSONResponse) VisitGetEnclavesEnclaveIdentifierResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PostEnclavesEnclaveIdentifierLogsRequestObject struct { + EnclaveIdentifier string `json:"enclave_identifier"` + Body *PostEnclavesEnclaveIdentifierLogsJSONRequestBody +} + +type PostEnclavesEnclaveIdentifierLogsResponseObject interface { + VisitPostEnclavesEnclaveIdentifierLogsResponse(w http.ResponseWriter) error +} + +type PostEnclavesEnclaveIdentifierLogs200JSONResponse GetServiceLogsResponse + +func (response PostEnclavesEnclaveIdentifierLogs200JSONResponse) VisitPostEnclavesEnclaveIdentifierLogsResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PostEnclavesEnclaveIdentifierStopRequestObject struct { + EnclaveIdentifier string `json:"enclave_identifier"` +} + +type PostEnclavesEnclaveIdentifierStopResponseObject interface { + VisitPostEnclavesEnclaveIdentifierStopResponse(w http.ResponseWriter) error +} + +type PostEnclavesEnclaveIdentifierStop200JSONResponse map[string]interface{} + +func (response PostEnclavesEnclaveIdentifierStop200JSONResponse) VisitPostEnclavesEnclaveIdentifierStopResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type GetEngineInfoRequestObject struct { +} + +type GetEngineInfoResponseObject interface { + VisitGetEngineInfoResponse(w http.ResponseWriter) error +} + +type GetEngineInfo200JSONResponse GetEngineInfoResponse + +func (response GetEngineInfo200JSONResponse) VisitGetEngineInfoResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +// StrictServerInterface represents all server handlers. +type StrictServerInterface interface { + // Delete Enclaves + // (DELETE /enclaves) + DeleteEnclaves(ctx context.Context, request DeleteEnclavesRequestObject) (DeleteEnclavesResponseObject, error) + // Get Enclaves + // (GET /enclaves) + GetEnclaves(ctx context.Context, request GetEnclavesRequestObject) (GetEnclavesResponseObject, error) + // Create Enclave + // (POST /enclaves) + PostEnclaves(ctx context.Context, request PostEnclavesRequestObject) (PostEnclavesResponseObject, error) + // Get Historical Enclaves + // (GET /enclaves/historical) + GetEnclavesHistorical(ctx context.Context, request GetEnclavesHistoricalRequestObject) (GetEnclavesHistoricalResponseObject, error) + // Destroy Enclave + // (DELETE /enclaves/{enclave_identifier}) + DeleteEnclavesEnclaveIdentifier(ctx context.Context, request DeleteEnclavesEnclaveIdentifierRequestObject) (DeleteEnclavesEnclaveIdentifierResponseObject, error) + // Get Enclave Info + // (GET /enclaves/{enclave_identifier}) + GetEnclavesEnclaveIdentifier(ctx context.Context, request GetEnclavesEnclaveIdentifierRequestObject) (GetEnclavesEnclaveIdentifierResponseObject, error) + // Get Service Logs + // (POST /enclaves/{enclave_identifier}/logs) + PostEnclavesEnclaveIdentifierLogs(ctx context.Context, request PostEnclavesEnclaveIdentifierLogsRequestObject) (PostEnclavesEnclaveIdentifierLogsResponseObject, error) + // Stop Enclave + // (POST /enclaves/{enclave_identifier}/stop) + PostEnclavesEnclaveIdentifierStop(ctx context.Context, request PostEnclavesEnclaveIdentifierStopRequestObject) (PostEnclavesEnclaveIdentifierStopResponseObject, error) + // Get Engine Info + // (GET /engine/info) + GetEngineInfo(ctx context.Context, request GetEngineInfoRequestObject) (GetEngineInfoResponseObject, error) +} + +// Base64 encoded, gzipped, json marshaled Swagger object +var swaggerSpec = []string{ + + "H4sIAAAAAAAC/+xYTW/jNhP+KwLf9+jGaXvzLU22WQPpbrBJTosFwYgjmQFFcsmRu0bg/16Q+rT1YdmJ", + "CxTtzZZmOF/PPDPUK4l1ZrQChY4sXomLV5Cx8PNaAlNfwBmtHPgHxmoDFgWE1xYyvQZOQcWSrYEqlgFl", + "itM8FzxICIQs/Pi/hYQsyP/mja15aWj+oVD/xDK4UvwpF5xsZwQ3BsiCMGvZhmybB/r5BWL0EtcWGEKp", + "fWVT1/WQGUFjrZAJBZZKnVIJa5D+VXmcQytU6o/blV2DdUIriiztlW7H3CuQaR5egMozsvhKHj88PJIZ", + "uf/y+ebp+nH5+RP5NtvXOhjlcC0qf4RK9MSEL71or80qp/fL6yohH7XDP1i8EqrQ6ziQWhNToy1SrehK", + "O6RZId7KjlAIKVhvQpgRubF89PjW79CzFTwFKgxlnFtwrrdMTcUF7xVo4hLKCQ4V2gfDGhSbENWSg0KR", + "CLBuuMS+u3pdHcSiW2mLoIAP6Y651Jvc3WZpl/EYBI4BrNORJ57bf5hDhrnrr2Et5cbFfGMGihBF2scc", + "exQZOGSZaXPHYCFP4Y4zlb/Nyh0UDFo8ws4tYGnKTWc3xrnwuWfyfkduMut1HBl0LS0BOeacl6kmxhFh", + "/xAOhUqvFP8oHGorYia7RDBsmEm5RxjHzNu26qR5ewv4AHYtYrjTqesfuLFWL7mKUayBJkLiMX7d6fRO", + "KPg9qHVdmpFES6n/9GO83ZLPWvs1JXRAnhVDXigY6FoLmFtFmZQj57gizNAu1AGOQa6rPQ1ZrVQOV1hp", + "pInOlffiHV1qIvQ5oM+bneNPbbCyfhNTUEl3Ypbl0xozHXbZxwXW5DqdhUdcKgHYccz/ZqhtP7AQfiA1", + "DBHsVA54bPudaJsxJAvCGcJPYaZ090O/YZQUiAKlf1cwVHR1vyQzUnMQ+fni8uLSG9EGFDOCLMiv4dGM", + "GIarENC8pNXwh4MEhCZOodWSkwW5Cc8rig7qlmVQdPZXr+diKwwWZpdJhDaHWVTcDSImZVRZuYhuIGG5", + "xEi4KGHS+QiF1/qeg92QaoKV9wrfo2RWXkf6YL395tu5aJ0Qwi+XlyUHIaiiQ4yRIg7BzF9cQc7NgWNQ", + "2b36hMzvRvqQxzE4l+Qyso3YjLg8y5jd1JmL6tT5ZbJo3N0MtyYgOWNEfYP2pLhuAXeCMtr1RHWv3W5Y", + "33Nw+Jvmm/erUecCGOLxpoQFThYeittzgqT3bnZSUoujqryGl3V7zlf1ehBuWgdA1CwT54bTkQvMyWhr", + "Tm8BbydDr/WGWNvdTme1js+HaO7paXkzi+q9Oir+axt5Bot0EuEKKt6rSM7TbsNxXX/JPnJ7uK8eBG+l", + "vv0BfRK9ObR600D2ML39+/I8/TPM24g4qj/mjPfEvFp6D5N2p1h+Vf1nFOz9R03P3edvnjUDV4aTgVMe", + "FoWqTgCOQ21OBM6DV/2PUQ+WxedpfwPwy/282vmH+bX6SnH2BbLzOeQNzBUuLhX9bf8KAAD//6fYwzqI", + "GAAA", +} + +// GetSwagger returns the content of the embedded swagger specification file +// or error if failed to decode +func decodeSpec() ([]byte, error) { + zipped, err := base64.StdEncoding.DecodeString(strings.Join(swaggerSpec, "")) + if err != nil { + return nil, fmt.Errorf("error base64 decoding spec: %s", err) + } + zr, err := gzip.NewReader(bytes.NewReader(zipped)) + if err != nil { + return nil, fmt.Errorf("error decompressing spec: %s", err) + } + var buf bytes.Buffer + _, err = buf.ReadFrom(zr) + if err != nil { + return nil, fmt.Errorf("error decompressing spec: %s", err) + } + + return buf.Bytes(), nil +} + +var rawSpec = decodeSpecCached() + +// a naive cached of a decoded swagger spec +func decodeSpecCached() func() ([]byte, error) { + data, err := decodeSpec() + return func() ([]byte, error) { + return data, err + } +} + +// Constructs a synthetic filesystem for resolving external references when loading openapi specifications. +func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error) { + var res = make(map[string]func() ([]byte, error)) + if len(pathToFile) > 0 { + res[pathToFile] = rawSpec + } + + return res +} + +// GetSwagger returns the Swagger specification corresponding to the generated code +// in this file. The external references of Swagger specification are resolved. +// The logic of resolving external references is tightly connected to "import-mapping" feature. +// Externally referenced files must be embedded in the corresponding golang packages. +// Urls can be supported but this task was out of the scope. +func GetSwagger() (swagger *openapi3.T, err error) { + var resolvePath = PathToRawSpec("") + + loader := openapi3.NewLoader() + loader.IsExternalRefsAllowed = true + loader.ReadFromURIFunc = func(loader *openapi3.Loader, url *url.URL) ([]byte, error) { + var pathToFile = url.String() + pathToFile = path.Clean(pathToFile) + getSpec, ok := resolvePath[pathToFile] + if !ok { + err1 := fmt.Errorf("path not found: %s", pathToFile) + return nil, err1 + } + return getSpec() + } + var specData []byte + specData, err = rawSpec() + if err != nil { + return + } + swagger, err = loader.LoadFromData(specData) + if err != nil { + return + } + return +} diff --git a/api/golang/engine/kurtosis_engine_http_api_bindings/engine_service.gen.go b/api/golang/engine/kurtosis_engine_http_api_bindings/engine_service.gen.go deleted file mode 100644 index bc6ac87e06..0000000000 --- a/api/golang/engine/kurtosis_engine_http_api_bindings/engine_service.gen.go +++ /dev/null @@ -1,1710 +0,0 @@ -// Package engine_service provides primitives to interact with the openapi HTTP API. -// -// Code generated by github.com/deepmap/oapi-codegen version (devel) DO NOT EDIT. -package engine_service - -import ( - "bytes" - "compress/gzip" - "context" - "encoding/base64" - "encoding/json" - "fmt" - "io" - "net/http" - "net/url" - "path" - "strings" - - "github.com/getkin/kin-openapi/openapi3" - "github.com/labstack/echo/v4" -) - -// Defines values for EngineApiEnclaveAPIContainerStatus. -const ( - EnclaveAPIContainerStatusNONEXISTENT EngineApiEnclaveAPIContainerStatus = "EnclaveAPIContainerStatus_NONEXISTENT" - EnclaveAPIContainerStatusRUNNING EngineApiEnclaveAPIContainerStatus = "EnclaveAPIContainerStatus_RUNNING" - EnclaveAPIContainerStatusSTOPPED EngineApiEnclaveAPIContainerStatus = "EnclaveAPIContainerStatus_STOPPED" -) - -// Defines values for EngineApiEnclaveContainersStatus. -const ( - EnclaveContainersStatusEMPTY EngineApiEnclaveContainersStatus = "EnclaveContainersStatus_EMPTY" - EnclaveContainersStatusRUNNING EngineApiEnclaveContainersStatus = "EnclaveContainersStatus_RUNNING" - EnclaveContainersStatusSTOPPED EngineApiEnclaveContainersStatus = "EnclaveContainersStatus_STOPPED" -) - -// Defines values for EngineApiEnclaveMode. -const ( - PRODUCTION EngineApiEnclaveMode = "PRODUCTION" - TEST EngineApiEnclaveMode = "TEST" -) - -// Defines values for EngineApiLogLineOperator. -const ( - LogLineOperatorDOESCONTAINMATCHREGEX EngineApiLogLineOperator = "LogLineOperator_DOES_CONTAIN_MATCH_REGEX" - LogLineOperatorDOESCONTAINTEXT EngineApiLogLineOperator = "LogLineOperator_DOES_CONTAIN_TEXT" - LogLineOperatorDOESNOTCONTAINMATCHREGEX EngineApiLogLineOperator = "LogLineOperator_DOES_NOT_CONTAIN_MATCH_REGEX" - LogLineOperatorDOESNOTCONTAINTEXT EngineApiLogLineOperator = "LogLineOperator_DOES_NOT_CONTAIN_TEXT" -) - -// EngineApiCleanArgs ============================================================================================== -// Create Enclave -// ============================================================================================== -type EngineApiCleanArgs struct { - // ShouldCleanAll If true, It will clean even the running enclaves - ShouldCleanAll *bool `json:"should_clean_all,omitempty"` -} - -// EngineApiCleanResponse defines model for engine_api.CleanResponse. -type EngineApiCleanResponse struct { - // RemovedEnclaveNameAndUuids removed enclave name and uuids - RemovedEnclaveNameAndUuids *[]EngineApiEnclaveNameAndUuid `json:"removed_enclave_name_and_uuids,omitempty"` -} - -// EngineApiCreateEnclaveArgs ============================================================================================== -// Create Enclave -// ============================================================================================== -type EngineApiCreateEnclaveArgs struct { - // ApiContainerLogLevel The API container log level - ApiContainerLogLevel *string `json:"api_container_log_level,omitempty"` - - // ApiContainerVersionTag The image tag of the API container that should be used inside the enclave - // If blank, will use the default version that the engine server uses - ApiContainerVersionTag *string `json:"api_container_version_tag,omitempty"` - - // EnclaveName The name of the new Kurtosis Enclave - EnclaveName *string `json:"enclave_name,omitempty"` - - // Mode 0 - TEST - // 1 - PRODUCTION - Mode *EngineApiEnclaveMode `json:"mode,omitempty"` -} - -// EngineApiCreateEnclaveResponse defines model for engine_api.CreateEnclaveResponse. -type EngineApiCreateEnclaveResponse struct { - // EnclaveInfo Enclaves are defined by a network in the container system, which is why there's a bunch of network information here - EnclaveInfo *EngineApiEnclaveInfo `json:"enclave_info,omitempty"` -} - -// EngineApiDestroyEnclaveArgs ============================================================================================== -// Destroy Enclave -// ============================================================================================== -type EngineApiDestroyEnclaveArgs struct { - // EnclaveIdentifier The identifier(uuid, shortened uuid, name) of the Kurtosis enclave to destroy - EnclaveIdentifier *string `json:"enclave_identifier,omitempty"` -} - -// EngineApiEnclaveAPIContainerHostMachineInfo Will only be present if the API container is running -type EngineApiEnclaveAPIContainerHostMachineInfo struct { - // GrpcPortOnHostMachine The grpc port on the container engine host machine where the API container can be reached - GrpcPortOnHostMachine *int32 `json:"grpc_port_on_host_machine,omitempty"` - - // IpOnHostMachine The interface IP on the container engine host machine where the API container can be reached - IpOnHostMachine *string `json:"ip_on_host_machine,omitempty"` -} - -// EngineApiEnclaveAPIContainerInfo defines model for engine_api.EnclaveAPIContainerInfo. -type EngineApiEnclaveAPIContainerInfo struct { - // BridgeIpAddress this is the bridge ip address that gets assigned to api container - BridgeIpAddress *string `json:"bridge_ip_address,omitempty"` - - // ContainerId The container engine ID of the API container - ContainerId *string `json:"container_id,omitempty"` - - // GrpcPortInsideEnclave The grpc port inside the enclave network that the API container is listening on - GrpcPortInsideEnclave *int32 `json:"grpc_port_inside_enclave,omitempty"` - - // IpInsideEnclave The IP inside the enclave network of the API container (i.e. how services inside the network can reach the API container) - IpInsideEnclave *string `json:"ip_inside_enclave,omitempty"` -} - -// EngineApiEnclaveAPIContainerStatus 0 - EnclaveAPIContainerStatus_NONEXISTENT // No API container exists in the enclave -// This is the only valid value when the enclave containers status is "EMPTY" -// 1 - EnclaveAPIContainerStatus_RUNNING // An API container exists and is running -// NOTE: this does NOT say that the server inside the API container is available, because checking if it's available requires making a call to the API container -// If we have a lot of API containers, we'd be making tons of calls -// 2 - EnclaveAPIContainerStatus_STOPPED // An API container exists, but isn't running -type EngineApiEnclaveAPIContainerStatus string - -// EngineApiEnclaveContainersStatus 0 - EnclaveContainersStatus_EMPTY // The enclave has been created, but there are no containers inside it -// 1 - EnclaveContainersStatus_RUNNING // One or more containers are running in the enclave (which may or may not include the API container, depending on if the user was manually stopping/removing containers) -// 2 - EnclaveContainersStatus_STOPPED // There are >= 1 container in the enclave, but they're all stopped -type EngineApiEnclaveContainersStatus string - -// EngineApiEnclaveIdentifiers An enclave identifier is a collection of uuid, name and shortened uuid -type EngineApiEnclaveIdentifiers struct { - // EnclaveUuid UUID of the enclave - EnclaveUuid *string `json:"enclave_uuid,omitempty"` - - // Name Name of the enclave - Name *string `json:"name,omitempty"` - - // ShortenedUuid The shortened uuid of the enclave - ShortenedUuid *string `json:"shortened_uuid,omitempty"` -} - -// EngineApiEnclaveInfo Enclaves are defined by a network in the container system, which is why there's a bunch of network information here -type EngineApiEnclaveInfo struct { - // ApiContainerHostMachineInfo Will only be present if the API container is running - ApiContainerHostMachineInfo *EngineApiEnclaveAPIContainerHostMachineInfo `json:"api_container_host_machine_info,omitempty"` - ApiContainerInfo *EngineApiEnclaveAPIContainerInfo `json:"api_container_info,omitempty"` - - // ApiContainerStatus 0 - EnclaveAPIContainerStatus_NONEXISTENT // No API container exists in the enclave - // This is the only valid value when the enclave containers status is "EMPTY" - // 1 - EnclaveAPIContainerStatus_RUNNING // An API container exists and is running - // NOTE: this does NOT say that the server inside the API container is available, because checking if it's available requires making a call to the API container - // If we have a lot of API containers, we'd be making tons of calls - // 2 - EnclaveAPIContainerStatus_STOPPED // An API container exists, but isn't running - ApiContainerStatus *EngineApiEnclaveAPIContainerStatus `json:"api_container_status,omitempty"` - - // ContainersStatus 0 - EnclaveContainersStatus_EMPTY // The enclave has been created, but there are no containers inside it - // 1 - EnclaveContainersStatus_RUNNING // One or more containers are running in the enclave (which may or may not include the API container, depending on if the user was manually stopping/removing containers) - // 2 - EnclaveContainersStatus_STOPPED // There are >= 1 container in the enclave, but they're all stopped - ContainersStatus *EngineApiEnclaveContainersStatus `json:"containers_status,omitempty"` - CreationTime *GoogleProtobufTimestamp `json:"creation_time,omitempty"` - - // EnclaveUuid UUID of the enclave - EnclaveUuid *string `json:"enclave_uuid,omitempty"` - - // Mode 0 - TEST - // 1 - PRODUCTION - Mode *EngineApiEnclaveMode `json:"mode,omitempty"` - - // Name Name of the enclave - Name *string `json:"name,omitempty"` - - // ShortenedUuid The shortened uuid of the enclave - ShortenedUuid *string `json:"shortened_uuid,omitempty"` -} - -// EngineApiEnclaveMode 0 - TEST -// 1 - PRODUCTION -type EngineApiEnclaveMode string - -// EngineApiEnclaveNameAndUuid defines model for engine_api.EnclaveNameAndUuid. -type EngineApiEnclaveNameAndUuid struct { - Name *string `json:"name,omitempty"` - Uuid *string `json:"uuid,omitempty"` -} - -// EngineApiGetEnclavesResponse defines model for engine_api.GetEnclavesResponse. -type EngineApiGetEnclavesResponse struct { - // EnclaveInfo Enclaves are defined by a network in the container system, which is why there's a bunch of network information here - EnclaveInfo *EngineApiEnclaveInfo `json:"enclave_info,omitempty"` -} - -// EngineApiGetEngineInfoResponse ============================================================================================== -// Get Engine Info -// ============================================================================================== -type EngineApiGetEngineInfoResponse struct { - // EngineVersion Version of the engine server - EngineVersion *string `json:"engine_version,omitempty"` -} - -// EngineApiGetExistingAndHistoricalEnclaveIdentifiersResponse defines model for engine_api.GetExistingAndHistoricalEnclaveIdentifiersResponse. -type EngineApiGetExistingAndHistoricalEnclaveIdentifiersResponse struct { - AllIdentifiers *[]EngineApiEnclaveIdentifiers `json:"allIdentifiers,omitempty"` -} - -// EngineApiGetServiceLogsArgs ============================================================================================== -// Get User Service Logs -// ============================================================================================== -type EngineApiGetServiceLogsArgs struct { - // ConjunctiveFilters The conjunctive log lines filters, the first filter is applied over the found log lines, the second filter is applied over the filter one result and so on (like grep) - ConjunctiveFilters *[]EngineApiLogLineFilter `json:"conjunctive_filters,omitempty"` - - // EnclaveIdentifier The identifier of the user service's Kurtosis Enclave - EnclaveIdentifier *string `json:"enclave_identifier,omitempty"` - - // FollowLogs If true, It will follow the container logs - FollowLogs *bool `json:"follow_logs,omitempty"` - - // NumLogLines If [return_all_logs] is false, return [num_log_lines] - NumLogLines *int32 `json:"num_log_lines,omitempty"` - - // ReturnAllLogs If true, return all log lines - ReturnAllLogs *bool `json:"return_all_logs,omitempty"` - - // ServiceUuidSet "Set" of service UUIDs in the enclave - ServiceUuidSet *map[string]string `json:"service_uuid_set,omitempty"` -} - -// EngineApiGetServiceLogsResponse defines model for engine_api.GetServiceLogsResponse. -type EngineApiGetServiceLogsResponse struct { - // NotFoundServiceUuidSet A set of service GUIDs requested by the user that were not found in the logs database, could be related that users send - // a wrong GUID or a right GUID for a service that has not sent any logs so far - NotFoundServiceUuidSet *map[string]string `json:"not_found_service_uuid_set,omitempty"` - - // ServiceLogsByServiceUuid TODO add timestamp as well, for when we do timestamp-handling on the client side - ServiceLogsByServiceUuid *EngineApiLogLine `json:"service_logs_by_service_uuid,omitempty"` -} - -// EngineApiLogLine TODO add timestamp as well, for when we do timestamp-handling on the client side -type EngineApiLogLine struct { - Line *[]string `json:"line,omitempty"` -} - -// EngineApiLogLineFilter defines model for engine_api.LogLineFilter. -type EngineApiLogLineFilter struct { - // Operator 0 - LogLineOperator_DOES_CONTAIN_TEXT - // 1 - LogLineOperator_DOES_NOT_CONTAIN_TEXT - // 2 - LogLineOperator_DOES_CONTAIN_MATCH_REGEX - // 3 - LogLineOperator_DOES_NOT_CONTAIN_MATCH_REGEX - Operator *EngineApiLogLineOperator `json:"operator,omitempty"` - TextPattern *string `json:"text_pattern,omitempty"` -} - -// EngineApiLogLineOperator 0 - LogLineOperator_DOES_CONTAIN_TEXT -// 1 - LogLineOperator_DOES_NOT_CONTAIN_TEXT -// 2 - LogLineOperator_DOES_CONTAIN_MATCH_REGEX -// 3 - LogLineOperator_DOES_NOT_CONTAIN_MATCH_REGEX -type EngineApiLogLineOperator string - -// EngineApiStopEnclaveArgs ============================================================================================== -// Stop Enclave -// ============================================================================================== -type EngineApiStopEnclaveArgs struct { - // EnclaveIdentifier The identifier(uuid, shortened uuid, name) of the Kurtosis enclave to stop - EnclaveIdentifier *string `json:"enclave_identifier,omitempty"` -} - -// GoogleProtobufEmpty defines model for google.protobuf.Empty. -type GoogleProtobufEmpty = map[string]interface{} - -// GoogleProtobufTimestamp defines model for google.protobuf.Timestamp. -type GoogleProtobufTimestamp struct { - Nanos *int32 `json:"nanos,omitempty"` - Seconds *int64 `json:"seconds,omitempty"` -} - -// EngineApiEngineServiceCleanJSONRequestBody defines body for EngineApiEngineServiceClean for application/json ContentType. -type EngineApiEngineServiceCleanJSONRequestBody = EngineApiCleanArgs - -// EngineApiEngineServiceCreateEnclaveJSONRequestBody defines body for EngineApiEngineServiceCreateEnclave for application/json ContentType. -type EngineApiEngineServiceCreateEnclaveJSONRequestBody = EngineApiCreateEnclaveArgs - -// EngineApiEngineServiceDestroyEnclaveJSONRequestBody defines body for EngineApiEngineServiceDestroyEnclave for application/json ContentType. -type EngineApiEngineServiceDestroyEnclaveJSONRequestBody = EngineApiDestroyEnclaveArgs - -// EngineApiEngineServiceGetEnclavesJSONRequestBody defines body for EngineApiEngineServiceGetEnclaves for application/json ContentType. -type EngineApiEngineServiceGetEnclavesJSONRequestBody = GoogleProtobufEmpty - -// EngineApiEngineServiceGetEngineInfoJSONRequestBody defines body for EngineApiEngineServiceGetEngineInfo for application/json ContentType. -type EngineApiEngineServiceGetEngineInfoJSONRequestBody = GoogleProtobufEmpty - -// EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersJSONRequestBody defines body for EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiers for application/json ContentType. -type EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersJSONRequestBody = GoogleProtobufEmpty - -// EngineApiEngineServiceGetServiceLogsJSONRequestBody defines body for EngineApiEngineServiceGetServiceLogs for application/json ContentType. -type EngineApiEngineServiceGetServiceLogsJSONRequestBody = EngineApiGetServiceLogsArgs - -// EngineApiEngineServiceStopEnclaveJSONRequestBody defines body for EngineApiEngineServiceStopEnclave for application/json ContentType. -type EngineApiEngineServiceStopEnclaveJSONRequestBody = EngineApiStopEnclaveArgs - -// RequestEditorFn is the function signature for the RequestEditor callback function -type RequestEditorFn func(ctx context.Context, req *http.Request) error - -// Doer performs HTTP requests. -// -// The standard http.Client implements this interface. -type HttpRequestDoer interface { - Do(req *http.Request) (*http.Response, error) -} - -// Client which conforms to the OpenAPI3 specification for this service. -type Client struct { - // The endpoint of the server conforming to this interface, with scheme, - // https://api.deepmap.com for example. This can contain a path relative - // to the server, such as https://api.deepmap.com/dev-test, and all the - // paths in the swagger spec will be appended to the server. - Server string - - // Doer for performing requests, typically a *http.Client with any - // customized settings, such as certificate chains. - Client HttpRequestDoer - - // A list of callbacks for modifying requests which are generated before sending over - // the network. - RequestEditors []RequestEditorFn -} - -// ClientOption allows setting custom parameters during construction -type ClientOption func(*Client) error - -// Creates a new Client, with reasonable defaults -func NewClient(server string, opts ...ClientOption) (*Client, error) { - // create a client with sane default values - client := Client{ - Server: server, - } - // mutate client and add all optional params - for _, o := range opts { - if err := o(&client); err != nil { - return nil, err - } - } - // ensure the server URL always has a trailing slash - if !strings.HasSuffix(client.Server, "/") { - client.Server += "/" - } - // create httpClient, if not already present - if client.Client == nil { - client.Client = &http.Client{} - } - return &client, nil -} - -// WithHTTPClient allows overriding the default Doer, which is -// automatically created using http.Client. This is useful for tests. -func WithHTTPClient(doer HttpRequestDoer) ClientOption { - return func(c *Client) error { - c.Client = doer - return nil - } -} - -// WithRequestEditorFn allows setting up a callback function, which will be -// called right before sending the request. This can be used to mutate the request. -func WithRequestEditorFn(fn RequestEditorFn) ClientOption { - return func(c *Client) error { - c.RequestEditors = append(c.RequestEditors, fn) - return nil - } -} - -// The interface specification for the client above. -type ClientInterface interface { - // EngineApiEngineServiceCleanWithBody request with any body - EngineApiEngineServiceCleanWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - EngineApiEngineServiceClean(ctx context.Context, body EngineApiEngineServiceCleanJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // EngineApiEngineServiceCreateEnclaveWithBody request with any body - EngineApiEngineServiceCreateEnclaveWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - EngineApiEngineServiceCreateEnclave(ctx context.Context, body EngineApiEngineServiceCreateEnclaveJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // EngineApiEngineServiceDestroyEnclaveWithBody request with any body - EngineApiEngineServiceDestroyEnclaveWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - EngineApiEngineServiceDestroyEnclave(ctx context.Context, body EngineApiEngineServiceDestroyEnclaveJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // EngineApiEngineServiceGetEnclavesWithBody request with any body - EngineApiEngineServiceGetEnclavesWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - EngineApiEngineServiceGetEnclaves(ctx context.Context, body EngineApiEngineServiceGetEnclavesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // EngineApiEngineServiceGetEngineInfoWithBody request with any body - EngineApiEngineServiceGetEngineInfoWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - EngineApiEngineServiceGetEngineInfo(ctx context.Context, body EngineApiEngineServiceGetEngineInfoJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersWithBody request with any body - EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiers(ctx context.Context, body EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // EngineApiEngineServiceGetServiceLogsWithBody request with any body - EngineApiEngineServiceGetServiceLogsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - EngineApiEngineServiceGetServiceLogs(ctx context.Context, body EngineApiEngineServiceGetServiceLogsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // EngineApiEngineServiceStopEnclaveWithBody request with any body - EngineApiEngineServiceStopEnclaveWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - EngineApiEngineServiceStopEnclave(ctx context.Context, body EngineApiEngineServiceStopEnclaveJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) -} - -func (c *Client) EngineApiEngineServiceCleanWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewEngineApiEngineServiceCleanRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) EngineApiEngineServiceClean(ctx context.Context, body EngineApiEngineServiceCleanJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewEngineApiEngineServiceCleanRequest(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) EngineApiEngineServiceCreateEnclaveWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewEngineApiEngineServiceCreateEnclaveRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) EngineApiEngineServiceCreateEnclave(ctx context.Context, body EngineApiEngineServiceCreateEnclaveJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewEngineApiEngineServiceCreateEnclaveRequest(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) EngineApiEngineServiceDestroyEnclaveWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewEngineApiEngineServiceDestroyEnclaveRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) EngineApiEngineServiceDestroyEnclave(ctx context.Context, body EngineApiEngineServiceDestroyEnclaveJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewEngineApiEngineServiceDestroyEnclaveRequest(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) EngineApiEngineServiceGetEnclavesWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewEngineApiEngineServiceGetEnclavesRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) EngineApiEngineServiceGetEnclaves(ctx context.Context, body EngineApiEngineServiceGetEnclavesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewEngineApiEngineServiceGetEnclavesRequest(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) EngineApiEngineServiceGetEngineInfoWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewEngineApiEngineServiceGetEngineInfoRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) EngineApiEngineServiceGetEngineInfo(ctx context.Context, body EngineApiEngineServiceGetEngineInfoJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewEngineApiEngineServiceGetEngineInfoRequest(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewEngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiers(ctx context.Context, body EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewEngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersRequest(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) EngineApiEngineServiceGetServiceLogsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewEngineApiEngineServiceGetServiceLogsRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) EngineApiEngineServiceGetServiceLogs(ctx context.Context, body EngineApiEngineServiceGetServiceLogsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewEngineApiEngineServiceGetServiceLogsRequest(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) EngineApiEngineServiceStopEnclaveWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewEngineApiEngineServiceStopEnclaveRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) EngineApiEngineServiceStopEnclave(ctx context.Context, body EngineApiEngineServiceStopEnclaveJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewEngineApiEngineServiceStopEnclaveRequest(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -// NewEngineApiEngineServiceCleanRequest calls the generic EngineApiEngineServiceClean builder with application/json body -func NewEngineApiEngineServiceCleanRequest(server string, body EngineApiEngineServiceCleanJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewEngineApiEngineServiceCleanRequestWithBody(server, "application/json", bodyReader) -} - -// NewEngineApiEngineServiceCleanRequestWithBody generates requests for EngineApiEngineServiceClean with any type of body -func NewEngineApiEngineServiceCleanRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/engine_api.EngineService/Clean") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewEngineApiEngineServiceCreateEnclaveRequest calls the generic EngineApiEngineServiceCreateEnclave builder with application/json body -func NewEngineApiEngineServiceCreateEnclaveRequest(server string, body EngineApiEngineServiceCreateEnclaveJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewEngineApiEngineServiceCreateEnclaveRequestWithBody(server, "application/json", bodyReader) -} - -// NewEngineApiEngineServiceCreateEnclaveRequestWithBody generates requests for EngineApiEngineServiceCreateEnclave with any type of body -func NewEngineApiEngineServiceCreateEnclaveRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/engine_api.EngineService/CreateEnclave") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewEngineApiEngineServiceDestroyEnclaveRequest calls the generic EngineApiEngineServiceDestroyEnclave builder with application/json body -func NewEngineApiEngineServiceDestroyEnclaveRequest(server string, body EngineApiEngineServiceDestroyEnclaveJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewEngineApiEngineServiceDestroyEnclaveRequestWithBody(server, "application/json", bodyReader) -} - -// NewEngineApiEngineServiceDestroyEnclaveRequestWithBody generates requests for EngineApiEngineServiceDestroyEnclave with any type of body -func NewEngineApiEngineServiceDestroyEnclaveRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/engine_api.EngineService/DestroyEnclave") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewEngineApiEngineServiceGetEnclavesRequest calls the generic EngineApiEngineServiceGetEnclaves builder with application/json body -func NewEngineApiEngineServiceGetEnclavesRequest(server string, body EngineApiEngineServiceGetEnclavesJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewEngineApiEngineServiceGetEnclavesRequestWithBody(server, "application/json", bodyReader) -} - -// NewEngineApiEngineServiceGetEnclavesRequestWithBody generates requests for EngineApiEngineServiceGetEnclaves with any type of body -func NewEngineApiEngineServiceGetEnclavesRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/engine_api.EngineService/GetEnclaves") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewEngineApiEngineServiceGetEngineInfoRequest calls the generic EngineApiEngineServiceGetEngineInfo builder with application/json body -func NewEngineApiEngineServiceGetEngineInfoRequest(server string, body EngineApiEngineServiceGetEngineInfoJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewEngineApiEngineServiceGetEngineInfoRequestWithBody(server, "application/json", bodyReader) -} - -// NewEngineApiEngineServiceGetEngineInfoRequestWithBody generates requests for EngineApiEngineServiceGetEngineInfo with any type of body -func NewEngineApiEngineServiceGetEngineInfoRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/engine_api.EngineService/GetEngineInfo") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewEngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersRequest calls the generic EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiers builder with application/json body -func NewEngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersRequest(server string, body EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewEngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersRequestWithBody(server, "application/json", bodyReader) -} - -// NewEngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersRequestWithBody generates requests for EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiers with any type of body -func NewEngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/engine_api.EngineService/GetExistingAndHistoricalEnclaveIdentifiers") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewEngineApiEngineServiceGetServiceLogsRequest calls the generic EngineApiEngineServiceGetServiceLogs builder with application/json body -func NewEngineApiEngineServiceGetServiceLogsRequest(server string, body EngineApiEngineServiceGetServiceLogsJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewEngineApiEngineServiceGetServiceLogsRequestWithBody(server, "application/json", bodyReader) -} - -// NewEngineApiEngineServiceGetServiceLogsRequestWithBody generates requests for EngineApiEngineServiceGetServiceLogs with any type of body -func NewEngineApiEngineServiceGetServiceLogsRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/engine_api.EngineService/GetServiceLogs") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewEngineApiEngineServiceStopEnclaveRequest calls the generic EngineApiEngineServiceStopEnclave builder with application/json body -func NewEngineApiEngineServiceStopEnclaveRequest(server string, body EngineApiEngineServiceStopEnclaveJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewEngineApiEngineServiceStopEnclaveRequestWithBody(server, "application/json", bodyReader) -} - -// NewEngineApiEngineServiceStopEnclaveRequestWithBody generates requests for EngineApiEngineServiceStopEnclave with any type of body -func NewEngineApiEngineServiceStopEnclaveRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/engine_api.EngineService/StopEnclave") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error { - for _, r := range c.RequestEditors { - if err := r(ctx, req); err != nil { - return err - } - } - for _, r := range additionalEditors { - if err := r(ctx, req); err != nil { - return err - } - } - return nil -} - -// ClientWithResponses builds on ClientInterface to offer response payloads -type ClientWithResponses struct { - ClientInterface -} - -// NewClientWithResponses creates a new ClientWithResponses, which wraps -// Client with return type handling -func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error) { - client, err := NewClient(server, opts...) - if err != nil { - return nil, err - } - return &ClientWithResponses{client}, nil -} - -// WithBaseURL overrides the baseURL. -func WithBaseURL(baseURL string) ClientOption { - return func(c *Client) error { - newBaseURL, err := url.Parse(baseURL) - if err != nil { - return err - } - c.Server = newBaseURL.String() - return nil - } -} - -// ClientWithResponsesInterface is the interface specification for the client with responses above. -type ClientWithResponsesInterface interface { - // EngineApiEngineServiceCleanWithBodyWithResponse request with any body - EngineApiEngineServiceCleanWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceCleanResponse, error) - - EngineApiEngineServiceCleanWithResponse(ctx context.Context, body EngineApiEngineServiceCleanJSONRequestBody, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceCleanResponse, error) - - // EngineApiEngineServiceCreateEnclaveWithBodyWithResponse request with any body - EngineApiEngineServiceCreateEnclaveWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceCreateEnclaveResponse, error) - - EngineApiEngineServiceCreateEnclaveWithResponse(ctx context.Context, body EngineApiEngineServiceCreateEnclaveJSONRequestBody, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceCreateEnclaveResponse, error) - - // EngineApiEngineServiceDestroyEnclaveWithBodyWithResponse request with any body - EngineApiEngineServiceDestroyEnclaveWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceDestroyEnclaveResponse, error) - - EngineApiEngineServiceDestroyEnclaveWithResponse(ctx context.Context, body EngineApiEngineServiceDestroyEnclaveJSONRequestBody, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceDestroyEnclaveResponse, error) - - // EngineApiEngineServiceGetEnclavesWithBodyWithResponse request with any body - EngineApiEngineServiceGetEnclavesWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceGetEnclavesResponse, error) - - EngineApiEngineServiceGetEnclavesWithResponse(ctx context.Context, body EngineApiEngineServiceGetEnclavesJSONRequestBody, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceGetEnclavesResponse, error) - - // EngineApiEngineServiceGetEngineInfoWithBodyWithResponse request with any body - EngineApiEngineServiceGetEngineInfoWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceGetEngineInfoResponse, error) - - EngineApiEngineServiceGetEngineInfoWithResponse(ctx context.Context, body EngineApiEngineServiceGetEngineInfoJSONRequestBody, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceGetEngineInfoResponse, error) - - // EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersWithBodyWithResponse request with any body - EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersResponse, error) - - EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersWithResponse(ctx context.Context, body EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersJSONRequestBody, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersResponse, error) - - // EngineApiEngineServiceGetServiceLogsWithBodyWithResponse request with any body - EngineApiEngineServiceGetServiceLogsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceGetServiceLogsResponse, error) - - EngineApiEngineServiceGetServiceLogsWithResponse(ctx context.Context, body EngineApiEngineServiceGetServiceLogsJSONRequestBody, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceGetServiceLogsResponse, error) - - // EngineApiEngineServiceStopEnclaveWithBodyWithResponse request with any body - EngineApiEngineServiceStopEnclaveWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceStopEnclaveResponse, error) - - EngineApiEngineServiceStopEnclaveWithResponse(ctx context.Context, body EngineApiEngineServiceStopEnclaveJSONRequestBody, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceStopEnclaveResponse, error) -} - -type EngineApiEngineServiceCleanResponse struct { - Body []byte - HTTPResponse *http.Response -} - -// Status returns HTTPResponse.Status -func (r EngineApiEngineServiceCleanResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r EngineApiEngineServiceCleanResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type EngineApiEngineServiceCreateEnclaveResponse struct { - Body []byte - HTTPResponse *http.Response -} - -// Status returns HTTPResponse.Status -func (r EngineApiEngineServiceCreateEnclaveResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r EngineApiEngineServiceCreateEnclaveResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type EngineApiEngineServiceDestroyEnclaveResponse struct { - Body []byte - HTTPResponse *http.Response -} - -// Status returns HTTPResponse.Status -func (r EngineApiEngineServiceDestroyEnclaveResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r EngineApiEngineServiceDestroyEnclaveResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type EngineApiEngineServiceGetEnclavesResponse struct { - Body []byte - HTTPResponse *http.Response -} - -// Status returns HTTPResponse.Status -func (r EngineApiEngineServiceGetEnclavesResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r EngineApiEngineServiceGetEnclavesResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type EngineApiEngineServiceGetEngineInfoResponse struct { - Body []byte - HTTPResponse *http.Response -} - -// Status returns HTTPResponse.Status -func (r EngineApiEngineServiceGetEngineInfoResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r EngineApiEngineServiceGetEngineInfoResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersResponse struct { - Body []byte - HTTPResponse *http.Response -} - -// Status returns HTTPResponse.Status -func (r EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type EngineApiEngineServiceGetServiceLogsResponse struct { - Body []byte - HTTPResponse *http.Response -} - -// Status returns HTTPResponse.Status -func (r EngineApiEngineServiceGetServiceLogsResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r EngineApiEngineServiceGetServiceLogsResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type EngineApiEngineServiceStopEnclaveResponse struct { - Body []byte - HTTPResponse *http.Response -} - -// Status returns HTTPResponse.Status -func (r EngineApiEngineServiceStopEnclaveResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r EngineApiEngineServiceStopEnclaveResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -// EngineApiEngineServiceCleanWithBodyWithResponse request with arbitrary body returning *EngineApiEngineServiceCleanResponse -func (c *ClientWithResponses) EngineApiEngineServiceCleanWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceCleanResponse, error) { - rsp, err := c.EngineApiEngineServiceCleanWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseEngineApiEngineServiceCleanResponse(rsp) -} - -func (c *ClientWithResponses) EngineApiEngineServiceCleanWithResponse(ctx context.Context, body EngineApiEngineServiceCleanJSONRequestBody, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceCleanResponse, error) { - rsp, err := c.EngineApiEngineServiceClean(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseEngineApiEngineServiceCleanResponse(rsp) -} - -// EngineApiEngineServiceCreateEnclaveWithBodyWithResponse request with arbitrary body returning *EngineApiEngineServiceCreateEnclaveResponse -func (c *ClientWithResponses) EngineApiEngineServiceCreateEnclaveWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceCreateEnclaveResponse, error) { - rsp, err := c.EngineApiEngineServiceCreateEnclaveWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseEngineApiEngineServiceCreateEnclaveResponse(rsp) -} - -func (c *ClientWithResponses) EngineApiEngineServiceCreateEnclaveWithResponse(ctx context.Context, body EngineApiEngineServiceCreateEnclaveJSONRequestBody, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceCreateEnclaveResponse, error) { - rsp, err := c.EngineApiEngineServiceCreateEnclave(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseEngineApiEngineServiceCreateEnclaveResponse(rsp) -} - -// EngineApiEngineServiceDestroyEnclaveWithBodyWithResponse request with arbitrary body returning *EngineApiEngineServiceDestroyEnclaveResponse -func (c *ClientWithResponses) EngineApiEngineServiceDestroyEnclaveWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceDestroyEnclaveResponse, error) { - rsp, err := c.EngineApiEngineServiceDestroyEnclaveWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseEngineApiEngineServiceDestroyEnclaveResponse(rsp) -} - -func (c *ClientWithResponses) EngineApiEngineServiceDestroyEnclaveWithResponse(ctx context.Context, body EngineApiEngineServiceDestroyEnclaveJSONRequestBody, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceDestroyEnclaveResponse, error) { - rsp, err := c.EngineApiEngineServiceDestroyEnclave(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseEngineApiEngineServiceDestroyEnclaveResponse(rsp) -} - -// EngineApiEngineServiceGetEnclavesWithBodyWithResponse request with arbitrary body returning *EngineApiEngineServiceGetEnclavesResponse -func (c *ClientWithResponses) EngineApiEngineServiceGetEnclavesWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceGetEnclavesResponse, error) { - rsp, err := c.EngineApiEngineServiceGetEnclavesWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseEngineApiEngineServiceGetEnclavesResponse(rsp) -} - -func (c *ClientWithResponses) EngineApiEngineServiceGetEnclavesWithResponse(ctx context.Context, body EngineApiEngineServiceGetEnclavesJSONRequestBody, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceGetEnclavesResponse, error) { - rsp, err := c.EngineApiEngineServiceGetEnclaves(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseEngineApiEngineServiceGetEnclavesResponse(rsp) -} - -// EngineApiEngineServiceGetEngineInfoWithBodyWithResponse request with arbitrary body returning *EngineApiEngineServiceGetEngineInfoResponse -func (c *ClientWithResponses) EngineApiEngineServiceGetEngineInfoWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceGetEngineInfoResponse, error) { - rsp, err := c.EngineApiEngineServiceGetEngineInfoWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseEngineApiEngineServiceGetEngineInfoResponse(rsp) -} - -func (c *ClientWithResponses) EngineApiEngineServiceGetEngineInfoWithResponse(ctx context.Context, body EngineApiEngineServiceGetEngineInfoJSONRequestBody, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceGetEngineInfoResponse, error) { - rsp, err := c.EngineApiEngineServiceGetEngineInfo(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseEngineApiEngineServiceGetEngineInfoResponse(rsp) -} - -// EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersWithBodyWithResponse request with arbitrary body returning *EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersResponse -func (c *ClientWithResponses) EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersResponse, error) { - rsp, err := c.EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseEngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersResponse(rsp) -} - -func (c *ClientWithResponses) EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersWithResponse(ctx context.Context, body EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersJSONRequestBody, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersResponse, error) { - rsp, err := c.EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiers(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseEngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersResponse(rsp) -} - -// EngineApiEngineServiceGetServiceLogsWithBodyWithResponse request with arbitrary body returning *EngineApiEngineServiceGetServiceLogsResponse -func (c *ClientWithResponses) EngineApiEngineServiceGetServiceLogsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceGetServiceLogsResponse, error) { - rsp, err := c.EngineApiEngineServiceGetServiceLogsWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseEngineApiEngineServiceGetServiceLogsResponse(rsp) -} - -func (c *ClientWithResponses) EngineApiEngineServiceGetServiceLogsWithResponse(ctx context.Context, body EngineApiEngineServiceGetServiceLogsJSONRequestBody, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceGetServiceLogsResponse, error) { - rsp, err := c.EngineApiEngineServiceGetServiceLogs(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseEngineApiEngineServiceGetServiceLogsResponse(rsp) -} - -// EngineApiEngineServiceStopEnclaveWithBodyWithResponse request with arbitrary body returning *EngineApiEngineServiceStopEnclaveResponse -func (c *ClientWithResponses) EngineApiEngineServiceStopEnclaveWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceStopEnclaveResponse, error) { - rsp, err := c.EngineApiEngineServiceStopEnclaveWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseEngineApiEngineServiceStopEnclaveResponse(rsp) -} - -func (c *ClientWithResponses) EngineApiEngineServiceStopEnclaveWithResponse(ctx context.Context, body EngineApiEngineServiceStopEnclaveJSONRequestBody, reqEditors ...RequestEditorFn) (*EngineApiEngineServiceStopEnclaveResponse, error) { - rsp, err := c.EngineApiEngineServiceStopEnclave(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseEngineApiEngineServiceStopEnclaveResponse(rsp) -} - -// ParseEngineApiEngineServiceCleanResponse parses an HTTP response from a EngineApiEngineServiceCleanWithResponse call -func ParseEngineApiEngineServiceCleanResponse(rsp *http.Response) (*EngineApiEngineServiceCleanResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &EngineApiEngineServiceCleanResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - return response, nil -} - -// ParseEngineApiEngineServiceCreateEnclaveResponse parses an HTTP response from a EngineApiEngineServiceCreateEnclaveWithResponse call -func ParseEngineApiEngineServiceCreateEnclaveResponse(rsp *http.Response) (*EngineApiEngineServiceCreateEnclaveResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &EngineApiEngineServiceCreateEnclaveResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - return response, nil -} - -// ParseEngineApiEngineServiceDestroyEnclaveResponse parses an HTTP response from a EngineApiEngineServiceDestroyEnclaveWithResponse call -func ParseEngineApiEngineServiceDestroyEnclaveResponse(rsp *http.Response) (*EngineApiEngineServiceDestroyEnclaveResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &EngineApiEngineServiceDestroyEnclaveResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - return response, nil -} - -// ParseEngineApiEngineServiceGetEnclavesResponse parses an HTTP response from a EngineApiEngineServiceGetEnclavesWithResponse call -func ParseEngineApiEngineServiceGetEnclavesResponse(rsp *http.Response) (*EngineApiEngineServiceGetEnclavesResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &EngineApiEngineServiceGetEnclavesResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - return response, nil -} - -// ParseEngineApiEngineServiceGetEngineInfoResponse parses an HTTP response from a EngineApiEngineServiceGetEngineInfoWithResponse call -func ParseEngineApiEngineServiceGetEngineInfoResponse(rsp *http.Response) (*EngineApiEngineServiceGetEngineInfoResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &EngineApiEngineServiceGetEngineInfoResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - return response, nil -} - -// ParseEngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersResponse parses an HTTP response from a EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersWithResponse call -func ParseEngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersResponse(rsp *http.Response) (*EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiersResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - return response, nil -} - -// ParseEngineApiEngineServiceGetServiceLogsResponse parses an HTTP response from a EngineApiEngineServiceGetServiceLogsWithResponse call -func ParseEngineApiEngineServiceGetServiceLogsResponse(rsp *http.Response) (*EngineApiEngineServiceGetServiceLogsResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &EngineApiEngineServiceGetServiceLogsResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - return response, nil -} - -// ParseEngineApiEngineServiceStopEnclaveResponse parses an HTTP response from a EngineApiEngineServiceStopEnclaveWithResponse call -func ParseEngineApiEngineServiceStopEnclaveResponse(rsp *http.Response) (*EngineApiEngineServiceStopEnclaveResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &EngineApiEngineServiceStopEnclaveResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - return response, nil -} - -// ServerInterface represents all server handlers. -type ServerInterface interface { - - // (POST /engine_api.EngineService/Clean) - EngineApiEngineServiceClean(ctx echo.Context) error - - // (POST /engine_api.EngineService/CreateEnclave) - EngineApiEngineServiceCreateEnclave(ctx echo.Context) error - - // (POST /engine_api.EngineService/DestroyEnclave) - EngineApiEngineServiceDestroyEnclave(ctx echo.Context) error - - // (POST /engine_api.EngineService/GetEnclaves) - EngineApiEngineServiceGetEnclaves(ctx echo.Context) error - - // (POST /engine_api.EngineService/GetEngineInfo) - EngineApiEngineServiceGetEngineInfo(ctx echo.Context) error - - // (POST /engine_api.EngineService/GetExistingAndHistoricalEnclaveIdentifiers) - EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiers(ctx echo.Context) error - - // (POST /engine_api.EngineService/GetServiceLogs) - EngineApiEngineServiceGetServiceLogs(ctx echo.Context) error - - // (POST /engine_api.EngineService/StopEnclave) - EngineApiEngineServiceStopEnclave(ctx echo.Context) error -} - -// ServerInterfaceWrapper converts echo contexts to parameters. -type ServerInterfaceWrapper struct { - Handler ServerInterface -} - -// EngineApiEngineServiceClean converts echo context to params. -func (w *ServerInterfaceWrapper) EngineApiEngineServiceClean(ctx echo.Context) error { - var err error - - // Invoke the callback with all the unmarshaled arguments - err = w.Handler.EngineApiEngineServiceClean(ctx) - return err -} - -// EngineApiEngineServiceCreateEnclave converts echo context to params. -func (w *ServerInterfaceWrapper) EngineApiEngineServiceCreateEnclave(ctx echo.Context) error { - var err error - - // Invoke the callback with all the unmarshaled arguments - err = w.Handler.EngineApiEngineServiceCreateEnclave(ctx) - return err -} - -// EngineApiEngineServiceDestroyEnclave converts echo context to params. -func (w *ServerInterfaceWrapper) EngineApiEngineServiceDestroyEnclave(ctx echo.Context) error { - var err error - - // Invoke the callback with all the unmarshaled arguments - err = w.Handler.EngineApiEngineServiceDestroyEnclave(ctx) - return err -} - -// EngineApiEngineServiceGetEnclaves converts echo context to params. -func (w *ServerInterfaceWrapper) EngineApiEngineServiceGetEnclaves(ctx echo.Context) error { - var err error - - // Invoke the callback with all the unmarshaled arguments - err = w.Handler.EngineApiEngineServiceGetEnclaves(ctx) - return err -} - -// EngineApiEngineServiceGetEngineInfo converts echo context to params. -func (w *ServerInterfaceWrapper) EngineApiEngineServiceGetEngineInfo(ctx echo.Context) error { - var err error - - // Invoke the callback with all the unmarshaled arguments - err = w.Handler.EngineApiEngineServiceGetEngineInfo(ctx) - return err -} - -// EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiers converts echo context to params. -func (w *ServerInterfaceWrapper) EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiers(ctx echo.Context) error { - var err error - - // Invoke the callback with all the unmarshaled arguments - err = w.Handler.EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiers(ctx) - return err -} - -// EngineApiEngineServiceGetServiceLogs converts echo context to params. -func (w *ServerInterfaceWrapper) EngineApiEngineServiceGetServiceLogs(ctx echo.Context) error { - var err error - - // Invoke the callback with all the unmarshaled arguments - err = w.Handler.EngineApiEngineServiceGetServiceLogs(ctx) - return err -} - -// EngineApiEngineServiceStopEnclave converts echo context to params. -func (w *ServerInterfaceWrapper) EngineApiEngineServiceStopEnclave(ctx echo.Context) error { - var err error - - // Invoke the callback with all the unmarshaled arguments - err = w.Handler.EngineApiEngineServiceStopEnclave(ctx) - return err -} - -// This is a simple interface which specifies echo.Route addition functions which -// are present on both echo.Echo and echo.Group, since we want to allow using -// either of them for path registration -type EchoRouter interface { - CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route - DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route - GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route - HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route - OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route - PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route - POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route - PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route - TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route -} - -// RegisterHandlers adds each server route to the EchoRouter. -func RegisterHandlers(router EchoRouter, si ServerInterface) { - RegisterHandlersWithBaseURL(router, si, "") -} - -// Registers handlers, and prepends BaseURL to the paths, so that the paths -// can be served under a prefix. -func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string) { - - wrapper := ServerInterfaceWrapper{ - Handler: si, - } - - router.POST(baseURL+"/engine_api.EngineService/Clean", wrapper.EngineApiEngineServiceClean) - router.POST(baseURL+"/engine_api.EngineService/CreateEnclave", wrapper.EngineApiEngineServiceCreateEnclave) - router.POST(baseURL+"/engine_api.EngineService/DestroyEnclave", wrapper.EngineApiEngineServiceDestroyEnclave) - router.POST(baseURL+"/engine_api.EngineService/GetEnclaves", wrapper.EngineApiEngineServiceGetEnclaves) - router.POST(baseURL+"/engine_api.EngineService/GetEngineInfo", wrapper.EngineApiEngineServiceGetEngineInfo) - router.POST(baseURL+"/engine_api.EngineService/GetExistingAndHistoricalEnclaveIdentifiers", wrapper.EngineApiEngineServiceGetExistingAndHistoricalEnclaveIdentifiers) - router.POST(baseURL+"/engine_api.EngineService/GetServiceLogs", wrapper.EngineApiEngineServiceGetServiceLogs) - router.POST(baseURL+"/engine_api.EngineService/StopEnclave", wrapper.EngineApiEngineServiceStopEnclave) - -} - -// Base64 encoded, gzipped, json marshaled Swagger object -var swaggerSpec = []string{ - - "H4sIAAAAAAAC/+xaX2/jNhL/KgPdAbtbqEm6e+hDgD7kNr7UuMYONs5dD3Uh0NJYYpcmdSQV1yjy3Q9D", - "UbJkyX93s7lebx8WjjgcDmd+M5wZ8rcgVotcSZTWBJe/BRr/XaCxf1UJR/chVSoVeJZrZdWsmJ8NFrld", - "0UCspEVp6SfLc8FjZrmS578YJembiTNcMPr1Z43z4DL40/l6pfNy1Jz3c396egqdJFxjElxaXSB98ZOI", - "J8qUS4xYzs/eC2TySqfue4Im1jwnSYLL4Ltn/TeV7zUyizCQsWCPOJXPu14QBrlWOWrrTWMyVYgkikkB", - "EROiq4DhHEh5IQwtLLkQ4GgBH1GCzRB0ISWXKWC5AxOEgV3lGFwGM6WINCC9+09q9gvGNngKO9r/gCZX", - "0iAJ0BZR40I9YhL5BSLJFhgxmURFwZMei3n6SiAgemAygZI+DLjFhdmHqoZ83jYjtsArmTwUPAnWO2Ja", - "s9X+LTore0Z/SKCxnEfk7oxL1JFQaSTwEXvwNskQru6GUBODUCmUxLWSjdVcpqTkNt9H1IYrGVmW9nP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q", - "fbwKx9VMEgB/tVHOrEUtj88rNxn2ZtAbRNH1eHAfvR+PJlfDUTQZ/Fil1710o/Fkk/btPp63V5P330cf", - "BjeDH2Eq3x3CujmlkdvvFT0Ig4PE3kbXs/4hLJvke6qNe6vyF70OJQH+AHehxqr8sNx86zOovZTrWr+n", - "YJTK/TjgcC+Ttw71t3/poe5ugD5VJaLlVtCYx5uP7EEY1KVN8A2tqHKULOfBZfDu7OLsgszEbOYkaBcJ", - "9NMfwefuPZDbqTK2a7YbtAZ02QFQImk+PCpDI1dymLjuGnG9ynmLfck9bLxS+3xP0XqflDnF/Y+/9dl4", - "aEcfyhzKmfrtxcWGir86/+p0rdb5WY9m6dtTuAtczScr20H23BbyAsAtkyzFBUr73FaqUGFcd7n36dBB", - "7tPS3/O7Uefh3P/d6TO6U+/7rVPcqv3+artfeToDTK5vzeoLOiommbZ8zuLylYeKuatdltxmwO2BGN0Q", - "5tlB2vP47AVQ+uWfnz0rTHc86z4Sm40m+HZgfnDtDNO6L2MzVfj3m76Remyy0Vy6A8O+3bfezm/TwbPF", - "g77rgpM1njae9PXrfCCTXHFpXRWeorXl44BeAzh2jWtPJoyCZdkNKd/fKnhEzeerzqvb8sVDrBa4frpy", - "jP3qjfxeLNi5aDnVhoddH5ziVBTpa6eaFhcXb7+FrF7jFDc7UNbfiQ2PvLg50cCNpufOeqvuA/qO9YE2", - "abJ/9kO455boBQ7hl7on+lIZ45ZO+Sn4azSotoOPiIyLFq1HaY308UA4Nld7dixu9t5eAIhfuPv2X5QK", - "Pj39JwAA//9424DrkTgAAA==", -} - -// GetSwagger returns the content of the embedded swagger specification file -// or error if failed to decode -func decodeSpec() ([]byte, error) { - zipped, err := base64.StdEncoding.DecodeString(strings.Join(swaggerSpec, "")) - if err != nil { - return nil, fmt.Errorf("error base64 decoding spec: %w", err) - } - zr, err := gzip.NewReader(bytes.NewReader(zipped)) - if err != nil { - return nil, fmt.Errorf("error decompressing spec: %w", err) - } - var buf bytes.Buffer - _, err = buf.ReadFrom(zr) - if err != nil { - return nil, fmt.Errorf("error decompressing spec: %w", err) - } - - return buf.Bytes(), nil -} - -var rawSpec = decodeSpecCached() - -// a naive cached of a decoded swagger spec -func decodeSpecCached() func() ([]byte, error) { - data, err := decodeSpec() - return func() ([]byte, error) { - return data, err - } -} - -// Constructs a synthetic filesystem for resolving external references when loading openapi specifications. -func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error) { - res := make(map[string]func() ([]byte, error)) - if len(pathToFile) > 0 { - res[pathToFile] = rawSpec - } - - return res -} - -// GetSwagger returns the Swagger specification corresponding to the generated code -// in this file. The external references of Swagger specification are resolved. -// The logic of resolving external references is tightly connected to "import-mapping" feature. -// Externally referenced files must be embedded in the corresponding golang packages. -// Urls can be supported but this task was out of the scope. -func GetSwagger() (swagger *openapi3.T, err error) { - resolvePath := PathToRawSpec("") - - loader := openapi3.NewLoader() - loader.IsExternalRefsAllowed = true - loader.ReadFromURIFunc = func(loader *openapi3.Loader, url *url.URL) ([]byte, error) { - pathToFile := url.String() - pathToFile = path.Clean(pathToFile) - getSpec, ok := resolvePath[pathToFile] - if !ok { - err1 := fmt.Errorf("path not found: %s", pathToFile) - return nil, err1 - } - return getSpec() - } - var specData []byte - specData, err = rawSpec() - if err != nil { - return - } - swagger, err = loader.LoadFromData(specData) - if err != nil { - return - } - return -} diff --git a/api/golang/engine/kurtosis_engine_http_api_bindings/engine_types.gen.go b/api/golang/engine/kurtosis_engine_http_api_bindings/engine_types.gen.go new file mode 100644 index 0000000000..cf562c40ca --- /dev/null +++ b/api/golang/engine/kurtosis_engine_http_api_bindings/engine_types.gen.go @@ -0,0 +1,141 @@ +// Package kurtosis_engine_http_api_bindings provides primitives to interact with the openapi HTTP API. +// +// Code generated by github.com/deepmap/oapi-codegen version (devel) DO NOT EDIT. +package kurtosis_engine_http_api_bindings + +import ( + "time" +) + +// Defines values for CreateEnclaveArgsMode. +const ( + CreateEnclaveArgsModePRODUCTION CreateEnclaveArgsMode = "PRODUCTION" + CreateEnclaveArgsModeTEST CreateEnclaveArgsMode = "TEST" +) + +// Defines values for EnclaveInfoMode. +const ( + EnclaveInfoModePRODUCTION EnclaveInfoMode = "PRODUCTION" + EnclaveInfoModeTEST EnclaveInfoMode = "TEST" +) + +// CleanResponse defines model for CleanResponse. +type CleanResponse struct { + RemovedEnclaveNameAndUuids *[]EnclaveNameAndUuid `json:"removed_enclave_name_and_uuids,omitempty"` +} + +// CreateEnclaveArgs defines model for CreateEnclaveArgs. +type CreateEnclaveArgs struct { + ApiContainerLogLevel *string `json:"api_container_log_level,omitempty"` + ApiContainerVersionTag *string `json:"api_container_version_tag,omitempty"` + EnclaveName *string `json:"enclave_name,omitempty"` + Mode *CreateEnclaveArgsMode `json:"mode,omitempty"` +} + +// CreateEnclaveArgsMode defines model for CreateEnclaveArgs.Mode. +type CreateEnclaveArgsMode string + +// CreateEnclaveResponse defines model for CreateEnclaveResponse. +type CreateEnclaveResponse struct { + EnclaveInfo *EnclaveInfo `json:"enclave_info,omitempty"` +} + +// EnclaveAPIContainerHostMachineInfo defines model for EnclaveAPIContainerHostMachineInfo. +type EnclaveAPIContainerHostMachineInfo struct { + GrpcPortOnHostMachine *int `json:"grpc_port_on_host_machine,omitempty"` + IpOnHostMachine *string `json:"ip_on_host_machine,omitempty"` +} + +// EnclaveAPIContainerInfo defines model for EnclaveAPIContainerInfo. +type EnclaveAPIContainerInfo struct { + BridgeIpAddress *string `json:"bridge_ip_address,omitempty"` + ContainerId *string `json:"container_id,omitempty"` + GrpcPortInsideEnclave *int `json:"grpc_port_inside_enclave,omitempty"` + IpInsideEnclave *string `json:"ip_inside_enclave,omitempty"` +} + +// EnclaveIdentifiers defines model for EnclaveIdentifiers. +type EnclaveIdentifiers struct { + EnclaveUuid *string `json:"enclave_uuid,omitempty"` + Name *string `json:"name,omitempty"` + ShortenedUuid *string `json:"shortened_uuid,omitempty"` +} + +// EnclaveInfo defines model for EnclaveInfo. +type EnclaveInfo struct { + ApiContainerHostMachineInfo *EnclaveAPIContainerHostMachineInfo `json:"api_container_host_machine_info,omitempty"` + ApiContainerInfo *EnclaveAPIContainerInfo `json:"api_container_info,omitempty"` + ApiContainerStatus *int `json:"api_container_status,omitempty"` + ContainersStatus *int `json:"containers_status,omitempty"` + CreationTime *Timestamp `json:"creation_time,omitempty"` + EnclaveUuid *string `json:"enclave_uuid,omitempty"` + Mode *EnclaveInfoMode `json:"mode,omitempty"` + Name *string `json:"name,omitempty"` + ShortenedUuid *string `json:"shortened_uuid,omitempty"` +} + +// EnclaveInfoMode defines model for EnclaveInfo.Mode. +type EnclaveInfoMode string + +// EnclaveNameAndUuid defines model for EnclaveNameAndUuid. +type EnclaveNameAndUuid struct { + Name *string `json:"name,omitempty"` + Uuid *string `json:"uuid,omitempty"` +} + +// GetEnclavesResponse defines model for GetEnclavesResponse. +type GetEnclavesResponse struct { + EnclaveInfo *map[string]EnclaveInfo `json:"enclave_info,omitempty"` +} + +// GetEngineInfoResponse defines model for GetEngineInfoResponse. +type GetEngineInfoResponse struct { + EngineVersion *string `json:"engine_version,omitempty"` +} + +// GetExistingAndHistoricalEnclaveIdentifiersResponse defines model for GetExistingAndHistoricalEnclaveIdentifiersResponse. +type GetExistingAndHistoricalEnclaveIdentifiersResponse struct { + AllIdentifiers *[]EnclaveIdentifiers `json:"allIdentifiers,omitempty"` +} + +// GetServiceLogsArgs defines model for GetServiceLogsArgs. +type GetServiceLogsArgs struct { + ConjunctiveFilters *[]LogLineFilter `json:"conjunctive_filters,omitempty"` + FollowLogs *bool `json:"follow_logs,omitempty"` + NumLogLines *int `json:"num_log_lines,omitempty"` + ReturnAllLogs *bool `json:"return_all_logs,omitempty"` + ServiceUuidSet *map[string]bool `json:"service_uuid_set,omitempty"` +} + +// GetServiceLogsResponse defines model for GetServiceLogsResponse. +type GetServiceLogsResponse struct { + NotFoundServiceUuidSet *map[string]bool `json:"not_found_service_uuid_set,omitempty"` + ServiceLogsByServiceUuid *map[string]LogLine `json:"service_logs_by_service_uuid,omitempty"` +} + +// LogLine defines model for LogLine. +type LogLine struct { + Line *[]string `json:"line,omitempty"` + Timestamp *Timestamp `json:"timestamp,omitempty"` +} + +// LogLineFilter defines model for LogLineFilter. +type LogLineFilter struct { + Operator *int `json:"operator,omitempty"` + TextPattern *string `json:"text_pattern,omitempty"` +} + +// Timestamp defines model for Timestamp. +type Timestamp = time.Time + +// DeleteEnclavesParams defines parameters for DeleteEnclaves. +type DeleteEnclavesParams struct { + // RemoveAll If true, remove all enclaves. Default is false + RemoveAll *bool `form:"remove_all,omitempty" json:"remove_all,omitempty"` +} + +// PostEnclavesJSONRequestBody defines body for PostEnclaves for application/json ContentType. +type PostEnclavesJSONRequestBody = CreateEnclaveArgs + +// PostEnclavesEnclaveIdentifierLogsJSONRequestBody defines body for PostEnclavesEnclaveIdentifierLogs for application/json ContentType. +type PostEnclavesEnclaveIdentifierLogsJSONRequestBody = GetServiceLogsArgs diff --git a/api/openapi/core/api_container_service.yaml b/api/openapi/core/api_container_service.yaml index 7729f979b3..1d77a681a5 100644 --- a/api/openapi/core/api_container_service.yaml +++ b/api/openapi/core/api_container_service.yaml @@ -1,9 +1,10 @@ openapi: 3.0.0 info: - title: api_container_service + title: Enclave API description: "" version: "1" paths: + /starlark: get: description: Get last Starlark run @@ -11,22 +12,20 @@ paths: "200": description: "" content: - "*/*": + application/json: schema: $ref: "#/components/schemas/GetStarlarkRunResponse" - /starlark/package: + + /starlark/packages: put: description: Uploads a Starlark package. This step is required before the package can be executed with RunStarlarkPackage requestBody: $ref: "#/components/requestBodies/StreamedDataBody" responses: "200": - description: "" - content: - "*/*": - schema: - $ref: "#/components/schemas/google.protobuf.Empty" - /starlark/package/{package_id}: + $ref: "#/components/responses/Success" + + /starlark/packages/{package_id}: post: description: Executes a Starlark script on the user's behalf requestBody: @@ -46,10 +45,11 @@ paths: "200": description: "" content: - "*/*": + application/json: schema: $ref: "#/components/schemas/StarlarkRunResponseLine" - /starlark/script: + + /starlark/scripts: post: description: Executes a Starlark script on the user's behalf requestBody: @@ -62,20 +62,22 @@ paths: "200": description: "" content: - "*/*": + application/json: schema: $ref: "#/components/schemas/StarlarkRunResponseLine" - /service: + + /services: get: description: Returns information about all existing & historical services responses: "200": description: "" content: - "*/*": + application/json: schema: $ref: "#/components/schemas/GetExistingAndHistoricalServiceIdentifiersResponse" - /service/{service_identifier}: + + /services/{service_identifier}: get: parameters: - in: path @@ -93,10 +95,11 @@ paths: "200": description: "" content: - "*/*": + application/json: schema: $ref: "#/components/schemas/GetServicesResponse" - /service/{service_identifier}/command: + + /services/{service_identifier}/command: post: description: Executes the given command inside a running container requestBody: @@ -117,10 +120,11 @@ paths: "200": description: "" content: - "*/*": + application/json: schema: $ref: "#/components/schemas/ExecCommandResponse" - /service/{service_identifier}/endpoint/{port_number}/availability: + + /services/{service_identifier}/endpoints/{port_number}/availability: post: description: Block until the given HTTP endpoint returns available, calling it through a HTTP Get request requestBody: @@ -145,21 +149,19 @@ paths: required: true responses: "200": - description: "" - content: - "*/*": - schema: - $ref: "#/components/schemas/google.protobuf.Empty" - /artifact: + $ref: "#/components/responses/Success" + + /artifacts: get: responses: "200": description: "" content: - "*/*": + application/json: schema: $ref: "#/components/schemas/ListFilesArtifactNamesAndUuidsResponse" - /artifact/{artifact_identifier}: + + /artifacts/{artifact_identifier}: get: description: "" parameters: @@ -173,17 +175,18 @@ paths: "200": description: "" content: - "*/*": + application/json: schema: $ref: "#/components/schemas/InspectFilesArtifactContentsResponse" - /artifact/{artifact_identifier}/download: + + /artifacts/{artifact_identifier}/download: get: description: Downloads a files artifact from the Kurtosis File System responses: "200": description: "" content: - "*/*": + application/json: schema: $ref: "#/components/schemas/StreamedDataChunk" parameters: @@ -193,7 +196,8 @@ paths: type: string required: true description: Numeric ID of the user to get - /artifact/local-file: + + /artifacts/local-file: put: description: Uploads a files artifact to the Kurtosis File System requestBody: @@ -202,10 +206,11 @@ paths: "200": description: "" content: - "*/*": + application/json: schema: $ref: "#/components/schemas/UploadFilesArtifactResponse" - /artifact/remote-file: + + /artifacts/remote-file: put: description: Tells the API container to download a files artifact from the web to the Kurtosis File System requestBody: @@ -219,10 +224,11 @@ paths: "200": description: "" content: - "*/*": + application/json: schema: $ref: "#/components/schemas/StoreWebFilesArtifactResponse" - /artifact/service/{service_identifier}: + + /artifacts/services/{service_identifier}: put: description: Tells the API container to copy a files artifact from a service to the Kurtosis File System requestBody: @@ -242,10 +248,11 @@ paths: "200": description: "" content: - "*/*": + application/json: schema: $ref: "#/components/schemas/StoreFilesArtifactFromServiceResponse" - /service/connection: + + /services/connection: post: description: User services port forwarding requestBody: @@ -258,11 +265,13 @@ paths: "200": description: "" content: - "*/*": + application/json: schema: $ref: "#/components/schemas/ConnectServicesResponse" components: + requestBodies: + StreamedDataBody: content: application/json: @@ -270,13 +279,18 @@ components: $ref: "#/components/schemas/StreamedDataChunk" description: Streamed Data Chunk required: true - google.protobuf.Empty: + + responses: + + Success: content: - application/json: + "*/*": schema: - $ref: "#/components/schemas/google.protobuf.Empty" - required: true + type: string + description: Success + schemas: + Port: type: object properties: @@ -291,6 +305,7 @@ components: type: string description: The wait timeout duration in string description: Shared Objects (Used By Multiple Endpoints) + Container: type: object properties: @@ -310,6 +325,7 @@ components: type: object additionalProperties: type: string + ServiceStatus: type: string enum: @@ -320,6 +336,7 @@ components: 0 - STOPPED 1 - RUNNING 2 - UNKNOWN + ImageDownloadMode: type: string enum: @@ -328,6 +345,7 @@ components: description: |- 0 - always 1 - missing + ServiceInfo: type: object properties: @@ -356,6 +374,7 @@ components: $ref: "#/components/schemas/ServiceStatus" container: $ref: "#/components/schemas/Container" + Connect: type: string enum: @@ -364,6 +383,7 @@ components: description: |- 0 - CONNECT // Best effort port forwarding 1 - NO_CONNECT // Port forwarding disabled + RunStarlarkScriptArgs: type: object properties: @@ -393,6 +413,7 @@ components: description: Defaults to empty image_download_mode: $ref: "#/components/schemas/ImageDownloadMode" + RunStarlarkPackageArgs: type: object properties: @@ -442,11 +463,13 @@ components: description: Defaults to empty image_download_mode: $ref: "#/components/schemas/ImageDownloadMode" + KurtosisFeatureFlag: type: string enum: - NO_INSTRUCTIONS_CACHING description: "0 - NO_INSTRUCTIONS_CACHING " + StarlarkRunResponseLine: type: object properties: @@ -465,19 +488,20 @@ components: info: $ref: "#/components/schemas/StarlarkInfo" description: |- - ============================================================================================== Starlark Execution Response - ============================================================================================== + StarlarkInfo: type: object properties: info_message: type: string + StarlarkWarning: type: object properties: warning_message: type: string + StarlarkInstruction: type: object properties: @@ -493,11 +517,13 @@ components: type: string is_skipped: type: boolean + StarlarkInstructionResult: type: object properties: serialized_instruction_result: type: string + StarlarkInstructionArg: type: object properties: @@ -507,6 +533,7 @@ components: type: string is_representative: type: boolean + StarlarkInstructionPosition: type: object properties: @@ -518,6 +545,7 @@ components: column: type: integer format: int32 + StarlarkError: type: object properties: @@ -527,21 +555,25 @@ components: $ref: "#/components/schemas/StarlarkValidationError" execution_error: $ref: "#/components/schemas/StarlarkExecutionError" + StarlarkInterpretationError: type: object properties: error_message: type: string + StarlarkValidationError: type: object properties: error_message: type: string + StarlarkExecutionError: type: object properties: error_message: type: string + StarlarkRunProgress: type: object properties: @@ -555,6 +587,7 @@ components: current_step_number: type: integer format: int32 + StarlarkRunFinishedEvent: type: object properties: @@ -562,11 +595,13 @@ components: type: boolean serialized_output: type: string + GetServicesResponse: type: object properties: service_info: $ref: "#/components/schemas/ServiceInfo" + ServiceIdentifiers: type: object properties: @@ -580,6 +615,7 @@ components: type: string description: The shortened uuid of the service description: An service identifier is a collection of uuid, name and shortened uuid + GetExistingAndHistoricalServiceIdentifiersResponse: type: object properties: @@ -587,6 +623,7 @@ components: type: array items: $ref: "#/components/schemas/ServiceIdentifiers" + ExecCommandArgs: type: object properties: @@ -595,9 +632,8 @@ components: items: type: string description: |- - ============================================================================================== Exec Command - ============================================================================================== + ExecCommandResponse: type: object properties: @@ -607,6 +643,7 @@ components: log_output: type: string description: Assumes UTF-8 encoding + WaitForEndpointAvailabilityArgs: type: object properties: @@ -632,6 +669,7 @@ components: type: string description: If the endpoint returns this value, the service will be marked as available (e.g. Hello World). description: Wait For HTTP Endpoint Availability + StreamedDataChunk: type: object properties: @@ -648,14 +686,14 @@ components: metadata: $ref: "#/components/schemas/DataChunkMetadata" description: |- - ============================================================================================== Streamed Data Chunk - ============================================================================================== + DataChunkMetadata: type: object properties: name: type: string + UploadFilesArtifactResponse: type: object properties: @@ -666,9 +704,8 @@ components: type: string description: UUID of the files artifact, for use when referencing it in the future description: |- - ============================================================================================== Upload Files Artifact - ============================================================================================== + DownloadFilesArtifactArgs: type: object properties: @@ -676,9 +713,8 @@ components: type: string description: Files identifier to get bytes for description: |- - ============================================================================================== Download Files Artifact - ============================================================================================== + StoreWebFilesArtifactArgs: type: object properties: @@ -689,15 +725,15 @@ components: type: string description: The name of the files artifact description: |- - ============================================================================================== Store Web Files Artifact - ============================================================================================== + StoreWebFilesArtifactResponse: type: object properties: uuid: type: string description: UUID of the files artifact, for use when referencing it in the future + StoreFilesArtifactFromServiceArgs: type: object properties: @@ -707,12 +743,14 @@ components: name: type: string description: The name of the files artifact + StoreFilesArtifactFromServiceResponse: type: object properties: uuid: type: string description: UUID of the files artifact, for use when referencing it in the future + FilesArtifactNameAndUuid: type: object properties: @@ -722,6 +760,7 @@ components: fileUuid: type: string description: A string representing the uuid of the file + ListFilesArtifactNamesAndUuidsResponse: type: object properties: @@ -729,11 +768,13 @@ components: type: array items: $ref: "#/components/schemas/FilesArtifactNameAndUuid" + InspectFilesArtifactContentsRequest: type: object properties: file_names_and_uuid: $ref: "#/components/schemas/FilesArtifactNameAndUuid" + InspectFilesArtifactContentsResponse: type: object properties: @@ -741,6 +782,7 @@ components: type: array items: $ref: "#/components/schemas/FileArtifactContentsFileDescription" + FileArtifactContentsFileDescription: type: object properties: @@ -754,14 +796,17 @@ components: text_preview: type: string description: A bit of text content, if the file allows (similar to UNIX's 'head') + ConnectServicesArgs: type: object properties: connect: $ref: "#/components/schemas/Connect" + ConnectServicesResponse: type: object properties: {} + RestartPolicy: type: string enum: @@ -770,6 +815,7 @@ components: description: |- 0 - NEVER 1 - ALWAYS + GetStarlarkRunResponse: type: object properties: @@ -792,6 +838,7 @@ components: $ref: "#/components/schemas/KurtosisFeatureFlag" restart_policy: $ref: "#/components/schemas/RestartPolicy" + Port.TransportProtocol: type: string enum: @@ -802,6 +849,7 @@ components: 0 - TCP 1 - SCTP 2 - UDP + Container.Status: type: string enum: @@ -812,6 +860,3 @@ components: 0 - STOPPED 1 - RUNNING 2 - UNKNOWN - google.protobuf.Empty: - type: object - properties: {} diff --git a/api/openapi/core/server.cfg.yaml b/api/openapi/core/server.cfg.yaml new file mode 100644 index 0000000000..e78f91a6fa --- /dev/null +++ b/api/openapi/core/server.cfg.yaml @@ -0,0 +1,5 @@ +package: kurtosis_core_http_api_bindings +generate: + strict-server: true + embedded-spec: true +output: api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go \ No newline at end of file diff --git a/api/openapi/core/types.cfg.yaml b/api/openapi/core/types.cfg.yaml new file mode 100644 index 0000000000..efb73389d6 --- /dev/null +++ b/api/openapi/core/types.cfg.yaml @@ -0,0 +1,4 @@ +package: kurtosis_core_http_api_bindings +generate: + models: true +output: api/golang/core/kurtosis_core_http_api_bindings/api_container_types.gen.go \ No newline at end of file diff --git a/api/openapi/engine/engine_service.yaml b/api/openapi/engine/engine_service.yaml index fdd18ab722..4549ec9f16 100644 --- a/api/openapi/engine/engine_service.yaml +++ b/api/openapi/engine/engine_service.yaml @@ -1,432 +1,319 @@ openapi: 3.0.0 info: - title: engine_service - description: '' - version: '1' + title: Engine API + version: 1.0.0 paths: - /engine_api.EngineService/GetEngineInfo: - post: - operationId: engine_api.EngineService.GetEngineInfo - description: Endpoint for getting information about the engine, which is also what we use to verify that the engine has become available - requestBody: - $ref: '#/components/requestBodies/google.protobuf.Empty' + /engine/info: + get: + summary: Get Engine Info responses: '200': - description: '' + description: Successful response content: - '*/*': + application/json: schema: - $ref: '#/components/schemas/engine_api.GetEngineInfoResponse' - /engine_api.EngineService/CreateEnclave: + $ref: '#/components/schemas/GetEngineInfoResponse' + + /enclaves: + get: + summary: Get Enclaves + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/GetEnclavesResponse' + post: - operationId: engine_api.EngineService.CreateEnclave - description: |- - ============================================================================================== - Enclave Management - ============================================================================================== - Creates a new Kurtosis Enclave + summary: Create Enclave requestBody: + required: true content: application/json: schema: - $ref: '#/components/schemas/engine_api.CreateEnclaveArgs' - description: |- - ============================================================================================== - Create Enclave - ============================================================================================== - required: true + $ref: '#/components/schemas/CreateEnclaveArgs' responses: '200': - description: '' + description: Successful response content: - '*/*': + application/json: schema: - $ref: '#/components/schemas/engine_api.CreateEnclaveResponse' - /engine_api.EngineService/GetEnclaves: - post: - operationId: engine_api.EngineService.GetEnclaves - description: Returns information about the existing enclaves - requestBody: - $ref: '#/components/requestBodies/google.protobuf.Empty' + $ref: '#/components/schemas/CreateEnclaveResponse' + + delete: + summary: Delete Enclaves + parameters: + - name: remove_all + in: query + required: false + description: If true, remove all enclaves. Default is false + schema: + type: boolean responses: '200': - description: '' + description: Successful response content: - '*/*': + application/json: schema: - $ref: '#/components/schemas/engine_api.GetEnclavesResponse' - /engine_api.EngineService/GetExistingAndHistoricalEnclaveIdentifiers: - post: - operationId: engine_api.EngineService.GetExistingAndHistoricalEnclaveIdentifiers - description: Returns information about all existing & historical enclaves - requestBody: - $ref: '#/components/requestBodies/google.protobuf.Empty' + $ref: '#/components/schemas/CleanResponse' + + /enclaves/historical: + get: + summary: Get Historical Enclaves responses: '200': - description: '' + description: Successful response content: - '*/*': + application/json: schema: - $ref: '#/components/schemas/engine_api.GetExistingAndHistoricalEnclaveIdentifiersResponse' - /engine_api.EngineService/StopEnclave: - post: - operationId: engine_api.EngineService.StopEnclave - description: Stops all containers in an enclave - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/engine_api.StopEnclaveArgs' - description: |- - ============================================================================================== - Stop Enclave - ============================================================================================== - required: true + $ref: '#/components/schemas/GetExistingAndHistoricalEnclaveIdentifiersResponse' + + /enclaves/{enclave_identifier}: + get: + summary: Get Enclave Info + parameters: + - name: enclave_identifier + in: path + required: true + description: UUID, shortened UUID, or name of the enclave + schema: + type: string responses: '200': - description: '' + description: Successful response content: - '*/*': + application/json: schema: - $ref: '#/components/schemas/google.protobuf.Empty' - /engine_api.EngineService/DestroyEnclave: - post: - operationId: engine_api.EngineService.DestroyEnclave - description: Destroys an enclave, removing all artifacts associated with it - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/engine_api.DestroyEnclaveArgs' - description: |- - ============================================================================================== - Destroy Enclave - ============================================================================================== - required: true + $ref: '#/components/schemas/EnclaveInfo' + + + + delete: + summary: Destroy Enclave + parameters: + - name: enclave_identifier + in: path + required: true + description: UUID, shortened UUID, or name of the enclave + schema: + type: string responses: '200': - description: '' + description: Successful response content: - '*/*': + application/json: schema: - $ref: '#/components/schemas/google.protobuf.Empty' - /engine_api.EngineService/Clean: + type: object + + /enclaves/{enclave_identifier}/logs: post: - operationId: engine_api.EngineService.Clean - description: Gets rid of old enclaves + summary: Get Service Logs requestBody: + required: true content: application/json: schema: - $ref: '#/components/schemas/engine_api.CleanArgs' - description: |- - ============================================================================================== - Create Enclave - ============================================================================================== - required: true + $ref: '#/components/schemas/GetServiceLogsArgs' + parameters: + - name: enclave_identifier + in: path + required: true + description: UUID, shortened UUID, or name of the enclave + schema: + type: string responses: '200': - description: '' + description: Successful response content: - '*/*': + application/json: schema: - $ref: '#/components/schemas/engine_api.CleanResponse' - /engine_api.EngineService/GetServiceLogs: + $ref: '#/components/schemas/GetServiceLogsResponse' + + /enclaves/{enclave_identifier}/stop: post: - operationId: engine_api.EngineService.GetServiceLogs - description: Get service logs - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/engine_api.GetServiceLogsArgs' - description: |- - ============================================================================================== - Get User Service Logs - ============================================================================================== - required: true + summary: Stop Enclave + parameters: + - name: enclave_identifier + in: path + required: true + description: UUID, shortened UUID, or name of the enclave + schema: + type: string responses: '200': - description: '' + description: Successful response content: - '*/*': + application/json: schema: - $ref: '#/components/schemas/engine_api.GetServiceLogsResponse' + type: object + + + components: - requestBodies: - google.protobuf.Empty: - content: - application/json: - schema: - $ref: '#/components/schemas/google.protobuf.Empty' - required: true schemas: - engine_api.GetEngineInfoResponse: + GetEngineInfoResponse: type: object properties: engine_version: type: string - description: Version of the engine server - description: |- - ============================================================================================== - Get Engine Info - ============================================================================================== - engine_api.CreateEnclaveArgs: + + GetEnclavesResponse: + type: object + properties: + enclave_info: + type: object + additionalProperties: + $ref: '#/components/schemas/EnclaveInfo' + + GetExistingAndHistoricalEnclaveIdentifiersResponse: + type: object + properties: + allIdentifiers: + type: array + items: + $ref: '#/components/schemas/EnclaveIdentifiers' + + CreateEnclaveArgs: type: object properties: enclave_name: type: string - description: The name of the new Kurtosis Enclave api_container_version_tag: type: string - description: |- - The image tag of the API container that should be used inside the enclave - If blank, will use the default version that the engine server uses api_container_log_level: type: string - description: The API container log level mode: - $ref: '#/components/schemas/engine_api.EnclaveMode' - description: |- - ============================================================================================== - Create Enclave - ============================================================================================== - engine_api.EnclaveMode: - type: string - enum: - - TEST - - PRODUCTION - description: |- - 0 - TEST - 1 - PRODUCTION - engine_api.CreateEnclaveResponse: - type: object - properties: - enclave_info: - $ref: '#/components/schemas/engine_api.EnclaveInfo' - engine_api.EnclaveContainersStatus: - type: string - enum: - - EnclaveContainersStatus_EMPTY - - EnclaveContainersStatus_RUNNING - - EnclaveContainersStatus_STOPPED - description: |- - 0 - EnclaveContainersStatus_EMPTY // The enclave has been created, but there are no containers inside it - 1 - EnclaveContainersStatus_RUNNING // One or more containers are running in the enclave (which may or may not include the API container, depending on if the user was manually stopping/removing containers) - 2 - EnclaveContainersStatus_STOPPED // There are >= 1 container in the enclave, but they're all stopped - engine_api.EnclaveAPIContainerStatus: - type: string - enum: - - EnclaveAPIContainerStatus_NONEXISTENT - - EnclaveAPIContainerStatus_RUNNING - - EnclaveAPIContainerStatus_STOPPED - description: |- - 0 - EnclaveAPIContainerStatus_NONEXISTENT // No API container exists in the enclave - This is the only valid value when the enclave containers status is "EMPTY" - 1 - EnclaveAPIContainerStatus_RUNNING // An API container exists and is running - NOTE: this does NOT say that the server inside the API container is available, because checking if it's available requires making a call to the API container - If we have a lot of API containers, we'd be making tons of calls - 2 - EnclaveAPIContainerStatus_STOPPED // An API container exists, but isn't running - engine_api.EnclaveAPIContainerInfo: - type: object - properties: - container_id: - type: string - description: The container engine ID of the API container - ip_inside_enclave: - type: string - description: The IP inside the enclave network of the API container (i.e. how services inside the network can reach the API container) - grpc_port_inside_enclave: - type: integer - format: int32 - description: The grpc port inside the enclave network that the API container is listening on - bridge_ip_address: type: string - description: this is the bridge ip address that gets assigned to api container - engine_api.EnclaveAPIContainerHostMachineInfo: + enum: + - TEST + - PRODUCTION + + CreateEnclaveResponse: type: object properties: - ip_on_host_machine: - type: string - description: The interface IP on the container engine host machine where the API container can be reached - grpc_port_on_host_machine: - type: integer - format: int32 - description: The grpc port on the container engine host machine where the API container can be reached - description: Will only be present if the API container is running - engine_api.EnclaveInfo: + enclave_info: + $ref: '#/components/schemas/EnclaveInfo' + + EnclaveInfo: type: object properties: enclave_uuid: type: string - description: UUID of the enclave name: type: string - description: Name of the enclave shortened_uuid: type: string - description: The shortened uuid of the enclave containers_status: - $ref: '#/components/schemas/engine_api.EnclaveContainersStatus' + type: integer api_container_status: - $ref: '#/components/schemas/engine_api.EnclaveAPIContainerStatus' + type: integer api_container_info: - $ref: '#/components/schemas/engine_api.EnclaveAPIContainerInfo' + $ref: '#/components/schemas/EnclaveAPIContainerInfo' api_container_host_machine_info: - $ref: '#/components/schemas/engine_api.EnclaveAPIContainerHostMachineInfo' + $ref: '#/components/schemas/EnclaveAPIContainerHostMachineInfo' creation_time: - $ref: '#/components/schemas/google.protobuf.Timestamp' + $ref: '#/components/schemas/Timestamp' mode: - $ref: '#/components/schemas/engine_api.EnclaveMode' - description: Enclaves are defined by a network in the container system, which is why there's a bunch of network information here - engine_api.GetEnclavesResponse: - type: object - properties: - enclave_info: - $ref: '#/components/schemas/engine_api.EnclaveInfo' - engine_api.EnclaveIdentifiers: + type: string + enum: + - TEST + - PRODUCTION + + EnclaveAPIContainerInfo: type: object properties: - enclave_uuid: + container_id: type: string - description: UUID of the enclave - name: + ip_inside_enclave: type: string - description: Name of the enclave - shortened_uuid: + grpc_port_inside_enclave: + type: integer + bridge_ip_address: type: string - description: The shortened uuid of the enclave - description: An enclave identifier is a collection of uuid, name and shortened uuid - engine_api.GetExistingAndHistoricalEnclaveIdentifiersResponse: + + EnclaveAPIContainerHostMachineInfo: type: object properties: - allIdentifiers: - type: array - items: - $ref: '#/components/schemas/engine_api.EnclaveIdentifiers' - engine_api.StopEnclaveArgs: - type: object - properties: - enclave_identifier: + ip_on_host_machine: type: string - description: The identifier(uuid, shortened uuid, name) of the Kurtosis enclave to stop - description: |- - ============================================================================================== - Stop Enclave - ============================================================================================== - engine_api.DestroyEnclaveArgs: + grpc_port_on_host_machine: + type: integer + + EnclaveIdentifiers: type: object properties: - enclave_identifier: + enclave_uuid: type: string - description: The identifier(uuid, shortened uuid, name) of the Kurtosis enclave to destroy - description: |- - ============================================================================================== - Destroy Enclave - ============================================================================================== - engine_api.CleanArgs: - type: object - properties: - should_clean_all: - type: boolean - description: If true, It will clean even the running enclaves - description: |- - ============================================================================================== - Create Enclave - ============================================================================================== - engine_api.EnclaveNameAndUuid: + name: + type: string + shortened_uuid: + type: string + + EnclaveNameAndUuid: type: object properties: name: type: string uuid: type: string - engine_api.CleanResponse: + + CleanResponse: type: object properties: removed_enclave_name_and_uuids: type: array items: - $ref: '#/components/schemas/engine_api.EnclaveNameAndUuid' - description: removed enclave name and uuids - engine_api.GetServiceLogsArgs: + $ref: '#/components/schemas/EnclaveNameAndUuid' + + GetServiceLogsArgs: type: object properties: - enclave_identifier: - type: string - description: The identifier of the user service's Kurtosis Enclave service_uuid_set: type: object - description: '"Set" of service UUIDs in the enclave' additionalProperties: - type: string + type: boolean follow_logs: type: boolean - description: If true, It will follow the container logs conjunctive_filters: type: array items: - $ref: '#/components/schemas/engine_api.LogLineFilter' - description: The conjunctive log lines filters, the first filter is applied over the found log lines, the second filter is applied over the filter one result and so on (like grep) + $ref: '#/components/schemas/LogLineFilter' return_all_logs: type: boolean - description: If true, return all log lines num_log_lines: type: integer - format: int32 - description: If [return_all_logs] is false, return [num_log_lines] - description: |- - ============================================================================================== - Get User Service Logs - ============================================================================================== - engine_api.GetServiceLogsResponse: + + GetServiceLogsResponse: type: object properties: service_logs_by_service_uuid: - $ref: '#/components/schemas/engine_api.LogLine' + type: object + additionalProperties: + $ref: '#/components/schemas/LogLine' not_found_service_uuid_set: type: object - description: |- - A set of service GUIDs requested by the user that were not found in the logs database, could be related that users send - a wrong GUID or a right GUID for a service that has not sent any logs so far additionalProperties: - type: string - engine_api.LogLine: + type: boolean + + LogLine: type: object properties: line: type: array items: type: string - description: TODO add timestamp as well, for when we do timestamp-handling on the client side - engine_api.LogLineFilter: + timestamp: + $ref: '#/components/schemas/Timestamp' + + LogLineFilter: type: object properties: operator: - $ref: '#/components/schemas/engine_api.LogLineOperator' + type: integer text_pattern: type: string - engine_api.LogLineOperator: + + Timestamp: type: string - enum: - - LogLineOperator_DOES_CONTAIN_TEXT - - LogLineOperator_DOES_NOT_CONTAIN_TEXT - - LogLineOperator_DOES_CONTAIN_MATCH_REGEX - - LogLineOperator_DOES_NOT_CONTAIN_MATCH_REGEX - description: |- - 0 - LogLineOperator_DOES_CONTAIN_TEXT - 1 - LogLineOperator_DOES_NOT_CONTAIN_TEXT - 2 - LogLineOperator_DOES_CONTAIN_MATCH_REGEX - 3 - LogLineOperator_DOES_NOT_CONTAIN_MATCH_REGEX - google.protobuf.Empty: - type: object - properties: {} - google.protobuf.Timestamp: - type: object - properties: - seconds: - type: integer - format: int64 - nanos: - type: integer - format: int32 + format: date-time diff --git a/api/openapi/engine/server.cfg.yaml b/api/openapi/engine/server.cfg.yaml new file mode 100644 index 0000000000..840550b201 --- /dev/null +++ b/api/openapi/engine/server.cfg.yaml @@ -0,0 +1,5 @@ +package: kurtosis_engine_http_api_bindings +generate: + strict-server: true + embedded-spec: true +output: api/golang/engine/kurtosis_engine_http_api_bindings/engine_server.gen.go \ No newline at end of file diff --git a/api/openapi/engine/types.cfg.yaml b/api/openapi/engine/types.cfg.yaml new file mode 100644 index 0000000000..c06640d643 --- /dev/null +++ b/api/openapi/engine/types.cfg.yaml @@ -0,0 +1,4 @@ +package: kurtosis_engine_http_api_bindings +generate: + models: true +output: api/golang/engine/kurtosis_engine_http_api_bindings/engine_types.gen.go \ No newline at end of file From 6a8d8a0f726a774deee6ca87d6c5501019c5715c Mon Sep 17 00:00:00 2001 From: lostbean Date: Fri, 10 Nov 2023 16:23:42 -0300 Subject: [PATCH 04/95] use Echo framework --- .../api_container_server.gen.go | 460 ++++++++---------- .../engine_server.gen.go | 288 +++++------ api/openapi/core/server.cfg.yaml | 2 +- api/openapi/engine/server.cfg.yaml | 2 +- 4 files changed, 368 insertions(+), 384 deletions(-) diff --git a/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go b/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go index db8b2efaef..f3fa8e4d56 100644 --- a/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go +++ b/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go @@ -6,345 +6,317 @@ package kurtosis_core_http_api_bindings import ( "bytes" "compress/gzip" - "context" "encoding/base64" - "encoding/json" "fmt" - "io" "net/http" "net/url" "path" "strings" + "github.com/deepmap/oapi-codegen/pkg/runtime" "github.com/getkin/kin-openapi/openapi3" + "github.com/labstack/echo/v4" ) -type SuccessAsteriskResponse struct { - Body io.Reader +// ServerInterface represents all server handlers. +type ServerInterface interface { - ContentType string - ContentLength int64 -} - -type GetArtifactsRequestObject struct { -} - -type GetArtifactsResponseObject interface { - VisitGetArtifactsResponse(w http.ResponseWriter) error -} - -type GetArtifacts200JSONResponse ListFilesArtifactNamesAndUuidsResponse + // (GET /artifacts) + GetArtifacts(ctx echo.Context) error -func (response GetArtifacts200JSONResponse) VisitGetArtifactsResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(200) + // (PUT /artifacts/local-file) + PutArtifactsLocalFile(ctx echo.Context) error - return json.NewEncoder(w).Encode(response) -} + // (PUT /artifacts/remote-file) + PutArtifactsRemoteFile(ctx echo.Context) error -type PutArtifactsLocalFileRequestObject struct { - Body *PutArtifactsLocalFileJSONRequestBody -} + // (PUT /artifacts/services/{service_identifier}) + PutArtifactsServicesServiceIdentifier(ctx echo.Context, serviceIdentifier string) error -type PutArtifactsLocalFileResponseObject interface { - VisitPutArtifactsLocalFileResponse(w http.ResponseWriter) error -} + // (GET /artifacts/{artifact_identifier}) + GetArtifactsArtifactIdentifier(ctx echo.Context, artifactIdentifier string) error -type PutArtifactsLocalFile200JSONResponse UploadFilesArtifactResponse + // (GET /artifacts/{artifact_identifier}/download) + GetArtifactsArtifactIdentifierDownload(ctx echo.Context, artifactIdentifier string) error -func (response PutArtifactsLocalFile200JSONResponse) VisitPutArtifactsLocalFileResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(200) + // (GET /services) + GetServices(ctx echo.Context) error - return json.NewEncoder(w).Encode(response) -} + // (POST /services/connection) + PostServicesConnection(ctx echo.Context) error -type PutArtifactsRemoteFileRequestObject struct { - Body *PutArtifactsRemoteFileJSONRequestBody -} + // (GET /services/{service_identifier}) + GetServicesServiceIdentifier(ctx echo.Context, serviceIdentifier string, params GetServicesServiceIdentifierParams) error -type PutArtifactsRemoteFileResponseObject interface { - VisitPutArtifactsRemoteFileResponse(w http.ResponseWriter) error -} + // (POST /services/{service_identifier}/command) + PostServicesServiceIdentifierCommand(ctx echo.Context, serviceIdentifier string) error -type PutArtifactsRemoteFile200JSONResponse StoreWebFilesArtifactResponse + // (POST /services/{service_identifier}/endpoints/{port_number}/availability) + PostServicesServiceIdentifierEndpointsPortNumberAvailability(ctx echo.Context, serviceIdentifier string, portNumber int) error -func (response PutArtifactsRemoteFile200JSONResponse) VisitPutArtifactsRemoteFileResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(200) + // (GET /starlark) + GetStarlark(ctx echo.Context) error - return json.NewEncoder(w).Encode(response) -} + // (PUT /starlark/packages) + PutStarlarkPackages(ctx echo.Context) error -type PutArtifactsServicesServiceIdentifierRequestObject struct { - ServiceIdentifier string `json:"service_identifier"` - Body *PutArtifactsServicesServiceIdentifierJSONRequestBody -} + // (POST /starlark/packages/{package_id}) + PostStarlarkPackagesPackageId(ctx echo.Context, packageId string) error -type PutArtifactsServicesServiceIdentifierResponseObject interface { - VisitPutArtifactsServicesServiceIdentifierResponse(w http.ResponseWriter) error + // (POST /starlark/scripts) + PostStarlarkScripts(ctx echo.Context) error } -type PutArtifactsServicesServiceIdentifier200JSONResponse StoreFilesArtifactFromServiceResponse - -func (response PutArtifactsServicesServiceIdentifier200JSONResponse) VisitPutArtifactsServicesServiceIdentifierResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(200) - - return json.NewEncoder(w).Encode(response) +// ServerInterfaceWrapper converts echo contexts to parameters. +type ServerInterfaceWrapper struct { + Handler ServerInterface } -type GetArtifactsArtifactIdentifierRequestObject struct { - ArtifactIdentifier string `json:"artifact_identifier"` -} +// GetArtifacts converts echo context to params. +func (w *ServerInterfaceWrapper) GetArtifacts(ctx echo.Context) error { + var err error -type GetArtifactsArtifactIdentifierResponseObject interface { - VisitGetArtifactsArtifactIdentifierResponse(w http.ResponseWriter) error + // Invoke the callback with all the unmarshalled arguments + err = w.Handler.GetArtifacts(ctx) + return err } -type GetArtifactsArtifactIdentifier200JSONResponse InspectFilesArtifactContentsResponse - -func (response GetArtifactsArtifactIdentifier200JSONResponse) VisitGetArtifactsArtifactIdentifierResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(200) +// PutArtifactsLocalFile converts echo context to params. +func (w *ServerInterfaceWrapper) PutArtifactsLocalFile(ctx echo.Context) error { + var err error - return json.NewEncoder(w).Encode(response) + // Invoke the callback with all the unmarshalled arguments + err = w.Handler.PutArtifactsLocalFile(ctx) + return err } -type GetArtifactsArtifactIdentifierDownloadRequestObject struct { - ArtifactIdentifier string `json:"artifact_identifier"` -} +// PutArtifactsRemoteFile converts echo context to params. +func (w *ServerInterfaceWrapper) PutArtifactsRemoteFile(ctx echo.Context) error { + var err error -type GetArtifactsArtifactIdentifierDownloadResponseObject interface { - VisitGetArtifactsArtifactIdentifierDownloadResponse(w http.ResponseWriter) error + // Invoke the callback with all the unmarshalled arguments + err = w.Handler.PutArtifactsRemoteFile(ctx) + return err } -type GetArtifactsArtifactIdentifierDownload200JSONResponse StreamedDataChunk - -func (response GetArtifactsArtifactIdentifierDownload200JSONResponse) VisitGetArtifactsArtifactIdentifierDownloadResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(200) +// PutArtifactsServicesServiceIdentifier converts echo context to params. +func (w *ServerInterfaceWrapper) PutArtifactsServicesServiceIdentifier(ctx echo.Context) error { + var err error + // ------------- Path parameter "service_identifier" ------------- + var serviceIdentifier string - return json.NewEncoder(w).Encode(response) -} - -type GetServicesRequestObject struct { -} + err = runtime.BindStyledParameterWithLocation("simple", false, "service_identifier", runtime.ParamLocationPath, ctx.Param("service_identifier"), &serviceIdentifier) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter service_identifier: %s", err)) + } -type GetServicesResponseObject interface { - VisitGetServicesResponse(w http.ResponseWriter) error + // Invoke the callback with all the unmarshalled arguments + err = w.Handler.PutArtifactsServicesServiceIdentifier(ctx, serviceIdentifier) + return err } -type GetServices200JSONResponse GetExistingAndHistoricalServiceIdentifiersResponse +// GetArtifactsArtifactIdentifier converts echo context to params. +func (w *ServerInterfaceWrapper) GetArtifactsArtifactIdentifier(ctx echo.Context) error { + var err error + // ------------- Path parameter "artifact_identifier" ------------- + var artifactIdentifier string -func (response GetServices200JSONResponse) VisitGetServicesResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(200) + err = runtime.BindStyledParameterWithLocation("simple", false, "artifact_identifier", runtime.ParamLocationPath, ctx.Param("artifact_identifier"), &artifactIdentifier) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter artifact_identifier: %s", err)) + } - return json.NewEncoder(w).Encode(response) + // Invoke the callback with all the unmarshalled arguments + err = w.Handler.GetArtifactsArtifactIdentifier(ctx, artifactIdentifier) + return err } -type PostServicesConnectionRequestObject struct { - Body *PostServicesConnectionJSONRequestBody -} +// GetArtifactsArtifactIdentifierDownload converts echo context to params. +func (w *ServerInterfaceWrapper) GetArtifactsArtifactIdentifierDownload(ctx echo.Context) error { + var err error + // ------------- Path parameter "artifact_identifier" ------------- + var artifactIdentifier string -type PostServicesConnectionResponseObject interface { - VisitPostServicesConnectionResponse(w http.ResponseWriter) error -} + err = runtime.BindStyledParameterWithLocation("simple", false, "artifact_identifier", runtime.ParamLocationPath, ctx.Param("artifact_identifier"), &artifactIdentifier) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter artifact_identifier: %s", err)) + } -type PostServicesConnection200JSONResponse ConnectServicesResponse + // Invoke the callback with all the unmarshalled arguments + err = w.Handler.GetArtifactsArtifactIdentifierDownload(ctx, artifactIdentifier) + return err +} -func (response PostServicesConnection200JSONResponse) VisitPostServicesConnectionResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(200) +// GetServices converts echo context to params. +func (w *ServerInterfaceWrapper) GetServices(ctx echo.Context) error { + var err error - return json.NewEncoder(w).Encode(response) + // Invoke the callback with all the unmarshalled arguments + err = w.Handler.GetServices(ctx) + return err } -type GetServicesServiceIdentifierRequestObject struct { - ServiceIdentifier string `json:"service_identifier"` - Params GetServicesServiceIdentifierParams -} +// PostServicesConnection converts echo context to params. +func (w *ServerInterfaceWrapper) PostServicesConnection(ctx echo.Context) error { + var err error -type GetServicesServiceIdentifierResponseObject interface { - VisitGetServicesServiceIdentifierResponse(w http.ResponseWriter) error + // Invoke the callback with all the unmarshalled arguments + err = w.Handler.PostServicesConnection(ctx) + return err } -type GetServicesServiceIdentifier200JSONResponse GetServicesResponse +// GetServicesServiceIdentifier converts echo context to params. +func (w *ServerInterfaceWrapper) GetServicesServiceIdentifier(ctx echo.Context) error { + var err error + // ------------- Path parameter "service_identifier" ------------- + var serviceIdentifier string -func (response GetServicesServiceIdentifier200JSONResponse) VisitGetServicesServiceIdentifierResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(200) + err = runtime.BindStyledParameterWithLocation("simple", false, "service_identifier", runtime.ParamLocationPath, ctx.Param("service_identifier"), &serviceIdentifier) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter service_identifier: %s", err)) + } - return json.NewEncoder(w).Encode(response) -} + // Parameter object where we will unmarshal all parameters from the context + var params GetServicesServiceIdentifierParams + // ------------- Optional query parameter "additional-properties" ------------- -type PostServicesServiceIdentifierCommandRequestObject struct { - ServiceIdentifier string `json:"service_identifier"` - Body *PostServicesServiceIdentifierCommandJSONRequestBody -} + err = runtime.BindQueryParameter("form", true, false, "additional-properties", ctx.QueryParams(), ¶ms.AdditionalProperties) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter additional-properties: %s", err)) + } -type PostServicesServiceIdentifierCommandResponseObject interface { - VisitPostServicesServiceIdentifierCommandResponse(w http.ResponseWriter) error + // Invoke the callback with all the unmarshalled arguments + err = w.Handler.GetServicesServiceIdentifier(ctx, serviceIdentifier, params) + return err } -type PostServicesServiceIdentifierCommand200JSONResponse ExecCommandResponse +// PostServicesServiceIdentifierCommand converts echo context to params. +func (w *ServerInterfaceWrapper) PostServicesServiceIdentifierCommand(ctx echo.Context) error { + var err error + // ------------- Path parameter "service_identifier" ------------- + var serviceIdentifier string -func (response PostServicesServiceIdentifierCommand200JSONResponse) VisitPostServicesServiceIdentifierCommandResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(200) + err = runtime.BindStyledParameterWithLocation("simple", false, "service_identifier", runtime.ParamLocationPath, ctx.Param("service_identifier"), &serviceIdentifier) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter service_identifier: %s", err)) + } - return json.NewEncoder(w).Encode(response) + // Invoke the callback with all the unmarshalled arguments + err = w.Handler.PostServicesServiceIdentifierCommand(ctx, serviceIdentifier) + return err } -type PostServicesServiceIdentifierEndpointsPortNumberAvailabilityRequestObject struct { - ServiceIdentifier string `json:"service_identifier"` - PortNumber int `json:"port_number"` - Body *PostServicesServiceIdentifierEndpointsPortNumberAvailabilityJSONRequestBody -} +// PostServicesServiceIdentifierEndpointsPortNumberAvailability converts echo context to params. +func (w *ServerInterfaceWrapper) PostServicesServiceIdentifierEndpointsPortNumberAvailability(ctx echo.Context) error { + var err error + // ------------- Path parameter "service_identifier" ------------- + var serviceIdentifier string -type PostServicesServiceIdentifierEndpointsPortNumberAvailabilityResponseObject interface { - VisitPostServicesServiceIdentifierEndpointsPortNumberAvailabilityResponse(w http.ResponseWriter) error -} + err = runtime.BindStyledParameterWithLocation("simple", false, "service_identifier", runtime.ParamLocationPath, ctx.Param("service_identifier"), &serviceIdentifier) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter service_identifier: %s", err)) + } -type PostServicesServiceIdentifierEndpointsPortNumberAvailability200AsteriskResponse struct{ SuccessAsteriskResponse } + // ------------- Path parameter "port_number" ------------- + var portNumber int -func (response PostServicesServiceIdentifierEndpointsPortNumberAvailability200AsteriskResponse) VisitPostServicesServiceIdentifierEndpointsPortNumberAvailabilityResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", response.ContentType) - if response.ContentLength != 0 { - w.Header().Set("Content-Length", fmt.Sprint(response.ContentLength)) + err = runtime.BindStyledParameterWithLocation("simple", false, "port_number", runtime.ParamLocationPath, ctx.Param("port_number"), &portNumber) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter port_number: %s", err)) } - w.WriteHeader(200) - if closer, ok := response.Body.(io.ReadCloser); ok { - defer closer.Close() - } - _, err := io.Copy(w, response.Body) + // Invoke the callback with all the unmarshalled arguments + err = w.Handler.PostServicesServiceIdentifierEndpointsPortNumberAvailability(ctx, serviceIdentifier, portNumber) return err } -type GetStarlarkRequestObject struct { -} - -type GetStarlarkResponseObject interface { - VisitGetStarlarkResponse(w http.ResponseWriter) error -} - -type GetStarlark200JSONResponse GetStarlarkRunResponse - -func (response GetStarlark200JSONResponse) VisitGetStarlarkResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(200) +// GetStarlark converts echo context to params. +func (w *ServerInterfaceWrapper) GetStarlark(ctx echo.Context) error { + var err error - return json.NewEncoder(w).Encode(response) + // Invoke the callback with all the unmarshalled arguments + err = w.Handler.GetStarlark(ctx) + return err } -type PutStarlarkPackagesRequestObject struct { - Body *PutStarlarkPackagesJSONRequestBody -} +// PutStarlarkPackages converts echo context to params. +func (w *ServerInterfaceWrapper) PutStarlarkPackages(ctx echo.Context) error { + var err error -type PutStarlarkPackagesResponseObject interface { - VisitPutStarlarkPackagesResponse(w http.ResponseWriter) error + // Invoke the callback with all the unmarshalled arguments + err = w.Handler.PutStarlarkPackages(ctx) + return err } -type PutStarlarkPackages200AsteriskResponse struct{ SuccessAsteriskResponse } +// PostStarlarkPackagesPackageId converts echo context to params. +func (w *ServerInterfaceWrapper) PostStarlarkPackagesPackageId(ctx echo.Context) error { + var err error + // ------------- Path parameter "package_id" ------------- + var packageId string -func (response PutStarlarkPackages200AsteriskResponse) VisitPutStarlarkPackagesResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", response.ContentType) - if response.ContentLength != 0 { - w.Header().Set("Content-Length", fmt.Sprint(response.ContentLength)) + err = runtime.BindStyledParameterWithLocation("simple", false, "package_id", runtime.ParamLocationPath, ctx.Param("package_id"), &packageId) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter package_id: %s", err)) } - w.WriteHeader(200) - if closer, ok := response.Body.(io.ReadCloser); ok { - defer closer.Close() - } - _, err := io.Copy(w, response.Body) + // Invoke the callback with all the unmarshalled arguments + err = w.Handler.PostStarlarkPackagesPackageId(ctx, packageId) return err } -type PostStarlarkPackagesPackageIdRequestObject struct { - PackageId string `json:"package_id"` - Body *PostStarlarkPackagesPackageIdJSONRequestBody -} +// PostStarlarkScripts converts echo context to params. +func (w *ServerInterfaceWrapper) PostStarlarkScripts(ctx echo.Context) error { + var err error -type PostStarlarkPackagesPackageIdResponseObject interface { - VisitPostStarlarkPackagesPackageIdResponse(w http.ResponseWriter) error -} - -type PostStarlarkPackagesPackageId200JSONResponse StarlarkRunResponseLine - -func (response PostStarlarkPackagesPackageId200JSONResponse) VisitPostStarlarkPackagesPackageIdResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(200) - - return json.NewEncoder(w).Encode(response) -} - -type PostStarlarkScriptsRequestObject struct { - Body *PostStarlarkScriptsJSONRequestBody + // Invoke the callback with all the unmarshalled arguments + err = w.Handler.PostStarlarkScripts(ctx) + return err } -type PostStarlarkScriptsResponseObject interface { - VisitPostStarlarkScriptsResponse(w http.ResponseWriter) error +// This is a simple interface which specifies echo.Route addition functions which +// are present on both echo.Echo and echo.Group, since we want to allow using +// either of them for path registration +type EchoRouter interface { + CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route } -type PostStarlarkScripts200JSONResponse StarlarkRunResponseLine - -func (response PostStarlarkScripts200JSONResponse) VisitPostStarlarkScriptsResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(200) - - return json.NewEncoder(w).Encode(response) +// RegisterHandlers adds each server route to the EchoRouter. +func RegisterHandlers(router EchoRouter, si ServerInterface) { + RegisterHandlersWithBaseURL(router, si, "") } -// StrictServerInterface represents all server handlers. -type StrictServerInterface interface { - - // (GET /artifacts) - GetArtifacts(ctx context.Context, request GetArtifactsRequestObject) (GetArtifactsResponseObject, error) - - // (PUT /artifacts/local-file) - PutArtifactsLocalFile(ctx context.Context, request PutArtifactsLocalFileRequestObject) (PutArtifactsLocalFileResponseObject, error) - - // (PUT /artifacts/remote-file) - PutArtifactsRemoteFile(ctx context.Context, request PutArtifactsRemoteFileRequestObject) (PutArtifactsRemoteFileResponseObject, error) - - // (PUT /artifacts/services/{service_identifier}) - PutArtifactsServicesServiceIdentifier(ctx context.Context, request PutArtifactsServicesServiceIdentifierRequestObject) (PutArtifactsServicesServiceIdentifierResponseObject, error) - - // (GET /artifacts/{artifact_identifier}) - GetArtifactsArtifactIdentifier(ctx context.Context, request GetArtifactsArtifactIdentifierRequestObject) (GetArtifactsArtifactIdentifierResponseObject, error) - - // (GET /artifacts/{artifact_identifier}/download) - GetArtifactsArtifactIdentifierDownload(ctx context.Context, request GetArtifactsArtifactIdentifierDownloadRequestObject) (GetArtifactsArtifactIdentifierDownloadResponseObject, error) - - // (GET /services) - GetServices(ctx context.Context, request GetServicesRequestObject) (GetServicesResponseObject, error) - - // (POST /services/connection) - PostServicesConnection(ctx context.Context, request PostServicesConnectionRequestObject) (PostServicesConnectionResponseObject, error) - - // (GET /services/{service_identifier}) - GetServicesServiceIdentifier(ctx context.Context, request GetServicesServiceIdentifierRequestObject) (GetServicesServiceIdentifierResponseObject, error) - - // (POST /services/{service_identifier}/command) - PostServicesServiceIdentifierCommand(ctx context.Context, request PostServicesServiceIdentifierCommandRequestObject) (PostServicesServiceIdentifierCommandResponseObject, error) +// Registers handlers, and prepends BaseURL to the paths, so that the paths +// can be served under a prefix. +func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string) { - // (POST /services/{service_identifier}/endpoints/{port_number}/availability) - PostServicesServiceIdentifierEndpointsPortNumberAvailability(ctx context.Context, request PostServicesServiceIdentifierEndpointsPortNumberAvailabilityRequestObject) (PostServicesServiceIdentifierEndpointsPortNumberAvailabilityResponseObject, error) - - // (GET /starlark) - GetStarlark(ctx context.Context, request GetStarlarkRequestObject) (GetStarlarkResponseObject, error) - - // (PUT /starlark/packages) - PutStarlarkPackages(ctx context.Context, request PutStarlarkPackagesRequestObject) (PutStarlarkPackagesResponseObject, error) + wrapper := ServerInterfaceWrapper{ + Handler: si, + } - // (POST /starlark/packages/{package_id}) - PostStarlarkPackagesPackageId(ctx context.Context, request PostStarlarkPackagesPackageIdRequestObject) (PostStarlarkPackagesPackageIdResponseObject, error) + router.GET(baseURL+"/artifacts", wrapper.GetArtifacts) + router.PUT(baseURL+"/artifacts/local-file", wrapper.PutArtifactsLocalFile) + router.PUT(baseURL+"/artifacts/remote-file", wrapper.PutArtifactsRemoteFile) + router.PUT(baseURL+"/artifacts/services/:service_identifier", wrapper.PutArtifactsServicesServiceIdentifier) + router.GET(baseURL+"/artifacts/:artifact_identifier", wrapper.GetArtifactsArtifactIdentifier) + router.GET(baseURL+"/artifacts/:artifact_identifier/download", wrapper.GetArtifactsArtifactIdentifierDownload) + router.GET(baseURL+"/services", wrapper.GetServices) + router.POST(baseURL+"/services/connection", wrapper.PostServicesConnection) + router.GET(baseURL+"/services/:service_identifier", wrapper.GetServicesServiceIdentifier) + router.POST(baseURL+"/services/:service_identifier/command", wrapper.PostServicesServiceIdentifierCommand) + router.POST(baseURL+"/services/:service_identifier/endpoints/:port_number/availability", wrapper.PostServicesServiceIdentifierEndpointsPortNumberAvailability) + router.GET(baseURL+"/starlark", wrapper.GetStarlark) + router.PUT(baseURL+"/starlark/packages", wrapper.PutStarlarkPackages) + router.POST(baseURL+"/starlark/packages/:package_id", wrapper.PostStarlarkPackagesPackageId) + router.POST(baseURL+"/starlark/scripts", wrapper.PostStarlarkScripts) - // (POST /starlark/scripts) - PostStarlarkScripts(ctx context.Context, request PostStarlarkScriptsRequestObject) (PostStarlarkScriptsResponseObject, error) } // Base64 encoded, gzipped, json marshaled Swagger object diff --git a/api/golang/engine/kurtosis_engine_http_api_bindings/engine_server.gen.go b/api/golang/engine/kurtosis_engine_http_api_bindings/engine_server.gen.go index a8ccffdcb7..e7574da42b 100644 --- a/api/golang/engine/kurtosis_engine_http_api_bindings/engine_server.gen.go +++ b/api/golang/engine/kurtosis_engine_http_api_bindings/engine_server.gen.go @@ -6,198 +6,210 @@ package kurtosis_engine_http_api_bindings import ( "bytes" "compress/gzip" - "context" "encoding/base64" - "encoding/json" "fmt" "net/http" "net/url" "path" "strings" + "github.com/deepmap/oapi-codegen/pkg/runtime" "github.com/getkin/kin-openapi/openapi3" + "github.com/labstack/echo/v4" ) -type DeleteEnclavesRequestObject struct { - Params DeleteEnclavesParams -} - -type DeleteEnclavesResponseObject interface { - VisitDeleteEnclavesResponse(w http.ResponseWriter) error -} - -type DeleteEnclaves200JSONResponse CleanResponse - -func (response DeleteEnclaves200JSONResponse) VisitDeleteEnclavesResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(200) - - return json.NewEncoder(w).Encode(response) +// ServerInterface represents all server handlers. +type ServerInterface interface { + // Delete Enclaves + // (DELETE /enclaves) + DeleteEnclaves(ctx echo.Context, params DeleteEnclavesParams) error + // Get Enclaves + // (GET /enclaves) + GetEnclaves(ctx echo.Context) error + // Create Enclave + // (POST /enclaves) + PostEnclaves(ctx echo.Context) error + // Get Historical Enclaves + // (GET /enclaves/historical) + GetEnclavesHistorical(ctx echo.Context) error + // Destroy Enclave + // (DELETE /enclaves/{enclave_identifier}) + DeleteEnclavesEnclaveIdentifier(ctx echo.Context, enclaveIdentifier string) error + // Get Enclave Info + // (GET /enclaves/{enclave_identifier}) + GetEnclavesEnclaveIdentifier(ctx echo.Context, enclaveIdentifier string) error + // Get Service Logs + // (POST /enclaves/{enclave_identifier}/logs) + PostEnclavesEnclaveIdentifierLogs(ctx echo.Context, enclaveIdentifier string) error + // Stop Enclave + // (POST /enclaves/{enclave_identifier}/stop) + PostEnclavesEnclaveIdentifierStop(ctx echo.Context, enclaveIdentifier string) error + // Get Engine Info + // (GET /engine/info) + GetEngineInfo(ctx echo.Context) error } -type GetEnclavesRequestObject struct { +// ServerInterfaceWrapper converts echo contexts to parameters. +type ServerInterfaceWrapper struct { + Handler ServerInterface } -type GetEnclavesResponseObject interface { - VisitGetEnclavesResponse(w http.ResponseWriter) error -} +// DeleteEnclaves converts echo context to params. +func (w *ServerInterfaceWrapper) DeleteEnclaves(ctx echo.Context) error { + var err error -type GetEnclaves200JSONResponse GetEnclavesResponse + // Parameter object where we will unmarshal all parameters from the context + var params DeleteEnclavesParams + // ------------- Optional query parameter "remove_all" ------------- -func (response GetEnclaves200JSONResponse) VisitGetEnclavesResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(200) + err = runtime.BindQueryParameter("form", true, false, "remove_all", ctx.QueryParams(), ¶ms.RemoveAll) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter remove_all: %s", err)) + } - return json.NewEncoder(w).Encode(response) + // Invoke the callback with all the unmarshalled arguments + err = w.Handler.DeleteEnclaves(ctx, params) + return err } -type PostEnclavesRequestObject struct { - Body *PostEnclavesJSONRequestBody -} +// GetEnclaves converts echo context to params. +func (w *ServerInterfaceWrapper) GetEnclaves(ctx echo.Context) error { + var err error -type PostEnclavesResponseObject interface { - VisitPostEnclavesResponse(w http.ResponseWriter) error + // Invoke the callback with all the unmarshalled arguments + err = w.Handler.GetEnclaves(ctx) + return err } -type PostEnclaves200JSONResponse CreateEnclaveResponse - -func (response PostEnclaves200JSONResponse) VisitPostEnclavesResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(200) +// PostEnclaves converts echo context to params. +func (w *ServerInterfaceWrapper) PostEnclaves(ctx echo.Context) error { + var err error - return json.NewEncoder(w).Encode(response) + // Invoke the callback with all the unmarshalled arguments + err = w.Handler.PostEnclaves(ctx) + return err } -type GetEnclavesHistoricalRequestObject struct { -} +// GetEnclavesHistorical converts echo context to params. +func (w *ServerInterfaceWrapper) GetEnclavesHistorical(ctx echo.Context) error { + var err error -type GetEnclavesHistoricalResponseObject interface { - VisitGetEnclavesHistoricalResponse(w http.ResponseWriter) error + // Invoke the callback with all the unmarshalled arguments + err = w.Handler.GetEnclavesHistorical(ctx) + return err } -type GetEnclavesHistorical200JSONResponse GetExistingAndHistoricalEnclaveIdentifiersResponse - -func (response GetEnclavesHistorical200JSONResponse) VisitGetEnclavesHistoricalResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(200) +// DeleteEnclavesEnclaveIdentifier converts echo context to params. +func (w *ServerInterfaceWrapper) DeleteEnclavesEnclaveIdentifier(ctx echo.Context) error { + var err error + // ------------- Path parameter "enclave_identifier" ------------- + var enclaveIdentifier string - return json.NewEncoder(w).Encode(response) -} - -type DeleteEnclavesEnclaveIdentifierRequestObject struct { - EnclaveIdentifier string `json:"enclave_identifier"` -} + err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter enclave_identifier: %s", err)) + } -type DeleteEnclavesEnclaveIdentifierResponseObject interface { - VisitDeleteEnclavesEnclaveIdentifierResponse(w http.ResponseWriter) error + // Invoke the callback with all the unmarshalled arguments + err = w.Handler.DeleteEnclavesEnclaveIdentifier(ctx, enclaveIdentifier) + return err } -type DeleteEnclavesEnclaveIdentifier200JSONResponse map[string]interface{} +// GetEnclavesEnclaveIdentifier converts echo context to params. +func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifier(ctx echo.Context) error { + var err error + // ------------- Path parameter "enclave_identifier" ------------- + var enclaveIdentifier string -func (response DeleteEnclavesEnclaveIdentifier200JSONResponse) VisitDeleteEnclavesEnclaveIdentifierResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(200) - - return json.NewEncoder(w).Encode(response) -} - -type GetEnclavesEnclaveIdentifierRequestObject struct { - EnclaveIdentifier string `json:"enclave_identifier"` -} + err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter enclave_identifier: %s", err)) + } -type GetEnclavesEnclaveIdentifierResponseObject interface { - VisitGetEnclavesEnclaveIdentifierResponse(w http.ResponseWriter) error + // Invoke the callback with all the unmarshalled arguments + err = w.Handler.GetEnclavesEnclaveIdentifier(ctx, enclaveIdentifier) + return err } -type GetEnclavesEnclaveIdentifier200JSONResponse EnclaveInfo - -func (response GetEnclavesEnclaveIdentifier200JSONResponse) VisitGetEnclavesEnclaveIdentifierResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(200) +// PostEnclavesEnclaveIdentifierLogs converts echo context to params. +func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierLogs(ctx echo.Context) error { + var err error + // ------------- Path parameter "enclave_identifier" ------------- + var enclaveIdentifier string - return json.NewEncoder(w).Encode(response) -} - -type PostEnclavesEnclaveIdentifierLogsRequestObject struct { - EnclaveIdentifier string `json:"enclave_identifier"` - Body *PostEnclavesEnclaveIdentifierLogsJSONRequestBody -} + err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter enclave_identifier: %s", err)) + } -type PostEnclavesEnclaveIdentifierLogsResponseObject interface { - VisitPostEnclavesEnclaveIdentifierLogsResponse(w http.ResponseWriter) error + // Invoke the callback with all the unmarshalled arguments + err = w.Handler.PostEnclavesEnclaveIdentifierLogs(ctx, enclaveIdentifier) + return err } -type PostEnclavesEnclaveIdentifierLogs200JSONResponse GetServiceLogsResponse +// PostEnclavesEnclaveIdentifierStop converts echo context to params. +func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierStop(ctx echo.Context) error { + var err error + // ------------- Path parameter "enclave_identifier" ------------- + var enclaveIdentifier string -func (response PostEnclavesEnclaveIdentifierLogs200JSONResponse) VisitPostEnclavesEnclaveIdentifierLogsResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(200) - - return json.NewEncoder(w).Encode(response) -} - -type PostEnclavesEnclaveIdentifierStopRequestObject struct { - EnclaveIdentifier string `json:"enclave_identifier"` -} + err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter enclave_identifier: %s", err)) + } -type PostEnclavesEnclaveIdentifierStopResponseObject interface { - VisitPostEnclavesEnclaveIdentifierStopResponse(w http.ResponseWriter) error + // Invoke the callback with all the unmarshalled arguments + err = w.Handler.PostEnclavesEnclaveIdentifierStop(ctx, enclaveIdentifier) + return err } -type PostEnclavesEnclaveIdentifierStop200JSONResponse map[string]interface{} - -func (response PostEnclavesEnclaveIdentifierStop200JSONResponse) VisitPostEnclavesEnclaveIdentifierStopResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(200) +// GetEngineInfo converts echo context to params. +func (w *ServerInterfaceWrapper) GetEngineInfo(ctx echo.Context) error { + var err error - return json.NewEncoder(w).Encode(response) + // Invoke the callback with all the unmarshalled arguments + err = w.Handler.GetEngineInfo(ctx) + return err } -type GetEngineInfoRequestObject struct { +// This is a simple interface which specifies echo.Route addition functions which +// are present on both echo.Echo and echo.Group, since we want to allow using +// either of them for path registration +type EchoRouter interface { + CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route } -type GetEngineInfoResponseObject interface { - VisitGetEngineInfoResponse(w http.ResponseWriter) error +// RegisterHandlers adds each server route to the EchoRouter. +func RegisterHandlers(router EchoRouter, si ServerInterface) { + RegisterHandlersWithBaseURL(router, si, "") } -type GetEngineInfo200JSONResponse GetEngineInfoResponse +// Registers handlers, and prepends BaseURL to the paths, so that the paths +// can be served under a prefix. +func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string) { -func (response GetEngineInfo200JSONResponse) VisitGetEngineInfoResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(200) + wrapper := ServerInterfaceWrapper{ + Handler: si, + } - return json.NewEncoder(w).Encode(response) -} + router.DELETE(baseURL+"/enclaves", wrapper.DeleteEnclaves) + router.GET(baseURL+"/enclaves", wrapper.GetEnclaves) + router.POST(baseURL+"/enclaves", wrapper.PostEnclaves) + router.GET(baseURL+"/enclaves/historical", wrapper.GetEnclavesHistorical) + router.DELETE(baseURL+"/enclaves/:enclave_identifier", wrapper.DeleteEnclavesEnclaveIdentifier) + router.GET(baseURL+"/enclaves/:enclave_identifier", wrapper.GetEnclavesEnclaveIdentifier) + router.POST(baseURL+"/enclaves/:enclave_identifier/logs", wrapper.PostEnclavesEnclaveIdentifierLogs) + router.POST(baseURL+"/enclaves/:enclave_identifier/stop", wrapper.PostEnclavesEnclaveIdentifierStop) + router.GET(baseURL+"/engine/info", wrapper.GetEngineInfo) -// StrictServerInterface represents all server handlers. -type StrictServerInterface interface { - // Delete Enclaves - // (DELETE /enclaves) - DeleteEnclaves(ctx context.Context, request DeleteEnclavesRequestObject) (DeleteEnclavesResponseObject, error) - // Get Enclaves - // (GET /enclaves) - GetEnclaves(ctx context.Context, request GetEnclavesRequestObject) (GetEnclavesResponseObject, error) - // Create Enclave - // (POST /enclaves) - PostEnclaves(ctx context.Context, request PostEnclavesRequestObject) (PostEnclavesResponseObject, error) - // Get Historical Enclaves - // (GET /enclaves/historical) - GetEnclavesHistorical(ctx context.Context, request GetEnclavesHistoricalRequestObject) (GetEnclavesHistoricalResponseObject, error) - // Destroy Enclave - // (DELETE /enclaves/{enclave_identifier}) - DeleteEnclavesEnclaveIdentifier(ctx context.Context, request DeleteEnclavesEnclaveIdentifierRequestObject) (DeleteEnclavesEnclaveIdentifierResponseObject, error) - // Get Enclave Info - // (GET /enclaves/{enclave_identifier}) - GetEnclavesEnclaveIdentifier(ctx context.Context, request GetEnclavesEnclaveIdentifierRequestObject) (GetEnclavesEnclaveIdentifierResponseObject, error) - // Get Service Logs - // (POST /enclaves/{enclave_identifier}/logs) - PostEnclavesEnclaveIdentifierLogs(ctx context.Context, request PostEnclavesEnclaveIdentifierLogsRequestObject) (PostEnclavesEnclaveIdentifierLogsResponseObject, error) - // Stop Enclave - // (POST /enclaves/{enclave_identifier}/stop) - PostEnclavesEnclaveIdentifierStop(ctx context.Context, request PostEnclavesEnclaveIdentifierStopRequestObject) (PostEnclavesEnclaveIdentifierStopResponseObject, error) - // Get Engine Info - // (GET /engine/info) - GetEngineInfo(ctx context.Context, request GetEngineInfoRequestObject) (GetEngineInfoResponseObject, error) } // Base64 encoded, gzipped, json marshaled Swagger object diff --git a/api/openapi/core/server.cfg.yaml b/api/openapi/core/server.cfg.yaml index e78f91a6fa..bd5e98ac34 100644 --- a/api/openapi/core/server.cfg.yaml +++ b/api/openapi/core/server.cfg.yaml @@ -1,5 +1,5 @@ package: kurtosis_core_http_api_bindings generate: - strict-server: true embedded-spec: true + echo-server: true output: api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go \ No newline at end of file diff --git a/api/openapi/engine/server.cfg.yaml b/api/openapi/engine/server.cfg.yaml index 840550b201..ecb438b9ab 100644 --- a/api/openapi/engine/server.cfg.yaml +++ b/api/openapi/engine/server.cfg.yaml @@ -1,5 +1,5 @@ package: kurtosis_engine_http_api_bindings generate: - strict-server: true embedded-spec: true + echo-server: true output: api/golang/engine/kurtosis_engine_http_api_bindings/engine_server.gen.go \ No newline at end of file From a9bffd1238374505cf38a398ca8883f4d19478c1 Mon Sep 17 00:00:00 2001 From: lostbean Date: Fri, 10 Nov 2023 18:06:19 -0300 Subject: [PATCH 05/95] add test server --- api/golang/engine_http_server.go | 51 ++++++++++++++++++ api/golang/http/core_handler.go | 90 ++++++++++++++++++++++++++++++++ flake.nix | 2 +- go.work.sum | 1 - 4 files changed, 142 insertions(+), 2 deletions(-) create mode 100644 api/golang/engine_http_server.go create mode 100644 api/golang/http/core_handler.go diff --git a/api/golang/engine_http_server.go b/api/golang/engine_http_server.go new file mode 100644 index 0000000000..ed5f63a0e3 --- /dev/null +++ b/api/golang/engine_http_server.go @@ -0,0 +1,51 @@ +package main + +import ( + "flag" + "fmt" + "net" + "os" + + api "github.com/kurtosis-tech/kurtosis/api/golang/core/kurtosis_core_http_api_bindings" + "github.com/kurtosis-tech/kurtosis/api/golang/http" + "github.com/labstack/echo/v4" + echomiddleware "github.com/labstack/echo/v4/middleware" + // middleware "github.com/oapi-codegen/echo-middleware" +) + +type ServerInterface struct { + + // (GET /artifacts) +} + +func main() { + port := flag.String("port", "8008", "Port for test HTTP server") + flag.Parse() + + _, err := api.GetSwagger() + if err != nil { + fmt.Fprintf(os.Stderr, "Error loading swagger spec\n: %s", err) + os.Exit(1) + } + + // Clear out the servers array in the swagger spec, that skips validating + // that server names match. We don't know how this thing will be run. + // swagger.Servers = nil + + // Create an instance of our handler which satisfies the generated interface + petStore := http.EngineRuntime{} + + // This is how you set up a basic Echo router + e := echo.New() + // Log all requests + e.Use(echomiddleware.Logger()) + // Use our validation middleware to check all requests against the + // OpenAPI schema. + // e.Use(middleware.OapiRequestValidator(swagger)) + + // We now register our petStore above as the handler for the interface + api.RegisterHandlers(e, &petStore) + + // And we serve HTTP until the world ends. + e.Logger.Fatal(e.Start(net.JoinHostPort("0.0.0.0", *port))) +} diff --git a/api/golang/http/core_handler.go b/api/golang/http/core_handler.go new file mode 100644 index 0000000000..addd05e1cf --- /dev/null +++ b/api/golang/http/core_handler.go @@ -0,0 +1,90 @@ +package http + +import ( + api "github.com/kurtosis-tech/kurtosis/api/golang/core/kurtosis_core_http_api_bindings" + "github.com/labstack/echo/v4" +) + +type EngineRuntime struct { +} + +type Error struct { +} + +func (error Error) Error() string { + return "Not Implemented :(" +} + +func (engine *EngineRuntime) GetArtifacts(ctx echo.Context) error { + return Error{} +} + +// (PUT /artifacts/local-file) +func (engine *EngineRuntime) PutArtifactsLocalFile(ctx echo.Context) error { + return Error{} +} + +// (PUT /artifacts/remote-file) +func (engine *EngineRuntime) PutArtifactsRemoteFile(ctx echo.Context) error { + return Error{} +} + +// (PUT /artifacts/services/{service_identifier}) +func (engine *EngineRuntime) PutArtifactsServicesServiceIdentifier(ctx echo.Context, serviceIdentifier string) error { + return Error{} +} + +// (GET /artifacts/{artifact_identifier}) +func (engine *EngineRuntime) GetArtifactsArtifactIdentifier(ctx echo.Context, artifactIdentifier string) error { + return Error{} +} + +// (GET /artifacts/{artifact_identifier}/download) +func (engine *EngineRuntime) GetArtifactsArtifactIdentifierDownload(ctx echo.Context, artifactIdentifier string) error { + return Error{} +} + +// (GET /services) +func (engine *EngineRuntime) GetServices(ctx echo.Context) error { + return Error{} +} + +// (POST /services/connection) +func (engine *EngineRuntime) PostServicesConnection(ctx echo.Context) error { + return Error{} +} + +// (GET /services/{service_identifier}) +func (engine *EngineRuntime) GetServicesServiceIdentifier(ctx echo.Context, serviceIdentifier string, params api.GetServicesServiceIdentifierParams) error { + return Error{} +} + +// (POST /services/{service_identifier}/command) +func (engine *EngineRuntime) PostServicesServiceIdentifierCommand(ctx echo.Context, serviceIdentifier string) error { + return Error{} +} + +// (POST /services/{service_identifier}/endpoints/{port_number}/availability) +func (engine *EngineRuntime) PostServicesServiceIdentifierEndpointsPortNumberAvailability(ctx echo.Context, serviceIdentifier string, portNumber int) error { + return Error{} +} + +// (GET /starlark) +func (engine *EngineRuntime) GetStarlark(ctx echo.Context) error { + return Error{} +} + +// (PUT /starlark/packages) +func (engine *EngineRuntime) PutStarlarkPackages(ctx echo.Context) error { + return Error{} +} + +// (POST /starlark/packages/{package_id}) +func (engine *EngineRuntime) PostStarlarkPackagesPackageId(ctx echo.Context, packageId string) error { + return Error{} +} + +// (POST /starlark/scripts) +func (engine *EngineRuntime) PostStarlarkScripts(ctx echo.Context) error { + return Error{} +} diff --git a/flake.nix b/flake.nix index 4fefaf4234..a96de7481b 100644 --- a/flake.nix +++ b/flake.nix @@ -54,7 +54,7 @@ in [ goreleaser - go_1_19 + go_1_20 gopls golangci-lint delve diff --git a/go.work.sum b/go.work.sum index b7dcb8d999..3ddc504898 100644 --- a/go.work.sum +++ b/go.work.sum @@ -9,7 +9,6 @@ github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lY github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY= github.com/invopop/yaml v0.2.0 h1:7zky/qH+O0DwAyoobXUqvVBwgBFRxKoQ/3FjcVpjTMY= github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= From d379aa33153bb9270ee7686115f490ff192d77ec Mon Sep 17 00:00:00 2001 From: lostbean Date: Mon, 13 Nov 2023 15:28:21 -0300 Subject: [PATCH 06/95] Add strict interface --- .../api_container_server.gen.go | 759 ++++++++++++++++++ .../engine_server.gen.go | 426 ++++++++++ api/openapi/core/server.cfg.yaml | 1 + api/openapi/engine/server.cfg.yaml | 1 + 4 files changed, 1187 insertions(+) diff --git a/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go b/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go index f3fa8e4d56..018187cbf5 100644 --- a/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go +++ b/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go @@ -6,8 +6,11 @@ package kurtosis_core_http_api_bindings import ( "bytes" "compress/gzip" + "context" "encoding/base64" + "encoding/json" "fmt" + "io" "net/http" "net/url" "path" @@ -319,6 +322,762 @@ func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL } +type SuccessAsteriskResponse struct { + Body io.Reader + + ContentType string + ContentLength int64 +} + +type GetArtifactsRequestObject struct { +} + +type GetArtifactsResponseObject interface { + VisitGetArtifactsResponse(w http.ResponseWriter) error +} + +type GetArtifacts200JSONResponse ListFilesArtifactNamesAndUuidsResponse + +func (response GetArtifacts200JSONResponse) VisitGetArtifactsResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PutArtifactsLocalFileRequestObject struct { + Body *PutArtifactsLocalFileJSONRequestBody +} + +type PutArtifactsLocalFileResponseObject interface { + VisitPutArtifactsLocalFileResponse(w http.ResponseWriter) error +} + +type PutArtifactsLocalFile200JSONResponse UploadFilesArtifactResponse + +func (response PutArtifactsLocalFile200JSONResponse) VisitPutArtifactsLocalFileResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PutArtifactsRemoteFileRequestObject struct { + Body *PutArtifactsRemoteFileJSONRequestBody +} + +type PutArtifactsRemoteFileResponseObject interface { + VisitPutArtifactsRemoteFileResponse(w http.ResponseWriter) error +} + +type PutArtifactsRemoteFile200JSONResponse StoreWebFilesArtifactResponse + +func (response PutArtifactsRemoteFile200JSONResponse) VisitPutArtifactsRemoteFileResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PutArtifactsServicesServiceIdentifierRequestObject struct { + ServiceIdentifier string `json:"service_identifier"` + Body *PutArtifactsServicesServiceIdentifierJSONRequestBody +} + +type PutArtifactsServicesServiceIdentifierResponseObject interface { + VisitPutArtifactsServicesServiceIdentifierResponse(w http.ResponseWriter) error +} + +type PutArtifactsServicesServiceIdentifier200JSONResponse StoreFilesArtifactFromServiceResponse + +func (response PutArtifactsServicesServiceIdentifier200JSONResponse) VisitPutArtifactsServicesServiceIdentifierResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type GetArtifactsArtifactIdentifierRequestObject struct { + ArtifactIdentifier string `json:"artifact_identifier"` +} + +type GetArtifactsArtifactIdentifierResponseObject interface { + VisitGetArtifactsArtifactIdentifierResponse(w http.ResponseWriter) error +} + +type GetArtifactsArtifactIdentifier200JSONResponse InspectFilesArtifactContentsResponse + +func (response GetArtifactsArtifactIdentifier200JSONResponse) VisitGetArtifactsArtifactIdentifierResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type GetArtifactsArtifactIdentifierDownloadRequestObject struct { + ArtifactIdentifier string `json:"artifact_identifier"` +} + +type GetArtifactsArtifactIdentifierDownloadResponseObject interface { + VisitGetArtifactsArtifactIdentifierDownloadResponse(w http.ResponseWriter) error +} + +type GetArtifactsArtifactIdentifierDownload200JSONResponse StreamedDataChunk + +func (response GetArtifactsArtifactIdentifierDownload200JSONResponse) VisitGetArtifactsArtifactIdentifierDownloadResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type GetServicesRequestObject struct { +} + +type GetServicesResponseObject interface { + VisitGetServicesResponse(w http.ResponseWriter) error +} + +type GetServices200JSONResponse GetExistingAndHistoricalServiceIdentifiersResponse + +func (response GetServices200JSONResponse) VisitGetServicesResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PostServicesConnectionRequestObject struct { + Body *PostServicesConnectionJSONRequestBody +} + +type PostServicesConnectionResponseObject interface { + VisitPostServicesConnectionResponse(w http.ResponseWriter) error +} + +type PostServicesConnection200JSONResponse ConnectServicesResponse + +func (response PostServicesConnection200JSONResponse) VisitPostServicesConnectionResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type GetServicesServiceIdentifierRequestObject struct { + ServiceIdentifier string `json:"service_identifier"` + Params GetServicesServiceIdentifierParams +} + +type GetServicesServiceIdentifierResponseObject interface { + VisitGetServicesServiceIdentifierResponse(w http.ResponseWriter) error +} + +type GetServicesServiceIdentifier200JSONResponse GetServicesResponse + +func (response GetServicesServiceIdentifier200JSONResponse) VisitGetServicesServiceIdentifierResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PostServicesServiceIdentifierCommandRequestObject struct { + ServiceIdentifier string `json:"service_identifier"` + Body *PostServicesServiceIdentifierCommandJSONRequestBody +} + +type PostServicesServiceIdentifierCommandResponseObject interface { + VisitPostServicesServiceIdentifierCommandResponse(w http.ResponseWriter) error +} + +type PostServicesServiceIdentifierCommand200JSONResponse ExecCommandResponse + +func (response PostServicesServiceIdentifierCommand200JSONResponse) VisitPostServicesServiceIdentifierCommandResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PostServicesServiceIdentifierEndpointsPortNumberAvailabilityRequestObject struct { + ServiceIdentifier string `json:"service_identifier"` + PortNumber int `json:"port_number"` + Body *PostServicesServiceIdentifierEndpointsPortNumberAvailabilityJSONRequestBody +} + +type PostServicesServiceIdentifierEndpointsPortNumberAvailabilityResponseObject interface { + VisitPostServicesServiceIdentifierEndpointsPortNumberAvailabilityResponse(w http.ResponseWriter) error +} + +type PostServicesServiceIdentifierEndpointsPortNumberAvailability200AsteriskResponse struct{ SuccessAsteriskResponse } + +func (response PostServicesServiceIdentifierEndpointsPortNumberAvailability200AsteriskResponse) VisitPostServicesServiceIdentifierEndpointsPortNumberAvailabilityResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", response.ContentType) + if response.ContentLength != 0 { + w.Header().Set("Content-Length", fmt.Sprint(response.ContentLength)) + } + w.WriteHeader(200) + + if closer, ok := response.Body.(io.ReadCloser); ok { + defer closer.Close() + } + _, err := io.Copy(w, response.Body) + return err +} + +type GetStarlarkRequestObject struct { +} + +type GetStarlarkResponseObject interface { + VisitGetStarlarkResponse(w http.ResponseWriter) error +} + +type GetStarlark200JSONResponse GetStarlarkRunResponse + +func (response GetStarlark200JSONResponse) VisitGetStarlarkResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PutStarlarkPackagesRequestObject struct { + Body *PutStarlarkPackagesJSONRequestBody +} + +type PutStarlarkPackagesResponseObject interface { + VisitPutStarlarkPackagesResponse(w http.ResponseWriter) error +} + +type PutStarlarkPackages200AsteriskResponse struct{ SuccessAsteriskResponse } + +func (response PutStarlarkPackages200AsteriskResponse) VisitPutStarlarkPackagesResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", response.ContentType) + if response.ContentLength != 0 { + w.Header().Set("Content-Length", fmt.Sprint(response.ContentLength)) + } + w.WriteHeader(200) + + if closer, ok := response.Body.(io.ReadCloser); ok { + defer closer.Close() + } + _, err := io.Copy(w, response.Body) + return err +} + +type PostStarlarkPackagesPackageIdRequestObject struct { + PackageId string `json:"package_id"` + Body *PostStarlarkPackagesPackageIdJSONRequestBody +} + +type PostStarlarkPackagesPackageIdResponseObject interface { + VisitPostStarlarkPackagesPackageIdResponse(w http.ResponseWriter) error +} + +type PostStarlarkPackagesPackageId200JSONResponse StarlarkRunResponseLine + +func (response PostStarlarkPackagesPackageId200JSONResponse) VisitPostStarlarkPackagesPackageIdResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PostStarlarkScriptsRequestObject struct { + Body *PostStarlarkScriptsJSONRequestBody +} + +type PostStarlarkScriptsResponseObject interface { + VisitPostStarlarkScriptsResponse(w http.ResponseWriter) error +} + +type PostStarlarkScripts200JSONResponse StarlarkRunResponseLine + +func (response PostStarlarkScripts200JSONResponse) VisitPostStarlarkScriptsResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +// StrictServerInterface represents all server handlers. +type StrictServerInterface interface { + + // (GET /artifacts) + GetArtifacts(ctx context.Context, request GetArtifactsRequestObject) (GetArtifactsResponseObject, error) + + // (PUT /artifacts/local-file) + PutArtifactsLocalFile(ctx context.Context, request PutArtifactsLocalFileRequestObject) (PutArtifactsLocalFileResponseObject, error) + + // (PUT /artifacts/remote-file) + PutArtifactsRemoteFile(ctx context.Context, request PutArtifactsRemoteFileRequestObject) (PutArtifactsRemoteFileResponseObject, error) + + // (PUT /artifacts/services/{service_identifier}) + PutArtifactsServicesServiceIdentifier(ctx context.Context, request PutArtifactsServicesServiceIdentifierRequestObject) (PutArtifactsServicesServiceIdentifierResponseObject, error) + + // (GET /artifacts/{artifact_identifier}) + GetArtifactsArtifactIdentifier(ctx context.Context, request GetArtifactsArtifactIdentifierRequestObject) (GetArtifactsArtifactIdentifierResponseObject, error) + + // (GET /artifacts/{artifact_identifier}/download) + GetArtifactsArtifactIdentifierDownload(ctx context.Context, request GetArtifactsArtifactIdentifierDownloadRequestObject) (GetArtifactsArtifactIdentifierDownloadResponseObject, error) + + // (GET /services) + GetServices(ctx context.Context, request GetServicesRequestObject) (GetServicesResponseObject, error) + + // (POST /services/connection) + PostServicesConnection(ctx context.Context, request PostServicesConnectionRequestObject) (PostServicesConnectionResponseObject, error) + + // (GET /services/{service_identifier}) + GetServicesServiceIdentifier(ctx context.Context, request GetServicesServiceIdentifierRequestObject) (GetServicesServiceIdentifierResponseObject, error) + + // (POST /services/{service_identifier}/command) + PostServicesServiceIdentifierCommand(ctx context.Context, request PostServicesServiceIdentifierCommandRequestObject) (PostServicesServiceIdentifierCommandResponseObject, error) + + // (POST /services/{service_identifier}/endpoints/{port_number}/availability) + PostServicesServiceIdentifierEndpointsPortNumberAvailability(ctx context.Context, request PostServicesServiceIdentifierEndpointsPortNumberAvailabilityRequestObject) (PostServicesServiceIdentifierEndpointsPortNumberAvailabilityResponseObject, error) + + // (GET /starlark) + GetStarlark(ctx context.Context, request GetStarlarkRequestObject) (GetStarlarkResponseObject, error) + + // (PUT /starlark/packages) + PutStarlarkPackages(ctx context.Context, request PutStarlarkPackagesRequestObject) (PutStarlarkPackagesResponseObject, error) + + // (POST /starlark/packages/{package_id}) + PostStarlarkPackagesPackageId(ctx context.Context, request PostStarlarkPackagesPackageIdRequestObject) (PostStarlarkPackagesPackageIdResponseObject, error) + + // (POST /starlark/scripts) + PostStarlarkScripts(ctx context.Context, request PostStarlarkScriptsRequestObject) (PostStarlarkScriptsResponseObject, error) +} + +type StrictHandlerFunc func(ctx echo.Context, args interface{}) (interface{}, error) + +type StrictMiddlewareFunc func(f StrictHandlerFunc, operationID string) StrictHandlerFunc + +func NewStrictHandler(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc) ServerInterface { + return &strictHandler{ssi: ssi, middlewares: middlewares} +} + +type strictHandler struct { + ssi StrictServerInterface + middlewares []StrictMiddlewareFunc +} + +// GetArtifacts operation middleware +func (sh *strictHandler) GetArtifacts(ctx echo.Context) error { + var request GetArtifactsRequestObject + + handler := func(ctx echo.Context, request interface{}) (interface{}, error) { + return sh.ssi.GetArtifacts(ctx.Request().Context(), request.(GetArtifactsRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "GetArtifacts") + } + + response, err := handler(ctx, request) + + if err != nil { + return err + } else if validResponse, ok := response.(GetArtifactsResponseObject); ok { + return validResponse.VisitGetArtifactsResponse(ctx.Response()) + } else if response != nil { + return fmt.Errorf("Unexpected response type: %T", response) + } + return nil +} + +// PutArtifactsLocalFile operation middleware +func (sh *strictHandler) PutArtifactsLocalFile(ctx echo.Context) error { + var request PutArtifactsLocalFileRequestObject + + var body PutArtifactsLocalFileJSONRequestBody + if err := ctx.Bind(&body); err != nil { + return err + } + request.Body = &body + + handler := func(ctx echo.Context, request interface{}) (interface{}, error) { + return sh.ssi.PutArtifactsLocalFile(ctx.Request().Context(), request.(PutArtifactsLocalFileRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PutArtifactsLocalFile") + } + + response, err := handler(ctx, request) + + if err != nil { + return err + } else if validResponse, ok := response.(PutArtifactsLocalFileResponseObject); ok { + return validResponse.VisitPutArtifactsLocalFileResponse(ctx.Response()) + } else if response != nil { + return fmt.Errorf("Unexpected response type: %T", response) + } + return nil +} + +// PutArtifactsRemoteFile operation middleware +func (sh *strictHandler) PutArtifactsRemoteFile(ctx echo.Context) error { + var request PutArtifactsRemoteFileRequestObject + + var body PutArtifactsRemoteFileJSONRequestBody + if err := ctx.Bind(&body); err != nil { + return err + } + request.Body = &body + + handler := func(ctx echo.Context, request interface{}) (interface{}, error) { + return sh.ssi.PutArtifactsRemoteFile(ctx.Request().Context(), request.(PutArtifactsRemoteFileRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PutArtifactsRemoteFile") + } + + response, err := handler(ctx, request) + + if err != nil { + return err + } else if validResponse, ok := response.(PutArtifactsRemoteFileResponseObject); ok { + return validResponse.VisitPutArtifactsRemoteFileResponse(ctx.Response()) + } else if response != nil { + return fmt.Errorf("Unexpected response type: %T", response) + } + return nil +} + +// PutArtifactsServicesServiceIdentifier operation middleware +func (sh *strictHandler) PutArtifactsServicesServiceIdentifier(ctx echo.Context, serviceIdentifier string) error { + var request PutArtifactsServicesServiceIdentifierRequestObject + + request.ServiceIdentifier = serviceIdentifier + + var body PutArtifactsServicesServiceIdentifierJSONRequestBody + if err := ctx.Bind(&body); err != nil { + return err + } + request.Body = &body + + handler := func(ctx echo.Context, request interface{}) (interface{}, error) { + return sh.ssi.PutArtifactsServicesServiceIdentifier(ctx.Request().Context(), request.(PutArtifactsServicesServiceIdentifierRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PutArtifactsServicesServiceIdentifier") + } + + response, err := handler(ctx, request) + + if err != nil { + return err + } else if validResponse, ok := response.(PutArtifactsServicesServiceIdentifierResponseObject); ok { + return validResponse.VisitPutArtifactsServicesServiceIdentifierResponse(ctx.Response()) + } else if response != nil { + return fmt.Errorf("Unexpected response type: %T", response) + } + return nil +} + +// GetArtifactsArtifactIdentifier operation middleware +func (sh *strictHandler) GetArtifactsArtifactIdentifier(ctx echo.Context, artifactIdentifier string) error { + var request GetArtifactsArtifactIdentifierRequestObject + + request.ArtifactIdentifier = artifactIdentifier + + handler := func(ctx echo.Context, request interface{}) (interface{}, error) { + return sh.ssi.GetArtifactsArtifactIdentifier(ctx.Request().Context(), request.(GetArtifactsArtifactIdentifierRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "GetArtifactsArtifactIdentifier") + } + + response, err := handler(ctx, request) + + if err != nil { + return err + } else if validResponse, ok := response.(GetArtifactsArtifactIdentifierResponseObject); ok { + return validResponse.VisitGetArtifactsArtifactIdentifierResponse(ctx.Response()) + } else if response != nil { + return fmt.Errorf("Unexpected response type: %T", response) + } + return nil +} + +// GetArtifactsArtifactIdentifierDownload operation middleware +func (sh *strictHandler) GetArtifactsArtifactIdentifierDownload(ctx echo.Context, artifactIdentifier string) error { + var request GetArtifactsArtifactIdentifierDownloadRequestObject + + request.ArtifactIdentifier = artifactIdentifier + + handler := func(ctx echo.Context, request interface{}) (interface{}, error) { + return sh.ssi.GetArtifactsArtifactIdentifierDownload(ctx.Request().Context(), request.(GetArtifactsArtifactIdentifierDownloadRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "GetArtifactsArtifactIdentifierDownload") + } + + response, err := handler(ctx, request) + + if err != nil { + return err + } else if validResponse, ok := response.(GetArtifactsArtifactIdentifierDownloadResponseObject); ok { + return validResponse.VisitGetArtifactsArtifactIdentifierDownloadResponse(ctx.Response()) + } else if response != nil { + return fmt.Errorf("Unexpected response type: %T", response) + } + return nil +} + +// GetServices operation middleware +func (sh *strictHandler) GetServices(ctx echo.Context) error { + var request GetServicesRequestObject + + handler := func(ctx echo.Context, request interface{}) (interface{}, error) { + return sh.ssi.GetServices(ctx.Request().Context(), request.(GetServicesRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "GetServices") + } + + response, err := handler(ctx, request) + + if err != nil { + return err + } else if validResponse, ok := response.(GetServicesResponseObject); ok { + return validResponse.VisitGetServicesResponse(ctx.Response()) + } else if response != nil { + return fmt.Errorf("Unexpected response type: %T", response) + } + return nil +} + +// PostServicesConnection operation middleware +func (sh *strictHandler) PostServicesConnection(ctx echo.Context) error { + var request PostServicesConnectionRequestObject + + var body PostServicesConnectionJSONRequestBody + if err := ctx.Bind(&body); err != nil { + return err + } + request.Body = &body + + handler := func(ctx echo.Context, request interface{}) (interface{}, error) { + return sh.ssi.PostServicesConnection(ctx.Request().Context(), request.(PostServicesConnectionRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PostServicesConnection") + } + + response, err := handler(ctx, request) + + if err != nil { + return err + } else if validResponse, ok := response.(PostServicesConnectionResponseObject); ok { + return validResponse.VisitPostServicesConnectionResponse(ctx.Response()) + } else if response != nil { + return fmt.Errorf("Unexpected response type: %T", response) + } + return nil +} + +// GetServicesServiceIdentifier operation middleware +func (sh *strictHandler) GetServicesServiceIdentifier(ctx echo.Context, serviceIdentifier string, params GetServicesServiceIdentifierParams) error { + var request GetServicesServiceIdentifierRequestObject + + request.ServiceIdentifier = serviceIdentifier + request.Params = params + + handler := func(ctx echo.Context, request interface{}) (interface{}, error) { + return sh.ssi.GetServicesServiceIdentifier(ctx.Request().Context(), request.(GetServicesServiceIdentifierRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "GetServicesServiceIdentifier") + } + + response, err := handler(ctx, request) + + if err != nil { + return err + } else if validResponse, ok := response.(GetServicesServiceIdentifierResponseObject); ok { + return validResponse.VisitGetServicesServiceIdentifierResponse(ctx.Response()) + } else if response != nil { + return fmt.Errorf("Unexpected response type: %T", response) + } + return nil +} + +// PostServicesServiceIdentifierCommand operation middleware +func (sh *strictHandler) PostServicesServiceIdentifierCommand(ctx echo.Context, serviceIdentifier string) error { + var request PostServicesServiceIdentifierCommandRequestObject + + request.ServiceIdentifier = serviceIdentifier + + var body PostServicesServiceIdentifierCommandJSONRequestBody + if err := ctx.Bind(&body); err != nil { + return err + } + request.Body = &body + + handler := func(ctx echo.Context, request interface{}) (interface{}, error) { + return sh.ssi.PostServicesServiceIdentifierCommand(ctx.Request().Context(), request.(PostServicesServiceIdentifierCommandRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PostServicesServiceIdentifierCommand") + } + + response, err := handler(ctx, request) + + if err != nil { + return err + } else if validResponse, ok := response.(PostServicesServiceIdentifierCommandResponseObject); ok { + return validResponse.VisitPostServicesServiceIdentifierCommandResponse(ctx.Response()) + } else if response != nil { + return fmt.Errorf("Unexpected response type: %T", response) + } + return nil +} + +// PostServicesServiceIdentifierEndpointsPortNumberAvailability operation middleware +func (sh *strictHandler) PostServicesServiceIdentifierEndpointsPortNumberAvailability(ctx echo.Context, serviceIdentifier string, portNumber int) error { + var request PostServicesServiceIdentifierEndpointsPortNumberAvailabilityRequestObject + + request.ServiceIdentifier = serviceIdentifier + request.PortNumber = portNumber + + var body PostServicesServiceIdentifierEndpointsPortNumberAvailabilityJSONRequestBody + if err := ctx.Bind(&body); err != nil { + return err + } + request.Body = &body + + handler := func(ctx echo.Context, request interface{}) (interface{}, error) { + return sh.ssi.PostServicesServiceIdentifierEndpointsPortNumberAvailability(ctx.Request().Context(), request.(PostServicesServiceIdentifierEndpointsPortNumberAvailabilityRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PostServicesServiceIdentifierEndpointsPortNumberAvailability") + } + + response, err := handler(ctx, request) + + if err != nil { + return err + } else if validResponse, ok := response.(PostServicesServiceIdentifierEndpointsPortNumberAvailabilityResponseObject); ok { + return validResponse.VisitPostServicesServiceIdentifierEndpointsPortNumberAvailabilityResponse(ctx.Response()) + } else if response != nil { + return fmt.Errorf("Unexpected response type: %T", response) + } + return nil +} + +// GetStarlark operation middleware +func (sh *strictHandler) GetStarlark(ctx echo.Context) error { + var request GetStarlarkRequestObject + + handler := func(ctx echo.Context, request interface{}) (interface{}, error) { + return sh.ssi.GetStarlark(ctx.Request().Context(), request.(GetStarlarkRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "GetStarlark") + } + + response, err := handler(ctx, request) + + if err != nil { + return err + } else if validResponse, ok := response.(GetStarlarkResponseObject); ok { + return validResponse.VisitGetStarlarkResponse(ctx.Response()) + } else if response != nil { + return fmt.Errorf("Unexpected response type: %T", response) + } + return nil +} + +// PutStarlarkPackages operation middleware +func (sh *strictHandler) PutStarlarkPackages(ctx echo.Context) error { + var request PutStarlarkPackagesRequestObject + + var body PutStarlarkPackagesJSONRequestBody + if err := ctx.Bind(&body); err != nil { + return err + } + request.Body = &body + + handler := func(ctx echo.Context, request interface{}) (interface{}, error) { + return sh.ssi.PutStarlarkPackages(ctx.Request().Context(), request.(PutStarlarkPackagesRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PutStarlarkPackages") + } + + response, err := handler(ctx, request) + + if err != nil { + return err + } else if validResponse, ok := response.(PutStarlarkPackagesResponseObject); ok { + return validResponse.VisitPutStarlarkPackagesResponse(ctx.Response()) + } else if response != nil { + return fmt.Errorf("Unexpected response type: %T", response) + } + return nil +} + +// PostStarlarkPackagesPackageId operation middleware +func (sh *strictHandler) PostStarlarkPackagesPackageId(ctx echo.Context, packageId string) error { + var request PostStarlarkPackagesPackageIdRequestObject + + request.PackageId = packageId + + var body PostStarlarkPackagesPackageIdJSONRequestBody + if err := ctx.Bind(&body); err != nil { + return err + } + request.Body = &body + + handler := func(ctx echo.Context, request interface{}) (interface{}, error) { + return sh.ssi.PostStarlarkPackagesPackageId(ctx.Request().Context(), request.(PostStarlarkPackagesPackageIdRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PostStarlarkPackagesPackageId") + } + + response, err := handler(ctx, request) + + if err != nil { + return err + } else if validResponse, ok := response.(PostStarlarkPackagesPackageIdResponseObject); ok { + return validResponse.VisitPostStarlarkPackagesPackageIdResponse(ctx.Response()) + } else if response != nil { + return fmt.Errorf("Unexpected response type: %T", response) + } + return nil +} + +// PostStarlarkScripts operation middleware +func (sh *strictHandler) PostStarlarkScripts(ctx echo.Context) error { + var request PostStarlarkScriptsRequestObject + + var body PostStarlarkScriptsJSONRequestBody + if err := ctx.Bind(&body); err != nil { + return err + } + request.Body = &body + + handler := func(ctx echo.Context, request interface{}) (interface{}, error) { + return sh.ssi.PostStarlarkScripts(ctx.Request().Context(), request.(PostStarlarkScriptsRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PostStarlarkScripts") + } + + response, err := handler(ctx, request) + + if err != nil { + return err + } else if validResponse, ok := response.(PostStarlarkScriptsResponseObject); ok { + return validResponse.VisitPostStarlarkScriptsResponse(ctx.Response()) + } else if response != nil { + return fmt.Errorf("Unexpected response type: %T", response) + } + return nil +} + // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ diff --git a/api/golang/engine/kurtosis_engine_http_api_bindings/engine_server.gen.go b/api/golang/engine/kurtosis_engine_http_api_bindings/engine_server.gen.go index e7574da42b..8a6229dbf2 100644 --- a/api/golang/engine/kurtosis_engine_http_api_bindings/engine_server.gen.go +++ b/api/golang/engine/kurtosis_engine_http_api_bindings/engine_server.gen.go @@ -6,7 +6,9 @@ package kurtosis_engine_http_api_bindings import ( "bytes" "compress/gzip" + "context" "encoding/base64" + "encoding/json" "fmt" "net/http" "net/url" @@ -212,6 +214,430 @@ func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL } +type DeleteEnclavesRequestObject struct { + Params DeleteEnclavesParams +} + +type DeleteEnclavesResponseObject interface { + VisitDeleteEnclavesResponse(w http.ResponseWriter) error +} + +type DeleteEnclaves200JSONResponse CleanResponse + +func (response DeleteEnclaves200JSONResponse) VisitDeleteEnclavesResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type GetEnclavesRequestObject struct { +} + +type GetEnclavesResponseObject interface { + VisitGetEnclavesResponse(w http.ResponseWriter) error +} + +type GetEnclaves200JSONResponse GetEnclavesResponse + +func (response GetEnclaves200JSONResponse) VisitGetEnclavesResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PostEnclavesRequestObject struct { + Body *PostEnclavesJSONRequestBody +} + +type PostEnclavesResponseObject interface { + VisitPostEnclavesResponse(w http.ResponseWriter) error +} + +type PostEnclaves200JSONResponse CreateEnclaveResponse + +func (response PostEnclaves200JSONResponse) VisitPostEnclavesResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type GetEnclavesHistoricalRequestObject struct { +} + +type GetEnclavesHistoricalResponseObject interface { + VisitGetEnclavesHistoricalResponse(w http.ResponseWriter) error +} + +type GetEnclavesHistorical200JSONResponse GetExistingAndHistoricalEnclaveIdentifiersResponse + +func (response GetEnclavesHistorical200JSONResponse) VisitGetEnclavesHistoricalResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type DeleteEnclavesEnclaveIdentifierRequestObject struct { + EnclaveIdentifier string `json:"enclave_identifier"` +} + +type DeleteEnclavesEnclaveIdentifierResponseObject interface { + VisitDeleteEnclavesEnclaveIdentifierResponse(w http.ResponseWriter) error +} + +type DeleteEnclavesEnclaveIdentifier200JSONResponse map[string]interface{} + +func (response DeleteEnclavesEnclaveIdentifier200JSONResponse) VisitDeleteEnclavesEnclaveIdentifierResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type GetEnclavesEnclaveIdentifierRequestObject struct { + EnclaveIdentifier string `json:"enclave_identifier"` +} + +type GetEnclavesEnclaveIdentifierResponseObject interface { + VisitGetEnclavesEnclaveIdentifierResponse(w http.ResponseWriter) error +} + +type GetEnclavesEnclaveIdentifier200JSONResponse EnclaveInfo + +func (response GetEnclavesEnclaveIdentifier200JSONResponse) VisitGetEnclavesEnclaveIdentifierResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PostEnclavesEnclaveIdentifierLogsRequestObject struct { + EnclaveIdentifier string `json:"enclave_identifier"` + Body *PostEnclavesEnclaveIdentifierLogsJSONRequestBody +} + +type PostEnclavesEnclaveIdentifierLogsResponseObject interface { + VisitPostEnclavesEnclaveIdentifierLogsResponse(w http.ResponseWriter) error +} + +type PostEnclavesEnclaveIdentifierLogs200JSONResponse GetServiceLogsResponse + +func (response PostEnclavesEnclaveIdentifierLogs200JSONResponse) VisitPostEnclavesEnclaveIdentifierLogsResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PostEnclavesEnclaveIdentifierStopRequestObject struct { + EnclaveIdentifier string `json:"enclave_identifier"` +} + +type PostEnclavesEnclaveIdentifierStopResponseObject interface { + VisitPostEnclavesEnclaveIdentifierStopResponse(w http.ResponseWriter) error +} + +type PostEnclavesEnclaveIdentifierStop200JSONResponse map[string]interface{} + +func (response PostEnclavesEnclaveIdentifierStop200JSONResponse) VisitPostEnclavesEnclaveIdentifierStopResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type GetEngineInfoRequestObject struct { +} + +type GetEngineInfoResponseObject interface { + VisitGetEngineInfoResponse(w http.ResponseWriter) error +} + +type GetEngineInfo200JSONResponse GetEngineInfoResponse + +func (response GetEngineInfo200JSONResponse) VisitGetEngineInfoResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +// StrictServerInterface represents all server handlers. +type StrictServerInterface interface { + // Delete Enclaves + // (DELETE /enclaves) + DeleteEnclaves(ctx context.Context, request DeleteEnclavesRequestObject) (DeleteEnclavesResponseObject, error) + // Get Enclaves + // (GET /enclaves) + GetEnclaves(ctx context.Context, request GetEnclavesRequestObject) (GetEnclavesResponseObject, error) + // Create Enclave + // (POST /enclaves) + PostEnclaves(ctx context.Context, request PostEnclavesRequestObject) (PostEnclavesResponseObject, error) + // Get Historical Enclaves + // (GET /enclaves/historical) + GetEnclavesHistorical(ctx context.Context, request GetEnclavesHistoricalRequestObject) (GetEnclavesHistoricalResponseObject, error) + // Destroy Enclave + // (DELETE /enclaves/{enclave_identifier}) + DeleteEnclavesEnclaveIdentifier(ctx context.Context, request DeleteEnclavesEnclaveIdentifierRequestObject) (DeleteEnclavesEnclaveIdentifierResponseObject, error) + // Get Enclave Info + // (GET /enclaves/{enclave_identifier}) + GetEnclavesEnclaveIdentifier(ctx context.Context, request GetEnclavesEnclaveIdentifierRequestObject) (GetEnclavesEnclaveIdentifierResponseObject, error) + // Get Service Logs + // (POST /enclaves/{enclave_identifier}/logs) + PostEnclavesEnclaveIdentifierLogs(ctx context.Context, request PostEnclavesEnclaveIdentifierLogsRequestObject) (PostEnclavesEnclaveIdentifierLogsResponseObject, error) + // Stop Enclave + // (POST /enclaves/{enclave_identifier}/stop) + PostEnclavesEnclaveIdentifierStop(ctx context.Context, request PostEnclavesEnclaveIdentifierStopRequestObject) (PostEnclavesEnclaveIdentifierStopResponseObject, error) + // Get Engine Info + // (GET /engine/info) + GetEngineInfo(ctx context.Context, request GetEngineInfoRequestObject) (GetEngineInfoResponseObject, error) +} + +type StrictHandlerFunc func(ctx echo.Context, args interface{}) (interface{}, error) + +type StrictMiddlewareFunc func(f StrictHandlerFunc, operationID string) StrictHandlerFunc + +func NewStrictHandler(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc) ServerInterface { + return &strictHandler{ssi: ssi, middlewares: middlewares} +} + +type strictHandler struct { + ssi StrictServerInterface + middlewares []StrictMiddlewareFunc +} + +// DeleteEnclaves operation middleware +func (sh *strictHandler) DeleteEnclaves(ctx echo.Context, params DeleteEnclavesParams) error { + var request DeleteEnclavesRequestObject + + request.Params = params + + handler := func(ctx echo.Context, request interface{}) (interface{}, error) { + return sh.ssi.DeleteEnclaves(ctx.Request().Context(), request.(DeleteEnclavesRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "DeleteEnclaves") + } + + response, err := handler(ctx, request) + + if err != nil { + return err + } else if validResponse, ok := response.(DeleteEnclavesResponseObject); ok { + return validResponse.VisitDeleteEnclavesResponse(ctx.Response()) + } else if response != nil { + return fmt.Errorf("Unexpected response type: %T", response) + } + return nil +} + +// GetEnclaves operation middleware +func (sh *strictHandler) GetEnclaves(ctx echo.Context) error { + var request GetEnclavesRequestObject + + handler := func(ctx echo.Context, request interface{}) (interface{}, error) { + return sh.ssi.GetEnclaves(ctx.Request().Context(), request.(GetEnclavesRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "GetEnclaves") + } + + response, err := handler(ctx, request) + + if err != nil { + return err + } else if validResponse, ok := response.(GetEnclavesResponseObject); ok { + return validResponse.VisitGetEnclavesResponse(ctx.Response()) + } else if response != nil { + return fmt.Errorf("Unexpected response type: %T", response) + } + return nil +} + +// PostEnclaves operation middleware +func (sh *strictHandler) PostEnclaves(ctx echo.Context) error { + var request PostEnclavesRequestObject + + var body PostEnclavesJSONRequestBody + if err := ctx.Bind(&body); err != nil { + return err + } + request.Body = &body + + handler := func(ctx echo.Context, request interface{}) (interface{}, error) { + return sh.ssi.PostEnclaves(ctx.Request().Context(), request.(PostEnclavesRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PostEnclaves") + } + + response, err := handler(ctx, request) + + if err != nil { + return err + } else if validResponse, ok := response.(PostEnclavesResponseObject); ok { + return validResponse.VisitPostEnclavesResponse(ctx.Response()) + } else if response != nil { + return fmt.Errorf("Unexpected response type: %T", response) + } + return nil +} + +// GetEnclavesHistorical operation middleware +func (sh *strictHandler) GetEnclavesHistorical(ctx echo.Context) error { + var request GetEnclavesHistoricalRequestObject + + handler := func(ctx echo.Context, request interface{}) (interface{}, error) { + return sh.ssi.GetEnclavesHistorical(ctx.Request().Context(), request.(GetEnclavesHistoricalRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "GetEnclavesHistorical") + } + + response, err := handler(ctx, request) + + if err != nil { + return err + } else if validResponse, ok := response.(GetEnclavesHistoricalResponseObject); ok { + return validResponse.VisitGetEnclavesHistoricalResponse(ctx.Response()) + } else if response != nil { + return fmt.Errorf("Unexpected response type: %T", response) + } + return nil +} + +// DeleteEnclavesEnclaveIdentifier operation middleware +func (sh *strictHandler) DeleteEnclavesEnclaveIdentifier(ctx echo.Context, enclaveIdentifier string) error { + var request DeleteEnclavesEnclaveIdentifierRequestObject + + request.EnclaveIdentifier = enclaveIdentifier + + handler := func(ctx echo.Context, request interface{}) (interface{}, error) { + return sh.ssi.DeleteEnclavesEnclaveIdentifier(ctx.Request().Context(), request.(DeleteEnclavesEnclaveIdentifierRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "DeleteEnclavesEnclaveIdentifier") + } + + response, err := handler(ctx, request) + + if err != nil { + return err + } else if validResponse, ok := response.(DeleteEnclavesEnclaveIdentifierResponseObject); ok { + return validResponse.VisitDeleteEnclavesEnclaveIdentifierResponse(ctx.Response()) + } else if response != nil { + return fmt.Errorf("Unexpected response type: %T", response) + } + return nil +} + +// GetEnclavesEnclaveIdentifier operation middleware +func (sh *strictHandler) GetEnclavesEnclaveIdentifier(ctx echo.Context, enclaveIdentifier string) error { + var request GetEnclavesEnclaveIdentifierRequestObject + + request.EnclaveIdentifier = enclaveIdentifier + + handler := func(ctx echo.Context, request interface{}) (interface{}, error) { + return sh.ssi.GetEnclavesEnclaveIdentifier(ctx.Request().Context(), request.(GetEnclavesEnclaveIdentifierRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "GetEnclavesEnclaveIdentifier") + } + + response, err := handler(ctx, request) + + if err != nil { + return err + } else if validResponse, ok := response.(GetEnclavesEnclaveIdentifierResponseObject); ok { + return validResponse.VisitGetEnclavesEnclaveIdentifierResponse(ctx.Response()) + } else if response != nil { + return fmt.Errorf("Unexpected response type: %T", response) + } + return nil +} + +// PostEnclavesEnclaveIdentifierLogs operation middleware +func (sh *strictHandler) PostEnclavesEnclaveIdentifierLogs(ctx echo.Context, enclaveIdentifier string) error { + var request PostEnclavesEnclaveIdentifierLogsRequestObject + + request.EnclaveIdentifier = enclaveIdentifier + + var body PostEnclavesEnclaveIdentifierLogsJSONRequestBody + if err := ctx.Bind(&body); err != nil { + return err + } + request.Body = &body + + handler := func(ctx echo.Context, request interface{}) (interface{}, error) { + return sh.ssi.PostEnclavesEnclaveIdentifierLogs(ctx.Request().Context(), request.(PostEnclavesEnclaveIdentifierLogsRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PostEnclavesEnclaveIdentifierLogs") + } + + response, err := handler(ctx, request) + + if err != nil { + return err + } else if validResponse, ok := response.(PostEnclavesEnclaveIdentifierLogsResponseObject); ok { + return validResponse.VisitPostEnclavesEnclaveIdentifierLogsResponse(ctx.Response()) + } else if response != nil { + return fmt.Errorf("Unexpected response type: %T", response) + } + return nil +} + +// PostEnclavesEnclaveIdentifierStop operation middleware +func (sh *strictHandler) PostEnclavesEnclaveIdentifierStop(ctx echo.Context, enclaveIdentifier string) error { + var request PostEnclavesEnclaveIdentifierStopRequestObject + + request.EnclaveIdentifier = enclaveIdentifier + + handler := func(ctx echo.Context, request interface{}) (interface{}, error) { + return sh.ssi.PostEnclavesEnclaveIdentifierStop(ctx.Request().Context(), request.(PostEnclavesEnclaveIdentifierStopRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "PostEnclavesEnclaveIdentifierStop") + } + + response, err := handler(ctx, request) + + if err != nil { + return err + } else if validResponse, ok := response.(PostEnclavesEnclaveIdentifierStopResponseObject); ok { + return validResponse.VisitPostEnclavesEnclaveIdentifierStopResponse(ctx.Response()) + } else if response != nil { + return fmt.Errorf("Unexpected response type: %T", response) + } + return nil +} + +// GetEngineInfo operation middleware +func (sh *strictHandler) GetEngineInfo(ctx echo.Context) error { + var request GetEngineInfoRequestObject + + handler := func(ctx echo.Context, request interface{}) (interface{}, error) { + return sh.ssi.GetEngineInfo(ctx.Request().Context(), request.(GetEngineInfoRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "GetEngineInfo") + } + + response, err := handler(ctx, request) + + if err != nil { + return err + } else if validResponse, ok := response.(GetEngineInfoResponseObject); ok { + return validResponse.VisitGetEngineInfoResponse(ctx.Response()) + } else if response != nil { + return fmt.Errorf("Unexpected response type: %T", response) + } + return nil +} + // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ diff --git a/api/openapi/core/server.cfg.yaml b/api/openapi/core/server.cfg.yaml index bd5e98ac34..f21a52155d 100644 --- a/api/openapi/core/server.cfg.yaml +++ b/api/openapi/core/server.cfg.yaml @@ -2,4 +2,5 @@ package: kurtosis_core_http_api_bindings generate: embedded-spec: true echo-server: true + strict-server: true output: api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go \ No newline at end of file diff --git a/api/openapi/engine/server.cfg.yaml b/api/openapi/engine/server.cfg.yaml index ecb438b9ab..db358c3fb7 100644 --- a/api/openapi/engine/server.cfg.yaml +++ b/api/openapi/engine/server.cfg.yaml @@ -2,4 +2,5 @@ package: kurtosis_engine_http_api_bindings generate: embedded-spec: true echo-server: true + strict-server: true output: api/golang/engine/kurtosis_engine_http_api_bindings/engine_server.gen.go \ No newline at end of file From f07706577eec52fffd5dfe6058d9fe15c2535adb Mon Sep 17 00:00:00 2001 From: lostbean Date: Mon, 13 Nov 2023 18:00:10 -0300 Subject: [PATCH 07/95] Decouple inner types --- .../engine/enclave_manager/enclave_creator.go | 29 ++-- .../engine/enclave_manager/enclave_manager.go | 124 ++++++++--------- .../engine/enclave_manager/enclave_pool.go | 23 ++-- .../server/engine_connect_server_service.go | 130 ++++++++++++++++-- engine/server/engine/types/engine_types.go | 118 ++++++++++++++++ 5 files changed, 325 insertions(+), 99 deletions(-) create mode 100644 engine/server/engine/types/engine_types.go diff --git a/engine/server/engine/enclave_manager/enclave_creator.go b/engine/server/engine/enclave_manager/enclave_creator.go index 41fad2c683..15eaac9b4b 100644 --- a/engine/server/engine/enclave_manager/enclave_creator.go +++ b/engine/server/engine/enclave_manager/enclave_creator.go @@ -2,12 +2,13 @@ package enclave_manager import ( "context" - "github.com/kurtosis-tech/kurtosis/api/golang/engine/kurtosis_engine_rpc_api_bindings" + "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface" "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/api_container" "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/enclave" "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/uuid_generator" "github.com/kurtosis-tech/kurtosis/core/launcher/api_container_launcher" + "github.com/kurtosis-tech/kurtosis/engine/server/engine/types" "github.com/kurtosis-tech/kurtosis/metrics-library/golang/lib/metrics_client" "github.com/kurtosis-tech/stacktrace" "github.com/sirupsen/logrus" @@ -43,7 +44,7 @@ func (creator *EnclaveCreator) CreateEnclave( isCI bool, cloudUserID metrics_client.CloudUserID, cloudInstanceID metrics_client.CloudInstanceID, -) (*kurtosis_engine_rpc_api_bindings.EnclaveInfo, error) { +) (*types.EnclaveInfo, error) { uuid, err := uuid_generator.GenerateUUIDString() if err != nil { @@ -109,11 +110,11 @@ func (creator *EnclaveCreator) CreateEnclave( } }() - var apiContainerHostMachineInfo *kurtosis_engine_rpc_api_bindings.EnclaveAPIContainerHostMachineInfo + var apiContainerHostMachineInfo *types.EnclaveAPIContainerHostMachineInfo if apiContainer.GetPublicIPAddress() != nil && apiContainer.GetPublicGRPCPort() != nil { - apiContainerHostMachineInfo = &kurtosis_engine_rpc_api_bindings.EnclaveAPIContainerHostMachineInfo{ + apiContainerHostMachineInfo = &types.EnclaveAPIContainerHostMachineInfo{ IpOnHostMachine: apiContainer.GetPublicIPAddress().String(), GrpcPortOnHostMachine: uint32(apiContainer.GetPublicGRPCPort().GetNumber()), } @@ -132,25 +133,25 @@ func (creator *EnclaveCreator) CreateEnclave( bridgeIpAddr = apiContainer.GetBridgeNetworkIPAddress().String() } - mode := kurtosis_engine_rpc_api_bindings.EnclaveMode_TEST + mode := types.EnclaveMode_TEST if newEnclave.IsProductionEnclave() { - mode = kurtosis_engine_rpc_api_bindings.EnclaveMode_PRODUCTION + mode = types.EnclaveMode_PRODUCTION } - newEnclaveInfo := &kurtosis_engine_rpc_api_bindings.EnclaveInfo{ - EnclaveUuid: newEnclaveUuidStr, - Name: newEnclave.GetName(), - ShortenedUuid: shortenedUuid, - ContainersStatus: kurtosis_engine_rpc_api_bindings.EnclaveContainersStatus_EnclaveContainersStatus_RUNNING, - ApiContainerStatus: kurtosis_engine_rpc_api_bindings.EnclaveAPIContainerStatus_EnclaveAPIContainerStatus_RUNNING, - ApiContainerInfo: &kurtosis_engine_rpc_api_bindings.EnclaveAPIContainerInfo{ + newEnclaveInfo := &types.EnclaveInfo{ + EnclaveUuid: newEnclaveUuidStr, + Name: newEnclave.GetName(), + ShortenedUuid: shortenedUuid, + EnclaveContainersStatus: types.EnclaveContainersStatus_RUNNING, + ApiContainerStatus: types.ContainerStatus_RUNNING, + ApiContainerInfo: &types.EnclaveAPIContainerInfo{ ContainerId: "", IpInsideEnclave: apiContainer.GetPrivateIPAddress().String(), GrpcPortInsideEnclave: uint32(apiContainerListenGrpcPortNumInsideNetwork), BridgeIpAddress: bridgeIpAddr, }, ApiContainerHostMachineInfo: apiContainerHostMachineInfo, - CreationTime: creationTimestamp, + CreationTime: *creationTimestamp, Mode: mode, } diff --git a/engine/server/engine/enclave_manager/enclave_manager.go b/engine/server/engine/enclave_manager/enclave_manager.go index 023a72c292..332054ccd6 100644 --- a/engine/server/engine/enclave_manager/enclave_manager.go +++ b/engine/server/engine/enclave_manager/enclave_manager.go @@ -3,14 +3,15 @@ package enclave_manager import ( "context" "fmt" - "github.com/kurtosis-tech/kurtosis/engine/server/engine/centralized_logs/client_implementations/persistent_volume/log_file_manager" - "github.com/kurtosis-tech/kurtosis/metrics-library/golang/lib/metrics_client" "sort" "strings" "sync" + "time" + + "github.com/kurtosis-tech/kurtosis/engine/server/engine/centralized_logs/client_implementations/persistent_volume/log_file_manager" + "github.com/kurtosis-tech/kurtosis/metrics-library/golang/lib/metrics_client" - "github.com/kurtosis-tech/kurtosis/api/golang/engine/kurtosis_engine_rpc_api_bindings" - "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/docker_manager/types" + dockerTypes "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/docker_manager/types" "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface" "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/api_container" "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/container" @@ -18,10 +19,10 @@ import ( "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/uuid_generator" "github.com/kurtosis-tech/kurtosis/core/launcher/api_container_launcher" "github.com/kurtosis-tech/kurtosis/engine/launcher/args" + "github.com/kurtosis-tech/kurtosis/engine/server/engine/types" "github.com/kurtosis-tech/kurtosis/name_generator" "github.com/kurtosis-tech/stacktrace" "github.com/sirupsen/logrus" - "google.golang.org/protobuf/types/known/timestamppb" ) const ( @@ -38,14 +39,14 @@ const ( // TODO Move this to the KurtosisBackend to calculate!! // Completeness enforced via unit test -var isContainerRunningDeterminer = map[types.ContainerStatus]bool{ - types.ContainerStatus_Paused: false, - types.ContainerStatus_Restarting: true, - types.ContainerStatus_Running: true, - types.ContainerStatus_Removing: false, - types.ContainerStatus_Dead: false, - types.ContainerStatus_Created: false, - types.ContainerStatus_Exited: false, +var isContainerRunningDeterminer = map[dockerTypes.ContainerStatus]bool{ + dockerTypes.ContainerStatus_Paused: false, + dockerTypes.ContainerStatus_Restarting: true, + dockerTypes.ContainerStatus_Running: true, + dockerTypes.ContainerStatus_Removing: false, + dockerTypes.ContainerStatus_Dead: false, + dockerTypes.ContainerStatus_Created: false, + dockerTypes.ContainerStatus_Exited: false, } // Manages Kurtosis enclaves, and creates new ones in response to running tasks @@ -60,7 +61,7 @@ type EnclaveManager struct { // this is a stop gap solution, this would be stored and retrieved from the DB in the future // we go with the GRPC type as it is just used by the engine server service // this is an append only list - allExistingAndHistoricalIdentifiers []*kurtosis_engine_rpc_api_bindings.EnclaveIdentifiers + allExistingAndHistoricalIdentifiers []*types.EnclaveIdentifiers enclaveCreator *EnclaveCreator enclavePool *EnclavePool @@ -107,7 +108,7 @@ func CreateEnclaveManager( mutex: &sync.Mutex{}, kurtosisBackend: kurtosisBackend, apiContainerKurtosisBackendConfigSupplier: apiContainerKurtosisBackendConfigSupplier, - allExistingAndHistoricalIdentifiers: []*kurtosis_engine_rpc_api_bindings.EnclaveIdentifiers{}, + allExistingAndHistoricalIdentifiers: []*types.EnclaveIdentifiers{}, enclaveCreator: enclaveCreator, enclavePool: enclavePool, enclaveEnvVars: enclaveEnvVars, @@ -134,12 +135,12 @@ func (manager *EnclaveManager) CreateEnclave( //If blank, will use a random one enclaveName string, isProduction bool, -) (*kurtosis_engine_rpc_api_bindings.EnclaveInfo, error) { +) (*types.EnclaveInfo, error) { manager.mutex.Lock() defer manager.mutex.Unlock() var ( - enclaveInfo *kurtosis_engine_rpc_api_bindings.EnclaveInfo + enclaveInfo *types.EnclaveInfo err error ) @@ -201,7 +202,7 @@ func (manager *EnclaveManager) CreateEnclave( } } - enclaveIdentifier := &kurtosis_engine_rpc_api_bindings.EnclaveIdentifiers{ + enclaveIdentifier := &types.EnclaveIdentifiers{ EnclaveUuid: enclaveInfo.EnclaveUuid, Name: enclaveInfo.Name, ShortenedUuid: enclaveInfo.ShortenedUuid, @@ -216,7 +217,7 @@ func (manager *EnclaveManager) CreateEnclave( // is only used by the EngineServerService so we might as well return the object that EngineServerService wants func (manager *EnclaveManager) GetEnclaves( ctx context.Context, -) (map[string]*kurtosis_engine_rpc_api_bindings.EnclaveInfo, error) { +) (map[string]*types.EnclaveInfo, error) { manager.mutex.Lock() defer manager.mutex.Unlock() @@ -226,7 +227,7 @@ func (manager *EnclaveManager) GetEnclaves( } // Transform map[enclave.EnclaveUUID]*EnclaveInfo -> map[string]*EnclaveInfo - enclaveMapKeyedWithUuidStr := map[string]*kurtosis_engine_rpc_api_bindings.EnclaveInfo{} + enclaveMapKeyedWithUuidStr := map[string]*types.EnclaveInfo{} for enclaveUuid, enclaveInfo := range enclaves { enclaveMapKeyedWithUuidStr[string(enclaveUuid)] = enclaveInfo } @@ -282,11 +283,11 @@ func (manager *EnclaveManager) DestroyEnclave(ctx context.Context, enclaveIdenti return destructionErr } -func (manager *EnclaveManager) Clean(ctx context.Context, shouldCleanAll bool) ([]*kurtosis_engine_rpc_api_bindings.EnclaveNameAndUuid, error) { +func (manager *EnclaveManager) Clean(ctx context.Context, shouldCleanAll bool) ([]*types.EnclaveNameAndUuid, error) { manager.mutex.Lock() defer manager.mutex.Unlock() // TODO: Refactor with kurtosis backend - var resultEnclaveNameAndUuids []*kurtosis_engine_rpc_api_bindings.EnclaveNameAndUuid + var resultEnclaveNameAndUuids []*types.EnclaveNameAndUuid // we prefetch the enclaves before deletion so that we have metadata enclavesForUuidNameMapping, err := manager.getEnclavesWithoutMutex(ctx) @@ -320,7 +321,7 @@ func (manager *EnclaveManager) Clean(ctx context.Context, shouldCleanAll bool) ( logrus.Infof("Successfully removed the enclaves") sort.Strings(successfullyRemovedEnclaveUuidStrs) for _, successfullyRemovedEnclaveUuidStr := range successfullyRemovedEnclaveUuidStrs { - nameAndUuid := &kurtosis_engine_rpc_api_bindings.EnclaveNameAndUuid{ + nameAndUuid := &types.EnclaveNameAndUuid{ Uuid: successfullyRemovedEnclaveUuidStr, Name: enclaveNameNotFound, } @@ -328,7 +329,7 @@ func (manager *EnclaveManager) Clean(ctx context.Context, shouldCleanAll bool) ( // we just use the default not found that we set above if we can't find the name enclave, found := enclavesForUuidNameMapping[enclave.EnclaveUUID(successfullyRemovedEnclaveUuidStr)] if found { - nameAndUuid.Name = enclave.GetName() + nameAndUuid.Name = enclave.Name } resultEnclaveNameAndUuids = append(resultEnclaveNameAndUuids, nameAndUuid) logrus.Infof("Enclave Uuid '%v'", successfullyRemovedEnclaveUuidStr) @@ -345,7 +346,7 @@ func (manager *EnclaveManager) GetEnclaveUuidForEnclaveIdentifier(ctx context.Co return manager.getEnclaveUuidForIdentifierUnlocked(ctx, enclaveIdentifier) } -func (manager *EnclaveManager) GetExistingAndHistoricalEnclaveIdentifiers() ([]*kurtosis_engine_rpc_api_bindings.EnclaveIdentifiers, error) { +func (manager *EnclaveManager) GetExistingAndHistoricalEnclaveIdentifiers() ([]*types.EnclaveIdentifiers, error) { manager.mutex.Lock() defer manager.mutex.Unlock() @@ -353,14 +354,14 @@ func (manager *EnclaveManager) GetExistingAndHistoricalEnclaveIdentifiers() ([]* } // this should be called from a thread safe context -func (manager *EnclaveManager) getExistingAndHistoricalEnclaveIdentifiersWithoutMutex() ([]*kurtosis_engine_rpc_api_bindings.EnclaveIdentifiers, error) { +func (manager *EnclaveManager) getExistingAndHistoricalEnclaveIdentifiersWithoutMutex() ([]*types.EnclaveIdentifiers, error) { if len(manager.allExistingAndHistoricalIdentifiers) > 0 { return manager.allExistingAndHistoricalIdentifiers, nil } // either the engine got restarted or no enclaves have been created so far - var enclaveIdentifiersResult []*kurtosis_engine_rpc_api_bindings.EnclaveIdentifiers + var enclaveIdentifiersResult []*types.EnclaveIdentifiers // TODO fix this - this is a hack while we persist enclave identifier information to disk // this is a hack that will only send enclaves that are still registered; removed or destroyed enclaves will not show up ctx := context.Background() @@ -370,7 +371,7 @@ func (manager *EnclaveManager) getExistingAndHistoricalEnclaveIdentifiersWithout } for _, enclave := range allCurrentEnclavesToBackFillRestart { - identifiers := &kurtosis_engine_rpc_api_bindings.EnclaveIdentifiers{ + identifiers := &types.EnclaveIdentifiers{ EnclaveUuid: enclave.EnclaveUuid, Name: enclave.Name, ShortenedUuid: enclave.ShortenedUuid, @@ -390,23 +391,23 @@ func getEnclaveApiContainerInformation( kurtosisBackend backend_interface.KurtosisBackend, enclaveId enclave.EnclaveUUID, ) ( - kurtosis_engine_rpc_api_bindings.EnclaveAPIContainerStatus, - *kurtosis_engine_rpc_api_bindings.EnclaveAPIContainerInfo, - *kurtosis_engine_rpc_api_bindings.EnclaveAPIContainerHostMachineInfo, + types.ContainerStatus, + *types.EnclaveAPIContainerInfo, + *types.EnclaveAPIContainerHostMachineInfo, error, ) { apiContainerByEnclaveIdFilter := getApiContainerByEnclaveIdFilter(enclaveId) enclaveApiContainers, err := kurtosisBackend.GetAPIContainers(ctx, apiContainerByEnclaveIdFilter) if err != nil { - return 0, nil, nil, stacktrace.Propagate(err, "An error occurred getting the containers for enclave '%v'", enclaveId) + return types.ContainerStatus_NONEXISTENT, nil, nil, stacktrace.Propagate(err, "An error occurred getting the containers for enclave '%v'", enclaveId) } numOfFoundApiContainers := len(enclaveApiContainers) if numOfFoundApiContainers == 0 { - return kurtosis_engine_rpc_api_bindings.EnclaveAPIContainerStatus_EnclaveAPIContainerStatus_NONEXISTENT, + return types.ContainerStatus_NONEXISTENT, nil, nil, nil } if numOfFoundApiContainers > 1 { - return 0, nil, nil, stacktrace.NewError("Expected to be able to find only one API container associated with enclave '%v', instead found '%v'", + return types.ContainerStatus_NONEXISTENT, nil, nil, stacktrace.NewError("Expected to be able to find only one API container associated with enclave '%v', instead found '%v'", enclaveId, numOfFoundApiContainers) } @@ -414,27 +415,27 @@ func getEnclaveApiContainerInformation( resultApiContainerStatus, err := getApiContainerStatusFromContainerStatus(apiContainer.GetStatus()) if err != nil { - return 0, nil, nil, stacktrace.Propagate(err, "An error occurred getting the API container status for enclave '%v'", enclaveId) + return types.ContainerStatus_NONEXISTENT, nil, nil, stacktrace.Propagate(err, "An error occurred getting the API container status for enclave '%v'", enclaveId) } bridgeIpAddr := "" if apiContainer.GetBridgeNetworkIPAddress() != nil { bridgeIpAddr = apiContainer.GetBridgeNetworkIPAddress().String() } - resultApiContainerInfo := &kurtosis_engine_rpc_api_bindings.EnclaveAPIContainerInfo{ + resultApiContainerInfo := &types.EnclaveAPIContainerInfo{ ContainerId: "", IpInsideEnclave: apiContainer.GetPrivateIPAddress().String(), GrpcPortInsideEnclave: uint32(apiContainer.GetPrivateGRPCPort().GetNumber()), BridgeIpAddress: bridgeIpAddr, } - var resultApiContainerHostMachineInfo *kurtosis_engine_rpc_api_bindings.EnclaveAPIContainerHostMachineInfo - if resultApiContainerStatus == kurtosis_engine_rpc_api_bindings.EnclaveAPIContainerStatus_EnclaveAPIContainerStatus_RUNNING { + var resultApiContainerHostMachineInfo *types.EnclaveAPIContainerHostMachineInfo + if resultApiContainerStatus == types.ContainerStatus_RUNNING { - var apiContainerHostMachineInfo *kurtosis_engine_rpc_api_bindings.EnclaveAPIContainerHostMachineInfo + var apiContainerHostMachineInfo *types.EnclaveAPIContainerHostMachineInfo if apiContainer.GetPublicIPAddress() != nil && apiContainer.GetPublicGRPCPort() != nil { - apiContainerHostMachineInfo = &kurtosis_engine_rpc_api_bindings.EnclaveAPIContainerHostMachineInfo{ + apiContainerHostMachineInfo = &types.EnclaveAPIContainerHostMachineInfo{ IpOnHostMachine: apiContainer.GetPublicIPAddress().String(), GrpcPortOnHostMachine: uint32(apiContainer.GetPublicGRPCPort().GetNumber()), } @@ -519,13 +520,13 @@ func (manager *EnclaveManager) cleanEnclaves( func (manager *EnclaveManager) getEnclavesWithoutMutex( ctx context.Context, -) (map[enclave.EnclaveUUID]*kurtosis_engine_rpc_api_bindings.EnclaveInfo, error) { +) (map[enclave.EnclaveUUID]*types.EnclaveInfo, error) { enclaves, err := manager.kurtosisBackend.GetEnclaves(ctx, getAllEnclavesFilter()) if err != nil { return nil, stacktrace.Propagate(err, "Error thrown retrieving enclaves") } - result := map[enclave.EnclaveUUID]*kurtosis_engine_rpc_api_bindings.EnclaveInfo{} + result := map[enclave.EnclaveUUID]*types.EnclaveInfo{} for enclaveId, enclaveObj := range enclaves { // filter idle enclaves because these were not created by users if isIdleEnclave(*enclaveObj) { @@ -575,7 +576,7 @@ func getApiContainerByEnclaveIdFilter(enclaveId enclave.EnclaveUUID) *api_contai } } -func getEnclaveInfoForEnclave(ctx context.Context, kurtosisBackend backend_interface.KurtosisBackend, enclave *enclave.Enclave) (*kurtosis_engine_rpc_api_bindings.EnclaveInfo, error) { +func getEnclaveInfoForEnclave(ctx context.Context, kurtosisBackend backend_interface.KurtosisBackend, enclave *enclave.Enclave) (*types.EnclaveInfo, error) { enclaveUuid := enclave.GetUUID() enclaveUuidStr := string(enclaveUuid) apiContainerStatus, apiContainerInfo, apiContainerHostMachineInfo, err := getEnclaveApiContainerInformation(ctx, kurtosisBackend, enclaveUuid) @@ -594,20 +595,20 @@ func getEnclaveInfoForEnclave(ctx context.Context, kurtosisBackend backend_inter enclaveName := enclave.GetName() - mode := kurtosis_engine_rpc_api_bindings.EnclaveMode_TEST + mode := types.EnclaveMode_TEST if enclave.IsProductionEnclave() { - mode = kurtosis_engine_rpc_api_bindings.EnclaveMode_PRODUCTION + mode = types.EnclaveMode_PRODUCTION } - return &kurtosis_engine_rpc_api_bindings.EnclaveInfo{ + return &types.EnclaveInfo{ EnclaveUuid: enclaveUuidStr, ShortenedUuid: uuid_generator.ShortenedUUIDString(enclaveUuidStr), Name: enclaveName, - ContainersStatus: enclaveContainersStatus, + EnclaveContainersStatus: enclaveContainersStatus, ApiContainerStatus: apiContainerStatus, ApiContainerInfo: apiContainerInfo, ApiContainerHostMachineInfo: apiContainerHostMachineInfo, - CreationTime: creationTimestamp, + CreationTime: *creationTimestamp, Mode: mode, }, nil } @@ -660,38 +661,37 @@ func getFirstApiContainerFromMap(apiContainerMap map[enclave.EnclaveUUID]*api_co return firstApiContainerFound } -func getEnclaveContainersStatusFromEnclaveStatus(status enclave.EnclaveStatus) (kurtosis_engine_rpc_api_bindings.EnclaveContainersStatus, error) { +func getEnclaveContainersStatusFromEnclaveStatus(status enclave.EnclaveStatus) (types.EnclaveContainersStatus, error) { switch status { case enclave.EnclaveStatus_Empty: - return kurtosis_engine_rpc_api_bindings.EnclaveContainersStatus_EnclaveContainersStatus_EMPTY, nil + return types.EnclaveContainersStatus_EMPTY, nil case enclave.EnclaveStatus_Stopped: - return kurtosis_engine_rpc_api_bindings.EnclaveContainersStatus_EnclaveContainersStatus_STOPPED, nil + return types.EnclaveContainersStatus_STOPPED, nil case enclave.EnclaveStatus_Running: - return kurtosis_engine_rpc_api_bindings.EnclaveContainersStatus_EnclaveContainersStatus_RUNNING, nil + return types.EnclaveContainersStatus_RUNNING, nil default: - // EnclaveContainersStatus is of type int32, cannot convert nil to int32 returning -1 - return -1, stacktrace.NewError("Unrecognized enclave status '%v'; this is a bug in Kurtosis", status.String()) + // EnclaveContainersStatus is of type string, cannot convert nil to sting returning "" + return "", stacktrace.NewError("Unrecognized enclave status '%v'; this is a bug in Kurtosis", status.String()) } } -func getApiContainerStatusFromContainerStatus(status container.ContainerStatus) (kurtosis_engine_rpc_api_bindings.EnclaveAPIContainerStatus, error) { +func getApiContainerStatusFromContainerStatus(status container.ContainerStatus) (types.ContainerStatus, error) { switch status { case container.ContainerStatus_Running: - return kurtosis_engine_rpc_api_bindings.EnclaveAPIContainerStatus_EnclaveAPIContainerStatus_RUNNING, nil + return types.ContainerStatus_RUNNING, nil case container.ContainerStatus_Stopped: - return kurtosis_engine_rpc_api_bindings.EnclaveAPIContainerStatus_EnclaveAPIContainerStatus_STOPPED, nil + return types.ContainerStatus_STOPPED, nil default: - // EnclaveAPIContainerStatus is of type int32, cannot convert nil to int32 returning -1 - return -1, stacktrace.NewError("Unrecognized container status '%v'; this is a bug in Kurtosis", status.String()) + // EnclaveAPIContainerStatus is of type string, cannot convert nil to sting returning "" + return "", stacktrace.NewError("Unrecognized container status '%v'; this is a bug in Kurtosis", status.String()) } } -func getEnclaveCreationTimestamp(enclave *enclave.Enclave) (*timestamppb.Timestamp, error) { +func getEnclaveCreationTimestamp(enclave *enclave.Enclave) (*time.Time, error) { enclaveCreationTime := enclave.GetCreationTime() if enclaveCreationTime == nil { return nil, stacktrace.NewError("Expected to get the enclave creation time for enclave '%+v' but it's nil, this is a bug in Kurtosis", enclave) } - enclaveCreationTimestamp := timestamppb.New(*enclaveCreationTime) - return enclaveCreationTimestamp, nil + return enclaveCreationTime, nil } diff --git a/engine/server/engine/enclave_manager/enclave_pool.go b/engine/server/engine/enclave_manager/enclave_pool.go index 5915e2a024..642de7db01 100644 --- a/engine/server/engine/enclave_manager/enclave_pool.go +++ b/engine/server/engine/enclave_manager/enclave_pool.go @@ -3,15 +3,15 @@ package enclave_manager import ( "context" "fmt" - "github.com/kurtosis-tech/kurtosis/api/golang/engine/kurtosis_engine_rpc_api_bindings" + "strings" + "time" + "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface" "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/enclave" + "github.com/kurtosis-tech/kurtosis/engine/server/engine/types" "github.com/kurtosis-tech/kurtosis/metrics-library/golang/lib/metrics_client" "github.com/kurtosis-tech/stacktrace" "github.com/sirupsen/logrus" - "google.golang.org/protobuf/types/known/timestamppb" - "strings" - "time" ) const ( @@ -26,7 +26,7 @@ const ( type EnclavePool struct { kurtosisBackend backend_interface.KurtosisBackend enclaveCreator *EnclaveCreator - idleEnclavesChan chan *kurtosis_engine_rpc_api_bindings.EnclaveInfo + idleEnclavesChan chan *types.EnclaveInfo fillChan chan bool engineVersion string cancelSubRoutineCtxFunc context.CancelFunc @@ -80,7 +80,7 @@ func CreateEnclavePool( } // this channel is the repository of idle enclave UUIDs - idleEnclavesChan := make(chan *kurtosis_engine_rpc_api_bindings.EnclaveInfo, poolSize) + idleEnclavesChan := make(chan *types.EnclaveInfo, poolSize) // This channel is used as a signal to tell to the sub-routine that one idle enclave // has been allocated from the pool @@ -120,7 +120,7 @@ func (pool *EnclavePool) GetEnclave( engineVersion string, apiContainerVersion string, apiContainerLogLevel logrus.Level, -) (*kurtosis_engine_rpc_api_bindings.EnclaveInfo, error) { +) (*types.EnclaveInfo, error) { logrus.Debugf( "Requesting enclave from pool using params: engine version '%s', api container version '%s' and api container log level '%s'...", @@ -155,7 +155,7 @@ func (pool *EnclavePool) GetEnclave( // and it has to fill the pool again pool.fillChan <- fill - enclaveUUID := enclave.EnclaveUUID(enclaveInfo.GetEnclaveUuid()) + enclaveUUID := enclave.EnclaveUUID(enclaveInfo.EnclaveUuid) shouldDestroyEnclaveBecauseSomethingFails := true defer func() { if shouldDestroyEnclaveBecauseSomethingFails { @@ -185,9 +185,8 @@ func (pool *EnclavePool) GetEnclave( // update the enclave info before returning it // we assume that container status and apic status both are RUNNING because we check it above in getRunningEnclave - enclaveCreationTimestamp := timestamppb.New(newCreationTime) enclaveInfo.Name = newEnclaveName - enclaveInfo.CreationTime = enclaveCreationTimestamp + enclaveInfo.CreationTime = newCreationTime logrus.Debugf("Returning enclave Info '%+v' for requested enclave name '%s'", enclaveInfo, newEnclaveName) @@ -260,12 +259,12 @@ func (pool *EnclavePool) createAndAddOneIdleEnclaveIfNeeded(ctx context.Context) } pool.idleEnclavesChan <- newEnclaveInfo - logrus.Debugf("Enclave with UUID '%s' was added intho the pool channel", newEnclaveInfo.GetEnclaveUuid()) + logrus.Debugf("Enclave with UUID '%s' was added intho the pool channel", newEnclaveInfo.EnclaveUuid) return nil } -func (pool *EnclavePool) createNewIdleEnclave(ctx context.Context) (*kurtosis_engine_rpc_api_bindings.EnclaveInfo, error) { +func (pool *EnclavePool) createNewIdleEnclave(ctx context.Context) (*types.EnclaveInfo, error) { enclaveName, err := GetRandomIdleEnclaveName() if err != nil { diff --git a/engine/server/engine/server/engine_connect_server_service.go b/engine/server/engine/server/engine_connect_server_service.go index 015bb17c28..7716cca0ed 100644 --- a/engine/server/engine/server/engine_connect_server_service.go +++ b/engine/server/engine/server/engine_connect_server_service.go @@ -1,8 +1,11 @@ package server import ( - "connectrpc.com/connect" "context" + "fmt" + "time" + + "connectrpc.com/connect" "github.com/kurtosis-tech/kurtosis/api/golang/engine/kurtosis_engine_rpc_api_bindings" "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/enclave" user_service "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/service" @@ -10,12 +13,12 @@ import ( "github.com/kurtosis-tech/kurtosis/engine/server/engine/centralized_logs/client_implementations/persistent_volume/log_file_manager" "github.com/kurtosis-tech/kurtosis/engine/server/engine/centralized_logs/logline" "github.com/kurtosis-tech/kurtosis/engine/server/engine/enclave_manager" + "github.com/kurtosis-tech/kurtosis/engine/server/engine/types" "github.com/kurtosis-tech/kurtosis/metrics-library/golang/lib/metrics_client" "github.com/kurtosis-tech/stacktrace" "github.com/sirupsen/logrus" "google.golang.org/protobuf/types/known/emptypb" "google.golang.org/protobuf/types/known/timestamppb" - "time" ) const ( @@ -75,6 +78,113 @@ func NewEngineConnectServerService( return service } +func toGrpcEnclaveContainersStatus(status types.EnclaveContainersStatus) kurtosis_engine_rpc_api_bindings.EnclaveContainersStatus { + switch status { + case types.EnclaveContainersStatus_EMPTY: + return kurtosis_engine_rpc_api_bindings.EnclaveContainersStatus_EnclaveContainersStatus_EMPTY + case types.EnclaveContainersStatus_STOPPED: + return kurtosis_engine_rpc_api_bindings.EnclaveContainersStatus_EnclaveContainersStatus_STOPPED + case types.EnclaveContainersStatus_RUNNING: + return kurtosis_engine_rpc_api_bindings.EnclaveContainersStatus_EnclaveContainersStatus_RUNNING + default: + panic(fmt.Sprintf("Undefined mapping of value: %s", status)) + } +} + +func toGrpcContainerStatus(status types.ContainerStatus) kurtosis_engine_rpc_api_bindings.EnclaveAPIContainerStatus { + switch status { + case types.ContainerStatus_NONEXISTENT: + return kurtosis_engine_rpc_api_bindings.EnclaveAPIContainerStatus_EnclaveAPIContainerStatus_NONEXISTENT + case types.ContainerStatus_STOPPED: + return kurtosis_engine_rpc_api_bindings.EnclaveAPIContainerStatus_EnclaveAPIContainerStatus_STOPPED + case types.ContainerStatus_RUNNING: + return kurtosis_engine_rpc_api_bindings.EnclaveAPIContainerStatus_EnclaveAPIContainerStatus_RUNNING + default: + panic(fmt.Sprintf("Undefined mapping of value: %s", status)) + } +} + +func toGrpcEnclaveAPIContainerInfo(info *types.EnclaveAPIContainerInfo) kurtosis_engine_rpc_api_bindings.EnclaveAPIContainerInfo { + return kurtosis_engine_rpc_api_bindings.EnclaveAPIContainerInfo{ + ContainerId: info.ContainerId, + IpInsideEnclave: info.IpInsideEnclave, + GrpcPortInsideEnclave: info.GrpcPortInsideEnclave, + BridgeIpAddress: info.BridgeIpAddress, + } +} + +func toGrpcApiContainerHostMachineInfo(info *types.EnclaveAPIContainerHostMachineInfo) kurtosis_engine_rpc_api_bindings.EnclaveAPIContainerHostMachineInfo { + return kurtosis_engine_rpc_api_bindings.EnclaveAPIContainerHostMachineInfo{ + IpOnHostMachine: info.IpOnHostMachine, + GrpcPortOnHostMachine: info.GrpcPortOnHostMachine, + } +} + +func toGrpcTimestamp(timestamp *time.Time) *timestamppb.Timestamp { + return timestamppb.New(*timestamp) +} + +func toGrpcEnclaveMode(mode types.EnclaveMode) kurtosis_engine_rpc_api_bindings.EnclaveMode { + switch mode { + case types.EnclaveMode_PRODUCTION: + return kurtosis_engine_rpc_api_bindings.EnclaveMode_PRODUCTION + case types.EnclaveMode_TEST: + return kurtosis_engine_rpc_api_bindings.EnclaveMode_TEST + default: + panic(fmt.Sprintf("Undefined mapping of value: %s", mode)) + } +} + +func toGrpcEnclaveInfo(info types.EnclaveInfo) kurtosis_engine_rpc_api_bindings.EnclaveInfo { + containerInfo := toGrpcEnclaveAPIContainerInfo(info.ApiContainerInfo) + apiHostMachine := toGrpcApiContainerHostMachineInfo(info.ApiContainerHostMachineInfo) + return kurtosis_engine_rpc_api_bindings.EnclaveInfo{ + EnclaveUuid: info.EnclaveUuid, + ShortenedUuid: info.ShortenedUuid, + Name: info.Name, + ContainersStatus: toGrpcEnclaveContainersStatus(info.EnclaveContainersStatus), + ApiContainerStatus: toGrpcContainerStatus(info.ApiContainerStatus), + ApiContainerInfo: &containerInfo, + ApiContainerHostMachineInfo: &apiHostMachine, + CreationTime: toGrpcTimestamp(&info.CreationTime), + Mode: toGrpcEnclaveMode(info.Mode), + } +} + +func toGrpcEnclaveInfos(infos map[string]*types.EnclaveInfo) map[string]*kurtosis_engine_rpc_api_bindings.EnclaveInfo { + var info_map map[string]*kurtosis_engine_rpc_api_bindings.EnclaveInfo + for key, info := range infos { + grpc_info := toGrpcEnclaveInfo(*info) + info_map[key] = &grpc_info + } + return info_map +} + +func toGrpcEnclaveIdentifiers(identifier *types.EnclaveIdentifiers) *kurtosis_engine_rpc_api_bindings.EnclaveIdentifiers { + ident := kurtosis_engine_rpc_api_bindings.EnclaveIdentifiers{ + EnclaveUuid: identifier.EnclaveUuid, + Name: identifier.Name, + ShortenedUuid: identifier.ShortenedUuid, + } + return &ident +} + +func toGrpcEnclaveNameAndUuid(identifier *types.EnclaveNameAndUuid) *kurtosis_engine_rpc_api_bindings.EnclaveNameAndUuid { + ident := kurtosis_engine_rpc_api_bindings.EnclaveNameAndUuid{ + Uuid: identifier.Uuid, + Name: identifier.Name, + } + return &ident +} + +func mapList[T, U any](data []T, f func(T) U) []U { + res := make([]U, 0, len(data)) + for _, e := range data { + res = append(res, f(e)) + } + return res +} + func (service *EngineConnectServerService) GetEngineInfo(context.Context, *connect.Request[emptypb.Empty]) (*connect.Response[kurtosis_engine_rpc_api_bindings.GetEngineInfoResponse], error) { result := &kurtosis_engine_rpc_api_bindings.GetEngineInfoResponse{ EngineVersion: service.imageVersionTag, @@ -112,8 +222,9 @@ func (service *EngineConnectServerService) CreateEnclave(ctx context.Context, co return nil, stacktrace.Propagate(err, "An error occurred creating new enclave with name '%v'", args.EnclaveName) } + grpcEnclaveInfo := toGrpcEnclaveInfo(*enclaveInfo) response := &kurtosis_engine_rpc_api_bindings.CreateEnclaveResponse{ - EnclaveInfo: enclaveInfo, + EnclaveInfo: &grpcEnclaveInfo, } return connect.NewResponse(response), nil @@ -124,7 +235,7 @@ func (service *EngineConnectServerService) GetEnclaves(ctx context.Context, _ *c if err != nil { return nil, stacktrace.Propagate(err, "An error occurred getting info for enclaves") } - response := &kurtosis_engine_rpc_api_bindings.GetEnclavesResponse{EnclaveInfo: infoForEnclaves} + response := &kurtosis_engine_rpc_api_bindings.GetEnclavesResponse{EnclaveInfo: toGrpcEnclaveInfos(infoForEnclaves)} return connect.NewResponse(response), nil } @@ -133,7 +244,7 @@ func (service *EngineConnectServerService) GetExistingAndHistoricalEnclaveIdenti if err != nil { return nil, stacktrace.Propagate(err, "An error occurred while fetching enclave identifiers") } - response := &kurtosis_engine_rpc_api_bindings.GetExistingAndHistoricalEnclaveIdentifiersResponse{AllIdentifiers: allIdentifiers} + response := &kurtosis_engine_rpc_api_bindings.GetExistingAndHistoricalEnclaveIdentifiersResponse{AllIdentifiers: mapList(allIdentifiers, toGrpcEnclaveIdentifiers)} return connect.NewResponse(response), nil } @@ -177,7 +288,7 @@ func (service *EngineConnectServerService) Clean(ctx context.Context, connectArg return nil, stacktrace.Propagate(err, "An error occurred removing all logs.") } } - response := &kurtosis_engine_rpc_api_bindings.CleanResponse{RemovedEnclaveNameAndUuids: removedEnclaveUuidsAndNames} + response := &kurtosis_engine_rpc_api_bindings.CleanResponse{RemovedEnclaveNameAndUuids: mapList(removedEnclaveUuidsAndNames, toGrpcEnclaveNameAndUuid)} return connect.NewResponse(response), nil } @@ -443,9 +554,6 @@ func (service *EngineConnectServerService) getEnclaveCreationTime(ctx context.Co return time.Time{}, stacktrace.NewError("Engine could not find enclave '%v'", enclaveUuid) } - timestamp := enclaveObj.GetCreationTime() - if timestamp == nil { - return time.Time{}, stacktrace.NewError("An error occurred getting the creation time for enclave '%v'. This is a bug in Kurtosis", enclaveUuid) - } - return timestamp.AsTime(), nil + timestamp := enclaveObj.CreationTime + return timestamp, nil } diff --git a/engine/server/engine/types/engine_types.go b/engine/server/engine/types/engine_types.go new file mode 100644 index 0000000000..58e0eb28d3 --- /dev/null +++ b/engine/server/engine/types/engine_types.go @@ -0,0 +1,118 @@ +package types + +import ( + "time" +) + +// Defines values for EnclaveContainersStatus. +type EnclaveContainersStatus string + +const ( + EnclaveContainersStatus_RUNNING EnclaveContainersStatus = "RUNNING" + EnclaveContainersStatus_STOPPED EnclaveContainersStatus = "STOPPED" + EnclaveContainersStatus_EMPTY EnclaveContainersStatus = "EMPTY" +) + +// Defines values for ContainerStatus. +type ContainerStatus string + +const ( + ContainerStatus_RUNNING ContainerStatus = "RUNNING" + ContainerStatus_STOPPED ContainerStatus = "STOPPED" + ContainerStatus_NONEXISTENT ContainerStatus = "NONEXISTENT" +) + +// Defines values for EnclaveMode. +type EnclaveMode string + +const ( + EnclaveMode_PRODUCTION EnclaveMode = "PRODUCTION" + EnclaveMode_TEST EnclaveMode = "TEST" +) + +// CreateEnclaveArgs defines model for CreateEnclaveArgs. +type CreateEnclaveArgs struct { + ApiContainerLogLevel string + ApiContainerVersionTag string + EnclaveName string + Mode *EnclaveMode +} + +// EnclaveAPIContainerHostMachineInfo defines model for EnclaveAPIContainerHostMachineInfo. +type EnclaveAPIContainerHostMachineInfo struct { + GrpcPortOnHostMachine uint32 + IpOnHostMachine string +} + +// EnclaveAPIContainerInfo defines model for EnclaveAPIContainerInfo. +type EnclaveAPIContainerInfo struct { + BridgeIpAddress string + ContainerId string + GrpcPortInsideEnclave uint32 + IpInsideEnclave string +} + +// EnclaveIdentifiers defines model for EnclaveIdentifiers. +type EnclaveIdentifiers struct { + EnclaveUuid string + Name string + ShortenedUuid string +} + +// EnclaveInfo defines model for EnclaveInfo. +type EnclaveInfo struct { + ApiContainerHostMachineInfo *EnclaveAPIContainerHostMachineInfo + ApiContainerInfo *EnclaveAPIContainerInfo + ApiContainerStatus ContainerStatus + EnclaveContainersStatus EnclaveContainersStatus + CreationTime Timestamp + EnclaveUuid string + Mode EnclaveMode + Name string + ShortenedUuid string +} + +// EnclaveNameAndUuid defines model for EnclaveNameAndUuid. +type EnclaveNameAndUuid struct { + Name string + Uuid string +} + +type GetEnclavesResponse struct { + EnclaveInfo *map[string]EnclaveInfo +} + +// GetEngineInfoResponse defines model for GetEngineInfoResponse. +type EngineVersion struct { + EngineVersion string +} + +// GetServiceLogsArgs defines model for GetServiceLogsArgs. +type GetServiceLogsArgs struct { + ConjunctiveFilters *[]LogLineFilter + FollowLogs bool + NumLogLines int + ReturnAllLogs bool + ServiceUuidSet *[]string +} + +// GetServiceLogsResponse defines model for GetServiceLogsResponse. +type GetServiceLogsResponse struct { + NotFoundServiceUuidSet *[]string + ServiceLogsByServiceUuid *map[string]LogLine +} + +// LogLine defines model for LogLine. +type LogLine struct { + Line *[]string + Timestamp Timestamp +} + +// LogLineFilter defines model for LogLineFilter. +type LogLineFilter struct { + Operator *int + TextPattern *string +} + +// Timestamp defines model for Timestamp. +type Timestamp = time.Time From 95184b40917725742772e1a36f0d06a5db052eaa Mon Sep 17 00:00:00 2001 From: lostbean Date: Tue, 14 Nov 2023 11:17:58 -0300 Subject: [PATCH 08/95] add rest http server to engine --- .../engine_server.gen.go | 43 +- .../engine_types.gen.go | 74 ++- api/golang/go.mod | 13 +- api/golang/go.sum | 42 +- api/openapi/engine/engine_service.yaml | 61 +- api/openapi/scripts/build.sh | 6 + engine/server/engine/main.go | 79 ++- .../server/engine_connect_server_service.go | 13 +- .../engine/server/engine_http_service.go | 529 ++++++++++++++++++ engine/server/engine/utils/List.go | 9 + go.work.sum | 9 +- 11 files changed, 777 insertions(+), 101 deletions(-) create mode 100644 api/openapi/scripts/build.sh create mode 100644 engine/server/engine/server/engine_http_service.go create mode 100644 engine/server/engine/utils/List.go diff --git a/api/golang/engine/kurtosis_engine_http_api_bindings/engine_server.gen.go b/api/golang/engine/kurtosis_engine_http_api_bindings/engine_server.gen.go index 8a6229dbf2..e159591cfd 100644 --- a/api/golang/engine/kurtosis_engine_http_api_bindings/engine_server.gen.go +++ b/api/golang/engine/kurtosis_engine_http_api_bindings/engine_server.gen.go @@ -222,7 +222,7 @@ type DeleteEnclavesResponseObject interface { VisitDeleteEnclavesResponse(w http.ResponseWriter) error } -type DeleteEnclaves200JSONResponse CleanResponse +type DeleteEnclaves200JSONResponse DeleteResponse func (response DeleteEnclaves200JSONResponse) VisitDeleteEnclavesResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -641,26 +641,27 @@ func (sh *strictHandler) GetEngineInfo(ctx echo.Context) error { // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/+xYTW/jNhP+KwLf9+jGaXvzLU22WQPpbrBJTosFwYgjmQFFcsmRu0bg/16Q+rT1YdmJ", - "CxTtzZZmOF/PPDPUK4l1ZrQChY4sXomLV5Cx8PNaAlNfwBmtHPgHxmoDFgWE1xYyvQZOQcWSrYEqlgFl", - "itM8FzxICIQs/Pi/hYQsyP/mja15aWj+oVD/xDK4UvwpF5xsZwQ3BsiCMGvZhmybB/r5BWL0EtcWGEKp", - "fWVT1/WQGUFjrZAJBZZKnVIJa5D+VXmcQytU6o/blV2DdUIriiztlW7H3CuQaR5egMozsvhKHj88PJIZ", - "uf/y+ebp+nH5+RP5NtvXOhjlcC0qf4RK9MSEL71or80qp/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NZS6M0ds9aPw3COnL/kjbre1TZmdg61TSHYhJ+XQ4GKxJdzg7n3GpLK+OY+Y3Q6kG", + "xmFZiRtT8A1pxhBBDW3/Uy0tep4uZ2t6v1wEk/mCBrOPhqvts8UycD6vnj1Ogvv39Gn2MPvoOtJ+7SL8", + "oB3nWKqUIRmTiCH8ZGdj54gBVhEyckzMu4IvvclqTnxSMyL5+d3duztjRGYgWMbJmPxqH/kkY7i1CRiV", + "JG//RHbhb/LCpZhHZFxeBKqBYY8rlkLBM5/MOR0qnmFhdh57qHLwveJ+4LEk8Sor77wpxCxP0OPai1mi", + "DUJuTn3NQe1JNYzLu4VhDOKXt0cXaxw+G3IpOttC+OXurmREBIHFzpYlPLRgRl90MSoaheeK7uT+Y0N/", + "DHWdhyFoHeeJpxoxn+g8TZna16Hz6tiZXb0gluMQtwYyeUNIrrl/E64HwCNQmdQOVCupj2F9zUHjbzLa", + "/zBE3bu/xWNMcQURGZtaPLxhSN0385uCWqiq4mpf1v052tbbir3IXiiiZrd563K6cp+6udoa7a3CO4rQ", + "93phre0ehtNax+dLPPf8PJ/6Xn1H8Ir/UnmGwjwZe7iFivgqljO825Bc119yWrkO8qsnwWu573SjuIne", + "NCq5b0r2Mr39++I8/CPc64jYqz/lne+JUbWDXybtTrLMKv3PSNiPHzWOq9jfPGt6rjQ3F06pzLNZHVA4", + "GmV2Y+GszdH/GPViWkycTjcAs92PqqW/n1+rjyZvvkB2vs68grnszaWiv8NfAQAA//+kzK+LOBoAAA==", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/api/golang/engine/kurtosis_engine_http_api_bindings/engine_types.gen.go b/api/golang/engine/kurtosis_engine_http_api_bindings/engine_types.gen.go index cf562c40ca..3977abde5a 100644 --- a/api/golang/engine/kurtosis_engine_http_api_bindings/engine_types.gen.go +++ b/api/golang/engine/kurtosis_engine_http_api_bindings/engine_types.gen.go @@ -7,39 +7,55 @@ import ( "time" ) -// Defines values for CreateEnclaveArgsMode. +// Defines values for ApiContainerStatus. const ( - CreateEnclaveArgsModePRODUCTION CreateEnclaveArgsMode = "PRODUCTION" - CreateEnclaveArgsModeTEST CreateEnclaveArgsMode = "TEST" + ApiContainerStatusNONEXISTENT ApiContainerStatus = "NON_EXISTENT" + ApiContainerStatusRUNNING ApiContainerStatus = "RUNNING" + ApiContainerStatusSTOPPED ApiContainerStatus = "STOPPED" ) -// Defines values for EnclaveInfoMode. +// Defines values for EnclaveContainersStatus. const ( - EnclaveInfoModePRODUCTION EnclaveInfoMode = "PRODUCTION" - EnclaveInfoModeTEST EnclaveInfoMode = "TEST" + EnclaveContainersStatusEMPTY EnclaveContainersStatus = "EMPTY" + EnclaveContainersStatusRUNNING EnclaveContainersStatus = "RUNNING" + EnclaveContainersStatusSTOPPED EnclaveContainersStatus = "STOPPED" ) -// CleanResponse defines model for CleanResponse. -type CleanResponse struct { - RemovedEnclaveNameAndUuids *[]EnclaveNameAndUuid `json:"removed_enclave_name_and_uuids,omitempty"` -} +// Defines values for EnclaveMode. +const ( + PRODUCTION EnclaveMode = "PRODUCTION" + TEST EnclaveMode = "TEST" +) + +// Defines values for LogLineOperator. +const ( + DOESCONTAINMATCHREGEX LogLineOperator = "DOES_CONTAIN_MATCH_REGEX" + DOESCONTAINTEXT LogLineOperator = "DOES_CONTAIN_TEXT" + DOESNOTCONTAINMATCHREGEX LogLineOperator = "DOES_NOT_CONTAIN_MATCH_REGEX" + DOESNOTCONTAINTEXT LogLineOperator = "DOES_NOT_CONTAIN_TEXT" +) + +// ApiContainerStatus defines model for ApiContainerStatus. +type ApiContainerStatus string // CreateEnclaveArgs defines model for CreateEnclaveArgs. type CreateEnclaveArgs struct { - ApiContainerLogLevel *string `json:"api_container_log_level,omitempty"` - ApiContainerVersionTag *string `json:"api_container_version_tag,omitempty"` - EnclaveName *string `json:"enclave_name,omitempty"` - Mode *CreateEnclaveArgsMode `json:"mode,omitempty"` + ApiContainerLogLevel *string `json:"api_container_log_level,omitempty"` + ApiContainerVersionTag *string `json:"api_container_version_tag,omitempty"` + EnclaveName *string `json:"enclave_name,omitempty"` + Mode *EnclaveMode `json:"mode,omitempty"` } -// CreateEnclaveArgsMode defines model for CreateEnclaveArgs.Mode. -type CreateEnclaveArgsMode string - // CreateEnclaveResponse defines model for CreateEnclaveResponse. type CreateEnclaveResponse struct { EnclaveInfo *EnclaveInfo `json:"enclave_info,omitempty"` } +// DeleteResponse defines model for DeleteResponse. +type DeleteResponse struct { + RemovedEnclaveNameAndUuids *[]EnclaveNameAndUuid `json:"removed_enclave_name_and_uuids,omitempty"` +} + // EnclaveAPIContainerHostMachineInfo defines model for EnclaveAPIContainerHostMachineInfo. type EnclaveAPIContainerHostMachineInfo struct { GrpcPortOnHostMachine *int `json:"grpc_port_on_host_machine,omitempty"` @@ -54,6 +70,9 @@ type EnclaveAPIContainerInfo struct { IpInsideEnclave *string `json:"ip_inside_enclave,omitempty"` } +// EnclaveContainersStatus defines model for EnclaveContainersStatus. +type EnclaveContainersStatus string + // EnclaveIdentifiers defines model for EnclaveIdentifiers. type EnclaveIdentifiers struct { EnclaveUuid *string `json:"enclave_uuid,omitempty"` @@ -65,17 +84,17 @@ type EnclaveIdentifiers struct { type EnclaveInfo struct { ApiContainerHostMachineInfo *EnclaveAPIContainerHostMachineInfo `json:"api_container_host_machine_info,omitempty"` ApiContainerInfo *EnclaveAPIContainerInfo `json:"api_container_info,omitempty"` - ApiContainerStatus *int `json:"api_container_status,omitempty"` - ContainersStatus *int `json:"containers_status,omitempty"` + ApiContainerStatus *ApiContainerStatus `json:"api_container_status,omitempty"` + ContainersStatus *EnclaveContainersStatus `json:"containers_status,omitempty"` CreationTime *Timestamp `json:"creation_time,omitempty"` EnclaveUuid *string `json:"enclave_uuid,omitempty"` - Mode *EnclaveInfoMode `json:"mode,omitempty"` + Mode *EnclaveMode `json:"mode,omitempty"` Name *string `json:"name,omitempty"` ShortenedUuid *string `json:"shortened_uuid,omitempty"` } -// EnclaveInfoMode defines model for EnclaveInfo.Mode. -type EnclaveInfoMode string +// EnclaveMode defines model for EnclaveMode. +type EnclaveMode string // EnclaveNameAndUuid defines model for EnclaveNameAndUuid. type EnclaveNameAndUuid struct { @@ -104,12 +123,12 @@ type GetServiceLogsArgs struct { FollowLogs *bool `json:"follow_logs,omitempty"` NumLogLines *int `json:"num_log_lines,omitempty"` ReturnAllLogs *bool `json:"return_all_logs,omitempty"` - ServiceUuidSet *map[string]bool `json:"service_uuid_set,omitempty"` + ServiceUuidSet *[]string `json:"service_uuid_set,omitempty"` } // GetServiceLogsResponse defines model for GetServiceLogsResponse. type GetServiceLogsResponse struct { - NotFoundServiceUuidSet *map[string]bool `json:"not_found_service_uuid_set,omitempty"` + NotFoundServiceUuidSet *[]string `json:"not_found_service_uuid_set,omitempty"` ServiceLogsByServiceUuid *map[string]LogLine `json:"service_logs_by_service_uuid,omitempty"` } @@ -121,10 +140,13 @@ type LogLine struct { // LogLineFilter defines model for LogLineFilter. type LogLineFilter struct { - Operator *int `json:"operator,omitempty"` - TextPattern *string `json:"text_pattern,omitempty"` + Operator *LogLineOperator `json:"operator,omitempty"` + TextPattern *string `json:"text_pattern,omitempty"` } +// LogLineOperator defines model for LogLineOperator. +type LogLineOperator string + // Timestamp defines model for Timestamp. type Timestamp = time.Time diff --git a/api/golang/go.mod b/api/golang/go.mod index 7ddc768cf3..29e3eae7a0 100644 --- a/api/golang/go.mod +++ b/api/golang/go.mod @@ -7,6 +7,8 @@ replace github.com/kurtosis-tech/kurtosis/grpc-file-transfer/golang => ../../grp require ( connectrpc.com/connect v1.11.1 github.com/Masterminds/semver/v3 v3.1.1 + github.com/deepmap/oapi-codegen v1.16.2 + github.com/getkin/kin-openapi v0.120.0 github.com/ghodss/yaml v1.0.0 github.com/go-yaml/yaml v2.1.0+incompatible github.com/kurtosis-tech/kurtosis-portal/api/golang v0.0.0-20230818182330-1a86869414d2 @@ -14,6 +16,7 @@ require ( github.com/kurtosis-tech/kurtosis/contexts-config-store v0.0.0-20230818184218-f4e3e773463b github.com/kurtosis-tech/kurtosis/grpc-file-transfer/golang v0.0.0-20230803130419-099ee7a4e3dc github.com/kurtosis-tech/stacktrace v0.0.0-20211028211901-1c67a77b5409 + github.com/labstack/echo/v4 v4.11.3 github.com/mholt/archiver/v3 v3.5.1 github.com/sirupsen/logrus v1.9.0 github.com/stretchr/testify v1.8.4 @@ -34,23 +37,25 @@ require ( github.com/bytedance/sonic v1.9.1 // indirect github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/deepmap/oapi-codegen v1.16.2 // indirect github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5 // indirect github.com/fatih/structs v1.1.0 // indirect github.com/flosch/pongo2/v4 v4.0.2 // indirect github.com/gabriel-vasile/mimetype v1.4.2 // indirect - github.com/getkin/kin-openapi v0.120.0 // indirect github.com/gin-contrib/sse v0.1.0 // indirect github.com/gin-gonic/gin v1.9.1 // indirect + github.com/go-openapi/jsonpointer v0.19.6 // indirect + github.com/go-openapi/swag v0.22.4 // indirect github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect github.com/go-playground/validator/v10 v10.14.0 // indirect github.com/goccy/go-json v0.10.2 // indirect + github.com/golang-jwt/jwt v3.2.2+incompatible // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/gomarkdown/markdown v0.0.0-20230716120725-531d2d74bc12 // indirect github.com/google/uuid v1.3.1 // indirect github.com/gorilla/css v1.0.0 // indirect + github.com/invopop/yaml v0.2.0 // indirect github.com/iris-contrib/schema v0.0.6 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect @@ -63,8 +68,6 @@ require ( github.com/klauspost/compress v1.16.7 // indirect github.com/klauspost/cpuid/v2 v2.2.4 // indirect github.com/klauspost/pgzip v1.2.5 // indirect - github.com/kr/text v0.2.0 // indirect - github.com/labstack/echo/v4 v4.11.3 // indirect github.com/labstack/gommon v0.4.0 // indirect github.com/leodido/go-urn v1.2.4 // indirect github.com/mailgun/raymond/v2 v2.0.48 // indirect @@ -74,8 +77,10 @@ require ( github.com/microcosm-cc/bluemonday v1.0.25 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect github.com/nwaples/rardecode v1.1.3 // indirect github.com/pelletier/go-toml/v2 v2.0.8 // indirect + github.com/perimeterx/marshmallow v1.1.5 // indirect github.com/pierrec/lz4/v4 v4.1.15 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect diff --git a/api/golang/go.sum b/api/golang/go.sum index a2b5d8639e..24c4a0e9ad 100644 --- a/api/golang/go.sum +++ b/api/golang/go.sum @@ -6,6 +6,7 @@ github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53 h1:sR+/8Yb4s github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno= github.com/CloudyKit/jet/v6 v6.2.0 h1:EpcZ6SR9n28BUGtNJSvlBqf90IpjeFr36Tizxhn/oME= github.com/CloudyKit/jet/v6 v6.2.0/go.mod h1:d3ypHeIRNo2+XyqnGA8s+aphtcVpjP5hPwP/Lzo7Ro4= +github.com/Joker/hpp v1.0.0 h1:65+iuJYdRXv/XyN62C1uEmmOx3432rNG/rKlX6V7Kkc= github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= github.com/Joker/jade v1.1.3 h1:Qbeh12Vq6BxURXT1qZBRHsDxeURB8ztcL6f3EXSGeHk= github.com/Joker/jade v1.1.3/go.mod h1:T+2WLyt7VH6Lp0TRxQrUYEs64nRc83wkMQrfeIQKduM= @@ -16,9 +17,8 @@ github.com/Shopify/goreferrer v0.0.0-20220729165902-8cddb4f5de06 h1:KkH3I3sJuOLP github.com/Shopify/goreferrer v0.0.0-20220729165902-8cddb4f5de06/go.mod h1:7erjKLwalezA0k99cWs5L11HWOAPNjdUZ6RxH1BXbbM= github.com/adrg/xdg v0.4.0 h1:RzRqFcjH4nE5C6oTAxhBtoE2IRyjBSa62SCbyPidvls= github.com/adrg/xdg v0.4.0/go.mod h1:N6ag73EX4wyxeaoeHctc1mas01KZgsj5tYiAIwqJE/E= +github.com/ajg/form v1.5.1 h1:t9c7v8JUKu/XxOGBU0yjNpaMloxGEJhUkqFRq0ibGeU= github.com/andybalholm/brotli v1.0.1/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= -github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY= -github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs= github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/apapsch/go-jsonmerge/v2 v2.0.0 h1:axGnT1gRIfimI7gJifB699GoE/oq+F2MU7Dml6nw9rQ= @@ -41,6 +41,7 @@ github.com/deepmap/oapi-codegen v1.16.2/go.mod h1:rdYoEA2GE+riuZ91DvpmBX9hJbQpuY github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5 h1:iFaUwBSo5Svw6L7HYpRu/0lE3e0BaElwnNO1qkNQxBY= github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5/go.mod h1:qssHWj60/X5sZFNxpG4HBPDHVqxNm4DfnCKgrbZOT+s= github.com/dsnet/golib v0.0.0-20171103203638-1ea166775780/go.mod h1:Lj+Z9rebOhdfkVLjJ8T6VcRQv3SXugXy999NBtR9aFY= +github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/flosch/pongo2/v4 v4.0.2 h1:gv+5Pe3vaSVmiJvh/BZa82b7/00YUGm0PIyVVLop0Hw= @@ -55,16 +56,26 @@ github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= +github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= +github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= +github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU= +github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= github.com/go-playground/validator/v10 v10.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg/+t63MyGU2n5js= github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= +github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM= github.com/go-yaml/yaml v2.1.0+incompatible h1:RYi2hDdss1u4YE7GwixGzWwVo47T8UQwnTLB6vQiq+o= github.com/go-yaml/yaml v2.1.0+incompatible/go.mod h1:w2MrLa16VYP0jy6N7M5kHaCkaLENm+P+Tv+MfurjSw0= +github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY= +github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= @@ -75,14 +86,17 @@ github.com/gomarkdown/markdown v0.0.0-20230716120725-531d2d74bc12 h1:uK3X/2mt4tb github.com/gomarkdown/markdown v0.0.0-20230716120725-531d2d74bc12/go.mod h1:JDGcbDT52eL4fju3sZ4TeHGsQwhG9nbDV21aMyhwPoA= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/css v1.0.0 h1:BQqNyPTi50JCFMTw/b67hByjMVXZRwGha6wxVGkeihY= github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c= -github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= +github.com/imkira/go-interpol v1.1.0 h1:KIiKr0VSG2CUW1hl1jpiyuzuJeKUUpC8iM1AIE7N1Vk= +github.com/invopop/yaml v0.2.0 h1:7zky/qH+O0DwAyoobXUqvVBwgBFRxKoQ/3FjcVpjTMY= +github.com/invopop/yaml v0.2.0/go.mod h1:2XuRLgs/ouIrW3XNzuNj7J3Nvu/Dig5MXvbCEdiBN3Q= +github.com/iris-contrib/httpexpect/v2 v2.15.2 h1:T9THsdP1woyAqKHwjkEsbCnMefsAFvk8iJJKokcJ3Go= github.com/iris-contrib/schema v0.0.6 h1:CPSBLyx2e91H2yJzPuhGuifVRnZBBJ3pCOMbOvPZaTw= github.com/iris-contrib/schema v0.0.6/go.mod h1:iYszG0IOsuIsfzjymw1kMzTL8YQcCWlm65f3wX8J5iA= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= @@ -106,13 +120,13 @@ github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0 github.com/klauspost/compress v1.11.4/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I= github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= -github.com/klauspost/cpuid v1.2.0 h1:NMpwD2G9JSFOE1/TJjGSo5zG7Yb2bTe7eq1jH+irmeE= github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZXnvk= github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= github.com/klauspost/pgzip v1.2.5 h1:qnWYvvKqedOF2ulHpMG72XQol4ILEJ8k2wwRl/Km8oE= github.com/klauspost/pgzip v1.2.5/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= @@ -147,11 +161,13 @@ github.com/mholt/archiver/v3 v3.5.1 h1:rDjOBX9JSF5BvoJGvjqK479aL70qh9DIpZCl+k7Cl github.com/mholt/archiver/v3 v3.5.1/go.mod h1:e3dqJ7H78uzsRSEACH1joayhuSyhnonssnDhppzS1L4= github.com/microcosm-cc/bluemonday v1.0.25 h1:4NEwSfiJ+Wva0VxN5B8OwMicaJvD8r9tlJWm9rtloEg= github.com/microcosm-cc/bluemonday v1.0.25/go.mod h1:ZIOjCQp1OrzBBPIJmfX4qDYFuhU02nx4bn030ixfHLE= +github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nwaples/rardecode v1.1.0/go.mod h1:5DzqNKiOdpKKBH87u8VlvAnPZMXcGRhxWkRpHbbfGS0= @@ -159,6 +175,8 @@ github.com/nwaples/rardecode v1.1.3 h1:cWCaZwfM5H7nAD6PyEdcVnczzV8i/JtotnyW/dD9l github.com/nwaples/rardecode v1.1.3/go.mod h1:5DzqNKiOdpKKBH87u8VlvAnPZMXcGRhxWkRpHbbfGS0= github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= +github.com/perimeterx/marshmallow v1.1.5 h1:a2LALqQ1BlHM8PZblsDdidgv1mWi1DgC2UmX50IvK2s= +github.com/perimeterx/marshmallow v1.1.5/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw= github.com/pierrec/lz4/v4 v4.1.2/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pierrec/lz4/v4 v4.1.15 h1:MO0/ucJhngq7299dKLwIMtgTfbkoSPF6AoMYDd8Q4q0= github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= @@ -167,8 +185,10 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/sanity-io/litter v1.5.5 h1:iE+sBxPBzoK6uaEP5Lt3fHNgpKcHXc/A2HGETy0uJQo= github.com/schollz/closestmatch v2.1.0+incompatible h1:Uel2GXEpJqOWBrlyI+oY9LTiyyjYS17cCYRqP13/SHk= github.com/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= +github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= @@ -192,6 +212,7 @@ github.com/tdewolff/minify/v2 v2.12.9 h1:dvn5MtmuQ/DFMwqf5j8QhEVpPX6fi3WGImhv8RU github.com/tdewolff/minify/v2 v2.12.9/go.mod h1:qOqdlDfL+7v0/fyymB+OP497nIxJYSvX4MQWA8OoiXU= github.com/tdewolff/parse/v2 v2.6.8 h1:mhNZXYCx//xG7Yq2e/kVLNZw4YfYmeHbhx+Zc0OvFMA= github.com/tdewolff/parse/v2 v2.6.8/go.mod h1:XHDhaU6IBgsryfdnpzUXBlT6leW/l25yrFBTEb4eIyM= +github.com/tdewolff/test v1.0.9 h1:SswqJCmeN4B+9gEAi/5uqT0qpi1y2/2O47V/1hhGZT0= github.com/tdewolff/test v1.0.9/go.mod h1:6DAvZliBAAnD7rhVgwaM7DE5/d9NMOAJ09SqYqeK4QE= github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= @@ -210,10 +231,16 @@ github.com/vmihailenco/msgpack/v5 v5.3.5 h1:5gO0H1iULLWGhs2H5tbAHIZTV8/cYafcFOr9 github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc= github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= +github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c= +github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0= +github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 h1:nIPpBwaJSVYIxUFsDv3M8ofmx9yWTog9BfvIu0q41lo= github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8/go.mod h1:HUYIGzjTL3rfEspMxjDjgmT5uz5wzYJKVo23qUhYTos= +github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0 h1:6fRhSjgLCkTD3JnJxvaJ4Sj+TYblw757bqYgZaOq5ZY= github.com/yosssi/ace v0.0.5 h1:tUkIP/BLdKqrlrPwcmH0shwEEhTRHoGnc1wFIWmaBUA= github.com/yosssi/ace v0.0.5/go.mod h1:ALfIzm2vT7t5ZE7uoIZqF3TQ7SAOyupFZnkrF5id+K0= +github.com/yudai/gojsondiff v1.0.0 h1:27cbfqXLVEJ1o8I6v3y9lg8Ydm53EKqHXAOMxEGlCOA= +github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 h1:BHyfKlQyqbsFN5p3IfnEUduWvb9is428/nNb5L3U01M= github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/arch v0.3.0 h1:02VY4/ZcO/gBOH6PUaoiptASxtXU10jazRCP865E97k= @@ -277,12 +304,15 @@ google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqw gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +moul.io/http2curl/v2 v2.3.0 h1:9r3JfDzWPcbIklMOs2TnIFzDYvfAZvjeavG6EzP7jYs= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= diff --git a/api/openapi/engine/engine_service.yaml b/api/openapi/engine/engine_service.yaml index 4549ec9f16..3262afa7a8 100644 --- a/api/openapi/engine/engine_service.yaml +++ b/api/openapi/engine/engine_service.yaml @@ -56,7 +56,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/CleanResponse' + $ref: '#/components/schemas/DeleteResponse' /enclaves/historical: get: @@ -184,10 +184,27 @@ components: api_container_log_level: type: string mode: - type: string - enum: - - TEST - - PRODUCTION + $ref: '#/components/schemas/EnclaveMode' + + EnclaveMode: + type: string + enum: + - TEST + - PRODUCTION + + EnclaveContainersStatus: + type: string + enum: + - RUNNING + - STOPPED + - EMPTY + + ApiContainerStatus: + type: string + enum: + - RUNNING + - STOPPED + - NON_EXISTENT CreateEnclaveResponse: type: object @@ -205,9 +222,9 @@ components: shortened_uuid: type: string containers_status: - type: integer + $ref: '#/components/schemas/EnclaveContainersStatus' api_container_status: - type: integer + $ref: '#/components/schemas/ApiContainerStatus' api_container_info: $ref: '#/components/schemas/EnclaveAPIContainerInfo' api_container_host_machine_info: @@ -215,10 +232,8 @@ components: creation_time: $ref: '#/components/schemas/Timestamp' mode: - type: string - enum: - - TEST - - PRODUCTION + $ref: '#/components/schemas/EnclaveMode' + EnclaveAPIContainerInfo: type: object @@ -258,7 +273,7 @@ components: uuid: type: string - CleanResponse: + DeleteResponse: type: object properties: removed_enclave_name_and_uuids: @@ -270,9 +285,9 @@ components: type: object properties: service_uuid_set: - type: object - additionalProperties: - type: boolean + type: array + items: + type: string follow_logs: type: boolean conjunctive_filters: @@ -292,9 +307,9 @@ components: additionalProperties: $ref: '#/components/schemas/LogLine' not_found_service_uuid_set: - type: object - additionalProperties: - type: boolean + type: array + items: + type: string LogLine: type: object @@ -310,10 +325,18 @@ components: type: object properties: operator: - type: integer + $ref: '#/components/schemas/LogLineOperator' text_pattern: type: string + LogLineOperator: + type: string + enum: + - DOES_CONTAIN_TEXT + - DOES_NOT_CONTAIN_TEXT + - DOES_CONTAIN_MATCH_REGEX + - DOES_NOT_CONTAIN_MATCH_REGEX + Timestamp: type: string format: date-time diff --git a/api/openapi/scripts/build.sh b/api/openapi/scripts/build.sh new file mode 100644 index 0000000000..a13a263fd3 --- /dev/null +++ b/api/openapi/scripts/build.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +# 2021-07-08 WATERMARK, DO NOT REMOVE - This script was generated from the Kurtosis Bash script template + +set -euo pipefail # Bash "strict mode" +script_dirpath="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +api_root_dirpath="$(dirname "${script_dirpath}")" \ No newline at end of file diff --git a/engine/server/engine/main.go b/engine/server/engine/main.go index b5be184041..0d9769ab56 100644 --- a/engine/server/engine/main.go +++ b/engine/server/engine/main.go @@ -7,7 +7,18 @@ package main import ( "context" + "flag" "fmt" + "net" + "net/http" + "os" + "path" + "path/filepath" + "runtime" + "strings" + "time" + + api "github.com/kurtosis-tech/kurtosis/api/golang/engine/kurtosis_engine_http_api_bindings" "github.com/kurtosis-tech/kurtosis/api/golang/engine/kurtosis_engine_rpc_api_bindings/kurtosis_engine_rpc_api_bindingsconnect" connect_server "github.com/kurtosis-tech/kurtosis/connect-server" "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/backend_creator" @@ -19,6 +30,7 @@ import ( em_api "github.com/kurtosis-tech/kurtosis/enclave-manager/server" "github.com/kurtosis-tech/kurtosis/engine/launcher/args" "github.com/kurtosis-tech/kurtosis/engine/launcher/args/kurtosis_backend_config" + "github.com/kurtosis-tech/kurtosis/engine/server/engine/centralized_logs" "github.com/kurtosis-tech/kurtosis/engine/server/engine/centralized_logs/client_implementations/persistent_volume" "github.com/kurtosis-tech/kurtosis/engine/server/engine/centralized_logs/client_implementations/persistent_volume/log_file_manager" "github.com/kurtosis-tech/kurtosis/engine/server/engine/centralized_logs/client_implementations/persistent_volume/logs_clock" @@ -26,19 +38,15 @@ import ( "github.com/kurtosis-tech/kurtosis/engine/server/engine/centralized_logs/client_implementations/persistent_volume/volume_filesystem" "github.com/kurtosis-tech/kurtosis/engine/server/engine/enclave_manager" "github.com/kurtosis-tech/kurtosis/engine/server/engine/server" + restApi "github.com/kurtosis-tech/kurtosis/engine/server/engine/server" "github.com/kurtosis-tech/kurtosis/metrics-library/golang/lib/analytics_logger" "github.com/kurtosis-tech/kurtosis/metrics-library/golang/lib/metrics_client" "github.com/kurtosis-tech/kurtosis/metrics-library/golang/lib/source" "github.com/kurtosis-tech/stacktrace" + "github.com/labstack/echo/v4" + echomiddleware "github.com/labstack/echo/v4/middleware" "github.com/rs/cors" "github.com/sirupsen/logrus" - "net/http" - "os" - "path" - "path/filepath" - "runtime" - "strings" - "time" ) const ( @@ -248,6 +256,15 @@ func runMain() error { if err := engineHttpServer.RunServerUntilInterruptedWithCors(cors.AllowAll()); err != nil { return stacktrace.Propagate(err, "An error occurred running the server.") } + + go restApiServer( + serverArgs, + enclaveManager, + perWeekLogsDatabaseClient, + perFileLogsDatabaseClient, + logFileManager, + metricsClient, + ) return nil } @@ -338,3 +355,51 @@ func formatFilenameFunctionForLogs(filename string, functionName string) string output.WriteString("]") return output.String() } + +func restApiServer( + serverArgs *args.EngineServerArgs, + enclave_manager *enclave_manager.EnclaveManager, + perWeekLogsDatabaseClient centralized_logs.LogsDatabaseClient, + perFileLogsDatabaseClient centralized_logs.LogsDatabaseClient, + logFileManager *log_file_manager.LogFileManager, + metricsClient metrics_client.MetricsClient, +) { + port := flag.String("port", "8008", "Port for test HTTP server") + flag.Parse() + + _, err := api.GetSwagger() + if err != nil { + fmt.Fprintf(os.Stderr, "Error loading swagger spec\n: %s", err) + os.Exit(1) + } + + // Clear out the servers array in the swagger spec, that skips validating + // that server names match. We don't know how this thing will be run. + // swagger.Servers = nil + + // Create an instance of our handler which satisfies the generated interface + runtime := restApi.EngineRuntime{ + ImageVersionTag: serverArgs.ImageVersionTag, + EnclaveManager: enclave_manager, + MetricsUserID: serverArgs.MetricsUserID, + DidUserAcceptSendingMetrics: serverArgs.DidUserAcceptSendingMetrics, + PerWeekLogsDatabaseClient: perWeekLogsDatabaseClient, + PerFileLogsDatabaseClient: perFileLogsDatabaseClient, + LogFileManager: logFileManager, + MetricsClient: metricsClient, + } + + // This is how you set up a basic Echo router + e := echo.New() + // Log all requests + e.Use(echomiddleware.Logger()) + // Use our validation middleware to check all requests against the + // OpenAPI schema. + // e.Use(middleware.OapiRequestValidator(swagger)) + + // We now register our runtime above as the handler for the interface + api.NewStrictHandler(runtime, nil) + + // And we serve HTTP until the world ends. + e.Logger.Fatal(e.Start(net.JoinHostPort("0.0.0.0", *port))) +} diff --git a/engine/server/engine/server/engine_connect_server_service.go b/engine/server/engine/server/engine_connect_server_service.go index 7716cca0ed..2bd6f0ba51 100644 --- a/engine/server/engine/server/engine_connect_server_service.go +++ b/engine/server/engine/server/engine_connect_server_service.go @@ -14,6 +14,7 @@ import ( "github.com/kurtosis-tech/kurtosis/engine/server/engine/centralized_logs/logline" "github.com/kurtosis-tech/kurtosis/engine/server/engine/enclave_manager" "github.com/kurtosis-tech/kurtosis/engine/server/engine/types" + "github.com/kurtosis-tech/kurtosis/engine/server/engine/utils" "github.com/kurtosis-tech/kurtosis/metrics-library/golang/lib/metrics_client" "github.com/kurtosis-tech/stacktrace" "github.com/sirupsen/logrus" @@ -177,14 +178,6 @@ func toGrpcEnclaveNameAndUuid(identifier *types.EnclaveNameAndUuid) *kurtosis_en return &ident } -func mapList[T, U any](data []T, f func(T) U) []U { - res := make([]U, 0, len(data)) - for _, e := range data { - res = append(res, f(e)) - } - return res -} - func (service *EngineConnectServerService) GetEngineInfo(context.Context, *connect.Request[emptypb.Empty]) (*connect.Response[kurtosis_engine_rpc_api_bindings.GetEngineInfoResponse], error) { result := &kurtosis_engine_rpc_api_bindings.GetEngineInfoResponse{ EngineVersion: service.imageVersionTag, @@ -244,7 +237,7 @@ func (service *EngineConnectServerService) GetExistingAndHistoricalEnclaveIdenti if err != nil { return nil, stacktrace.Propagate(err, "An error occurred while fetching enclave identifiers") } - response := &kurtosis_engine_rpc_api_bindings.GetExistingAndHistoricalEnclaveIdentifiersResponse{AllIdentifiers: mapList(allIdentifiers, toGrpcEnclaveIdentifiers)} + response := &kurtosis_engine_rpc_api_bindings.GetExistingAndHistoricalEnclaveIdentifiersResponse{AllIdentifiers: utils.MapList(allIdentifiers, toGrpcEnclaveIdentifiers)} return connect.NewResponse(response), nil } @@ -288,7 +281,7 @@ func (service *EngineConnectServerService) Clean(ctx context.Context, connectArg return nil, stacktrace.Propagate(err, "An error occurred removing all logs.") } } - response := &kurtosis_engine_rpc_api_bindings.CleanResponse{RemovedEnclaveNameAndUuids: mapList(removedEnclaveUuidsAndNames, toGrpcEnclaveNameAndUuid)} + response := &kurtosis_engine_rpc_api_bindings.CleanResponse{RemovedEnclaveNameAndUuids: utils.MapList(removedEnclaveUuidsAndNames, toGrpcEnclaveNameAndUuid)} return connect.NewResponse(response), nil } diff --git a/engine/server/engine/server/engine_http_service.go b/engine/server/engine/server/engine_http_service.go new file mode 100644 index 0000000000..bed23ace8f --- /dev/null +++ b/engine/server/engine/server/engine_http_service.go @@ -0,0 +1,529 @@ +package server + +import ( + "context" + "encoding/json" + "fmt" + "net/http" + "time" + + "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/enclave" + user_service "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/service" + "github.com/kurtosis-tech/kurtosis/engine/server/engine/centralized_logs" + "github.com/kurtosis-tech/kurtosis/engine/server/engine/centralized_logs/client_implementations/persistent_volume/log_file_manager" + "github.com/kurtosis-tech/kurtosis/engine/server/engine/centralized_logs/logline" + "github.com/kurtosis-tech/kurtosis/engine/server/engine/enclave_manager" + "github.com/kurtosis-tech/kurtosis/engine/server/engine/types" + "github.com/kurtosis-tech/kurtosis/engine/server/engine/utils" + "github.com/kurtosis-tech/kurtosis/metrics-library/golang/lib/metrics_client" + "github.com/kurtosis-tech/stacktrace" + "github.com/sirupsen/logrus" + "golang.org/x/exp/slices" + + api "github.com/kurtosis-tech/kurtosis/api/golang/engine/kurtosis_engine_http_api_bindings" +) + +type EngineRuntime struct { + // The version tag of the engine server image, so it can report its own version + ImageVersionTag string + + EnclaveManager *enclave_manager.EnclaveManager + + // The protected user ID for metrics analytics purpose + MetricsUserID string + + // User consent to send metrics + DidUserAcceptSendingMetrics bool + + // The clients for consuming container logs from the logs' database server + + // per week pulls logs from enclaves created post log retention feature + PerWeekLogsDatabaseClient centralized_logs.LogsDatabaseClient + + // per file pulls logs from enclaves created pre log retention feature + // TODO: remove once users are fully migrated to log retention/new log schema + PerFileLogsDatabaseClient centralized_logs.LogsDatabaseClient + + LogFileManager *log_file_manager.LogFileManager + + MetricsClient metrics_client.MetricsClient +} + +type Error struct { +} + +func (error Error) Error() string { + return "Not Implemented :(" +} + +func toHttpApiEnclaveContainersStatus(status types.EnclaveContainersStatus) api.EnclaveContainersStatus { + switch status { + case types.EnclaveContainersStatus_EMPTY: + return api.EnclaveContainersStatusEMPTY + case types.EnclaveContainersStatus_STOPPED: + return api.EnclaveContainersStatusSTOPPED + case types.EnclaveContainersStatus_RUNNING: + return api.EnclaveContainersStatusRUNNING + default: + panic(fmt.Sprintf("Undefined mapping of value: %s", status)) + } +} + +func toHttpApiContainerStatus(status types.ContainerStatus) api.ApiContainerStatus { + switch status { + case types.ContainerStatus_NONEXISTENT: + return api.ApiContainerStatusNONEXISTENT + case types.ContainerStatus_STOPPED: + return api.ApiContainerStatusSTOPPED + case types.ContainerStatus_RUNNING: + return api.ApiContainerStatusRUNNING + default: + panic(fmt.Sprintf("Undefined mapping of value: %s", status)) + } +} + +func toHttpApiEnclaveAPIContainerInfo(info *types.EnclaveAPIContainerInfo) api.EnclaveAPIContainerInfo { + port := int(info.GrpcPortInsideEnclave) + return api.EnclaveAPIContainerInfo{ + ContainerId: &info.ContainerId, + IpInsideEnclave: &info.IpInsideEnclave, + GrpcPortInsideEnclave: &port, + BridgeIpAddress: &info.BridgeIpAddress, + } +} + +func toHttpApiApiContainerHostMachineInfo(info *types.EnclaveAPIContainerHostMachineInfo) api.EnclaveAPIContainerHostMachineInfo { + port := int(info.GrpcPortOnHostMachine) + return api.EnclaveAPIContainerHostMachineInfo{ + IpOnHostMachine: &info.IpOnHostMachine, + GrpcPortOnHostMachine: &port, + } +} + +func toHttpApiEnclaveMode(mode types.EnclaveMode) api.EnclaveMode { + switch mode { + case types.EnclaveMode_PRODUCTION: + return api.PRODUCTION + case types.EnclaveMode_TEST: + return api.TEST + default: + panic(fmt.Sprintf("Undefined mapping of value: %s", mode)) + } +} + +func toHttpApiEnclaveInfo(info types.EnclaveInfo) api.EnclaveInfo { + containerInfo := toHttpApiEnclaveAPIContainerInfo(info.ApiContainerInfo) + apiHostMachine := toHttpApiApiContainerHostMachineInfo(info.ApiContainerHostMachineInfo) + containersStatus := toHttpApiEnclaveContainersStatus(info.EnclaveContainersStatus) + apiContainerStatus := toHttpApiContainerStatus(info.ApiContainerStatus) + mode := toHttpApiEnclaveMode(info.Mode) + return api.EnclaveInfo{ + EnclaveUuid: &info.EnclaveUuid, + ShortenedUuid: &info.ShortenedUuid, + Name: &info.Name, + ContainersStatus: &containersStatus, + ApiContainerStatus: &apiContainerStatus, + ApiContainerInfo: &containerInfo, + ApiContainerHostMachineInfo: &apiHostMachine, + CreationTime: &info.CreationTime, + Mode: &mode, + } +} + +func toHttpApiEnclaveInfos(infos map[string]*types.EnclaveInfo) map[string]api.EnclaveInfo { + var info_map map[string]api.EnclaveInfo + for key, info := range infos { + grpc_info := toHttpApiEnclaveInfo(*info) + info_map[key] = grpc_info + } + return info_map +} + +func toHttpApiEnclaveIdentifiers(identifier *types.EnclaveIdentifiers) api.EnclaveIdentifiers { + return api.EnclaveIdentifiers{ + EnclaveUuid: &identifier.EnclaveUuid, + Name: &identifier.Name, + ShortenedUuid: &identifier.ShortenedUuid, + } +} + +func toHttpApiEnclaveNameAndUuid(identifier *types.EnclaveNameAndUuid) api.EnclaveNameAndUuid { + return api.EnclaveNameAndUuid{ + Uuid: &identifier.Uuid, + Name: &identifier.Name, + } +} + +// Delete Enclaves +// (DELETE /enclaves) +func (engine EngineRuntime) DeleteEnclaves(ctx context.Context, request api.DeleteEnclavesRequestObject) (api.DeleteEnclavesResponseObject, error) { + removedEnclaveUuidsAndNames, err := engine.EnclaveManager.Clean(ctx, *request.Params.RemoveAll) + if err != nil { + return nil, stacktrace.Propagate(err, "An error occurred while cleaning enclaves") + } + if *request.Params.RemoveAll { + if err = engine.LogFileManager.RemoveAllLogs(); err != nil { + return nil, stacktrace.Propagate(err, "An error occurred removing all logs.") + } + } + removedApiResponse := utils.MapList(removedEnclaveUuidsAndNames, toHttpApiEnclaveNameAndUuid) + return api.DeleteEnclaves200JSONResponse(api.DeleteResponse{RemovedEnclaveNameAndUuids: &removedApiResponse}), nil +} + +// Get Enclaves +// (GET /enclaves) +func (engine EngineRuntime) GetEnclaves(ctx context.Context, request api.GetEnclavesRequestObject) (api.GetEnclavesResponseObject, error) { + infoForEnclaves, err := engine.EnclaveManager.GetEnclaves(ctx) + if err != nil { + return nil, stacktrace.Propagate(err, "An error occurred getting info for enclaves") + } + info_map_http := toHttpApiEnclaveInfos(infoForEnclaves) + response := api.GetEnclavesResponse{EnclaveInfo: &info_map_http} + return api.GetEnclaves200JSONResponse(response), nil +} + +// Create Enclave +// (POST /enclaves) +func (engine EngineRuntime) PostEnclaves(ctx context.Context, request api.PostEnclavesRequestObject) (api.PostEnclavesResponseObject, error) { + if err := engine.MetricsClient.TrackCreateEnclave(*request.Body.EnclaveName, subnetworkDisableBecauseItIsDeprecated); err != nil { + logrus.Warn("An error occurred while logging the create enclave event") + } + + logrus.Debugf("request: %+v", request) + apiContainerLogLevel, err := logrus.ParseLevel(*request.Body.ApiContainerLogLevel) + if err != nil { + return nil, stacktrace.Propagate(err, "An error occurred parsing the log level string '%v':", request.Body.ApiContainerLogLevel) + } + + isProduction := false + if *request.Body.Mode == api.PRODUCTION { + isProduction = true + } + + enclaveInfo, err := engine.EnclaveManager.CreateEnclave( + ctx, + engine.ImageVersionTag, + *request.Body.ApiContainerVersionTag, + apiContainerLogLevel, + *request.Body.EnclaveName, + isProduction, + ) + if err != nil { + return nil, stacktrace.Propagate(err, "An error occurred creating new enclave with name '%v'", request.Body.EnclaveName) + } + + grpcEnclaveInfo := toHttpApiEnclaveInfo(*enclaveInfo) + response := api.CreateEnclaveResponse{ + EnclaveInfo: &grpcEnclaveInfo, + } + + return api.PostEnclaves200JSONResponse(response), nil +} + +// Get Historical Enclaves +// (GET /enclaves/historical) +func (engine EngineRuntime) GetEnclavesHistorical(ctx context.Context, request api.GetEnclavesHistoricalRequestObject) (api.GetEnclavesHistoricalResponseObject, error) { + allIdentifiers, err := engine.EnclaveManager.GetExistingAndHistoricalEnclaveIdentifiers() + if err != nil { + return nil, stacktrace.Propagate(err, "An error occurred while fetching enclave identifiers") + } + identifiers_map_api := utils.MapList(allIdentifiers, toHttpApiEnclaveIdentifiers) + response := api.GetExistingAndHistoricalEnclaveIdentifiersResponse{AllIdentifiers: &identifiers_map_api} + return api.GetEnclavesHistorical200JSONResponse(response), nil +} + +// Destroy Enclave +// (DELETE /enclaves/{enclave_identifier}) +func (engine EngineRuntime) DeleteEnclavesEnclaveIdentifier(ctx context.Context, request api.DeleteEnclavesEnclaveIdentifierRequestObject) (api.DeleteEnclavesEnclaveIdentifierResponseObject, error) { + enclaveIdentifier := request.EnclaveIdentifier + + if err := engine.MetricsClient.TrackDestroyEnclave(enclaveIdentifier); err != nil { + logrus.Warnf("An error occurred while logging the destroy enclave event for enclave '%v'", enclaveIdentifier) + } + + if err := engine.EnclaveManager.DestroyEnclave(ctx, enclaveIdentifier); err != nil { + return nil, stacktrace.Propagate(err, "An error occurred destroying enclave with identifier '%v':", enclaveIdentifier) + } + return api.DeleteEnclavesEnclaveIdentifier200JSONResponse{}, nil +} + +// Get Enclave Info +// (GET /enclaves/{enclave_identifier}) +func (engine EngineRuntime) GetEnclavesEnclaveIdentifier(ctx context.Context, request api.GetEnclavesEnclaveIdentifierRequestObject) (api.GetEnclavesEnclaveIdentifierResponseObject, error) { + return nil, Error{} +} + +// Get Service Logs +// (POST /enclaves/{enclave_identifier}/logs) +func (engine EngineRuntime) PostEnclavesEnclaveIdentifierLogs(ctx context.Context, request api.PostEnclavesEnclaveIdentifierLogsRequestObject) (api.PostEnclavesEnclaveIdentifierLogsResponseObject, error) { + enclaveIdentifier := request.EnclaveIdentifier + enclaveUuid, err := engine.EnclaveManager.GetEnclaveUuidForEnclaveIdentifier(context.Background(), enclaveIdentifier) + + contextWithCancel, cancel := context.WithCancel(ctx) + defer cancel() + + if err != nil { + logrus.Errorf("An error occurred while fetching uuid for enclave '%v'. This could happen if the enclave has been deleted. Treating it as UUID", enclaveIdentifier) + enclaveUuid = enclave.EnclaveUUID(enclaveIdentifier) + } + serviceUuidStrSet := *request.Body.ServiceUuidSet + requestedServiceUuids := make(map[user_service.ServiceUUID]bool, len(serviceUuidStrSet)) + shouldFollowLogs := *request.Body.FollowLogs + shouldReturnAllLogs := *request.Body.ReturnAllLogs + numLogLines := *request.Body.NumLogLines + + for _, serviceUuidStr := range serviceUuidStrSet { + serviceUuid := user_service.ServiceUUID(serviceUuidStr) + requestedServiceUuids[serviceUuid] = true + } + + if engine.PerWeekLogsDatabaseClient == nil || engine.PerFileLogsDatabaseClient == nil { + return nil, stacktrace.NewError("It's not possible to return service logs because there is no logs database client; this is bug in Kurtosis") + } + + var ( + serviceLogsByServiceUuidChan chan map[user_service.ServiceUUID][]logline.LogLine + errChan chan error + cancelCtxFunc func() + ) + + notFoundServiceUuids, err := engine.reportAnyMissingUuidsAndGetNotFoundUuidsListHttp(contextWithCancel, enclaveUuid, requestedServiceUuids) + if err != nil { + return nil, stacktrace.Propagate(err, "An error occurred reporting missing user service UUIDs for enclave '%v' and requested service UUIDs '%+v'", enclaveUuid, requestedServiceUuids) + } + + conjunctiveLogLineFilters, err := newConjunctiveLogLineFiltersFromHttpLogLineFilters(*request.Body.ConjunctiveFilters) + if err != nil { + return nil, stacktrace.Propagate(err, "An error occurred creating the conjunctive log line filters from the GRPC's conjunctive log line filters '%+v'", request.Body.ConjunctiveFilters) + } + + // get enclave creation time to determine strategy to pull logs + enclaveCreationTime, err := engine.getEnclaveCreationTime(ctx, enclaveUuid) + if err != nil { + return nil, stacktrace.Propagate(err, "An error occurred while trying to get the enclave creation time to determine how to pull logs.") + } + logsDatabaseClient := engine.getLogsDatabaseClient(enclaveCreationTime) + + serviceLogsByServiceUuidChan, errChan, cancelCtxFunc, err = logsDatabaseClient.StreamUserServiceLogs( + contextWithCancel, + enclaveUuid, + requestedServiceUuids, + conjunctiveLogLineFilters, + shouldFollowLogs, + shouldReturnAllLogs, + uint32(numLogLines)) + if err != nil { + return nil, stacktrace.Propagate( + err, + "An error occurred streaming service logs for UUIDs '%+v' in enclave with ID '%v' using filters '%v+' "+ + "and with should follow logs value as '%v'", + requestedServiceUuids, + enclaveUuid, + conjunctiveLogLineFilters, + shouldFollowLogs, + ) + } + defer func() { + if cancelCtxFunc != nil { + cancelCtxFunc() + } + }() + + streamingResponse := StreamLogs{ + serviceLogsByServiceUuidChan: serviceLogsByServiceUuidChan, + errChan: errChan, + missingServicesUUID: notFoundServiceUuids, + cancelCtxFunc: cancelCtxFunc, + contextWithCancel: contextWithCancel, + } + + return streamingResponse, nil + +} + +// Stop Enclave +// (POST /enclaves/{enclave_identifier}/stop) +func (engine EngineRuntime) PostEnclavesEnclaveIdentifierStop(ctx context.Context, request api.PostEnclavesEnclaveIdentifierStopRequestObject) (api.PostEnclavesEnclaveIdentifierStopResponseObject, error) { + enclaveIdentifier := request.EnclaveIdentifier + + if err := engine.MetricsClient.TrackStopEnclave(enclaveIdentifier); err != nil { + logrus.Warnf("An error occurred while logging the stop enclave event for enclave '%v'", enclaveIdentifier) + } + + if err := engine.EnclaveManager.StopEnclave(ctx, enclaveIdentifier); err != nil { + return nil, stacktrace.Propagate(err, "An error occurred stopping enclave '%v'", enclaveIdentifier) + } + + return api.PostEnclavesEnclaveIdentifierStop200JSONResponse{}, nil +} + +// Get Engine Info +// (GET /engine/info) +func (engine EngineRuntime) GetEngineInfo(ctx context.Context, request api.GetEngineInfoRequestObject) (api.GetEngineInfoResponseObject, error) { + result := api.GetEngineInfoResponse{EngineVersion: &engine.ImageVersionTag} + return api.GetEngineInfo200JSONResponse(result), nil +} + +// ============================================================================================================================================= +// ============================================== Helper Functions ============================================================================= +// ============================================================================================================================================= + +type StreamLogs struct { + serviceLogsByServiceUuidChan chan map[user_service.ServiceUUID][]logline.LogLine + errChan chan error + requestedServicesUUID []user_service.ServiceUUID + missingServicesUUID []string + contextWithCancel context.Context + cancelCtxFunc func() +} + +func (response StreamLogs) VisitPostEnclavesEnclaveIdentifierLogsResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + enc := json.NewEncoder(w) + for { + select { + //stream case + case serviceLogsByServiceUuid, isChanOpen := <-response.serviceLogsByServiceUuidChan: + //If the channel is closed means that the logs database client won't continue sending streams + if !isChanOpen { + logrus.Debug("Exiting the stream loop after receiving a close signal from the service logs by service UUID channel") + return nil + } + + getServiceLogsResponse := newLogsResponseHttp(response.requestedServicesUUID, serviceLogsByServiceUuid, response.missingServicesUUID) + enc.Encode(getServiceLogsResponse) + //client cancel ctx case + case <-response.contextWithCancel.Done(): + logrus.Debug("The user service logs stream has done") + return nil + //error from logs database case + case _, isChanOpen := <-response.errChan: + if isChanOpen { + logrus.Debug("Exiting the stream because an error from the logs database client was received through the error chan.") + return nil + } + logrus.Debug("Exiting the stream loop after receiving a close signal from the error chan") + return nil + } + } +} + +func (service *EngineRuntime) reportAnyMissingUuidsAndGetNotFoundUuidsListHttp( + ctx context.Context, + enclaveUuid enclave.EnclaveUUID, + requestedServiceUuids map[user_service.ServiceUUID]bool, +) ([]string, error) { + // doesn't matter which logs client is used here + existingServiceUuids, err := service.PerWeekLogsDatabaseClient.FilterExistingServiceUuids(ctx, enclaveUuid, requestedServiceUuids) + if err != nil { + return nil, stacktrace.Propagate(err, "An error occurred retrieving the exhaustive list of service UUIDs from the log client for enclave '%v' and for the requested UUIDs '%+v'", enclaveUuid, requestedServiceUuids) + } + + notFoundServiceUuidsMap := getNotFoundServiceUuidsAndEmptyServiceLogsMap(requestedServiceUuids, existingServiceUuids) + var notFoundServiceUuids []string + for service, _ := range notFoundServiceUuidsMap { + notFoundServiceUuids = append(notFoundServiceUuids, service) + } + return notFoundServiceUuids, nil +} + +func newLogsResponseHttp( + requestedServiceUuids []user_service.ServiceUUID, + serviceLogsByServiceUuid map[user_service.ServiceUUID][]logline.LogLine, + initialNotFoundServiceUuids []string, +) *api.GetServiceLogsResponse { + serviceLogLinesByUuid := make(map[string]api.LogLine, len(serviceLogsByServiceUuid)) + notFoundServiceUuids := make([]string, len(initialNotFoundServiceUuids)) + for _, serviceUuid := range requestedServiceUuids { + serviceUuidStr := string(serviceUuid) + isInNotFoundUuidList := slices.Contains(initialNotFoundServiceUuids, serviceUuidStr) + serviceLogLines, found := serviceLogsByServiceUuid[serviceUuid] + // should continue in the not-found-UUID list + if !found && isInNotFoundUuidList { + notFoundServiceUuids = append(notFoundServiceUuids, serviceUuidStr) + } + + // there is no new log lines but is a found UUID, so it has to be included in the service logs map + if !found && !isInNotFoundUuidList { + serviceLogLinesByUuid[serviceUuidStr] = api.LogLine{ + Line: nil, + Timestamp: nil, + } + } + + logLines := newHttpBindingsLogLineFromLogLines(serviceLogLines) + serviceLogLinesByUuid[serviceUuidStr] = logLines + } + + getServiceLogsResponse := &api.GetServiceLogsResponse{ + NotFoundServiceUuidSet: ¬FoundServiceUuids, + ServiceLogsByServiceUuid: &serviceLogLinesByUuid, + } + return getServiceLogsResponse +} + +func newHttpBindingsLogLineFromLogLines(logLines []logline.LogLine) api.LogLine { + logLinesStr := make([]string, len(logLines)) + var logTimestamp time.Time + + for logLineIndex, logLine := range logLines { + logLinesStr[logLineIndex] = logLine.GetContent() + logTimestamp = logLine.GetTimestamp() + } + + return api.LogLine{Line: &logLinesStr, Timestamp: &logTimestamp} + +} + +func newConjunctiveLogLineFiltersFromHttpLogLineFilters( + logLineFilters []api.LogLineFilter, +) (logline.ConjunctiveLogLineFilters, error) { + var conjunctiveLogLineFilters logline.ConjunctiveLogLineFilters + + for _, logLineFilter := range logLineFilters { + var filter *logline.LogLineFilter + operator := logLineFilter.Operator + filterTextPattern := logLineFilter.TextPattern + switch *operator { + case api.DOESCONTAINTEXT: + filter = logline.NewDoesContainTextLogLineFilter(*filterTextPattern) + case api.DOESNOTCONTAINTEXT: + filter = logline.NewDoesNotContainTextLogLineFilter(*filterTextPattern) + case api.DOESCONTAINMATCHREGEX: + filter = logline.NewDoesContainMatchRegexLogLineFilter(*filterTextPattern) + case api.DOESNOTCONTAINMATCHREGEX: + filter = logline.NewDoesNotContainMatchRegexLogLineFilter(*filterTextPattern) + default: + return nil, stacktrace.NewError("Unrecognized log line filter operator '%v' in GRPC filter '%v'; this is a bug in Kurtosis", operator, logLineFilter) + } + conjunctiveLogLineFilters = append(conjunctiveLogLineFilters, *filter) + } + + return conjunctiveLogLineFilters, nil +} + +// If the enclave was created prior to log retention, return the per file logs client +func (service *EngineRuntime) getLogsDatabaseClient(enclaveCreationTime time.Time) centralized_logs.LogsDatabaseClient { + if enclaveCreationTime.After(logRetentionFeatureReleaseTime) { + return service.PerWeekLogsDatabaseClient + } else { + return service.PerFileLogsDatabaseClient + } +} + +func (service *EngineRuntime) getEnclaveCreationTime(ctx context.Context, enclaveUuid enclave.EnclaveUUID) (time.Time, error) { + enclaves, err := service.EnclaveManager.GetEnclaves(ctx) + if err != nil { + return time.Time{}, err + } + + enclaveObj, found := enclaves[string(enclaveUuid)] + if !found { + return time.Time{}, stacktrace.NewError("Engine could not find enclave '%v'", enclaveUuid) + } + + timestamp := enclaveObj.CreationTime + return timestamp, nil +} diff --git a/engine/server/engine/utils/List.go b/engine/server/engine/utils/List.go new file mode 100644 index 0000000000..8ac5519b0a --- /dev/null +++ b/engine/server/engine/utils/List.go @@ -0,0 +1,9 @@ +package utils + +func MapList[T, U any](data []T, f func(T) U) []U { + res := make([]U, 0, len(data)) + for _, e := range data { + res = append(res, f(e)) + } + return res +} diff --git a/go.work.sum b/go.work.sum index 3ddc504898..15aab49df5 100644 --- a/go.work.sum +++ b/go.work.sum @@ -1,18 +1,11 @@ github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= -github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= -github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU= -github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= -github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/invopop/yaml v0.2.0 h1:7zky/qH+O0DwAyoobXUqvVBwgBFRxKoQ/3FjcVpjTMY= +github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY= github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= -github.com/perimeterx/marshmallow v1.1.5 h1:a2LALqQ1BlHM8PZblsDdidgv1mWi1DgC2UmX50IvK2s= github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= go.etcd.io/bbolt v1.3.7 h1:j+zJOnnEjF/kyHlDDgGnVL/AIqIJPq8UoB2GSNfkUfQ= From 11280395f3eb25d54f1e9702c489ca7cb37b1566 Mon Sep 17 00:00:00 2001 From: lostbean Date: Tue, 14 Nov 2023 12:07:51 -0300 Subject: [PATCH 09/95] tidy cli mod --- cli/cli/go.mod | 9 ++++----- cli/cli/go.sum | 17 ++++++++++------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/cli/cli/go.mod b/cli/cli/go.mod index 03eb5736cb..d7173e4370 100644 --- a/cli/cli/go.mod +++ b/cli/cli/go.mod @@ -66,7 +66,7 @@ require ( github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 // indirect - github.com/andybalholm/brotli v1.0.4 // indirect + github.com/andybalholm/brotli v1.0.5 // indirect github.com/bytedance/sonic v1.9.2 // indirect github.com/cenkalti/backoff/v4 v4.2.1 // indirect github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e // indirect @@ -84,11 +84,10 @@ require ( github.com/gammazero/deque v0.1.0 // indirect github.com/gammazero/workerpool v1.1.2 // indirect github.com/ghodss/yaml v1.0.0 // indirect - github.com/gin-gonic/gin v1.9.1 // indirect github.com/go-logr/logr v1.2.3 // indirect github.com/go-openapi/jsonpointer v0.19.6 // indirect github.com/go-openapi/jsonreference v0.20.1 // indirect - github.com/go-openapi/swag v0.22.3 // indirect + github.com/go-openapi/swag v0.22.4 // indirect github.com/go-playground/validator/v10 v10.14.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/protobuf v1.5.3 // indirect @@ -97,7 +96,7 @@ require ( github.com/google/go-cmp v0.5.9 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/google/gofuzz v1.1.0 // indirect - github.com/google/uuid v1.3.0 // indirect + github.com/google/uuid v1.3.1 // indirect github.com/imdario/mergo v0.3.16 // indirect github.com/improbable-eng/grpc-web v0.15.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect @@ -108,7 +107,7 @@ require ( github.com/klauspost/pgzip v1.2.5 // indirect github.com/kurtosis-tech/kurtosis/grpc-file-transfer/golang v0.0.0 // indirect github.com/mailru/easyjson v0.7.7 // indirect - github.com/mattn/go-colorable v0.1.9 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-shellwords v1.0.12 // indirect github.com/mholt/archiver/v3 v3.5.1 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect diff --git a/cli/cli/go.sum b/cli/cli/go.sum index 0ad75429e5..8e4d98c917 100644 --- a/cli/cli/go.sum +++ b/cli/cli/go.sum @@ -32,8 +32,8 @@ github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRF github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/andybalholm/brotli v1.0.1/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= -github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY= -github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= +github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs= +github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= @@ -158,7 +158,6 @@ github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= -github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -175,8 +174,9 @@ github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= github.com/go-openapi/jsonreference v0.20.1 h1:FBLnyygC4/IZZr893oiomc9XaghoveYTrLC1F86HID8= github.com/go-openapi/jsonreference v0.20.1/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= -github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU= +github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= @@ -259,8 +259,8 @@ github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OI github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= +github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= github.com/googleapis/gax-go/v2 v2.0.3/go.mod h1:LLvjysVCY1JZeum8Z6l8qUty8fiNwE08qbEPm1M08qg= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= @@ -378,13 +378,15 @@ github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYt github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.9 h1:sqDoxXbdeALODt0DAeJCVp38ps9ZogZEAXjus69YV3U= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= @@ -790,6 +792,7 @@ golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= From c544585760035f90335f596c5a26941f15da3b47 Mon Sep 17 00:00:00 2001 From: lostbean Date: Tue, 14 Nov 2023 12:08:34 -0300 Subject: [PATCH 10/95] allow multiple shells on ktdev completion --- scripts/set_ktdev.sh | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/scripts/set_ktdev.sh b/scripts/set_ktdev.sh index 0ac9209afa..438c62c1cc 100644 --- a/scripts/set_ktdev.sh +++ b/scripts/set_ktdev.sh @@ -1,6 +1,21 @@ # Add alias to compiled CLI alias ktdev="$(pwd)/cli/cli/scripts/launch-cli.sh" -# Setup bash completion -source <(ktdev completion bash) -complete -F __start_kurtosis ktdev \ No newline at end of file +CURRENT_SHELL=$(sh -c 'ps -p $$ -o ppid=' | xargs ps -o comm= -p) +SHELL_NAME=$(basename -- $CURRENT_SHELL) + +echo "Detected shell: $SHELL_NAME" + +case "$SHELL_NAME" in + +bash) echo "Setting $SHELL_NAME completion" + source <(ktdev completion bash) + complete -F __start_kurtosis ktdev + ;; +zsh) echo "Setting $SHELL_NAME completion" + source <(ktdev completion zsh) + compdef __start_kurtosis ktdev + ;; +*) echo "Sheel $SHELL_NAME is not supported" + ;; +esac \ No newline at end of file From 097d2a1a24e8cd8fb35559a56793b25daf3cd17e Mon Sep 17 00:00:00 2001 From: lostbean Date: Tue, 14 Nov 2023 13:58:45 -0300 Subject: [PATCH 11/95] Do actual registration of the handlers --- engine/server/engine/main.go | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/engine/server/engine/main.go b/engine/server/engine/main.go index 0d9769ab56..a094e1a551 100644 --- a/engine/server/engine/main.go +++ b/engine/server/engine/main.go @@ -235,6 +235,15 @@ func runMain() error { } }() + go restApiServer( + serverArgs, + enclaveManager, + perWeekLogsDatabaseClient, + perFileLogsDatabaseClient, + logFileManager, + metricsClient, + ) + engineConnectServer := server.NewEngineConnectServerService( serverArgs.ImageVersionTag, enclaveManager, @@ -251,20 +260,11 @@ func runMain() error { } }() - logrus.Info("Running server...") engineHttpServer := connect_server.NewConnectServer(serverArgs.GrpcListenPortNum, grpcServerStopGracePeriod, handler, apiPath) if err := engineHttpServer.RunServerUntilInterruptedWithCors(cors.AllowAll()); err != nil { return stacktrace.Propagate(err, "An error occurred running the server.") } - go restApiServer( - serverArgs, - enclaveManager, - perWeekLogsDatabaseClient, - perFileLogsDatabaseClient, - logFileManager, - metricsClient, - ) return nil } @@ -364,6 +364,7 @@ func restApiServer( logFileManager *log_file_manager.LogFileManager, metricsClient metrics_client.MetricsClient, ) { + logrus.Info("Running REST API server...") port := flag.String("port", "8008", "Port for test HTTP server") flag.Parse() @@ -398,7 +399,7 @@ func restApiServer( // e.Use(middleware.OapiRequestValidator(swagger)) // We now register our runtime above as the handler for the interface - api.NewStrictHandler(runtime, nil) + api.RegisterHandlers(e, api.NewStrictHandler(runtime, nil)) // And we serve HTTP until the world ends. e.Logger.Fatal(e.Start(net.JoinHostPort("0.0.0.0", *port))) From 19982afad6d32f6231ba97aedd43a0608ea053d3 Mon Sep 17 00:00:00 2001 From: lostbean Date: Tue, 14 Nov 2023 15:45:34 -0300 Subject: [PATCH 12/95] fix pointers --- .../engine/server/engine_connect_server_service.go | 2 +- engine/server/engine/server/engine_http_service.go | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/engine/server/engine/server/engine_connect_server_service.go b/engine/server/engine/server/engine_connect_server_service.go index 2bd6f0ba51..2aa26b5cbd 100644 --- a/engine/server/engine/server/engine_connect_server_service.go +++ b/engine/server/engine/server/engine_connect_server_service.go @@ -153,7 +153,7 @@ func toGrpcEnclaveInfo(info types.EnclaveInfo) kurtosis_engine_rpc_api_bindings. } func toGrpcEnclaveInfos(infos map[string]*types.EnclaveInfo) map[string]*kurtosis_engine_rpc_api_bindings.EnclaveInfo { - var info_map map[string]*kurtosis_engine_rpc_api_bindings.EnclaveInfo + info_map := make(map[string]*kurtosis_engine_rpc_api_bindings.EnclaveInfo) for key, info := range infos { grpc_info := toGrpcEnclaveInfo(*info) info_map[key] = &grpc_info diff --git a/engine/server/engine/server/engine_http_service.go b/engine/server/engine/server/engine_http_service.go index bed23ace8f..ec2a9d1227 100644 --- a/engine/server/engine/server/engine_http_service.go +++ b/engine/server/engine/server/engine_http_service.go @@ -83,6 +83,9 @@ func toHttpApiContainerStatus(status types.ContainerStatus) api.ApiContainerStat } func toHttpApiEnclaveAPIContainerInfo(info *types.EnclaveAPIContainerInfo) api.EnclaveAPIContainerInfo { + if info == nil { + return api.EnclaveAPIContainerInfo{} + } port := int(info.GrpcPortInsideEnclave) return api.EnclaveAPIContainerInfo{ ContainerId: &info.ContainerId, @@ -93,6 +96,9 @@ func toHttpApiEnclaveAPIContainerInfo(info *types.EnclaveAPIContainerInfo) api.E } func toHttpApiApiContainerHostMachineInfo(info *types.EnclaveAPIContainerHostMachineInfo) api.EnclaveAPIContainerHostMachineInfo { + if info == nil { + return api.EnclaveAPIContainerHostMachineInfo{} + } port := int(info.GrpcPortOnHostMachine) return api.EnclaveAPIContainerHostMachineInfo{ IpOnHostMachine: &info.IpOnHostMachine, @@ -131,10 +137,12 @@ func toHttpApiEnclaveInfo(info types.EnclaveInfo) api.EnclaveInfo { } func toHttpApiEnclaveInfos(infos map[string]*types.EnclaveInfo) map[string]api.EnclaveInfo { - var info_map map[string]api.EnclaveInfo + info_map := make(map[string]api.EnclaveInfo) for key, info := range infos { - grpc_info := toHttpApiEnclaveInfo(*info) - info_map[key] = grpc_info + if info != nil { + grpc_info := toHttpApiEnclaveInfo(*info) + info_map[key] = grpc_info + } } return info_map } From bd9c94921817c4ff27749c1b88357a857ba0d119 Mon Sep 17 00:00:00 2001 From: lostbean Date: Tue, 14 Nov 2023 17:40:47 -0300 Subject: [PATCH 13/95] return 404 on enclave uuid --- engine/server/engine/server/engine_http_service.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/engine/server/engine/server/engine_http_service.go b/engine/server/engine/server/engine_http_service.go index ec2a9d1227..c9f2c6dcac 100644 --- a/engine/server/engine/server/engine_http_service.go +++ b/engine/server/engine/server/engine_http_service.go @@ -272,7 +272,7 @@ func (engine EngineRuntime) PostEnclavesEnclaveIdentifierLogs(ctx context.Contex if err != nil { logrus.Errorf("An error occurred while fetching uuid for enclave '%v'. This could happen if the enclave has been deleted. Treating it as UUID", enclaveIdentifier) - enclaveUuid = enclave.EnclaveUUID(enclaveIdentifier) + return StreamLogsNotFound{}, nil } serviceUuidStrSet := *request.Body.ServiceUuidSet requestedServiceUuids := make(map[user_service.ServiceUUID]bool, len(serviceUuidStrSet)) @@ -385,6 +385,14 @@ type StreamLogs struct { cancelCtxFunc func() } +type StreamLogsNotFound struct{} + +func (response StreamLogsNotFound) VisitPostEnclavesEnclaveIdentifierLogsResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(404) + return nil +} + func (response StreamLogs) VisitPostEnclavesEnclaveIdentifierLogsResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") w.WriteHeader(200) From 7991f1a6bae8e1c038b182988f1bdb5aa59fcbeb Mon Sep 17 00:00:00 2001 From: lostbean Date: Tue, 14 Nov 2023 17:41:24 -0300 Subject: [PATCH 14/95] log error from log channel --- engine/server/engine/server/engine_http_service.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/engine/server/engine/server/engine_http_service.go b/engine/server/engine/server/engine_http_service.go index c9f2c6dcac..f95715b052 100644 --- a/engine/server/engine/server/engine_http_service.go +++ b/engine/server/engine/server/engine_http_service.go @@ -295,7 +295,7 @@ func (engine EngineRuntime) PostEnclavesEnclaveIdentifierLogs(ctx context.Contex cancelCtxFunc func() ) - notFoundServiceUuids, err := engine.reportAnyMissingUuidsAndGetNotFoundUuidsListHttp(contextWithCancel, enclaveUuid, requestedServiceUuids) + notFoundServiceUuids, err := engine.reportAnyMissingUuidsAndGetNotFoundUuidsListHttp(ctx, enclaveUuid, requestedServiceUuids) if err != nil { return nil, stacktrace.Propagate(err, "An error occurred reporting missing user service UUIDs for enclave '%v' and requested service UUIDs '%+v'", enclaveUuid, requestedServiceUuids) } @@ -415,8 +415,9 @@ func (response StreamLogs) VisitPostEnclavesEnclaveIdentifierLogsResponse(w http logrus.Debug("The user service logs stream has done") return nil //error from logs database case - case _, isChanOpen := <-response.errChan: + case err, isChanOpen := <-response.errChan: if isChanOpen { + logrus.Error(err) logrus.Debug("Exiting the stream because an error from the logs database client was received through the error chan.") return nil } From 19b569e56bbfbb7721b1c7d31ad24ba78a0e5a87 Mon Sep 17 00:00:00 2001 From: lostbean Date: Tue, 14 Nov 2023 17:45:24 -0300 Subject: [PATCH 15/95] rename file --- engine/server/engine/utils/{List.go => list.go} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename engine/server/engine/utils/{List.go => list.go} (100%) diff --git a/engine/server/engine/utils/List.go b/engine/server/engine/utils/list.go similarity index 100% rename from engine/server/engine/utils/List.go rename to engine/server/engine/utils/list.go From 1eaadcb11b627df301ff6482e05bdb71cdc64c88 Mon Sep 17 00:00:00 2001 From: lostbean Date: Tue, 14 Nov 2023 18:08:19 -0300 Subject: [PATCH 16/95] bind new REST API port to engine container --- .../engine_functions/create_engine.go | 20 ++++++++++++++++++- engine/server/engine/main.go | 8 +++----- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/engine_functions/create_engine.go b/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/engine_functions/create_engine.go index 4cc40f92c7..9b9d975aa5 100644 --- a/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/engine_functions/create_engine.go +++ b/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/engine_functions/create_engine.go @@ -3,6 +3,8 @@ package engine_functions import ( "context" "fmt" + "time" + "github.com/docker/go-connections/nat" "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/consts" "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/logs_aggregator_functions" @@ -17,13 +19,13 @@ import ( "github.com/kurtosis-tech/kurtosis/engine/launcher/args" "github.com/kurtosis-tech/stacktrace" "github.com/sirupsen/logrus" - "time" ) const ( //TODO: pass this parameter enclaveManagerUIPort = 9711 enclaveManagerAPIPort = 8081 + restAPIPort = 9779 //TODO: pass this parameter maxWaitForEngineAvailabilityRetries = 10 timeBetweenWaitForEngineAvailabilityRetries = 1 * time.Second logsStorageDirpath = "/var/log/kurtosis/" @@ -134,6 +136,16 @@ func CreateEngine( ) } + restAPIPortSpec, err := port_spec.NewPortSpec(uint16(restAPIPort), consts.EngineTransportProtocol, consts.HttpApplicationProtocol, defaultWait) + if err != nil { + return nil, stacktrace.Propagate( + err, + "An error occurred creating the Enclave Manager UI's http port spec object using number '%v' and protocol '%v'", + restAPIPort, + consts.EngineTransportProtocol.String(), + ) + } + engineAttrs, err := objAttrsProvider.ForEngineServer( engineGuid, consts.KurtosisInternalContainerGrpcPortId, @@ -163,10 +175,16 @@ func CreateEngine( return nil, stacktrace.Propagate(err, "An error occurred transforming the Enclave Manager API port spec to a Docker port") } + restAPIDockerPort, err := shared_helpers.TransformPortSpecToDockerPort(restAPIPortSpec) + if err != nil { + return nil, stacktrace.Propagate(err, "An error occurred transforming the Enclave Manager API port spec to a Docker port") + } + usedPorts := map[nat.Port]docker_manager.PortPublishSpec{ privateGrpcDockerPort: docker_manager.NewManualPublishingSpec(grpcPortNum), enclaveManagerUIDockerPort: docker_manager.NewManualPublishingSpec(uint16(enclaveManagerUIPort)), enclaveManagerAPIDockerPort: docker_manager.NewManualPublishingSpec(uint16(enclaveManagerAPIPort)), + restAPIDockerPort: docker_manager.NewManualPublishingSpec(uint16(restAPIPort)), } bindMounts := map[string]string{ diff --git a/engine/server/engine/main.go b/engine/server/engine/main.go index a094e1a551..52811cbeaa 100644 --- a/engine/server/engine/main.go +++ b/engine/server/engine/main.go @@ -7,7 +7,6 @@ package main import ( "context" - "flag" "fmt" "net" "net/http" @@ -68,6 +67,8 @@ const ( indexPath = "index.html" shouldFlushMetricsClientQueueOnEachEvent = false + + restAPIPortAddr uint16 = 9779 ) // Nil indicates that the KurtosisBackend should not operate in API container mode, which is appropriate here @@ -365,8 +366,6 @@ func restApiServer( metricsClient metrics_client.MetricsClient, ) { logrus.Info("Running REST API server...") - port := flag.String("port", "8008", "Port for test HTTP server") - flag.Parse() _, err := api.GetSwagger() if err != nil { @@ -401,6 +400,5 @@ func restApiServer( // We now register our runtime above as the handler for the interface api.RegisterHandlers(e, api.NewStrictHandler(runtime, nil)) - // And we serve HTTP until the world ends. - e.Logger.Fatal(e.Start(net.JoinHostPort("0.0.0.0", *port))) + e.Logger.Fatal(e.Start(net.JoinHostPort("0.0.0.0", fmt.Sprint(restAPIPortAddr)))) } From 673c5d6125317e76a8ca634103c2e4bd7ae8dee7 Mon Sep 17 00:00:00 2001 From: lostbean Date: Wed, 15 Nov 2023 10:28:36 -0300 Subject: [PATCH 17/95] clean up test service --- api/golang/engine_http_server.go | 51 ------------------ api/golang/http/core_handler.go | 90 -------------------------------- 2 files changed, 141 deletions(-) delete mode 100644 api/golang/engine_http_server.go delete mode 100644 api/golang/http/core_handler.go diff --git a/api/golang/engine_http_server.go b/api/golang/engine_http_server.go deleted file mode 100644 index ed5f63a0e3..0000000000 --- a/api/golang/engine_http_server.go +++ /dev/null @@ -1,51 +0,0 @@ -package main - -import ( - "flag" - "fmt" - "net" - "os" - - api "github.com/kurtosis-tech/kurtosis/api/golang/core/kurtosis_core_http_api_bindings" - "github.com/kurtosis-tech/kurtosis/api/golang/http" - "github.com/labstack/echo/v4" - echomiddleware "github.com/labstack/echo/v4/middleware" - // middleware "github.com/oapi-codegen/echo-middleware" -) - -type ServerInterface struct { - - // (GET /artifacts) -} - -func main() { - port := flag.String("port", "8008", "Port for test HTTP server") - flag.Parse() - - _, err := api.GetSwagger() - if err != nil { - fmt.Fprintf(os.Stderr, "Error loading swagger spec\n: %s", err) - os.Exit(1) - } - - // Clear out the servers array in the swagger spec, that skips validating - // that server names match. We don't know how this thing will be run. - // swagger.Servers = nil - - // Create an instance of our handler which satisfies the generated interface - petStore := http.EngineRuntime{} - - // This is how you set up a basic Echo router - e := echo.New() - // Log all requests - e.Use(echomiddleware.Logger()) - // Use our validation middleware to check all requests against the - // OpenAPI schema. - // e.Use(middleware.OapiRequestValidator(swagger)) - - // We now register our petStore above as the handler for the interface - api.RegisterHandlers(e, &petStore) - - // And we serve HTTP until the world ends. - e.Logger.Fatal(e.Start(net.JoinHostPort("0.0.0.0", *port))) -} diff --git a/api/golang/http/core_handler.go b/api/golang/http/core_handler.go deleted file mode 100644 index addd05e1cf..0000000000 --- a/api/golang/http/core_handler.go +++ /dev/null @@ -1,90 +0,0 @@ -package http - -import ( - api "github.com/kurtosis-tech/kurtosis/api/golang/core/kurtosis_core_http_api_bindings" - "github.com/labstack/echo/v4" -) - -type EngineRuntime struct { -} - -type Error struct { -} - -func (error Error) Error() string { - return "Not Implemented :(" -} - -func (engine *EngineRuntime) GetArtifacts(ctx echo.Context) error { - return Error{} -} - -// (PUT /artifacts/local-file) -func (engine *EngineRuntime) PutArtifactsLocalFile(ctx echo.Context) error { - return Error{} -} - -// (PUT /artifacts/remote-file) -func (engine *EngineRuntime) PutArtifactsRemoteFile(ctx echo.Context) error { - return Error{} -} - -// (PUT /artifacts/services/{service_identifier}) -func (engine *EngineRuntime) PutArtifactsServicesServiceIdentifier(ctx echo.Context, serviceIdentifier string) error { - return Error{} -} - -// (GET /artifacts/{artifact_identifier}) -func (engine *EngineRuntime) GetArtifactsArtifactIdentifier(ctx echo.Context, artifactIdentifier string) error { - return Error{} -} - -// (GET /artifacts/{artifact_identifier}/download) -func (engine *EngineRuntime) GetArtifactsArtifactIdentifierDownload(ctx echo.Context, artifactIdentifier string) error { - return Error{} -} - -// (GET /services) -func (engine *EngineRuntime) GetServices(ctx echo.Context) error { - return Error{} -} - -// (POST /services/connection) -func (engine *EngineRuntime) PostServicesConnection(ctx echo.Context) error { - return Error{} -} - -// (GET /services/{service_identifier}) -func (engine *EngineRuntime) GetServicesServiceIdentifier(ctx echo.Context, serviceIdentifier string, params api.GetServicesServiceIdentifierParams) error { - return Error{} -} - -// (POST /services/{service_identifier}/command) -func (engine *EngineRuntime) PostServicesServiceIdentifierCommand(ctx echo.Context, serviceIdentifier string) error { - return Error{} -} - -// (POST /services/{service_identifier}/endpoints/{port_number}/availability) -func (engine *EngineRuntime) PostServicesServiceIdentifierEndpointsPortNumberAvailability(ctx echo.Context, serviceIdentifier string, portNumber int) error { - return Error{} -} - -// (GET /starlark) -func (engine *EngineRuntime) GetStarlark(ctx echo.Context) error { - return Error{} -} - -// (PUT /starlark/packages) -func (engine *EngineRuntime) PutStarlarkPackages(ctx echo.Context) error { - return Error{} -} - -// (POST /starlark/packages/{package_id}) -func (engine *EngineRuntime) PostStarlarkPackagesPackageId(ctx echo.Context, packageId string) error { - return Error{} -} - -// (POST /starlark/scripts) -func (engine *EngineRuntime) PostStarlarkScripts(ctx echo.Context) error { - return Error{} -} From e3593a818df8f4c980c42759f169135da3e06d3a Mon Sep 17 00:00:00 2001 From: lostbean Date: Wed, 15 Nov 2023 11:19:31 -0300 Subject: [PATCH 18/95] add enclave id to APIC's REST api path --- .../api_container_server.gen.go | 952 ++++++++++-------- .../api_container_types.gen.go | 79 +- api/openapi/core/api_container_service.yaml | 203 ++-- api/openapi/scripts/build.sh | 10 +- 4 files changed, 724 insertions(+), 520 deletions(-) mode change 100644 => 100755 api/openapi/scripts/build.sh diff --git a/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go b/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go index 018187cbf5..e63892baac 100644 --- a/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go +++ b/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go @@ -24,50 +24,50 @@ import ( // ServerInterface represents all server handlers. type ServerInterface interface { - // (GET /artifacts) - GetArtifacts(ctx echo.Context) error + // (GET /enclaves/{enclave_identifier}/artifacts) + GetEnclavesEnclaveIdentifierArtifacts(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error - // (PUT /artifacts/local-file) - PutArtifactsLocalFile(ctx echo.Context) error + // (PUT /enclaves/{enclave_identifier}/artifacts/local-file) + PutEnclavesEnclaveIdentifierArtifactsLocalFile(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error - // (PUT /artifacts/remote-file) - PutArtifactsRemoteFile(ctx echo.Context) error + // (PUT /enclaves/{enclave_identifier}/artifacts/remote-file) + PutEnclavesEnclaveIdentifierArtifactsRemoteFile(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error - // (PUT /artifacts/services/{service_identifier}) - PutArtifactsServicesServiceIdentifier(ctx echo.Context, serviceIdentifier string) error + // (PUT /enclaves/{enclave_identifier}/artifacts/services/{service_identifier}) + PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, serviceIdentifier ServiceIdentifier) error - // (GET /artifacts/{artifact_identifier}) - GetArtifactsArtifactIdentifier(ctx echo.Context, artifactIdentifier string) error + // (GET /enclaves/{enclave_identifier}/artifacts/{artifact_identifier}) + GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, artifactIdentifier ArtifactIdentifier) error - // (GET /artifacts/{artifact_identifier}/download) - GetArtifactsArtifactIdentifierDownload(ctx echo.Context, artifactIdentifier string) error + // (GET /enclaves/{enclave_identifier}/artifacts/{artifact_identifier}/download) + GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownload(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, artifactIdentifier ArtifactIdentifier) error - // (GET /services) - GetServices(ctx echo.Context) error + // (GET /enclaves/{enclave_identifier}/services) + GetEnclavesEnclaveIdentifierServices(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error - // (POST /services/connection) - PostServicesConnection(ctx echo.Context) error + // (POST /enclaves/{enclave_identifier}/services/connection) + PostEnclavesEnclaveIdentifierServicesConnection(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error - // (GET /services/{service_identifier}) - GetServicesServiceIdentifier(ctx echo.Context, serviceIdentifier string, params GetServicesServiceIdentifierParams) error + // (GET /enclaves/{enclave_identifier}/services/{service_identifier}) + GetEnclavesEnclaveIdentifierServicesServiceIdentifier(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, serviceIdentifier ServiceIdentifier, params GetEnclavesEnclaveIdentifierServicesServiceIdentifierParams) error - // (POST /services/{service_identifier}/command) - PostServicesServiceIdentifierCommand(ctx echo.Context, serviceIdentifier string) error + // (POST /enclaves/{enclave_identifier}/services/{service_identifier}/command) + PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, serviceIdentifier ServiceIdentifier) error - // (POST /services/{service_identifier}/endpoints/{port_number}/availability) - PostServicesServiceIdentifierEndpointsPortNumberAvailability(ctx echo.Context, serviceIdentifier string, portNumber int) error + // (POST /enclaves/{enclave_identifier}/services/{service_identifier}/endpoints/{port_number}/availability) + PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, serviceIdentifier ServiceIdentifier, portNumber PortNumber) error - // (GET /starlark) - GetStarlark(ctx echo.Context) error + // (GET /enclaves/{enclave_identifier}/starlark) + GetEnclavesEnclaveIdentifierStarlark(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error - // (PUT /starlark/packages) - PutStarlarkPackages(ctx echo.Context) error + // (PUT /enclaves/{enclave_identifier}/starlark/packages) + PutEnclavesEnclaveIdentifierStarlarkPackages(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error - // (POST /starlark/packages/{package_id}) - PostStarlarkPackagesPackageId(ctx echo.Context, packageId string) error + // (POST /enclaves/{enclave_identifier}/starlark/packages/{package_id}) + PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, packageId PackageId) error - // (POST /starlark/scripts) - PostStarlarkScripts(ctx echo.Context) error + // (POST /enclaves/{enclave_identifier}/starlark/scripts) + PostEnclavesEnclaveIdentifierStarlarkScripts(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error } // ServerInterfaceWrapper converts echo contexts to parameters. @@ -75,38 +75,67 @@ type ServerInterfaceWrapper struct { Handler ServerInterface } -// GetArtifacts converts echo context to params. -func (w *ServerInterfaceWrapper) GetArtifacts(ctx echo.Context) error { +// GetEnclavesEnclaveIdentifierArtifacts converts echo context to params. +func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierArtifacts(ctx echo.Context) error { var err error + // ------------- Path parameter "enclave_identifier" ------------- + var enclaveIdentifier EnclaveIdentifier + + err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter enclave_identifier: %s", err)) + } // Invoke the callback with all the unmarshalled arguments - err = w.Handler.GetArtifacts(ctx) + err = w.Handler.GetEnclavesEnclaveIdentifierArtifacts(ctx, enclaveIdentifier) return err } -// PutArtifactsLocalFile converts echo context to params. -func (w *ServerInterfaceWrapper) PutArtifactsLocalFile(ctx echo.Context) error { +// PutEnclavesEnclaveIdentifierArtifactsLocalFile converts echo context to params. +func (w *ServerInterfaceWrapper) PutEnclavesEnclaveIdentifierArtifactsLocalFile(ctx echo.Context) error { var err error + // ------------- Path parameter "enclave_identifier" ------------- + var enclaveIdentifier EnclaveIdentifier + + err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter enclave_identifier: %s", err)) + } // Invoke the callback with all the unmarshalled arguments - err = w.Handler.PutArtifactsLocalFile(ctx) + err = w.Handler.PutEnclavesEnclaveIdentifierArtifactsLocalFile(ctx, enclaveIdentifier) return err } -// PutArtifactsRemoteFile converts echo context to params. -func (w *ServerInterfaceWrapper) PutArtifactsRemoteFile(ctx echo.Context) error { +// PutEnclavesEnclaveIdentifierArtifactsRemoteFile converts echo context to params. +func (w *ServerInterfaceWrapper) PutEnclavesEnclaveIdentifierArtifactsRemoteFile(ctx echo.Context) error { var err error + // ------------- Path parameter "enclave_identifier" ------------- + var enclaveIdentifier EnclaveIdentifier + + err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter enclave_identifier: %s", err)) + } // Invoke the callback with all the unmarshalled arguments - err = w.Handler.PutArtifactsRemoteFile(ctx) + err = w.Handler.PutEnclavesEnclaveIdentifierArtifactsRemoteFile(ctx, enclaveIdentifier) return err } -// PutArtifactsServicesServiceIdentifier converts echo context to params. -func (w *ServerInterfaceWrapper) PutArtifactsServicesServiceIdentifier(ctx echo.Context) error { +// PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier converts echo context to params. +func (w *ServerInterfaceWrapper) PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier(ctx echo.Context) error { var err error + // ------------- Path parameter "enclave_identifier" ------------- + var enclaveIdentifier EnclaveIdentifier + + err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter enclave_identifier: %s", err)) + } + // ------------- Path parameter "service_identifier" ------------- - var serviceIdentifier string + var serviceIdentifier ServiceIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "service_identifier", runtime.ParamLocationPath, ctx.Param("service_identifier"), &serviceIdentifier) if err != nil { @@ -114,15 +143,23 @@ func (w *ServerInterfaceWrapper) PutArtifactsServicesServiceIdentifier(ctx echo. } // Invoke the callback with all the unmarshalled arguments - err = w.Handler.PutArtifactsServicesServiceIdentifier(ctx, serviceIdentifier) + err = w.Handler.PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier(ctx, enclaveIdentifier, serviceIdentifier) return err } -// GetArtifactsArtifactIdentifier converts echo context to params. -func (w *ServerInterfaceWrapper) GetArtifactsArtifactIdentifier(ctx echo.Context) error { +// GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier converts echo context to params. +func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier(ctx echo.Context) error { var err error + // ------------- Path parameter "enclave_identifier" ------------- + var enclaveIdentifier EnclaveIdentifier + + err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter enclave_identifier: %s", err)) + } + // ------------- Path parameter "artifact_identifier" ------------- - var artifactIdentifier string + var artifactIdentifier ArtifactIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "artifact_identifier", runtime.ParamLocationPath, ctx.Param("artifact_identifier"), &artifactIdentifier) if err != nil { @@ -130,15 +167,23 @@ func (w *ServerInterfaceWrapper) GetArtifactsArtifactIdentifier(ctx echo.Context } // Invoke the callback with all the unmarshalled arguments - err = w.Handler.GetArtifactsArtifactIdentifier(ctx, artifactIdentifier) + err = w.Handler.GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier(ctx, enclaveIdentifier, artifactIdentifier) return err } -// GetArtifactsArtifactIdentifierDownload converts echo context to params. -func (w *ServerInterfaceWrapper) GetArtifactsArtifactIdentifierDownload(ctx echo.Context) error { +// GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownload converts echo context to params. +func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownload(ctx echo.Context) error { var err error + // ------------- Path parameter "enclave_identifier" ------------- + var enclaveIdentifier EnclaveIdentifier + + err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter enclave_identifier: %s", err)) + } + // ------------- Path parameter "artifact_identifier" ------------- - var artifactIdentifier string + var artifactIdentifier ArtifactIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "artifact_identifier", runtime.ParamLocationPath, ctx.Param("artifact_identifier"), &artifactIdentifier) if err != nil { @@ -146,33 +191,55 @@ func (w *ServerInterfaceWrapper) GetArtifactsArtifactIdentifierDownload(ctx echo } // Invoke the callback with all the unmarshalled arguments - err = w.Handler.GetArtifactsArtifactIdentifierDownload(ctx, artifactIdentifier) + err = w.Handler.GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownload(ctx, enclaveIdentifier, artifactIdentifier) return err } -// GetServices converts echo context to params. -func (w *ServerInterfaceWrapper) GetServices(ctx echo.Context) error { +// GetEnclavesEnclaveIdentifierServices converts echo context to params. +func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierServices(ctx echo.Context) error { var err error + // ------------- Path parameter "enclave_identifier" ------------- + var enclaveIdentifier EnclaveIdentifier + + err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter enclave_identifier: %s", err)) + } // Invoke the callback with all the unmarshalled arguments - err = w.Handler.GetServices(ctx) + err = w.Handler.GetEnclavesEnclaveIdentifierServices(ctx, enclaveIdentifier) return err } -// PostServicesConnection converts echo context to params. -func (w *ServerInterfaceWrapper) PostServicesConnection(ctx echo.Context) error { +// PostEnclavesEnclaveIdentifierServicesConnection converts echo context to params. +func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierServicesConnection(ctx echo.Context) error { var err error + // ------------- Path parameter "enclave_identifier" ------------- + var enclaveIdentifier EnclaveIdentifier + + err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter enclave_identifier: %s", err)) + } // Invoke the callback with all the unmarshalled arguments - err = w.Handler.PostServicesConnection(ctx) + err = w.Handler.PostEnclavesEnclaveIdentifierServicesConnection(ctx, enclaveIdentifier) return err } -// GetServicesServiceIdentifier converts echo context to params. -func (w *ServerInterfaceWrapper) GetServicesServiceIdentifier(ctx echo.Context) error { +// GetEnclavesEnclaveIdentifierServicesServiceIdentifier converts echo context to params. +func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierServicesServiceIdentifier(ctx echo.Context) error { var err error + // ------------- Path parameter "enclave_identifier" ------------- + var enclaveIdentifier EnclaveIdentifier + + err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter enclave_identifier: %s", err)) + } + // ------------- Path parameter "service_identifier" ------------- - var serviceIdentifier string + var serviceIdentifier ServiceIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "service_identifier", runtime.ParamLocationPath, ctx.Param("service_identifier"), &serviceIdentifier) if err != nil { @@ -180,7 +247,7 @@ func (w *ServerInterfaceWrapper) GetServicesServiceIdentifier(ctx echo.Context) } // Parameter object where we will unmarshal all parameters from the context - var params GetServicesServiceIdentifierParams + var params GetEnclavesEnclaveIdentifierServicesServiceIdentifierParams // ------------- Optional query parameter "additional-properties" ------------- err = runtime.BindQueryParameter("form", true, false, "additional-properties", ctx.QueryParams(), ¶ms.AdditionalProperties) @@ -189,15 +256,23 @@ func (w *ServerInterfaceWrapper) GetServicesServiceIdentifier(ctx echo.Context) } // Invoke the callback with all the unmarshalled arguments - err = w.Handler.GetServicesServiceIdentifier(ctx, serviceIdentifier, params) + err = w.Handler.GetEnclavesEnclaveIdentifierServicesServiceIdentifier(ctx, enclaveIdentifier, serviceIdentifier, params) return err } -// PostServicesServiceIdentifierCommand converts echo context to params. -func (w *ServerInterfaceWrapper) PostServicesServiceIdentifierCommand(ctx echo.Context) error { +// PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand converts echo context to params. +func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand(ctx echo.Context) error { var err error + // ------------- Path parameter "enclave_identifier" ------------- + var enclaveIdentifier EnclaveIdentifier + + err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter enclave_identifier: %s", err)) + } + // ------------- Path parameter "service_identifier" ------------- - var serviceIdentifier string + var serviceIdentifier ServiceIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "service_identifier", runtime.ParamLocationPath, ctx.Param("service_identifier"), &serviceIdentifier) if err != nil { @@ -205,15 +280,23 @@ func (w *ServerInterfaceWrapper) PostServicesServiceIdentifierCommand(ctx echo.C } // Invoke the callback with all the unmarshalled arguments - err = w.Handler.PostServicesServiceIdentifierCommand(ctx, serviceIdentifier) + err = w.Handler.PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand(ctx, enclaveIdentifier, serviceIdentifier) return err } -// PostServicesServiceIdentifierEndpointsPortNumberAvailability converts echo context to params. -func (w *ServerInterfaceWrapper) PostServicesServiceIdentifierEndpointsPortNumberAvailability(ctx echo.Context) error { +// PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability converts echo context to params. +func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability(ctx echo.Context) error { var err error + // ------------- Path parameter "enclave_identifier" ------------- + var enclaveIdentifier EnclaveIdentifier + + err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter enclave_identifier: %s", err)) + } + // ------------- Path parameter "service_identifier" ------------- - var serviceIdentifier string + var serviceIdentifier ServiceIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "service_identifier", runtime.ParamLocationPath, ctx.Param("service_identifier"), &serviceIdentifier) if err != nil { @@ -221,7 +304,7 @@ func (w *ServerInterfaceWrapper) PostServicesServiceIdentifierEndpointsPortNumbe } // ------------- Path parameter "port_number" ------------- - var portNumber int + var portNumber PortNumber err = runtime.BindStyledParameterWithLocation("simple", false, "port_number", runtime.ParamLocationPath, ctx.Param("port_number"), &portNumber) if err != nil { @@ -229,33 +312,55 @@ func (w *ServerInterfaceWrapper) PostServicesServiceIdentifierEndpointsPortNumbe } // Invoke the callback with all the unmarshalled arguments - err = w.Handler.PostServicesServiceIdentifierEndpointsPortNumberAvailability(ctx, serviceIdentifier, portNumber) + err = w.Handler.PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability(ctx, enclaveIdentifier, serviceIdentifier, portNumber) return err } -// GetStarlark converts echo context to params. -func (w *ServerInterfaceWrapper) GetStarlark(ctx echo.Context) error { +// GetEnclavesEnclaveIdentifierStarlark converts echo context to params. +func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierStarlark(ctx echo.Context) error { var err error + // ------------- Path parameter "enclave_identifier" ------------- + var enclaveIdentifier EnclaveIdentifier + + err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter enclave_identifier: %s", err)) + } // Invoke the callback with all the unmarshalled arguments - err = w.Handler.GetStarlark(ctx) + err = w.Handler.GetEnclavesEnclaveIdentifierStarlark(ctx, enclaveIdentifier) return err } -// PutStarlarkPackages converts echo context to params. -func (w *ServerInterfaceWrapper) PutStarlarkPackages(ctx echo.Context) error { +// PutEnclavesEnclaveIdentifierStarlarkPackages converts echo context to params. +func (w *ServerInterfaceWrapper) PutEnclavesEnclaveIdentifierStarlarkPackages(ctx echo.Context) error { var err error + // ------------- Path parameter "enclave_identifier" ------------- + var enclaveIdentifier EnclaveIdentifier + + err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter enclave_identifier: %s", err)) + } // Invoke the callback with all the unmarshalled arguments - err = w.Handler.PutStarlarkPackages(ctx) + err = w.Handler.PutEnclavesEnclaveIdentifierStarlarkPackages(ctx, enclaveIdentifier) return err } -// PostStarlarkPackagesPackageId converts echo context to params. -func (w *ServerInterfaceWrapper) PostStarlarkPackagesPackageId(ctx echo.Context) error { +// PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId converts echo context to params. +func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId(ctx echo.Context) error { var err error + // ------------- Path parameter "enclave_identifier" ------------- + var enclaveIdentifier EnclaveIdentifier + + err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter enclave_identifier: %s", err)) + } + // ------------- Path parameter "package_id" ------------- - var packageId string + var packageId PackageId err = runtime.BindStyledParameterWithLocation("simple", false, "package_id", runtime.ParamLocationPath, ctx.Param("package_id"), &packageId) if err != nil { @@ -263,16 +368,23 @@ func (w *ServerInterfaceWrapper) PostStarlarkPackagesPackageId(ctx echo.Context) } // Invoke the callback with all the unmarshalled arguments - err = w.Handler.PostStarlarkPackagesPackageId(ctx, packageId) + err = w.Handler.PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId(ctx, enclaveIdentifier, packageId) return err } -// PostStarlarkScripts converts echo context to params. -func (w *ServerInterfaceWrapper) PostStarlarkScripts(ctx echo.Context) error { +// PostEnclavesEnclaveIdentifierStarlarkScripts converts echo context to params. +func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx echo.Context) error { var err error + // ------------- Path parameter "enclave_identifier" ------------- + var enclaveIdentifier EnclaveIdentifier + + err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter enclave_identifier: %s", err)) + } // Invoke the callback with all the unmarshalled arguments - err = w.Handler.PostStarlarkScripts(ctx) + err = w.Handler.PostEnclavesEnclaveIdentifierStarlarkScripts(ctx, enclaveIdentifier) return err } @@ -304,21 +416,21 @@ func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL Handler: si, } - router.GET(baseURL+"/artifacts", wrapper.GetArtifacts) - router.PUT(baseURL+"/artifacts/local-file", wrapper.PutArtifactsLocalFile) - router.PUT(baseURL+"/artifacts/remote-file", wrapper.PutArtifactsRemoteFile) - router.PUT(baseURL+"/artifacts/services/:service_identifier", wrapper.PutArtifactsServicesServiceIdentifier) - router.GET(baseURL+"/artifacts/:artifact_identifier", wrapper.GetArtifactsArtifactIdentifier) - router.GET(baseURL+"/artifacts/:artifact_identifier/download", wrapper.GetArtifactsArtifactIdentifierDownload) - router.GET(baseURL+"/services", wrapper.GetServices) - router.POST(baseURL+"/services/connection", wrapper.PostServicesConnection) - router.GET(baseURL+"/services/:service_identifier", wrapper.GetServicesServiceIdentifier) - router.POST(baseURL+"/services/:service_identifier/command", wrapper.PostServicesServiceIdentifierCommand) - router.POST(baseURL+"/services/:service_identifier/endpoints/:port_number/availability", wrapper.PostServicesServiceIdentifierEndpointsPortNumberAvailability) - router.GET(baseURL+"/starlark", wrapper.GetStarlark) - router.PUT(baseURL+"/starlark/packages", wrapper.PutStarlarkPackages) - router.POST(baseURL+"/starlark/packages/:package_id", wrapper.PostStarlarkPackagesPackageId) - router.POST(baseURL+"/starlark/scripts", wrapper.PostStarlarkScripts) + router.GET(baseURL+"/enclaves/:enclave_identifier/artifacts", wrapper.GetEnclavesEnclaveIdentifierArtifacts) + router.PUT(baseURL+"/enclaves/:enclave_identifier/artifacts/local-file", wrapper.PutEnclavesEnclaveIdentifierArtifactsLocalFile) + router.PUT(baseURL+"/enclaves/:enclave_identifier/artifacts/remote-file", wrapper.PutEnclavesEnclaveIdentifierArtifactsRemoteFile) + router.PUT(baseURL+"/enclaves/:enclave_identifier/artifacts/services/:service_identifier", wrapper.PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier) + router.GET(baseURL+"/enclaves/:enclave_identifier/artifacts/:artifact_identifier", wrapper.GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier) + router.GET(baseURL+"/enclaves/:enclave_identifier/artifacts/:artifact_identifier/download", wrapper.GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownload) + router.GET(baseURL+"/enclaves/:enclave_identifier/services", wrapper.GetEnclavesEnclaveIdentifierServices) + router.POST(baseURL+"/enclaves/:enclave_identifier/services/connection", wrapper.PostEnclavesEnclaveIdentifierServicesConnection) + router.GET(baseURL+"/enclaves/:enclave_identifier/services/:service_identifier", wrapper.GetEnclavesEnclaveIdentifierServicesServiceIdentifier) + router.POST(baseURL+"/enclaves/:enclave_identifier/services/:service_identifier/command", wrapper.PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand) + router.POST(baseURL+"/enclaves/:enclave_identifier/services/:service_identifier/endpoints/:port_number/availability", wrapper.PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability) + router.GET(baseURL+"/enclaves/:enclave_identifier/starlark", wrapper.GetEnclavesEnclaveIdentifierStarlark) + router.PUT(baseURL+"/enclaves/:enclave_identifier/starlark/packages", wrapper.PutEnclavesEnclaveIdentifierStarlarkPackages) + router.POST(baseURL+"/enclaves/:enclave_identifier/starlark/packages/:package_id", wrapper.PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId) + router.POST(baseURL+"/enclaves/:enclave_identifier/starlark/scripts", wrapper.PostEnclavesEnclaveIdentifierStarlarkScripts) } @@ -329,190 +441,201 @@ type SuccessAsteriskResponse struct { ContentLength int64 } -type GetArtifactsRequestObject struct { +type GetEnclavesEnclaveIdentifierArtifactsRequestObject struct { + EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` } -type GetArtifactsResponseObject interface { - VisitGetArtifactsResponse(w http.ResponseWriter) error +type GetEnclavesEnclaveIdentifierArtifactsResponseObject interface { + VisitGetEnclavesEnclaveIdentifierArtifactsResponse(w http.ResponseWriter) error } -type GetArtifacts200JSONResponse ListFilesArtifactNamesAndUuidsResponse +type GetEnclavesEnclaveIdentifierArtifacts200JSONResponse ListFilesArtifactNamesAndUuidsResponse -func (response GetArtifacts200JSONResponse) VisitGetArtifactsResponse(w http.ResponseWriter) error { +func (response GetEnclavesEnclaveIdentifierArtifacts200JSONResponse) VisitGetEnclavesEnclaveIdentifierArtifactsResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") w.WriteHeader(200) return json.NewEncoder(w).Encode(response) } -type PutArtifactsLocalFileRequestObject struct { - Body *PutArtifactsLocalFileJSONRequestBody +type PutEnclavesEnclaveIdentifierArtifactsLocalFileRequestObject struct { + EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` + Body *PutEnclavesEnclaveIdentifierArtifactsLocalFileJSONRequestBody } -type PutArtifactsLocalFileResponseObject interface { - VisitPutArtifactsLocalFileResponse(w http.ResponseWriter) error +type PutEnclavesEnclaveIdentifierArtifactsLocalFileResponseObject interface { + VisitPutEnclavesEnclaveIdentifierArtifactsLocalFileResponse(w http.ResponseWriter) error } -type PutArtifactsLocalFile200JSONResponse UploadFilesArtifactResponse +type PutEnclavesEnclaveIdentifierArtifactsLocalFile200JSONResponse UploadFilesArtifactResponse -func (response PutArtifactsLocalFile200JSONResponse) VisitPutArtifactsLocalFileResponse(w http.ResponseWriter) error { +func (response PutEnclavesEnclaveIdentifierArtifactsLocalFile200JSONResponse) VisitPutEnclavesEnclaveIdentifierArtifactsLocalFileResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") w.WriteHeader(200) return json.NewEncoder(w).Encode(response) } -type PutArtifactsRemoteFileRequestObject struct { - Body *PutArtifactsRemoteFileJSONRequestBody +type PutEnclavesEnclaveIdentifierArtifactsRemoteFileRequestObject struct { + EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` + Body *PutEnclavesEnclaveIdentifierArtifactsRemoteFileJSONRequestBody } -type PutArtifactsRemoteFileResponseObject interface { - VisitPutArtifactsRemoteFileResponse(w http.ResponseWriter) error +type PutEnclavesEnclaveIdentifierArtifactsRemoteFileResponseObject interface { + VisitPutEnclavesEnclaveIdentifierArtifactsRemoteFileResponse(w http.ResponseWriter) error } -type PutArtifactsRemoteFile200JSONResponse StoreWebFilesArtifactResponse +type PutEnclavesEnclaveIdentifierArtifactsRemoteFile200JSONResponse StoreWebFilesArtifactResponse -func (response PutArtifactsRemoteFile200JSONResponse) VisitPutArtifactsRemoteFileResponse(w http.ResponseWriter) error { +func (response PutEnclavesEnclaveIdentifierArtifactsRemoteFile200JSONResponse) VisitPutEnclavesEnclaveIdentifierArtifactsRemoteFileResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") w.WriteHeader(200) return json.NewEncoder(w).Encode(response) } -type PutArtifactsServicesServiceIdentifierRequestObject struct { - ServiceIdentifier string `json:"service_identifier"` - Body *PutArtifactsServicesServiceIdentifierJSONRequestBody +type PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierRequestObject struct { + EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` + ServiceIdentifier ServiceIdentifier `json:"service_identifier"` + Body *PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierJSONRequestBody } -type PutArtifactsServicesServiceIdentifierResponseObject interface { - VisitPutArtifactsServicesServiceIdentifierResponse(w http.ResponseWriter) error +type PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierResponseObject interface { + VisitPutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierResponse(w http.ResponseWriter) error } -type PutArtifactsServicesServiceIdentifier200JSONResponse StoreFilesArtifactFromServiceResponse +type PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier200JSONResponse StoreFilesArtifactFromServiceResponse -func (response PutArtifactsServicesServiceIdentifier200JSONResponse) VisitPutArtifactsServicesServiceIdentifierResponse(w http.ResponseWriter) error { +func (response PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier200JSONResponse) VisitPutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") w.WriteHeader(200) return json.NewEncoder(w).Encode(response) } -type GetArtifactsArtifactIdentifierRequestObject struct { - ArtifactIdentifier string `json:"artifact_identifier"` +type GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierRequestObject struct { + EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` + ArtifactIdentifier ArtifactIdentifier `json:"artifact_identifier"` } -type GetArtifactsArtifactIdentifierResponseObject interface { - VisitGetArtifactsArtifactIdentifierResponse(w http.ResponseWriter) error +type GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierResponseObject interface { + VisitGetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierResponse(w http.ResponseWriter) error } -type GetArtifactsArtifactIdentifier200JSONResponse InspectFilesArtifactContentsResponse +type GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier200JSONResponse InspectFilesArtifactContentsResponse -func (response GetArtifactsArtifactIdentifier200JSONResponse) VisitGetArtifactsArtifactIdentifierResponse(w http.ResponseWriter) error { +func (response GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier200JSONResponse) VisitGetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") w.WriteHeader(200) return json.NewEncoder(w).Encode(response) } -type GetArtifactsArtifactIdentifierDownloadRequestObject struct { - ArtifactIdentifier string `json:"artifact_identifier"` +type GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownloadRequestObject struct { + EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` + ArtifactIdentifier ArtifactIdentifier `json:"artifact_identifier"` } -type GetArtifactsArtifactIdentifierDownloadResponseObject interface { - VisitGetArtifactsArtifactIdentifierDownloadResponse(w http.ResponseWriter) error +type GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownloadResponseObject interface { + VisitGetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownloadResponse(w http.ResponseWriter) error } -type GetArtifactsArtifactIdentifierDownload200JSONResponse StreamedDataChunk +type GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownload200JSONResponse StreamedDataChunk -func (response GetArtifactsArtifactIdentifierDownload200JSONResponse) VisitGetArtifactsArtifactIdentifierDownloadResponse(w http.ResponseWriter) error { +func (response GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownload200JSONResponse) VisitGetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownloadResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") w.WriteHeader(200) return json.NewEncoder(w).Encode(response) } -type GetServicesRequestObject struct { +type GetEnclavesEnclaveIdentifierServicesRequestObject struct { + EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` } -type GetServicesResponseObject interface { - VisitGetServicesResponse(w http.ResponseWriter) error +type GetEnclavesEnclaveIdentifierServicesResponseObject interface { + VisitGetEnclavesEnclaveIdentifierServicesResponse(w http.ResponseWriter) error } -type GetServices200JSONResponse GetExistingAndHistoricalServiceIdentifiersResponse +type GetEnclavesEnclaveIdentifierServices200JSONResponse GetExistingAndHistoricalServiceIdentifiersResponse -func (response GetServices200JSONResponse) VisitGetServicesResponse(w http.ResponseWriter) error { +func (response GetEnclavesEnclaveIdentifierServices200JSONResponse) VisitGetEnclavesEnclaveIdentifierServicesResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") w.WriteHeader(200) return json.NewEncoder(w).Encode(response) } -type PostServicesConnectionRequestObject struct { - Body *PostServicesConnectionJSONRequestBody +type PostEnclavesEnclaveIdentifierServicesConnectionRequestObject struct { + EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` + Body *PostEnclavesEnclaveIdentifierServicesConnectionJSONRequestBody } -type PostServicesConnectionResponseObject interface { - VisitPostServicesConnectionResponse(w http.ResponseWriter) error +type PostEnclavesEnclaveIdentifierServicesConnectionResponseObject interface { + VisitPostEnclavesEnclaveIdentifierServicesConnectionResponse(w http.ResponseWriter) error } -type PostServicesConnection200JSONResponse ConnectServicesResponse +type PostEnclavesEnclaveIdentifierServicesConnection200JSONResponse ConnectServicesResponse -func (response PostServicesConnection200JSONResponse) VisitPostServicesConnectionResponse(w http.ResponseWriter) error { +func (response PostEnclavesEnclaveIdentifierServicesConnection200JSONResponse) VisitPostEnclavesEnclaveIdentifierServicesConnectionResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") w.WriteHeader(200) return json.NewEncoder(w).Encode(response) } -type GetServicesServiceIdentifierRequestObject struct { - ServiceIdentifier string `json:"service_identifier"` - Params GetServicesServiceIdentifierParams +type GetEnclavesEnclaveIdentifierServicesServiceIdentifierRequestObject struct { + EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` + ServiceIdentifier ServiceIdentifier `json:"service_identifier"` + Params GetEnclavesEnclaveIdentifierServicesServiceIdentifierParams } -type GetServicesServiceIdentifierResponseObject interface { - VisitGetServicesServiceIdentifierResponse(w http.ResponseWriter) error +type GetEnclavesEnclaveIdentifierServicesServiceIdentifierResponseObject interface { + VisitGetEnclavesEnclaveIdentifierServicesServiceIdentifierResponse(w http.ResponseWriter) error } -type GetServicesServiceIdentifier200JSONResponse GetServicesResponse +type GetEnclavesEnclaveIdentifierServicesServiceIdentifier200JSONResponse GetServicesResponse -func (response GetServicesServiceIdentifier200JSONResponse) VisitGetServicesServiceIdentifierResponse(w http.ResponseWriter) error { +func (response GetEnclavesEnclaveIdentifierServicesServiceIdentifier200JSONResponse) VisitGetEnclavesEnclaveIdentifierServicesServiceIdentifierResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") w.WriteHeader(200) return json.NewEncoder(w).Encode(response) } -type PostServicesServiceIdentifierCommandRequestObject struct { - ServiceIdentifier string `json:"service_identifier"` - Body *PostServicesServiceIdentifierCommandJSONRequestBody +type PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandRequestObject struct { + EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` + ServiceIdentifier ServiceIdentifier `json:"service_identifier"` + Body *PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandJSONRequestBody } -type PostServicesServiceIdentifierCommandResponseObject interface { - VisitPostServicesServiceIdentifierCommandResponse(w http.ResponseWriter) error +type PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandResponseObject interface { + VisitPostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandResponse(w http.ResponseWriter) error } -type PostServicesServiceIdentifierCommand200JSONResponse ExecCommandResponse +type PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand200JSONResponse ExecCommandResponse -func (response PostServicesServiceIdentifierCommand200JSONResponse) VisitPostServicesServiceIdentifierCommandResponse(w http.ResponseWriter) error { +func (response PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand200JSONResponse) VisitPostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") w.WriteHeader(200) return json.NewEncoder(w).Encode(response) } -type PostServicesServiceIdentifierEndpointsPortNumberAvailabilityRequestObject struct { - ServiceIdentifier string `json:"service_identifier"` - PortNumber int `json:"port_number"` - Body *PostServicesServiceIdentifierEndpointsPortNumberAvailabilityJSONRequestBody +type PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityRequestObject struct { + EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` + ServiceIdentifier ServiceIdentifier `json:"service_identifier"` + PortNumber PortNumber `json:"port_number"` + Body *PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityJSONRequestBody } -type PostServicesServiceIdentifierEndpointsPortNumberAvailabilityResponseObject interface { - VisitPostServicesServiceIdentifierEndpointsPortNumberAvailabilityResponse(w http.ResponseWriter) error +type PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityResponseObject interface { + VisitPostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityResponse(w http.ResponseWriter) error } -type PostServicesServiceIdentifierEndpointsPortNumberAvailability200AsteriskResponse struct{ SuccessAsteriskResponse } +type PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability200AsteriskResponse struct{ SuccessAsteriskResponse } -func (response PostServicesServiceIdentifierEndpointsPortNumberAvailability200AsteriskResponse) VisitPostServicesServiceIdentifierEndpointsPortNumberAvailabilityResponse(w http.ResponseWriter) error { +func (response PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability200AsteriskResponse) VisitPostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", response.ContentType) if response.ContentLength != 0 { w.Header().Set("Content-Length", fmt.Sprint(response.ContentLength)) @@ -526,33 +649,35 @@ func (response PostServicesServiceIdentifierEndpointsPortNumberAvailability200As return err } -type GetStarlarkRequestObject struct { +type GetEnclavesEnclaveIdentifierStarlarkRequestObject struct { + EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` } -type GetStarlarkResponseObject interface { - VisitGetStarlarkResponse(w http.ResponseWriter) error +type GetEnclavesEnclaveIdentifierStarlarkResponseObject interface { + VisitGetEnclavesEnclaveIdentifierStarlarkResponse(w http.ResponseWriter) error } -type GetStarlark200JSONResponse GetStarlarkRunResponse +type GetEnclavesEnclaveIdentifierStarlark200JSONResponse GetStarlarkRunResponse -func (response GetStarlark200JSONResponse) VisitGetStarlarkResponse(w http.ResponseWriter) error { +func (response GetEnclavesEnclaveIdentifierStarlark200JSONResponse) VisitGetEnclavesEnclaveIdentifierStarlarkResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") w.WriteHeader(200) return json.NewEncoder(w).Encode(response) } -type PutStarlarkPackagesRequestObject struct { - Body *PutStarlarkPackagesJSONRequestBody +type PutEnclavesEnclaveIdentifierStarlarkPackagesRequestObject struct { + EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` + Body *PutEnclavesEnclaveIdentifierStarlarkPackagesJSONRequestBody } -type PutStarlarkPackagesResponseObject interface { - VisitPutStarlarkPackagesResponse(w http.ResponseWriter) error +type PutEnclavesEnclaveIdentifierStarlarkPackagesResponseObject interface { + VisitPutEnclavesEnclaveIdentifierStarlarkPackagesResponse(w http.ResponseWriter) error } -type PutStarlarkPackages200AsteriskResponse struct{ SuccessAsteriskResponse } +type PutEnclavesEnclaveIdentifierStarlarkPackages200AsteriskResponse struct{ SuccessAsteriskResponse } -func (response PutStarlarkPackages200AsteriskResponse) VisitPutStarlarkPackagesResponse(w http.ResponseWriter) error { +func (response PutEnclavesEnclaveIdentifierStarlarkPackages200AsteriskResponse) VisitPutEnclavesEnclaveIdentifierStarlarkPackagesResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", response.ContentType) if response.ContentLength != 0 { w.Header().Set("Content-Length", fmt.Sprint(response.ContentLength)) @@ -566,35 +691,37 @@ func (response PutStarlarkPackages200AsteriskResponse) VisitPutStarlarkPackagesR return err } -type PostStarlarkPackagesPackageIdRequestObject struct { - PackageId string `json:"package_id"` - Body *PostStarlarkPackagesPackageIdJSONRequestBody +type PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdRequestObject struct { + EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` + PackageId PackageId `json:"package_id"` + Body *PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdJSONRequestBody } -type PostStarlarkPackagesPackageIdResponseObject interface { - VisitPostStarlarkPackagesPackageIdResponse(w http.ResponseWriter) error +type PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdResponseObject interface { + VisitPostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdResponse(w http.ResponseWriter) error } -type PostStarlarkPackagesPackageId200JSONResponse StarlarkRunResponseLine +type PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId200JSONResponse StarlarkRunResponseLine -func (response PostStarlarkPackagesPackageId200JSONResponse) VisitPostStarlarkPackagesPackageIdResponse(w http.ResponseWriter) error { +func (response PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId200JSONResponse) VisitPostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") w.WriteHeader(200) return json.NewEncoder(w).Encode(response) } -type PostStarlarkScriptsRequestObject struct { - Body *PostStarlarkScriptsJSONRequestBody +type PostEnclavesEnclaveIdentifierStarlarkScriptsRequestObject struct { + EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` + Body *PostEnclavesEnclaveIdentifierStarlarkScriptsJSONRequestBody } -type PostStarlarkScriptsResponseObject interface { - VisitPostStarlarkScriptsResponse(w http.ResponseWriter) error +type PostEnclavesEnclaveIdentifierStarlarkScriptsResponseObject interface { + VisitPostEnclavesEnclaveIdentifierStarlarkScriptsResponse(w http.ResponseWriter) error } -type PostStarlarkScripts200JSONResponse StarlarkRunResponseLine +type PostEnclavesEnclaveIdentifierStarlarkScripts200JSONResponse StarlarkRunResponseLine -func (response PostStarlarkScripts200JSONResponse) VisitPostStarlarkScriptsResponse(w http.ResponseWriter) error { +func (response PostEnclavesEnclaveIdentifierStarlarkScripts200JSONResponse) VisitPostEnclavesEnclaveIdentifierStarlarkScriptsResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") w.WriteHeader(200) @@ -604,50 +731,50 @@ func (response PostStarlarkScripts200JSONResponse) VisitPostStarlarkScriptsRespo // StrictServerInterface represents all server handlers. type StrictServerInterface interface { - // (GET /artifacts) - GetArtifacts(ctx context.Context, request GetArtifactsRequestObject) (GetArtifactsResponseObject, error) + // (GET /enclaves/{enclave_identifier}/artifacts) + GetEnclavesEnclaveIdentifierArtifacts(ctx context.Context, request GetEnclavesEnclaveIdentifierArtifactsRequestObject) (GetEnclavesEnclaveIdentifierArtifactsResponseObject, error) - // (PUT /artifacts/local-file) - PutArtifactsLocalFile(ctx context.Context, request PutArtifactsLocalFileRequestObject) (PutArtifactsLocalFileResponseObject, error) + // (PUT /enclaves/{enclave_identifier}/artifacts/local-file) + PutEnclavesEnclaveIdentifierArtifactsLocalFile(ctx context.Context, request PutEnclavesEnclaveIdentifierArtifactsLocalFileRequestObject) (PutEnclavesEnclaveIdentifierArtifactsLocalFileResponseObject, error) - // (PUT /artifacts/remote-file) - PutArtifactsRemoteFile(ctx context.Context, request PutArtifactsRemoteFileRequestObject) (PutArtifactsRemoteFileResponseObject, error) + // (PUT /enclaves/{enclave_identifier}/artifacts/remote-file) + PutEnclavesEnclaveIdentifierArtifactsRemoteFile(ctx context.Context, request PutEnclavesEnclaveIdentifierArtifactsRemoteFileRequestObject) (PutEnclavesEnclaveIdentifierArtifactsRemoteFileResponseObject, error) - // (PUT /artifacts/services/{service_identifier}) - PutArtifactsServicesServiceIdentifier(ctx context.Context, request PutArtifactsServicesServiceIdentifierRequestObject) (PutArtifactsServicesServiceIdentifierResponseObject, error) + // (PUT /enclaves/{enclave_identifier}/artifacts/services/{service_identifier}) + PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier(ctx context.Context, request PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierRequestObject) (PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierResponseObject, error) - // (GET /artifacts/{artifact_identifier}) - GetArtifactsArtifactIdentifier(ctx context.Context, request GetArtifactsArtifactIdentifierRequestObject) (GetArtifactsArtifactIdentifierResponseObject, error) + // (GET /enclaves/{enclave_identifier}/artifacts/{artifact_identifier}) + GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier(ctx context.Context, request GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierRequestObject) (GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierResponseObject, error) - // (GET /artifacts/{artifact_identifier}/download) - GetArtifactsArtifactIdentifierDownload(ctx context.Context, request GetArtifactsArtifactIdentifierDownloadRequestObject) (GetArtifactsArtifactIdentifierDownloadResponseObject, error) + // (GET /enclaves/{enclave_identifier}/artifacts/{artifact_identifier}/download) + GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownload(ctx context.Context, request GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownloadRequestObject) (GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownloadResponseObject, error) - // (GET /services) - GetServices(ctx context.Context, request GetServicesRequestObject) (GetServicesResponseObject, error) + // (GET /enclaves/{enclave_identifier}/services) + GetEnclavesEnclaveIdentifierServices(ctx context.Context, request GetEnclavesEnclaveIdentifierServicesRequestObject) (GetEnclavesEnclaveIdentifierServicesResponseObject, error) - // (POST /services/connection) - PostServicesConnection(ctx context.Context, request PostServicesConnectionRequestObject) (PostServicesConnectionResponseObject, error) + // (POST /enclaves/{enclave_identifier}/services/connection) + PostEnclavesEnclaveIdentifierServicesConnection(ctx context.Context, request PostEnclavesEnclaveIdentifierServicesConnectionRequestObject) (PostEnclavesEnclaveIdentifierServicesConnectionResponseObject, error) - // (GET /services/{service_identifier}) - GetServicesServiceIdentifier(ctx context.Context, request GetServicesServiceIdentifierRequestObject) (GetServicesServiceIdentifierResponseObject, error) + // (GET /enclaves/{enclave_identifier}/services/{service_identifier}) + GetEnclavesEnclaveIdentifierServicesServiceIdentifier(ctx context.Context, request GetEnclavesEnclaveIdentifierServicesServiceIdentifierRequestObject) (GetEnclavesEnclaveIdentifierServicesServiceIdentifierResponseObject, error) - // (POST /services/{service_identifier}/command) - PostServicesServiceIdentifierCommand(ctx context.Context, request PostServicesServiceIdentifierCommandRequestObject) (PostServicesServiceIdentifierCommandResponseObject, error) + // (POST /enclaves/{enclave_identifier}/services/{service_identifier}/command) + PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand(ctx context.Context, request PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandRequestObject) (PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandResponseObject, error) - // (POST /services/{service_identifier}/endpoints/{port_number}/availability) - PostServicesServiceIdentifierEndpointsPortNumberAvailability(ctx context.Context, request PostServicesServiceIdentifierEndpointsPortNumberAvailabilityRequestObject) (PostServicesServiceIdentifierEndpointsPortNumberAvailabilityResponseObject, error) + // (POST /enclaves/{enclave_identifier}/services/{service_identifier}/endpoints/{port_number}/availability) + PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability(ctx context.Context, request PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityRequestObject) (PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityResponseObject, error) - // (GET /starlark) - GetStarlark(ctx context.Context, request GetStarlarkRequestObject) (GetStarlarkResponseObject, error) + // (GET /enclaves/{enclave_identifier}/starlark) + GetEnclavesEnclaveIdentifierStarlark(ctx context.Context, request GetEnclavesEnclaveIdentifierStarlarkRequestObject) (GetEnclavesEnclaveIdentifierStarlarkResponseObject, error) - // (PUT /starlark/packages) - PutStarlarkPackages(ctx context.Context, request PutStarlarkPackagesRequestObject) (PutStarlarkPackagesResponseObject, error) + // (PUT /enclaves/{enclave_identifier}/starlark/packages) + PutEnclavesEnclaveIdentifierStarlarkPackages(ctx context.Context, request PutEnclavesEnclaveIdentifierStarlarkPackagesRequestObject) (PutEnclavesEnclaveIdentifierStarlarkPackagesResponseObject, error) - // (POST /starlark/packages/{package_id}) - PostStarlarkPackagesPackageId(ctx context.Context, request PostStarlarkPackagesPackageIdRequestObject) (PostStarlarkPackagesPackageIdResponseObject, error) + // (POST /enclaves/{enclave_identifier}/starlark/packages/{package_id}) + PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId(ctx context.Context, request PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdRequestObject) (PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdResponseObject, error) - // (POST /starlark/scripts) - PostStarlarkScripts(ctx context.Context, request PostStarlarkScriptsRequestObject) (PostStarlarkScriptsResponseObject, error) + // (POST /enclaves/{enclave_identifier}/starlark/scripts) + PostEnclavesEnclaveIdentifierStarlarkScripts(ctx context.Context, request PostEnclavesEnclaveIdentifierStarlarkScriptsRequestObject) (PostEnclavesEnclaveIdentifierStarlarkScriptsResponseObject, error) } type StrictHandlerFunc func(ctx echo.Context, args interface{}) (interface{}, error) @@ -663,415 +790,438 @@ type strictHandler struct { middlewares []StrictMiddlewareFunc } -// GetArtifacts operation middleware -func (sh *strictHandler) GetArtifacts(ctx echo.Context) error { - var request GetArtifactsRequestObject +// GetEnclavesEnclaveIdentifierArtifacts operation middleware +func (sh *strictHandler) GetEnclavesEnclaveIdentifierArtifacts(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error { + var request GetEnclavesEnclaveIdentifierArtifactsRequestObject + + request.EnclaveIdentifier = enclaveIdentifier handler := func(ctx echo.Context, request interface{}) (interface{}, error) { - return sh.ssi.GetArtifacts(ctx.Request().Context(), request.(GetArtifactsRequestObject)) + return sh.ssi.GetEnclavesEnclaveIdentifierArtifacts(ctx.Request().Context(), request.(GetEnclavesEnclaveIdentifierArtifactsRequestObject)) } for _, middleware := range sh.middlewares { - handler = middleware(handler, "GetArtifacts") + handler = middleware(handler, "GetEnclavesEnclaveIdentifierArtifacts") } response, err := handler(ctx, request) if err != nil { return err - } else if validResponse, ok := response.(GetArtifactsResponseObject); ok { - return validResponse.VisitGetArtifactsResponse(ctx.Response()) + } else if validResponse, ok := response.(GetEnclavesEnclaveIdentifierArtifactsResponseObject); ok { + return validResponse.VisitGetEnclavesEnclaveIdentifierArtifactsResponse(ctx.Response()) } else if response != nil { return fmt.Errorf("Unexpected response type: %T", response) } return nil } -// PutArtifactsLocalFile operation middleware -func (sh *strictHandler) PutArtifactsLocalFile(ctx echo.Context) error { - var request PutArtifactsLocalFileRequestObject +// PutEnclavesEnclaveIdentifierArtifactsLocalFile operation middleware +func (sh *strictHandler) PutEnclavesEnclaveIdentifierArtifactsLocalFile(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error { + var request PutEnclavesEnclaveIdentifierArtifactsLocalFileRequestObject - var body PutArtifactsLocalFileJSONRequestBody + request.EnclaveIdentifier = enclaveIdentifier + + var body PutEnclavesEnclaveIdentifierArtifactsLocalFileJSONRequestBody if err := ctx.Bind(&body); err != nil { return err } request.Body = &body handler := func(ctx echo.Context, request interface{}) (interface{}, error) { - return sh.ssi.PutArtifactsLocalFile(ctx.Request().Context(), request.(PutArtifactsLocalFileRequestObject)) + return sh.ssi.PutEnclavesEnclaveIdentifierArtifactsLocalFile(ctx.Request().Context(), request.(PutEnclavesEnclaveIdentifierArtifactsLocalFileRequestObject)) } for _, middleware := range sh.middlewares { - handler = middleware(handler, "PutArtifactsLocalFile") + handler = middleware(handler, "PutEnclavesEnclaveIdentifierArtifactsLocalFile") } response, err := handler(ctx, request) if err != nil { return err - } else if validResponse, ok := response.(PutArtifactsLocalFileResponseObject); ok { - return validResponse.VisitPutArtifactsLocalFileResponse(ctx.Response()) + } else if validResponse, ok := response.(PutEnclavesEnclaveIdentifierArtifactsLocalFileResponseObject); ok { + return validResponse.VisitPutEnclavesEnclaveIdentifierArtifactsLocalFileResponse(ctx.Response()) } else if response != nil { return fmt.Errorf("Unexpected response type: %T", response) } return nil } -// PutArtifactsRemoteFile operation middleware -func (sh *strictHandler) PutArtifactsRemoteFile(ctx echo.Context) error { - var request PutArtifactsRemoteFileRequestObject +// PutEnclavesEnclaveIdentifierArtifactsRemoteFile operation middleware +func (sh *strictHandler) PutEnclavesEnclaveIdentifierArtifactsRemoteFile(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error { + var request PutEnclavesEnclaveIdentifierArtifactsRemoteFileRequestObject + + request.EnclaveIdentifier = enclaveIdentifier - var body PutArtifactsRemoteFileJSONRequestBody + var body PutEnclavesEnclaveIdentifierArtifactsRemoteFileJSONRequestBody if err := ctx.Bind(&body); err != nil { return err } request.Body = &body handler := func(ctx echo.Context, request interface{}) (interface{}, error) { - return sh.ssi.PutArtifactsRemoteFile(ctx.Request().Context(), request.(PutArtifactsRemoteFileRequestObject)) + return sh.ssi.PutEnclavesEnclaveIdentifierArtifactsRemoteFile(ctx.Request().Context(), request.(PutEnclavesEnclaveIdentifierArtifactsRemoteFileRequestObject)) } for _, middleware := range sh.middlewares { - handler = middleware(handler, "PutArtifactsRemoteFile") + handler = middleware(handler, "PutEnclavesEnclaveIdentifierArtifactsRemoteFile") } response, err := handler(ctx, request) if err != nil { return err - } else if validResponse, ok := response.(PutArtifactsRemoteFileResponseObject); ok { - return validResponse.VisitPutArtifactsRemoteFileResponse(ctx.Response()) + } else if validResponse, ok := response.(PutEnclavesEnclaveIdentifierArtifactsRemoteFileResponseObject); ok { + return validResponse.VisitPutEnclavesEnclaveIdentifierArtifactsRemoteFileResponse(ctx.Response()) } else if response != nil { return fmt.Errorf("Unexpected response type: %T", response) } return nil } -// PutArtifactsServicesServiceIdentifier operation middleware -func (sh *strictHandler) PutArtifactsServicesServiceIdentifier(ctx echo.Context, serviceIdentifier string) error { - var request PutArtifactsServicesServiceIdentifierRequestObject +// PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier operation middleware +func (sh *strictHandler) PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, serviceIdentifier ServiceIdentifier) error { + var request PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierRequestObject + request.EnclaveIdentifier = enclaveIdentifier request.ServiceIdentifier = serviceIdentifier - var body PutArtifactsServicesServiceIdentifierJSONRequestBody + var body PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierJSONRequestBody if err := ctx.Bind(&body); err != nil { return err } request.Body = &body handler := func(ctx echo.Context, request interface{}) (interface{}, error) { - return sh.ssi.PutArtifactsServicesServiceIdentifier(ctx.Request().Context(), request.(PutArtifactsServicesServiceIdentifierRequestObject)) + return sh.ssi.PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier(ctx.Request().Context(), request.(PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierRequestObject)) } for _, middleware := range sh.middlewares { - handler = middleware(handler, "PutArtifactsServicesServiceIdentifier") + handler = middleware(handler, "PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier") } response, err := handler(ctx, request) if err != nil { return err - } else if validResponse, ok := response.(PutArtifactsServicesServiceIdentifierResponseObject); ok { - return validResponse.VisitPutArtifactsServicesServiceIdentifierResponse(ctx.Response()) + } else if validResponse, ok := response.(PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierResponseObject); ok { + return validResponse.VisitPutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierResponse(ctx.Response()) } else if response != nil { return fmt.Errorf("Unexpected response type: %T", response) } return nil } -// GetArtifactsArtifactIdentifier operation middleware -func (sh *strictHandler) GetArtifactsArtifactIdentifier(ctx echo.Context, artifactIdentifier string) error { - var request GetArtifactsArtifactIdentifierRequestObject +// GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier operation middleware +func (sh *strictHandler) GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, artifactIdentifier ArtifactIdentifier) error { + var request GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierRequestObject + request.EnclaveIdentifier = enclaveIdentifier request.ArtifactIdentifier = artifactIdentifier handler := func(ctx echo.Context, request interface{}) (interface{}, error) { - return sh.ssi.GetArtifactsArtifactIdentifier(ctx.Request().Context(), request.(GetArtifactsArtifactIdentifierRequestObject)) + return sh.ssi.GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier(ctx.Request().Context(), request.(GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierRequestObject)) } for _, middleware := range sh.middlewares { - handler = middleware(handler, "GetArtifactsArtifactIdentifier") + handler = middleware(handler, "GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier") } response, err := handler(ctx, request) if err != nil { return err - } else if validResponse, ok := response.(GetArtifactsArtifactIdentifierResponseObject); ok { - return validResponse.VisitGetArtifactsArtifactIdentifierResponse(ctx.Response()) + } else if validResponse, ok := response.(GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierResponseObject); ok { + return validResponse.VisitGetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierResponse(ctx.Response()) } else if response != nil { return fmt.Errorf("Unexpected response type: %T", response) } return nil } -// GetArtifactsArtifactIdentifierDownload operation middleware -func (sh *strictHandler) GetArtifactsArtifactIdentifierDownload(ctx echo.Context, artifactIdentifier string) error { - var request GetArtifactsArtifactIdentifierDownloadRequestObject +// GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownload operation middleware +func (sh *strictHandler) GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownload(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, artifactIdentifier ArtifactIdentifier) error { + var request GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownloadRequestObject + request.EnclaveIdentifier = enclaveIdentifier request.ArtifactIdentifier = artifactIdentifier handler := func(ctx echo.Context, request interface{}) (interface{}, error) { - return sh.ssi.GetArtifactsArtifactIdentifierDownload(ctx.Request().Context(), request.(GetArtifactsArtifactIdentifierDownloadRequestObject)) + return sh.ssi.GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownload(ctx.Request().Context(), request.(GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownloadRequestObject)) } for _, middleware := range sh.middlewares { - handler = middleware(handler, "GetArtifactsArtifactIdentifierDownload") + handler = middleware(handler, "GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownload") } response, err := handler(ctx, request) if err != nil { return err - } else if validResponse, ok := response.(GetArtifactsArtifactIdentifierDownloadResponseObject); ok { - return validResponse.VisitGetArtifactsArtifactIdentifierDownloadResponse(ctx.Response()) + } else if validResponse, ok := response.(GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownloadResponseObject); ok { + return validResponse.VisitGetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownloadResponse(ctx.Response()) } else if response != nil { return fmt.Errorf("Unexpected response type: %T", response) } return nil } -// GetServices operation middleware -func (sh *strictHandler) GetServices(ctx echo.Context) error { - var request GetServicesRequestObject +// GetEnclavesEnclaveIdentifierServices operation middleware +func (sh *strictHandler) GetEnclavesEnclaveIdentifierServices(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error { + var request GetEnclavesEnclaveIdentifierServicesRequestObject + + request.EnclaveIdentifier = enclaveIdentifier handler := func(ctx echo.Context, request interface{}) (interface{}, error) { - return sh.ssi.GetServices(ctx.Request().Context(), request.(GetServicesRequestObject)) + return sh.ssi.GetEnclavesEnclaveIdentifierServices(ctx.Request().Context(), request.(GetEnclavesEnclaveIdentifierServicesRequestObject)) } for _, middleware := range sh.middlewares { - handler = middleware(handler, "GetServices") + handler = middleware(handler, "GetEnclavesEnclaveIdentifierServices") } response, err := handler(ctx, request) if err != nil { return err - } else if validResponse, ok := response.(GetServicesResponseObject); ok { - return validResponse.VisitGetServicesResponse(ctx.Response()) + } else if validResponse, ok := response.(GetEnclavesEnclaveIdentifierServicesResponseObject); ok { + return validResponse.VisitGetEnclavesEnclaveIdentifierServicesResponse(ctx.Response()) } else if response != nil { return fmt.Errorf("Unexpected response type: %T", response) } return nil } -// PostServicesConnection operation middleware -func (sh *strictHandler) PostServicesConnection(ctx echo.Context) error { - var request PostServicesConnectionRequestObject +// PostEnclavesEnclaveIdentifierServicesConnection operation middleware +func (sh *strictHandler) PostEnclavesEnclaveIdentifierServicesConnection(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error { + var request PostEnclavesEnclaveIdentifierServicesConnectionRequestObject + + request.EnclaveIdentifier = enclaveIdentifier - var body PostServicesConnectionJSONRequestBody + var body PostEnclavesEnclaveIdentifierServicesConnectionJSONRequestBody if err := ctx.Bind(&body); err != nil { return err } request.Body = &body handler := func(ctx echo.Context, request interface{}) (interface{}, error) { - return sh.ssi.PostServicesConnection(ctx.Request().Context(), request.(PostServicesConnectionRequestObject)) + return sh.ssi.PostEnclavesEnclaveIdentifierServicesConnection(ctx.Request().Context(), request.(PostEnclavesEnclaveIdentifierServicesConnectionRequestObject)) } for _, middleware := range sh.middlewares { - handler = middleware(handler, "PostServicesConnection") + handler = middleware(handler, "PostEnclavesEnclaveIdentifierServicesConnection") } response, err := handler(ctx, request) if err != nil { return err - } else if validResponse, ok := response.(PostServicesConnectionResponseObject); ok { - return validResponse.VisitPostServicesConnectionResponse(ctx.Response()) + } else if validResponse, ok := response.(PostEnclavesEnclaveIdentifierServicesConnectionResponseObject); ok { + return validResponse.VisitPostEnclavesEnclaveIdentifierServicesConnectionResponse(ctx.Response()) } else if response != nil { return fmt.Errorf("Unexpected response type: %T", response) } return nil } -// GetServicesServiceIdentifier operation middleware -func (sh *strictHandler) GetServicesServiceIdentifier(ctx echo.Context, serviceIdentifier string, params GetServicesServiceIdentifierParams) error { - var request GetServicesServiceIdentifierRequestObject +// GetEnclavesEnclaveIdentifierServicesServiceIdentifier operation middleware +func (sh *strictHandler) GetEnclavesEnclaveIdentifierServicesServiceIdentifier(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, serviceIdentifier ServiceIdentifier, params GetEnclavesEnclaveIdentifierServicesServiceIdentifierParams) error { + var request GetEnclavesEnclaveIdentifierServicesServiceIdentifierRequestObject + request.EnclaveIdentifier = enclaveIdentifier request.ServiceIdentifier = serviceIdentifier request.Params = params handler := func(ctx echo.Context, request interface{}) (interface{}, error) { - return sh.ssi.GetServicesServiceIdentifier(ctx.Request().Context(), request.(GetServicesServiceIdentifierRequestObject)) + return sh.ssi.GetEnclavesEnclaveIdentifierServicesServiceIdentifier(ctx.Request().Context(), request.(GetEnclavesEnclaveIdentifierServicesServiceIdentifierRequestObject)) } for _, middleware := range sh.middlewares { - handler = middleware(handler, "GetServicesServiceIdentifier") + handler = middleware(handler, "GetEnclavesEnclaveIdentifierServicesServiceIdentifier") } response, err := handler(ctx, request) if err != nil { return err - } else if validResponse, ok := response.(GetServicesServiceIdentifierResponseObject); ok { - return validResponse.VisitGetServicesServiceIdentifierResponse(ctx.Response()) + } else if validResponse, ok := response.(GetEnclavesEnclaveIdentifierServicesServiceIdentifierResponseObject); ok { + return validResponse.VisitGetEnclavesEnclaveIdentifierServicesServiceIdentifierResponse(ctx.Response()) } else if response != nil { return fmt.Errorf("Unexpected response type: %T", response) } return nil } -// PostServicesServiceIdentifierCommand operation middleware -func (sh *strictHandler) PostServicesServiceIdentifierCommand(ctx echo.Context, serviceIdentifier string) error { - var request PostServicesServiceIdentifierCommandRequestObject +// PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand operation middleware +func (sh *strictHandler) PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, serviceIdentifier ServiceIdentifier) error { + var request PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandRequestObject + request.EnclaveIdentifier = enclaveIdentifier request.ServiceIdentifier = serviceIdentifier - var body PostServicesServiceIdentifierCommandJSONRequestBody + var body PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandJSONRequestBody if err := ctx.Bind(&body); err != nil { return err } request.Body = &body handler := func(ctx echo.Context, request interface{}) (interface{}, error) { - return sh.ssi.PostServicesServiceIdentifierCommand(ctx.Request().Context(), request.(PostServicesServiceIdentifierCommandRequestObject)) + return sh.ssi.PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand(ctx.Request().Context(), request.(PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandRequestObject)) } for _, middleware := range sh.middlewares { - handler = middleware(handler, "PostServicesServiceIdentifierCommand") + handler = middleware(handler, "PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand") } response, err := handler(ctx, request) if err != nil { return err - } else if validResponse, ok := response.(PostServicesServiceIdentifierCommandResponseObject); ok { - return validResponse.VisitPostServicesServiceIdentifierCommandResponse(ctx.Response()) + } else if validResponse, ok := response.(PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandResponseObject); ok { + return validResponse.VisitPostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandResponse(ctx.Response()) } else if response != nil { return fmt.Errorf("Unexpected response type: %T", response) } return nil } -// PostServicesServiceIdentifierEndpointsPortNumberAvailability operation middleware -func (sh *strictHandler) PostServicesServiceIdentifierEndpointsPortNumberAvailability(ctx echo.Context, serviceIdentifier string, portNumber int) error { - var request PostServicesServiceIdentifierEndpointsPortNumberAvailabilityRequestObject +// PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability operation middleware +func (sh *strictHandler) PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, serviceIdentifier ServiceIdentifier, portNumber PortNumber) error { + var request PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityRequestObject + request.EnclaveIdentifier = enclaveIdentifier request.ServiceIdentifier = serviceIdentifier request.PortNumber = portNumber - var body PostServicesServiceIdentifierEndpointsPortNumberAvailabilityJSONRequestBody + var body PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityJSONRequestBody if err := ctx.Bind(&body); err != nil { return err } request.Body = &body handler := func(ctx echo.Context, request interface{}) (interface{}, error) { - return sh.ssi.PostServicesServiceIdentifierEndpointsPortNumberAvailability(ctx.Request().Context(), request.(PostServicesServiceIdentifierEndpointsPortNumberAvailabilityRequestObject)) + return sh.ssi.PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability(ctx.Request().Context(), request.(PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityRequestObject)) } for _, middleware := range sh.middlewares { - handler = middleware(handler, "PostServicesServiceIdentifierEndpointsPortNumberAvailability") + handler = middleware(handler, "PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability") } response, err := handler(ctx, request) if err != nil { return err - } else if validResponse, ok := response.(PostServicesServiceIdentifierEndpointsPortNumberAvailabilityResponseObject); ok { - return validResponse.VisitPostServicesServiceIdentifierEndpointsPortNumberAvailabilityResponse(ctx.Response()) + } else if validResponse, ok := response.(PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityResponseObject); ok { + return validResponse.VisitPostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityResponse(ctx.Response()) } else if response != nil { return fmt.Errorf("Unexpected response type: %T", response) } return nil } -// GetStarlark operation middleware -func (sh *strictHandler) GetStarlark(ctx echo.Context) error { - var request GetStarlarkRequestObject +// GetEnclavesEnclaveIdentifierStarlark operation middleware +func (sh *strictHandler) GetEnclavesEnclaveIdentifierStarlark(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error { + var request GetEnclavesEnclaveIdentifierStarlarkRequestObject + + request.EnclaveIdentifier = enclaveIdentifier handler := func(ctx echo.Context, request interface{}) (interface{}, error) { - return sh.ssi.GetStarlark(ctx.Request().Context(), request.(GetStarlarkRequestObject)) + return sh.ssi.GetEnclavesEnclaveIdentifierStarlark(ctx.Request().Context(), request.(GetEnclavesEnclaveIdentifierStarlarkRequestObject)) } for _, middleware := range sh.middlewares { - handler = middleware(handler, "GetStarlark") + handler = middleware(handler, "GetEnclavesEnclaveIdentifierStarlark") } response, err := handler(ctx, request) if err != nil { return err - } else if validResponse, ok := response.(GetStarlarkResponseObject); ok { - return validResponse.VisitGetStarlarkResponse(ctx.Response()) + } else if validResponse, ok := response.(GetEnclavesEnclaveIdentifierStarlarkResponseObject); ok { + return validResponse.VisitGetEnclavesEnclaveIdentifierStarlarkResponse(ctx.Response()) } else if response != nil { return fmt.Errorf("Unexpected response type: %T", response) } return nil } -// PutStarlarkPackages operation middleware -func (sh *strictHandler) PutStarlarkPackages(ctx echo.Context) error { - var request PutStarlarkPackagesRequestObject +// PutEnclavesEnclaveIdentifierStarlarkPackages operation middleware +func (sh *strictHandler) PutEnclavesEnclaveIdentifierStarlarkPackages(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error { + var request PutEnclavesEnclaveIdentifierStarlarkPackagesRequestObject + + request.EnclaveIdentifier = enclaveIdentifier - var body PutStarlarkPackagesJSONRequestBody + var body PutEnclavesEnclaveIdentifierStarlarkPackagesJSONRequestBody if err := ctx.Bind(&body); err != nil { return err } request.Body = &body handler := func(ctx echo.Context, request interface{}) (interface{}, error) { - return sh.ssi.PutStarlarkPackages(ctx.Request().Context(), request.(PutStarlarkPackagesRequestObject)) + return sh.ssi.PutEnclavesEnclaveIdentifierStarlarkPackages(ctx.Request().Context(), request.(PutEnclavesEnclaveIdentifierStarlarkPackagesRequestObject)) } for _, middleware := range sh.middlewares { - handler = middleware(handler, "PutStarlarkPackages") + handler = middleware(handler, "PutEnclavesEnclaveIdentifierStarlarkPackages") } response, err := handler(ctx, request) if err != nil { return err - } else if validResponse, ok := response.(PutStarlarkPackagesResponseObject); ok { - return validResponse.VisitPutStarlarkPackagesResponse(ctx.Response()) + } else if validResponse, ok := response.(PutEnclavesEnclaveIdentifierStarlarkPackagesResponseObject); ok { + return validResponse.VisitPutEnclavesEnclaveIdentifierStarlarkPackagesResponse(ctx.Response()) } else if response != nil { return fmt.Errorf("Unexpected response type: %T", response) } return nil } -// PostStarlarkPackagesPackageId operation middleware -func (sh *strictHandler) PostStarlarkPackagesPackageId(ctx echo.Context, packageId string) error { - var request PostStarlarkPackagesPackageIdRequestObject +// PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId operation middleware +func (sh *strictHandler) PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, packageId PackageId) error { + var request PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdRequestObject + request.EnclaveIdentifier = enclaveIdentifier request.PackageId = packageId - var body PostStarlarkPackagesPackageIdJSONRequestBody + var body PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdJSONRequestBody if err := ctx.Bind(&body); err != nil { return err } request.Body = &body handler := func(ctx echo.Context, request interface{}) (interface{}, error) { - return sh.ssi.PostStarlarkPackagesPackageId(ctx.Request().Context(), request.(PostStarlarkPackagesPackageIdRequestObject)) + return sh.ssi.PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId(ctx.Request().Context(), request.(PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdRequestObject)) } for _, middleware := range sh.middlewares { - handler = middleware(handler, "PostStarlarkPackagesPackageId") + handler = middleware(handler, "PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId") } response, err := handler(ctx, request) if err != nil { return err - } else if validResponse, ok := response.(PostStarlarkPackagesPackageIdResponseObject); ok { - return validResponse.VisitPostStarlarkPackagesPackageIdResponse(ctx.Response()) + } else if validResponse, ok := response.(PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdResponseObject); ok { + return validResponse.VisitPostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdResponse(ctx.Response()) } else if response != nil { return fmt.Errorf("Unexpected response type: %T", response) } return nil } -// PostStarlarkScripts operation middleware -func (sh *strictHandler) PostStarlarkScripts(ctx echo.Context) error { - var request PostStarlarkScriptsRequestObject +// PostEnclavesEnclaveIdentifierStarlarkScripts operation middleware +func (sh *strictHandler) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error { + var request PostEnclavesEnclaveIdentifierStarlarkScriptsRequestObject + + request.EnclaveIdentifier = enclaveIdentifier - var body PostStarlarkScriptsJSONRequestBody + var body PostEnclavesEnclaveIdentifierStarlarkScriptsJSONRequestBody if err := ctx.Bind(&body); err != nil { return err } request.Body = &body handler := func(ctx echo.Context, request interface{}) (interface{}, error) { - return sh.ssi.PostStarlarkScripts(ctx.Request().Context(), request.(PostStarlarkScriptsRequestObject)) + return sh.ssi.PostEnclavesEnclaveIdentifierStarlarkScripts(ctx.Request().Context(), request.(PostEnclavesEnclaveIdentifierStarlarkScriptsRequestObject)) } for _, middleware := range sh.middlewares { - handler = middleware(handler, "PostStarlarkScripts") + handler = middleware(handler, "PostEnclavesEnclaveIdentifierStarlarkScripts") } response, err := handler(ctx, request) if err != nil { return err - } else if validResponse, ok := response.(PostStarlarkScriptsResponseObject); ok { - return validResponse.VisitPostStarlarkScriptsResponse(ctx.Response()) + } else if validResponse, ok := response.(PostEnclavesEnclaveIdentifierStarlarkScriptsResponseObject); ok { + return validResponse.VisitPostEnclavesEnclaveIdentifierStarlarkScriptsResponse(ctx.Response()) } else if response != nil { return fmt.Errorf("Unexpected response type: %T", response) } @@ -1081,70 +1231,72 @@ func (sh *strictHandler) PostStarlarkScripts(ctx echo.Context) error { // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/+w8f2/bOJZfhdAd0J2BG3dnF4tD/kvTpPVtxzFiZ3KHzUJLS88xpxSpJSmnniLf/fD4", - "Q5YsylG8TTsL3D/TWHx8fHy/+f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5G6leyNlgto3CSdC5457zCclxmWEdD2XO4uyOCFSGwSr6fcdSE5", + "LRQgC4k0ZD3usk/tRGU6nOfEpcMHOsK7GNB/c/e4f99kwMhk2QppAkeGBCxBAEt0pEaUTywuC1UI2IPu", + "G1g0SA8XJBlQdAMLZIDRSSWUw0i2EIHU9vXlJ6Q48vkpg6osaN5TXu11f9dyaheMBuQTKhdtrsOXrTVH", + "Gli/EL4GgSltLahbzNR7cVCrjttlC7vldMayw5rwQsaJfhOvsAxs6o9Yrjy1s8uznycX13NkBpjEhk2S", + "uFohk4Un0mfjl0RIZWFv2WVNKubGxE1u36M1wYgoiTQRvr7K51C1Crr4DW6Zq2GWRCpgycbTZrLihKEE", + "S21mMnCI77XpYVwhAQmQdU9FekcF7AVgr8K2VNMAP22nHkitR99+F91gos658NUHJ7U6+bDN0wPQORfo", + "49XVrKxaQCfNAvsmUxc83cQKvgYKESZLl2xyeASoQjCnoiaAaubv/HGUYfEFUoSlL+2ngH6Ao7sj9BEo", + "5eiGC5r+eBTi+UqpPM5Arbhhvc+zfDi7ikbR7GIerqEmjCiCaZwCxZs4I5QSCQlnqewx7LYDgS9RHVbv", + "ElN3UTBFqL9JdrvNbkXD1wRTOiwj33/Km1O9ld/zDRFHaKLMdZjJcSosFLonalUjQ1IsV0dG0v6mCP3T", + "oRmvAFO1+mf4ek4Jb1obJH3GX2tMKVeJsFLaPknf6UCcz+G6Gxyn7shas6nITTLfaol+gBmybv/AC05D", + "3CAhTncLcAHqHswWtOsdPSUQ2tbij9Y1x2yip8owI3lB/T2my8maigOiqEZ15tLm9gZzDUJaBH/R6+U5", + "MJyT6Dj669GbozeRVRez2LHHNX7o9hltx97gGNg7COzcT0Qq1D0WNW167xs3fZJGx6aq1M3l/lYXPCe1", + "UfXerV/CJ2UFMg40R21/bXV+vH3z5tn6UwZWovX3jSwLilw7jYbajgaLYGwqFV77e/hgBbk93STCbS/F", + "VXGXx7ReA5pvpIKsI6lZMUBSnzQx57am+JlE5nuMeitDG21I404P0vaAct/lYxxE2La+Ybe0r4BS6QsX", + "6s1itTCgowllQdY9LJ5fLS4N2QfUi2fqMusL7oLdZr3hXavl7ID6tzssO4gGulNejh+6DYTbp+hkwvNN", + "jz7iumvyvBrp+wI6VQXPoqCjR0cFui8PqtY7k03bZhHti2jto8mfg2jvQ6BDe9vrxbiK/LLpFpirQGu3", + "PT3Bp/H/eXHNC/WoH9Q5GtTX8HLSHvtDsFfsvjRL7jgmB1miJyqCn//PqhDDurmfKH1/PvVK99IlEXRo", + "pWMywhnCC17YeAVcixu6Ld68eft3tCr73FCJeR8xz6tB33cI84T2vgNIbewazf3NNpehcEaCKKXRbpfv", + "ugNcPi6e02ra79hBDbXqv/DZ3dfEfwhd6PMw3bbefxN+T87eqJPUKT8sgGoJUvfpjn8VIDa178yUsK8b", + "sP0frDiw6fhm+jB2rf391sLWBoCNPu7IGlj5tRRX0Ih9NWgVmDzNinT0q/Y9gj9XTNH+HENA3K0PMryc", + "iQp9oOHF1NHfVcjxQ+2jQdtx4xtDvbr6jvLki0tqV+pq0uGdS5DyamNUNrMRHaoIXtytELajPoAqV/c8", + "Kl22os64UDYN3r7e+XYW9ZFR9c84HWpnPHZnFtDE5q2ZFlnfzdmgTRTOkTq4cfWhoiG67spfep1pTSzF", + "UlVdTKJg+znIfop/Awc59GmH57QsDv3YdYLJAQn9dvfYEbL9Ygpy2xphFcZ3p9Z7WRPMGh8KM3d83X7Y", + "vfJrrbHyu78GOMBmKcU3fqhaNLcDHJSaNO17xO2dfSFBvJJoAStMl3va8ZZA3N/JS/kktSbVQ1ncnlb3", + "F09qhotWD2EfLDL5jVVq7qj4jgPmcM/rv51mbLf/FwAA//+j0gszy1QAAA==", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/api/golang/core/kurtosis_core_http_api_bindings/api_container_types.gen.go b/api/golang/core/kurtosis_core_http_api_bindings/api_container_types.gen.go index 3c347e3809..534cf0d02a 100644 --- a/api/golang/core/kurtosis_core_http_api_bindings/api_container_types.gen.go +++ b/api/golang/core/kurtosis_core_http_api_bindings/api_container_types.gen.go @@ -18,8 +18,8 @@ const ( // Defines values for ImageDownloadMode. const ( - Always ImageDownloadMode = "always" - Missing ImageDownloadMode = "missing" + ImageDownloadModeALWAYS ImageDownloadMode = "ALWAYS" + ImageDownloadModeMISSING ImageDownloadMode = "MISSING" ) // Defines values for KurtosisFeatureFlag. @@ -36,8 +36,8 @@ const ( // Defines values for RestartPolicy. const ( - ALWAYS RestartPolicy = "ALWAYS" - NEVER RestartPolicy = "NEVER" + RestartPolicyALWAYS RestartPolicy = "ALWAYS" + RestartPolicyNEVER RestartPolicy = "NEVER" ) // Defines values for ServiceStatus. @@ -149,8 +149,8 @@ type GetStarlarkRunResponse struct { SerializedScript *string `json:"serialized_script,omitempty"` } -// ImageDownloadMode 0 - always -// 1 - missing +// ImageDownloadMode 0 - ALWAYS +// 1 - MISSING type ImageDownloadMode string // InspectFilesArtifactContentsResponse defines model for InspectFilesArtifactContentsResponse. @@ -172,12 +172,12 @@ type Port struct { // MaybeWaitTimeout The wait timeout duration in string MaybeWaitTimeout *string `json:"maybe_wait_timeout,omitempty"` - Number *int32 `json:"number,omitempty"` + Number int32 `json:"number"` // TransportProtocol 0 - TCP // 1 - SCTP // 2 - UDP - TransportProtocol *PortTransportProtocol `json:"transport_protocol,omitempty"` + TransportProtocol PortTransportProtocol `json:"transport_protocol"` } // PortTransportProtocol 0 - TCP @@ -207,8 +207,8 @@ type RunStarlarkPackageArgs struct { DryRun *bool `json:"dry_run,omitempty"` ExperimentalFeatures *[]KurtosisFeatureFlag `json:"experimental_features,omitempty"` - // ImageDownloadMode 0 - always - // 1 - missing + // ImageDownloadMode 0 - ALWAYS + // 1 - MISSING ImageDownloadMode *ImageDownloadMode `json:"image_download_mode,omitempty"` // Local the payload of the local module @@ -244,8 +244,8 @@ type RunStarlarkScriptArgs struct { DryRun *bool `json:"dry_run,omitempty"` ExperimentalFeatures *[]KurtosisFeatureFlag `json:"experimental_features,omitempty"` - // ImageDownloadMode 0 - always - // 1 - missing + // ImageDownloadMode 0 - ALWAYS + // 1 - MISSING ImageDownloadMode *ImageDownloadMode `json:"image_download_mode,omitempty"` // MainFunctionName The name of the main function, the default value is "run" @@ -463,38 +463,53 @@ type WaitForEndpointAvailabilityArgs struct { // WaitForEndpointAvailabilityArgsHttpMethod defines model for WaitForEndpointAvailabilityArgs.HttpMethod. type WaitForEndpointAvailabilityArgsHttpMethod string +// ArtifactIdentifier defines model for artifact_identifier. +type ArtifactIdentifier = string + +// EnclaveIdentifier The package identifier that will be executed +type EnclaveIdentifier = string + +// PackageId defines model for package_id. +type PackageId = string + +// PortNumber defines model for port_number. +type PortNumber = int32 + +// ServiceIdentifier defines model for service_identifier. +type ServiceIdentifier = string + // StreamedDataBody Streamed Data Chunk type StreamedDataBody = StreamedDataChunk -// GetServicesServiceIdentifierParams defines parameters for GetServicesServiceIdentifier. -type GetServicesServiceIdentifierParams struct { +// GetEnclavesEnclaveIdentifierServicesServiceIdentifierParams defines parameters for GetEnclavesEnclaveIdentifierServicesServiceIdentifier. +type GetEnclavesEnclaveIdentifierServicesServiceIdentifierParams struct { // AdditionalProperties Additional properties AdditionalProperties *string `form:"additional-properties,omitempty" json:"additional-properties,omitempty"` } -// PutArtifactsLocalFileJSONRequestBody defines body for PutArtifactsLocalFile for application/json ContentType. -type PutArtifactsLocalFileJSONRequestBody = StreamedDataChunk +// PutEnclavesEnclaveIdentifierArtifactsLocalFileJSONRequestBody defines body for PutEnclavesEnclaveIdentifierArtifactsLocalFile for application/json ContentType. +type PutEnclavesEnclaveIdentifierArtifactsLocalFileJSONRequestBody = StreamedDataChunk -// PutArtifactsRemoteFileJSONRequestBody defines body for PutArtifactsRemoteFile for application/json ContentType. -type PutArtifactsRemoteFileJSONRequestBody = StoreWebFilesArtifactArgs +// PutEnclavesEnclaveIdentifierArtifactsRemoteFileJSONRequestBody defines body for PutEnclavesEnclaveIdentifierArtifactsRemoteFile for application/json ContentType. +type PutEnclavesEnclaveIdentifierArtifactsRemoteFileJSONRequestBody = StoreWebFilesArtifactArgs -// PutArtifactsServicesServiceIdentifierJSONRequestBody defines body for PutArtifactsServicesServiceIdentifier for application/json ContentType. -type PutArtifactsServicesServiceIdentifierJSONRequestBody = StoreFilesArtifactFromServiceArgs +// PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierJSONRequestBody defines body for PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier for application/json ContentType. +type PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierJSONRequestBody = StoreFilesArtifactFromServiceArgs -// PostServicesConnectionJSONRequestBody defines body for PostServicesConnection for application/json ContentType. -type PostServicesConnectionJSONRequestBody = ConnectServicesArgs +// PostEnclavesEnclaveIdentifierServicesConnectionJSONRequestBody defines body for PostEnclavesEnclaveIdentifierServicesConnection for application/json ContentType. +type PostEnclavesEnclaveIdentifierServicesConnectionJSONRequestBody = ConnectServicesArgs -// PostServicesServiceIdentifierCommandJSONRequestBody defines body for PostServicesServiceIdentifierCommand for application/json ContentType. -type PostServicesServiceIdentifierCommandJSONRequestBody = ExecCommandArgs +// PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandJSONRequestBody defines body for PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand for application/json ContentType. +type PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandJSONRequestBody = ExecCommandArgs -// PostServicesServiceIdentifierEndpointsPortNumberAvailabilityJSONRequestBody defines body for PostServicesServiceIdentifierEndpointsPortNumberAvailability for application/json ContentType. -type PostServicesServiceIdentifierEndpointsPortNumberAvailabilityJSONRequestBody = WaitForEndpointAvailabilityArgs +// PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityJSONRequestBody defines body for PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability for application/json ContentType. +type PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityJSONRequestBody = WaitForEndpointAvailabilityArgs -// PutStarlarkPackagesJSONRequestBody defines body for PutStarlarkPackages for application/json ContentType. -type PutStarlarkPackagesJSONRequestBody = StreamedDataChunk +// PutEnclavesEnclaveIdentifierStarlarkPackagesJSONRequestBody defines body for PutEnclavesEnclaveIdentifierStarlarkPackages for application/json ContentType. +type PutEnclavesEnclaveIdentifierStarlarkPackagesJSONRequestBody = StreamedDataChunk -// PostStarlarkPackagesPackageIdJSONRequestBody defines body for PostStarlarkPackagesPackageId for application/json ContentType. -type PostStarlarkPackagesPackageIdJSONRequestBody = RunStarlarkPackageArgs +// PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdJSONRequestBody defines body for PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId for application/json ContentType. +type PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdJSONRequestBody = RunStarlarkPackageArgs -// PostStarlarkScriptsJSONRequestBody defines body for PostStarlarkScripts for application/json ContentType. -type PostStarlarkScriptsJSONRequestBody = RunStarlarkScriptArgs +// PostEnclavesEnclaveIdentifierStarlarkScriptsJSONRequestBody defines body for PostEnclavesEnclaveIdentifierStarlarkScripts for application/json ContentType. +type PostEnclavesEnclaveIdentifierStarlarkScriptsJSONRequestBody = RunStarlarkScriptArgs diff --git a/api/openapi/core/api_container_service.yaml b/api/openapi/core/api_container_service.yaml index 1d77a681a5..190a5683ba 100644 --- a/api/openapi/core/api_container_service.yaml +++ b/api/openapi/core/api_container_service.yaml @@ -1,57 +1,59 @@ openapi: 3.0.0 info: title: Enclave API - description: "" + description: API to manipulate the enclaves version: "1" paths: - /starlark: + /enclaves/{enclave_identifier}/starlark: get: description: Get last Starlark run + parameters: + - $ref: '#/components/parameters/enclave_identifier' responses: "200": - description: "" + description: Successful request content: application/json: schema: $ref: "#/components/schemas/GetStarlarkRunResponse" - /starlark/packages: + /enclaves/{enclave_identifier}/starlark/packages: put: description: Uploads a Starlark package. This step is required before the package can be executed with RunStarlarkPackage + parameters: + - $ref: '#/components/parameters/enclave_identifier' requestBody: $ref: "#/components/requestBodies/StreamedDataBody" responses: "200": $ref: "#/components/responses/Success" - /starlark/packages/{package_id}: + /enclaves/{enclave_identifier}/starlark/packages/{package_id}: post: description: Executes a Starlark script on the user's behalf + parameters: + - $ref: '#/components/parameters/enclave_identifier' + - $ref: '#/components/parameters/package_id' requestBody: content: application/json: schema: $ref: "#/components/schemas/RunStarlarkPackageArgs" required: true - parameters: - - in: path - name: package_id - schema: - type: string - description: The package identifier that will be executed - required: true responses: "200": - description: "" + description: Successful request content: application/json: schema: $ref: "#/components/schemas/StarlarkRunResponseLine" - /starlark/scripts: + /enclaves/{enclave_identifier}/starlark/scripts: post: description: Executes a Starlark script on the user's behalf + parameters: + - $ref: '#/components/parameters/enclave_identifier' requestBody: content: application/json: @@ -60,32 +62,30 @@ paths: required: true responses: "200": - description: "" + description: Successful request content: application/json: schema: $ref: "#/components/schemas/StarlarkRunResponseLine" - /services: + /enclaves/{enclave_identifier}/services: get: description: Returns information about all existing & historical services + parameters: + - $ref: '#/components/parameters/enclave_identifier' responses: "200": - description: "" + description: Successful request content: application/json: schema: $ref: "#/components/schemas/GetExistingAndHistoricalServiceIdentifiersResponse" - /services/{service_identifier}: + /enclaves/{enclave_identifier}/services/{service_identifier}: get: parameters: - - in: path - name: service_identifier - schema: - type: string - required: true - description: Service identifier to fetch info + - $ref: '#/components/parameters/enclave_identifier' + - $ref: '#/components/parameters/service_identifier' - in: query name: additional-properties schema: @@ -93,15 +93,18 @@ paths: description: Additional properties responses: "200": - description: "" + description: Successful request content: application/json: schema: $ref: "#/components/schemas/GetServicesResponse" - /services/{service_identifier}/command: + /enclaves/{enclave_identifier}/services/{service_identifier}/command: post: description: Executes the given command inside a running container + parameters: + - $ref: '#/components/parameters/enclave_identifier' + - $ref: '#/components/parameters/service_identifier' requestBody: content: application/json: @@ -109,24 +112,21 @@ paths: $ref: "#/components/schemas/ExecCommandArgs" description: Exec Command required: true - parameters: - - in: path - name: service_identifier - schema: - type: string - description: The service identifier of the container that the command should be executed in - required: true responses: "200": - description: "" + description: Successful request content: application/json: schema: $ref: "#/components/schemas/ExecCommandResponse" - /services/{service_identifier}/endpoints/{port_number}/availability: + /enclaves/{enclave_identifier}/services/{service_identifier}/endpoints/{port_number}/availability: post: description: Block until the given HTTP endpoint returns available, calling it through a HTTP Get request + parameters: + - $ref: '#/components/parameters/enclave_identifier' + - $ref: '#/components/parameters/service_identifier' + - $ref: '#/components/parameters/port_number' requestBody: content: application/json: @@ -134,85 +134,71 @@ paths: $ref: "#/components/schemas/WaitForEndpointAvailabilityArgs" description: Wait For HTTP Get Endpoint Availability required: true - parameters: - - in: path - name: service_identifier - schema: - type: string - description: The service identifier of the container that the command should be executed in - required: true - - in: path - name: port_number - schema: - type: integer - description: The port number to check availability - required: true responses: "200": $ref: "#/components/responses/Success" - /artifacts: + /enclaves/{enclave_identifier}/artifacts: get: + description: List all files artifacts + parameters: + - $ref: '#/components/parameters/enclave_identifier' responses: "200": - description: "" + description: Successful request content: application/json: schema: $ref: "#/components/schemas/ListFilesArtifactNamesAndUuidsResponse" - /artifacts/{artifact_identifier}: + /enclaves/{enclave_identifier}/artifacts/{artifact_identifier}: get: - description: "" parameters: - - in: path - name: artifact_identifier - schema: - type: string - description: The artifact name or uuid - required: true + - $ref: '#/components/parameters/enclave_identifier' + - $ref: '#/components/parameters/artifact_identifier' + description: Inspect the content of a file artifact responses: "200": - description: "" + description: Successful request content: application/json: schema: $ref: "#/components/schemas/InspectFilesArtifactContentsResponse" - /artifacts/{artifact_identifier}/download: + /enclaves/{enclave_identifier}/artifacts/{artifact_identifier}/download: get: description: Downloads a files artifact from the Kurtosis File System + parameters: + - $ref: '#/components/parameters/enclave_identifier' + - $ref: '#/components/parameters/artifact_identifier' responses: "200": - description: "" + description: Successful request content: application/json: schema: $ref: "#/components/schemas/StreamedDataChunk" - parameters: - - in: path - name: artifact_identifier - schema: - type: string - required: true - description: Numeric ID of the user to get - /artifacts/local-file: + /enclaves/{enclave_identifier}/artifacts/local-file: put: description: Uploads a files artifact to the Kurtosis File System + parameters: + - $ref: '#/components/parameters/enclave_identifier' requestBody: $ref: "#/components/requestBodies/StreamedDataBody" responses: "200": - description: "" + description: Successful request content: application/json: schema: $ref: "#/components/schemas/UploadFilesArtifactResponse" - /artifacts/remote-file: + /enclaves/{enclave_identifier}/artifacts/remote-file: put: description: Tells the API container to download a files artifact from the web to the Kurtosis File System + parameters: + - $ref: '#/components/parameters/enclave_identifier' requestBody: content: application/json: @@ -222,39 +208,37 @@ paths: required: true responses: "200": - description: "" + description: Successful request content: application/json: schema: $ref: "#/components/schemas/StoreWebFilesArtifactResponse" - /artifacts/services/{service_identifier}: + /enclaves/{enclave_identifier}/artifacts/services/{service_identifier}: put: description: Tells the API container to copy a files artifact from a service to the Kurtosis File System + parameters: + - $ref: '#/components/parameters/enclave_identifier' + - $ref: '#/components/parameters/service_identifier' requestBody: content: application/json: schema: $ref: "#/components/schemas/StoreFilesArtifactFromServiceArgs" required: true - parameters: - - in: path - name: service_identifier - schema: - type: string - required: true - description: Numeric ID of the user to get responses: "200": - description: "" + description: Successful request content: application/json: schema: $ref: "#/components/schemas/StoreFilesArtifactFromServiceResponse" - /services/connection: + /enclaves/{enclave_identifier}/services/connection: post: description: User services port forwarding + parameters: + - $ref: '#/components/parameters/enclave_identifier' requestBody: content: application/json: @@ -263,13 +247,55 @@ paths: required: true responses: "200": - description: "" + description: Successful request content: application/json: schema: $ref: "#/components/schemas/ConnectServicesResponse" components: + parameters: + enclave_identifier: + in: path + name: enclave_identifier + schema: + type: string + description: The package identifier that will be executed + required: true + + service_identifier: + in: path + name: service_identifier + schema: + type: string + description: The service identifier of the container that the command should be executed in + required: true + + port_number: + in: path + name: port_number + schema: + type: integer + format: int32 + description: The port number to check availability + required: true + + artifact_identifier: + in: path + name: artifact_identifier + schema: + type: string + description: The artifact name or uuid + required: true + + package_id: + in: path + name: package_id + schema: + type: string + description: The package identifier that will be executed + required: true + requestBodies: StreamedDataBody: @@ -304,6 +330,9 @@ components: maybe_wait_timeout: type: string description: The wait timeout duration in string + required: + - number + - transport_protocol description: Shared Objects (Used By Multiple Endpoints) Container: @@ -340,11 +369,11 @@ components: ImageDownloadMode: type: string enum: - - always - - missing + - ALWAYS + - MISSING description: |- - 0 - always - 1 - missing + 0 - ALWAYS + 1 - MISSING ServiceInfo: type: object diff --git a/api/openapi/scripts/build.sh b/api/openapi/scripts/build.sh old mode 100644 new mode 100755 index a13a263fd3..f7a2e02c51 --- a/api/openapi/scripts/build.sh +++ b/api/openapi/scripts/build.sh @@ -3,4 +3,12 @@ set -euo pipefail # Bash "strict mode" script_dirpath="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -api_root_dirpath="$(dirname "${script_dirpath}")" \ No newline at end of file +api_root_dirpath="$(dirname "${script_dirpath}")" + +echo "Generating data models for REST API " +oapi-codegen --config="$api_root_dirpath/engine/types.cfg.yaml" "$api_root_dirpath/engine/engine_service.yaml" +oapi-codegen --config="$api_root_dirpath/core/types.cfg.yaml" "$api_root_dirpath/core/api_container_service.yaml" + +echo "Generating server code for REST API " +oapi-codegen --config="$api_root_dirpath/engine/server.cfg.yaml" "$api_root_dirpath/engine/engine_service.yaml" +oapi-codegen --config="$api_root_dirpath/core/server.cfg.yaml" "$api_root_dirpath/core/api_container_service.yaml" \ No newline at end of file From 5e1a0fba4b263eb9ff69a0ce3a44616f8637f9f3 Mon Sep 17 00:00:00 2001 From: lostbean Date: Wed, 15 Nov 2023 16:59:57 -0300 Subject: [PATCH 19/95] start enclave management REST API on engine --- engine/server/engine/main.go | 42 ++-- .../server/engine_enclave_manager_service.go | 180 ++++++++++++++++++ engine/server/engine/utils/list.go | 12 ++ 3 files changed, 215 insertions(+), 19 deletions(-) create mode 100644 engine/server/engine/server/engine_enclave_manager_service.go diff --git a/engine/server/engine/main.go b/engine/server/engine/main.go index 52811cbeaa..f7a7fdb90c 100644 --- a/engine/server/engine/main.go +++ b/engine/server/engine/main.go @@ -17,7 +17,8 @@ import ( "strings" "time" - api "github.com/kurtosis-tech/kurtosis/api/golang/engine/kurtosis_engine_http_api_bindings" + enclaveApi "github.com/kurtosis-tech/kurtosis/api/golang/core/kurtosis_core_http_api_bindings" + engineApi "github.com/kurtosis-tech/kurtosis/api/golang/engine/kurtosis_engine_http_api_bindings" "github.com/kurtosis-tech/kurtosis/api/golang/engine/kurtosis_engine_rpc_api_bindings/kurtosis_engine_rpc_api_bindingsconnect" connect_server "github.com/kurtosis-tech/kurtosis/connect-server" "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/backend_creator" @@ -237,6 +238,7 @@ func runMain() error { }() go restApiServer( + ctx, serverArgs, enclaveManager, perWeekLogsDatabaseClient, @@ -358,6 +360,7 @@ func formatFilenameFunctionForLogs(filename string, functionName string) string } func restApiServer( + ctx context.Context, serverArgs *args.EngineServerArgs, enclave_manager *enclave_manager.EnclaveManager, perWeekLogsDatabaseClient centralized_logs.LogsDatabaseClient, @@ -367,18 +370,23 @@ func restApiServer( ) { logrus.Info("Running REST API server...") - _, err := api.GetSwagger() - if err != nil { - fmt.Fprintf(os.Stderr, "Error loading swagger spec\n: %s", err) - os.Exit(1) - } + // This is how you set up a basic Echo router + e := echo.New() + // Log all requests + e.Use(echomiddleware.Logger()) - // Clear out the servers array in the swagger spec, that skips validating - // that server names match. We don't know how this thing will be run. + // Use our validation middleware to check all requests against the + // OpenAPI schema. + // _, err := engineApi.GetSwagger() + // if err != nil { + // fmt.Fprintf(os.Stderr, "Error loading swagger spec\n: %s", err) + // os.Exit(1) + // } // swagger.Servers = nil + // e.Use(middleware.OapiRequestValidator(swagger)) - // Create an instance of our handler which satisfies the generated interface - runtime := restApi.EngineRuntime{ + // We now register our runtime above as the handler for the interface + engineRuntime := restApi.EngineRuntime{ ImageVersionTag: serverArgs.ImageVersionTag, EnclaveManager: enclave_manager, MetricsUserID: serverArgs.MetricsUserID, @@ -388,17 +396,13 @@ func restApiServer( LogFileManager: logFileManager, MetricsClient: metricsClient, } + engineApi.RegisterHandlers(e, engineApi.NewStrictHandler(engineRuntime, nil)) - // This is how you set up a basic Echo router - e := echo.New() - // Log all requests - e.Use(echomiddleware.Logger()) - // Use our validation middleware to check all requests against the - // OpenAPI schema. - // e.Use(middleware.OapiRequestValidator(swagger)) + enclaveRuntime, err := restApi.NewEnclaveRuntime(ctx, enclave_manager) + if err != nil { - // We now register our runtime above as the handler for the interface - api.RegisterHandlers(e, api.NewStrictHandler(runtime, nil)) + } + enclaveApi.RegisterHandlers(e, enclaveApi.NewStrictHandler(enclaveRuntime, nil)) e.Logger.Fatal(e.Start(net.JoinHostPort("0.0.0.0", fmt.Sprint(restAPIPortAddr)))) } diff --git a/engine/server/engine/server/engine_enclave_manager_service.go b/engine/server/engine/server/engine_enclave_manager_service.go new file mode 100644 index 0000000000..e5227a00cb --- /dev/null +++ b/engine/server/engine/server/engine_enclave_manager_service.go @@ -0,0 +1,180 @@ +package server + +import ( + "context" + "fmt" + + "github.com/kurtosis-tech/kurtosis/engine/server/engine/enclave_manager" + "github.com/kurtosis-tech/kurtosis/engine/server/engine/types" + "github.com/kurtosis-tech/kurtosis/engine/server/engine/utils" + "github.com/kurtosis-tech/stacktrace" + "github.com/sirupsen/logrus" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" + "google.golang.org/protobuf/types/known/emptypb" + + "github.com/kurtosis-tech/kurtosis/api/golang/core/kurtosis_core_http_api_bindings" + api "github.com/kurtosis-tech/kurtosis/api/golang/core/kurtosis_core_http_api_bindings" + "github.com/kurtosis-tech/kurtosis/api/golang/core/kurtosis_core_rpc_api_bindings" +) + +func toHttpFilesArtifactNameAndUuid(rpc_artifact *kurtosis_core_rpc_api_bindings.FilesArtifactNameAndUuid) kurtosis_core_http_api_bindings.FilesArtifactNameAndUuid { + return kurtosis_core_http_api_bindings.FilesArtifactNameAndUuid{ + FileName: &rpc_artifact.FileName, + FileUuid: &rpc_artifact.FileUuid, + } +} + +func toHttpIdentifierArtifacts(rpc_artifact_list *kurtosis_core_rpc_api_bindings.ListFilesArtifactNamesAndUuidsResponse) []kurtosis_core_http_api_bindings.FilesArtifactNameAndUuid { + return utils.MapList(rpc_artifact_list.FileNamesAndUuids, toHttpFilesArtifactNameAndUuid) +} + +type enclaveRuntime struct { + enclaveManager *enclave_manager.EnclaveManager + remoteApiContainerClient map[string]kurtosis_core_rpc_api_bindings.ApiContainerServiceClient +} + +func NewEnclaveRuntime(ctx context.Context, manager *enclave_manager.EnclaveManager) (*enclaveRuntime, error) { + enclaves, err := manager.GetEnclaves(ctx) + if err != nil { + return nil, err + } + + clients := map[string]kurtosis_core_rpc_api_bindings.ApiContainerServiceClient{} + for uuid, info := range enclaves { + conn, err := getGrpcClientConn(info) + if err != nil { + logrus.Errorf("Failed to establish gRPC connection with enclave manager container %s on %s", uuid, info.ApiContainerInfo) + return nil, err + } + logrus.Debugf("Creating gRPC client to enclave manager container %s on %s", uuid, info.ApiContainerInfo) + apiContainerClient := kurtosis_core_rpc_api_bindings.NewApiContainerServiceClient(conn) + clients[uuid] = apiContainerClient + } + + runtime := enclaveRuntime{ + enclaveManager: manager, + remoteApiContainerClient: clients, + } + + return &runtime, nil +} + +// =============================================================================================================== +// ============================= Implementing StrictServerInterface ============================================= +// =============================================================================================================== + +// (GET /enclaves/{enclave_identifier}/artifacts) +func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierArtifacts(ctx context.Context, request api.GetEnclavesEnclaveIdentifierArtifactsRequestObject) (api.GetEnclavesEnclaveIdentifierArtifactsResponseObject, error) { + enclave_identifier := request.EnclaveIdentifier + + apiContainerClient := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) + + artifacts, err := apiContainerClient.ListFilesArtifactNamesAndUuids(ctx, &emptypb.Empty{}) + if err != nil { + return nil, err + } + + http_artifacts := toHttpIdentifierArtifacts(artifacts) + result := api.ListFilesArtifactNamesAndUuidsResponse{ + FileNamesAndUuids: &http_artifacts, + } + return api.GetEnclavesEnclaveIdentifierArtifacts200JSONResponse(result), nil + +} + +// (PUT /enclaves/{enclave_identifier}/artifacts/local-file) +func (manager *enclaveRuntime) PutEnclavesEnclaveIdentifierArtifactsLocalFile(ctx context.Context, request api.PutEnclavesEnclaveIdentifierArtifactsLocalFileRequestObject) (api.PutEnclavesEnclaveIdentifierArtifactsLocalFileResponseObject, error) { + return nil, Error{} +} + +// (PUT /enclaves/{enclave_identifier}/artifacts/remote-file) +func (manager *enclaveRuntime) PutEnclavesEnclaveIdentifierArtifactsRemoteFile(ctx context.Context, request api.PutEnclavesEnclaveIdentifierArtifactsRemoteFileRequestObject) (api.PutEnclavesEnclaveIdentifierArtifactsRemoteFileResponseObject, error) { + return nil, Error{} +} + +// (PUT /enclaves/{enclave_identifier}/artifacts/services/{service_identifier}) +func (manager *enclaveRuntime) PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier(ctx context.Context, request api.PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierRequestObject) (api.PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierResponseObject, error) { + return nil, Error{} +} + +// (GET /enclaves/{enclave_identifier}/artifacts/{artifact_identifier}) +func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier(ctx context.Context, request api.GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierRequestObject) (api.GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierResponseObject, error) { + return nil, Error{} +} + +// (GET /enclaves/{enclave_identifier}/artifacts/{artifact_identifier}/download) +func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownload(ctx context.Context, request api.GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownloadRequestObject) (api.GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownloadResponseObject, error) { + return nil, Error{} +} + +// (GET /enclaves/{enclave_identifier}/services) +func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierServices(ctx context.Context, request api.GetEnclavesEnclaveIdentifierServicesRequestObject) (api.GetEnclavesEnclaveIdentifierServicesResponseObject, error) { + return nil, Error{} +} + +// (POST /enclaves/{enclave_identifier}/services/connection) +func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierServicesConnection(ctx context.Context, request api.PostEnclavesEnclaveIdentifierServicesConnectionRequestObject) (api.PostEnclavesEnclaveIdentifierServicesConnectionResponseObject, error) { + return nil, Error{} +} + +// (GET /enclaves/{enclave_identifier}/services/{service_identifier}) +func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierServicesServiceIdentifier(ctx context.Context, request api.GetEnclavesEnclaveIdentifierServicesServiceIdentifierRequestObject) (api.GetEnclavesEnclaveIdentifierServicesServiceIdentifierResponseObject, error) { + return nil, Error{} +} + +// (POST /enclaves/{enclave_identifier}/services/{service_identifier}/command) +func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand(ctx context.Context, request api.PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandRequestObject) (api.PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandResponseObject, error) { + return nil, Error{} +} + +// (POST /enclaves/{enclave_identifier}/services/{service_identifier}/endpoints/{port_number}/availability) +func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability(ctx context.Context, request api.PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityRequestObject) (api.PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityResponseObject, error) { + return nil, Error{} +} + +// (GET /enclaves/{enclave_identifier}/starlark) +func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierStarlark(ctx context.Context, request api.GetEnclavesEnclaveIdentifierStarlarkRequestObject) (api.GetEnclavesEnclaveIdentifierStarlarkResponseObject, error) { + return nil, Error{} +} + +// (PUT /enclaves/{enclave_identifier}/starlark/packages) +func (manager *enclaveRuntime) PutEnclavesEnclaveIdentifierStarlarkPackages(ctx context.Context, request api.PutEnclavesEnclaveIdentifierStarlarkPackagesRequestObject) (api.PutEnclavesEnclaveIdentifierStarlarkPackagesResponseObject, error) { + return nil, Error{} +} + +// (POST /enclaves/{enclave_identifier}/starlark/packages/{package_id}) +func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId(ctx context.Context, request api.PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdRequestObject) (api.PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdResponseObject, error) { + return nil, Error{} +} + +// (POST /enclaves/{enclave_identifier}/starlark/scripts) +func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx context.Context, request api.PostEnclavesEnclaveIdentifierStarlarkScriptsRequestObject) (api.PostEnclavesEnclaveIdentifierStarlarkScriptsResponseObject, error) { + return nil, Error{} +} + +// =============================================================================================================== +// =============================================================================================================== +// =============================================================================================================== + +// GetGrpcClientConn returns a client conn dialed in to the local port +// It is the caller's responsibility to call resultClientConn.close() +func getGrpcClientConn(enclaveInfo *types.EnclaveInfo) (resultClientConn *grpc.ClientConn, resultErr error) { + apiContainerGrpcPort := enclaveInfo.ApiContainerInfo.GrpcPortInsideEnclave + apiContainerIP := enclaveInfo.ApiContainerInfo.ContainerId + grpcServerAddress := fmt.Sprintf("%v:%v", apiContainerIP, apiContainerGrpcPort) + grpcConnection, err := grpc.Dial(grpcServerAddress, grpc.WithTransportCredentials(insecure.NewCredentials())) + if err != nil { + return nil, stacktrace.Propagate(err, "Expected to be able to create a GRPC client connection on address '%v', but a non-nil error was returned", grpcServerAddress) + } + return grpcConnection, nil +} + +func (manager enclaveRuntime) GetGrpcClientForEnclaveUUID(enclave_uuid string) kurtosis_core_rpc_api_bindings.ApiContainerServiceClient { + client, found := manager.remoteApiContainerClient[enclave_uuid] + if !found { + // TODO(edgar): add logic to retry/refresh map + panic(fmt.Sprintf("can't find enclave %s", enclave_uuid)) + } + return client +} diff --git a/engine/server/engine/utils/list.go b/engine/server/engine/utils/list.go index 8ac5519b0a..344945329f 100644 --- a/engine/server/engine/utils/list.go +++ b/engine/server/engine/utils/list.go @@ -7,3 +7,15 @@ func MapList[T, U any](data []T, f func(T) U) []U { } return res } + +func MapListStopOnError[T, U any](data []T, f func(T) (U, error)) ([]U, error) { + res := make([]U, 0, len(data)) + for _, e := range data { + y, err := f(e) + if err != nil { + return res, err + } + res = append(res, y) + } + return res, nil +} From 03b362ba1b330df079a662251f0bec2d539f9467 Mon Sep 17 00:00:00 2001 From: lostbean Date: Wed, 15 Nov 2023 21:15:05 -0300 Subject: [PATCH 20/95] add artifact upload --- .../api_container_server.gen.go | 229 +++++++++--------- .../api_container_types.gen.go | 19 +- api/openapi/core/api_container_service.yaml | 21 +- engine/server/engine/main.go | 4 +- .../server/engine_enclave_manager_service.go | 66 ++++- 5 files changed, 202 insertions(+), 137 deletions(-) diff --git a/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go b/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go index e63892baac..a0856703a1 100644 --- a/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go +++ b/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go @@ -11,6 +11,7 @@ import ( "encoding/json" "fmt" "io" + "mime/multipart" "net/http" "net/url" "path" @@ -27,8 +28,8 @@ type ServerInterface interface { // (GET /enclaves/{enclave_identifier}/artifacts) GetEnclavesEnclaveIdentifierArtifacts(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error - // (PUT /enclaves/{enclave_identifier}/artifacts/local-file) - PutEnclavesEnclaveIdentifierArtifactsLocalFile(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error + // (POST /enclaves/{enclave_identifier}/artifacts/local-file) + PostEnclavesEnclaveIdentifierArtifactsLocalFile(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error // (PUT /enclaves/{enclave_identifier}/artifacts/remote-file) PutEnclavesEnclaveIdentifierArtifactsRemoteFile(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error @@ -60,8 +61,8 @@ type ServerInterface interface { // (GET /enclaves/{enclave_identifier}/starlark) GetEnclavesEnclaveIdentifierStarlark(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error - // (PUT /enclaves/{enclave_identifier}/starlark/packages) - PutEnclavesEnclaveIdentifierStarlarkPackages(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error + // (POST /enclaves/{enclave_identifier}/starlark/packages) + PostEnclavesEnclaveIdentifierStarlarkPackages(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error // (POST /enclaves/{enclave_identifier}/starlark/packages/{package_id}) PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, packageId PackageId) error @@ -91,8 +92,8 @@ func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierArtifacts(ctx echo. return err } -// PutEnclavesEnclaveIdentifierArtifactsLocalFile converts echo context to params. -func (w *ServerInterfaceWrapper) PutEnclavesEnclaveIdentifierArtifactsLocalFile(ctx echo.Context) error { +// PostEnclavesEnclaveIdentifierArtifactsLocalFile converts echo context to params. +func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierArtifactsLocalFile(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- var enclaveIdentifier EnclaveIdentifier @@ -103,7 +104,7 @@ func (w *ServerInterfaceWrapper) PutEnclavesEnclaveIdentifierArtifactsLocalFile( } // Invoke the callback with all the unmarshalled arguments - err = w.Handler.PutEnclavesEnclaveIdentifierArtifactsLocalFile(ctx, enclaveIdentifier) + err = w.Handler.PostEnclavesEnclaveIdentifierArtifactsLocalFile(ctx, enclaveIdentifier) return err } @@ -332,8 +333,8 @@ func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierStarlark(ctx echo.C return err } -// PutEnclavesEnclaveIdentifierStarlarkPackages converts echo context to params. -func (w *ServerInterfaceWrapper) PutEnclavesEnclaveIdentifierStarlarkPackages(ctx echo.Context) error { +// PostEnclavesEnclaveIdentifierStarlarkPackages converts echo context to params. +func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierStarlarkPackages(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- var enclaveIdentifier EnclaveIdentifier @@ -344,7 +345,7 @@ func (w *ServerInterfaceWrapper) PutEnclavesEnclaveIdentifierStarlarkPackages(ct } // Invoke the callback with all the unmarshalled arguments - err = w.Handler.PutEnclavesEnclaveIdentifierStarlarkPackages(ctx, enclaveIdentifier) + err = w.Handler.PostEnclavesEnclaveIdentifierStarlarkPackages(ctx, enclaveIdentifier) return err } @@ -417,7 +418,7 @@ func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL } router.GET(baseURL+"/enclaves/:enclave_identifier/artifacts", wrapper.GetEnclavesEnclaveIdentifierArtifacts) - router.PUT(baseURL+"/enclaves/:enclave_identifier/artifacts/local-file", wrapper.PutEnclavesEnclaveIdentifierArtifactsLocalFile) + router.POST(baseURL+"/enclaves/:enclave_identifier/artifacts/local-file", wrapper.PostEnclavesEnclaveIdentifierArtifactsLocalFile) router.PUT(baseURL+"/enclaves/:enclave_identifier/artifacts/remote-file", wrapper.PutEnclavesEnclaveIdentifierArtifactsRemoteFile) router.PUT(baseURL+"/enclaves/:enclave_identifier/artifacts/services/:service_identifier", wrapper.PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier) router.GET(baseURL+"/enclaves/:enclave_identifier/artifacts/:artifact_identifier", wrapper.GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier) @@ -428,7 +429,7 @@ func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL router.POST(baseURL+"/enclaves/:enclave_identifier/services/:service_identifier/command", wrapper.PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand) router.POST(baseURL+"/enclaves/:enclave_identifier/services/:service_identifier/endpoints/:port_number/availability", wrapper.PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability) router.GET(baseURL+"/enclaves/:enclave_identifier/starlark", wrapper.GetEnclavesEnclaveIdentifierStarlark) - router.PUT(baseURL+"/enclaves/:enclave_identifier/starlark/packages", wrapper.PutEnclavesEnclaveIdentifierStarlarkPackages) + router.POST(baseURL+"/enclaves/:enclave_identifier/starlark/packages", wrapper.PostEnclavesEnclaveIdentifierStarlarkPackages) router.POST(baseURL+"/enclaves/:enclave_identifier/starlark/packages/:package_id", wrapper.PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId) router.POST(baseURL+"/enclaves/:enclave_identifier/starlark/scripts", wrapper.PostEnclavesEnclaveIdentifierStarlarkScripts) @@ -458,18 +459,18 @@ func (response GetEnclavesEnclaveIdentifierArtifacts200JSONResponse) VisitGetEnc return json.NewEncoder(w).Encode(response) } -type PutEnclavesEnclaveIdentifierArtifactsLocalFileRequestObject struct { +type PostEnclavesEnclaveIdentifierArtifactsLocalFileRequestObject struct { EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` - Body *PutEnclavesEnclaveIdentifierArtifactsLocalFileJSONRequestBody + Body *multipart.Reader } -type PutEnclavesEnclaveIdentifierArtifactsLocalFileResponseObject interface { - VisitPutEnclavesEnclaveIdentifierArtifactsLocalFileResponse(w http.ResponseWriter) error +type PostEnclavesEnclaveIdentifierArtifactsLocalFileResponseObject interface { + VisitPostEnclavesEnclaveIdentifierArtifactsLocalFileResponse(w http.ResponseWriter) error } -type PutEnclavesEnclaveIdentifierArtifactsLocalFile200JSONResponse UploadFilesArtifactResponse +type PostEnclavesEnclaveIdentifierArtifactsLocalFile200JSONResponse []UploadFilesArtifactResponse -func (response PutEnclavesEnclaveIdentifierArtifactsLocalFile200JSONResponse) VisitPutEnclavesEnclaveIdentifierArtifactsLocalFileResponse(w http.ResponseWriter) error { +func (response PostEnclavesEnclaveIdentifierArtifactsLocalFile200JSONResponse) VisitPostEnclavesEnclaveIdentifierArtifactsLocalFileResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") w.WriteHeader(200) @@ -666,18 +667,18 @@ func (response GetEnclavesEnclaveIdentifierStarlark200JSONResponse) VisitGetEncl return json.NewEncoder(w).Encode(response) } -type PutEnclavesEnclaveIdentifierStarlarkPackagesRequestObject struct { +type PostEnclavesEnclaveIdentifierStarlarkPackagesRequestObject struct { EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` - Body *PutEnclavesEnclaveIdentifierStarlarkPackagesJSONRequestBody + Body *multipart.Reader } -type PutEnclavesEnclaveIdentifierStarlarkPackagesResponseObject interface { - VisitPutEnclavesEnclaveIdentifierStarlarkPackagesResponse(w http.ResponseWriter) error +type PostEnclavesEnclaveIdentifierStarlarkPackagesResponseObject interface { + VisitPostEnclavesEnclaveIdentifierStarlarkPackagesResponse(w http.ResponseWriter) error } -type PutEnclavesEnclaveIdentifierStarlarkPackages200AsteriskResponse struct{ SuccessAsteriskResponse } +type PostEnclavesEnclaveIdentifierStarlarkPackages200AsteriskResponse struct{ SuccessAsteriskResponse } -func (response PutEnclavesEnclaveIdentifierStarlarkPackages200AsteriskResponse) VisitPutEnclavesEnclaveIdentifierStarlarkPackagesResponse(w http.ResponseWriter) error { +func (response PostEnclavesEnclaveIdentifierStarlarkPackages200AsteriskResponse) VisitPostEnclavesEnclaveIdentifierStarlarkPackagesResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", response.ContentType) if response.ContentLength != 0 { w.Header().Set("Content-Length", fmt.Sprint(response.ContentLength)) @@ -734,8 +735,8 @@ type StrictServerInterface interface { // (GET /enclaves/{enclave_identifier}/artifacts) GetEnclavesEnclaveIdentifierArtifacts(ctx context.Context, request GetEnclavesEnclaveIdentifierArtifactsRequestObject) (GetEnclavesEnclaveIdentifierArtifactsResponseObject, error) - // (PUT /enclaves/{enclave_identifier}/artifacts/local-file) - PutEnclavesEnclaveIdentifierArtifactsLocalFile(ctx context.Context, request PutEnclavesEnclaveIdentifierArtifactsLocalFileRequestObject) (PutEnclavesEnclaveIdentifierArtifactsLocalFileResponseObject, error) + // (POST /enclaves/{enclave_identifier}/artifacts/local-file) + PostEnclavesEnclaveIdentifierArtifactsLocalFile(ctx context.Context, request PostEnclavesEnclaveIdentifierArtifactsLocalFileRequestObject) (PostEnclavesEnclaveIdentifierArtifactsLocalFileResponseObject, error) // (PUT /enclaves/{enclave_identifier}/artifacts/remote-file) PutEnclavesEnclaveIdentifierArtifactsRemoteFile(ctx context.Context, request PutEnclavesEnclaveIdentifierArtifactsRemoteFileRequestObject) (PutEnclavesEnclaveIdentifierArtifactsRemoteFileResponseObject, error) @@ -767,8 +768,8 @@ type StrictServerInterface interface { // (GET /enclaves/{enclave_identifier}/starlark) GetEnclavesEnclaveIdentifierStarlark(ctx context.Context, request GetEnclavesEnclaveIdentifierStarlarkRequestObject) (GetEnclavesEnclaveIdentifierStarlarkResponseObject, error) - // (PUT /enclaves/{enclave_identifier}/starlark/packages) - PutEnclavesEnclaveIdentifierStarlarkPackages(ctx context.Context, request PutEnclavesEnclaveIdentifierStarlarkPackagesRequestObject) (PutEnclavesEnclaveIdentifierStarlarkPackagesResponseObject, error) + // (POST /enclaves/{enclave_identifier}/starlark/packages) + PostEnclavesEnclaveIdentifierStarlarkPackages(ctx context.Context, request PostEnclavesEnclaveIdentifierStarlarkPackagesRequestObject) (PostEnclavesEnclaveIdentifierStarlarkPackagesResponseObject, error) // (POST /enclaves/{enclave_identifier}/starlark/packages/{package_id}) PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId(ctx context.Context, request PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdRequestObject) (PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdResponseObject, error) @@ -815,31 +816,31 @@ func (sh *strictHandler) GetEnclavesEnclaveIdentifierArtifacts(ctx echo.Context, return nil } -// PutEnclavesEnclaveIdentifierArtifactsLocalFile operation middleware -func (sh *strictHandler) PutEnclavesEnclaveIdentifierArtifactsLocalFile(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error { - var request PutEnclavesEnclaveIdentifierArtifactsLocalFileRequestObject +// PostEnclavesEnclaveIdentifierArtifactsLocalFile operation middleware +func (sh *strictHandler) PostEnclavesEnclaveIdentifierArtifactsLocalFile(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error { + var request PostEnclavesEnclaveIdentifierArtifactsLocalFileRequestObject request.EnclaveIdentifier = enclaveIdentifier - var body PutEnclavesEnclaveIdentifierArtifactsLocalFileJSONRequestBody - if err := ctx.Bind(&body); err != nil { + if reader, err := ctx.Request().MultipartReader(); err != nil { return err + } else { + request.Body = reader } - request.Body = &body handler := func(ctx echo.Context, request interface{}) (interface{}, error) { - return sh.ssi.PutEnclavesEnclaveIdentifierArtifactsLocalFile(ctx.Request().Context(), request.(PutEnclavesEnclaveIdentifierArtifactsLocalFileRequestObject)) + return sh.ssi.PostEnclavesEnclaveIdentifierArtifactsLocalFile(ctx.Request().Context(), request.(PostEnclavesEnclaveIdentifierArtifactsLocalFileRequestObject)) } for _, middleware := range sh.middlewares { - handler = middleware(handler, "PutEnclavesEnclaveIdentifierArtifactsLocalFile") + handler = middleware(handler, "PostEnclavesEnclaveIdentifierArtifactsLocalFile") } response, err := handler(ctx, request) if err != nil { return err - } else if validResponse, ok := response.(PutEnclavesEnclaveIdentifierArtifactsLocalFileResponseObject); ok { - return validResponse.VisitPutEnclavesEnclaveIdentifierArtifactsLocalFileResponse(ctx.Response()) + } else if validResponse, ok := response.(PostEnclavesEnclaveIdentifierArtifactsLocalFileResponseObject); ok { + return validResponse.VisitPostEnclavesEnclaveIdentifierArtifactsLocalFileResponse(ctx.Response()) } else if response != nil { return fmt.Errorf("Unexpected response type: %T", response) } @@ -1134,31 +1135,31 @@ func (sh *strictHandler) GetEnclavesEnclaveIdentifierStarlark(ctx echo.Context, return nil } -// PutEnclavesEnclaveIdentifierStarlarkPackages operation middleware -func (sh *strictHandler) PutEnclavesEnclaveIdentifierStarlarkPackages(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error { - var request PutEnclavesEnclaveIdentifierStarlarkPackagesRequestObject +// PostEnclavesEnclaveIdentifierStarlarkPackages operation middleware +func (sh *strictHandler) PostEnclavesEnclaveIdentifierStarlarkPackages(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error { + var request PostEnclavesEnclaveIdentifierStarlarkPackagesRequestObject request.EnclaveIdentifier = enclaveIdentifier - var body PutEnclavesEnclaveIdentifierStarlarkPackagesJSONRequestBody - if err := ctx.Bind(&body); err != nil { + if reader, err := ctx.Request().MultipartReader(); err != nil { return err + } else { + request.Body = reader } - request.Body = &body handler := func(ctx echo.Context, request interface{}) (interface{}, error) { - return sh.ssi.PutEnclavesEnclaveIdentifierStarlarkPackages(ctx.Request().Context(), request.(PutEnclavesEnclaveIdentifierStarlarkPackagesRequestObject)) + return sh.ssi.PostEnclavesEnclaveIdentifierStarlarkPackages(ctx.Request().Context(), request.(PostEnclavesEnclaveIdentifierStarlarkPackagesRequestObject)) } for _, middleware := range sh.middlewares { - handler = middleware(handler, "PutEnclavesEnclaveIdentifierStarlarkPackages") + handler = middleware(handler, "PostEnclavesEnclaveIdentifierStarlarkPackages") } response, err := handler(ctx, request) if err != nil { return err - } else if validResponse, ok := response.(PutEnclavesEnclaveIdentifierStarlarkPackagesResponseObject); ok { - return validResponse.VisitPutEnclavesEnclaveIdentifierStarlarkPackagesResponse(ctx.Response()) + } else if validResponse, ok := response.(PostEnclavesEnclaveIdentifierStarlarkPackagesResponseObject); ok { + return validResponse.VisitPostEnclavesEnclaveIdentifierStarlarkPackagesResponse(ctx.Response()) } else if response != nil { return fmt.Errorf("Unexpected response type: %T", response) } @@ -1231,72 +1232,72 @@ func (sh *strictHandler) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx echo.C // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/+w87XLbOJKvguJdVWamFCub3dq68j/HsRPdJrLKssd3NZ7iQmTLwgQEuAAoR+PSu1/h", - "i5+gTHksJzt1f+KIbDQa3Y1Gd6ObD1HCs5wzYEpGxw9Rjg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WnWMDLgXr9r1p8p5gsNpGs9oFeyJyu814ZFZN4n1WU1ev7UgHkfHS6X0MXvEHImpumO0o", - "usdCe99DUdw48J3a0j7nn3XX31QEN5G6leyNlgto3CSdC5457zCclxmWEdD2XO4uyOCFSGwSr6fcdSE5", - "LRQgC4k0ZD3usk/tRGU6nOfEpcMHOsK7GNB/c/e4f99kwMhk2QppAkeGBCxBAEt0pEaUTywuC1UI2IPu", - "G1g0SA8XJBlQdAMLZIDRSSWUw0i2EIHU9vXlJ6Q48vkpg6osaN5TXu11f9dyaheMBuQTKhdtrsOXrTVH", - "Gli/EL4GgSltLahbzNR7cVCrjttlC7vldMayw5rwQsaJfhOvsAxs6o9Yrjy1s8uznycX13NkBpjEhk2S", - "uFohk4Un0mfjl0RIZWFv2WVNKubGxE1u36M1wYgoiTQRvr7K51C1Crr4DW6Zq2GWRCpgycbTZrLihKEE", - "S21mMnCI77XpYVwhAQmQdU9FekcF7AVgr8K2VNMAP22nHkitR99+F91gos658NUHJ7U6+bDN0wPQORfo", - "49XVrKxaQCfNAvsmUxc83cQKvgYKESZLl2xyeASoQjCnoiaAaubv/HGUYfEFUoSlL+2ngH6Ao7sj9BEo", - "5eiGC5r+eBTi+UqpPM5Arbhhvc+zfDi7ikbR7GIerqEmjCiCaZwCxZs4I5QSCQlnqewx7LYDgS9RHVbv", - "ElN3UTBFqL9JdrvNbkXD1wRTOiwj33/Km1O9ld/zDRFHaKLMdZjJcSosFLonalUjQ1IsV0dG0v6mCP3T", - "oRmvAFO1+mf4ek4Jb1obJH3GX2tMKVeJsFLaPknf6UCcz+G6Gxyn7shas6nITTLfaol+gBmybv/AC05D", - "3CAhTncLcAHqHswWtOsdPSUQ2tbij9Y1x2yip8owI3lB/T2my8maigOiqEZ15tLm9gZzDUJaBH/R6+U5", - "MJyT6Dj669GbozeRVRez2LHHNX7o9hltx97gGNg7COzcT0Qq1D0WNW167xs3fZJGx6aq1M3l/lYXPCe1", - "UfXerV/CJ2UFMg40R21/bXV+vH3z5tn6UwZWovX3jSwLilw7jYbajgaLYGwqFV77e/hgBbk93STCbS/F", - "VXGXx7ReA5pvpIKsI6lZMUBSnzQx57am+JlE5nuMeitDG21I404P0vaAct/lYxxE2La+Ybe0r4BS6QsX", - "6s1itTCgowllQdY9LJ5fLS4N2QfUi2fqMusL7oLdZr3hXavl7ID6tzssO4gGulNejh+6DYTbp+hkwvNN", - "jz7iumvyvBrp+wI6VQXPoqCjR0cFui8PqtY7k03bZhHti2jto8mfg2jvQ6BDe9vrxbiK/LLpFpirQGu3", - "PT3Bp/H/eXHNC/WoH9Q5GtTX8HLSHvtDsFfsvjRL7jgmB1miJyqCn//PqhDDurmfKH1/PvVK99IlEXRo", - "pWMywhnCC17YeAVcixu6Ld68eft3tCr73FCJeR8xz6tB33cI84T2vgNIbewazf3NNpehcEaCKKXRbpfv", - "ugNcPi6e02ra79hBDbXqv/DZ3dfEfwhd6PMw3bbefxN+T87eqJPUKT8sgGoJUvfpjn8VIDa178yUsK8b", - "sP0frDiw6fhm+jB2rf391sLWBoCNPu7IGlj5tRRX0Ih9NWgVmDzNinT0q/Y9gj9XTNH+HENA3K0PMryc", - "iQp9oOHF1NHfVcjxQ+2jQdtx4xtDvbr6jvLki0tqV+pq0uGdS5DyamNUNrMRHaoIXtytELajPoAqV/c8", - "Kl22os64UDYN3r7e+XYW9ZFR9c84HWpnPHZnFtDE5q2ZFlnfzdmgTRTOkTq4cfWhoiG67spfep1pTSzF", - "UlVdTKJg+znIfop/Awc59GmH57QsDv3YdYLJAQn9dvfYEbL9Ygpy2xphFcZ3p9Z7WRPMGh8KM3d83X7Y", - "vfJrrbHyu78GOMBmKcU3fqhaNLcDHJSaNO17xO2dfSFBvJJoAStMl3va8ZZA3N/JS/kktSbVQ1ncnlb3", - "F09qhotWD2EfLDL5jVVq7qj4jgPmcM/rv51mbLf/FwAA//+j0gszy1QAAA==", + "H4sIAAAAAAAC/+w8a3PbOJJ/BcW7quxMKVZ2dmvryt8cx050m8gqyx7f1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tNgokMmoRa6//TVKLgVfVFoKWBO4jxAMLYiy", + "6OGLQl6tjxBZNpZMKb+X6E+SFIRie5VfTyf/80qiVyvA+asfhpNXBvpOcQEnLL/WzqZp09TMOvXivr1a", + "NwMSUAqQ5i5ld3alzlysVx2jr70xdcyK6sdrzM/deGN7fQ/q7AuRBssJyz8QqbggGaZen08qK0D2HwtM", + "aQOudRJ3Kb3uFMOO6nuI3jbtNVVmDFvyoQsxoL0zKiwoFp8vNdulH0oQpACmME2XgJUWMJwef9dCcUnk", + "uRt4TnH02iowYelSs8xIRP/F0zbFI68FphQokcVAZRaURGoUSap46hZiJC02gQCpsFBpySnJNo/t/dJB", + "zxywM4cJpuR3yFPrn8X1egPKHZKB987EXNrv+D0zRuknr9C7V+nJx5uT/537m/TTZD5392O4O93rZJSE", + "V7ELc8JkCZlq6ZSgs/slyZA1bSxouBQNuRsGHbOYOEapNL1IJ9P51eX16dXkYjpPT09OPxiTo0GpHpAo", + "wT4SqToaWHoV/BjJzHGQqTEKjDrcj2pRlT+IVMZwj1yHKywgRxcWTKI/XUvI0dsN+mQ9HgrojOXWdpU/", + "dEybAm8WkOKypCTD9qCXgiuecRo9Bw78HhOVKlIAjxkcxnk0EMhDoFwLi9rc0h5VhB212zxARyiBmbRe", + "cXO5uwhvSHd0FYbNwqjgRzqn85ekcrIjM/zaw5EI2qj8Xp3O/BGfn17NgqX8btaQ36tT85d5bczjd7Oo", + "4LZ1WPyonP18duknq7RHdUjMy2QU1Ep0Cs3CRTRz+r3HsaOcGUVtQbpLuVmBWtk4QR2SqUMEdnCOuECM", + "q6NbNlmiJaYSRgaetQaFuE2pKYUcLQUv7PuT2eQUUZ5hWuNXXMARmiwRUa8kwluvLWoiUaGlumUrvAa0", + "AGBI27gB5EhLY+i4MMIWDVApCHeBG0ypAevSye3DRi/6t+F3brfxnqgPeoEWsOQihE3MYbE8lrX0Lzin", + "gK1OzSjXeUqYVJhl8SDYO1hiTZU0i4WiVJvYkXN4tATxdBy52KRCs92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stJxsPD/wUAAP//z39X34pUAAA=", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/api/golang/core/kurtosis_core_http_api_bindings/api_container_types.gen.go b/api/golang/core/kurtosis_core_http_api_bindings/api_container_types.gen.go index 534cf0d02a..f6eb6ca3eb 100644 --- a/api/golang/core/kurtosis_core_http_api_bindings/api_container_types.gen.go +++ b/api/golang/core/kurtosis_core_http_api_bindings/api_container_types.gen.go @@ -3,6 +3,10 @@ // Code generated by github.com/deepmap/oapi-codegen version (devel) DO NOT EDIT. package kurtosis_core_http_api_bindings +import ( + openapi_types "github.com/deepmap/oapi-codegen/pkg/types" +) + // Defines values for Connect. const ( CONNECT Connect = "CONNECT" @@ -478,8 +482,8 @@ type PortNumber = int32 // ServiceIdentifier defines model for service_identifier. type ServiceIdentifier = string -// StreamedDataBody Streamed Data Chunk -type StreamedDataBody = StreamedDataChunk +// PostEnclavesEnclaveIdentifierArtifactsLocalFileMultipartBody defines parameters for PostEnclavesEnclaveIdentifierArtifactsLocalFile. +type PostEnclavesEnclaveIdentifierArtifactsLocalFileMultipartBody = openapi_types.File // GetEnclavesEnclaveIdentifierServicesServiceIdentifierParams defines parameters for GetEnclavesEnclaveIdentifierServicesServiceIdentifier. type GetEnclavesEnclaveIdentifierServicesServiceIdentifierParams struct { @@ -487,8 +491,11 @@ type GetEnclavesEnclaveIdentifierServicesServiceIdentifierParams struct { AdditionalProperties *string `form:"additional-properties,omitempty" json:"additional-properties,omitempty"` } -// PutEnclavesEnclaveIdentifierArtifactsLocalFileJSONRequestBody defines body for PutEnclavesEnclaveIdentifierArtifactsLocalFile for application/json ContentType. -type PutEnclavesEnclaveIdentifierArtifactsLocalFileJSONRequestBody = StreamedDataChunk +// PostEnclavesEnclaveIdentifierStarlarkPackagesMultipartBody defines parameters for PostEnclavesEnclaveIdentifierStarlarkPackages. +type PostEnclavesEnclaveIdentifierStarlarkPackagesMultipartBody = openapi_types.File + +// PostEnclavesEnclaveIdentifierArtifactsLocalFileMultipartRequestBody defines body for PostEnclavesEnclaveIdentifierArtifactsLocalFile for multipart/form-data ContentType. +type PostEnclavesEnclaveIdentifierArtifactsLocalFileMultipartRequestBody = PostEnclavesEnclaveIdentifierArtifactsLocalFileMultipartBody // PutEnclavesEnclaveIdentifierArtifactsRemoteFileJSONRequestBody defines body for PutEnclavesEnclaveIdentifierArtifactsRemoteFile for application/json ContentType. type PutEnclavesEnclaveIdentifierArtifactsRemoteFileJSONRequestBody = StoreWebFilesArtifactArgs @@ -505,8 +512,8 @@ type PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandJSONRequestBod // PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityJSONRequestBody defines body for PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability for application/json ContentType. type PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityJSONRequestBody = WaitForEndpointAvailabilityArgs -// PutEnclavesEnclaveIdentifierStarlarkPackagesJSONRequestBody defines body for PutEnclavesEnclaveIdentifierStarlarkPackages for application/json ContentType. -type PutEnclavesEnclaveIdentifierStarlarkPackagesJSONRequestBody = StreamedDataChunk +// PostEnclavesEnclaveIdentifierStarlarkPackagesMultipartRequestBody defines body for PostEnclavesEnclaveIdentifierStarlarkPackages for multipart/form-data ContentType. +type PostEnclavesEnclaveIdentifierStarlarkPackagesMultipartRequestBody = PostEnclavesEnclaveIdentifierStarlarkPackagesMultipartBody // PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdJSONRequestBody defines body for PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId for application/json ContentType. type PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdJSONRequestBody = RunStarlarkPackageArgs diff --git a/api/openapi/core/api_container_service.yaml b/api/openapi/core/api_container_service.yaml index 190a5683ba..a96381fbc8 100644 --- a/api/openapi/core/api_container_service.yaml +++ b/api/openapi/core/api_container_service.yaml @@ -19,12 +19,12 @@ paths: $ref: "#/components/schemas/GetStarlarkRunResponse" /enclaves/{enclave_identifier}/starlark/packages: - put: + post: description: Uploads a Starlark package. This step is required before the package can be executed with RunStarlarkPackage parameters: - $ref: '#/components/parameters/enclave_identifier' requestBody: - $ref: "#/components/requestBodies/StreamedDataBody" + $ref: "#/components/requestBodies/fileUploadBody" responses: "200": $ref: "#/components/responses/Success" @@ -180,19 +180,21 @@ paths: $ref: "#/components/schemas/StreamedDataChunk" /enclaves/{enclave_identifier}/artifacts/local-file: - put: + post: description: Uploads a files artifact to the Kurtosis File System parameters: - $ref: '#/components/parameters/enclave_identifier' requestBody: - $ref: "#/components/requestBodies/StreamedDataBody" + $ref: "#/components/requestBodies/fileUploadBody" responses: "200": description: Successful request content: application/json: schema: - $ref: "#/components/schemas/UploadFilesArtifactResponse" + type: array + items: + $ref: "#/components/schemas/UploadFilesArtifactResponse" /enclaves/{enclave_identifier}/artifacts/remote-file: put: @@ -298,13 +300,12 @@ components: requestBodies: - StreamedDataBody: + fileUploadBody: content: - application/json: + multipart/form-data: schema: - $ref: "#/components/schemas/StreamedDataChunk" - description: Streamed Data Chunk - required: true + type: string + format: binary responses: diff --git a/engine/server/engine/main.go b/engine/server/engine/main.go index f7a7fdb90c..0558e8dddd 100644 --- a/engine/server/engine/main.go +++ b/engine/server/engine/main.go @@ -400,8 +400,10 @@ func restApiServer( enclaveRuntime, err := restApi.NewEnclaveRuntime(ctx, enclave_manager) if err != nil { - + // TODO(edgar) fix error handling } + // TODO(edgar) add enclave Close() + // defer enclaveRuntime.ShutDown() enclaveApi.RegisterHandlers(e, enclaveApi.NewStrictHandler(enclaveRuntime, nil)) e.Logger.Fatal(e.Start(net.JoinHostPort("0.0.0.0", fmt.Sprint(restAPIPortAddr)))) diff --git a/engine/server/engine/server/engine_enclave_manager_service.go b/engine/server/engine/server/engine_enclave_manager_service.go index e5227a00cb..e5371d3d66 100644 --- a/engine/server/engine/server/engine_enclave_manager_service.go +++ b/engine/server/engine/server/engine_enclave_manager_service.go @@ -2,7 +2,10 @@ package server import ( "context" + "crypto/sha1" + "encoding/hex" "fmt" + "io" "github.com/kurtosis-tech/kurtosis/engine/server/engine/enclave_manager" "github.com/kurtosis-tech/kurtosis/engine/server/engine/types" @@ -29,6 +32,13 @@ func toHttpIdentifierArtifacts(rpc_artifact_list *kurtosis_core_rpc_api_bindings return utils.MapList(rpc_artifact_list.FileNamesAndUuids, toHttpFilesArtifactNameAndUuid) } +func toHttpUploadFilesArtifactResponse(rpc_upload_artifact *kurtosis_core_rpc_api_bindings.UploadFilesArtifactResponse) api.UploadFilesArtifactResponse { + return api.UploadFilesArtifactResponse{ + Name: &rpc_upload_artifact.Name, + Uuid: &rpc_upload_artifact.Uuid, + } +} + type enclaveRuntime struct { enclaveManager *enclave_manager.EnclaveManager remoteApiContainerClient map[string]kurtosis_core_rpc_api_bindings.ApiContainerServiceClient @@ -67,7 +77,6 @@ func NewEnclaveRuntime(ctx context.Context, manager *enclave_manager.EnclaveMana // (GET /enclaves/{enclave_identifier}/artifacts) func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierArtifacts(ctx context.Context, request api.GetEnclavesEnclaveIdentifierArtifactsRequestObject) (api.GetEnclavesEnclaveIdentifierArtifactsResponseObject, error) { enclave_identifier := request.EnclaveIdentifier - apiContainerClient := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) artifacts, err := apiContainerClient.ListFilesArtifactNamesAndUuids(ctx, &emptypb.Empty{}) @@ -83,9 +92,54 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierArtifacts(ctx context } -// (PUT /enclaves/{enclave_identifier}/artifacts/local-file) -func (manager *enclaveRuntime) PutEnclavesEnclaveIdentifierArtifactsLocalFile(ctx context.Context, request api.PutEnclavesEnclaveIdentifierArtifactsLocalFileRequestObject) (api.PutEnclavesEnclaveIdentifierArtifactsLocalFileResponseObject, error) { - return nil, Error{} +// (POST /enclaves/{enclave_identifier}/artifacts/local-file) +func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierArtifactsLocalFile(ctx context.Context, request api.PostEnclavesEnclaveIdentifierArtifactsLocalFileRequestObject) (api.PostEnclavesEnclaveIdentifierArtifactsLocalFileResponseObject, error) { + enclave_identifier := request.EnclaveIdentifier + apiContainerClient := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) + logrus.Infof("Uploading file artifact to enclave %s", enclave_identifier) + + buf := make([]byte, 1024) + hasher := sha1.New() + uploaded_artifacts := []api.UploadFilesArtifactResponse{} + for { + uploadStreamingCall, err := apiContainerClient.UploadFilesArtifact(ctx) + if err != nil { + logrus.Errorf("Can't start file upload gRPC call with enclave %s, error: %s", enclave_identifier, err) + return nil, stacktrace.NewError("Can't start file upload gRPC call with enclave %s", enclave_identifier) + } + part, err := request.Body.NextPart() + if err == io.EOF { + break + } + var n int + previousChunkHash := "" + for { + n, err = part.Read(buf) + if err == io.EOF { + break + } + chunk := kurtosis_core_rpc_api_bindings.StreamedDataChunk{ + Data: buf[:n], + PreviousChunkHash: previousChunkHash, + } + uploadStreamingCall.Send(&chunk) + hasher.Reset() + hasher.Write(chunk.Data) + previousChunkHash = hex.EncodeToString(hasher.Sum(nil)) + } + + artifact_info, closing_err := uploadStreamingCall.CloseAndRecv() + if closing_err != nil { + logrus.Errorf("Failed to close upload gRPC call with enclave %s, error: %s", enclave_identifier, closing_err) + return nil, closing_err + } + + // TODO(edgar) track uploaded artifacts by upload file name + artifact_response := toHttpUploadFilesArtifactResponse(artifact_info) + uploaded_artifacts = append(uploaded_artifacts, artifact_response) + } + + return api.PostEnclavesEnclaveIdentifierArtifactsLocalFile200JSONResponse(uploaded_artifacts), nil } // (PUT /enclaves/{enclave_identifier}/artifacts/remote-file) @@ -138,8 +192,8 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierStarlark(ctx context. return nil, Error{} } -// (PUT /enclaves/{enclave_identifier}/starlark/packages) -func (manager *enclaveRuntime) PutEnclavesEnclaveIdentifierStarlarkPackages(ctx context.Context, request api.PutEnclavesEnclaveIdentifierStarlarkPackagesRequestObject) (api.PutEnclavesEnclaveIdentifierStarlarkPackagesResponseObject, error) { +// (POST /enclaves/{enclave_identifier}/starlark/packages) +func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkPackages(ctx context.Context, request api.PostEnclavesEnclaveIdentifierStarlarkPackagesRequestObject) (api.PostEnclavesEnclaveIdentifierStarlarkPackagesResponseObject, error) { return nil, Error{} } From c34eb7038c8e402dd5d38ac8a3e643db0bc16d77 Mon Sep 17 00:00:00 2001 From: lostbean Date: Wed, 15 Nov 2023 23:12:25 -0300 Subject: [PATCH 21/95] add upload of remote files --- .../api_container_server.gen.go | 134 +++++++++--------- .../api_container_types.gen.go | 6 - api/openapi/core/api_container_service.yaml | 9 +- .../server/engine_enclave_manager_service.go | 77 ++++++++-- 4 files changed, 130 insertions(+), 96 deletions(-) diff --git a/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go b/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go index a0856703a1..e427fff089 100644 --- a/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go +++ b/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go @@ -486,7 +486,7 @@ type PutEnclavesEnclaveIdentifierArtifactsRemoteFileResponseObject interface { VisitPutEnclavesEnclaveIdentifierArtifactsRemoteFileResponse(w http.ResponseWriter) error } -type PutEnclavesEnclaveIdentifierArtifactsRemoteFile200JSONResponse StoreWebFilesArtifactResponse +type PutEnclavesEnclaveIdentifierArtifactsRemoteFile200JSONResponse UploadFilesArtifactResponse func (response PutEnclavesEnclaveIdentifierArtifactsRemoteFile200JSONResponse) VisitPutEnclavesEnclaveIdentifierArtifactsRemoteFileResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -1232,72 +1232,72 @@ func (sh *strictHandler) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx echo.C // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/+w8a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yBrM3WeuDaOwK/smiUiBJL9DF9ec/A7hMjIoRogwtNgokMmoRa6//TVKLgVfVFoKWBO4jxAMLYiy", - "6OGLQl6tjxBZNpZMKb+X6E+SFIRie5VfTyf/80qiVyvA+asfhpNXBvpOcQEnLL/WzqZp09TMOvXivr1a", - "NwMSUAqQ5i5ld3alzlysVx2jr70xdcyK6sdrzM/deGN7fQ/q7AuRBssJyz8QqbggGaZen08qK0D2HwtM", - "aQOudRJ3Kb3uFMOO6nuI3jbtNVVmDFvyoQsxoL0zKiwoFp8vNdulH0oQpACmME2XgJUWMJwef9dCcUnk", - "uRt4TnH02iowYelSs8xIRP/F0zbFI68FphQokcVAZRaURGoUSap46hZiJC02gQCpsFBpySnJNo/t/dJB", - "zxywM4cJpuR3yFPrn8X1egPKHZKB987EXNrv+D0zRuknr9C7V+nJx5uT/537m/TTZD5392O4O93rZJSE", - "V7ELc8JkCZlq6ZSgs/slyZA1bSxouBQNuRsGHbOYOEapNL1IJ9P51eX16dXkYjpPT09OPxiTo0GpHpAo", - "wT4SqToaWHoV/BjJzHGQqTEKjDrcj2pRlT+IVMZwj1yHKywgRxcWTKI/XUvI0dsN+mQ9HgrojOXWdpU/", - "dEybAm8WkOKypCTD9qCXgiuecRo9Bw78HhOVKlIAjxkcxnk0EMhDoFwLi9rc0h5VhB212zxARyiBmbRe", - "cXO5uwhvSHd0FYbNwqjgRzqn85ekcrIjM/zaw5EI2qj8Xp3O/BGfn17NgqX8btaQ36tT85d5bczjd7Oo", - "4LZ1WPyonP18duknq7RHdUjMy2QU1Ep0Cs3CRTRz+r3HsaOcGUVtQbpLuVmBWtk4QR2SqUMEdnCOuECM", - "q6NbNlmiJaYSRgaetQaFuE2pKYUcLQUv7PuT2eQUUZ5hWuNXXMARmiwRUa8kwluvLWoiUaGlumUrvAa0", - "AGBI27gB5EhLY+i4MMIWDVApCHeBG0ypAevSye3DRi/6t+F3brfxnqgPeoEWsOQihE3MYbE8lrX0Lzin", - "gK1OzSjXeUqYVJ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j0t2/vrvjvd03C0F8vvvDtwAGWp2Df+Ur+EvB8QoDSY6b5H3LXytQTxQqIFrDBdfh07/N/Jc8Uk", + "jbegh7K4PS/Kn72oGZ8NPYR9cMjkNxapuT/Fd5wwx5+W/ttJxv39/wUAAP//mUvFA/FTAAA=", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/api/golang/core/kurtosis_core_http_api_bindings/api_container_types.gen.go b/api/golang/core/kurtosis_core_http_api_bindings/api_container_types.gen.go index f6eb6ca3eb..7404443cd4 100644 --- a/api/golang/core/kurtosis_core_http_api_bindings/api_container_types.gen.go +++ b/api/golang/core/kurtosis_core_http_api_bindings/api_container_types.gen.go @@ -418,12 +418,6 @@ type StoreWebFilesArtifactArgs struct { Url *string `json:"url,omitempty"` } -// StoreWebFilesArtifactResponse defines model for StoreWebFilesArtifactResponse. -type StoreWebFilesArtifactResponse struct { - // Uuid UUID of the files artifact, for use when referencing it in the future - Uuid *string `json:"uuid,omitempty"` -} - // StreamedDataChunk Streamed Data Chunk type StreamedDataChunk struct { // Data Chunk of the overall files artifact bytes diff --git a/api/openapi/core/api_container_service.yaml b/api/openapi/core/api_container_service.yaml index a96381fbc8..df4dab0485 100644 --- a/api/openapi/core/api_container_service.yaml +++ b/api/openapi/core/api_container_service.yaml @@ -214,7 +214,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/StoreWebFilesArtifactResponse" + $ref: "#/components/schemas/UploadFilesArtifactResponse" /enclaves/{enclave_identifier}/artifacts/services/{service_identifier}: put: @@ -757,13 +757,6 @@ components: description: |- Store Web Files Artifact - StoreWebFilesArtifactResponse: - type: object - properties: - uuid: - type: string - description: UUID of the files artifact, for use when referencing it in the future - StoreFilesArtifactFromServiceArgs: type: object properties: diff --git a/engine/server/engine/server/engine_enclave_manager_service.go b/engine/server/engine/server/engine_enclave_manager_service.go index e5371d3d66..3c93af1823 100644 --- a/engine/server/engine/server/engine_enclave_manager_service.go +++ b/engine/server/engine/server/engine_enclave_manager_service.go @@ -6,6 +6,7 @@ import ( "encoding/hex" "fmt" "io" + "net/http" "github.com/kurtosis-tech/kurtosis/engine/server/engine/enclave_manager" "github.com/kurtosis-tech/kurtosis/engine/server/engine/types" @@ -102,11 +103,11 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierArtifactsLocalFile(c hasher := sha1.New() uploaded_artifacts := []api.UploadFilesArtifactResponse{} for { - uploadStreamingCall, err := apiContainerClient.UploadFilesArtifact(ctx) - if err != nil { - logrus.Errorf("Can't start file upload gRPC call with enclave %s, error: %s", enclave_identifier, err) - return nil, stacktrace.NewError("Can't start file upload gRPC call with enclave %s", enclave_identifier) - } + uploadStreamingCall, err := apiContainerClient.UploadFilesArtifact(ctx) + if err != nil { + logrus.Errorf("Can't start file upload gRPC call with enclave %s, error: %s", enclave_identifier, err) + return nil, stacktrace.NewError("Can't start file upload gRPC call with enclave %s", enclave_identifier) + } part, err := request.Body.NextPart() if err == io.EOF { break @@ -126,16 +127,16 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierArtifactsLocalFile(c hasher.Reset() hasher.Write(chunk.Data) previousChunkHash = hex.EncodeToString(hasher.Sum(nil)) - } + } - artifact_info, closing_err := uploadStreamingCall.CloseAndRecv() - if closing_err != nil { - logrus.Errorf("Failed to close upload gRPC call with enclave %s, error: %s", enclave_identifier, closing_err) - return nil, closing_err - } + artifact_info, closing_err := uploadStreamingCall.CloseAndRecv() + if closing_err != nil { + logrus.Errorf("Failed to close upload gRPC call with enclave %s, error: %s", enclave_identifier, closing_err) + return nil, closing_err + } // TODO(edgar) track uploaded artifacts by upload file name - artifact_response := toHttpUploadFilesArtifactResponse(artifact_info) + artifact_response := toHttpUploadFilesArtifactResponse(artifact_info) uploaded_artifacts = append(uploaded_artifacts, artifact_response) } @@ -144,7 +145,51 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierArtifactsLocalFile(c // (PUT /enclaves/{enclave_identifier}/artifacts/remote-file) func (manager *enclaveRuntime) PutEnclavesEnclaveIdentifierArtifactsRemoteFile(ctx context.Context, request api.PutEnclavesEnclaveIdentifierArtifactsRemoteFileRequestObject) (api.PutEnclavesEnclaveIdentifierArtifactsRemoteFileResponseObject, error) { - return nil, Error{} + enclave_identifier := request.EnclaveIdentifier + apiContainerClient := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) + logrus.Infof("Uploading file artifact to enclave %s", enclave_identifier) + + uploadStreamingCall, err := apiContainerClient.UploadFilesArtifact(ctx) + if err != nil { + logrus.Errorf("Can't start file upload gRPC call with enclave %s, error: %s", enclave_identifier, err) + return nil, stacktrace.NewError("Can't start file upload gRPC call with enclave %s", enclave_identifier) + } + + remoteFile, err := http.Get(*request.Body.Url) + if err != nil { + logrus.Errorf("Failed to retrieve remote file %s, error: %s", *request.Body.Url, err) + return nil, err + } + + buf := make([]byte, 1024) + var n int + hasher := sha1.New() + previousChunkHash := "" + + for { + n, err = remoteFile.Body.Read(buf) + if err == io.EOF { + break + } + chunk := kurtosis_core_rpc_api_bindings.StreamedDataChunk{ + Data: buf[:n], + PreviousChunkHash: previousChunkHash, + } + uploadStreamingCall.Send(&chunk) + hasher.Reset() + hasher.Write(chunk.Data) + previousChunkHash = hex.EncodeToString(hasher.Sum(nil)) + } + + artifact_info, closing_err := uploadStreamingCall.CloseAndRecv() + if closing_err != nil { + logrus.Errorf("Failed to close upload gRPC call with enclave %s, error: %s", enclave_identifier, closing_err) + return nil, closing_err + } + + artifact_response := toHttpUploadFilesArtifactResponse(artifact_info) + + return api.PutEnclavesEnclaveIdentifierArtifactsRemoteFile200JSONResponse(artifact_response), nil } // (PUT /enclaves/{enclave_identifier}/artifacts/services/{service_identifier}) @@ -214,8 +259,10 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx // GetGrpcClientConn returns a client conn dialed in to the local port // It is the caller's responsibility to call resultClientConn.close() func getGrpcClientConn(enclaveInfo *types.EnclaveInfo) (resultClientConn *grpc.ClientConn, resultErr error) { - apiContainerGrpcPort := enclaveInfo.ApiContainerInfo.GrpcPortInsideEnclave - apiContainerIP := enclaveInfo.ApiContainerInfo.ContainerId + // apiContainerGrpcPort := enclaveInfo.ApiContainerInfo.GrpcPortInsideEnclave + // apiContainerIP := enclaveInfo.ApiContainerInfo.ContainerId + apiContainerGrpcPort := enclaveInfo.ApiContainerHostMachineInfo.GrpcPortOnHostMachine + apiContainerIP := enclaveInfo.ApiContainerHostMachineInfo.IpOnHostMachine grpcServerAddress := fmt.Sprintf("%v:%v", apiContainerIP, apiContainerGrpcPort) grpcConnection, err := grpc.Dial(grpcServerAddress, grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { From 897648e765bf26dfcf29946bd645be2c57b3e18f Mon Sep 17 00:00:00 2001 From: lostbean Date: Wed, 15 Nov 2023 23:41:10 -0300 Subject: [PATCH 22/95] Use streaming utils to manage local file upload --- .../api_container_server.gen.go | 134 +++++++++--------- api/openapi/core/api_container_service.yaml | 4 +- .../server/engine_enclave_manager_service.go | 62 ++++---- 3 files changed, 99 insertions(+), 101 deletions(-) diff --git a/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go b/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go index e427fff089..550f6eef98 100644 --- a/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go +++ b/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go @@ -468,7 +468,7 @@ type PostEnclavesEnclaveIdentifierArtifactsLocalFileResponseObject interface { VisitPostEnclavesEnclaveIdentifierArtifactsLocalFileResponse(w http.ResponseWriter) error } -type PostEnclavesEnclaveIdentifierArtifactsLocalFile200JSONResponse []UploadFilesArtifactResponse +type PostEnclavesEnclaveIdentifierArtifactsLocalFile200JSONResponse map[string]UploadFilesArtifactResponse func (response PostEnclavesEnclaveIdentifierArtifactsLocalFile200JSONResponse) VisitPostEnclavesEnclaveIdentifierArtifactsLocalFileResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -1232,72 +1232,72 @@ func (sh *strictHandler) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx echo.C // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/+w8aW8bOZZ/hahdIN0Nxcr0DAYLf3McJ9FOIguW3d5Fu1FDVT1Z7LDIGh5y1IH/+4JX", - "HSqWXHIsJ9PYL+2O9PhIvvuiviQZL0rOgCmZHH9JSixwAQqE/RcWiixxplKSA1NkSUCYj3OQmSClIpwl", - "x8nlClAARAwXgLhAWpM8GSXEAJRYrZJRYr5KjqM4R4mAf2kiIE+OldAwSmS2ggKbzdSmNMukEoTdJvf3", - "owRYRvEatg4V2SoCuGun7rVKnH3Ct4BqBEitsEJ3hFK0AASfIdMKzE27x/SLU5J/NfLI3RrY96NeyYVK", - "mS4Wfbw0AMgBIMVRtoLsE8JrTCheEErUpudADby7TrTkosAqOU4IU3/9uaYcYQpuQdgzShBrksGDYufh", - "miTkS6RWgDLOFCYs0NR9VBSY5UiuuKZ5k8KIsPidIufYh9j3Dhikes1zAlalloTCVUk5zl/zfGM+MUcF", - "psz/FpoqUmKhxoZKL3OsLN4I8RaEYbGJyJ3fVZacSbfjXGcZSLm11U/jn9qoI4dvEzzgsQyyyyzOU84Y", - "ZKrLoFfoJTo9n07PTi/ReIxeg1QIlksjXVbEllzcYZETdnvD/oJeoul52gCftUFQTiReUKsNwHSRHP+a", - "eOhklNRLk986JBmFI84dN+WJuHW2TvAShPKMyep7/KeAZXKc/Me4to1jf+NxuK6hgt+IL363n3Q2uvBs", - "aJC3BeskNHKUIk+xPyRRUMgIf6rdsRB4k1izqMSm5ISpRy1ep2vsrX6eE8NDTGetY/Uhqe9ECmOSnPJE", - "4KXCSssBFHaEOZo7+D5St6Gi8je/PJ/Nzt4gJ2EXV9PpZPoO3bCf0Ut0Nf3H9Px62hAoD52MEg+ZjJIA", - "FZOrN1jh05Vmnz6CwkFZ26zsoUXsRmefITt1NipIaPtCBgB5iGTUEV/7+d6s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AJ1xoVy1fLsL9O086gOjmh8/OpRlPNRai2hiu7lmRNbXYBtkRPFCqocb", + "198HGqLr/tRJbzBtiKVYqvrykNBsvwA5TPFvECDHvqjwlJ7Fox/7C1hySN1/+9bWEXL3tBSU7kqC05hw", + "K7R5hzTDrPV9LdsL7N5D3dNxtAfL77xbcABjqcQ3/lLfjLwfEKA0hOneI+5a+1qCeCHRAlaYLr9OHP53", + "8lwxSeNu6KE8bs8N82cvasbPih7CPzhk8hur1NxT8R0nzPGrpv92mnF//38BAAD//3dHn34BVAAA", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/api/openapi/core/api_container_service.yaml b/api/openapi/core/api_container_service.yaml index df4dab0485..b99680bc65 100644 --- a/api/openapi/core/api_container_service.yaml +++ b/api/openapi/core/api_container_service.yaml @@ -192,8 +192,8 @@ paths: content: application/json: schema: - type: array - items: + type: object + additionalProperties: $ref: "#/components/schemas/UploadFilesArtifactResponse" /enclaves/{enclave_identifier}/artifacts/remote-file: diff --git a/engine/server/engine/server/engine_enclave_manager_service.go b/engine/server/engine/server/engine_enclave_manager_service.go index 3c93af1823..66d98fc808 100644 --- a/engine/server/engine/server/engine_enclave_manager_service.go +++ b/engine/server/engine/server/engine_enclave_manager_service.go @@ -11,6 +11,7 @@ import ( "github.com/kurtosis-tech/kurtosis/engine/server/engine/enclave_manager" "github.com/kurtosis-tech/kurtosis/engine/server/engine/types" "github.com/kurtosis-tech/kurtosis/engine/server/engine/utils" + "github.com/kurtosis-tech/kurtosis/grpc-file-transfer/golang/grpc_file_streaming" "github.com/kurtosis-tech/stacktrace" "github.com/sirupsen/logrus" "google.golang.org/grpc" @@ -99,45 +100,42 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierArtifactsLocalFile(c apiContainerClient := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) logrus.Infof("Uploading file artifact to enclave %s", enclave_identifier) - buf := make([]byte, 1024) - hasher := sha1.New() - uploaded_artifacts := []api.UploadFilesArtifactResponse{} + uploaded_artifacts := map[string]api.UploadFilesArtifactResponse{} for { - uploadStreamingCall, err := apiContainerClient.UploadFilesArtifact(ctx) - if err != nil { - logrus.Errorf("Can't start file upload gRPC call with enclave %s, error: %s", enclave_identifier, err) - return nil, stacktrace.NewError("Can't start file upload gRPC call with enclave %s", enclave_identifier) - } + // Get next part (file) from the the multipart POST request part, err := request.Body.NextPart() if err == io.EOF { break } - var n int - previousChunkHash := "" - for { - n, err = part.Read(buf) - if err == io.EOF { - break - } - chunk := kurtosis_core_rpc_api_bindings.StreamedDataChunk{ - Data: buf[:n], - PreviousChunkHash: previousChunkHash, - } - uploadStreamingCall.Send(&chunk) - hasher.Reset() - hasher.Write(chunk.Data) - previousChunkHash = hex.EncodeToString(hasher.Sum(nil)) - } + filename := part.FileName() - artifact_info, closing_err := uploadStreamingCall.CloseAndRecv() - if closing_err != nil { - logrus.Errorf("Failed to close upload gRPC call with enclave %s, error: %s", enclave_identifier, closing_err) - return nil, closing_err + client, err := apiContainerClient.UploadFilesArtifact(ctx) + if err != nil { + return nil, stacktrace.Propagate(err, "Can't start file upload gRPC call with enclave %s", enclave_identifier) + } + clientStream := grpc_file_streaming.NewClientStream[kurtosis_core_rpc_api_bindings.StreamedDataChunk, kurtosis_core_rpc_api_bindings.UploadFilesArtifactResponse](client) + + response, err := clientStream.SendData( + filename, + part, + 0, // Length unknown head of time + func(previousChunkHash string, contentChunk []byte) (*kurtosis_core_rpc_api_bindings.StreamedDataChunk, error) { + return &kurtosis_core_rpc_api_bindings.StreamedDataChunk{ + Data: contentChunk, + PreviousChunkHash: previousChunkHash, + Metadata: &kurtosis_core_rpc_api_bindings.DataChunkMetadata{ + Name: filename, + }, + }, nil + }, + ) + + // The response is nil when a file artifact with the same has already been uploaded + // TODO (edgar) Is this the expected behavior? If so, we should be explicit about it. + if response != nil { + artifact_response := toHttpUploadFilesArtifactResponse(response) + uploaded_artifacts[filename] = artifact_response } - - // TODO(edgar) track uploaded artifacts by upload file name - artifact_response := toHttpUploadFilesArtifactResponse(artifact_info) - uploaded_artifacts = append(uploaded_artifacts, artifact_response) } return api.PostEnclavesEnclaveIdentifierArtifactsLocalFile200JSONResponse(uploaded_artifacts), nil From ed4b83c86d2c568ee6257522e7b8d5dda22be99b Mon Sep 17 00:00:00 2001 From: lostbean Date: Thu, 16 Nov 2023 09:22:24 -0300 Subject: [PATCH 23/95] Pass remote upload to APIC --- .../api_container_server.gen.go | 47 ++++++++++--------- .../api_container_types.gen.go | 4 +- api/openapi/core/api_container_service.yaml | 3 ++ .../server/engine_enclave_manager_service.go | 45 ++++-------------- 4 files changed, 37 insertions(+), 62 deletions(-) diff --git a/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go b/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go index 550f6eef98..e438c10f4a 100644 --- a/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go +++ b/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go @@ -1275,29 +1275,30 @@ var swaggerSpec = []string{ "3iMc1rbTrK1gT0Te2mxE5tQk3Wc1TfW6H5kkMl16vU8hKP5ARG2DuR8ld1iY6HsoimsPvlNbtvf5J7X6", "65rgNlK/kr3RcgGtTtJbwQsfHcbrMsMqAsafy90HMrgWmSvi9ZxWXUhOtQLkIJGBbOZd7qmbqCqH85L4", "cvjAQHgXA/o7dw/H920GjGyVTUubODIkYAkCWGYyNaJCYXGplRawB93XsGiRHj+QZEHRNSyQBUYntVAO", - "I1ktIqXtq4sPSHEU6lMWVXUeeR95CcAF5NWhrth6HQgyMMgBbS81HANrj7SwYZ18DQJTurXe7uGg3kJ8", - "47TZLt/SPZ5mPSWsCdcyzcybdIVlxEjeY7kK1M4uzn6ZnF/NkR1gCwWu6ODP3tiqNpGhur0kQioHe8Mu", - "GtpoOxB+cvcerQlGRElkiAjnlUJN0ojU50Nww/yRXkmkApZtAm22ykwYyrA0ZluAR3xnTJlxhQRkQNY9", - "B7Q7KuAaai3FbxrqltpZ4Md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qH1b7791O7f25V0sLNgSM0UbbxZKuJCguF7ohaNciQFMvVkZV06Mmgf3o04xVg", + "qlb/jDfClAiutUXSR/y5wZRqlQgrZfyTDFcCiN/d/TUAz6lbsjZs0qUtmzstMQ8wQy7AHthKtMQNEuJ0", + "twAXoO7AmqBb7+gxKcd9I9LfaijMJmaqAjNSaho6hr76aXv7RFGD6swXqF2vcA1COgR/MevlJTBckuQ4", + "+evRq6NXiVMXu9hxwDX+0r2Qcz8ODsfC3kLEcj8QqVB3WzS0Gdu3AfEkT47t+U0/l/+tWyknjVHNS06/", + "xnfKGmQcuUV0/9vWHYufX73aul/ROK40/l26PKm+bLFrcx545qv/hsZSU+TvnSTuPshQEYztmYCXoeNd", + "cqn6tjeJ8HaY4g9MV/u0WQSab6SCoiOqGZcDZPXBkPPWnd99IqGF6zi9pzBbN3bGW9d17r9S7n1XK3bp", + "w67YI27oT60V7shBrRbRE3VAqQxnCZrXrxqReUdjqjNSd7DYT330AO25sGQfUH2exNz7862YLPszrva1", + "tPsDOqidCnkI/fPBgBx/6V7Iu3+MRma83PRoI25GME+rj+GgfqfN/yTqOXpwVOQ240GVemf1576dhB9a", + "Z4dVYw6ivV8iN57ve4Mdf0S+usQKzB8J276H9IjQJ/zn2TUvduf7oDHUoIsGzyftcdgCe8UezkrJHZvk", + "IE/0SEUI8/9ZFaJbw3tC6Yf9qVe6F77WYDIwk7oRzhBecO3SGvB3ztCNfvXq57+jVXXxDFWY9xHzvB70", + "fWc6j7hvdwCpjf3N79Bqjic9EkQlje376/tlN0E8p/W033F4Grs7/8x7d9+t+kPoQl+E6c16fyP8noK9", + "Uaf2U6WjqFFH9Z/C+JcG+4WJ8N2WCvZlC7b/CxIHdh3fTB/G/q59v7dwzXpw2cctWQOrvj7iTxjicDyz", + "Tkwe50U6+tX4QMCfK6fY/j5CRNxbX0h4PhcV+2LCs6ljaGnI8ZfGR3jux61v9vTq6mvKs0++9l2rq62a", + "d3olVQdkVN0uIyZVEVzfrhB2o96Bqlb3NCpd3Q2dcaFctXy7C/TtPOoDo5qfRTqUZTzUWotoYru5ZkTW", + "12AbZETxQqqHG9dfDhqi6/48Sm8wbYilWKr6WpHQbL8AOUzxbxAgx7618JSexaMf+6tZckjdf/s+1xFy", + "N7gUlO6ygtOYcF+0ebs0w6z15S3bC+zeUN3TcbQHy++8W3AAY6nEN/5S35m8HxCgNITp3iPuWvtagngh", + "0QJWmC6/Thz+d/JcMUnj1uihPG7P3fNnL2rGT5Eewj84ZPIbq9TcU/EdJ8zxS6j/dppxf/9/AQAA//+q", + "fiy0G1QAAA==", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/api/golang/core/kurtosis_core_http_api_bindings/api_container_types.gen.go b/api/golang/core/kurtosis_core_http_api_bindings/api_container_types.gen.go index 7404443cd4..9f3a95a0ca 100644 --- a/api/golang/core/kurtosis_core_http_api_bindings/api_container_types.gen.go +++ b/api/golang/core/kurtosis_core_http_api_bindings/api_container_types.gen.go @@ -412,10 +412,10 @@ type StoreFilesArtifactFromServiceResponse struct { // StoreWebFilesArtifactArgs Store Web Files Artifact type StoreWebFilesArtifactArgs struct { // Name The name of the files artifact - Name *string `json:"name,omitempty"` + Name string `json:"name"` // Url URL to download the artifact from - Url *string `json:"url,omitempty"` + Url string `json:"url"` } // StreamedDataChunk Streamed Data Chunk diff --git a/api/openapi/core/api_container_service.yaml b/api/openapi/core/api_container_service.yaml index b99680bc65..ec89ea5baf 100644 --- a/api/openapi/core/api_container_service.yaml +++ b/api/openapi/core/api_container_service.yaml @@ -754,6 +754,9 @@ components: name: type: string description: The name of the files artifact + required: + - url + - name description: |- Store Web Files Artifact diff --git a/engine/server/engine/server/engine_enclave_manager_service.go b/engine/server/engine/server/engine_enclave_manager_service.go index 66d98fc808..055819d391 100644 --- a/engine/server/engine/server/engine_enclave_manager_service.go +++ b/engine/server/engine/server/engine_enclave_manager_service.go @@ -2,11 +2,8 @@ package server import ( "context" - "crypto/sha1" - "encoding/hex" "fmt" "io" - "net/http" "github.com/kurtosis-tech/kurtosis/engine/server/engine/enclave_manager" "github.com/kurtosis-tech/kurtosis/engine/server/engine/types" @@ -147,46 +144,20 @@ func (manager *enclaveRuntime) PutEnclavesEnclaveIdentifierArtifactsRemoteFile(c apiContainerClient := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) logrus.Infof("Uploading file artifact to enclave %s", enclave_identifier) - uploadStreamingCall, err := apiContainerClient.UploadFilesArtifact(ctx) + storeWebFilesArtifactArgs := kurtosis_core_rpc_api_bindings.StoreWebFilesArtifactArgs{ + Url: request.Body.Url, + Name: request.Body.Name, + } + stored_artifact, err := apiContainerClient.StoreWebFilesArtifact(ctx, &storeWebFilesArtifactArgs) if err != nil { logrus.Errorf("Can't start file upload gRPC call with enclave %s, error: %s", enclave_identifier, err) return nil, stacktrace.NewError("Can't start file upload gRPC call with enclave %s", enclave_identifier) } - remoteFile, err := http.Get(*request.Body.Url) - if err != nil { - logrus.Errorf("Failed to retrieve remote file %s, error: %s", *request.Body.Url, err) - return nil, err + artifact_response := api.UploadFilesArtifactResponse{ + Uuid: &stored_artifact.Uuid, + Name: &request.Body.Name, } - - buf := make([]byte, 1024) - var n int - hasher := sha1.New() - previousChunkHash := "" - - for { - n, err = remoteFile.Body.Read(buf) - if err == io.EOF { - break - } - chunk := kurtosis_core_rpc_api_bindings.StreamedDataChunk{ - Data: buf[:n], - PreviousChunkHash: previousChunkHash, - } - uploadStreamingCall.Send(&chunk) - hasher.Reset() - hasher.Write(chunk.Data) - previousChunkHash = hex.EncodeToString(hasher.Sum(nil)) - } - - artifact_info, closing_err := uploadStreamingCall.CloseAndRecv() - if closing_err != nil { - logrus.Errorf("Failed to close upload gRPC call with enclave %s, error: %s", enclave_identifier, closing_err) - return nil, closing_err - } - - artifact_response := toHttpUploadFilesArtifactResponse(artifact_info) - return api.PutEnclavesEnclaveIdentifierArtifactsRemoteFile200JSONResponse(artifact_response), nil } From 162add5625bd06282b6740a86e1fe813d64f3ea8 Mon Sep 17 00:00:00 2001 From: lostbean Date: Thu, 16 Nov 2023 09:56:33 -0300 Subject: [PATCH 24/95] add API to store service file --- .../api_container_server.gen.go | 135 +++++++++--------- .../api_container_types.gen.go | 10 +- api/openapi/core/api_container_service.yaml | 12 +- .../server/engine_enclave_manager_service.go | 22 ++- 4 files changed, 94 insertions(+), 85 deletions(-) diff --git a/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go b/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go index e438c10f4a..d2ad355c21 100644 --- a/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go +++ b/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go @@ -505,7 +505,7 @@ type PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierResponseObjec VisitPutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierResponse(w http.ResponseWriter) error } -type PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier200JSONResponse StoreFilesArtifactFromServiceResponse +type PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier200JSONResponse UploadFilesArtifactResponse func (response PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier200JSONResponse) VisitPutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -1232,73 +1232,72 @@ func (sh *strictHandler) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx echo.C // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/+w8a3PbOJJ/BcW7qsxMKVZ2dmvryt8cx0l0m8gqyx7f1XiKC5EtCxMQ4OIhR5Pyf7/C", - "iw8RlCnHcrJT9yWKyUaj0S/0A+CXJONFyRkwJZPjL0mJBS5AgbB/YaHIEmcqJTkwRZYEhHmcg8wEKRXh", - "LDlOLleAAiBiuADEBdKa5MkoIQagxGqVjBLzKjmO4hwlAv6liYA8OVZCwyiR2QoKbCZTm9IMk0oQdpvc", -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K3bp", - "w67YI27oT60V7shBrRbRE3VAqQxnCZrXrxqReUdjqjNSd7DYT330AO25sGQfUH2exNz7862YLPszrva1", - "tPsDOqidCnkI/fPBgBx/6V7Iu3+MRma83PRoI25GME+rj+GgfqfN/yTqOXpwVOQ240GVemf1576dhB9a", - "Z4dVYw6ivV8iN57ve4Mdf0S+usQKzB8J276H9IjQJ/zn2TUvduf7oDHUoIsGzyftcdgCe8UezkrJHZvk", - "IE/0SEUI8/9ZFaJbw3tC6Yf9qVe6F77WYDIwk7oRzhBecO3SGvB3ztCNfvXq57+jVXXxDFWY9xHzvB70", - "fWc6j7hvdwCpjf3N79Bqjic9EkQlje376/tlN0E8p/W033F4Grs7/8x7d9+t+kPoQl+E6c16fyP8noK9", - "Uaf2U6WjqFFH9Z/C+JcG+4WJ8N2WCvZlC7b/CxIHdh3fTB/G/q59v7dwzXpw2cctWQOrvj7iTxjicDyz", - "Tkwe50U6+tX4QMCfK6fY/j5CRNxbX0h4PhcV+2LCs6ljaGnI8ZfGR3jux61v9vTq6mvKs0++9l2rq62a", - "d3olVQdkVN0uIyZVEVzfrhB2o96Bqlb3NCpd3Q2dcaFctXy7C/TtPOoDo5qfRTqUZTzUWotoYru5ZkTW", - "12AbZETxQqqHG9dfDhqi6/48Sm8wbYilWKr6WpHQbL8AOUzxbxAgx7618JSexaMf+6tZckjdf/s+1xFy", - "N7gUlO6ygtOYcF+0ebs0w6z15S3bC+zeUN3TcbQHy++8W3AAY6nEN/5S35m8HxCgNITp3iPuWvtagngh", - "0QJWmC6/Thz+d/JcMUnj1uihPG7P3fNnL2rGT5Eewj84ZPIbq9TcU/EdJ8zxS6j/dppxf/9/AQAA//+q", - "fiy0G1QAAA==", + "H4sIAAAAAAAC/+w8+2/bOJr/CqE7oDMDN+7OLhaH/Jamaevb1jHiZHKHyUBLS59jTilSy4dTT+H//cCX", + "HhblyGmSdgf3S91IHz+S3/tB6kuS8aLkDJiSyfGXpMQCF6BA2L+wUGSJM5WSHJgiSwLC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m5eDGXB2HbfX4becsml6nNv", + "EuHdMMUfTa78tNkEmm+kgqLDqhmXA3j1wSznrTsp+0hMCxdfes87tu7GjHcuxmy/ku99lxj2ycO+2COu", + "6I8tFa65X4tF9OwaUCpD17550akRmXckpjqNdAeLw8RHD5CeC7vsJxSfR1H3/nwrxsv+jKt9AWz7hAZq", + "r0A+hfz5YECOv3Svvm0fIpEZLzc90oibEczjymM4Et9pqD+KeI7uHRW5N/ikQr23zrJtJ+F/Opn9ErlR", + "vO0NcfwR9OqSKDB/5Gr3ns8DAp7wn2eXt9id6ieNnAYd5H8+bo+D4+tleziLJPe4xkH254GCEOb/swpE", + "t3L3iNwPXqmXuxe+wmDyLpOwEc4QXnDtkhnwd7rQjX716ue/o1V1sQtVmA9h87we9H3nNw+4z/YEXBv7", + "m9WhlRtPdSSIihu798MPy2kCe07rab/joDR2N/2ZPXbfrfWnkIW+uNKr9eFK+D2FeKNOxadKQlGjeuo/", + "NfEvDfYLDuG7KBXsyxZs/xcanth0fDN5GPu77P3WwjXDweUct2QNrPq6hz/Bh8PxxzodeZgV6chX4wL+", + "nyuT2P3+QITdO18geD4TFfsiwbOJY2hkyPGXxkdutuPWN3F6ZfU15dknX/GuxdXWyjsdkqrvMapubxGT", + "qgiub1cIu1HvQFW7exyRru5ezrhQrka+2/v5dhb1nlHNzw49lWbc11CLSGK7pWZY1tdWG6RE8fKphxvX", + "X+YZIuv+vEdvMG0WS7FU9bUdodlhAXKY4t8gQI59y+AxLYtHP/ZXn+SQav/ufakj5G5IKSjdZQAnMeE+", + "ZvP2ZoZZ68tWtgPYvQF6oOFoD5bfeY/gCZSlYt/4S30ncTsgQGkw071H3DX0tQTxQqIFrDBdfh07/O/k", + "uWKSxq3Mp7K4PXe7nzkx6jul+RT2wSGT31ik5n4V33HCHL/k+W8nGdvt/wUAAP//MI3ke3tTAAA=", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/api/golang/core/kurtosis_core_http_api_bindings/api_container_types.gen.go b/api/golang/core/kurtosis_core_http_api_bindings/api_container_types.gen.go index 9f3a95a0ca..2b47776df2 100644 --- a/api/golang/core/kurtosis_core_http_api_bindings/api_container_types.gen.go +++ b/api/golang/core/kurtosis_core_http_api_bindings/api_container_types.gen.go @@ -397,16 +397,10 @@ type StarlarkWarning struct { // StoreFilesArtifactFromServiceArgs defines model for StoreFilesArtifactFromServiceArgs. type StoreFilesArtifactFromServiceArgs struct { // Name The name of the files artifact - Name *string `json:"name,omitempty"` + Name string `json:"name"` // SourcePath The absolute source path where the source files will be copied from - SourcePath *string `json:"source_path,omitempty"` -} - -// StoreFilesArtifactFromServiceResponse defines model for StoreFilesArtifactFromServiceResponse. -type StoreFilesArtifactFromServiceResponse struct { - // Uuid UUID of the files artifact, for use when referencing it in the future - Uuid *string `json:"uuid,omitempty"` + SourcePath string `json:"source_path"` } // StoreWebFilesArtifactArgs Store Web Files Artifact diff --git a/api/openapi/core/api_container_service.yaml b/api/openapi/core/api_container_service.yaml index ec89ea5baf..299a853a5e 100644 --- a/api/openapi/core/api_container_service.yaml +++ b/api/openapi/core/api_container_service.yaml @@ -234,7 +234,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/StoreFilesArtifactFromServiceResponse" + $ref: "#/components/schemas/UploadFilesArtifactResponse" /enclaves/{enclave_identifier}/services/connection: post: @@ -769,13 +769,9 @@ components: name: type: string description: The name of the files artifact - - StoreFilesArtifactFromServiceResponse: - type: object - properties: - uuid: - type: string - description: UUID of the files artifact, for use when referencing it in the future + required: + - source_path + - name FilesArtifactNameAndUuid: type: object diff --git a/engine/server/engine/server/engine_enclave_manager_service.go b/engine/server/engine/server/engine_enclave_manager_service.go index 055819d391..94901b845a 100644 --- a/engine/server/engine/server/engine_enclave_manager_service.go +++ b/engine/server/engine/server/engine_enclave_manager_service.go @@ -163,7 +163,27 @@ func (manager *enclaveRuntime) PutEnclavesEnclaveIdentifierArtifactsRemoteFile(c // (PUT /enclaves/{enclave_identifier}/artifacts/services/{service_identifier}) func (manager *enclaveRuntime) PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier(ctx context.Context, request api.PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierRequestObject) (api.PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierResponseObject, error) { - return nil, Error{} + enclave_identifier := request.EnclaveIdentifier + service_identifier := request.ServiceIdentifier + apiContainerClient := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) + logrus.Infof("Storing file artifact from service %s on enclave %s", service_identifier, enclave_identifier) + + storeWebFilesArtifactArgs := kurtosis_core_rpc_api_bindings.StoreFilesArtifactFromServiceArgs{ + ServiceIdentifier: service_identifier, + SourcePath: request.Body.SourcePath, + Name: request.Body.Name, + } + stored_artifact, err := apiContainerClient.StoreFilesArtifactFromService(ctx, &storeWebFilesArtifactArgs) + if err != nil { + logrus.Errorf("Can't start file upload gRPC call with enclave %s, error: %s", enclave_identifier, err) + return nil, stacktrace.NewError("Can't start file upload gRPC call with enclave %s", enclave_identifier) + } + + artifact_response := api.UploadFilesArtifactResponse{ + Uuid: &stored_artifact.Uuid, + Name: &request.Body.Name, + } + return api.PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier200JSONResponse(artifact_response), nil } // (GET /enclaves/{enclave_identifier}/artifacts/{artifact_identifier}) From ee259cd668efbb671763048718cd247b9f435874 Mon Sep 17 00:00:00 2001 From: lostbean Date: Thu, 16 Nov 2023 10:10:09 -0300 Subject: [PATCH 25/95] Normalize artifact references --- .../api_container_server.gen.go | 138 +++++++++--------- .../api_container_types.gen.go | 23 +-- api/openapi/core/api_container_service.yaml | 24 +-- .../server/engine_enclave_manager_service.go | 39 ++--- 4 files changed, 99 insertions(+), 125 deletions(-) diff --git a/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go b/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go index d2ad355c21..b2786a8af1 100644 --- a/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go +++ b/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go @@ -468,7 +468,7 @@ type PostEnclavesEnclaveIdentifierArtifactsLocalFileResponseObject interface { VisitPostEnclavesEnclaveIdentifierArtifactsLocalFileResponse(w http.ResponseWriter) error } -type PostEnclavesEnclaveIdentifierArtifactsLocalFile200JSONResponse map[string]UploadFilesArtifactResponse +type PostEnclavesEnclaveIdentifierArtifactsLocalFile200JSONResponse map[string]FileArtifactReference func (response PostEnclavesEnclaveIdentifierArtifactsLocalFile200JSONResponse) VisitPostEnclavesEnclaveIdentifierArtifactsLocalFileResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -486,7 +486,7 @@ type PutEnclavesEnclaveIdentifierArtifactsRemoteFileResponseObject interface { VisitPutEnclavesEnclaveIdentifierArtifactsRemoteFileResponse(w http.ResponseWriter) error } -type PutEnclavesEnclaveIdentifierArtifactsRemoteFile200JSONResponse UploadFilesArtifactResponse +type PutEnclavesEnclaveIdentifierArtifactsRemoteFile200JSONResponse FileArtifactReference func (response PutEnclavesEnclaveIdentifierArtifactsRemoteFile200JSONResponse) VisitPutEnclavesEnclaveIdentifierArtifactsRemoteFileResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -505,7 +505,7 @@ type PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierResponseObjec VisitPutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierResponse(w http.ResponseWriter) error } -type PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier200JSONResponse UploadFilesArtifactResponse +type PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier200JSONResponse FileArtifactReference func (response PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier200JSONResponse) VisitPutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -1232,72 +1232,72 @@ func (sh *strictHandler) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx echo.C // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/+w8+2/bOJr/CqE7oDMDN+7OLhaH/Jamaevb1jHiZHKHyUBLS59jTilSy4dTT+H//cCX", - "HhblyGmSdgf3S91IHz+S3/tB6kuS8aLkDJiSyfGXpMQCF6BA2L+wUGSJM5WSHJgiSwLCPM5BZoKUinCW", - "HCeXK0ABEDFcAOICaU3yZJQQA1BitUpGiXmVHEdxjhIB/9JEQJ4cK6FhlMhsBQU2k6lNaYZJJQi7Tbbb", - "UQIso3gNO4uKTBUB3DdTd1slzj7hW0A1AqRWWKE7QilaAILPkGkFZqfdZfrBKcm/Gnlkbw3sh1Gv5EKl", - "TBeLPl4aAOQAkOIoW0H2CeE1JhQvCCVq07OgBt59K1pyUWCVHCeEqb/+XFOOMAW3IOwaJYg1yeBesfNw", - "TRLyJVIrQBlnChMWaOoeFQVmOZIrrmnepDAiLL6nyDoOIfbWAYNUr3lOwKrUklC4KinH+Wueb8wTs1Rg", - "yvy30FSREgs1NlR6mWNl8UaItyAMi01E7vyssuRMuhnnOstAyp2pfhr/1EYdWXyb4AGPZZAdZnGecsYg", - "U10GvUIv0en5dHp2eonGY/QapEKwXBrpsiK25OIOi5yw2xv2F/QSTc/TBvisDYJyIvGCWm0Apovk+NfE", - "QyejpB6a/NYhySgsce64KU/ErbN1gpcglGdMVu/jPwUsk+PkP8a1bRz7HY/Ddg0V/ER88bt90pnowrOh", - "Qd4WrJPQyFKKPMV+kURBISP8qWbHQuBNYs2iEpuSE6YeNHidrrG3+nlODA8xnbWW1Yek3hMpjElyyhOB", - "lworLQdQ2BHmaO7g+0jdhorK3/zyfDY7e4OchF1cTaeT6Tt0w35GL9HV9B/T8+tpQ6A8dDJKPGQySgJU", - "TK7eYIVPV5p9+ggKB2Vts7KHFrEdnX2G7NTZqCCh7Q0ZAOQhklFHfO3zg1l/z0qaItyeED4TlWY8h0FG", - "fZRQfptyrUodMRUnUuoCJLq6fPvyvxCwjBudj3rV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zvs5ou+hEUYPqzJeCXVduDUI6BH8x++UlMFyS5Dj569Gr", - "o1eJExe72XHANf7SvfqyHQeDY2FvIaK5H4hUqOsWzdqM7tvQc5Inx/akpJ/L/9ZNi5PGqOZ1ol/jnrIG", - "GUfu62x/27nN8POrVzs3GRoHg8a/S5eR1Nca9jnngaer+u9CLDVF/oZH4m5eDGXB2HbfX4becsml6nNv", - "EuHdMMUfTa78tNkEmm+kgqLDqhmXA3j1wSznrTsp+0hMCxdfes87tu7GjHcuxmy/ku99lxj2ycO+2COu", - "6I8tFa65X4tF9OwaUCpD17550akRmXckpjqNdAeLw8RHD5CeC7vsJxSfR1H3/nwrxsv+jKt9AWz7hAZq", - "r0A+hfz5YECOv3Svvm0fIpEZLzc90oibEczjymM4Et9pqD+KeI7uHRW5N/ikQr23zrJtJ+F/Opn9ErlR", - "vO0NcfwR9OqSKDB/5Gr3ns8DAp7wn2eXt9id6ieNnAYd5H8+bo+D4+tleziLJPe4xkH254GCEOb/swpE", - "t3L3iNwPXqmXuxe+wmDyLpOwEc4QXnDtkhnwd7rQjX716ue/o1V1sQtVmA9h87we9H3nNw+4z/YEXBv7", - "m9WhlRtPdSSIihu798MPy2kCe07rab/joDR2N/2ZPXbfrfWnkIW+uNKr9eFK+D2FeKNOxadKQlGjeuo/", - "NfEvDfYLDuG7KBXsyxZs/xcanth0fDN5GPu77P3WwjXDweUct2QNrPq6hz/Bh8PxxzodeZgV6chX4wL+", - "nyuT2P3+QITdO18geD4TFfsiwbOJY2hkyPGXxkdutuPWN3F6ZfU15dknX/GuxdXWyjsdkqrvMapubxGT", - "qgiub1cIu1HvQFW7exyRru5ezrhQrka+2/v5dhb1nlHNzw49lWbc11CLSGK7pWZY1tdWG6RE8fKphxvX", - "X+YZIuv+vEdvMG0WS7FU9bUdodlhAXKY4t8gQI59y+AxLYtHP/ZXn+SQav/ufakj5G5IKSjdZQAnMeE+", - "ZvP2ZoZZ68tWtgPYvQF6oOFoD5bfeY/gCZSlYt/4S30nc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dR8rHmg42ovld94ReAJlqdg3/lI/n9sOCFAazHTfI+6epWkJ", + "4oVEC1hhuvw6dvi/k+eKSRoPCJ/K4vY8Q37mxKhvoPAp7INDJr+xSM39Kb7jhDn+HvHfTjK22/8LAAD/", + "/xRWXuh4UgAA", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/api/golang/core/kurtosis_core_http_api_bindings/api_container_types.gen.go b/api/golang/core/kurtosis_core_http_api_bindings/api_container_types.gen.go index 2b47776df2..1eb96bb2ef 100644 --- a/api/golang/core/kurtosis_core_http_api_bindings/api_container_types.gen.go +++ b/api/golang/core/kurtosis_core_http_api_bindings/api_container_types.gen.go @@ -119,13 +119,13 @@ type FileArtifactContentsFileDescription struct { TextPreview *string `json:"text_preview,omitempty"` } -// FilesArtifactNameAndUuid defines model for FilesArtifactNameAndUuid. -type FilesArtifactNameAndUuid struct { - // FileName A string representing the name of the file - FileName *string `json:"fileName,omitempty"` +// FileArtifactReference Files Artifact identifier +type FileArtifactReference struct { + // Name UUID of the files artifact, for use when referencing it in the future + Name *string `json:"name,omitempty"` - // FileUuid A string representing the uuid of the file - FileUuid *string `json:"fileUuid,omitempty"` + // Uuid UUID of the files artifact, for use when referencing it in the future + Uuid *string `json:"uuid,omitempty"` } // GetExistingAndHistoricalServiceIdentifiersResponse defines model for GetExistingAndHistoricalServiceIdentifiersResponse. @@ -167,7 +167,7 @@ type KurtosisFeatureFlag string // ListFilesArtifactNamesAndUuidsResponse defines model for ListFilesArtifactNamesAndUuidsResponse. type ListFilesArtifactNamesAndUuidsResponse struct { - FileNamesAndUuids *[]FilesArtifactNameAndUuid `json:"file_names_and_uuids,omitempty"` + FileNamesAndUuids *[]FileArtifactReference `json:"file_names_and_uuids,omitempty"` } // Port Shared Objects (Used By Multiple Endpoints) @@ -424,15 +424,6 @@ type StreamedDataChunk struct { PreviousChunkHash *string `json:"previous_chunk_hash,omitempty"` } -// UploadFilesArtifactResponse Upload Files Artifact -type UploadFilesArtifactResponse struct { - // Name UUID of the files artifact, for use when referencing it in the future - Name *string `json:"name,omitempty"` - - // Uuid UUID of the files artifact, for use when referencing it in the future - Uuid *string `json:"uuid,omitempty"` -} - // WaitForEndpointAvailabilityArgs Wait For HTTP Endpoint Availability type WaitForEndpointAvailabilityArgs struct { // BodyText If the endpoint returns this value, the service will be marked as available (e.g. Hello World). diff --git a/api/openapi/core/api_container_service.yaml b/api/openapi/core/api_container_service.yaml index 299a853a5e..0a8aa0d0fd 100644 --- a/api/openapi/core/api_container_service.yaml +++ b/api/openapi/core/api_container_service.yaml @@ -194,7 +194,7 @@ paths: schema: type: object additionalProperties: - $ref: "#/components/schemas/UploadFilesArtifactResponse" + $ref: "#/components/schemas/FileArtifactReference" /enclaves/{enclave_identifier}/artifacts/remote-file: put: @@ -214,7 +214,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/UploadFilesArtifactResponse" + $ref: "#/components/schemas/FileArtifactReference" /enclaves/{enclave_identifier}/artifacts/services/{service_identifier}: put: @@ -234,7 +234,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/UploadFilesArtifactResponse" + $ref: "#/components/schemas/FileArtifactReference" /enclaves/{enclave_identifier}/services/connection: post: @@ -724,7 +724,7 @@ components: name: type: string - UploadFilesArtifactResponse: + FileArtifactReference: type: object properties: uuid: @@ -734,7 +734,7 @@ components: type: string description: UUID of the files artifact, for use when referencing it in the future description: |- - Upload Files Artifact + Files Artifact identifier DownloadFilesArtifactArgs: type: object @@ -773,29 +773,19 @@ components: - source_path - name - FilesArtifactNameAndUuid: - type: object - properties: - fileName: - type: string - description: A string representing the name of the file - fileUuid: - type: string - description: A string representing the uuid of the file - ListFilesArtifactNamesAndUuidsResponse: type: object properties: file_names_and_uuids: type: array items: - $ref: "#/components/schemas/FilesArtifactNameAndUuid" + $ref: "#/components/schemas/FileArtifactReference" InspectFilesArtifactContentsRequest: type: object properties: file_names_and_uuid: - $ref: "#/components/schemas/FilesArtifactNameAndUuid" + $ref: "#/components/schemas/FileArtifactReference" InspectFilesArtifactContentsResponse: type: object diff --git a/engine/server/engine/server/engine_enclave_manager_service.go b/engine/server/engine/server/engine_enclave_manager_service.go index 94901b845a..c4d443eb66 100644 --- a/engine/server/engine/server/engine_enclave_manager_service.go +++ b/engine/server/engine/server/engine_enclave_manager_service.go @@ -20,24 +20,6 @@ import ( "github.com/kurtosis-tech/kurtosis/api/golang/core/kurtosis_core_rpc_api_bindings" ) -func toHttpFilesArtifactNameAndUuid(rpc_artifact *kurtosis_core_rpc_api_bindings.FilesArtifactNameAndUuid) kurtosis_core_http_api_bindings.FilesArtifactNameAndUuid { - return kurtosis_core_http_api_bindings.FilesArtifactNameAndUuid{ - FileName: &rpc_artifact.FileName, - FileUuid: &rpc_artifact.FileUuid, - } -} - -func toHttpIdentifierArtifacts(rpc_artifact_list *kurtosis_core_rpc_api_bindings.ListFilesArtifactNamesAndUuidsResponse) []kurtosis_core_http_api_bindings.FilesArtifactNameAndUuid { - return utils.MapList(rpc_artifact_list.FileNamesAndUuids, toHttpFilesArtifactNameAndUuid) -} - -func toHttpUploadFilesArtifactResponse(rpc_upload_artifact *kurtosis_core_rpc_api_bindings.UploadFilesArtifactResponse) api.UploadFilesArtifactResponse { - return api.UploadFilesArtifactResponse{ - Name: &rpc_upload_artifact.Name, - Uuid: &rpc_upload_artifact.Uuid, - } -} - type enclaveRuntime struct { enclaveManager *enclave_manager.EnclaveManager remoteApiContainerClient map[string]kurtosis_core_rpc_api_bindings.ApiContainerServiceClient @@ -83,7 +65,15 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierArtifacts(ctx context return nil, err } - http_artifacts := toHttpIdentifierArtifacts(artifacts) + http_artifacts := utils.MapList( + artifacts.FileNamesAndUuids, + func(x *kurtosis_core_rpc_api_bindings.FilesArtifactNameAndUuid) kurtosis_core_http_api_bindings.FileArtifactReference { + return kurtosis_core_http_api_bindings.FileArtifactReference{ + Name: &x.FileName, + Uuid: &x.FileUuid, + } + }) + result := api.ListFilesArtifactNamesAndUuidsResponse{ FileNamesAndUuids: &http_artifacts, } @@ -97,7 +87,7 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierArtifactsLocalFile(c apiContainerClient := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) logrus.Infof("Uploading file artifact to enclave %s", enclave_identifier) - uploaded_artifacts := map[string]api.UploadFilesArtifactResponse{} + uploaded_artifacts := map[string]api.FileArtifactReference{} for { // Get next part (file) from the the multipart POST request part, err := request.Body.NextPart() @@ -130,7 +120,10 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierArtifactsLocalFile(c // The response is nil when a file artifact with the same has already been uploaded // TODO (edgar) Is this the expected behavior? If so, we should be explicit about it. if response != nil { - artifact_response := toHttpUploadFilesArtifactResponse(response) + artifact_response := api.FileArtifactReference{ + Name: &response.Name, + Uuid: &response.Uuid, + } uploaded_artifacts[filename] = artifact_response } } @@ -154,7 +147,7 @@ func (manager *enclaveRuntime) PutEnclavesEnclaveIdentifierArtifactsRemoteFile(c return nil, stacktrace.NewError("Can't start file upload gRPC call with enclave %s", enclave_identifier) } - artifact_response := api.UploadFilesArtifactResponse{ + artifact_response := api.FileArtifactReference{ Uuid: &stored_artifact.Uuid, Name: &request.Body.Name, } @@ -179,7 +172,7 @@ func (manager *enclaveRuntime) PutEnclavesEnclaveIdentifierArtifactsServicesServ return nil, stacktrace.NewError("Can't start file upload gRPC call with enclave %s", enclave_identifier) } - artifact_response := api.UploadFilesArtifactResponse{ + artifact_response := api.FileArtifactReference{ Uuid: &stored_artifact.Uuid, Name: &request.Body.Name, } From 7c375789747d27d2a3ccf04c8771952fb28eb7f9 Mon Sep 17 00:00:00 2001 From: lostbean Date: Thu, 16 Nov 2023 10:36:46 -0300 Subject: [PATCH 26/95] add artifact inspection --- .../server/engine_enclave_manager_service.go | 34 ++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/engine/server/engine/server/engine_enclave_manager_service.go b/engine/server/engine/server/engine_enclave_manager_service.go index c4d443eb66..4064f5af33 100644 --- a/engine/server/engine/server/engine_enclave_manager_service.go +++ b/engine/server/engine/server/engine_enclave_manager_service.go @@ -181,7 +181,39 @@ func (manager *enclaveRuntime) PutEnclavesEnclaveIdentifierArtifactsServicesServ // (GET /enclaves/{enclave_identifier}/artifacts/{artifact_identifier}) func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier(ctx context.Context, request api.GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierRequestObject) (api.GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierResponseObject, error) { - return nil, Error{} + enclave_identifier := request.EnclaveIdentifier + artifact_identifier := request.ArtifactIdentifier + apiContainerClient := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) + logrus.Infof("Inspecting file artifact %s on enclave %s", artifact_identifier, enclave_identifier) + + inspectFilesArtifactContentsRequest := kurtosis_core_rpc_api_bindings.InspectFilesArtifactContentsRequest{ + FileNamesAndUuid: &kurtosis_core_rpc_api_bindings.FilesArtifactNameAndUuid{ + FileName: artifact_identifier, + FileUuid: artifact_identifier, + }, + } + stored_artifact, err := apiContainerClient.InspectFilesArtifactContents(ctx, &inspectFilesArtifactContentsRequest) + if err != nil { + logrus.Errorf("Can't inspect artifact using gRPC call with enclave %s, error: %s", enclave_identifier, err) + return nil, stacktrace.NewError("Can't inspect artifact using gRPC call with enclave %s", enclave_identifier) + } + + artifact_content_list := utils.MapList( + stored_artifact.FileDescriptions, + func(x *kurtosis_core_rpc_api_bindings.FileArtifactContentsFileDescription) api.FileArtifactContentsFileDescription { + size := int64(x.Size) + return api.FileArtifactContentsFileDescription{ + Path: &x.Path, + Size: &size, + TextPreview: x.TextPreview, + } + }) + + artifact_response := api.InspectFilesArtifactContentsResponse{ + FileDescriptions: &artifact_content_list, + } + + return api.GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier200JSONResponse(artifact_response), nil } // (GET /enclaves/{enclave_identifier}/artifacts/{artifact_identifier}/download) From 52761306e1b5e96ab2a12aeda22ac4c1158df0a3 Mon Sep 17 00:00:00 2001 From: lostbean Date: Thu, 16 Nov 2023 11:50:25 -0300 Subject: [PATCH 27/95] add artifact download --- .../api_container_server.gen.go | 147 +++++++++--------- .../api_container_types.gen.go | 17 -- api/openapi/core/api_container_service.yaml | 29 +--- .../server/engine_enclave_manager_service.go | 33 +++- 4 files changed, 112 insertions(+), 114 deletions(-) diff --git a/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go b/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go index b2786a8af1..901603aff8 100644 --- a/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go +++ b/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go @@ -541,13 +541,23 @@ type GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownloadResponseObje VisitGetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownloadResponse(w http.ResponseWriter) error } -type GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownload200JSONResponse StreamedDataChunk +type GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownload200ApplicationoctetStreamResponse struct { + Body io.Reader + ContentLength int64 +} -func (response GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownload200JSONResponse) VisitGetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownloadResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "application/json") +func (response GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownload200ApplicationoctetStreamResponse) VisitGetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownloadResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/octet-stream") + if response.ContentLength != 0 { + w.Header().Set("Content-Length", fmt.Sprint(response.ContentLength)) + } w.WriteHeader(200) - return json.NewEncoder(w).Encode(response) + if closer, ok := response.Body.(io.ReadCloser); ok { + defer closer.Close() + } + _, err := io.Copy(w, response.Body) + return err } type GetEnclavesEnclaveIdentifierServicesRequestObject struct { @@ -1232,72 +1242,69 @@ func (sh *strictHandler) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx echo.C // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/+w8aW8bOZZ/hahdIN0Nxcr0DAYLf3McJ9FOIguW3d5Fu1FDVT1Z7LDIGh5y1IH++4JX", - "HSqWXHJsJ9PYL+2O9PhIvvuiviQZL0rOgCmZHH9JSixwAQqE/RcWiixxplKSA1NkSUCYj3OQmSClIpwl", - "x8nlClAARAwXgLhAWpM8GSXEAJRYrZJRYr5KjqM4R4mAf2kiIE+OldAwSmS2ggKbzdSmNMukEoTdJtvt", - "KAGWUbyGnUNFtooA7tupe60SZ5/wLaAaAVIrrNAdoRQtAMFnyLQCc9PuMf3ilORfjTxytwb2w6hXcqFS", - "potFHy8NAHIASHGUrSD7hPAaE4oXhBK16TlQA+++Ey25KLBKjhPC1F9/rilHmIJbEPaMEsSaZHCv2Hm4", - "Jgn5EqkVoIwzhQkLNHUfFQVmOZIrrmnepDAiLH6nyDkOIfbWAYNUr3lOwKrUklC4KinH+Wueb8wn5qjA", - "lPnfQlNFSizU2FDpZY6VxRsh3oIwLDYRufO7ypIz6Xac6ywDKXe2+mn8Uxt15PBtggc8lkF2mcV5yhmD", - "THUZ9Aq9RKfn0+nZ6SUaj9FrkArBcmmky4rYkos7LHLCbm/YX9BLND1PG+CzNgjKicQLarUBmC6S418T", - "D52Mknpp8luHJKNwxLnjpjwRt87WCV6CUJ4xWX2P/xSwTI6T/xjXtnHsbzwO1zVU8Bvxxe/2k85GF54N", - "DfK2YJ2ERo5S5Cn2hyQKChnhT7U7FgJvEmsWldiUnDD1oMXrdI291c9zYniI6ax1rD4k9Z1IYUySU54I", - "vFRYaTmAwo4wR3MH30fqNlRU/uaX57PZ2RvkJOziajqdTN+hG/Yzeomupv+Ynl9PGwLloZNR4iGTURKg", - "YnL1Bit8utLs00dQOChrm5U9tIjd6OwzZKfORgUJb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xrLPK1m7ygFFK0EDwz3x9PRieI8gTTCr/iAg7RaIGIeiER3vraoCYSZYVU12yFbwDNARgqTO0AUlRI", + "HeHYUsIWDVAuCLfFG0ypBmvTyd7DVDC6r+Fubq7xjqj3xRzNYcGFL51oZTE8lpX0zzmngI1BTSgv0pgw", + "qTBLwoWwt7DABVVSHxayXK1DKmfxFBLEw3GkYh2Lgu1ebdgavMqzhDE2fU6dD44z54R3YW57bZO4JTig", + "25bDaw3pI2krcxlPCwr1LEenPSEqhgOttl21ZWC7h16D/BojbCi1NEc3mBagpfw6EgW7jkJb7he0dfP2", + "p60s7kEhXfumZfJpr6nzOP0fvbrjrvrDa0PJQ60715Fd5RIVwblJE7FXxhBNBGRcBQ70RyEVwmhB8VJf", + "mbBUe0uwbDBMNvakptqESZKCt1FB0Q+GnVuevQRBVQMBpVhhk5tp7N78lDamIRbXbLYismZzsaYXSdF/", + "T8/Hnc44FHrULN3UnLDTIfy/afoGpumbGJDHtRBPm4YFKgDtWhILdT6IDiISTikYQmnq6YB/YGnpOh9C", + "gVZ7157rU+cZ1zjhdg3W1Fxx4f7qzS4k/oAdaEzPp3GJe5HuorGrg7T6AFVdvleduko48mJOSRKTPMZp", + "GuhZTcz3aDRB+nuQEr3khdIW+KW5hWtYotsVCKjfSzNXAE5WeE7hmo3PZ6dH6Mo3CrVh8ZXEagF7oZAo", + "GCNsOWh8lZJUf5fCgjAtGGvTj5ED5Ez1HCefgaUo5WCQyCI3DRsB+o8OJ+09q700IQddWZgjitmjT/Zj", + "kqyvEcVckBusoJsNWoxqPOBblKtcouPHrk32upZXkn6NECemvgvyTDo2fTT9+naNGR8BnArBRagm6ZKX", + "GDzATj54bH6ZRau9IlMgcgEK749t1FhbojRhzwPQ/Vquc6iCjAnfpE0g/XGcgZQuXe7D9PJeIauqTcSD", + "EUoliiTcFsJiWWR+eKVfib2N9liEe6KGStrimkCxdoaWwNW+7y4/ExnLzyTPoZ7J1AK5nEvid9jzBhO/", + "tC8l9ZVDxNx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"LwqK3Hx6ZOfG+7JgaPqGB74rlnMZYIdtTUuEt/jhxzR958G4MzRdSwVZi1UTLnvw6oM+jkbzeEzzY/ud", + "Y1qNyf7h1lj/5iv53jWC/TXzOnUVf2x5sA3JSiCC8zZAqfSdxvoDjVo00ZKVcoLiFub7CU7RQ24uzLGf", + "UHAeRdG7Y8QQL7ujxObDlc0TmqYOUXwKyXMBgBx+aT/W2TxEFhOerzvkENejlseVRD+922r/PYpgDu5d", + "FXjp9KTivDMr3DRThn+QtH4JvH7cdAY0bk62fNAGzI2GbL9weEB44//n2SUt9P7zSeOkXtPGz8ftoXd2", + "nWz3MxNyhzvsZXkeKAh+/7+PQPBEgTqQSgDO9n4w+Vh8956ok68XrpKg8yt9KsIZwnNe2KQF3JMTdF28", + "evX6Z7Qq352gEvM+DJ5Wi77vPOYBz22egGtD9/7TN5vCKY0EUXJj+xXrfrmLZ89Jte13HIKGXtA+s5fu", + "elv7FLLQFUs6td5fCb+nsG7QquyUySaqVUndg/g/CzBm0/96Qwl70IDtfkf+xKbjm8nD0L3f7bYWtl0H", + "Ns9Ykhtg5W8QuBkj7Ae0qhTkYVakJV+1R8f/rOxh+811gN1br66fz0SFXmE/mzj6hoUcfqn9FMdm2Pjl", + "jk5ZfUN58tlVtitxNTXxViek7G8MyvclRCcpghfLFcJ21TtQ5e0eR6TL12ETLpSthW/3eL6dRb1nVf3H", + "UZ5KM+5rnAUksdk60yzrap/1UqJwmdTBDavfD+kj664j3RlM68NSLFX1sEAUbL8A2W/xNwiQQ0+tH9Oy", + "OPRD9zhD9qnqb7/oOET2DYeC3I4rW4nxL8bq78sSzBq/v2M6fe03ansajuZi+Z33Ap5AWUr2Db9Ur6Y2", + "PQKUGjPt94jb10iFBPFCojmsMF18HTvc39FzxSS1d2NPZXE7Xp8+c2LUNUf2FPbBIpPfWKSm7hTfccIc", + "fob2t5OMzeb/AgAA//+gRQ5oIVAAAA==", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/api/golang/core/kurtosis_core_http_api_bindings/api_container_types.gen.go b/api/golang/core/kurtosis_core_http_api_bindings/api_container_types.gen.go index 1eb96bb2ef..69eeb23e5d 100644 --- a/api/golang/core/kurtosis_core_http_api_bindings/api_container_types.gen.go +++ b/api/golang/core/kurtosis_core_http_api_bindings/api_container_types.gen.go @@ -89,11 +89,6 @@ type Container struct { // 2 - UNKNOWN type ContainerStatus string -// DataChunkMetadata defines model for DataChunkMetadata. -type DataChunkMetadata struct { - Name *string `json:"name,omitempty"` -} - // ExecCommandArgs Exec Command type ExecCommandArgs struct { CommandArgs *[]string `json:"command_args,omitempty"` @@ -412,18 +407,6 @@ type StoreWebFilesArtifactArgs struct { Url string `json:"url"` } -// StreamedDataChunk Streamed Data Chunk -type StreamedDataChunk struct { - // Data Chunk of the overall files artifact bytes - Data *[]byte `json:"data,omitempty"` - Metadata *DataChunkMetadata `json:"metadata,omitempty"` - - // PreviousChunkHash Hash of the PREVIOUS chunk, or empty string is this is the first chunk - // Referencing the previous chunk via its hash allows Kurtosis to validate - // the consistency of the data in case some chunk were not received - PreviousChunkHash *string `json:"previous_chunk_hash,omitempty"` -} - // WaitForEndpointAvailabilityArgs Wait For HTTP Endpoint Availability type WaitForEndpointAvailabilityArgs struct { // BodyText If the endpoint returns this value, the service will be marked as available (e.g. Hello World). diff --git a/api/openapi/core/api_container_service.yaml b/api/openapi/core/api_container_service.yaml index 0a8aa0d0fd..4f74f20e64 100644 --- a/api/openapi/core/api_container_service.yaml +++ b/api/openapi/core/api_container_service.yaml @@ -175,9 +175,10 @@ paths: "200": description: Successful request content: - application/json: + application/octet-stream: schema: - $ref: "#/components/schemas/StreamedDataChunk" + type: string + format: binary /enclaves/{enclave_identifier}/artifacts/local-file: post: @@ -700,30 +701,6 @@ components: description: If the endpoint returns this value, the service will be marked as available (e.g. Hello World). description: Wait For HTTP Endpoint Availability - StreamedDataChunk: - type: object - properties: - data: - type: string - format: byte - description: Chunk of the overall files artifact bytes - previous_chunk_hash: - type: string - description: |- - Hash of the PREVIOUS chunk, or empty string is this is the first chunk - Referencing the previous chunk via its hash allows Kurtosis to validate - the consistency of the data in case some chunk were not received - metadata: - $ref: "#/components/schemas/DataChunkMetadata" - description: |- - Streamed Data Chunk - - DataChunkMetadata: - type: object - properties: - name: - type: string - FileArtifactReference: type: object properties: diff --git a/engine/server/engine/server/engine_enclave_manager_service.go b/engine/server/engine/server/engine_enclave_manager_service.go index 4064f5af33..320666cb47 100644 --- a/engine/server/engine/server/engine_enclave_manager_service.go +++ b/engine/server/engine/server/engine_enclave_manager_service.go @@ -1,6 +1,7 @@ package server import ( + "bytes" "context" "fmt" "io" @@ -218,7 +219,37 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierArtifactsArtifactIden // (GET /enclaves/{enclave_identifier}/artifacts/{artifact_identifier}/download) func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownload(ctx context.Context, request api.GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownloadRequestObject) (api.GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownloadResponseObject, error) { - return nil, Error{} + enclave_identifier := request.EnclaveIdentifier + artifact_identifier := request.ArtifactIdentifier + apiContainerClient := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) + logrus.Infof("Downloading file artifact %s from enclave %s", artifact_identifier, enclave_identifier) + + downloadFilesArtifactArgs := kurtosis_core_rpc_api_bindings.DownloadFilesArtifactArgs{ + Identifier: artifact_identifier, + } + client, err := apiContainerClient.DownloadFilesArtifact(ctx, &downloadFilesArtifactArgs) + if err != nil { + logrus.Errorf("Can't start file download gRPC call with enclave %s, error: %s", enclave_identifier, err) + return nil, stacktrace.NewError("Can't start file download gRPC call with enclave %s", enclave_identifier) + } + + clientStream := grpc_file_streaming.NewClientStream[kurtosis_core_rpc_api_bindings.StreamedDataChunk, []byte](client) + fileContent, err := clientStream.ReceiveData( + artifact_identifier, + func(dataChunk *kurtosis_core_rpc_api_bindings.StreamedDataChunk) ([]byte, string, error) { + return dataChunk.Data, dataChunk.PreviousChunkHash, nil + }, + ) + if err != nil { + return nil, stacktrace.Propagate(err, "An error occurred downloading files artifact '%v'", artifact_identifier) + } + + response := api.GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownload200ApplicationoctetStreamResponse{ + Body: bytes.NewReader(fileContent), + ContentLength: int64(len(fileContent)), + } + + return api.GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownload200ApplicationoctetStreamResponse(response), nil } // (GET /enclaves/{enclave_identifier}/services) From abb46b8c7732ce7f60ade1ab3007e803b559fe07 Mon Sep 17 00:00:00 2001 From: lostbean Date: Thu, 16 Nov 2023 13:07:30 -0300 Subject: [PATCH 28/95] Use streaming to download artifacts --- .../server/engine_enclave_manager_service.go | 10 ++---- .../grpc_file_streaming/client_stream.go | 32 ++++++++++++++++++- 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/engine/server/engine/server/engine_enclave_manager_service.go b/engine/server/engine/server/engine_enclave_manager_service.go index 320666cb47..0ede865e82 100644 --- a/engine/server/engine/server/engine_enclave_manager_service.go +++ b/engine/server/engine/server/engine_enclave_manager_service.go @@ -1,7 +1,6 @@ package server import ( - "bytes" "context" "fmt" "io" @@ -234,19 +233,16 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierArtifactsArtifactIden } clientStream := grpc_file_streaming.NewClientStream[kurtosis_core_rpc_api_bindings.StreamedDataChunk, []byte](client) - fileContent, err := clientStream.ReceiveData( + pipeReader := clientStream.PipeReader( artifact_identifier, func(dataChunk *kurtosis_core_rpc_api_bindings.StreamedDataChunk) ([]byte, string, error) { return dataChunk.Data, dataChunk.PreviousChunkHash, nil }, ) - if err != nil { - return nil, stacktrace.Propagate(err, "An error occurred downloading files artifact '%v'", artifact_identifier) - } response := api.GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownload200ApplicationoctetStreamResponse{ - Body: bytes.NewReader(fileContent), - ContentLength: int64(len(fileContent)), + Body: pipeReader, + ContentLength: 0, // No file size is provided since we are streaming it directly } return api.GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownload200ApplicationoctetStreamResponse(response), nil diff --git a/grpc-file-transfer/golang/grpc_file_streaming/client_stream.go b/grpc-file-transfer/golang/grpc_file_streaming/client_stream.go index 356bf7935f..b4e886fab3 100644 --- a/grpc-file-transfer/golang/grpc_file_streaming/client_stream.go +++ b/grpc-file-transfer/golang/grpc_file_streaming/client_stream.go @@ -1,9 +1,10 @@ package grpc_file_streaming import ( + "io" + "github.com/kurtosis-tech/stacktrace" "google.golang.org/grpc" - "io" ) // ClientStream is a wrapper around a GRPC ClientStream object to be able to send and receive payloads bypassing the @@ -74,3 +75,32 @@ func (clientStream *ClientStream[DataChunkMessageType, ServerResponseType]) Rece } return assembledContent, nil } + +// PipeReader pipe out data via streaming expecting the content to be received in fixed-sized chunks from +// the server until the server returns io.EOF. The pipe is filled up asynchronously and the data can be consumed +// as the client Stream send them. This allows a low (and constant) memory footprint. If the transfer fails the +// PipeReader will be closed with the error. +func (clientStream *ClientStream[DataChunkMessageType, ServerResponseType]) PipeReader( + contentNameForLogging string, + grpcMsgExtractor func(dataChunk *DataChunkMessageType) ([]byte, string, error), +) *io.PipeReader { + // Use pipe and gorotines to stream over data from the client directly to the pipe consumer + pipeReader, pipeWriter := io.Pipe() + go func() { + defer pipeWriter.Close() + // Read all the chunks and assemble them into a single byte array assembledContent + _, err := readMessagesFromStream[DataChunkMessageType]( + contentNameForLogging, + clientStream.grpcStream.RecvMsg, + func(chunk *DataChunkMessageType) ([]byte, string, error) { + data, hash, extErr := grpcMsgExtractor(chunk) + pipeWriter.Write(data) + return []byte{}, hash, extErr + }) + if err != nil { + pipeReader.CloseWithError(stacktrace.Propagate(err, "An error occurred sending the data chunks for '%s' through the stream", contentNameForLogging)) + } + }() + + return pipeReader +} From 24a2023636b64fb8eeea9cf0d1836ff38f3a4bf9 Mon Sep 17 00:00:00 2001 From: lostbean Date: Thu, 16 Nov 2023 14:20:56 -0300 Subject: [PATCH 29/95] list services --- .../server/engine_enclave_manager_service.go | 23 ++++++++++++++++++- engine/server/engine/utils/map.go | 10 ++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 engine/server/engine/utils/map.go diff --git a/engine/server/engine/server/engine_enclave_manager_service.go b/engine/server/engine/server/engine_enclave_manager_service.go index 0ede865e82..3f77d1fc16 100644 --- a/engine/server/engine/server/engine_enclave_manager_service.go +++ b/engine/server/engine/server/engine_enclave_manager_service.go @@ -250,7 +250,28 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierArtifactsArtifactIden // (GET /enclaves/{enclave_identifier}/services) func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierServices(ctx context.Context, request api.GetEnclavesEnclaveIdentifierServicesRequestObject) (api.GetEnclavesEnclaveIdentifierServicesResponseObject, error) { - return nil, Error{} + enclave_identifier := request.EnclaveIdentifier + apiContainerClient := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) + logrus.Infof("Listing services from enclave %s", enclave_identifier) + + services, err := apiContainerClient.GetExistingAndHistoricalServiceIdentifiers(ctx, &emptypb.Empty{}) + if err != nil { + logrus.Errorf("Can't list services using gRPC call with enclave %s, error: %s", enclave_identifier, err) + return nil, stacktrace.NewError("Can't list services using gRPC call with enclave %s", enclave_identifier) + } + + mapped_services := utils.MapList(services.AllIdentifiers, func(service *kurtosis_core_rpc_api_bindings.ServiceIdentifiers) api.ServiceIdentifiers { + return api.ServiceIdentifiers{ + ServiceUuid: &service.ServiceUuid, + ShortenedUuid: &service.ShortenedUuid, + Name: &service.Name, + } + }) + response := api.GetExistingAndHistoricalServiceIdentifiersResponse{ + AllIdentifiers: &mapped_services, + } + + return api.GetEnclavesEnclaveIdentifierServices200JSONResponse(response), nil } // (POST /enclaves/{enclave_identifier}/services/connection) diff --git a/engine/server/engine/utils/map.go b/engine/server/engine/utils/map.go new file mode 100644 index 0000000000..ecb4db52ff --- /dev/null +++ b/engine/server/engine/utils/map.go @@ -0,0 +1,10 @@ +package utils + +func MapMapValues[T, U any, K comparable](data map[K]T, f func(T) U) map[K]U { + mappedMap := make(map[K]U, len(data)) + for key, value := range data { + mappedMap[key] = f(value) + } + + return mappedMap +} From 3331498a49ffe65e5ae2bf5533f8681e39879ed5 Mon Sep 17 00:00:00 2001 From: lostbean Date: Thu, 16 Nov 2023 14:30:00 -0300 Subject: [PATCH 30/95] add Connect command --- .../server/engine_enclave_manager_service.go | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/engine/server/engine/server/engine_enclave_manager_service.go b/engine/server/engine/server/engine_enclave_manager_service.go index 3f77d1fc16..b0a6738381 100644 --- a/engine/server/engine/server/engine_enclave_manager_service.go +++ b/engine/server/engine/server/engine_enclave_manager_service.go @@ -276,7 +276,20 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierServices(ctx context. // (POST /enclaves/{enclave_identifier}/services/connection) func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierServicesConnection(ctx context.Context, request api.PostEnclavesEnclaveIdentifierServicesConnectionRequestObject) (api.PostEnclavesEnclaveIdentifierServicesConnectionResponseObject, error) { - return nil, Error{} + enclave_identifier := request.EnclaveIdentifier + apiContainerClient := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) + logrus.Infof("Listing services from enclave %s", enclave_identifier) + + connectServicesArgs := kurtosis_core_rpc_api_bindings.ConnectServicesArgs{ + Connect: toGrpcConnect(*request.Body.Connect), + } + _, err := apiContainerClient.ConnectServices(ctx, &connectServicesArgs) + if err != nil { + logrus.Errorf("Can't list services using gRPC call with enclave %s, error: %s", enclave_identifier, err) + return nil, stacktrace.NewError("Can't list services using gRPC call with enclave %s", enclave_identifier) + } + + return api.PostEnclavesEnclaveIdentifierServicesConnection200JSONResponse{}, nil } // (GET /enclaves/{enclave_identifier}/services/{service_identifier}) @@ -341,3 +354,14 @@ func (manager enclaveRuntime) GetGrpcClientForEnclaveUUID(enclave_uuid string) k } return client } + +func toGrpcConnect(conn api.Connect) kurtosis_core_rpc_api_bindings.Connect { + switch conn { + case api.CONNECT: + return kurtosis_core_rpc_api_bindings.Connect_CONNECT + case api.NOCONNECT: + return kurtosis_core_rpc_api_bindings.Connect_NO_CONNECT + default: + panic(fmt.Sprintf("Missing convertion of Connect Enum value: %s", conn)) + } +} From 976bdd5899133c876b9cfdac9982752aad879187 Mon Sep 17 00:00:00 2001 From: lostbean Date: Thu, 16 Nov 2023 16:05:10 -0300 Subject: [PATCH 31/95] Get service info --- .../api_container_server.gen.go | 229 +++++++++++------- .../api_container_types.gen.go | 30 +-- api/openapi/core/api_container_service.yaml | 50 ++-- .../server/engine_enclave_manager_service.go | 129 +++++++++- engine/server/engine/utils/map.go | 9 + engine/server/engine/utils/pointer.go | 8 + 6 files changed, 326 insertions(+), 129 deletions(-) create mode 100644 engine/server/engine/utils/pointer.go diff --git a/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go b/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go index 901603aff8..dabac0d55a 100644 --- a/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go +++ b/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go @@ -44,13 +44,16 @@ type ServerInterface interface { GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownload(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, artifactIdentifier ArtifactIdentifier) error // (GET /enclaves/{enclave_identifier}/services) - GetEnclavesEnclaveIdentifierServices(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error + GetEnclavesEnclaveIdentifierServices(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, params GetEnclavesEnclaveIdentifierServicesParams) error // (POST /enclaves/{enclave_identifier}/services/connection) PostEnclavesEnclaveIdentifierServicesConnection(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error + // (GET /enclaves/{enclave_identifier}/services/history) + GetEnclavesEnclaveIdentifierServicesHistory(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error + // (GET /enclaves/{enclave_identifier}/services/{service_identifier}) - GetEnclavesEnclaveIdentifierServicesServiceIdentifier(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, serviceIdentifier ServiceIdentifier, params GetEnclavesEnclaveIdentifierServicesServiceIdentifierParams) error + GetEnclavesEnclaveIdentifierServicesServiceIdentifier(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, serviceIdentifier ServiceIdentifier) error // (POST /enclaves/{enclave_identifier}/services/{service_identifier}/command) PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, serviceIdentifier ServiceIdentifier) error @@ -207,8 +210,17 @@ func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierServices(ctx echo.C return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter enclave_identifier: %s", err)) } + // Parameter object where we will unmarshal all parameters from the context + var params GetEnclavesEnclaveIdentifierServicesParams + // ------------- Optional query parameter "services" ------------- + + err = runtime.BindQueryParameter("form", true, false, "services", ctx.QueryParams(), ¶ms.Services) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter services: %s", err)) + } + // Invoke the callback with all the unmarshalled arguments - err = w.Handler.GetEnclavesEnclaveIdentifierServices(ctx, enclaveIdentifier) + err = w.Handler.GetEnclavesEnclaveIdentifierServices(ctx, enclaveIdentifier, params) return err } @@ -228,6 +240,22 @@ func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierServicesConnection return err } +// GetEnclavesEnclaveIdentifierServicesHistory converts echo context to params. +func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierServicesHistory(ctx echo.Context) error { + var err error + // ------------- Path parameter "enclave_identifier" ------------- + var enclaveIdentifier EnclaveIdentifier + + err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter enclave_identifier: %s", err)) + } + + // Invoke the callback with all the unmarshalled arguments + err = w.Handler.GetEnclavesEnclaveIdentifierServicesHistory(ctx, enclaveIdentifier) + return err +} + // GetEnclavesEnclaveIdentifierServicesServiceIdentifier converts echo context to params. func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierServicesServiceIdentifier(ctx echo.Context) error { var err error @@ -247,17 +275,8 @@ func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierServicesServiceIden return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter service_identifier: %s", err)) } - // Parameter object where we will unmarshal all parameters from the context - var params GetEnclavesEnclaveIdentifierServicesServiceIdentifierParams - // ------------- Optional query parameter "additional-properties" ------------- - - err = runtime.BindQueryParameter("form", true, false, "additional-properties", ctx.QueryParams(), ¶ms.AdditionalProperties) - if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter additional-properties: %s", err)) - } - // Invoke the callback with all the unmarshalled arguments - err = w.Handler.GetEnclavesEnclaveIdentifierServicesServiceIdentifier(ctx, enclaveIdentifier, serviceIdentifier, params) + err = w.Handler.GetEnclavesEnclaveIdentifierServicesServiceIdentifier(ctx, enclaveIdentifier, serviceIdentifier) return err } @@ -425,6 +444,7 @@ func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL router.GET(baseURL+"/enclaves/:enclave_identifier/artifacts/:artifact_identifier/download", wrapper.GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownload) router.GET(baseURL+"/enclaves/:enclave_identifier/services", wrapper.GetEnclavesEnclaveIdentifierServices) router.POST(baseURL+"/enclaves/:enclave_identifier/services/connection", wrapper.PostEnclavesEnclaveIdentifierServicesConnection) + router.GET(baseURL+"/enclaves/:enclave_identifier/services/history", wrapper.GetEnclavesEnclaveIdentifierServicesHistory) router.GET(baseURL+"/enclaves/:enclave_identifier/services/:service_identifier", wrapper.GetEnclavesEnclaveIdentifierServicesServiceIdentifier) router.POST(baseURL+"/enclaves/:enclave_identifier/services/:service_identifier/command", wrapper.PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand) router.POST(baseURL+"/enclaves/:enclave_identifier/services/:service_identifier/endpoints/:port_number/availability", wrapper.PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability) @@ -562,13 +582,14 @@ func (response GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownload20 type GetEnclavesEnclaveIdentifierServicesRequestObject struct { EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` + Params GetEnclavesEnclaveIdentifierServicesParams } type GetEnclavesEnclaveIdentifierServicesResponseObject interface { VisitGetEnclavesEnclaveIdentifierServicesResponse(w http.ResponseWriter) error } -type GetEnclavesEnclaveIdentifierServices200JSONResponse GetExistingAndHistoricalServiceIdentifiersResponse +type GetEnclavesEnclaveIdentifierServices200JSONResponse map[string]ServiceInfo func (response GetEnclavesEnclaveIdentifierServices200JSONResponse) VisitGetEnclavesEnclaveIdentifierServicesResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -595,17 +616,33 @@ func (response PostEnclavesEnclaveIdentifierServicesConnection200JSONResponse) V return json.NewEncoder(w).Encode(response) } +type GetEnclavesEnclaveIdentifierServicesHistoryRequestObject struct { + EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` +} + +type GetEnclavesEnclaveIdentifierServicesHistoryResponseObject interface { + VisitGetEnclavesEnclaveIdentifierServicesHistoryResponse(w http.ResponseWriter) error +} + +type GetEnclavesEnclaveIdentifierServicesHistory200JSONResponse []ServiceIdentifiers + +func (response GetEnclavesEnclaveIdentifierServicesHistory200JSONResponse) VisitGetEnclavesEnclaveIdentifierServicesHistoryResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + type GetEnclavesEnclaveIdentifierServicesServiceIdentifierRequestObject struct { EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` ServiceIdentifier ServiceIdentifier `json:"service_identifier"` - Params GetEnclavesEnclaveIdentifierServicesServiceIdentifierParams } type GetEnclavesEnclaveIdentifierServicesServiceIdentifierResponseObject interface { VisitGetEnclavesEnclaveIdentifierServicesServiceIdentifierResponse(w http.ResponseWriter) error } -type GetEnclavesEnclaveIdentifierServicesServiceIdentifier200JSONResponse GetServicesResponse +type GetEnclavesEnclaveIdentifierServicesServiceIdentifier200JSONResponse ServiceInfo func (response GetEnclavesEnclaveIdentifierServicesServiceIdentifier200JSONResponse) VisitGetEnclavesEnclaveIdentifierServicesServiceIdentifierResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -766,6 +803,9 @@ type StrictServerInterface interface { // (POST /enclaves/{enclave_identifier}/services/connection) PostEnclavesEnclaveIdentifierServicesConnection(ctx context.Context, request PostEnclavesEnclaveIdentifierServicesConnectionRequestObject) (PostEnclavesEnclaveIdentifierServicesConnectionResponseObject, error) + // (GET /enclaves/{enclave_identifier}/services/history) + GetEnclavesEnclaveIdentifierServicesHistory(ctx context.Context, request GetEnclavesEnclaveIdentifierServicesHistoryRequestObject) (GetEnclavesEnclaveIdentifierServicesHistoryResponseObject, error) + // (GET /enclaves/{enclave_identifier}/services/{service_identifier}) GetEnclavesEnclaveIdentifierServicesServiceIdentifier(ctx context.Context, request GetEnclavesEnclaveIdentifierServicesServiceIdentifierRequestObject) (GetEnclavesEnclaveIdentifierServicesServiceIdentifierResponseObject, error) @@ -973,10 +1013,11 @@ func (sh *strictHandler) GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier } // GetEnclavesEnclaveIdentifierServices operation middleware -func (sh *strictHandler) GetEnclavesEnclaveIdentifierServices(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error { +func (sh *strictHandler) GetEnclavesEnclaveIdentifierServices(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, params GetEnclavesEnclaveIdentifierServicesParams) error { var request GetEnclavesEnclaveIdentifierServicesRequestObject request.EnclaveIdentifier = enclaveIdentifier + request.Params = params handler := func(ctx echo.Context, request interface{}) (interface{}, error) { return sh.ssi.GetEnclavesEnclaveIdentifierServices(ctx.Request().Context(), request.(GetEnclavesEnclaveIdentifierServicesRequestObject)) @@ -1028,13 +1069,37 @@ func (sh *strictHandler) PostEnclavesEnclaveIdentifierServicesConnection(ctx ech return nil } +// GetEnclavesEnclaveIdentifierServicesHistory operation middleware +func (sh *strictHandler) GetEnclavesEnclaveIdentifierServicesHistory(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error { + var request GetEnclavesEnclaveIdentifierServicesHistoryRequestObject + + request.EnclaveIdentifier = enclaveIdentifier + + handler := func(ctx echo.Context, request interface{}) (interface{}, error) { + return sh.ssi.GetEnclavesEnclaveIdentifierServicesHistory(ctx.Request().Context(), request.(GetEnclavesEnclaveIdentifierServicesHistoryRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "GetEnclavesEnclaveIdentifierServicesHistory") + } + + response, err := handler(ctx, request) + + if err != nil { + return err + } else if validResponse, ok := response.(GetEnclavesEnclaveIdentifierServicesHistoryResponseObject); ok { + return validResponse.VisitGetEnclavesEnclaveIdentifierServicesHistoryResponse(ctx.Response()) + } else if response != nil { + return fmt.Errorf("Unexpected response type: %T", response) + } + return nil +} + // GetEnclavesEnclaveIdentifierServicesServiceIdentifier operation middleware -func (sh *strictHandler) GetEnclavesEnclaveIdentifierServicesServiceIdentifier(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, serviceIdentifier ServiceIdentifier, params GetEnclavesEnclaveIdentifierServicesServiceIdentifierParams) error { +func (sh *strictHandler) GetEnclavesEnclaveIdentifierServicesServiceIdentifier(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, serviceIdentifier ServiceIdentifier) error { var request GetEnclavesEnclaveIdentifierServicesServiceIdentifierRequestObject request.EnclaveIdentifier = enclaveIdentifier request.ServiceIdentifier = serviceIdentifier - request.Params = params handler := func(ctx echo.Context, request interface{}) (interface{}, error) { return sh.ssi.GetEnclavesEnclaveIdentifierServicesServiceIdentifier(ctx.Request().Context(), request.(GetEnclavesEnclaveIdentifierServicesServiceIdentifierRequestObject)) @@ -1242,69 +1307,69 @@ func (sh *strictHandler) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx echo.C // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/+w8624bN5evQswukDaQrXz5imLhf45jJ9omsmDJ9S7qYErNHElsOOSU5NhWA737gre5", - "aDjyyLGdtNg/dSMdHpLnfqO+RAnPcs6AKRkdfYlyLHAGCoT5FxaKLHCiYpICU2RBQOiPU5CJILkinEVH", - "0WwFyAMihjNAXKCiIGk0iIgGyLFaRYNIfxUdBXEOIgF/FkRAGh0pUcAgkskKMqw3U+tcL5NKELaMNptB", - "BCyh+Aa2DhXYKgC4a6f2tXKcfMZLQBUCpFZYoVtCKZoDgjtICgX6pu1jusUxSb8aeeBuNez7US/nQsWs", - "yOZdvNQAyAIgxVGyguQzwjeYUDwnlKh1x4FqeHedaMFFhlV0FBGm/v26ohxhCpYgzBkliBuSwL1i5+Dq", - "JOQLpFaAEs4UJszT1H6UZZilSK54QdM6hRFh4TsFzrEPsTcWGKR6w1MCRqUWhMJlTjlO3/B0rT/RRwWm", - "9P9mBVUkx0INNZUOUqwM3gDx5oRhsQ7IndtV5pxJu+O0SBKQcmurl8OXTdSBwzcJ7vEYBpllBucJZwwS", - "1WbQK3SATs7H49OTGRoO0RuQCsFioaXLiNiCi1ssUsKW1+xf6ACNz+Ma+KQJglIi8ZwabQBWZNHRb5GD", - "jgZRtTT61CLJwB9xarkpj8XS2jrBcxDKMSap7vGfAhbRUfQfw8o2Dt2Nh/66mgpuIz7/w3zS2ujCsaFG", - "3gasldDAUbI0xu6QREEmA/wpd8dC4HVkzKIS65wTph60+Ca+wc7qpynRPMR00jhWF5LqTiTTJskqTwBe", - "KqwK2Y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", - "wm1Wmo5SQ/SX0cDblOAWBfNeaGKNe0dyRznTVtqAtI9ytQK1MrWCqixTlQnM4hRxgRhXh9dstEALTCUM", - "NDxrLPK1m7ygFFK0EDwz3x9PRieI8gTTCr/iAg7RaIGIeiER3vraoCYSZYVU12yFbwDNARgqTO0AUlRI", - "HeHYUsIWDVAuCLfFG0ypBmvTyd7DVDC6r+Fubq7xjqj3xRzNYcGFL51oZTE8lpX0zzmngI1BTSgv0pgw", - "qTBLwoWwt7DABVVSHxayXK1DKmfxFBLEw3GkYh2Lgu1ebdgavMqzhDE2fU6dD44z54R3YW57bZO4JTig", - "25bDaw3pI2krcxlPCwr1LEenPSEqhgOttl21ZWC7h16D/BojbCi1NEc3mBagpfw6EgW7jkJb7he0dfP2", - "p60s7kEhXfumZfJpr6nzOP0fvbrjrvrDa0PJQ60715Fd5RIVwblJE7FXxhBNBGRcBQ70RyEVwmhB8VJf", - "mbBUe0uwbDBMNvakptqESZKCt1FB0Q+GnVuevQRBVQMBpVhhk5tp7N78lDamIRbXbLYismZzsaYXSdF/", - "T8/Hnc44FHrULN3UnLDTIfy/afoGpumbGJDHtRBPm4YFKgDtWhILdT6IDiISTikYQmnq6YB/YGnpOh9C", - "gVZ7157rU+cZ1zjhdg3W1Fxx4f7qzS4k/oAdaEzPp3GJe5HuorGrg7T6AFVdvleduko48mJOSRKTPMZp", - "GuhZTcz3aDRB+nuQEr3khdIW+KW5hWtYotsVCKjfSzNXAE5WeE7hmo3PZ6dH6Mo3CrVh8ZXEagF7oZAo", - "GCNsOWh8lZJUf5fCgjAtGGvTj5ED5Ez1HCefgaUo5WCQyCI3DRsB+o8OJ+09q700IQddWZgjitmjT/Zj", - "kqyvEcVckBusoJsNWoxqPOBblKtcouPHrk32upZXkn6NECemvgvyTDo2fTT9+naNGR8BnArBRagm6ZKX", - "GDzATj54bH6ZRau9IlMgcgEK749t1FhbojRhzwPQ/Vquc6iCjAnfpE0g/XGcgZQuXe7D9PJeIauqTcSD", - "EUolii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TR", + "0pXNTMYtzPZTHN1Db84t2U+oOI9i6N0xYkyW3VFi85XH+gldU4cqPoXm+QBADr+2X7asH6KLGS9XHXqI", + "61HL42pieF/Raig+imIO7l0VeRb0pOq8MytcN1OGv5C2fo08FVx3BjR+8nbz+guYHzbZfg7wgPAm/J9n", + "17TYY8knjZN6zS8/n7SH4bLrFHuYwpA7rsNenueBihD2//MoBM8UqFdSCcDF3q8LH0vu4SaqybW/OIL/", + "fyyeb098UeNHAoXm+lqAspMAhj0GyD8W/V2D5VLztaghq+Jp71ddn79DFFyfFnnK2HcTd/hHlqFJFU+F", + "JIiK+1tPRffLeYKiHFfb/sCha+yZ6jPf7l0PWJ9CF5ZEKi5WnZ793NcSa4aH8IxrV7aAOyJt6e1av379", + "5p/IYSMZpqhmh/v7lA+eqh+hoNGvRd+eqms7l8eXXlcG8WBn/sMF809kYg2f+0yCGfq3xt1O13VLwaV5", + "C3IDbPP3EvwsGA4Td1UG+DBn3BJ07YH0Xyt5234fHhH31gvx5/P0sRfjz6aOoV8kh19rfzZkPWz8lZFO", + "XX1LefbFNxYqdbUtiVYjatNeGmweDBGTIwquF0uE3ar3oDanexyV3jz3m3ChXCtiu8X2nVT9/lX1P+Ty", + "VJZxX98yoonNzqURWVf3spcRxavUHm5Y/a2TPrruBwI6IxlDLMVSVS9FhGb7RSdhix+9z9Lxdv4xPYtH", + "P/SvbWSfpsr2E50D5B7lKCjd/LnTmPAEsP5gMMOs8beCbKO1/ehwT8fRXCx/8FbMExjLRnzDr9UzuHWP", + "AKUmTPcdcfe8TEsQLySawRLT+beJw/87eq6YpPYQ8Kk8bsdz4mfOL7vG+J7CPzhk8jur1NRT8QPXHeLv", + "Cv90mrFe/18AAAD//5WIl7PNUAAA", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/api/golang/core/kurtosis_core_http_api_bindings/api_container_types.gen.go b/api/golang/core/kurtosis_core_http_api_bindings/api_container_types.gen.go index 69eeb23e5d..f98b5da912 100644 --- a/api/golang/core/kurtosis_core_http_api_bindings/api_container_types.gen.go +++ b/api/golang/core/kurtosis_core_http_api_bindings/api_container_types.gen.go @@ -123,16 +123,6 @@ type FileArtifactReference struct { Uuid *string `json:"uuid,omitempty"` } -// GetExistingAndHistoricalServiceIdentifiersResponse defines model for GetExistingAndHistoricalServiceIdentifiersResponse. -type GetExistingAndHistoricalServiceIdentifiersResponse struct { - AllIdentifiers *[]ServiceIdentifiers `json:"allIdentifiers,omitempty"` -} - -// GetServicesResponse defines model for GetServicesResponse. -type GetServicesResponse struct { - ServiceInfo *ServiceInfo `json:"service_info,omitempty"` -} - // GetStarlarkRunResponse defines model for GetStarlarkRunResponse. type GetStarlarkRunResponse struct { ExperimentalFeatures *[]KurtosisFeatureFlag `json:"experimental_features,omitempty"` @@ -274,19 +264,15 @@ type ServiceInfo struct { // MaybePublicIpAddr Public IP address *outside* the enclave where the service is reachable // NOTE: Will be empty if the service isn't running, the service didn't define any ports, or the backend doesn't support reporting public service info - MaybePublicIpAddr *string `json:"maybe_public_ip_addr,omitempty"` - - // MaybePublicPorts Shared Objects (Used By Multiple Endpoints) - MaybePublicPorts *Port `json:"maybe_public_ports,omitempty"` + MaybePublicIpAddr *string `json:"maybe_public_ip_addr,omitempty"` + MaybePublicPorts *map[string]Port `json:"maybe_public_ports,omitempty"` // Name Name of the service Name *string `json:"name,omitempty"` // PrivateIpAddr The IP address of the service inside the enclave - PrivateIpAddr *string `json:"private_ip_addr,omitempty"` - - // PrivatePorts Shared Objects (Used By Multiple Endpoints) - PrivatePorts *Port `json:"private_ports,omitempty"` + PrivateIpAddr *string `json:"private_ip_addr,omitempty"` + PrivatePorts *map[string]Port `json:"private_ports,omitempty"` // ServiceStatus 0 - STOPPED // 1 - RUNNING @@ -447,10 +433,10 @@ type ServiceIdentifier = string // PostEnclavesEnclaveIdentifierArtifactsLocalFileMultipartBody defines parameters for PostEnclavesEnclaveIdentifierArtifactsLocalFile. type PostEnclavesEnclaveIdentifierArtifactsLocalFileMultipartBody = openapi_types.File -// GetEnclavesEnclaveIdentifierServicesServiceIdentifierParams defines parameters for GetEnclavesEnclaveIdentifierServicesServiceIdentifier. -type GetEnclavesEnclaveIdentifierServicesServiceIdentifierParams struct { - // AdditionalProperties Additional properties - AdditionalProperties *string `form:"additional-properties,omitempty" json:"additional-properties,omitempty"` +// GetEnclavesEnclaveIdentifierServicesParams defines parameters for GetEnclavesEnclaveIdentifierServices. +type GetEnclavesEnclaveIdentifierServicesParams struct { + // Services Select services to get information + Services *[]string `form:"services,omitempty" json:"services,omitempty"` } // PostEnclavesEnclaveIdentifierStarlarkPackagesMultipartBody defines parameters for PostEnclavesEnclaveIdentifierStarlarkPackages. diff --git a/api/openapi/core/api_container_service.yaml b/api/openapi/core/api_container_service.yaml index 4f74f20e64..14c934185b 100644 --- a/api/openapi/core/api_container_service.yaml +++ b/api/openapi/core/api_container_service.yaml @@ -68,7 +68,20 @@ paths: schema: $ref: "#/components/schemas/StarlarkRunResponseLine" - /enclaves/{enclave_identifier}/services: + /enclaves/{enclave_identifier}/services/{service_identifier}: + get: + parameters: + - $ref: '#/components/parameters/enclave_identifier' + - $ref: '#/components/parameters/service_identifier' + responses: + "200": + description: Successful request + content: + application/json: + schema: + $ref: "#/components/schemas/ServiceInfo" + + /enclaves/{enclave_identifier}/services/history: get: description: Returns information about all existing & historical services parameters: @@ -79,25 +92,30 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/GetExistingAndHistoricalServiceIdentifiersResponse" + type: array + items: + $ref: "#/components/schemas/ServiceIdentifiers" - /enclaves/{enclave_identifier}/services/{service_identifier}: + /enclaves/{enclave_identifier}/services: get: parameters: - $ref: '#/components/parameters/enclave_identifier' - - $ref: '#/components/parameters/service_identifier' - in: query - name: additional-properties + name: services schema: - type: string - description: Additional properties + type: array + items: + type: string + description: Select services to get information responses: "200": description: Successful request content: application/json: schema: - $ref: "#/components/schemas/GetServicesResponse" + type: object + additionalProperties: + $ref: "#/components/schemas/ServiceInfo" /enclaves/{enclave_identifier}/services/{service_identifier}/command: post: @@ -387,14 +405,18 @@ components: type: string description: The IP address of the service inside the enclave private_ports: - $ref: "#/components/schemas/Port" + type: object + additionalProperties: + $ref: "#/components/schemas/Port" maybe_public_ip_addr: type: string description: |- Public IP address *outside* the enclave where the service is reachable NOTE: Will be empty if the service isn't running, the service didn't define any ports, or the backend doesn't support reporting public service info maybe_public_ports: - $ref: "#/components/schemas/Port" + type: object + additionalProperties: + $ref: "#/components/schemas/Port" name: type: string description: Name of the service @@ -647,14 +669,6 @@ components: description: The shortened uuid of the service description: An service identifier is a collection of uuid, name and shortened uuid - GetExistingAndHistoricalServiceIdentifiersResponse: - type: object - properties: - allIdentifiers: - type: array - items: - $ref: "#/components/schemas/ServiceIdentifiers" - ExecCommandArgs: type: object properties: diff --git a/engine/server/engine/server/engine_enclave_manager_service.go b/engine/server/engine/server/engine_enclave_manager_service.go index b0a6738381..34f4d50ccc 100644 --- a/engine/server/engine/server/engine_enclave_manager_service.go +++ b/engine/server/engine/server/engine_enclave_manager_service.go @@ -250,6 +250,26 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierArtifactsArtifactIden // (GET /enclaves/{enclave_identifier}/services) func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierServices(ctx context.Context, request api.GetEnclavesEnclaveIdentifierServicesRequestObject) (api.GetEnclavesEnclaveIdentifierServicesResponseObject, error) { + enclave_identifier := request.EnclaveIdentifier + apiContainerClient := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) + logrus.Infof("Getting info about services enclave %s", enclave_identifier) + + service_ids := utils.DerefWith(request.Params.Services, []string{}) + getServicesArgs := kurtosis_core_rpc_api_bindings.GetServicesArgs{ + ServiceIdentifiers: utils.NewMapFromList(service_ids, func(x string) bool { return true }), + } + services, err := apiContainerClient.GetServices(ctx, &getServicesArgs) + if err != nil { + logrus.Errorf("Can't list services using gRPC call with enclave %s, error: %s", enclave_identifier, err) + return nil, stacktrace.NewError("Can't list services using gRPC call with enclave %s", enclave_identifier) + } + + mapped_services := utils.MapMapValues(services.ServiceInfo, toHttpServiceInfo) + return api.GetEnclavesEnclaveIdentifierServices200JSONResponse(mapped_services), nil +} + +// (GET /enclaves/{enclave_identifier}/services/history) +func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierServicesHistory(ctx context.Context, request api.GetEnclavesEnclaveIdentifierServicesHistoryRequestObject) (api.GetEnclavesEnclaveIdentifierServicesHistoryResponseObject, error) { enclave_identifier := request.EnclaveIdentifier apiContainerClient := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) logrus.Infof("Listing services from enclave %s", enclave_identifier) @@ -260,18 +280,15 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierServices(ctx context. return nil, stacktrace.NewError("Can't list services using gRPC call with enclave %s", enclave_identifier) } - mapped_services := utils.MapList(services.AllIdentifiers, func(service *kurtosis_core_rpc_api_bindings.ServiceIdentifiers) api.ServiceIdentifiers { + response := utils.MapList(services.AllIdentifiers, func(service *kurtosis_core_rpc_api_bindings.ServiceIdentifiers) api.ServiceIdentifiers { return api.ServiceIdentifiers{ ServiceUuid: &service.ServiceUuid, ShortenedUuid: &service.ShortenedUuid, Name: &service.Name, } }) - response := api.GetExistingAndHistoricalServiceIdentifiersResponse{ - AllIdentifiers: &mapped_services, - } - return api.GetEnclavesEnclaveIdentifierServices200JSONResponse(response), nil + return api.GetEnclavesEnclaveIdentifierServicesHistory200JSONResponse(response), nil } // (POST /enclaves/{enclave_identifier}/services/connection) @@ -294,7 +311,27 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierServicesConnection(c // (GET /enclaves/{enclave_identifier}/services/{service_identifier}) func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierServicesServiceIdentifier(ctx context.Context, request api.GetEnclavesEnclaveIdentifierServicesServiceIdentifierRequestObject) (api.GetEnclavesEnclaveIdentifierServicesServiceIdentifierResponseObject, error) { - return nil, Error{} + enclave_identifier := request.EnclaveIdentifier + service_identifier := request.ServiceIdentifier + apiContainerClient := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) + logrus.Infof("Getting info about service %s from enclave %s", service_identifier, enclave_identifier) + + getServicesArgs := kurtosis_core_rpc_api_bindings.GetServicesArgs{ + ServiceIdentifiers: map[string]bool{service_identifier: true}, + } + services, err := apiContainerClient.GetServices(ctx, &getServicesArgs) + if err != nil { + logrus.Errorf("Can't list services using gRPC call with enclave %s, error: %s", enclave_identifier, err) + return nil, stacktrace.NewError("Can't list services using gRPC call with enclave %s", enclave_identifier) + } + + mapped_services := utils.MapMapValues(services.ServiceInfo, toHttpServiceInfo) + selected_service, found := mapped_services[service_identifier] + if !found { + // TODO(edgar) add 404 return + return nil, stacktrace.NewError("Service %s not found", service_identifier) + } + return api.GetEnclavesEnclaveIdentifierServicesServiceIdentifier200JSONResponse(selected_service), nil } // (POST /enclaves/{enclave_identifier}/services/{service_identifier}/command) @@ -362,6 +399,84 @@ func toGrpcConnect(conn api.Connect) kurtosis_core_rpc_api_bindings.Connect { case api.NOCONNECT: return kurtosis_core_rpc_api_bindings.Connect_NO_CONNECT default: - panic(fmt.Sprintf("Missing convertion of Connect Enum value: %s", conn)) + panic(fmt.Sprintf("Missing conversion of Connect Enum value: %s", conn)) + } +} + +func toHttpContainerStatus(status kurtosis_core_rpc_api_bindings.Container_Status) api.ContainerStatus { + switch status { + case kurtosis_core_rpc_api_bindings.Container_RUNNING: + return api.ContainerStatusRUNNING + case kurtosis_core_rpc_api_bindings.Container_STOPPED: + return api.ContainerStatusSTOPPED + case kurtosis_core_rpc_api_bindings.Container_UNKNOWN: + return api.ContainerStatusUNKNOWN + default: + panic(fmt.Sprintf("Missing conversion of Container Status Enum value: %s", status)) + } +} + +func toHttpTransportProtocol(protocol kurtosis_core_rpc_api_bindings.Port_TransportProtocol) api.PortTransportProtocol { + switch protocol { + case kurtosis_core_rpc_api_bindings.Port_TCP: + return api.TCP + case kurtosis_core_rpc_api_bindings.Port_UDP: + return api.UDP + case kurtosis_core_rpc_api_bindings.Port_SCTP: + return api.SCTP + default: + panic(fmt.Sprintf("Missing conversion of Transport Protocol Enum value: %s", protocol)) + } +} + +func toHttpServiceStatus(status kurtosis_core_rpc_api_bindings.ServiceStatus) api.ServiceStatus { + switch status { + case kurtosis_core_rpc_api_bindings.ServiceStatus_RUNNING: + return api.ServiceStatusRUNNING + case kurtosis_core_rpc_api_bindings.ServiceStatus_STOPPED: + return api.ServiceStatusSTOPPED + case kurtosis_core_rpc_api_bindings.ServiceStatus_UNKNOWN: + return api.ServiceStatusUNKNOWN + default: + panic(fmt.Sprintf("Missing conversion of Service Status Enum value: %s", status)) + } +} + +func toHttpContainer(container *kurtosis_core_rpc_api_bindings.Container) api.Container { + status := toHttpContainerStatus(container.Status) + return api.Container{ + CmdArgs: &container.CmdArgs, + EntrypointArgs: &container.EntrypointArgs, + EnvVars: &container.EnvVars, + ImageName: &container.ImageName, + Status: &status, + } +} + +func toHttpPorts(port *kurtosis_core_rpc_api_bindings.Port) api.Port { + protocol := toHttpTransportProtocol(port.TransportProtocol) + return api.Port{ + MaybeApplicationProtocol: &port.MaybeApplicationProtocol, + MaybeWaitTimeout: &port.MaybeWaitTimeout, + Number: int32(port.Number), + TransportProtocol: protocol, + } +} + +func toHttpServiceInfo(service *kurtosis_core_rpc_api_bindings.ServiceInfo) api.ServiceInfo { + container := toHttpContainer(service.Container) + serviceStatus := toHttpServiceStatus(service.ServiceStatus) + publicPorts := utils.MapMapValues(service.MaybePublicPorts, toHttpPorts) + privatePorts := utils.MapMapValues(service.PrivatePorts, toHttpPorts) + return api.ServiceInfo{ + Container: &container, + MaybePublicIpAddr: &service.MaybePublicIpAddr, + MaybePublicPorts: &publicPorts, + Name: &service.Name, + PrivateIpAddr: &service.PrivateIpAddr, + PrivatePorts: &privatePorts, + ServiceStatus: &serviceStatus, + ServiceUuid: &service.ServiceUuid, + ShortenedUuid: &service.ShortenedUuid, } } diff --git a/engine/server/engine/utils/map.go b/engine/server/engine/utils/map.go index ecb4db52ff..764337ab37 100644 --- a/engine/server/engine/utils/map.go +++ b/engine/server/engine/utils/map.go @@ -8,3 +8,12 @@ func MapMapValues[T, U any, K comparable](data map[K]T, f func(T) U) map[K]U { return mappedMap } + +func NewMapFromList[U any, K comparable](data []K, f func(K) U) map[K]U { + mappedMap := make(map[K]U, len(data)) + for _, key := range data { + mappedMap[key] = f(key) + } + + return mappedMap +} diff --git a/engine/server/engine/utils/pointer.go b/engine/server/engine/utils/pointer.go new file mode 100644 index 0000000000..3007497ff4 --- /dev/null +++ b/engine/server/engine/utils/pointer.go @@ -0,0 +1,8 @@ +package utils + +func DerefWith[T any](value *T, defaultValue T) T { + if value == nil { + return defaultValue + } + return *value +} From be07300b2d7c5d0bf1234ca3eabadc43175ba85f Mon Sep 17 00:00:00 2001 From: lostbean Date: Thu, 16 Nov 2023 16:14:50 -0300 Subject: [PATCH 32/95] Add command execution --- .../server/engine_enclave_manager_service.go | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/engine/server/engine/server/engine_enclave_manager_service.go b/engine/server/engine/server/engine_enclave_manager_service.go index 34f4d50ccc..4c0a9aecd6 100644 --- a/engine/server/engine/server/engine_enclave_manager_service.go +++ b/engine/server/engine/server/engine_enclave_manager_service.go @@ -336,7 +336,26 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierServicesServiceIdenti // (POST /enclaves/{enclave_identifier}/services/{service_identifier}/command) func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand(ctx context.Context, request api.PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandRequestObject) (api.PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandResponseObject, error) { - return nil, Error{} + enclave_identifier := request.EnclaveIdentifier + service_identifier := request.ServiceIdentifier + apiContainerClient := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) + logrus.Infof("Getting info about service %s from enclave %s", service_identifier, enclave_identifier) + + execCommandArgs := kurtosis_core_rpc_api_bindings.ExecCommandArgs{ + ServiceIdentifier: service_identifier, + CommandArgs: *request.Body.CommandArgs, + } + exec_result, err := apiContainerClient.ExecCommand(ctx, &execCommandArgs) + if err != nil { + logrus.Errorf("Can't execute commands using gRPC call with enclave %s, error: %s", enclave_identifier, err) + return nil, stacktrace.NewError("Can't execute commands using gRPC call with enclave %s", enclave_identifier) + } + + response := api.ExecCommandResponse{ + ExitCode: &exec_result.ExitCode, + LogOutput: &exec_result.LogOutput, + } + return api.PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand200JSONResponse(response), nil } // (POST /enclaves/{enclave_identifier}/services/{service_identifier}/endpoints/{port_number}/availability) From c118bc0be954474503300af0371535963c663f4c Mon Sep 17 00:00:00 2001 From: lostbean Date: Thu, 16 Nov 2023 16:44:55 -0300 Subject: [PATCH 33/95] Add availability checker --- .../api_container_server.gen.go | 164 ++++++++---------- api/openapi/core/api_container_service.yaml | 13 +- .../server/engine_enclave_manager_service.go | 45 ++++- engine/server/engine/utils/pointer.go | 8 + 4 files changed, 124 insertions(+), 106 deletions(-) diff --git a/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go b/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go index dabac0d55a..7efb510b33 100644 --- a/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go +++ b/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go @@ -455,13 +455,6 @@ func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL } -type SuccessAsteriskResponse struct { - Body io.Reader - - ContentType string - ContentLength int64 -} - type GetEnclavesEnclaveIdentifierArtifactsRequestObject struct { EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` } @@ -681,20 +674,12 @@ type PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAv VisitPostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityResponse(w http.ResponseWriter) error } -type PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability200AsteriskResponse struct{ SuccessAsteriskResponse } +type PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability200Response struct { +} -func (response PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability200AsteriskResponse) VisitPostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", response.ContentType) - if response.ContentLength != 0 { - w.Header().Set("Content-Length", fmt.Sprint(response.ContentLength)) - } +func (response PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability200Response) VisitPostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityResponse(w http.ResponseWriter) error { w.WriteHeader(200) - - if closer, ok := response.Body.(io.ReadCloser); ok { - defer closer.Close() - } - _, err := io.Copy(w, response.Body) - return err + return nil } type GetEnclavesEnclaveIdentifierStarlarkRequestObject struct { @@ -723,20 +708,12 @@ type PostEnclavesEnclaveIdentifierStarlarkPackagesResponseObject interface { VisitPostEnclavesEnclaveIdentifierStarlarkPackagesResponse(w http.ResponseWriter) error } -type PostEnclavesEnclaveIdentifierStarlarkPackages200AsteriskResponse struct{ SuccessAsteriskResponse } +type PostEnclavesEnclaveIdentifierStarlarkPackages200Response struct { +} -func (response PostEnclavesEnclaveIdentifierStarlarkPackages200AsteriskResponse) VisitPostEnclavesEnclaveIdentifierStarlarkPackagesResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", response.ContentType) - if response.ContentLength != 0 { - w.Header().Set("Content-Length", fmt.Sprint(response.ContentLength)) - } +func (response PostEnclavesEnclaveIdentifierStarlarkPackages200Response) VisitPostEnclavesEnclaveIdentifierStarlarkPackagesResponse(w http.ResponseWriter) error { w.WriteHeader(200) - - if closer, ok := response.Body.(io.ReadCloser); ok { - defer closer.Close() - } - _, err := io.Copy(w, response.Body) - return err + return nil } type PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdRequestObject struct { @@ -1307,69 +1284,68 @@ func (sh *strictHandler) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx echo.C // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/+w8a3PbOJJ/BcW7qsykFCub3dq68jfHsRPdJrLKstd3NU5xILIlYQICHDxsa1L671d4", - "iaQIypRjO5mp+7LZERuNRr/QL/hrkvGi5AyYksnh16TEAhegQNj/wkKROc5USnJgiswJCPNzDjITpFSE", - "s+QwuVgCCoCI4QIQF0hrkieDhBiAEqtlMkjMp+QwinOQCPhdEwF5cqiEhkEisyUU2GymVqVZJpUgbJGs", - "14MEWEbxDWwRFdkqArhrp/axSpx9wQtAFQKkllihW0IpmgGCO8i0AnPSNpl+cUryb0YeOVsN+37cK7lQ", - "KdPFrEuWBgA5AKQ4ypaQfUH4BhOKZ4QSteogqIZ3F0VzLgqsksOEMPX3NxXnCFOwAGFplCBuSAb3qp2H", - "q7OQz5FaAso4U5iwwFP3U1FgliO55JrmdQ4jwuJnitCxD7PXDhikestzAtak5oTCZUk5zt/yfGV+MaQC", - "U+b/FpoqUmKhhoZLr3KsLN4I82aEYbGK6J3fVZacSbfjVGcZSLm11cvhyybqCPFNhgc8VkB2mcV5zBmD", - "TLUF9Bq9Qsdn4/HJ8QUaDtFbkArBfG60y6rYnItbLHLCFtfsb+gVGp+lNfBJEwTlROIZtdYATBfJ4S+J", - "h04GSbU0+dxiySCQOHXSlEdi4Xyd4CUI5QWTVef4TwHz5DD5j2HlG4f+xMNwXMMFvxGf/WZ/aW107sVQ", - "Y28D1mlohJQiT7EnkigoZEQ+m92xEHiVWLeoxKrkhKkHLb5Jb7D3+nlOjAwxnTTI6kJSnYkUxiU544nA", - "S4WVlj047BhzMHXwXaxuQkX1b3pxNpmcvENOw84vx+PR+D26Zm/QK3Q5/tf47GpcUygPnQwSD5kMkgAV", - "06uTO8iOnVcJOtUkwQAgD5EMWgpnf99bWDFu1CipK11zQ7gjKs14Dr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751Z0DjJ283j7OA+WGT7ecADwhvwv95dk2LvWV80jip1/zy80l7GC67", + "TrGHKQy54zrs5XkeqAhh/7+OQvBMgXoplQBc7P3477HkHm6imlz7iyP4/8fi+fbEFzV+JFBorq8FKDsJ", + "YNhjgPxbzj80WC41H3Masiqe9n7V9ekbRMH1aZGnjH03cYd/ZBmaVPFUSIKouL/1VHS/nCcoynG17Xcc", + "usaeqT7z7d71gPUpdGFJpOJi1enZz30tsWZ4CM+4dmULuCPSlt6u9atXr39CDhvJMEU1O9zfp7z3VH0P", + "BY1+Lfr2VF3buTy+9LoyiAc78+8umH8iE2v43GcSzNC/Ne52uq5bCi7NW5AbYJs/Z+BnwXCYuKsywIc5", + "45agaw+k/17J2/b78Ii4t16IP5+nj70YfzZ1DP0iOfxS+6se62Hjj4B06uobyrPPvrFQqattSbQaUZv2", + "0mDzYIiYHFFwvVgi7Fa9A7U53eOo9Oa534QL5VoR2y22b6Tq96+q/52Vp7KM+/qWEU1sdi6NyLq6l72M", + "KKrmPXXbDwB0Ri6GOIqlql6GCM32i0bCFt97X6XjrfxjehKPfuhf18g+TZTtJzkHyD3CUVC6eXOnIeHJ", + "X/2BYIZZ40/32MZq+5Hhno6iuVh+562XRzCOjbiGX6pnbuseAUhNeO474u75mJYgXkg0gyWm869jv/93", + "9FwxR+2h31N51I7nws+cP3aN6T2FP3DI5DdWqamn4juuK8TfDf7lNGO9/r8AAAD///6efaNMUAAA", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/api/openapi/core/api_container_service.yaml b/api/openapi/core/api_container_service.yaml index 14c934185b..1ff63c4b38 100644 --- a/api/openapi/core/api_container_service.yaml +++ b/api/openapi/core/api_container_service.yaml @@ -27,7 +27,7 @@ paths: $ref: "#/components/requestBodies/fileUploadBody" responses: "200": - $ref: "#/components/responses/Success" + description: Success /enclaves/{enclave_identifier}/starlark/packages/{package_id}: post: @@ -154,7 +154,7 @@ paths: required: true responses: "200": - $ref: "#/components/responses/Success" + description: Success /enclaves/{enclave_identifier}/artifacts: get: @@ -326,15 +326,6 @@ components: type: string format: binary - responses: - - Success: - content: - "*/*": - schema: - type: string - description: Success - schemas: Port: diff --git a/engine/server/engine/server/engine_enclave_manager_service.go b/engine/server/engine/server/engine_enclave_manager_service.go index 4c0a9aecd6..2dc06df836 100644 --- a/engine/server/engine/server/engine_enclave_manager_service.go +++ b/engine/server/engine/server/engine_enclave_manager_service.go @@ -360,7 +360,50 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierServicesServiceIdent // (POST /enclaves/{enclave_identifier}/services/{service_identifier}/endpoints/{port_number}/availability) func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability(ctx context.Context, request api.PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityRequestObject) (api.PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityResponseObject, error) { - return nil, Error{} + enclave_identifier := request.EnclaveIdentifier + service_identifier := request.ServiceIdentifier + port_number := request.PortNumber + apiContainerClient := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) + logrus.Infof("Getting info about service %s from enclave %s", service_identifier, enclave_identifier) + + endpoint_method := *request.Body.HttpMethod + + castToUInt32 := func(v int32) uint32 { return uint32(v) } + + var err error + switch endpoint_method { + case api.GET: + waitForHttpGetEndpointAvailabilityArgs := kurtosis_core_rpc_api_bindings.WaitForHttpGetEndpointAvailabilityArgs{ + ServiceIdentifier: service_identifier, + Port: uint32(port_number), + Path: request.Body.Path, + InitialDelayMilliseconds: utils.MapPointer(request.Body.InitialDelayMilliseconds, castToUInt32), + Retries: utils.MapPointer(request.Body.Retries, castToUInt32), + RetriesDelayMilliseconds: utils.MapPointer(request.Body.RetriesDelayMilliseconds, castToUInt32), + BodyText: request.Body.BodyText, + } + _, err = apiContainerClient.WaitForHttpGetEndpointAvailability(ctx, &waitForHttpGetEndpointAvailabilityArgs) + case api.POST: + waitForHttpPostEndpointAvailabilityArgs := kurtosis_core_rpc_api_bindings.WaitForHttpPostEndpointAvailabilityArgs{ + ServiceIdentifier: service_identifier, + Port: uint32(port_number), + Path: request.Body.Path, + InitialDelayMilliseconds: utils.MapPointer(request.Body.InitialDelayMilliseconds, castToUInt32), + Retries: utils.MapPointer(request.Body.Retries, castToUInt32), + RetriesDelayMilliseconds: utils.MapPointer(request.Body.RetriesDelayMilliseconds, castToUInt32), + BodyText: request.Body.BodyText, + } + _, err = apiContainerClient.WaitForHttpPostEndpointAvailability(ctx, &waitForHttpPostEndpointAvailabilityArgs) + default: + return nil, stacktrace.NewError("Undefined method for availability endpoint: %s", endpoint_method) + } + + if err != nil { + logrus.Errorf("Can't execute commands using gRPC call with enclave %s, error: %s", enclave_identifier, err) + return nil, stacktrace.NewError("Can't execute commands using gRPC call with enclave %s", enclave_identifier) + } + return api.PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability200Response{}, nil + } // (GET /enclaves/{enclave_identifier}/starlark) diff --git a/engine/server/engine/utils/pointer.go b/engine/server/engine/utils/pointer.go index 3007497ff4..1532465753 100644 --- a/engine/server/engine/utils/pointer.go +++ b/engine/server/engine/utils/pointer.go @@ -6,3 +6,11 @@ func DerefWith[T any](value *T, defaultValue T) T { } return *value } + +func MapPointer[T any, U any](value *T, foo func(T) U) *U { + if value == nil { + return nil + } + mapped := foo(*value) + return &mapped +} From 7d0db74b41e2f950070bb3a7244c7c8ef3dbeb26 Mon Sep 17 00:00:00 2001 From: lostbean Date: Thu, 16 Nov 2023 17:02:54 -0300 Subject: [PATCH 34/95] Fetch info about last Starlark run --- .../server/engine_enclave_manager_service.go | 45 ++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/engine/server/engine/server/engine_enclave_manager_service.go b/engine/server/engine/server/engine_enclave_manager_service.go index 2dc06df836..4e87e1e8d0 100644 --- a/engine/server/engine/server/engine_enclave_manager_service.go +++ b/engine/server/engine/server/engine_enclave_manager_service.go @@ -408,7 +408,30 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierServicesServiceIdent // (GET /enclaves/{enclave_identifier}/starlark) func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierStarlark(ctx context.Context, request api.GetEnclavesEnclaveIdentifierStarlarkRequestObject) (api.GetEnclavesEnclaveIdentifierStarlarkResponseObject, error) { - return nil, Error{} + enclave_identifier := request.EnclaveIdentifier + apiContainerClient := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) + logrus.Infof("Getting info about last Starlark run on enclave %s", enclave_identifier) + + starlark_result, err := apiContainerClient.GetStarlarkRun(ctx, &emptypb.Empty{}) + if err != nil { + logrus.Errorf("Can't get Starlark info using gRPC call with enclave %s, error: %s", enclave_identifier, err) + return nil, stacktrace.NewError("Can't get Starlark info using gRPC call with enclave %s", enclave_identifier) + } + + flags := utils.MapList(starlark_result.ExperimentalFeatures, toHttpFeatureFlag) + policy := toHttpRestartPolicy(starlark_result.RestartPolicy) + response := api.GetStarlarkRunResponse{ + ExperimentalFeatures: &flags, + MainFunctionName: &starlark_result.MainFunctionName, + PackageId: &starlark_result.PackageId, + Parallelism: &starlark_result.Parallelism, + RelativePathToMainFile: &starlark_result.RelativePathToMainFile, + RestartPolicy: &policy, + SerializedParams: &starlark_result.SerializedParams, + SerializedScript: &starlark_result.SerializedScript, + } + + return api.GetEnclavesEnclaveIdentifierStarlark200JSONResponse(response), nil } // (POST /enclaves/{enclave_identifier}/starlark/packages) @@ -542,3 +565,23 @@ func toHttpServiceInfo(service *kurtosis_core_rpc_api_bindings.ServiceInfo) api. ShortenedUuid: &service.ShortenedUuid, } } + +func toHttpFeatureFlag(flag kurtosis_core_rpc_api_bindings.KurtosisFeatureFlag) api.KurtosisFeatureFlag { + switch flag { + case kurtosis_core_rpc_api_bindings.KurtosisFeatureFlag_NO_INSTRUCTIONS_CACHING: + return api.NOINSTRUCTIONSCACHING + default: + panic(fmt.Sprintf("Missing conversion of Feature Flag Enum value: %s", flag)) + } +} + +func toHttpRestartPolicy(policy kurtosis_core_rpc_api_bindings.RestartPolicy) api.RestartPolicy { + switch policy { + case kurtosis_core_rpc_api_bindings.RestartPolicy_ALWAYS: + return api.RestartPolicyALWAYS + case kurtosis_core_rpc_api_bindings.RestartPolicy_NEVER: + return api.RestartPolicyNEVER + default: + panic(fmt.Sprintf("Missing conversion of Restart Policy Enum value: %s", policy)) + } +} From 1221c99aba058d8c4b47f1a68efb6285fdb775f7 Mon Sep 17 00:00:00 2001 From: lostbean Date: Thu, 16 Nov 2023 17:54:37 -0300 Subject: [PATCH 35/95] Add package upload --- .../server/engine_enclave_manager_service.go | 40 ++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/engine/server/engine/server/engine_enclave_manager_service.go b/engine/server/engine/server/engine_enclave_manager_service.go index 4e87e1e8d0..bec7ed21fa 100644 --- a/engine/server/engine/server/engine_enclave_manager_service.go +++ b/engine/server/engine/server/engine_enclave_manager_service.go @@ -436,7 +436,45 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierStarlark(ctx context. // (POST /enclaves/{enclave_identifier}/starlark/packages) func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkPackages(ctx context.Context, request api.PostEnclavesEnclaveIdentifierStarlarkPackagesRequestObject) (api.PostEnclavesEnclaveIdentifierStarlarkPackagesResponseObject, error) { - return nil, Error{} + enclave_identifier := request.EnclaveIdentifier + apiContainerClient := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) + logrus.Infof("Upload Starlark package on enclave %s", enclave_identifier) + + for { + // Get next part (file) from the the multipart POST request + part, err := request.Body.NextPart() + if err == io.EOF { + break + } + filename := part.FileName() + client, err := apiContainerClient.UploadStarlarkPackage(ctx) + if err != nil { + logrus.Errorf("Can't upload Starlark package using gRPC call with enclave %s, error: %s", enclave_identifier, err) + return nil, stacktrace.NewError("Can't upload Starlark package using gRPC call with enclave %s", enclave_identifier) + } + clientStream := grpc_file_streaming.NewClientStream[kurtosis_core_rpc_api_bindings.StreamedDataChunk, emptypb.Empty](client) + + _, err = clientStream.SendData( + filename, + part, + 0, // Length unknown head of time + func(previousChunkHash string, contentChunk []byte) (*kurtosis_core_rpc_api_bindings.StreamedDataChunk, error) { + return &kurtosis_core_rpc_api_bindings.StreamedDataChunk{ + Data: contentChunk, + PreviousChunkHash: previousChunkHash, + Metadata: &kurtosis_core_rpc_api_bindings.DataChunkMetadata{ + Name: filename, + }, + }, nil + }, + ) + if err != nil { + // TODO(edgar) Should we stop on failure in case of multiple files? Should we return a list of succeed uploads? + return nil, err + } + } + + return api.PostEnclavesEnclaveIdentifierStarlarkPackages200Response{}, nil } // (POST /enclaves/{enclave_identifier}/starlark/packages/{package_id}) From f9e34f95b16efd375c3188927e4d62707297fc76 Mon Sep 17 00:00:00 2001 From: lostbean Date: Thu, 16 Nov 2023 20:27:11 -0300 Subject: [PATCH 36/95] Run both Starlark scripts and packages --- .../api_container_server.gen.go | 167 +++++++++++------- .../api_container_types.gen.go | 17 +- api/openapi/core/api_container_service.yaml | 35 +++- .../server/engine_enclave_manager_service.go | 111 +++++++++++- 4 files changed, 248 insertions(+), 82 deletions(-) diff --git a/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go b/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go index 7efb510b33..c461b1674d 100644 --- a/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go +++ b/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go @@ -726,7 +726,7 @@ type PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdResponseObject interf VisitPostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdResponse(w http.ResponseWriter) error } -type PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId200JSONResponse StarlarkRunResponseLine +type PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId200JSONResponse []StarlarkRunResponseLine func (response PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId200JSONResponse) VisitPostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -735,6 +735,25 @@ func (response PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId200JSONResp return json.NewEncoder(w).Encode(response) } +type PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId200ApplicationoctetStreamResponse struct { + Body io.Reader + ContentLength int64 +} + +func (response PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId200ApplicationoctetStreamResponse) VisitPostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/octet-stream") + if response.ContentLength != 0 { + w.Header().Set("Content-Length", fmt.Sprint(response.ContentLength)) + } + w.WriteHeader(200) + + if closer, ok := response.Body.(io.ReadCloser); ok { + defer closer.Close() + } + _, err := io.Copy(w, response.Body) + return err +} + type PostEnclavesEnclaveIdentifierStarlarkScriptsRequestObject struct { EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` Body *PostEnclavesEnclaveIdentifierStarlarkScriptsJSONRequestBody @@ -744,7 +763,7 @@ type PostEnclavesEnclaveIdentifierStarlarkScriptsResponseObject interface { VisitPostEnclavesEnclaveIdentifierStarlarkScriptsResponse(w http.ResponseWriter) error } -type PostEnclavesEnclaveIdentifierStarlarkScripts200JSONResponse StarlarkRunResponseLine +type PostEnclavesEnclaveIdentifierStarlarkScripts200JSONResponse []StarlarkRunResponseLine func (response PostEnclavesEnclaveIdentifierStarlarkScripts200JSONResponse) VisitPostEnclavesEnclaveIdentifierStarlarkScriptsResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -753,6 +772,25 @@ func (response PostEnclavesEnclaveIdentifierStarlarkScripts200JSONResponse) Visi return json.NewEncoder(w).Encode(response) } +type PostEnclavesEnclaveIdentifierStarlarkScripts200ApplicationoctetStreamResponse struct { + Body io.Reader + ContentLength int64 +} + +func (response PostEnclavesEnclaveIdentifierStarlarkScripts200ApplicationoctetStreamResponse) VisitPostEnclavesEnclaveIdentifierStarlarkScriptsResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/octet-stream") + if response.ContentLength != 0 { + w.Header().Set("Content-Length", fmt.Sprint(response.ContentLength)) + } + w.WriteHeader(200) + + if closer, ok := response.Body.(io.ReadCloser); ok { + defer closer.Close() + } + _, err := io.Copy(w, response.Body) + return err +} + // StrictServerInterface represents all server handlers. type StrictServerInterface interface { @@ -1284,68 +1322,69 @@ func (sh *strictHandler) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx echo.C // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/+w8a3PbtpZ/BcPdmbR3FCs3905nx98cx060TWSNZde7U2dYiDyS0IAAi4dtNaP/voOX", - "SIqgTDm2k3b2y82teHBwcF44L/hLkvGi5AyYksnhl6TEAhegQNj/wkKROc5USnJgiswJCPNzDjITpFSE", - "s+QwuVgCCoCI4QIQF0hrkieDhBiAEqtlMkjMp+QwinOQCPhDEwF5cqiEhkEisyUU2GymVqVZJpUgbJGs", - "14MEWEbxDWwRFdkqArhrp/axSpx9xgtAFQKkllihW0IpmgGCO8i0AnPSNpl+cUryr0YeOVsN+37cK7lQ", - "KdPFrEuWBgA5AKQ4ypaQfUb4BhOKZ4QSteogqIZ3F0VzLgqsksOEMPWv1xXnCFOwAGFplCBuSAb3qp2H", - "q7OQz5FaAso4U5iwwFP3U1FgliO55JrmdQ4jwuJnitCxD7PXDhikesNzAtak5oTCZUk5zt/wfGV+MaQC", - "U+b/FpoqUmKhhoZLL3OsLN4I82aEYbGK6J3d1S2w+x1zxiBTbf69Qi/R8dl4fHJ8gYZD9AakQjCfG+Fb", - "DZhzcYtFTtjimv0TvUTjs7QGPmmCoJxIPKNWWYHpIjn8NfHQySCpliafWhQPAolTx2x5JBbOFQleglCe", - "b1l1jv8UME8Ok/8YVq5r6E88DMc1XPAb8dnv9pfWRucgS84k1ETXgHUKFCGlyFPsiSQKChmR/WZ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hBG5hPzkxo93bGm0NPlXKnWWgZRzTe+Vh6rbux8iE8EXxqNHhEALAUylUkGZEm94", + "+o8lNLbvV57mJm80++RXi06tC/jBi+KWRw75zsZso03nYhDjeW+HVvkxR7p+VmfOt0zeAwzWttGstGBP", + "QF7bbOjmxCTd5zZ18TIZoGbp3Mt9CkHwewJqKsx6kNxiYeL5viCu/PKd0rLt5x9V668qhJtA/U32BssF", + "NNpvp4IXPjqMl5j6FTeaLfpolMu1yFw1sGPkcyY51QqQW4nMynom5351B22q+rwkvqofDYQb9YMaAj7x", + "+dRFoiuYNagUH/exS9EVzFBzuKJnZWB/GmoRqYVfnn9AiqNQ1LKgNuOzvShjwO6gyBUm6pSL0NI8qk1u", + "xuliNqBTLtD7i4vJphWKjpojn00SzXi+ShXcRbqbo7nPET0cAUoLJpFaEulKZ838PAhHgcVnyBGWYdiU", + "AvoBDhYH6D1QytEVFzT/8SBG6KVSZVqAWnIbGYas593JRTJIJmfT+NwhYUQRTNMcKF6lBaGUSMg4y2UH", + "891MLJ+j+lrDTNvM1UwRGtpTbOFlREjl6JphSvuW+rp0zurYVloeRnQP0EjZKretYSgsFLolallDQ1Is", + "lweW06EEjX7zYIZLwFQtf4tX3ZXwbG+i9BHf1YiyuSXCSkFRKhlmb4m3AH7e1lNqQW4MmXRpi3VOSswP", + "mCHnhAf9BmEscr2YON7NwBmoW7AjSu6+g4eEJetaNLBVxpyMzFEFZqTUNLQnfCnFtjGJogbUiS+LucbE", + "DQjpAPzT3JeXwHBJksPkXwevDl4lTlzsZYcB1vBLe/J9PQxGxq5dQERzPxCpkGFg07QZ3IzuW6c5ypPD", + "5B0oj6T0/1YF3KParvprgl/jPrxaMoyM668/2dklG6pZvF+/erU1M12bzBj+Ll0sVQ1M7wobes62WJZu", + "eZJNzI78gHfiBq/7smBo258vQ3ut5DLCDtdhlwhv8SMMUoYminVnaLqSCooWqyZc9uDVB4OOAfN4TAtz", + "753TZo3R+OHWXPz6K/n+kKrjfWNHdRV/bHlwnc1KIKJjQ0CpDC3L+guHWjTRkpXNIMgtzPYTHN1Dbs4t", + "2k8oOI+i6N0xYoyX3VFi8+XH+glNU4coPoXk+QBADr+0X7usHyKLGS9XHXKI61HL40pieNTRaig+imAO", + "7t0VeSr0pOK8MytcN1OGv5C0fok8H1x3BjR+3HfzIgyYnzHZfoPwgPAm/J9nl7TYA8onjZN6DU0/H7eH", + "wdl1sj2Mf8gd7rCX5XmgIITz/3MEgmcK1EupBOBi7xeHj8X34IlqfO3PjmD/H4vmW1cCauxIwNC4rwUo", + "OwlgyOOmZuwD0j80WCo1X5AatCqa9n5K9ukbRMH1aZGnjH03cYd/2RmaVPFUSIKoqL/1PnW/nCcIynF1", + "7Hccusbexj6zd+96NfsUsrAkUnGx6rTs576WWFM8hGdcu7IF3BFpS2/X+tWr1z8hB41kmKKaHu5vU957", + "rL6Hgka/Fn17qq5tXB6fe10ZxION+XcXzD+RijVs7jMxZugfOHcbXdctBZfmLcgNsM3fUPCzYDhM3FUZ", + "4MOMcYvRtVfZf63kbftReoTdW8/Sn8/Sx56pP5s4hn6RHH6p/SmR9bDxl0c6ZfUN5dln31ioxNW2JFqN", + "qE17abB5pURMjii4XiwRdrvegdrc7nFEevPGcMKFcq2I7RbbNxL1+3fV/7jLU2nGfX3LiCQ2O5eGZV3d", + "y15KFBXznrLtBwA6IxeDHMVSVcP3QrP9opFwxPfeV+l4oP+YlsSDH/oHDLJPE2X71cMBulgSiaSC0s2b", + "OwkJ7wzrrxIzzBp/L8g2VtsvG/c0FM3N8jtvvTyCcmzYNfxSvada9whAasxz3xF3r8a0BPFCohksMZ1/", + "Hfn9v6PnijlqL8qeyqJ2vFF+gvxxr8Hh7Xm92MP+7684FWTYAZPfWGqnHovvuHQRfxP5t/C1hW+9/v8A", + "AAD//2499LKHUQAA", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/api/golang/core/kurtosis_core_http_api_bindings/api_container_types.gen.go b/api/golang/core/kurtosis_core_http_api_bindings/api_container_types.gen.go index f98b5da912..4918c5c462 100644 --- a/api/golang/core/kurtosis_core_http_api_bindings/api_container_types.gen.go +++ b/api/golang/core/kurtosis_core_http_api_bindings/api_container_types.gen.go @@ -205,20 +205,19 @@ type RunStarlarkPackageArgs struct { // MainFunctionName The name of the main function, the default value is "run" MainFunctionName *string `json:"main_function_name,omitempty"` - PackageId *string `json:"package_id,omitempty"` + PackageId string `json:"package_id"` // Parallelism Defaults to 4 Parallelism *int32 `json:"parallelism,omitempty"` + // Params Parameters data for the Starlark package main function + Params *map[string]interface{} `json:"params,omitempty"` + // RelativePathToMainFile The relative main file filepath, the default value is the "main.star" file in the root of a package RelativePathToMainFile *string `json:"relative_path_to_main_file,omitempty"` // Remote just a flag to indicate the module must be cloned inside the API Remote *bool `json:"remote,omitempty"` - - // SerializedParams Serialized parameters data for the Starlark package main function - // This should be a valid JSON string - SerializedParams *string `json:"serialized_params,omitempty"` } // RunStarlarkScriptArgs defines model for RunStarlarkScriptArgs. @@ -241,9 +240,11 @@ type RunStarlarkScriptArgs struct { MainFunctionName *string `json:"main_function_name,omitempty"` // Parallelism Defaults to 4 - Parallelism *int32 `json:"parallelism,omitempty"` - SerializedParams *string `json:"serialized_params,omitempty"` - SerializedScript *string `json:"serialized_script,omitempty"` + Parallelism *int32 `json:"parallelism,omitempty"` + + // Params Parameters data for the Starlark package main function + Params *map[string]interface{} `json:"params,omitempty"` + SerializedScript string `json:"serialized_script"` } // ServiceIdentifiers An service identifier is a collection of uuid, name and shortened uuid diff --git a/api/openapi/core/api_container_service.yaml b/api/openapi/core/api_container_service.yaml index 1ff63c4b38..872b9516b1 100644 --- a/api/openapi/core/api_container_service.yaml +++ b/api/openapi/core/api_container_service.yaml @@ -45,9 +45,15 @@ paths: "200": description: Successful request content: + application/octet-stream: + schema: + type: string + format: binary application/json: schema: - $ref: "#/components/schemas/StarlarkRunResponseLine" + type: array + items: + $ref: "#/components/schemas/StarlarkRunResponseLine" /enclaves/{enclave_identifier}/starlark/scripts: post: @@ -64,9 +70,15 @@ paths: "200": description: Successful request content: + application/octet-stream: + schema: + type: string + format: binary application/json: schema: - $ref: "#/components/schemas/StarlarkRunResponseLine" + type: array + items: + $ref: "#/components/schemas/StarlarkRunResponseLine" /enclaves/{enclave_identifier}/services/{service_identifier}: get: @@ -433,8 +445,11 @@ components: properties: serialized_script: type: string - serialized_params: - type: string + params: + type: object + additionalProperties: true + description: |- + Parameters data for the Starlark package main function dry_run: type: boolean description: Defaults to false @@ -457,6 +472,8 @@ components: description: Defaults to empty image_download_mode: $ref: "#/components/schemas/ImageDownloadMode" + required: + - serialized_script RunStarlarkPackageArgs: type: object @@ -470,11 +487,11 @@ components: remote: type: boolean description: just a flag to indicate the module must be cloned inside the API - serialized_params: - type: string + params: + type: object + additionalProperties: true description: |- - Serialized parameters data for the Starlark package main function - This should be a valid JSON string + Parameters data for the Starlark package main function dry_run: type: boolean description: Defaults to false @@ -507,6 +524,8 @@ components: description: Defaults to empty image_download_mode: $ref: "#/components/schemas/ImageDownloadMode" + required: + - package_id KurtosisFeatureFlag: type: string diff --git a/engine/server/engine/server/engine_enclave_manager_service.go b/engine/server/engine/server/engine_enclave_manager_service.go index bec7ed21fa..3802784b6d 100644 --- a/engine/server/engine/server/engine_enclave_manager_service.go +++ b/engine/server/engine/server/engine_enclave_manager_service.go @@ -2,6 +2,7 @@ package server import ( "context" + "encoding/json" "fmt" "io" @@ -479,12 +480,98 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkPackages(ctx // (POST /enclaves/{enclave_identifier}/starlark/packages/{package_id}) func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId(ctx context.Context, request api.PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdRequestObject) (api.PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdResponseObject, error) { - return nil, Error{} + enclave_identifier := request.EnclaveIdentifier + apiContainerClient := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) + logrus.Infof("Run Starlark package on enclave %s", enclave_identifier) + + package_id := request.PackageId + flags := utils.MapList(utils.DerefWith(request.Body.ExperimentalFeatures, []api.KurtosisFeatureFlag{}), toGrpcFeatureFlag) + jsonString := utils.MapPointer(request.Body.Params, func(v map[string]interface{}) string { + jsonBlob, err := json.Marshal(v) + if err != nil { + panic("Failed to serialize parsed JSON") + } + return string(jsonBlob) + }) + + runStarlarkPackageArgs := kurtosis_core_rpc_api_bindings.RunStarlarkPackageArgs{ + PackageId: request.Body.PackageId, + StarlarkPackageContent: nil, + SerializedParams: jsonString, + DryRun: request.Body.DryRun, + Parallelism: request.Body.Parallelism, + ClonePackage: request.Body.ClonePackage, + RelativePathToMainFile: request.Body.RelativePathToMainFile, + MainFunctionName: request.Body.MainFunctionName, + ExperimentalFeatures: flags, + CloudInstanceId: request.Body.CloudInstanceId, + CloudUserId: request.Body.CloudUserId, + ImageDownloadMode: utils.MapPointer(request.Body.ImageDownloadMode, toGrpcImageDownloadMode), + } + client, err := apiContainerClient.RunStarlarkPackage(ctx, &runStarlarkPackageArgs) + if err != nil { + logrus.Errorf("Can't run Starlark package using gRPC call with enclave %s, error: %s", enclave_identifier, err) + return nil, stacktrace.NewError("Can't run Starlark package using gRPC call with enclave %s", enclave_identifier) + } + clientStream := grpc_file_streaming.NewClientStream[kurtosis_core_rpc_api_bindings.StreamedDataChunk, []byte](client) + pipeReader := clientStream.PipeReader( + package_id, + func(dataChunk *kurtosis_core_rpc_api_bindings.StreamedDataChunk) ([]byte, string, error) { + return dataChunk.Data, dataChunk.PreviousChunkHash, nil + }, + ) + response := api.PostEnclavesEnclaveIdentifierStarlarkScripts200ApplicationoctetStreamResponse{ + Body: pipeReader, + ContentLength: 0, // No file size is provided since we are streaming it directly + } + + return api.PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId200ApplicationoctetStreamResponse(response), nil } // (POST /enclaves/{enclave_identifier}/starlark/scripts) func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx context.Context, request api.PostEnclavesEnclaveIdentifierStarlarkScriptsRequestObject) (api.PostEnclavesEnclaveIdentifierStarlarkScriptsResponseObject, error) { - return nil, Error{} + enclave_identifier := request.EnclaveIdentifier + apiContainerClient := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) + logrus.Infof("Run Starlark script on enclave %s", enclave_identifier) + + flags := utils.MapList(utils.DerefWith(request.Body.ExperimentalFeatures, []api.KurtosisFeatureFlag{}), toGrpcFeatureFlag) + jsonString := utils.MapPointer(request.Body.Params, func(v map[string]interface{}) string { + jsonBlob, err := json.Marshal(v) + if err != nil { + panic("Failed to serialize parsed JSON") + } + return string(jsonBlob) + }) + + runStarlarkScriptArgs := kurtosis_core_rpc_api_bindings.RunStarlarkScriptArgs{ + SerializedScript: request.Body.SerializedScript, + SerializedParams: jsonString, + DryRun: request.Body.DryRun, + Parallelism: request.Body.Parallelism, + MainFunctionName: request.Body.MainFunctionName, + ExperimentalFeatures: flags, + CloudInstanceId: request.Body.CloudInstanceId, + CloudUserId: request.Body.CloudUserId, + ImageDownloadMode: utils.MapPointer(request.Body.ImageDownloadMode, toGrpcImageDownloadMode), + } + client, err := apiContainerClient.RunStarlarkScript(ctx, &runStarlarkScriptArgs) + if err != nil { + logrus.Errorf("Can't run Starlark script using gRPC call with enclave %s, error: %s", enclave_identifier, err) + return nil, stacktrace.NewError("Can't run Starlark script using gRPC call with enclave %s", enclave_identifier) + } + clientStream := grpc_file_streaming.NewClientStream[kurtosis_core_rpc_api_bindings.StreamedDataChunk, []byte](client) + pipeReader := clientStream.PipeReader( + "__RunStarlarkScript__", + func(dataChunk *kurtosis_core_rpc_api_bindings.StreamedDataChunk) ([]byte, string, error) { + return dataChunk.Data, dataChunk.PreviousChunkHash, nil + }, + ) + response := api.PostEnclavesEnclaveIdentifierStarlarkScripts200ApplicationoctetStreamResponse{ + Body: pipeReader, + ContentLength: 0, // No file size is provided since we are streaming it directly + } + + return api.PostEnclavesEnclaveIdentifierStarlarkScripts200ApplicationoctetStreamResponse(response), nil } // =============================================================================================================== @@ -623,3 +710,23 @@ func toHttpRestartPolicy(policy kurtosis_core_rpc_api_bindings.RestartPolicy) ap panic(fmt.Sprintf("Missing conversion of Restart Policy Enum value: %s", policy)) } } + +func toGrpcFeatureFlag(flag api.KurtosisFeatureFlag) kurtosis_core_rpc_api_bindings.KurtosisFeatureFlag { + switch flag { + case api.NOINSTRUCTIONSCACHING: + return kurtosis_core_rpc_api_bindings.KurtosisFeatureFlag_NO_INSTRUCTIONS_CACHING + default: + panic(fmt.Sprintf("Missing conversion of Feature Flag Enum value: %s", flag)) + } +} + +func toGrpcImageDownloadMode(flag api.ImageDownloadMode) kurtosis_core_rpc_api_bindings.ImageDownloadMode { + switch flag { + case api.ImageDownloadModeALWAYS: + return kurtosis_core_rpc_api_bindings.ImageDownloadMode_always + case api.ImageDownloadModeMISSING: + return kurtosis_core_rpc_api_bindings.ImageDownloadMode_missing + default: + panic(fmt.Sprintf("Missing conversion of Image Download Mode Enum value: %s", flag)) + } +} From 65816f1e34d3aafe34917df3493240d3706a2ffd Mon Sep 17 00:00:00 2001 From: lostbean Date: Thu, 16 Nov 2023 22:06:04 -0300 Subject: [PATCH 37/95] Add Swagger UI endpoints to visualize deployed API --- engine/server/engine/main.go | 30 +++-- .../engine/server/openapi_ui_service.go | 122 ++++++++++++++++++ 2 files changed, 144 insertions(+), 8 deletions(-) create mode 100644 engine/server/engine/server/openapi_ui_service.go diff --git a/engine/server/engine/main.go b/engine/server/engine/main.go index 0558e8dddd..5b96e1267b 100644 --- a/engine/server/engine/main.go +++ b/engine/server/engine/main.go @@ -375,15 +375,17 @@ func restApiServer( // Log all requests e.Use(echomiddleware.Logger()) - // Use our validation middleware to check all requests against the + // ============================== Engine Management API ====================================== // OpenAPI schema. - // _, err := engineApi.GetSwagger() - // if err != nil { - // fmt.Fprintf(os.Stderr, "Error loading swagger spec\n: %s", err) - // os.Exit(1) - // } - // swagger.Servers = nil - // e.Use(middleware.OapiRequestValidator(swagger)) + swagger_engine, err := engineApi.GetSwagger() + if err != nil { + fmt.Fprintf(os.Stderr, "Error loading swagger spec\n: %s", err) + os.Exit(1) + } + server.ServeSwaggerUI(e, "/api/specs/engine", server.NewSwaggerUIConfig(swagger_engine)) + + // Use our validation middleware to check all requests against the + // e.Use(middleware.OapiRequestValidator(swagger_engine)) // We now register our runtime above as the handler for the interface engineRuntime := restApi.EngineRuntime{ @@ -398,6 +400,17 @@ func restApiServer( } engineApi.RegisterHandlers(e, engineApi.NewStrictHandler(engineRuntime, nil)) + // ============================== Engine Management API ====================================== + // OpenAPI schema. + swagger_enclave, err := enclaveApi.GetSwagger() + if err != nil { + fmt.Fprintf(os.Stderr, "Error loading swagger spec\n: %s", err) + os.Exit(1) + } + server.ServeSwaggerUI(e, "/api/specs/enclave", server.NewSwaggerUIConfig(swagger_enclave)) + + // Use our validation middleware to check all requests against the + // e.Use(middleware.OapiRequestValidator(swagger_enclave)) enclaveRuntime, err := restApi.NewEnclaveRuntime(ctx, enclave_manager) if err != nil { // TODO(edgar) fix error handling @@ -406,5 +419,6 @@ func restApiServer( // defer enclaveRuntime.ShutDown() enclaveApi.RegisterHandlers(e, enclaveApi.NewStrictHandler(enclaveRuntime, nil)) + // ============================== Start Server ====================================== e.Logger.Fatal(e.Start(net.JoinHostPort("0.0.0.0", fmt.Sprint(restAPIPortAddr)))) } diff --git a/engine/server/engine/server/openapi_ui_service.go b/engine/server/engine/server/openapi_ui_service.go new file mode 100644 index 0000000000..545aa8ef4b --- /dev/null +++ b/engine/server/engine/server/openapi_ui_service.go @@ -0,0 +1,122 @@ +package server + +// Based on https://github.com/go-goyave/openapi3 + +import ( + "io" + "net/http" + "text/template" + + "github.com/getkin/kin-openapi/openapi3" + "github.com/labstack/echo/v4" +) + +type UIConfig struct { + Title string + Favicon32x32 string + Favicon16x16 string + BundleURL string + PresetURL string + StylesURL string + Spec string +} + +const uiTemplate = ` + + + + + {{ .Title }} + + + + + + +
+ + + + + +` + +func NewSwaggerUIConfig(spec *openapi3.T) UIConfig { + var json []byte + if spec == nil { + json = []byte{} + } else { + json, _ = spec.MarshalJSON() + } + return UIConfig{ + Title: spec.Info.Title + " API Documentation", + Favicon16x16: "https://raw.githubusercontent.com/kurtosis-tech/kurtosis/70f492c6e3bfa46caa78e93b90b70f4f005ed2fc/docs/static/img/favicon.ico", + Favicon32x32: "https://raw.githubusercontent.com/kurtosis-tech/kurtosis/70f492c6e3bfa46caa78e93b90b70f4f005ed2fc/docs/static/img/favicon.ico", + BundleURL: "https://unpkg.com/swagger-ui-dist/swagger-ui-bundle.js", + PresetURL: "https://unpkg.com/swagger-ui-dist/swagger-ui-standalone-preset.js", + StylesURL: "https://unpkg.com/swagger-ui-dist/swagger-ui.css", + Spec: string(json), + } +} + +type TemplateRenderer struct { + templates *template.Template +} + +func (t *TemplateRenderer) Render(w io.Writer, name string, data interface{}, c echo.Context) error { + // Add global methods if data is a map + if viewContext, isMap := data.(map[string]interface{}); isMap { + viewContext["reverse"] = c.Echo().Reverse + } + return t.templates.ExecuteTemplate(w, name, data) +} + +func ServeSwaggerUI(e *echo.Echo, uri string, opts UIConfig) { + const template_name = "swaggerui" + + tmpl := TemplateRenderer{ + templates: template.Must(template.New(template_name).Parse(uiTemplate)), + } + e.Renderer = &tmpl + + e.GET(uri, func(c echo.Context) error { + return c.Render(http.StatusOK, template_name, opts) + }) +} From 8d17d32f77730d511e4dd520e87d4082a7b53566 Mon Sep 17 00:00:00 2001 From: lostbean Date: Fri, 17 Nov 2023 10:43:27 -0300 Subject: [PATCH 38/95] Remove non-string args from log msg --- engine/server/engine/server/engine_enclave_manager_service.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/server/engine/server/engine_enclave_manager_service.go b/engine/server/engine/server/engine_enclave_manager_service.go index 3802784b6d..56f1a63658 100644 --- a/engine/server/engine/server/engine_enclave_manager_service.go +++ b/engine/server/engine/server/engine_enclave_manager_service.go @@ -36,10 +36,10 @@ func NewEnclaveRuntime(ctx context.Context, manager *enclave_manager.EnclaveMana for uuid, info := range enclaves { conn, err := getGrpcClientConn(info) if err != nil { - logrus.Errorf("Failed to establish gRPC connection with enclave manager container %s on %s", uuid, info.ApiContainerInfo) + logrus.Errorf("Failed to establish gRPC connection with enclave manager service on enclave %s", uuid) return nil, err } - logrus.Debugf("Creating gRPC client to enclave manager container %s on %s", uuid, info.ApiContainerInfo) + logrus.Debugf("Creating gRPC connection with enclave manager service on enclave %s", uuid) apiContainerClient := kurtosis_core_rpc_api_bindings.NewApiContainerServiceClient(conn) clients[uuid] = apiContainerClient } From 27ec28fb144afde08a4754e2bd3f00f1cbfeb185 Mon Sep 17 00:00:00 2001 From: lostbean Date: Fri, 17 Nov 2023 16:48:52 -0300 Subject: [PATCH 39/95] rename files --- .../api_container_server.gen.go | 4 ++-- .../api_container_types.gen.go | 4 ++-- .../engine_server.gen.go | 4 ++-- .../engine_types.gen.go | 4 ++-- .../{api_container_service.yaml => core_service.yaml} | 0 api/openapi/core/server.cfg.yaml | 4 ++-- api/openapi/core/types.cfg.yaml | 4 ++-- api/openapi/engine/server.cfg.yaml | 4 ++-- api/openapi/engine/types.cfg.yaml | 4 ++-- api/openapi/scripts/build.sh | 4 ++-- engine/server/engine/main.go | 4 ++-- ...ave_manager_service.go => enclave_rest_api_handler.go} | 8 ++++---- ...{engine_http_service.go => engine_rest_api_handler.go} | 2 +- .../{openapi_ui_service.go => rest_api_doc_handler.go} | 0 14 files changed, 25 insertions(+), 25 deletions(-) rename api/golang/core/{kurtosis_core_http_api_bindings => kurtosis_core_rest_api_bindings}/api_container_server.gen.go (99%) rename api/golang/core/{kurtosis_core_http_api_bindings => kurtosis_core_rest_api_bindings}/api_container_types.gen.go (99%) rename api/golang/engine/{kurtosis_engine_http_api_bindings => kurtosis_engine_rest_api_bindings}/engine_server.gen.go (99%) rename api/golang/engine/{kurtosis_engine_http_api_bindings => kurtosis_engine_rest_api_bindings}/engine_types.gen.go (98%) rename api/openapi/core/{api_container_service.yaml => core_service.yaml} (100%) rename engine/server/engine/server/{engine_enclave_manager_service.go => enclave_rest_api_handler.go} (99%) rename engine/server/engine/server/{engine_http_service.go => engine_rest_api_handler.go} (99%) rename engine/server/engine/server/{openapi_ui_service.go => rest_api_doc_handler.go} (100%) diff --git a/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go b/api/golang/core/kurtosis_core_rest_api_bindings/api_container_server.gen.go similarity index 99% rename from api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go rename to api/golang/core/kurtosis_core_rest_api_bindings/api_container_server.gen.go index c461b1674d..6ffb23cd79 100644 --- a/api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go +++ b/api/golang/core/kurtosis_core_rest_api_bindings/api_container_server.gen.go @@ -1,7 +1,7 @@ -// Package kurtosis_core_http_api_bindings provides primitives to interact with the openapi HTTP API. +// Package kurtosis_core_rest_api_bindings provides primitives to interact with the openapi HTTP API. // // Code generated by github.com/deepmap/oapi-codegen version (devel) DO NOT EDIT. -package kurtosis_core_http_api_bindings +package kurtosis_core_rest_api_bindings import ( "bytes" diff --git a/api/golang/core/kurtosis_core_http_api_bindings/api_container_types.gen.go b/api/golang/core/kurtosis_core_rest_api_bindings/api_container_types.gen.go similarity index 99% rename from api/golang/core/kurtosis_core_http_api_bindings/api_container_types.gen.go rename to api/golang/core/kurtosis_core_rest_api_bindings/api_container_types.gen.go index 4918c5c462..a0780b9856 100644 --- a/api/golang/core/kurtosis_core_http_api_bindings/api_container_types.gen.go +++ b/api/golang/core/kurtosis_core_rest_api_bindings/api_container_types.gen.go @@ -1,7 +1,7 @@ -// Package kurtosis_core_http_api_bindings provides primitives to interact with the openapi HTTP API. +// Package kurtosis_core_rest_api_bindings provides primitives to interact with the openapi HTTP API. // // Code generated by github.com/deepmap/oapi-codegen version (devel) DO NOT EDIT. -package kurtosis_core_http_api_bindings +package kurtosis_core_rest_api_bindings import ( openapi_types "github.com/deepmap/oapi-codegen/pkg/types" diff --git a/api/golang/engine/kurtosis_engine_http_api_bindings/engine_server.gen.go b/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_server.gen.go similarity index 99% rename from api/golang/engine/kurtosis_engine_http_api_bindings/engine_server.gen.go rename to api/golang/engine/kurtosis_engine_rest_api_bindings/engine_server.gen.go index e159591cfd..fa79130b12 100644 --- a/api/golang/engine/kurtosis_engine_http_api_bindings/engine_server.gen.go +++ b/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_server.gen.go @@ -1,7 +1,7 @@ -// Package kurtosis_engine_http_api_bindings provides primitives to interact with the openapi HTTP API. +// Package kurtosis_engine_rest_api_bindings provides primitives to interact with the openapi HTTP API. // // Code generated by github.com/deepmap/oapi-codegen version (devel) DO NOT EDIT. -package kurtosis_engine_http_api_bindings +package kurtosis_engine_rest_api_bindings import ( "bytes" diff --git a/api/golang/engine/kurtosis_engine_http_api_bindings/engine_types.gen.go b/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_types.gen.go similarity index 98% rename from api/golang/engine/kurtosis_engine_http_api_bindings/engine_types.gen.go rename to api/golang/engine/kurtosis_engine_rest_api_bindings/engine_types.gen.go index 3977abde5a..e064c7ea11 100644 --- a/api/golang/engine/kurtosis_engine_http_api_bindings/engine_types.gen.go +++ b/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_types.gen.go @@ -1,7 +1,7 @@ -// Package kurtosis_engine_http_api_bindings provides primitives to interact with the openapi HTTP API. +// Package kurtosis_engine_rest_api_bindings provides primitives to interact with the openapi HTTP API. // // Code generated by github.com/deepmap/oapi-codegen version (devel) DO NOT EDIT. -package kurtosis_engine_http_api_bindings +package kurtosis_engine_rest_api_bindings import ( "time" diff --git a/api/openapi/core/api_container_service.yaml b/api/openapi/core/core_service.yaml similarity index 100% rename from api/openapi/core/api_container_service.yaml rename to api/openapi/core/core_service.yaml diff --git a/api/openapi/core/server.cfg.yaml b/api/openapi/core/server.cfg.yaml index f21a52155d..a7f63cab68 100644 --- a/api/openapi/core/server.cfg.yaml +++ b/api/openapi/core/server.cfg.yaml @@ -1,6 +1,6 @@ -package: kurtosis_core_http_api_bindings +package: kurtosis_core_rest_api_bindings generate: embedded-spec: true echo-server: true strict-server: true -output: api/golang/core/kurtosis_core_http_api_bindings/api_container_server.gen.go \ No newline at end of file +output: api/golang/core/kurtosis_core_rest_api_bindings/api_container_server.gen.go \ No newline at end of file diff --git a/api/openapi/core/types.cfg.yaml b/api/openapi/core/types.cfg.yaml index efb73389d6..bd0c20d926 100644 --- a/api/openapi/core/types.cfg.yaml +++ b/api/openapi/core/types.cfg.yaml @@ -1,4 +1,4 @@ -package: kurtosis_core_http_api_bindings +package: kurtosis_core_rest_api_bindings generate: models: true -output: api/golang/core/kurtosis_core_http_api_bindings/api_container_types.gen.go \ No newline at end of file +output: api/golang/core/kurtosis_core_rest_api_bindings/api_container_types.gen.go \ No newline at end of file diff --git a/api/openapi/engine/server.cfg.yaml b/api/openapi/engine/server.cfg.yaml index db358c3fb7..96a9e3afba 100644 --- a/api/openapi/engine/server.cfg.yaml +++ b/api/openapi/engine/server.cfg.yaml @@ -1,6 +1,6 @@ -package: kurtosis_engine_http_api_bindings +package: kurtosis_engine_rest_api_bindings generate: embedded-spec: true echo-server: true strict-server: true -output: api/golang/engine/kurtosis_engine_http_api_bindings/engine_server.gen.go \ No newline at end of file +output: api/golang/engine/kurtosis_engine_rest_api_bindings/engine_server.gen.go \ No newline at end of file diff --git a/api/openapi/engine/types.cfg.yaml b/api/openapi/engine/types.cfg.yaml index c06640d643..9e4f8fc94c 100644 --- a/api/openapi/engine/types.cfg.yaml +++ b/api/openapi/engine/types.cfg.yaml @@ -1,4 +1,4 @@ -package: kurtosis_engine_http_api_bindings +package: kurtosis_engine_rest_api_bindings generate: models: true -output: api/golang/engine/kurtosis_engine_http_api_bindings/engine_types.gen.go \ No newline at end of file +output: api/golang/engine/kurtosis_engine_rest_api_bindings/engine_types.gen.go \ No newline at end of file diff --git a/api/openapi/scripts/build.sh b/api/openapi/scripts/build.sh index f7a2e02c51..839f3d5957 100755 --- a/api/openapi/scripts/build.sh +++ b/api/openapi/scripts/build.sh @@ -7,8 +7,8 @@ api_root_dirpath="$(dirname "${script_dirpath}")" echo "Generating data models for REST API " oapi-codegen --config="$api_root_dirpath/engine/types.cfg.yaml" "$api_root_dirpath/engine/engine_service.yaml" -oapi-codegen --config="$api_root_dirpath/core/types.cfg.yaml" "$api_root_dirpath/core/api_container_service.yaml" +oapi-codegen --config="$api_root_dirpath/core/types.cfg.yaml" "$api_root_dirpath/core/core_service.yaml" echo "Generating server code for REST API " oapi-codegen --config="$api_root_dirpath/engine/server.cfg.yaml" "$api_root_dirpath/engine/engine_service.yaml" -oapi-codegen --config="$api_root_dirpath/core/server.cfg.yaml" "$api_root_dirpath/core/api_container_service.yaml" \ No newline at end of file +oapi-codegen --config="$api_root_dirpath/core/server.cfg.yaml" "$api_root_dirpath/core/core_service.yaml" \ No newline at end of file diff --git a/engine/server/engine/main.go b/engine/server/engine/main.go index 5b96e1267b..c4c9c56736 100644 --- a/engine/server/engine/main.go +++ b/engine/server/engine/main.go @@ -17,8 +17,8 @@ import ( "strings" "time" - enclaveApi "github.com/kurtosis-tech/kurtosis/api/golang/core/kurtosis_core_http_api_bindings" - engineApi "github.com/kurtosis-tech/kurtosis/api/golang/engine/kurtosis_engine_http_api_bindings" + enclaveApi "github.com/kurtosis-tech/kurtosis/api/golang/core/kurtosis_core_rest_api_bindings" + engineApi "github.com/kurtosis-tech/kurtosis/api/golang/engine/kurtosis_engine_rest_api_bindings" "github.com/kurtosis-tech/kurtosis/api/golang/engine/kurtosis_engine_rpc_api_bindings/kurtosis_engine_rpc_api_bindingsconnect" connect_server "github.com/kurtosis-tech/kurtosis/connect-server" "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/backend_creator" diff --git a/engine/server/engine/server/engine_enclave_manager_service.go b/engine/server/engine/server/enclave_rest_api_handler.go similarity index 99% rename from engine/server/engine/server/engine_enclave_manager_service.go rename to engine/server/engine/server/enclave_rest_api_handler.go index 56f1a63658..563bb9a43a 100644 --- a/engine/server/engine/server/engine_enclave_manager_service.go +++ b/engine/server/engine/server/enclave_rest_api_handler.go @@ -16,8 +16,8 @@ import ( "google.golang.org/grpc/credentials/insecure" "google.golang.org/protobuf/types/known/emptypb" - "github.com/kurtosis-tech/kurtosis/api/golang/core/kurtosis_core_http_api_bindings" - api "github.com/kurtosis-tech/kurtosis/api/golang/core/kurtosis_core_http_api_bindings" + "github.com/kurtosis-tech/kurtosis/api/golang/core/kurtosis_core_rest_api_bindings" + api "github.com/kurtosis-tech/kurtosis/api/golang/core/kurtosis_core_rest_api_bindings" "github.com/kurtosis-tech/kurtosis/api/golang/core/kurtosis_core_rpc_api_bindings" ) @@ -68,8 +68,8 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierArtifacts(ctx context http_artifacts := utils.MapList( artifacts.FileNamesAndUuids, - func(x *kurtosis_core_rpc_api_bindings.FilesArtifactNameAndUuid) kurtosis_core_http_api_bindings.FileArtifactReference { - return kurtosis_core_http_api_bindings.FileArtifactReference{ + func(x *kurtosis_core_rpc_api_bindings.FilesArtifactNameAndUuid) kurtosis_core_rest_api_bindings.FileArtifactReference { + return kurtosis_core_rest_api_bindings.FileArtifactReference{ Name: &x.FileName, Uuid: &x.FileUuid, } diff --git a/engine/server/engine/server/engine_http_service.go b/engine/server/engine/server/engine_rest_api_handler.go similarity index 99% rename from engine/server/engine/server/engine_http_service.go rename to engine/server/engine/server/engine_rest_api_handler.go index f95715b052..9ac9ab8cd2 100644 --- a/engine/server/engine/server/engine_http_service.go +++ b/engine/server/engine/server/engine_rest_api_handler.go @@ -20,7 +20,7 @@ import ( "github.com/sirupsen/logrus" "golang.org/x/exp/slices" - api "github.com/kurtosis-tech/kurtosis/api/golang/engine/kurtosis_engine_http_api_bindings" + api "github.com/kurtosis-tech/kurtosis/api/golang/engine/kurtosis_engine_rest_api_bindings" ) type EngineRuntime struct { diff --git a/engine/server/engine/server/openapi_ui_service.go b/engine/server/engine/server/rest_api_doc_handler.go similarity index 100% rename from engine/server/engine/server/openapi_ui_service.go rename to engine/server/engine/server/rest_api_doc_handler.go From e6b882a29f57c10cc09f03d945e8dc5ad76fa465 Mon Sep 17 00:00:00 2001 From: lostbean Date: Fri, 17 Nov 2023 17:06:01 -0300 Subject: [PATCH 40/95] rename schemas on engine API --- .../engine_server.gen.go | 54 +++++++++-------- .../engine_types.gen.go | 29 +++------ api/openapi/engine/engine_service.yaml | 59 ++++++++----------- .../engine/server/engine_rest_api_handler.go | 21 +++---- 4 files changed, 70 insertions(+), 93 deletions(-) diff --git a/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_server.gen.go b/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_server.gen.go index fa79130b12..f06956550c 100644 --- a/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_server.gen.go +++ b/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_server.gen.go @@ -222,7 +222,7 @@ type DeleteEnclavesResponseObject interface { VisitDeleteEnclavesResponse(w http.ResponseWriter) error } -type DeleteEnclaves200JSONResponse DeleteResponse +type DeleteEnclaves200JSONResponse DeletionSummary func (response DeleteEnclaves200JSONResponse) VisitDeleteEnclavesResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -238,7 +238,9 @@ type GetEnclavesResponseObject interface { VisitGetEnclavesResponse(w http.ResponseWriter) error } -type GetEnclaves200JSONResponse GetEnclavesResponse +type GetEnclaves200JSONResponse struct { + EnclaveInfo *map[string]EnclaveInfo `json:"enclave_info,omitempty"` +} func (response GetEnclaves200JSONResponse) VisitGetEnclavesResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -255,7 +257,7 @@ type PostEnclavesResponseObject interface { VisitPostEnclavesResponse(w http.ResponseWriter) error } -type PostEnclaves200JSONResponse CreateEnclaveResponse +type PostEnclaves200JSONResponse EnclaveInfo func (response PostEnclaves200JSONResponse) VisitPostEnclavesResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -271,7 +273,7 @@ type GetEnclavesHistoricalResponseObject interface { VisitGetEnclavesHistoricalResponse(w http.ResponseWriter) error } -type GetEnclavesHistorical200JSONResponse GetExistingAndHistoricalEnclaveIdentifiersResponse +type GetEnclavesHistorical200JSONResponse []EnclaveIdentifiers func (response GetEnclavesHistorical200JSONResponse) VisitGetEnclavesHistoricalResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -356,7 +358,7 @@ type GetEngineInfoResponseObject interface { VisitGetEngineInfoResponse(w http.ResponseWriter) error } -type GetEngineInfo200JSONResponse GetEngineInfoResponse +type GetEngineInfo200JSONResponse EngineInfo func (response GetEngineInfo200JSONResponse) VisitGetEngineInfoResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -641,27 +643,27 @@ func (sh *strictHandler) GetEngineInfo(ctx echo.Context) error { // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/+xY34/ithP/VyJ/v4/psW3feKML3UO6BbRkpatOJ8ubTMCnxM7ZE3roxP9e2fkJcSCw", - "t5Wq9g2S8cx85sdnxvlOQplmUoBATcbfiQ63kDL7c5LxeymQcQFqjQxz+xREnpLxJ/L0vFjMFw/EJ+tg", - "uVrNpsQni+WCzj7O18FsEZDPPsF9BmRMNCouNuTgk3sFDGEmwoTtYKI2VmOmZAYKOdh/LOM0rMzSRG5o", - "AjtIzKuOumPZHSjNpaDINk5pKMxSwVJwCqQysi/+ryAmY/K/UROaURmXUen7oxE9HGqI8uULhNiB+AQ6", - "k0JDF2blDBexHGhzbkSdNqeQAJ4xpiCVO4hoOwKUiYjmOY+sBEdI9UA/FiyFiYiecx6RxhumFNu73avy", - "vZrX9fReanxk4ZaLAlbH5Y3KQppJhVQKupUaaVqItzLHBcIGlDHBszNyVYYH+uZ26EXxaAOUZ5RFkQKt", - "nSXUVCOPnAINLi40j6DKSS+sXrEBqGpIelj/zh5XwR/Oxq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cv5CmjFEUENr6bmVlorMVvMNvV0tg+liSYP5JyMp9ttyFTi/", + "V9/up8HtB/owv5t/ch1pL7t0KWjHOZYqZUgmJGIIP1kJ7x0xwKrWhRwTs1aIjjddL4hPankh45ufb8bm", + "EpmBYBknE/LrzfhmTHySMdzZBIxK3bc/IjOYQpMXLsUiIpNiYK3mcW2PK5ZCoTOfzTkdKp5hce0i9lDl", + "4HvFGOuxJPGqW268GcQsT9Dj2otZog1Cbk59y0EdSNUzyhHYKAbxy9eGSzWOX4y4FJVtIfwyHpeKiCCw", + "GC2yhIcWzOirLnS3MXiOdM/ndBv7LtZNHoagdZwnXuWGpZ6uRvsydl4dPDNTFsrSjfEdYCvAr8LkHvMq", + "0lwjQ+3ZbYgUXROoO8BOlDKpHWFaS92N07ccNP4mo8Obpb37+rRYzDVcQUQmhtnHd+RcJ9LXhLHw3mvc", + "95saH+24Rql4yOxj+RIPPzS7X4n4Jc/V9pul3+evJFYDpcWxTmi+13VS338crok93y+J5OPjYuZ79Rzs", + "Fb+l8oz+eTL2cAeValYSaUS7Uci+v+Q5UR3KWbeR1wrnG1T8DDQqeWi4elka/3txflexaGmuV1q5VBOj", + "aoC/rM+9ZJk5/N+RsLfvKo533D/cWk68h64mTmnMs1kdQByNMruSOBtz9H9FvZgWE6fnrd88DUbV8Hda", + "X+t/W7yrXtW3vEKu7FunMnL8OwAA//+//WT6mhgAAA==", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_types.gen.go b/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_types.gen.go index e064c7ea11..21b017635f 100644 --- a/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_types.gen.go +++ b/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_types.gen.go @@ -38,21 +38,16 @@ const ( // ApiContainerStatus defines model for ApiContainerStatus. type ApiContainerStatus string -// CreateEnclaveArgs defines model for CreateEnclaveArgs. -type CreateEnclaveArgs struct { +// CreateEnclave defines model for CreateEnclave. +type CreateEnclave struct { ApiContainerLogLevel *string `json:"api_container_log_level,omitempty"` ApiContainerVersionTag *string `json:"api_container_version_tag,omitempty"` EnclaveName *string `json:"enclave_name,omitempty"` Mode *EnclaveMode `json:"mode,omitempty"` } -// CreateEnclaveResponse defines model for CreateEnclaveResponse. -type CreateEnclaveResponse struct { - EnclaveInfo *EnclaveInfo `json:"enclave_info,omitempty"` -} - -// DeleteResponse defines model for DeleteResponse. -type DeleteResponse struct { +// DeletionSummary defines model for DeletionSummary. +type DeletionSummary struct { RemovedEnclaveNameAndUuids *[]EnclaveNameAndUuid `json:"removed_enclave_name_and_uuids,omitempty"` } @@ -102,21 +97,11 @@ type EnclaveNameAndUuid struct { Uuid *string `json:"uuid,omitempty"` } -// GetEnclavesResponse defines model for GetEnclavesResponse. -type GetEnclavesResponse struct { - EnclaveInfo *map[string]EnclaveInfo `json:"enclave_info,omitempty"` -} - -// GetEngineInfoResponse defines model for GetEngineInfoResponse. -type GetEngineInfoResponse struct { +// EngineInfo defines model for EngineInfo. +type EngineInfo struct { EngineVersion *string `json:"engine_version,omitempty"` } -// GetExistingAndHistoricalEnclaveIdentifiersResponse defines model for GetExistingAndHistoricalEnclaveIdentifiersResponse. -type GetExistingAndHistoricalEnclaveIdentifiersResponse struct { - AllIdentifiers *[]EnclaveIdentifiers `json:"allIdentifiers,omitempty"` -} - // GetServiceLogsArgs defines model for GetServiceLogsArgs. type GetServiceLogsArgs struct { ConjunctiveFilters *[]LogLineFilter `json:"conjunctive_filters,omitempty"` @@ -157,7 +142,7 @@ type DeleteEnclavesParams struct { } // PostEnclavesJSONRequestBody defines body for PostEnclaves for application/json ContentType. -type PostEnclavesJSONRequestBody = CreateEnclaveArgs +type PostEnclavesJSONRequestBody = CreateEnclave // PostEnclavesEnclaveIdentifierLogsJSONRequestBody defines body for PostEnclavesEnclaveIdentifierLogs for application/json ContentType. type PostEnclavesEnclaveIdentifierLogsJSONRequestBody = GetServiceLogsArgs diff --git a/api/openapi/engine/engine_service.yaml b/api/openapi/engine/engine_service.yaml index 3262afa7a8..c8131612a0 100644 --- a/api/openapi/engine/engine_service.yaml +++ b/api/openapi/engine/engine_service.yaml @@ -1,7 +1,9 @@ openapi: 3.0.0 + info: title: Engine API - version: 1.0.0 + version: 0.1.0 + paths: /engine/info: get: @@ -12,7 +14,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/GetEngineInfoResponse' + $ref: '#/components/schemas/EngineInfo' /enclaves: get: @@ -23,7 +25,12 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/GetEnclavesResponse' + type: object + properties: + enclave_info: + type: object + additionalProperties: + $ref: '#/components/schemas/EnclaveInfo' post: summary: Create Enclave @@ -32,14 +39,14 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/CreateEnclaveArgs' + $ref: '#/components/schemas/CreateEnclave' responses: '200': description: Successful response content: application/json: schema: - $ref: '#/components/schemas/CreateEnclaveResponse' + $ref: '#/components/schemas/EnclaveInfo' delete: summary: Delete Enclaves @@ -56,7 +63,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/DeleteResponse' + $ref: '#/components/schemas/DeletionSummary' /enclaves/historical: get: @@ -67,7 +74,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/GetExistingAndHistoricalEnclaveIdentifiersResponse' + type: array + items: + $ref: '#/components/schemas/EnclaveIdentifiers' /enclaves/{enclave_identifier}: get: @@ -148,33 +157,23 @@ paths: schema: type: object - +# ========================================================================================================================= +# ========================================================================================================================= +# > > > > > > > > > > > > > > > > > > > > > > > > Data Models < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < +# ========================================================================================================================= +# ========================================================================================================================= components: + schemas: - GetEngineInfoResponse: + + EngineInfo: type: object properties: engine_version: type: string - GetEnclavesResponse: - type: object - properties: - enclave_info: - type: object - additionalProperties: - $ref: '#/components/schemas/EnclaveInfo' - - GetExistingAndHistoricalEnclaveIdentifiersResponse: - type: object - properties: - allIdentifiers: - type: array - items: - $ref: '#/components/schemas/EnclaveIdentifiers' - - CreateEnclaveArgs: + CreateEnclave: type: object properties: enclave_name: @@ -206,12 +205,6 @@ components: - STOPPED - NON_EXISTENT - CreateEnclaveResponse: - type: object - properties: - enclave_info: - $ref: '#/components/schemas/EnclaveInfo' - EnclaveInfo: type: object properties: @@ -273,7 +266,7 @@ components: uuid: type: string - DeleteResponse: + DeletionSummary: type: object properties: removed_enclave_name_and_uuids: diff --git a/engine/server/engine/server/engine_rest_api_handler.go b/engine/server/engine/server/engine_rest_api_handler.go index 9ac9ab8cd2..25d6e9f00d 100644 --- a/engine/server/engine/server/engine_rest_api_handler.go +++ b/engine/server/engine/server/engine_rest_api_handler.go @@ -175,7 +175,7 @@ func (engine EngineRuntime) DeleteEnclaves(ctx context.Context, request api.Dele } } removedApiResponse := utils.MapList(removedEnclaveUuidsAndNames, toHttpApiEnclaveNameAndUuid) - return api.DeleteEnclaves200JSONResponse(api.DeleteResponse{RemovedEnclaveNameAndUuids: &removedApiResponse}), nil + return api.DeleteEnclaves200JSONResponse(api.DeletionSummary{RemovedEnclaveNameAndUuids: &removedApiResponse}), nil } // Get Enclaves @@ -186,8 +186,10 @@ func (engine EngineRuntime) GetEnclaves(ctx context.Context, request api.GetEncl return nil, stacktrace.Propagate(err, "An error occurred getting info for enclaves") } info_map_http := toHttpApiEnclaveInfos(infoForEnclaves) - response := api.GetEnclavesResponse{EnclaveInfo: &info_map_http} - return api.GetEnclaves200JSONResponse(response), nil + response := api.GetEnclaves200JSONResponse{ + EnclaveInfo: &info_map_http, + } + return response, nil } // Create Enclave @@ -220,11 +222,7 @@ func (engine EngineRuntime) PostEnclaves(ctx context.Context, request api.PostEn return nil, stacktrace.Propagate(err, "An error occurred creating new enclave with name '%v'", request.Body.EnclaveName) } - grpcEnclaveInfo := toHttpApiEnclaveInfo(*enclaveInfo) - response := api.CreateEnclaveResponse{ - EnclaveInfo: &grpcEnclaveInfo, - } - + response := toHttpApiEnclaveInfo(*enclaveInfo) return api.PostEnclaves200JSONResponse(response), nil } @@ -236,8 +234,7 @@ func (engine EngineRuntime) GetEnclavesHistorical(ctx context.Context, request a return nil, stacktrace.Propagate(err, "An error occurred while fetching enclave identifiers") } identifiers_map_api := utils.MapList(allIdentifiers, toHttpApiEnclaveIdentifiers) - response := api.GetExistingAndHistoricalEnclaveIdentifiersResponse{AllIdentifiers: &identifiers_map_api} - return api.GetEnclavesHistorical200JSONResponse(response), nil + return api.GetEnclavesHistorical200JSONResponse(identifiers_map_api), nil } // Destroy Enclave @@ -368,7 +365,7 @@ func (engine EngineRuntime) PostEnclavesEnclaveIdentifierStop(ctx context.Contex // Get Engine Info // (GET /engine/info) func (engine EngineRuntime) GetEngineInfo(ctx context.Context, request api.GetEngineInfoRequestObject) (api.GetEngineInfoResponseObject, error) { - result := api.GetEngineInfoResponse{EngineVersion: &engine.ImageVersionTag} + result := api.EngineInfo{EngineVersion: &engine.ImageVersionTag} return api.GetEngineInfo200JSONResponse(result), nil } @@ -440,7 +437,7 @@ func (service *EngineRuntime) reportAnyMissingUuidsAndGetNotFoundUuidsListHttp( notFoundServiceUuidsMap := getNotFoundServiceUuidsAndEmptyServiceLogsMap(requestedServiceUuids, existingServiceUuids) var notFoundServiceUuids []string - for service, _ := range notFoundServiceUuidsMap { + for service := range notFoundServiceUuidsMap { notFoundServiceUuids = append(notFoundServiceUuids, service) } return notFoundServiceUuids, nil From 1e4afcbf7d029f0f360be1317bdc9deac291fcf3 Mon Sep 17 00:00:00 2001 From: lostbean Date: Fri, 17 Nov 2023 17:27:51 -0300 Subject: [PATCH 41/95] more renaming on schemas on engine API --- .../engine_server.gen.go | 98 +++++++++---------- .../engine_types.gen.go | 26 +++-- api/openapi/engine/engine_service.yaml | 80 ++++++--------- .../engine/server/engine_rest_api_handler.go | 17 ++-- 4 files changed, 100 insertions(+), 121 deletions(-) diff --git a/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_server.gen.go b/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_server.gen.go index f06956550c..c778e57efe 100644 --- a/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_server.gen.go +++ b/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_server.gen.go @@ -36,16 +36,16 @@ type ServerInterface interface { GetEnclavesHistorical(ctx echo.Context) error // Destroy Enclave // (DELETE /enclaves/{enclave_identifier}) - DeleteEnclavesEnclaveIdentifier(ctx echo.Context, enclaveIdentifier string) error + DeleteEnclavesEnclaveIdentifier(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error // Get Enclave Info // (GET /enclaves/{enclave_identifier}) - GetEnclavesEnclaveIdentifier(ctx echo.Context, enclaveIdentifier string) error + GetEnclavesEnclaveIdentifier(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error // Get Service Logs // (POST /enclaves/{enclave_identifier}/logs) - PostEnclavesEnclaveIdentifierLogs(ctx echo.Context, enclaveIdentifier string) error + PostEnclavesEnclaveIdentifierLogs(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error // Stop Enclave // (POST /enclaves/{enclave_identifier}/stop) - PostEnclavesEnclaveIdentifierStop(ctx echo.Context, enclaveIdentifier string) error + PostEnclavesEnclaveIdentifierStop(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error // Get Engine Info // (GET /engine/info) GetEngineInfo(ctx echo.Context) error @@ -105,7 +105,7 @@ func (w *ServerInterfaceWrapper) GetEnclavesHistorical(ctx echo.Context) error { func (w *ServerInterfaceWrapper) DeleteEnclavesEnclaveIdentifier(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- - var enclaveIdentifier string + var enclaveIdentifier EnclaveIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) if err != nil { @@ -121,7 +121,7 @@ func (w *ServerInterfaceWrapper) DeleteEnclavesEnclaveIdentifier(ctx echo.Contex func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifier(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- - var enclaveIdentifier string + var enclaveIdentifier EnclaveIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) if err != nil { @@ -137,7 +137,7 @@ func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifier(ctx echo.Context) func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierLogs(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- - var enclaveIdentifier string + var enclaveIdentifier EnclaveIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) if err != nil { @@ -153,7 +153,7 @@ func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierLogs(ctx echo.Cont func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierStop(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- - var enclaveIdentifier string + var enclaveIdentifier EnclaveIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) if err != nil { @@ -238,9 +238,7 @@ type GetEnclavesResponseObject interface { VisitGetEnclavesResponse(w http.ResponseWriter) error } -type GetEnclaves200JSONResponse struct { - EnclaveInfo *map[string]EnclaveInfo `json:"enclave_info,omitempty"` -} +type GetEnclaves200JSONResponse map[string]EnclaveInfo func (response GetEnclaves200JSONResponse) VisitGetEnclavesResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -283,24 +281,23 @@ func (response GetEnclavesHistorical200JSONResponse) VisitGetEnclavesHistoricalR } type DeleteEnclavesEnclaveIdentifierRequestObject struct { - EnclaveIdentifier string `json:"enclave_identifier"` + EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` } type DeleteEnclavesEnclaveIdentifierResponseObject interface { VisitDeleteEnclavesEnclaveIdentifierResponse(w http.ResponseWriter) error } -type DeleteEnclavesEnclaveIdentifier200JSONResponse map[string]interface{} +type DeleteEnclavesEnclaveIdentifier200Response struct { +} -func (response DeleteEnclavesEnclaveIdentifier200JSONResponse) VisitDeleteEnclavesEnclaveIdentifierResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "application/json") +func (response DeleteEnclavesEnclaveIdentifier200Response) VisitDeleteEnclavesEnclaveIdentifierResponse(w http.ResponseWriter) error { w.WriteHeader(200) - - return json.NewEncoder(w).Encode(response) + return nil } type GetEnclavesEnclaveIdentifierRequestObject struct { - EnclaveIdentifier string `json:"enclave_identifier"` + EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` } type GetEnclavesEnclaveIdentifierResponseObject interface { @@ -317,7 +314,7 @@ func (response GetEnclavesEnclaveIdentifier200JSONResponse) VisitGetEnclavesEncl } type PostEnclavesEnclaveIdentifierLogsRequestObject struct { - EnclaveIdentifier string `json:"enclave_identifier"` + EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` Body *PostEnclavesEnclaveIdentifierLogsJSONRequestBody } @@ -325,7 +322,7 @@ type PostEnclavesEnclaveIdentifierLogsResponseObject interface { VisitPostEnclavesEnclaveIdentifierLogsResponse(w http.ResponseWriter) error } -type PostEnclavesEnclaveIdentifierLogs200JSONResponse GetServiceLogsResponse +type PostEnclavesEnclaveIdentifierLogs200JSONResponse ServiceLogs func (response PostEnclavesEnclaveIdentifierLogs200JSONResponse) VisitPostEnclavesEnclaveIdentifierLogsResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -335,20 +332,19 @@ func (response PostEnclavesEnclaveIdentifierLogs200JSONResponse) VisitPostEnclav } type PostEnclavesEnclaveIdentifierStopRequestObject struct { - EnclaveIdentifier string `json:"enclave_identifier"` + EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` } type PostEnclavesEnclaveIdentifierStopResponseObject interface { VisitPostEnclavesEnclaveIdentifierStopResponse(w http.ResponseWriter) error } -type PostEnclavesEnclaveIdentifierStop200JSONResponse map[string]interface{} +type PostEnclavesEnclaveIdentifierStop200Response struct { +} -func (response PostEnclavesEnclaveIdentifierStop200JSONResponse) VisitPostEnclavesEnclaveIdentifierStopResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "application/json") +func (response PostEnclavesEnclaveIdentifierStop200Response) VisitPostEnclavesEnclaveIdentifierStopResponse(w http.ResponseWriter) error { w.WriteHeader(200) - - return json.NewEncoder(w).Encode(response) + return nil } type GetEngineInfoRequestObject struct { @@ -512,7 +508,7 @@ func (sh *strictHandler) GetEnclavesHistorical(ctx echo.Context) error { } // DeleteEnclavesEnclaveIdentifier operation middleware -func (sh *strictHandler) DeleteEnclavesEnclaveIdentifier(ctx echo.Context, enclaveIdentifier string) error { +func (sh *strictHandler) DeleteEnclavesEnclaveIdentifier(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error { var request DeleteEnclavesEnclaveIdentifierRequestObject request.EnclaveIdentifier = enclaveIdentifier @@ -537,7 +533,7 @@ func (sh *strictHandler) DeleteEnclavesEnclaveIdentifier(ctx echo.Context, encla } // GetEnclavesEnclaveIdentifier operation middleware -func (sh *strictHandler) GetEnclavesEnclaveIdentifier(ctx echo.Context, enclaveIdentifier string) error { +func (sh *strictHandler) GetEnclavesEnclaveIdentifier(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error { var request GetEnclavesEnclaveIdentifierRequestObject request.EnclaveIdentifier = enclaveIdentifier @@ -562,7 +558,7 @@ func (sh *strictHandler) GetEnclavesEnclaveIdentifier(ctx echo.Context, enclaveI } // PostEnclavesEnclaveIdentifierLogs operation middleware -func (sh *strictHandler) PostEnclavesEnclaveIdentifierLogs(ctx echo.Context, enclaveIdentifier string) error { +func (sh *strictHandler) PostEnclavesEnclaveIdentifierLogs(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error { var request PostEnclavesEnclaveIdentifierLogsRequestObject request.EnclaveIdentifier = enclaveIdentifier @@ -593,7 +589,7 @@ func (sh *strictHandler) PostEnclavesEnclaveIdentifierLogs(ctx echo.Context, enc } // PostEnclavesEnclaveIdentifierStop operation middleware -func (sh *strictHandler) PostEnclavesEnclaveIdentifierStop(ctx echo.Context, enclaveIdentifier string) error { +func (sh *strictHandler) PostEnclavesEnclaveIdentifierStop(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error { var request PostEnclavesEnclaveIdentifierStopRequestObject request.EnclaveIdentifier = enclaveIdentifier @@ -643,27 +639,27 @@ func (sh *strictHandler) GetEngineInfo(ctx echo.Context) error { // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/+xYTW/jNhD9KwLboxq77c03N3azBja2ESvAFosFwUgjmwuJ1JIjt8bC/70g9R3RtuIk", - "BYr2FovkcN7MmzfDfCehTDMpQKAmk+9EhztImf1zmvFbKZBxAWqDDHP7FUSeksln8vC4XC6Wd8Qnm2C1", - "Xs9nxCfL1ZLOPy02wXwZkC8+wUMGZEI0Ki625OiTWwUMYS7ChO3BWMuUzEAhB2ubZZyG1ZU0kVuawB4S", - "s9Qz1d27B6W5FBTZ1rkbiiupYCk4N6Qysgs/KojJhPwwasIyKmMyKv2+N1uPxxqefPoKIRojM0gAuRSb", - "PE2ZOvQBKkjlHiLadocyEdE855HdwRFSPdCRJUthKqLHnEekcYcpxQ5u/8pz0/WiTuwHqfGehTsuYCFi", - "2Xd5q7KQZlIhlYLupEaaFttbYeQCYQvKXMGzM/uqcA/0ze3Qk+LRFijPKIsiBVo789lQg0fODQ0uLjSP", - "oMrJSVgntw1AVUPSwwppfr8O/nBWUGlwEYFAHnNQuh+hil2GVE7sJ6tA76RCEBCdOnsGoztb3TJt84Ly", - "8sAApp9jbE8LrrTrNqbrfJ0z55DKNgf1QDOn2GJsGeW0CsfTi0IV8BQ0sjRrS99JNrxY+t6JQPelH1Vh", - "BPNNQHyyfljNHm+DxWp5riDaWtgj4Ul3X+Tk9qRGgl2rmt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ZpBInzd72uw7FEXc8CdL", + "5nv2O1SEtPPsynzQhFMsVcqQDEjEEH6znN3KjNFSvVXIMTFnBct4w/mE+GTHJ6R/9ftV3xiRGQiWcTIg", + "f171r/rEt7uIjaRXrQXFEpEAQg0/LsUkIoNiQq0GcG2v1wvTN3c6apFeY5HYfjcMoDMpdGHyj36/pC0E", + "gcXbnyU8tMZ7L7ogxnr7OJX5w0Ha5mp/MVrkYQhax3niVW7Yuuhq9i5j9XbBmqGvgNV+Tm4AGwn5UEyX", + "oKw5PjmQdkHgN4B7UWdSO8KeS70f92sOGv+S0ebTyri/7m2LXbe5F2+/EEN7eb0kjYX3Xu2+X/dYb8U1", + "SsVDZrfTc7i6raU/GPF79sPmktB+XC8EVh1KA2N7qXlr/yCy7c5JLd/fTVKO32OOkdX7KUWjkpsaE+cp", + "5YfG83M0ToN/vFLLOXz0qgnyPFe1EmoHi09L6uez4MGg/4NpsGX6kmqWSrxSy9lqapTZhdVcmKs/Ucsb", + "fw7fADOj9arR7TgB7BbGL23WnZUP9KodOisl2/8DAAD//7ux+lBVFwAA", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_types.gen.go b/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_types.gen.go index 21b017635f..10ae153b99 100644 --- a/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_types.gen.go +++ b/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_types.gen.go @@ -102,8 +102,8 @@ type EngineInfo struct { EngineVersion *string `json:"engine_version,omitempty"` } -// GetServiceLogsArgs defines model for GetServiceLogsArgs. -type GetServiceLogsArgs struct { +// GetServiceLogs defines model for GetServiceLogs. +type GetServiceLogs struct { ConjunctiveFilters *[]LogLineFilter `json:"conjunctive_filters,omitempty"` FollowLogs *bool `json:"follow_logs,omitempty"` NumLogLines *int `json:"num_log_lines,omitempty"` @@ -111,12 +111,6 @@ type GetServiceLogsArgs struct { ServiceUuidSet *[]string `json:"service_uuid_set,omitempty"` } -// GetServiceLogsResponse defines model for GetServiceLogsResponse. -type GetServiceLogsResponse struct { - NotFoundServiceUuidSet *[]string `json:"not_found_service_uuid_set,omitempty"` - ServiceLogsByServiceUuid *map[string]LogLine `json:"service_logs_by_service_uuid,omitempty"` -} - // LogLine defines model for LogLine. type LogLine struct { Line *[]string `json:"line,omitempty"` @@ -132,17 +126,29 @@ type LogLineFilter struct { // LogLineOperator defines model for LogLineOperator. type LogLineOperator string +// ServiceLogs defines model for ServiceLogs. +type ServiceLogs struct { + NotFoundServiceUuidSet *[]string `json:"not_found_service_uuid_set,omitempty"` + ServiceLogsByServiceUuid *map[string]LogLine `json:"service_logs_by_service_uuid,omitempty"` +} + // Timestamp defines model for Timestamp. type Timestamp = time.Time +// EnclaveIdentifier defines model for enclave_identifier. +type EnclaveIdentifier = string + +// RemoveAll defines model for remove_all. +type RemoveAll = bool + // DeleteEnclavesParams defines parameters for DeleteEnclaves. type DeleteEnclavesParams struct { // RemoveAll If true, remove all enclaves. Default is false - RemoveAll *bool `form:"remove_all,omitempty" json:"remove_all,omitempty"` + RemoveAll *RemoveAll `form:"remove_all,omitempty" json:"remove_all,omitempty"` } // PostEnclavesJSONRequestBody defines body for PostEnclaves for application/json ContentType. type PostEnclavesJSONRequestBody = CreateEnclave // PostEnclavesEnclaveIdentifierLogsJSONRequestBody defines body for PostEnclavesEnclaveIdentifierLogs for application/json ContentType. -type PostEnclavesEnclaveIdentifierLogsJSONRequestBody = GetServiceLogsArgs +type PostEnclavesEnclaveIdentifierLogsJSONRequestBody = GetServiceLogs diff --git a/api/openapi/engine/engine_service.yaml b/api/openapi/engine/engine_service.yaml index c8131612a0..b12b81f8f8 100644 --- a/api/openapi/engine/engine_service.yaml +++ b/api/openapi/engine/engine_service.yaml @@ -26,11 +26,8 @@ paths: application/json: schema: type: object - properties: - enclave_info: - type: object - additionalProperties: - $ref: '#/components/schemas/EnclaveInfo' + additionalProperties: + $ref: '#/components/schemas/EnclaveInfo' post: summary: Create Enclave @@ -51,12 +48,7 @@ paths: delete: summary: Delete Enclaves parameters: - - name: remove_all - in: query - required: false - description: If true, remove all enclaves. Default is false - schema: - type: boolean + - $ref: '#/components/parameters/remove_all' responses: '200': description: Successful response @@ -82,12 +74,7 @@ paths: get: summary: Get Enclave Info parameters: - - name: enclave_identifier - in: path - required: true - description: UUID, shortened UUID, or name of the enclave - schema: - type: string + - $ref: '#/components/parameters/enclave_identifier' responses: '200': description: Successful response @@ -96,66 +83,41 @@ paths: schema: $ref: '#/components/schemas/EnclaveInfo' - - delete: summary: Destroy Enclave parameters: - - name: enclave_identifier - in: path - required: true - description: UUID, shortened UUID, or name of the enclave - schema: - type: string + - $ref: '#/components/parameters/enclave_identifier' responses: '200': description: Successful response - content: - application/json: - schema: - type: object /enclaves/{enclave_identifier}/logs: post: summary: Get Service Logs + parameters: + - $ref: '#/components/parameters/enclave_identifier' requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/GetServiceLogsArgs' - parameters: - - name: enclave_identifier - in: path - required: true - description: UUID, shortened UUID, or name of the enclave - schema: - type: string + $ref: '#/components/schemas/GetServiceLogs' responses: '200': description: Successful response content: application/json: schema: - $ref: '#/components/schemas/GetServiceLogsResponse' + $ref: '#/components/schemas/ServiceLogs' /enclaves/{enclave_identifier}/stop: post: summary: Stop Enclave parameters: - - name: enclave_identifier - in: path - required: true - description: UUID, shortened UUID, or name of the enclave - schema: - type: string + - $ref: '#/components/parameters/enclave_identifier' responses: '200': description: Successful response - content: - application/json: - schema: - type: object # ========================================================================================================================= # ========================================================================================================================= @@ -165,6 +127,24 @@ paths: components: + parameters: + + enclave_identifier: + name: enclave_identifier + in: path + required: true + description: UUID, shortened UUID, or name of the enclave + schema: + type: string + + remove_all: + name: remove_all + in: query + required: false + description: If true, remove all enclaves. Default is false + schema: + type: boolean + schemas: EngineInfo: @@ -274,7 +254,7 @@ components: items: $ref: '#/components/schemas/EnclaveNameAndUuid' - GetServiceLogsArgs: + GetServiceLogs: type: object properties: service_uuid_set: @@ -292,7 +272,7 @@ components: num_log_lines: type: integer - GetServiceLogsResponse: + ServiceLogs: type: object properties: service_logs_by_service_uuid: diff --git a/engine/server/engine/server/engine_rest_api_handler.go b/engine/server/engine/server/engine_rest_api_handler.go index 25d6e9f00d..472525f705 100644 --- a/engine/server/engine/server/engine_rest_api_handler.go +++ b/engine/server/engine/server/engine_rest_api_handler.go @@ -185,11 +185,8 @@ func (engine EngineRuntime) GetEnclaves(ctx context.Context, request api.GetEncl if err != nil { return nil, stacktrace.Propagate(err, "An error occurred getting info for enclaves") } - info_map_http := toHttpApiEnclaveInfos(infoForEnclaves) - response := api.GetEnclaves200JSONResponse{ - EnclaveInfo: &info_map_http, - } - return response, nil + response := toHttpApiEnclaveInfos(infoForEnclaves) + return api.GetEnclaves200JSONResponse(response), nil } // Create Enclave @@ -249,7 +246,7 @@ func (engine EngineRuntime) DeleteEnclavesEnclaveIdentifier(ctx context.Context, if err := engine.EnclaveManager.DestroyEnclave(ctx, enclaveIdentifier); err != nil { return nil, stacktrace.Propagate(err, "An error occurred destroying enclave with identifier '%v':", enclaveIdentifier) } - return api.DeleteEnclavesEnclaveIdentifier200JSONResponse{}, nil + return api.DeleteEnclavesEnclaveIdentifier200Response{}, nil } // Get Enclave Info @@ -359,7 +356,7 @@ func (engine EngineRuntime) PostEnclavesEnclaveIdentifierStop(ctx context.Contex return nil, stacktrace.Propagate(err, "An error occurred stopping enclave '%v'", enclaveIdentifier) } - return api.PostEnclavesEnclaveIdentifierStop200JSONResponse{}, nil + return api.PostEnclavesEnclaveIdentifierStop200Response{}, nil } // Get Engine Info @@ -447,7 +444,7 @@ func newLogsResponseHttp( requestedServiceUuids []user_service.ServiceUUID, serviceLogsByServiceUuid map[user_service.ServiceUUID][]logline.LogLine, initialNotFoundServiceUuids []string, -) *api.GetServiceLogsResponse { +) *api.ServiceLogs { serviceLogLinesByUuid := make(map[string]api.LogLine, len(serviceLogsByServiceUuid)) notFoundServiceUuids := make([]string, len(initialNotFoundServiceUuids)) for _, serviceUuid := range requestedServiceUuids { @@ -471,11 +468,11 @@ func newLogsResponseHttp( serviceLogLinesByUuid[serviceUuidStr] = logLines } - getServiceLogsResponse := &api.GetServiceLogsResponse{ + response := &api.ServiceLogs{ NotFoundServiceUuidSet: ¬FoundServiceUuids, ServiceLogsByServiceUuid: &serviceLogLinesByUuid, } - return getServiceLogsResponse + return response } func newHttpBindingsLogLineFromLogLines(logLines []logline.LogLine) api.LogLine { From b4247f6643bda944635cf072d33326ea552f702a Mon Sep 17 00:00:00 2001 From: lostbean Date: Fri, 17 Nov 2023 17:51:36 -0300 Subject: [PATCH 42/95] Update optionality on engine API schemas --- .../engine_server.gen.go | 43 +++++++-------- .../engine_types.gen.go | 46 ++++++++-------- api/openapi/engine/engine_service.yaml | 32 ++++++++++- .../engine/server/engine_rest_api_handler.go | 54 +++++++++---------- 4 files changed, 103 insertions(+), 72 deletions(-) diff --git a/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_server.gen.go b/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_server.gen.go index c778e57efe..d0e7d4dc99 100644 --- a/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_server.gen.go +++ b/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_server.gen.go @@ -639,27 +639,28 @@ func (sh *strictHandler) GetEngineInfo(ctx echo.Context) error { // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/8xYX2/qNhT/KpG3x6yw7Y03VliL1AIqqdTp6spykxNwldipfcKGKr77ZCchgRhIaXt1", - "39r4+Pz9nZ/P4Y2EMs2kAIGaDN5IxhRLAUHZ/0CECVsD5REI5DEHZb5GoEPFM+RSkAF5fJyMfE+vpEIQ", - "EHnF/1J5gqXgydjDFXilIuITbu5kDFfEJ0aCDFxWfKLgNecKIjJAlYNPdLiClBnzuMnMLY2KiyXZbo1s", - "KtdAWZK03ZvEnlXgFUIeS5LKG33ljSBmeYIe117MEr1z8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uGAR9cS5QDoFWI6XFVvnzcev9Yy7tQuKoaoe4m", + "oKS+YbwV2t4SrXp039kLCFuWCr0dLQO42AnU7jtNYlJeHBhRukMl2GluN+q1K9NVjofUWXp/syz0SDV9", + "DDO6zFWQtWweX+28Ho9BI4uTZi/vZdCre/lbk86GZE+eLoEqohug7WMRfVnC3nLnEZdsP2wWT/fearMe", + "Kt3mldKhfi9I46ApsBgou33vLQTZu/KaH5OGlrzN3APgDtSR+/Be7i2Nypficyp85EegIY/KmXLUBf1e", + "7t9zAX9nx7p3s0tCGUXyXzPiaNsk5hKRxvkAxAVo+62iAFMlzFQ3oEfnIWa8oxqwFUInkddHiCKyLlxR", + "8XSscpdgVdTjq/8izVE+K9SanvtdLpLRcdz8ZijVyJxuSnETAfyHNGGIoEZwsjJ0cXDA503Dt7KeF5vl", + "jt5v1t58tabe8qMp7uzZeuNZn5fPHufe/Tv6Yfmw/Gg70nxt6xCDxSIk0lCmwnDsdsLVdDWEpi+nlrbs", + "9g0Cbpohi7Yt+yMSR7p0thHca7IylCpmSGYkYAi/FQ34MstmwCuaFnKMzLu8lTnz7Yq4pGpaZHr3+93U", + "GJEJCJZwMiN/3k3vpsTNVsoskkm53eW7YAQINUu5FKuAzPJFo9yjdHa83ns/2eGoRSaNffD8bEiqEyl0", + "bvKP6bTofggC84knibifGZ981nn3rZfIIeQv96EMq/Z+u0t9H7QO08gp3cjyossVqojVqYI103dOqzYm", + "D4ANQL4ppltY1hwaLUy7IfAHwFbUidSWsLdSt+P+koLGv2Rw+m5pbG/t53ZfQ5XC+QdyqIXrLTDm3ju1", + "+25dY5MD1ygV91n2keEar97V0t8Y8WvW/OY61b2jbyRWHUqDYy1ovna/a53H96SO769uUpbPan3N6vUt", + "RaOSp5oT11vKm8bzcxROo/84hZZr/JiUg+j1XtUBNBssvhuo378LXuwLb9wGO6ZvyWahxCm0XM2mRpnc", + "mM2dOfoTlbzx5/IOMDPapBzd+htAtZX+0GKtrHxDrWZDZ6nk/H8AAAD//4uBl5ccGQAA", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_types.gen.go b/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_types.gen.go index 10ae153b99..a85aa644be 100644 --- a/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_types.gen.go +++ b/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_types.gen.go @@ -53,16 +53,16 @@ type DeletionSummary struct { // EnclaveAPIContainerHostMachineInfo defines model for EnclaveAPIContainerHostMachineInfo. type EnclaveAPIContainerHostMachineInfo struct { - GrpcPortOnHostMachine *int `json:"grpc_port_on_host_machine,omitempty"` - IpOnHostMachine *string `json:"ip_on_host_machine,omitempty"` + GrpcPortOnHostMachine int `json:"grpc_port_on_host_machine"` + IpOnHostMachine string `json:"ip_on_host_machine"` } // EnclaveAPIContainerInfo defines model for EnclaveAPIContainerInfo. type EnclaveAPIContainerInfo struct { - BridgeIpAddress *string `json:"bridge_ip_address,omitempty"` - ContainerId *string `json:"container_id,omitempty"` - GrpcPortInsideEnclave *int `json:"grpc_port_inside_enclave,omitempty"` - IpInsideEnclave *string `json:"ip_inside_enclave,omitempty"` + BridgeIpAddress string `json:"bridge_ip_address"` + ContainerId string `json:"container_id"` + GrpcPortInsideEnclave int `json:"grpc_port_inside_enclave"` + IpInsideEnclave string `json:"ip_inside_enclave"` } // EnclaveContainersStatus defines model for EnclaveContainersStatus. @@ -70,22 +70,22 @@ type EnclaveContainersStatus string // EnclaveIdentifiers defines model for EnclaveIdentifiers. type EnclaveIdentifiers struct { - EnclaveUuid *string `json:"enclave_uuid,omitempty"` - Name *string `json:"name,omitempty"` - ShortenedUuid *string `json:"shortened_uuid,omitempty"` + EnclaveUuid string `json:"enclave_uuid"` + Name string `json:"name"` + ShortenedUuid string `json:"shortened_uuid"` } // EnclaveInfo defines model for EnclaveInfo. type EnclaveInfo struct { ApiContainerHostMachineInfo *EnclaveAPIContainerHostMachineInfo `json:"api_container_host_machine_info,omitempty"` ApiContainerInfo *EnclaveAPIContainerInfo `json:"api_container_info,omitempty"` - ApiContainerStatus *ApiContainerStatus `json:"api_container_status,omitempty"` - ContainersStatus *EnclaveContainersStatus `json:"containers_status,omitempty"` - CreationTime *Timestamp `json:"creation_time,omitempty"` - EnclaveUuid *string `json:"enclave_uuid,omitempty"` - Mode *EnclaveMode `json:"mode,omitempty"` - Name *string `json:"name,omitempty"` - ShortenedUuid *string `json:"shortened_uuid,omitempty"` + ApiContainerStatus ApiContainerStatus `json:"api_container_status"` + ContainersStatus EnclaveContainersStatus `json:"containers_status"` + CreationTime Timestamp `json:"creation_time"` + EnclaveUuid string `json:"enclave_uuid"` + Mode EnclaveMode `json:"mode"` + Name string `json:"name"` + ShortenedUuid string `json:"shortened_uuid"` } // EnclaveMode defines model for EnclaveMode. @@ -93,13 +93,13 @@ type EnclaveMode string // EnclaveNameAndUuid defines model for EnclaveNameAndUuid. type EnclaveNameAndUuid struct { - Name *string `json:"name,omitempty"` - Uuid *string `json:"uuid,omitempty"` + Name string `json:"name"` + Uuid string `json:"uuid"` } // EngineInfo defines model for EngineInfo. type EngineInfo struct { - EngineVersion *string `json:"engine_version,omitempty"` + EngineVersion string `json:"engine_version"` } // GetServiceLogs defines model for GetServiceLogs. @@ -113,14 +113,14 @@ type GetServiceLogs struct { // LogLine defines model for LogLine. type LogLine struct { - Line *[]string `json:"line,omitempty"` - Timestamp *Timestamp `json:"timestamp,omitempty"` + Line []string `json:"line"` + Timestamp Timestamp `json:"timestamp"` } // LogLineFilter defines model for LogLineFilter. type LogLineFilter struct { - Operator *LogLineOperator `json:"operator,omitempty"` - TextPattern *string `json:"text_pattern,omitempty"` + Operator LogLineOperator `json:"operator"` + TextPattern string `json:"text_pattern"` } // LogLineOperator defines model for LogLineOperator. diff --git a/api/openapi/engine/engine_service.yaml b/api/openapi/engine/engine_service.yaml index b12b81f8f8..fc4a8ffa6a 100644 --- a/api/openapi/engine/engine_service.yaml +++ b/api/openapi/engine/engine_service.yaml @@ -152,6 +152,8 @@ components: properties: engine_version: type: string + required: + - engine_version CreateEnclave: type: object @@ -206,7 +208,14 @@ components: $ref: '#/components/schemas/Timestamp' mode: $ref: '#/components/schemas/EnclaveMode' - + required: + - enclave_uuid + - name + - shortened_uuid + - containers_status + - api_container_status + - creation_time + - mode EnclaveAPIContainerInfo: type: object @@ -219,6 +228,11 @@ components: type: integer bridge_ip_address: type: string + required: + - container_id + - ip_inside_enclave + - grpc_port_inside_enclave + - bridge_ip_address EnclaveAPIContainerHostMachineInfo: type: object @@ -227,6 +241,9 @@ components: type: string grpc_port_on_host_machine: type: integer + required: + - ip_on_host_machine + - grpc_port_on_host_machine EnclaveIdentifiers: type: object @@ -237,6 +254,10 @@ components: type: string shortened_uuid: type: string + required: + - enclave_uuid + - name + - shortened_uuid EnclaveNameAndUuid: type: object @@ -245,6 +266,9 @@ components: type: string uuid: type: string + required: + - name + - uuid DeletionSummary: type: object @@ -293,6 +317,9 @@ components: type: string timestamp: $ref: '#/components/schemas/Timestamp' + required: + - line + - timestamp LogLineFilter: type: object @@ -301,6 +328,9 @@ components: $ref: '#/components/schemas/LogLineOperator' text_pattern: type: string + required: + - operator + - text_pattern LogLineOperator: type: string diff --git a/engine/server/engine/server/engine_rest_api_handler.go b/engine/server/engine/server/engine_rest_api_handler.go index 472525f705..9f3fd66e4c 100644 --- a/engine/server/engine/server/engine_rest_api_handler.go +++ b/engine/server/engine/server/engine_rest_api_handler.go @@ -88,10 +88,10 @@ func toHttpApiEnclaveAPIContainerInfo(info *types.EnclaveAPIContainerInfo) api.E } port := int(info.GrpcPortInsideEnclave) return api.EnclaveAPIContainerInfo{ - ContainerId: &info.ContainerId, - IpInsideEnclave: &info.IpInsideEnclave, - GrpcPortInsideEnclave: &port, - BridgeIpAddress: &info.BridgeIpAddress, + ContainerId: info.ContainerId, + IpInsideEnclave: info.IpInsideEnclave, + GrpcPortInsideEnclave: port, + BridgeIpAddress: info.BridgeIpAddress, } } @@ -101,8 +101,8 @@ func toHttpApiApiContainerHostMachineInfo(info *types.EnclaveAPIContainerHostMac } port := int(info.GrpcPortOnHostMachine) return api.EnclaveAPIContainerHostMachineInfo{ - IpOnHostMachine: &info.IpOnHostMachine, - GrpcPortOnHostMachine: &port, + IpOnHostMachine: info.IpOnHostMachine, + GrpcPortOnHostMachine: port, } } @@ -124,15 +124,15 @@ func toHttpApiEnclaveInfo(info types.EnclaveInfo) api.EnclaveInfo { apiContainerStatus := toHttpApiContainerStatus(info.ApiContainerStatus) mode := toHttpApiEnclaveMode(info.Mode) return api.EnclaveInfo{ - EnclaveUuid: &info.EnclaveUuid, - ShortenedUuid: &info.ShortenedUuid, - Name: &info.Name, - ContainersStatus: &containersStatus, - ApiContainerStatus: &apiContainerStatus, + EnclaveUuid: info.EnclaveUuid, + ShortenedUuid: info.ShortenedUuid, + Name: info.Name, + ContainersStatus: containersStatus, + ApiContainerStatus: apiContainerStatus, ApiContainerInfo: &containerInfo, ApiContainerHostMachineInfo: &apiHostMachine, - CreationTime: &info.CreationTime, - Mode: &mode, + CreationTime: info.CreationTime, + Mode: mode, } } @@ -149,16 +149,16 @@ func toHttpApiEnclaveInfos(infos map[string]*types.EnclaveInfo) map[string]api.E func toHttpApiEnclaveIdentifiers(identifier *types.EnclaveIdentifiers) api.EnclaveIdentifiers { return api.EnclaveIdentifiers{ - EnclaveUuid: &identifier.EnclaveUuid, - Name: &identifier.Name, - ShortenedUuid: &identifier.ShortenedUuid, + EnclaveUuid: identifier.EnclaveUuid, + Name: identifier.Name, + ShortenedUuid: identifier.ShortenedUuid, } } func toHttpApiEnclaveNameAndUuid(identifier *types.EnclaveNameAndUuid) api.EnclaveNameAndUuid { return api.EnclaveNameAndUuid{ - Uuid: &identifier.Uuid, - Name: &identifier.Name, + Uuid: identifier.Uuid, + Name: identifier.Name, } } @@ -362,7 +362,7 @@ func (engine EngineRuntime) PostEnclavesEnclaveIdentifierStop(ctx context.Contex // Get Engine Info // (GET /engine/info) func (engine EngineRuntime) GetEngineInfo(ctx context.Context, request api.GetEngineInfoRequestObject) (api.GetEngineInfoResponseObject, error) { - result := api.EngineInfo{EngineVersion: &engine.ImageVersionTag} + result := api.EngineInfo{EngineVersion: engine.ImageVersionTag} return api.GetEngineInfo200JSONResponse(result), nil } @@ -459,8 +459,8 @@ func newLogsResponseHttp( // there is no new log lines but is a found UUID, so it has to be included in the service logs map if !found && !isInNotFoundUuidList { serviceLogLinesByUuid[serviceUuidStr] = api.LogLine{ - Line: nil, - Timestamp: nil, + Line: []string{}, + Timestamp: time.Now(), } } @@ -484,7 +484,7 @@ func newHttpBindingsLogLineFromLogLines(logLines []logline.LogLine) api.LogLine logTimestamp = logLine.GetTimestamp() } - return api.LogLine{Line: &logLinesStr, Timestamp: &logTimestamp} + return api.LogLine{Line: logLinesStr, Timestamp: logTimestamp} } @@ -497,15 +497,15 @@ func newConjunctiveLogLineFiltersFromHttpLogLineFilters( var filter *logline.LogLineFilter operator := logLineFilter.Operator filterTextPattern := logLineFilter.TextPattern - switch *operator { + switch operator { case api.DOESCONTAINTEXT: - filter = logline.NewDoesContainTextLogLineFilter(*filterTextPattern) + filter = logline.NewDoesContainTextLogLineFilter(filterTextPattern) case api.DOESNOTCONTAINTEXT: - filter = logline.NewDoesNotContainTextLogLineFilter(*filterTextPattern) + filter = logline.NewDoesNotContainTextLogLineFilter(filterTextPattern) case api.DOESCONTAINMATCHREGEX: - filter = logline.NewDoesContainMatchRegexLogLineFilter(*filterTextPattern) + filter = logline.NewDoesContainMatchRegexLogLineFilter(filterTextPattern) case api.DOESNOTCONTAINMATCHREGEX: - filter = logline.NewDoesNotContainMatchRegexLogLineFilter(*filterTextPattern) + filter = logline.NewDoesNotContainMatchRegexLogLineFilter(filterTextPattern) default: return nil, stacktrace.NewError("Unrecognized log line filter operator '%v' in GRPC filter '%v'; this is a bug in Kurtosis", operator, logLineFilter) } From 7634d73cd30a4a3733f7d5c1846d0e7f908fb5c6 Mon Sep 17 00:00:00 2001 From: lostbean Date: Fri, 17 Nov 2023 18:14:10 -0300 Subject: [PATCH 43/95] use utils functions --- .../engine/server/engine_rest_api_handler.go | 38 ++++--------------- 1 file changed, 8 insertions(+), 30 deletions(-) diff --git a/engine/server/engine/server/engine_rest_api_handler.go b/engine/server/engine/server/engine_rest_api_handler.go index 9f3fd66e4c..6dbf025125 100644 --- a/engine/server/engine/server/engine_rest_api_handler.go +++ b/engine/server/engine/server/engine_rest_api_handler.go @@ -82,10 +82,7 @@ func toHttpApiContainerStatus(status types.ContainerStatus) api.ApiContainerStat } } -func toHttpApiEnclaveAPIContainerInfo(info *types.EnclaveAPIContainerInfo) api.EnclaveAPIContainerInfo { - if info == nil { - return api.EnclaveAPIContainerInfo{} - } +func toHttpApiEnclaveAPIContainerInfo(info types.EnclaveAPIContainerInfo) api.EnclaveAPIContainerInfo { port := int(info.GrpcPortInsideEnclave) return api.EnclaveAPIContainerInfo{ ContainerId: info.ContainerId, @@ -95,10 +92,7 @@ func toHttpApiEnclaveAPIContainerInfo(info *types.EnclaveAPIContainerInfo) api.E } } -func toHttpApiApiContainerHostMachineInfo(info *types.EnclaveAPIContainerHostMachineInfo) api.EnclaveAPIContainerHostMachineInfo { - if info == nil { - return api.EnclaveAPIContainerHostMachineInfo{} - } +func toHttpApiApiContainerHostMachineInfo(info types.EnclaveAPIContainerHostMachineInfo) api.EnclaveAPIContainerHostMachineInfo { port := int(info.GrpcPortOnHostMachine) return api.EnclaveAPIContainerHostMachineInfo{ IpOnHostMachine: info.IpOnHostMachine, @@ -118,33 +112,17 @@ func toHttpApiEnclaveMode(mode types.EnclaveMode) api.EnclaveMode { } func toHttpApiEnclaveInfo(info types.EnclaveInfo) api.EnclaveInfo { - containerInfo := toHttpApiEnclaveAPIContainerInfo(info.ApiContainerInfo) - apiHostMachine := toHttpApiApiContainerHostMachineInfo(info.ApiContainerHostMachineInfo) - containersStatus := toHttpApiEnclaveContainersStatus(info.EnclaveContainersStatus) - apiContainerStatus := toHttpApiContainerStatus(info.ApiContainerStatus) - mode := toHttpApiEnclaveMode(info.Mode) return api.EnclaveInfo{ EnclaveUuid: info.EnclaveUuid, ShortenedUuid: info.ShortenedUuid, Name: info.Name, - ContainersStatus: containersStatus, - ApiContainerStatus: apiContainerStatus, - ApiContainerInfo: &containerInfo, - ApiContainerHostMachineInfo: &apiHostMachine, + ContainersStatus: toHttpApiEnclaveContainersStatus(info.EnclaveContainersStatus), + ApiContainerStatus: toHttpApiContainerStatus(info.ApiContainerStatus), + ApiContainerInfo: utils.MapPointer(info.ApiContainerInfo, toHttpApiEnclaveAPIContainerInfo), + ApiContainerHostMachineInfo: utils.MapPointer(info.ApiContainerHostMachineInfo, toHttpApiApiContainerHostMachineInfo), CreationTime: info.CreationTime, - Mode: mode, - } -} - -func toHttpApiEnclaveInfos(infos map[string]*types.EnclaveInfo) map[string]api.EnclaveInfo { - info_map := make(map[string]api.EnclaveInfo) - for key, info := range infos { - if info != nil { - grpc_info := toHttpApiEnclaveInfo(*info) - info_map[key] = grpc_info - } + Mode: toHttpApiEnclaveMode(info.Mode), } - return info_map } func toHttpApiEnclaveIdentifiers(identifier *types.EnclaveIdentifiers) api.EnclaveIdentifiers { @@ -185,7 +163,7 @@ func (engine EngineRuntime) GetEnclaves(ctx context.Context, request api.GetEncl if err != nil { return nil, stacktrace.Propagate(err, "An error occurred getting info for enclaves") } - response := toHttpApiEnclaveInfos(infoForEnclaves) + response := utils.MapMapValues(infoForEnclaves, func(enclave *types.EnclaveInfo) api.EnclaveInfo { return toHttpApiEnclaveInfo(*enclave) }) return api.GetEnclaves200JSONResponse(response), nil } From bf99e58c6afacb66e4abf94010db486268d90190 Mon Sep 17 00:00:00 2001 From: lostbean Date: Fri, 17 Nov 2023 18:35:31 -0300 Subject: [PATCH 44/95] rename schemas on enclave API --- .../api_container_server.gen.go | 142 +++++++++-------- .../api_container_types.gen.go | 148 +++++++++--------- api/openapi/core/core_service.yaml | 99 +++++------- .../engine/server/enclave_rest_api_handler.go | 22 ++- 4 files changed, 188 insertions(+), 223 deletions(-) diff --git a/api/golang/core/kurtosis_core_rest_api_bindings/api_container_server.gen.go b/api/golang/core/kurtosis_core_rest_api_bindings/api_container_server.gen.go index 6ffb23cd79..7f10a57f21 100644 --- a/api/golang/core/kurtosis_core_rest_api_bindings/api_container_server.gen.go +++ b/api/golang/core/kurtosis_core_rest_api_bindings/api_container_server.gen.go @@ -463,7 +463,7 @@ type GetEnclavesEnclaveIdentifierArtifactsResponseObject interface { VisitGetEnclavesEnclaveIdentifierArtifactsResponse(w http.ResponseWriter) error } -type GetEnclavesEnclaveIdentifierArtifacts200JSONResponse ListFilesArtifactNamesAndUuidsResponse +type GetEnclavesEnclaveIdentifierArtifacts200JSONResponse []FileArtifactReference func (response GetEnclavesEnclaveIdentifierArtifacts200JSONResponse) VisitGetEnclavesEnclaveIdentifierArtifactsResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -536,7 +536,7 @@ type GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierResponseObject inter VisitGetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierResponse(w http.ResponseWriter) error } -type GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier200JSONResponse InspectFilesArtifactContentsResponse +type GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier200JSONResponse InspectFilesArtifactContents func (response GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier200JSONResponse) VisitGetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -600,13 +600,12 @@ type PostEnclavesEnclaveIdentifierServicesConnectionResponseObject interface { VisitPostEnclavesEnclaveIdentifierServicesConnectionResponse(w http.ResponseWriter) error } -type PostEnclavesEnclaveIdentifierServicesConnection200JSONResponse ConnectServicesResponse +type PostEnclavesEnclaveIdentifierServicesConnection200Response struct { +} -func (response PostEnclavesEnclaveIdentifierServicesConnection200JSONResponse) VisitPostEnclavesEnclaveIdentifierServicesConnectionResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "application/json") +func (response PostEnclavesEnclaveIdentifierServicesConnection200Response) VisitPostEnclavesEnclaveIdentifierServicesConnectionResponse(w http.ResponseWriter) error { w.WriteHeader(200) - - return json.NewEncoder(w).Encode(response) + return nil } type GetEnclavesEnclaveIdentifierServicesHistoryRequestObject struct { @@ -654,7 +653,7 @@ type PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandResponseObject VisitPostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandResponse(w http.ResponseWriter) error } -type PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand200JSONResponse ExecCommandResponse +type PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand200JSONResponse ExecCommandResult func (response PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand200JSONResponse) VisitPostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -690,7 +689,7 @@ type GetEnclavesEnclaveIdentifierStarlarkResponseObject interface { VisitGetEnclavesEnclaveIdentifierStarlarkResponse(w http.ResponseWriter) error } -type GetEnclavesEnclaveIdentifierStarlark200JSONResponse GetStarlarkRunResponse +type GetEnclavesEnclaveIdentifierStarlark200JSONResponse StarlarkDescription func (response GetEnclavesEnclaveIdentifierStarlark200JSONResponse) VisitGetEnclavesEnclaveIdentifierStarlarkResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -1322,69 +1321,68 @@ func (sh *strictHandler) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx echo.C // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/+w8a28bN7Z/hZh7gbQLxcpmF8WFvzmOnQhNZMGy63tRB1Nq5khiwyGnfNhWA/33C740", - "MxqOPHJsJ1v0y2arIQ8Pz/tFf0kyXpScAVMyOfySlFjgAhQI+19YKDLHmUpJDkyROQFhfs5BZoKUinCW", - "HCYXS0BhIWK4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6fAQjObf6FA8ox", - "jggouIog9LuWCmE0p3hhCE5Ybnw1OCGwImatWc2wECZJDsFCRhRvy+vVZCHm5GpWbmrx6nQGf5ulb2CW", - "vonx+CtZh56pXV1j2ltiiuNrsaNNeSNSpjtisUI/MZFLxikFi7Vhm8kyBo6JvtAvFBht992oPnWTcU0E", - "/KnRGpXvDNxfDdkFJCDYAca2OBqXuBfoegeN2ZxH6+pVnbtX3bfKcko9oyRLSZniPI+0aCb2OxpNkPkO", - "UqJ/cK2M4f2HvYXvz6HbJQio38swVwDOlnhG4ZqNzy5ODtFV6IsZixYqc9UG9kIhoRkjbDFofMpJbr7l", - "MCfMCMbK9jfkAHltmOHsM7Ac5RwsEKlL2wARYP4xMay7Z3WWIeSgK/XzRLFn7CrX35eKRSv4XyWzpSA3", - "WEE3v4y81ZjFt0hcuUzPuF2HPM39g9r1a1V4wQ99imfS2umjaey3a50ED3EiBBex0qrPwVIIC3byIUAL", - "2xxY4+CZAlEKUHh/aKPG3g3IG0xJ/gBwv2z2eVBRxsRv0iaQ+TktQEqf9fdh+uZeMTttjM6DAUoldBZv", - "3GCx0EWY/ugVu0XAHol419JSydhwG/PWcGgJXO17dxWdyFR+JmUJ9YSsFpOWXJJwwp43mIStfSlprhwj", - "5k7sBZQCpImZTeoUv0QtbjLgbKz5cIZPaiTZdvxUF6xnNdFkap0Xo4RB38mOPjifg9RUtTGuUaYuLmKz", - "fC8StY3Ho2rxuWanhBG5hPzkxo93bGm0NPlXKnWWgZRzTe+Vh6rbux8iE8EXxqNHhEALAUylUkGZEm94", - "+o8lNLbvV57mJm80++RXi06tC/jBi+KWRw75zsZso03nYhDjeW+HVvkxR7p+VmfOt0zeAwzWttGstGBP", - "QF7bbOjmxCTd5zZ18TIZoGbp3Mt9CkHwewJqKsx6kNxiYeL5viCu/PKd0rLt5x9V668qhJtA/U32BssF", - "NNpvp4IXPjqMl5j6FTeaLfpolMu1yFw1sGPkcyY51QqQW4nMynom5351B22q+rwkvqofDYQb9YMaAj7x", - "+dRFoiuYNagUH/exS9EVzFBzuKJnZWB/GmoRqYVfnn9AiqNQ1LKgNuOzvShjwO6gyBUm6pSL0NI8qk1u", - "xuliNqBTLtD7i4vJphWKjpojn00SzXi+ShXcRbqbo7nPET0cAUoLJpFaEulKZ838PAhHgcVnyBGWYdiU", - "AvoBDhYH6D1QytEVFzT/8SBG6KVSZVqAWnIbGYas593JRTJIJmfT+NwhYUQRTNMcKF6lBaGUSMg4y2UH", - "891MLJ+j+lrDTNvM1UwRGtpTbOFlREjl6JphSvuW+rp0zurYVloeRnQP0EjZKretYSgsFLolallDQ1Is", - "lweW06EEjX7zYIZLwFQtf4tX3ZXwbG+i9BHf1YiyuSXCSkFRKhlmb4m3AH7e1lNqQW4MmXRpi3VOSswP", - "mCHnhAf9BmEscr2YON7NwBmoW7AjSu6+g4eEJetaNLBVxpyMzFEFZqTUNLQnfCnFtjGJogbUiS+LucbE", - "DQjpAPzT3JeXwHBJksPkXwevDl4lTlzsZYcB1vBLe/J9PQxGxq5dQERzPxCpkGFg07QZ3IzuW6c5ypPD", - "5B0oj6T0/1YF3KParvprgl/jPrxaMoyM668/2dklG6pZvF+/erU1M12bzBj+Ll0sVQ1M7wobes62WJZu", - "eZJNzI78gHfiBq/7smBo258vQ3ut5DLCDtdhlwhv8SMMUoYminVnaLqSCooWqyZc9uDVB4OOAfN4TAtz", - "753TZo3R+OHWXPz6K/n+kKrjfWNHdRV/bHlwnc1KIKJjQ0CpDC3L+guHWjTRkpXNIMgtzPYTHN1Dbs4t", - "2k8oOI+i6N0xYoyX3VFi8+XH+glNU4coPoXk+QBADr+0X7usHyKLGS9XHXKI61HL40pieNTRaig+imAO", - "7t0VeSr0pOK8MytcN1OGv5C0fok8H1x3BjR+3HfzIgyYnzHZfoPwgPAm/J9nl7TYA8onjZN6DU0/H7eH", - "wdl1sj2Mf8gd7rCX5XmgIITz/3MEgmcK1EupBOBi7xeHj8X34IlqfO3PjmD/H4vmW1cCauxIwNC4rwUo", - "O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VfDkdEfXG2+mXi6q6b6lfDIihdiOH3xr/bsV6iDfqSHGUvqM8", + "++qT/DVQbXmgUxSqSj2D6qEZMfGa4HqxRNjN+gCqOt3TgLl6qTnhQrmywGa56zuB/P5ZzX9J5Ll0Ylf9", + "MILCdgXRiGtbFfHhLkxPXPta/1Z/xWyOYqnq9xNCs/18kLDEj+B89Om8aD27fkIT4skPfduu7FPB2Hy1", + "coAulkQiqaB07wUcPMIb0eaL0gyz1r9KY6ubkZe7+1mI9mT5g9c9nkAzKnENv9X91usePkdDeO474u7F", + "n5YgXkk0gyWm88ex3/85eik3o9Fx/lymNILQZ0jP7tUmvNmTF/u3GH68LFHAryMmvzNip34XP3AOofuW", + "9U/gdYG3Xv9/AAAA//8IxCQR5U8AAA==", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/api/golang/core/kurtosis_core_rest_api_bindings/api_container_types.gen.go b/api/golang/core/kurtosis_core_rest_api_bindings/api_container_types.gen.go index a0780b9856..21058c92d9 100644 --- a/api/golang/core/kurtosis_core_rest_api_bindings/api_container_types.gen.go +++ b/api/golang/core/kurtosis_core_rest_api_bindings/api_container_types.gen.go @@ -31,13 +31,6 @@ const ( NOINSTRUCTIONSCACHING KurtosisFeatureFlag = "NO_INSTRUCTIONS_CACHING" ) -// Defines values for PortTransportProtocol. -const ( - SCTP PortTransportProtocol = "SCTP" - TCP PortTransportProtocol = "TCP" - UDP PortTransportProtocol = "UDP" -) - // Defines values for RestartPolicy. const ( RestartPolicyALWAYS RestartPolicy = "ALWAYS" @@ -51,26 +44,30 @@ const ( ServiceStatusUNKNOWN ServiceStatus = "UNKNOWN" ) -// Defines values for WaitForEndpointAvailabilityArgsHttpMethod. +// Defines values for TransportProtocol. +const ( + SCTP TransportProtocol = "SCTP" + TCP TransportProtocol = "TCP" + UDP TransportProtocol = "UDP" +) + +// Defines values for WaitForEndpointAvailabilityHttpMethod. const ( - GET WaitForEndpointAvailabilityArgsHttpMethod = "GET" - POST WaitForEndpointAvailabilityArgsHttpMethod = "POST" + GET WaitForEndpointAvailabilityHttpMethod = "GET" + POST WaitForEndpointAvailabilityHttpMethod = "POST" ) // Connect 0 - CONNECT // Best effort port forwarding // 1 - NO_CONNECT // Port forwarding disabled type Connect string -// ConnectServicesArgs defines model for ConnectServicesArgs. -type ConnectServicesArgs struct { +// ConnectServices defines model for ConnectServices. +type ConnectServices struct { // Connect 0 - CONNECT // Best effort port forwarding // 1 - NO_CONNECT // Port forwarding disabled Connect *Connect `json:"connect,omitempty"` } -// ConnectServicesResponse defines model for ConnectServicesResponse. -type ConnectServicesResponse = map[string]interface{} - // Container defines model for Container. type Container struct { CmdArgs *[]string `json:"cmd_args,omitempty"` @@ -89,21 +86,21 @@ type Container struct { // 2 - UNKNOWN type ContainerStatus string -// ExecCommandArgs Exec Command -type ExecCommandArgs struct { +// ExecCommand Exec Command +type ExecCommand struct { CommandArgs *[]string `json:"command_args,omitempty"` } -// ExecCommandResponse defines model for ExecCommandResponse. -type ExecCommandResponse struct { +// ExecCommandResult defines model for ExecCommandResult. +type ExecCommandResult struct { ExitCode *int32 `json:"exit_code,omitempty"` // LogOutput Assumes UTF-8 encoding LogOutput *string `json:"log_output,omitempty"` } -// FileArtifactContentsFileDescription defines model for FileArtifactContentsFileDescription. -type FileArtifactContentsFileDescription struct { +// FileArtifactDescription defines model for FileArtifactDescription. +type FileArtifactDescription struct { // Path Path relative to the file artifact Path *string `json:"path,omitempty"` @@ -123,38 +120,18 @@ type FileArtifactReference struct { Uuid *string `json:"uuid,omitempty"` } -// GetStarlarkRunResponse defines model for GetStarlarkRunResponse. -type GetStarlarkRunResponse struct { - ExperimentalFeatures *[]KurtosisFeatureFlag `json:"experimental_features,omitempty"` - MainFunctionName *string `json:"main_function_name,omitempty"` - PackageId *string `json:"package_id,omitempty"` - Parallelism *int32 `json:"parallelism,omitempty"` - RelativePathToMainFile *string `json:"relative_path_to_main_file,omitempty"` - - // RestartPolicy 0 - NEVER - // 1 - ALWAYS - RestartPolicy *RestartPolicy `json:"restart_policy,omitempty"` - SerializedParams *string `json:"serialized_params,omitempty"` - SerializedScript *string `json:"serialized_script,omitempty"` -} - // ImageDownloadMode 0 - ALWAYS // 1 - MISSING type ImageDownloadMode string -// InspectFilesArtifactContentsResponse defines model for InspectFilesArtifactContentsResponse. -type InspectFilesArtifactContentsResponse struct { - FileDescriptions *[]FileArtifactContentsFileDescription `json:"file_descriptions,omitempty"` +// InspectFilesArtifactContents defines model for InspectFilesArtifactContents. +type InspectFilesArtifactContents struct { + FileDescriptions *[]FileArtifactDescription `json:"file_descriptions,omitempty"` } // KurtosisFeatureFlag 0 - NO_INSTRUCTIONS_CACHING type KurtosisFeatureFlag string -// ListFilesArtifactNamesAndUuidsResponse defines model for ListFilesArtifactNamesAndUuidsResponse. -type ListFilesArtifactNamesAndUuidsResponse struct { - FileNamesAndUuids *[]FileArtifactReference `json:"file_names_and_uuids,omitempty"` -} - // Port Shared Objects (Used By Multiple Endpoints) type Port struct { MaybeApplicationProtocol *string `json:"maybe_application_protocol,omitempty"` @@ -166,20 +143,15 @@ type Port struct { // TransportProtocol 0 - TCP // 1 - SCTP // 2 - UDP - TransportProtocol PortTransportProtocol `json:"transport_protocol"` + TransportProtocol TransportProtocol `json:"transport_protocol"` } -// PortTransportProtocol 0 - TCP -// 1 - SCTP -// 2 - UDP -type PortTransportProtocol string - // RestartPolicy 0 - NEVER // 1 - ALWAYS type RestartPolicy string -// RunStarlarkPackageArgs defines model for RunStarlarkPackageArgs. -type RunStarlarkPackageArgs struct { +// RunStarlarkPackage defines model for RunStarlarkPackage. +type RunStarlarkPackage struct { // ClonePackage Whether the package should be cloned or not. // If false, then the package will be pulled from the APIC local package store. If it's a local package then is must // have been uploaded using UploadStarlarkPackage prior to calling RunStarlarkPackage. @@ -220,8 +192,8 @@ type RunStarlarkPackageArgs struct { Remote *bool `json:"remote,omitempty"` } -// RunStarlarkScriptArgs defines model for RunStarlarkScriptArgs. -type RunStarlarkScriptArgs struct { +// RunStarlarkScript defines model for RunStarlarkScript. +type RunStarlarkScript struct { // CloudInstanceId Defaults to empty CloudInstanceId *string `json:"cloud_instance_id,omitempty"` @@ -292,6 +264,21 @@ type ServiceInfo struct { // 2 - UNKNOWN type ServiceStatus string +// StarlarkDescription defines model for StarlarkDescription. +type StarlarkDescription struct { + ExperimentalFeatures *[]KurtosisFeatureFlag `json:"experimental_features,omitempty"` + MainFunctionName *string `json:"main_function_name,omitempty"` + PackageId *string `json:"package_id,omitempty"` + Parallelism *int32 `json:"parallelism,omitempty"` + RelativePathToMainFile *string `json:"relative_path_to_main_file,omitempty"` + + // RestartPolicy 0 - NEVER + // 1 - ALWAYS + RestartPolicy *RestartPolicy `json:"restart_policy,omitempty"` + SerializedParams *string `json:"serialized_params,omitempty"` + SerializedScript *string `json:"serialized_script,omitempty"` +} + // StarlarkError defines model for StarlarkError. type StarlarkError struct { ExecutionError *StarlarkExecutionError `json:"execution_error,omitempty"` @@ -311,15 +298,15 @@ type StarlarkInfo struct { // StarlarkInstruction defines model for StarlarkInstruction. type StarlarkInstruction struct { - Arguments *[]StarlarkInstructionArg `json:"arguments,omitempty"` - ExecutableInstruction *string `json:"executable_instruction,omitempty"` - InstructionName *string `json:"instruction_name,omitempty"` - IsSkipped *bool `json:"is_skipped,omitempty"` - Position *StarlarkInstructionPosition `json:"position,omitempty"` + Arguments *[]StarlarkInstructionArgument `json:"arguments,omitempty"` + ExecutableInstruction *string `json:"executable_instruction,omitempty"` + InstructionName *string `json:"instruction_name,omitempty"` + IsSkipped *bool `json:"is_skipped,omitempty"` + Position *StarlarkInstructionPosition `json:"position,omitempty"` } -// StarlarkInstructionArg defines model for StarlarkInstructionArg. -type StarlarkInstructionArg struct { +// StarlarkInstructionArgument defines model for StarlarkInstructionArgument. +type StarlarkInstructionArgument struct { ArgName *string `json:"arg_name,omitempty"` IsRepresentative *bool `json:"is_representative,omitempty"` SerializedArgValue *string `json:"serialized_arg_value,omitempty"` @@ -376,8 +363,8 @@ type StarlarkWarning struct { WarningMessage *string `json:"warning_message,omitempty"` } -// StoreFilesArtifactFromServiceArgs defines model for StoreFilesArtifactFromServiceArgs. -type StoreFilesArtifactFromServiceArgs struct { +// StoreFilesArtifactFromService defines model for StoreFilesArtifactFromService. +type StoreFilesArtifactFromService struct { // Name The name of the files artifact Name string `json:"name"` @@ -385,8 +372,8 @@ type StoreFilesArtifactFromServiceArgs struct { SourcePath string `json:"source_path"` } -// StoreWebFilesArtifactArgs Store Web Files Artifact -type StoreWebFilesArtifactArgs struct { +// StoreWebFilesArtifact Store Web Files Artifact +type StoreWebFilesArtifact struct { // Name The name of the files artifact Name string `json:"name"` @@ -394,11 +381,16 @@ type StoreWebFilesArtifactArgs struct { Url string `json:"url"` } -// WaitForEndpointAvailabilityArgs Wait For HTTP Endpoint Availability -type WaitForEndpointAvailabilityArgs struct { +// TransportProtocol 0 - TCP +// 1 - SCTP +// 2 - UDP +type TransportProtocol string + +// WaitForEndpointAvailability Wait For HTTP Endpoint Availability +type WaitForEndpointAvailability struct { // BodyText If the endpoint returns this value, the service will be marked as available (e.g. Hello World). - BodyText *string `json:"body_text,omitempty"` - HttpMethod *WaitForEndpointAvailabilityArgsHttpMethod `json:"http_method,omitempty"` + BodyText *string `json:"body_text,omitempty"` + HttpMethod *WaitForEndpointAvailabilityHttpMethod `json:"http_method,omitempty"` // InitialDelayMilliseconds The number of milliseconds to wait until executing the first HTTP call InitialDelayMilliseconds *int32 `json:"initial_delay_milliseconds,omitempty"` @@ -413,8 +405,8 @@ type WaitForEndpointAvailabilityArgs struct { RetriesDelayMilliseconds *int32 `json:"retries_delay_milliseconds,omitempty"` } -// WaitForEndpointAvailabilityArgsHttpMethod defines model for WaitForEndpointAvailabilityArgs.HttpMethod. -type WaitForEndpointAvailabilityArgsHttpMethod string +// WaitForEndpointAvailabilityHttpMethod defines model for WaitForEndpointAvailability.HttpMethod. +type WaitForEndpointAvailabilityHttpMethod string // ArtifactIdentifier defines model for artifact_identifier. type ArtifactIdentifier = string @@ -447,25 +439,25 @@ type PostEnclavesEnclaveIdentifierStarlarkPackagesMultipartBody = openapi_types. type PostEnclavesEnclaveIdentifierArtifactsLocalFileMultipartRequestBody = PostEnclavesEnclaveIdentifierArtifactsLocalFileMultipartBody // PutEnclavesEnclaveIdentifierArtifactsRemoteFileJSONRequestBody defines body for PutEnclavesEnclaveIdentifierArtifactsRemoteFile for application/json ContentType. -type PutEnclavesEnclaveIdentifierArtifactsRemoteFileJSONRequestBody = StoreWebFilesArtifactArgs +type PutEnclavesEnclaveIdentifierArtifactsRemoteFileJSONRequestBody = StoreWebFilesArtifact // PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierJSONRequestBody defines body for PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier for application/json ContentType. -type PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierJSONRequestBody = StoreFilesArtifactFromServiceArgs +type PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierJSONRequestBody = StoreFilesArtifactFromService // PostEnclavesEnclaveIdentifierServicesConnectionJSONRequestBody defines body for PostEnclavesEnclaveIdentifierServicesConnection for application/json ContentType. -type PostEnclavesEnclaveIdentifierServicesConnectionJSONRequestBody = ConnectServicesArgs +type PostEnclavesEnclaveIdentifierServicesConnectionJSONRequestBody = ConnectServices // PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandJSONRequestBody defines body for PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand for application/json ContentType. -type PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandJSONRequestBody = ExecCommandArgs +type PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandJSONRequestBody = ExecCommand // PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityJSONRequestBody defines body for PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability for application/json ContentType. -type PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityJSONRequestBody = WaitForEndpointAvailabilityArgs +type PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityJSONRequestBody = WaitForEndpointAvailability // PostEnclavesEnclaveIdentifierStarlarkPackagesMultipartRequestBody defines body for PostEnclavesEnclaveIdentifierStarlarkPackages for multipart/form-data ContentType. type PostEnclavesEnclaveIdentifierStarlarkPackagesMultipartRequestBody = PostEnclavesEnclaveIdentifierStarlarkPackagesMultipartBody // PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdJSONRequestBody defines body for PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId for application/json ContentType. -type PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdJSONRequestBody = RunStarlarkPackageArgs +type PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdJSONRequestBody = RunStarlarkPackage // PostEnclavesEnclaveIdentifierStarlarkScriptsJSONRequestBody defines body for PostEnclavesEnclaveIdentifierStarlarkScripts for application/json ContentType. -type PostEnclavesEnclaveIdentifierStarlarkScriptsJSONRequestBody = RunStarlarkScriptArgs +type PostEnclavesEnclaveIdentifierStarlarkScriptsJSONRequestBody = RunStarlarkScript diff --git a/api/openapi/core/core_service.yaml b/api/openapi/core/core_service.yaml index 872b9516b1..a54aa8b007 100644 --- a/api/openapi/core/core_service.yaml +++ b/api/openapi/core/core_service.yaml @@ -16,7 +16,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/GetStarlarkRunResponse" + $ref: "#/components/schemas/StarlarkDescription" /enclaves/{enclave_identifier}/starlark/packages: post: @@ -39,7 +39,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/RunStarlarkPackageArgs" + $ref: "#/components/schemas/RunStarlarkPackage" required: true responses: "200": @@ -64,7 +64,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/RunStarlarkScriptArgs" + $ref: "#/components/schemas/RunStarlarkScript" required: true responses: "200": @@ -139,7 +139,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/ExecCommandArgs" + $ref: "#/components/schemas/ExecCommand" description: Exec Command required: true responses: @@ -148,7 +148,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/ExecCommandResponse" + $ref: "#/components/schemas/ExecCommandResult" /enclaves/{enclave_identifier}/services/{service_identifier}/endpoints/{port_number}/availability: post: @@ -161,7 +161,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/WaitForEndpointAvailabilityArgs" + $ref: "#/components/schemas/WaitForEndpointAvailability" description: Wait For HTTP Get Endpoint Availability required: true responses: @@ -179,7 +179,9 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/ListFilesArtifactNamesAndUuidsResponse" + type: array + items: + $ref: "#/components/schemas/FileArtifactReference" /enclaves/{enclave_identifier}/artifacts/{artifact_identifier}: get: @@ -193,7 +195,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/InspectFilesArtifactContentsResponse" + $ref: "#/components/schemas/InspectFilesArtifactContents" /enclaves/{enclave_identifier}/artifacts/{artifact_identifier}/download: get: @@ -236,7 +238,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/StoreWebFilesArtifactArgs" + $ref: "#/components/schemas/StoreWebFilesArtifact" description: Store Web Files Artifact required: true responses: @@ -257,7 +259,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/StoreFilesArtifactFromServiceArgs" + $ref: "#/components/schemas/StoreFilesArtifactFromService" required: true responses: "200": @@ -276,18 +278,22 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/ConnectServicesArgs" + $ref: "#/components/schemas/ConnectServices" required: true responses: "200": description: Successful request - content: - application/json: - schema: - $ref: "#/components/schemas/ConnectServicesResponse" + +# ========================================================================================================================= +# ========================================================================================================================= +# > > > > > > > > > > > > > > > > > > > > > > > > Data Models < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < +# ========================================================================================================================= +# ========================================================================================================================= + components: parameters: + enclave_identifier: in: path name: enclave_identifier @@ -347,7 +353,7 @@ components: type: integer format: int32 transport_protocol: - $ref: "#/components/schemas/Port.TransportProtocol" + $ref: "#/components/schemas/TransportProtocol" maybe_application_protocol: type: string maybe_wait_timeout: @@ -362,7 +368,7 @@ components: type: object properties: status: - $ref: "#/components/schemas/Container.Status" + $ref: "#/components/schemas/ContainerStatus" image_name: type: string entrypoint_args: @@ -440,7 +446,7 @@ components: 0 - CONNECT // Best effort port forwarding 1 - NO_CONNECT // Port forwarding disabled - RunStarlarkScriptArgs: + RunStarlarkScript: type: object properties: serialized_script: @@ -475,7 +481,7 @@ components: required: - serialized_script - RunStarlarkPackageArgs: + RunStarlarkPackage: type: object properties: package_id: @@ -575,7 +581,7 @@ components: arguments: type: array items: - $ref: "#/components/schemas/StarlarkInstructionArg" + $ref: "#/components/schemas/StarlarkInstructionArgument" executable_instruction: type: string is_skipped: @@ -587,7 +593,7 @@ components: serialized_instruction_result: type: string - StarlarkInstructionArg: + StarlarkInstructionArgument: type: object properties: serialized_arg_value: @@ -679,7 +685,7 @@ components: description: The shortened uuid of the service description: An service identifier is a collection of uuid, name and shortened uuid - ExecCommandArgs: + ExecCommand: type: object properties: command_args: @@ -689,7 +695,7 @@ components: description: |- Exec Command - ExecCommandResponse: + ExecCommandResult: type: object properties: exit_code: @@ -699,7 +705,7 @@ components: type: string description: Assumes UTF-8 encoding - WaitForEndpointAvailabilityArgs: + WaitForEndpointAvailability: type: object properties: http_method: @@ -737,16 +743,7 @@ components: description: |- Files Artifact identifier - DownloadFilesArtifactArgs: - type: object - properties: - identifier: - type: string - description: Files identifier to get bytes for - description: |- - Download Files Artifact - - StoreWebFilesArtifactArgs: + StoreWebFilesArtifact: type: object properties: url: @@ -761,7 +758,7 @@ components: description: |- Store Web Files Artifact - StoreFilesArtifactFromServiceArgs: + StoreFilesArtifactFromService: type: object properties: source_path: @@ -774,29 +771,15 @@ components: - source_path - name - ListFilesArtifactNamesAndUuidsResponse: - type: object - properties: - file_names_and_uuids: - type: array - items: - $ref: "#/components/schemas/FileArtifactReference" - - InspectFilesArtifactContentsRequest: - type: object - properties: - file_names_and_uuid: - $ref: "#/components/schemas/FileArtifactReference" - - InspectFilesArtifactContentsResponse: + InspectFilesArtifactContents: type: object properties: file_descriptions: type: array items: - $ref: "#/components/schemas/FileArtifactContentsFileDescription" + $ref: "#/components/schemas/FileArtifactDescription" - FileArtifactContentsFileDescription: + FileArtifactDescription: type: object properties: path: @@ -810,16 +793,12 @@ components: type: string description: A bit of text content, if the file allows (similar to UNIX's 'head') - ConnectServicesArgs: + ConnectServices: type: object properties: connect: $ref: "#/components/schemas/Connect" - ConnectServicesResponse: - type: object - properties: {} - RestartPolicy: type: string enum: @@ -829,7 +808,7 @@ components: 0 - NEVER 1 - ALWAYS - GetStarlarkRunResponse: + StarlarkDescription: type: object properties: package_id: @@ -852,7 +831,7 @@ components: restart_policy: $ref: "#/components/schemas/RestartPolicy" - Port.TransportProtocol: + TransportProtocol: type: string enum: - TCP @@ -863,7 +842,7 @@ components: 1 - SCTP 2 - UDP - Container.Status: + ContainerStatus: type: string enum: - STOPPED diff --git a/engine/server/engine/server/enclave_rest_api_handler.go b/engine/server/engine/server/enclave_rest_api_handler.go index 563bb9a43a..b7858cf4ba 100644 --- a/engine/server/engine/server/enclave_rest_api_handler.go +++ b/engine/server/engine/server/enclave_rest_api_handler.go @@ -66,7 +66,7 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierArtifacts(ctx context return nil, err } - http_artifacts := utils.MapList( + results := utils.MapList( artifacts.FileNamesAndUuids, func(x *kurtosis_core_rpc_api_bindings.FilesArtifactNameAndUuid) kurtosis_core_rest_api_bindings.FileArtifactReference { return kurtosis_core_rest_api_bindings.FileArtifactReference{ @@ -75,11 +75,7 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierArtifacts(ctx context } }) - result := api.ListFilesArtifactNamesAndUuidsResponse{ - FileNamesAndUuids: &http_artifacts, - } - return api.GetEnclavesEnclaveIdentifierArtifacts200JSONResponse(result), nil - + return api.GetEnclavesEnclaveIdentifierArtifacts200JSONResponse(results), nil } // (POST /enclaves/{enclave_identifier}/artifacts/local-file) @@ -201,16 +197,16 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierArtifactsArtifactIden artifact_content_list := utils.MapList( stored_artifact.FileDescriptions, - func(x *kurtosis_core_rpc_api_bindings.FileArtifactContentsFileDescription) api.FileArtifactContentsFileDescription { + func(x *kurtosis_core_rpc_api_bindings.FileArtifactContentsFileDescription) api.FileArtifactDescription { size := int64(x.Size) - return api.FileArtifactContentsFileDescription{ + return api.FileArtifactDescription{ Path: &x.Path, Size: &size, TextPreview: x.TextPreview, } }) - artifact_response := api.InspectFilesArtifactContentsResponse{ + artifact_response := api.InspectFilesArtifactContents{ FileDescriptions: &artifact_content_list, } @@ -307,7 +303,7 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierServicesConnection(c return nil, stacktrace.NewError("Can't list services using gRPC call with enclave %s", enclave_identifier) } - return api.PostEnclavesEnclaveIdentifierServicesConnection200JSONResponse{}, nil + return api.PostEnclavesEnclaveIdentifierServicesConnection200Response{}, nil } // (GET /enclaves/{enclave_identifier}/services/{service_identifier}) @@ -352,7 +348,7 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierServicesServiceIdent return nil, stacktrace.NewError("Can't execute commands using gRPC call with enclave %s", enclave_identifier) } - response := api.ExecCommandResponse{ + response := api.ExecCommandResult{ ExitCode: &exec_result.ExitCode, LogOutput: &exec_result.LogOutput, } @@ -421,7 +417,7 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierStarlark(ctx context. flags := utils.MapList(starlark_result.ExperimentalFeatures, toHttpFeatureFlag) policy := toHttpRestartPolicy(starlark_result.RestartPolicy) - response := api.GetStarlarkRunResponse{ + response := api.StarlarkDescription{ ExperimentalFeatures: &flags, MainFunctionName: &starlark_result.MainFunctionName, PackageId: &starlark_result.PackageId, @@ -626,7 +622,7 @@ func toHttpContainerStatus(status kurtosis_core_rpc_api_bindings.Container_Statu } } -func toHttpTransportProtocol(protocol kurtosis_core_rpc_api_bindings.Port_TransportProtocol) api.PortTransportProtocol { +func toHttpTransportProtocol(protocol kurtosis_core_rpc_api_bindings.Port_TransportProtocol) api.TransportProtocol { switch protocol { case kurtosis_core_rpc_api_bindings.Port_TCP: return api.TCP From 7298781e17a5fe86b2dacc2f134e2486dd5f3e32 Mon Sep 17 00:00:00 2001 From: lostbean Date: Fri, 17 Nov 2023 22:32:46 -0300 Subject: [PATCH 45/95] Update optionality on core API schemas --- .../api_container_server.gen.go | 128 ++--- .../api_container_types.gen.go | 458 ++++++++++++++---- api/openapi/core/core_service.yaml | 250 +++++++--- .../engine/server/enclave_rest_api_handler.go | 94 ++-- 4 files changed, 654 insertions(+), 276 deletions(-) diff --git a/api/golang/core/kurtosis_core_rest_api_bindings/api_container_server.gen.go b/api/golang/core/kurtosis_core_rest_api_bindings/api_container_server.gen.go index 7f10a57f21..8d6799f73c 100644 --- a/api/golang/core/kurtosis_core_rest_api_bindings/api_container_server.gen.go +++ b/api/golang/core/kurtosis_core_rest_api_bindings/api_container_server.gen.go @@ -536,7 +536,7 @@ type GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierResponseObject inter VisitGetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierResponse(w http.ResponseWriter) error } -type GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier200JSONResponse InspectFilesArtifactContents +type GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier200JSONResponse []FileArtifactDescription func (response GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier200JSONResponse) VisitGetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -1321,68 +1321,70 @@ func (sh *strictHandler) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx echo.C // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/+xce28bOZL/KkTfAZlZKFY2u1gc/J/j2ImwiSxY9voO46CX6i5JnLDJXj5sawJ99wNf", - "/VBTc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M85pmj6/0RsfRv0owXKo/", + "OtdoBQ7evtesn7+DJ1xt7XxO/3frf6T2Ubsv6obDIQlix/3Gk/bD4h6vKKe7bX9g99W/+B9+uz+xdFZE", + "Ki7Wnbb20iUCK0cB4TkvbVIBHog0ebPb8s2bX/6GLDSSYooqJ+PwU/7BYfVvk24INLI/4w2617d/tHn9", + "4dzsZ3Jva1bwhQQzSnffSgibQVupBRuALckdsO2HUFwLO/Zt27vY7HHmsSXoyqca/lhhVfUrFQFRN75T", + "8XIRVvvbFC+miL7MI0dfK18C2oxwo+QU1tK3lKdfXD1gp6imktCqH22rQvH2OTDRsZvg5XKFsF31HtSW", + "uqdR5u0b+ikXylYQmpWx76Tk+1dVv830XGeir9QY0MJ6sVGLq6vg+HgXZqBeu76DTn9FI0exVLtXbqJk", + "h/kgfosfwfkY0mNSC9uf0IQ48CPXqS+HVDOabwuP0NWKSCQVFPadklUP/5K/+u4/xaz2nS9TCA18X+Ew", + "C1FfLH/wGsgTnIytuEZfd08sNgN8jorw7Dji9l12KUG8kmgOK0wX38Z+9+/4pdyMyiOT5zKlAQ19hlTt", + "QY34zdbA0Ge0frzskNdfC0x+Z42dOSx+4NxB+4sD/1G8tuJtNv8fAAD//22Zx2Q3VQAA", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/api/golang/core/kurtosis_core_rest_api_bindings/api_container_types.gen.go b/api/golang/core/kurtosis_core_rest_api_bindings/api_container_types.gen.go index 21058c92d9..6e1f416801 100644 --- a/api/golang/core/kurtosis_core_rest_api_bindings/api_container_types.gen.go +++ b/api/golang/core/kurtosis_core_rest_api_bindings/api_container_types.gen.go @@ -4,6 +4,9 @@ package kurtosis_core_rest_api_bindings import ( + "encoding/json" + + "github.com/deepmap/oapi-codegen/pkg/runtime" openapi_types "github.com/deepmap/oapi-codegen/pkg/types" ) @@ -61,24 +64,17 @@ const ( // 1 - NO_CONNECT // Port forwarding disabled type Connect string -// ConnectServices defines model for ConnectServices. -type ConnectServices struct { - // Connect 0 - CONNECT // Best effort port forwarding - // 1 - NO_CONNECT // Port forwarding disabled - Connect *Connect `json:"connect,omitempty"` -} - // Container defines model for Container. type Container struct { - CmdArgs *[]string `json:"cmd_args,omitempty"` - EntrypointArgs *[]string `json:"entrypoint_args,omitempty"` - EnvVars *map[string]string `json:"env_vars,omitempty"` - ImageName *string `json:"image_name,omitempty"` + CmdArgs []string `json:"cmd_args"` + EntrypointArgs []string `json:"entrypoint_args"` + EnvVars map[string]string `json:"env_vars"` + ImageName string `json:"image_name"` // Status 0 - STOPPED // 1 - RUNNING // 2 - UNKNOWN - Status *ContainerStatus `json:"status,omitempty"` + Status ContainerStatus `json:"status"` } // ContainerStatus 0 - STOPPED @@ -88,24 +84,24 @@ type ContainerStatus string // ExecCommand Exec Command type ExecCommand struct { - CommandArgs *[]string `json:"command_args,omitempty"` + CommandArgs []string `json:"command_args"` } // ExecCommandResult defines model for ExecCommandResult. type ExecCommandResult struct { - ExitCode *int32 `json:"exit_code,omitempty"` + ExitCode int32 `json:"exit_code"` // LogOutput Assumes UTF-8 encoding - LogOutput *string `json:"log_output,omitempty"` + LogOutput string `json:"log_output"` } // FileArtifactDescription defines model for FileArtifactDescription. type FileArtifactDescription struct { // Path Path relative to the file artifact - Path *string `json:"path,omitempty"` + Path string `json:"path"` // Size Size of the file, in bytes - Size *int64 `json:"size,omitempty"` + Size int64 `json:"size"` // TextPreview A bit of text content, if the file allows (similar to UNIX's 'head') TextPreview *string `json:"text_preview,omitempty"` @@ -114,36 +110,31 @@ type FileArtifactDescription struct { // FileArtifactReference Files Artifact identifier type FileArtifactReference struct { // Name UUID of the files artifact, for use when referencing it in the future - Name *string `json:"name,omitempty"` + Name string `json:"name"` // Uuid UUID of the files artifact, for use when referencing it in the future - Uuid *string `json:"uuid,omitempty"` + Uuid string `json:"uuid"` } // ImageDownloadMode 0 - ALWAYS // 1 - MISSING type ImageDownloadMode string -// InspectFilesArtifactContents defines model for InspectFilesArtifactContents. -type InspectFilesArtifactContents struct { - FileDescriptions *[]FileArtifactDescription `json:"file_descriptions,omitempty"` -} - // KurtosisFeatureFlag 0 - NO_INSTRUCTIONS_CACHING type KurtosisFeatureFlag string // Port Shared Objects (Used By Multiple Endpoints) type Port struct { - MaybeApplicationProtocol *string `json:"maybe_application_protocol,omitempty"` - - // MaybeWaitTimeout The wait timeout duration in string - MaybeWaitTimeout *string `json:"maybe_wait_timeout,omitempty"` - Number int32 `json:"number"` + ApplicationProtocol *string `json:"application_protocol,omitempty"` + Number int32 `json:"number"` // TransportProtocol 0 - TCP // 1 - SCTP // 2 - UDP TransportProtocol TransportProtocol `json:"transport_protocol"` + + // WaitTimeout The wait timeout duration in string + WaitTimeout *string `json:"wait_timeout,omitempty"` } // RestartPolicy 0 - NEVER @@ -222,41 +213,41 @@ type RunStarlarkScript struct { // ServiceIdentifiers An service identifier is a collection of uuid, name and shortened uuid type ServiceIdentifiers struct { // Name Name of the service - Name *string `json:"name,omitempty"` + Name string `json:"name"` // ServiceUuid UUID of the service - ServiceUuid *string `json:"service_uuid,omitempty"` + ServiceUuid string `json:"service_uuid"` // ShortenedUuid The shortened uuid of the service - ShortenedUuid *string `json:"shortened_uuid,omitempty"` + ShortenedUuid string `json:"shortened_uuid"` } // ServiceInfo defines model for ServiceInfo. type ServiceInfo struct { - Container *Container `json:"container,omitempty"` - - // MaybePublicIpAddr Public IP address *outside* the enclave where the service is reachable - // NOTE: Will be empty if the service isn't running, the service didn't define any ports, or the backend doesn't support reporting public service info - MaybePublicIpAddr *string `json:"maybe_public_ip_addr,omitempty"` - MaybePublicPorts *map[string]Port `json:"maybe_public_ports,omitempty"` + Container Container `json:"container"` // Name Name of the service - Name *string `json:"name,omitempty"` + Name string `json:"name"` // PrivateIpAddr The IP address of the service inside the enclave - PrivateIpAddr *string `json:"private_ip_addr,omitempty"` - PrivatePorts *map[string]Port `json:"private_ports,omitempty"` + PrivateIpAddr string `json:"private_ip_addr"` + PrivatePorts map[string]Port `json:"private_ports"` + + // PublicIpAddr Public IP address *outside* the enclave where the service is reachable + // NOTE: Will be empty if the service isn't running, the service didn't define any ports, or the backend doesn't support reporting public service info + PublicIpAddr *string `json:"public_ip_addr,omitempty"` + PublicPorts *map[string]Port `json:"public_ports,omitempty"` // ServiceStatus 0 - STOPPED // 1 - RUNNING // 2 - UNKNOWN - ServiceStatus *ServiceStatus `json:"service_status,omitempty"` + ServiceStatus ServiceStatus `json:"service_status"` // ServiceUuid UUID of the service - ServiceUuid *string `json:"service_uuid,omitempty"` + ServiceUuid string `json:"service_uuid"` // ShortenedUuid Shortened uuid of the service - ShortenedUuid *string `json:"shortened_uuid,omitempty"` + ShortenedUuid string `json:"shortened_uuid"` } // ServiceStatus 0 - STOPPED @@ -266,101 +257,116 @@ type ServiceStatus string // StarlarkDescription defines model for StarlarkDescription. type StarlarkDescription struct { - ExperimentalFeatures *[]KurtosisFeatureFlag `json:"experimental_features,omitempty"` - MainFunctionName *string `json:"main_function_name,omitempty"` - PackageId *string `json:"package_id,omitempty"` - Parallelism *int32 `json:"parallelism,omitempty"` - RelativePathToMainFile *string `json:"relative_path_to_main_file,omitempty"` + ExperimentalFeatures []KurtosisFeatureFlag `json:"experimental_features"` + MainFunctionName string `json:"main_function_name"` + PackageId string `json:"package_id"` + Parallelism int32 `json:"parallelism"` + RelativePathToMainFile string `json:"relative_path_to_main_file"` // RestartPolicy 0 - NEVER // 1 - ALWAYS - RestartPolicy *RestartPolicy `json:"restart_policy,omitempty"` - SerializedParams *string `json:"serialized_params,omitempty"` - SerializedScript *string `json:"serialized_script,omitempty"` + RestartPolicy RestartPolicy `json:"restart_policy"` + SerializedParams string `json:"serialized_params"` + SerializedScript string `json:"serialized_script"` } // StarlarkError defines model for StarlarkError. type StarlarkError struct { - ExecutionError *StarlarkExecutionError `json:"execution_error,omitempty"` - InterpretationError *StarlarkInterpretationError `json:"interpretation_error,omitempty"` - ValidationError *StarlarkValidationError `json:"validation_error,omitempty"` + Error StarlarkError_Error `json:"error"` +} + +// StarlarkError_Error defines model for StarlarkError.Error. +type StarlarkError_Error struct { + union json.RawMessage } // StarlarkExecutionError defines model for StarlarkExecutionError. type StarlarkExecutionError struct { - ErrorMessage *string `json:"error_message,omitempty"` + ExecutionError struct { + ErrorMessage string `json:"error_message"` + } `json:"execution_error"` } // StarlarkInfo defines model for StarlarkInfo. type StarlarkInfo struct { - InfoMessage *string `json:"info_message,omitempty"` + Info struct { + Instruction struct { + InfoMessage string `json:"info_message"` + } `json:"instruction"` + } `json:"info"` } // StarlarkInstruction defines model for StarlarkInstruction. type StarlarkInstruction struct { - Arguments *[]StarlarkInstructionArgument `json:"arguments,omitempty"` - ExecutableInstruction *string `json:"executable_instruction,omitempty"` - InstructionName *string `json:"instruction_name,omitempty"` - IsSkipped *bool `json:"is_skipped,omitempty"` - Position *StarlarkInstructionPosition `json:"position,omitempty"` + Arguments []StarlarkInstructionArgument `json:"arguments"` + ExecutableInstruction string `json:"executable_instruction"` + InstructionName string `json:"instruction_name"` + IsSkipped bool `json:"is_skipped"` + Position StarlarkInstructionPosition `json:"position"` } // StarlarkInstructionArgument defines model for StarlarkInstructionArgument. type StarlarkInstructionArgument struct { ArgName *string `json:"arg_name,omitempty"` - IsRepresentative *bool `json:"is_representative,omitempty"` - SerializedArgValue *string `json:"serialized_arg_value,omitempty"` + IsRepresentative bool `json:"is_representative"` + SerializedArgValue string `json:"serialized_arg_value"` } // StarlarkInstructionPosition defines model for StarlarkInstructionPosition. type StarlarkInstructionPosition struct { - Column *int32 `json:"column,omitempty"` - Filename *string `json:"filename,omitempty"` - Line *int32 `json:"line,omitempty"` + Column int32 `json:"column"` + Filename string `json:"filename"` + Line int32 `json:"line"` } // StarlarkInstructionResult defines model for StarlarkInstructionResult. type StarlarkInstructionResult struct { - SerializedInstructionResult *string `json:"serialized_instruction_result,omitempty"` + InstructionResult struct { + SerializedInstructionResult string `json:"serialized_instruction_result"` + } `json:"instruction_result"` } // StarlarkInterpretationError defines model for StarlarkInterpretationError. type StarlarkInterpretationError struct { - ErrorMessage *string `json:"error_message,omitempty"` + InterpretationError struct { + ErrorMessage string `json:"error_message"` + } `json:"interpretation_error"` } // StarlarkRunFinishedEvent defines model for StarlarkRunFinishedEvent. type StarlarkRunFinishedEvent struct { - IsRunSuccessful *bool `json:"is_run_successful,omitempty"` - SerializedOutput *string `json:"serialized_output,omitempty"` + RunFinishedEvent struct { + IsRunSuccessful bool `json:"is_run_successful"` + SerializedOutput string `json:"serialized_output"` + } `json:"run_finished_event"` } // StarlarkRunProgress defines model for StarlarkRunProgress. type StarlarkRunProgress struct { - CurrentStepInfo *[]string `json:"current_step_info,omitempty"` - CurrentStepNumber *int32 `json:"current_step_number,omitempty"` - TotalSteps *int32 `json:"total_steps,omitempty"` + ProgressInfo struct { + CurrentStepInfo []string `json:"current_step_info"` + CurrentStepNumber int32 `json:"current_step_number"` + TotalSteps int32 `json:"total_steps"` + } `json:"progress_info"` } // StarlarkRunResponseLine Starlark Execution Response type StarlarkRunResponseLine struct { - Error *StarlarkError `json:"error,omitempty"` - Info *StarlarkInfo `json:"info,omitempty"` - Instruction *StarlarkInstruction `json:"instruction,omitempty"` - InstructionResult *StarlarkInstructionResult `json:"instruction_result,omitempty"` - ProgressInfo *StarlarkRunProgress `json:"progress_info,omitempty"` - RunFinishedEvent *StarlarkRunFinishedEvent `json:"run_finished_event,omitempty"` - Warning *StarlarkWarning `json:"warning,omitempty"` + union json.RawMessage } // StarlarkValidationError defines model for StarlarkValidationError. type StarlarkValidationError struct { - ErrorMessage *string `json:"error_message,omitempty"` + ValidationError struct { + ErrorMessage string `json:"error_message"` + } `json:"validation_error"` } // StarlarkWarning defines model for StarlarkWarning. type StarlarkWarning struct { - WarningMessage *string `json:"warning_message,omitempty"` + Warning struct { + WarningMessage string `json:"warning_message"` + } `json:"warning"` } // StoreFilesArtifactFromService defines model for StoreFilesArtifactFromService. @@ -389,8 +395,8 @@ type TransportProtocol string // WaitForEndpointAvailability Wait For HTTP Endpoint Availability type WaitForEndpointAvailability struct { // BodyText If the endpoint returns this value, the service will be marked as available (e.g. Hello World). - BodyText *string `json:"body_text,omitempty"` - HttpMethod *WaitForEndpointAvailabilityHttpMethod `json:"http_method,omitempty"` + BodyText *string `json:"body_text,omitempty"` + HttpMethod WaitForEndpointAvailabilityHttpMethod `json:"http_method"` // InitialDelayMilliseconds The number of milliseconds to wait until executing the first HTTP call InitialDelayMilliseconds *int32 `json:"initial_delay_milliseconds,omitempty"` @@ -445,7 +451,7 @@ type PutEnclavesEnclaveIdentifierArtifactsRemoteFileJSONRequestBody = StoreWebFi type PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierJSONRequestBody = StoreFilesArtifactFromService // PostEnclavesEnclaveIdentifierServicesConnectionJSONRequestBody defines body for PostEnclavesEnclaveIdentifierServicesConnection for application/json ContentType. -type PostEnclavesEnclaveIdentifierServicesConnectionJSONRequestBody = ConnectServices +type PostEnclavesEnclaveIdentifierServicesConnectionJSONRequestBody = Connect // PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandJSONRequestBody defines body for PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand for application/json ContentType. type PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandJSONRequestBody = ExecCommand @@ -461,3 +467,283 @@ type PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdJSONRequestBody = Run // PostEnclavesEnclaveIdentifierStarlarkScriptsJSONRequestBody defines body for PostEnclavesEnclaveIdentifierStarlarkScripts for application/json ContentType. type PostEnclavesEnclaveIdentifierStarlarkScriptsJSONRequestBody = RunStarlarkScript + +// AsStarlarkInterpretationError returns the union data inside the StarlarkError_Error as a StarlarkInterpretationError +func (t StarlarkError_Error) AsStarlarkInterpretationError() (StarlarkInterpretationError, error) { + var body StarlarkInterpretationError + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromStarlarkInterpretationError overwrites any union data inside the StarlarkError_Error as the provided StarlarkInterpretationError +func (t *StarlarkError_Error) FromStarlarkInterpretationError(v StarlarkInterpretationError) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeStarlarkInterpretationError performs a merge with any union data inside the StarlarkError_Error, using the provided StarlarkInterpretationError +func (t *StarlarkError_Error) MergeStarlarkInterpretationError(v StarlarkInterpretationError) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JsonMerge(b, t.union) + t.union = merged + return err +} + +// AsStarlarkValidationError returns the union data inside the StarlarkError_Error as a StarlarkValidationError +func (t StarlarkError_Error) AsStarlarkValidationError() (StarlarkValidationError, error) { + var body StarlarkValidationError + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromStarlarkValidationError overwrites any union data inside the StarlarkError_Error as the provided StarlarkValidationError +func (t *StarlarkError_Error) FromStarlarkValidationError(v StarlarkValidationError) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeStarlarkValidationError performs a merge with any union data inside the StarlarkError_Error, using the provided StarlarkValidationError +func (t *StarlarkError_Error) MergeStarlarkValidationError(v StarlarkValidationError) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JsonMerge(b, t.union) + t.union = merged + return err +} + +// AsStarlarkExecutionError returns the union data inside the StarlarkError_Error as a StarlarkExecutionError +func (t StarlarkError_Error) AsStarlarkExecutionError() (StarlarkExecutionError, error) { + var body StarlarkExecutionError + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromStarlarkExecutionError overwrites any union data inside the StarlarkError_Error as the provided StarlarkExecutionError +func (t *StarlarkError_Error) FromStarlarkExecutionError(v StarlarkExecutionError) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeStarlarkExecutionError performs a merge with any union data inside the StarlarkError_Error, using the provided StarlarkExecutionError +func (t *StarlarkError_Error) MergeStarlarkExecutionError(v StarlarkExecutionError) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JsonMerge(b, t.union) + t.union = merged + return err +} + +func (t StarlarkError_Error) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *StarlarkError_Error) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsStarlarkInstruction returns the union data inside the StarlarkRunResponseLine as a StarlarkInstruction +func (t StarlarkRunResponseLine) AsStarlarkInstruction() (StarlarkInstruction, error) { + var body StarlarkInstruction + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromStarlarkInstruction overwrites any union data inside the StarlarkRunResponseLine as the provided StarlarkInstruction +func (t *StarlarkRunResponseLine) FromStarlarkInstruction(v StarlarkInstruction) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeStarlarkInstruction performs a merge with any union data inside the StarlarkRunResponseLine, using the provided StarlarkInstruction +func (t *StarlarkRunResponseLine) MergeStarlarkInstruction(v StarlarkInstruction) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JsonMerge(b, t.union) + t.union = merged + return err +} + +// AsStarlarkError returns the union data inside the StarlarkRunResponseLine as a StarlarkError +func (t StarlarkRunResponseLine) AsStarlarkError() (StarlarkError, error) { + var body StarlarkError + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromStarlarkError overwrites any union data inside the StarlarkRunResponseLine as the provided StarlarkError +func (t *StarlarkRunResponseLine) FromStarlarkError(v StarlarkError) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeStarlarkError performs a merge with any union data inside the StarlarkRunResponseLine, using the provided StarlarkError +func (t *StarlarkRunResponseLine) MergeStarlarkError(v StarlarkError) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JsonMerge(b, t.union) + t.union = merged + return err +} + +// AsStarlarkRunProgress returns the union data inside the StarlarkRunResponseLine as a StarlarkRunProgress +func (t StarlarkRunResponseLine) AsStarlarkRunProgress() (StarlarkRunProgress, error) { + var body StarlarkRunProgress + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromStarlarkRunProgress overwrites any union data inside the StarlarkRunResponseLine as the provided StarlarkRunProgress +func (t *StarlarkRunResponseLine) FromStarlarkRunProgress(v StarlarkRunProgress) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeStarlarkRunProgress performs a merge with any union data inside the StarlarkRunResponseLine, using the provided StarlarkRunProgress +func (t *StarlarkRunResponseLine) MergeStarlarkRunProgress(v StarlarkRunProgress) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JsonMerge(b, t.union) + t.union = merged + return err +} + +// AsStarlarkInstructionResult returns the union data inside the StarlarkRunResponseLine as a StarlarkInstructionResult +func (t StarlarkRunResponseLine) AsStarlarkInstructionResult() (StarlarkInstructionResult, error) { + var body StarlarkInstructionResult + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromStarlarkInstructionResult overwrites any union data inside the StarlarkRunResponseLine as the provided StarlarkInstructionResult +func (t *StarlarkRunResponseLine) FromStarlarkInstructionResult(v StarlarkInstructionResult) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeStarlarkInstructionResult performs a merge with any union data inside the StarlarkRunResponseLine, using the provided StarlarkInstructionResult +func (t *StarlarkRunResponseLine) MergeStarlarkInstructionResult(v StarlarkInstructionResult) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JsonMerge(b, t.union) + t.union = merged + return err +} + +// AsStarlarkRunFinishedEvent returns the union data inside the StarlarkRunResponseLine as a StarlarkRunFinishedEvent +func (t StarlarkRunResponseLine) AsStarlarkRunFinishedEvent() (StarlarkRunFinishedEvent, error) { + var body StarlarkRunFinishedEvent + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromStarlarkRunFinishedEvent overwrites any union data inside the StarlarkRunResponseLine as the provided StarlarkRunFinishedEvent +func (t *StarlarkRunResponseLine) FromStarlarkRunFinishedEvent(v StarlarkRunFinishedEvent) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeStarlarkRunFinishedEvent performs a merge with any union data inside the StarlarkRunResponseLine, using the provided StarlarkRunFinishedEvent +func (t *StarlarkRunResponseLine) MergeStarlarkRunFinishedEvent(v StarlarkRunFinishedEvent) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JsonMerge(b, t.union) + t.union = merged + return err +} + +// AsStarlarkWarning returns the union data inside the StarlarkRunResponseLine as a StarlarkWarning +func (t StarlarkRunResponseLine) AsStarlarkWarning() (StarlarkWarning, error) { + var body StarlarkWarning + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromStarlarkWarning overwrites any union data inside the StarlarkRunResponseLine as the provided StarlarkWarning +func (t *StarlarkRunResponseLine) FromStarlarkWarning(v StarlarkWarning) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeStarlarkWarning performs a merge with any union data inside the StarlarkRunResponseLine, using the provided StarlarkWarning +func (t *StarlarkRunResponseLine) MergeStarlarkWarning(v StarlarkWarning) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JsonMerge(b, t.union) + t.union = merged + return err +} + +// AsStarlarkInfo returns the union data inside the StarlarkRunResponseLine as a StarlarkInfo +func (t StarlarkRunResponseLine) AsStarlarkInfo() (StarlarkInfo, error) { + var body StarlarkInfo + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromStarlarkInfo overwrites any union data inside the StarlarkRunResponseLine as the provided StarlarkInfo +func (t *StarlarkRunResponseLine) FromStarlarkInfo(v StarlarkInfo) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeStarlarkInfo performs a merge with any union data inside the StarlarkRunResponseLine, using the provided StarlarkInfo +func (t *StarlarkRunResponseLine) MergeStarlarkInfo(v StarlarkInfo) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JsonMerge(b, t.union) + t.union = merged + return err +} + +func (t StarlarkRunResponseLine) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *StarlarkRunResponseLine) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} diff --git a/api/openapi/core/core_service.yaml b/api/openapi/core/core_service.yaml index a54aa8b007..366709d92c 100644 --- a/api/openapi/core/core_service.yaml +++ b/api/openapi/core/core_service.yaml @@ -1,8 +1,10 @@ openapi: 3.0.0 + info: title: Enclave API description: API to manipulate the enclaves - version: "1" + version: 0.1.0 + paths: /enclaves/{enclave_identifier}/starlark: @@ -195,7 +197,9 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/InspectFilesArtifactContents" + type: array + items: + $ref: "#/components/schemas/FileArtifactDescription" /enclaves/{enclave_identifier}/artifacts/{artifact_identifier}/download: get: @@ -278,7 +282,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/ConnectServices" + $ref: "#/components/schemas/Connect" required: true responses: "200": @@ -354,9 +358,9 @@ components: format: int32 transport_protocol: $ref: "#/components/schemas/TransportProtocol" - maybe_application_protocol: + application_protocol: type: string - maybe_wait_timeout: + wait_timeout: type: string description: The wait timeout duration in string required: @@ -383,6 +387,12 @@ components: type: object additionalProperties: type: string + required: + - status + - image_name + - entrypoint_args + - cmd_args + - env_vars ServiceStatus: type: string @@ -417,12 +427,12 @@ components: type: object additionalProperties: $ref: "#/components/schemas/Port" - maybe_public_ip_addr: + public_ip_addr: type: string description: |- Public IP address *outside* the enclave where the service is reachable NOTE: Will be empty if the service isn't running, the service didn't define any ports, or the backend doesn't support reporting public service info - maybe_public_ports: + public_ports: type: object additionalProperties: $ref: "#/components/schemas/Port" @@ -436,6 +446,14 @@ components: $ref: "#/components/schemas/ServiceStatus" container: $ref: "#/components/schemas/Container" + required: + - service_uuid + - private_ip_addr + - private_ports + - name + - shortened_uuid + - service_status + - container Connect: type: string @@ -537,39 +555,51 @@ components: type: string enum: - NO_INSTRUCTIONS_CACHING - description: "0 - NO_INSTRUCTIONS_CACHING " + description: |- + 0 - NO_INSTRUCTIONS_CACHING StarlarkRunResponseLine: - type: object - properties: - instruction: - $ref: "#/components/schemas/StarlarkInstruction" - error: - $ref: "#/components/schemas/StarlarkError" - progress_info: - $ref: "#/components/schemas/StarlarkRunProgress" - instruction_result: - $ref: "#/components/schemas/StarlarkInstructionResult" - run_finished_event: - $ref: "#/components/schemas/StarlarkRunFinishedEvent" - warning: - $ref: "#/components/schemas/StarlarkWarning" - info: - $ref: "#/components/schemas/StarlarkInfo" + oneOf: + - $ref: "#/components/schemas/StarlarkInstruction" + - $ref: "#/components/schemas/StarlarkError" + - $ref: "#/components/schemas/StarlarkRunProgress" + - $ref: "#/components/schemas/StarlarkInstructionResult" + - $ref: "#/components/schemas/StarlarkRunFinishedEvent" + - $ref: "#/components/schemas/StarlarkWarning" + - $ref: "#/components/schemas/StarlarkInfo" description: |- Starlark Execution Response StarlarkInfo: type: object properties: - info_message: - type: string + info: + type: object + properties: + instruction: + type: object + properties: + info_message: + type: string + required: + - info_message + required: + - instruction + required: + - info StarlarkWarning: type: object properties: - warning_message: - type: string + warning: + type: object + properties: + warning_message: + type: string + required: + - warning_message + required: + - warning StarlarkInstruction: type: object @@ -586,12 +616,25 @@ components: type: string is_skipped: type: boolean + required: + - position + - instruction_name + - arguments + - executable_instruction + - is_skipped StarlarkInstructionResult: type: object properties: - serialized_instruction_result: - type: string + instruction_result: + type: object + properties: + serialized_instruction_result: + type: string + required: + - serialized_instruction_result + required: + - instruction_result StarlarkInstructionArgument: type: object @@ -602,6 +645,9 @@ components: type: string is_representative: type: boolean + required: + - serialized_arg_value + - is_representative StarlarkInstructionPosition: type: object @@ -614,62 +660,99 @@ components: column: type: integer format: int32 + required: + - filename + - line + - column StarlarkError: type: object properties: - interpretation_error: - $ref: "#/components/schemas/StarlarkInterpretationError" - validation_error: - $ref: "#/components/schemas/StarlarkValidationError" - execution_error: - $ref: "#/components/schemas/StarlarkExecutionError" + error: + oneOf: + - $ref: "#/components/schemas/StarlarkInterpretationError" + - $ref: "#/components/schemas/StarlarkValidationError" + - $ref: "#/components/schemas/StarlarkExecutionError" + required: + - error StarlarkInterpretationError: type: object properties: - error_message: - type: string + interpretation_error: + type: object + properties: + error_message: + type: string + required: + - error_message + required: + - interpretation_error StarlarkValidationError: type: object properties: - error_message: - type: string + validation_error: + type: object + properties: + error_message: + type: string + required: + - error_message + required: + - validation_error StarlarkExecutionError: type: object properties: - error_message: - type: string + execution_error: + type: object + properties: + error_message: + type: string + required: + - error_message + required: + - execution_error StarlarkRunProgress: type: object properties: - current_step_info: - type: array - items: - type: string - total_steps: - type: integer - format: int32 - current_step_number: - type: integer - format: int32 + progress_info: + type: object + properties: + current_step_info: + type: array + items: + type: string + total_steps: + type: integer + format: int32 + current_step_number: + type: integer + format: int32 + required: + - current_step_info + - total_steps + - current_step_number + required: + - progress_info StarlarkRunFinishedEvent: type: object properties: - is_run_successful: - type: boolean - serialized_output: - type: string - - GetServicesResponse: - type: object - properties: - service_info: - $ref: "#/components/schemas/ServiceInfo" + run_finished_event: + type: object + properties: + is_run_successful: + type: boolean + serialized_output: + type: string + required: + - is_run_successful + - serialized_output + required: + - run_finished_event ServiceIdentifiers: type: object @@ -684,6 +767,10 @@ components: type: string description: The shortened uuid of the service description: An service identifier is a collection of uuid, name and shortened uuid + required: + - service_uuid + - name + - shortened_uuid ExecCommand: type: object @@ -692,8 +779,9 @@ components: type: array items: type: string - description: |- - Exec Command + description: Exec Command + required: + - command_args ExecCommandResult: type: object @@ -704,6 +792,9 @@ components: log_output: type: string description: Assumes UTF-8 encoding + required: + - exit_code + - log_output WaitForEndpointAvailability: type: object @@ -730,6 +821,8 @@ components: type: string description: If the endpoint returns this value, the service will be marked as available (e.g. Hello World). description: Wait For HTTP Endpoint Availability + required: + - http_method FileArtifactReference: type: object @@ -742,6 +835,9 @@ components: description: UUID of the files artifact, for use when referencing it in the future description: |- Files Artifact identifier + required: + - uuid + - name StoreWebFilesArtifact: type: object @@ -771,14 +867,6 @@ components: - source_path - name - InspectFilesArtifactContents: - type: object - properties: - file_descriptions: - type: array - items: - $ref: "#/components/schemas/FileArtifactDescription" - FileArtifactDescription: type: object properties: @@ -792,12 +880,9 @@ components: text_preview: type: string description: A bit of text content, if the file allows (similar to UNIX's 'head') - - ConnectServices: - type: object - properties: - connect: - $ref: "#/components/schemas/Connect" + required: + - path + - size RestartPolicy: type: string @@ -830,6 +915,15 @@ components: $ref: "#/components/schemas/KurtosisFeatureFlag" restart_policy: $ref: "#/components/schemas/RestartPolicy" + required: + - package_id + - serialized_script + - serialized_params + - parallelism + - relative_path_to_main_file + - main_function_name + - experimental_features + - restart_policy TransportProtocol: type: string diff --git a/engine/server/engine/server/enclave_rest_api_handler.go b/engine/server/engine/server/enclave_rest_api_handler.go index b7858cf4ba..5038cc47ab 100644 --- a/engine/server/engine/server/enclave_rest_api_handler.go +++ b/engine/server/engine/server/enclave_rest_api_handler.go @@ -70,8 +70,8 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierArtifacts(ctx context artifacts.FileNamesAndUuids, func(x *kurtosis_core_rpc_api_bindings.FilesArtifactNameAndUuid) kurtosis_core_rest_api_bindings.FileArtifactReference { return kurtosis_core_rest_api_bindings.FileArtifactReference{ - Name: &x.FileName, - Uuid: &x.FileUuid, + Name: x.FileName, + Uuid: x.FileUuid, } }) @@ -118,8 +118,8 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierArtifactsLocalFile(c // TODO (edgar) Is this the expected behavior? If so, we should be explicit about it. if response != nil { artifact_response := api.FileArtifactReference{ - Name: &response.Name, - Uuid: &response.Uuid, + Name: response.Name, + Uuid: response.Uuid, } uploaded_artifacts[filename] = artifact_response } @@ -145,8 +145,8 @@ func (manager *enclaveRuntime) PutEnclavesEnclaveIdentifierArtifactsRemoteFile(c } artifact_response := api.FileArtifactReference{ - Uuid: &stored_artifact.Uuid, - Name: &request.Body.Name, + Uuid: stored_artifact.Uuid, + Name: request.Body.Name, } return api.PutEnclavesEnclaveIdentifierArtifactsRemoteFile200JSONResponse(artifact_response), nil } @@ -170,8 +170,8 @@ func (manager *enclaveRuntime) PutEnclavesEnclaveIdentifierArtifactsServicesServ } artifact_response := api.FileArtifactReference{ - Uuid: &stored_artifact.Uuid, - Name: &request.Body.Name, + Uuid: stored_artifact.Uuid, + Name: request.Body.Name, } return api.PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier200JSONResponse(artifact_response), nil } @@ -200,17 +200,13 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierArtifactsArtifactIden func(x *kurtosis_core_rpc_api_bindings.FileArtifactContentsFileDescription) api.FileArtifactDescription { size := int64(x.Size) return api.FileArtifactDescription{ - Path: &x.Path, - Size: &size, + Path: x.Path, + Size: size, TextPreview: x.TextPreview, } }) - artifact_response := api.InspectFilesArtifactContents{ - FileDescriptions: &artifact_content_list, - } - - return api.GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier200JSONResponse(artifact_response), nil + return api.GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier200JSONResponse(artifact_content_list), nil } // (GET /enclaves/{enclave_identifier}/artifacts/{artifact_identifier}/download) @@ -279,9 +275,9 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierServicesHistory(ctx c response := utils.MapList(services.AllIdentifiers, func(service *kurtosis_core_rpc_api_bindings.ServiceIdentifiers) api.ServiceIdentifiers { return api.ServiceIdentifiers{ - ServiceUuid: &service.ServiceUuid, - ShortenedUuid: &service.ShortenedUuid, - Name: &service.Name, + ServiceUuid: service.ServiceUuid, + ShortenedUuid: service.ShortenedUuid, + Name: service.Name, } }) @@ -295,7 +291,7 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierServicesConnection(c logrus.Infof("Listing services from enclave %s", enclave_identifier) connectServicesArgs := kurtosis_core_rpc_api_bindings.ConnectServicesArgs{ - Connect: toGrpcConnect(*request.Body.Connect), + Connect: toGrpcConnect(*request.Body), } _, err := apiContainerClient.ConnectServices(ctx, &connectServicesArgs) if err != nil { @@ -340,7 +336,7 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierServicesServiceIdent execCommandArgs := kurtosis_core_rpc_api_bindings.ExecCommandArgs{ ServiceIdentifier: service_identifier, - CommandArgs: *request.Body.CommandArgs, + CommandArgs: request.Body.CommandArgs, } exec_result, err := apiContainerClient.ExecCommand(ctx, &execCommandArgs) if err != nil { @@ -349,8 +345,8 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierServicesServiceIdent } response := api.ExecCommandResult{ - ExitCode: &exec_result.ExitCode, - LogOutput: &exec_result.LogOutput, + ExitCode: exec_result.ExitCode, + LogOutput: exec_result.LogOutput, } return api.PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand200JSONResponse(response), nil } @@ -363,7 +359,7 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierServicesServiceIdent apiContainerClient := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) logrus.Infof("Getting info about service %s from enclave %s", service_identifier, enclave_identifier) - endpoint_method := *request.Body.HttpMethod + endpoint_method := request.Body.HttpMethod castToUInt32 := func(v int32) uint32 { return uint32(v) } @@ -418,14 +414,14 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierStarlark(ctx context. flags := utils.MapList(starlark_result.ExperimentalFeatures, toHttpFeatureFlag) policy := toHttpRestartPolicy(starlark_result.RestartPolicy) response := api.StarlarkDescription{ - ExperimentalFeatures: &flags, - MainFunctionName: &starlark_result.MainFunctionName, - PackageId: &starlark_result.PackageId, - Parallelism: &starlark_result.Parallelism, - RelativePathToMainFile: &starlark_result.RelativePathToMainFile, - RestartPolicy: &policy, - SerializedParams: &starlark_result.SerializedParams, - SerializedScript: &starlark_result.SerializedScript, + ExperimentalFeatures: flags, + MainFunctionName: starlark_result.MainFunctionName, + PackageId: starlark_result.PackageId, + Parallelism: starlark_result.Parallelism, + RelativePathToMainFile: starlark_result.RelativePathToMainFile, + RestartPolicy: policy, + SerializedParams: starlark_result.SerializedParams, + SerializedScript: starlark_result.SerializedScript, } return api.GetEnclavesEnclaveIdentifierStarlark200JSONResponse(response), nil @@ -651,21 +647,21 @@ func toHttpServiceStatus(status kurtosis_core_rpc_api_bindings.ServiceStatus) ap func toHttpContainer(container *kurtosis_core_rpc_api_bindings.Container) api.Container { status := toHttpContainerStatus(container.Status) return api.Container{ - CmdArgs: &container.CmdArgs, - EntrypointArgs: &container.EntrypointArgs, - EnvVars: &container.EnvVars, - ImageName: &container.ImageName, - Status: &status, + CmdArgs: container.CmdArgs, + EntrypointArgs: container.EntrypointArgs, + EnvVars: container.EnvVars, + ImageName: container.ImageName, + Status: status, } } func toHttpPorts(port *kurtosis_core_rpc_api_bindings.Port) api.Port { protocol := toHttpTransportProtocol(port.TransportProtocol) return api.Port{ - MaybeApplicationProtocol: &port.MaybeApplicationProtocol, - MaybeWaitTimeout: &port.MaybeWaitTimeout, - Number: int32(port.Number), - TransportProtocol: protocol, + ApplicationProtocol: &port.MaybeApplicationProtocol, + WaitTimeout: &port.MaybeWaitTimeout, + Number: int32(port.Number), + TransportProtocol: protocol, } } @@ -675,15 +671,15 @@ func toHttpServiceInfo(service *kurtosis_core_rpc_api_bindings.ServiceInfo) api. publicPorts := utils.MapMapValues(service.MaybePublicPorts, toHttpPorts) privatePorts := utils.MapMapValues(service.PrivatePorts, toHttpPorts) return api.ServiceInfo{ - Container: &container, - MaybePublicIpAddr: &service.MaybePublicIpAddr, - MaybePublicPorts: &publicPorts, - Name: &service.Name, - PrivateIpAddr: &service.PrivateIpAddr, - PrivatePorts: &privatePorts, - ServiceStatus: &serviceStatus, - ServiceUuid: &service.ServiceUuid, - ShortenedUuid: &service.ShortenedUuid, + Container: container, + PublicIpAddr: &service.MaybePublicIpAddr, + PublicPorts: &publicPorts, + Name: service.Name, + PrivateIpAddr: service.PrivateIpAddr, + PrivatePorts: privatePorts, + ServiceStatus: serviceStatus, + ServiceUuid: service.ServiceUuid, + ShortenedUuid: service.ShortenedUuid, } } From 1130aece85461302cd0ba3c2e5b6ab3feaafe750 Mon Sep 17 00:00:00 2001 From: lostbean Date: Sat, 18 Nov 2023 22:31:07 -0300 Subject: [PATCH 46/95] switch between internal and host connection for APIC --- engine/server/engine/main.go | 2 +- .../engine/server/enclave_rest_api_handler.go | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/engine/server/engine/main.go b/engine/server/engine/main.go index c4c9c56736..62127f7477 100644 --- a/engine/server/engine/main.go +++ b/engine/server/engine/main.go @@ -411,7 +411,7 @@ func restApiServer( // Use our validation middleware to check all requests against the // e.Use(middleware.OapiRequestValidator(swagger_enclave)) - enclaveRuntime, err := restApi.NewEnclaveRuntime(ctx, enclave_manager) + enclaveRuntime, err := restApi.NewEnclaveRuntime(ctx, enclave_manager, false) if err != nil { // TODO(edgar) fix error handling } diff --git a/engine/server/engine/server/enclave_rest_api_handler.go b/engine/server/engine/server/enclave_rest_api_handler.go index 5038cc47ab..9ebddf29f9 100644 --- a/engine/server/engine/server/enclave_rest_api_handler.go +++ b/engine/server/engine/server/enclave_rest_api_handler.go @@ -26,7 +26,7 @@ type enclaveRuntime struct { remoteApiContainerClient map[string]kurtosis_core_rpc_api_bindings.ApiContainerServiceClient } -func NewEnclaveRuntime(ctx context.Context, manager *enclave_manager.EnclaveManager) (*enclaveRuntime, error) { +func NewEnclaveRuntime(ctx context.Context, manager *enclave_manager.EnclaveManager, connectOnHostMachine bool) (*enclaveRuntime, error) { enclaves, err := manager.GetEnclaves(ctx) if err != nil { return nil, err @@ -34,7 +34,7 @@ func NewEnclaveRuntime(ctx context.Context, manager *enclave_manager.EnclaveMana clients := map[string]kurtosis_core_rpc_api_bindings.ApiContainerServiceClient{} for uuid, info := range enclaves { - conn, err := getGrpcClientConn(info) + conn, err := getGrpcClientConn(info, connectOnHostMachine) if err != nil { logrus.Errorf("Failed to establish gRPC connection with enclave manager service on enclave %s", uuid) return nil, err @@ -572,11 +572,13 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx // GetGrpcClientConn returns a client conn dialed in to the local port // It is the caller's responsibility to call resultClientConn.close() -func getGrpcClientConn(enclaveInfo *types.EnclaveInfo) (resultClientConn *grpc.ClientConn, resultErr error) { - // apiContainerGrpcPort := enclaveInfo.ApiContainerInfo.GrpcPortInsideEnclave - // apiContainerIP := enclaveInfo.ApiContainerInfo.ContainerId - apiContainerGrpcPort := enclaveInfo.ApiContainerHostMachineInfo.GrpcPortOnHostMachine - apiContainerIP := enclaveInfo.ApiContainerHostMachineInfo.IpOnHostMachine +func getGrpcClientConn(enclaveInfo *types.EnclaveInfo, connectOnHostMachine bool) (resultClientConn *grpc.ClientConn, resultErr error) { + apiContainerGrpcPort := enclaveInfo.ApiContainerInfo.GrpcPortInsideEnclave + apiContainerIP := enclaveInfo.ApiContainerInfo.BridgeIpAddress + if connectOnHostMachine { + apiContainerGrpcPort = enclaveInfo.ApiContainerHostMachineInfo.GrpcPortOnHostMachine + apiContainerIP = enclaveInfo.ApiContainerHostMachineInfo.IpOnHostMachine + } grpcServerAddress := fmt.Sprintf("%v:%v", apiContainerIP, apiContainerGrpcPort) grpcConnection, err := grpc.Dial(grpcServerAddress, grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { From 19c35bf8e33e0b9c70cc682d62c3856deb5022ff Mon Sep 17 00:00:00 2001 From: lostbean Date: Tue, 21 Nov 2023 15:14:13 -0300 Subject: [PATCH 47/95] Add websocket for logs --- .../engine_server.gen.go | 112 +---- .../engine_types.gen.go | 41 -- .../logging_server.gen.go | 264 ++++++++++++ .../logging_types.gen.go | 78 ++++ api/openapi/engine/engine_service.yaml | 83 +--- api/openapi/logging/logging_service.yaml | 154 +++++++ api/openapi/logging/server.cfg.yaml | 6 + api/openapi/logging/types.cfg.yaml | 4 + api/openapi/scripts/build.sh | 4 +- engine/server/engine/main.go | 27 +- .../engine/server/enclave_rest_api_handler.go | 184 +++++--- .../engine/server/engine_rest_api_handler.go | 386 +++-------------- .../engine/server/logging_api_handler.go | 404 ++++++++++++++++++ 13 files changed, 1153 insertions(+), 594 deletions(-) create mode 100644 api/golang/logging/kurtosis_logging_api_bindings/logging_server.gen.go create mode 100644 api/golang/logging/kurtosis_logging_api_bindings/logging_types.gen.go create mode 100644 api/openapi/logging/logging_service.yaml create mode 100644 api/openapi/logging/server.cfg.yaml create mode 100644 api/openapi/logging/types.cfg.yaml create mode 100644 engine/server/engine/server/logging_api_handler.go diff --git a/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_server.gen.go b/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_server.gen.go index d0e7d4dc99..3d2d46ffaa 100644 --- a/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_server.gen.go +++ b/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_server.gen.go @@ -40,9 +40,6 @@ type ServerInterface interface { // Get Enclave Info // (GET /enclaves/{enclave_identifier}) GetEnclavesEnclaveIdentifier(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error - // Get Service Logs - // (POST /enclaves/{enclave_identifier}/logs) - PostEnclavesEnclaveIdentifierLogs(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error // Stop Enclave // (POST /enclaves/{enclave_identifier}/stop) PostEnclavesEnclaveIdentifierStop(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error @@ -133,22 +130,6 @@ func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifier(ctx echo.Context) return err } -// PostEnclavesEnclaveIdentifierLogs converts echo context to params. -func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierLogs(ctx echo.Context) error { - var err error - // ------------- Path parameter "enclave_identifier" ------------- - var enclaveIdentifier EnclaveIdentifier - - err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) - if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter enclave_identifier: %s", err)) - } - - // Invoke the callback with all the unmarshalled arguments - err = w.Handler.PostEnclavesEnclaveIdentifierLogs(ctx, enclaveIdentifier) - return err -} - // PostEnclavesEnclaveIdentifierStop converts echo context to params. func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierStop(ctx echo.Context) error { var err error @@ -208,7 +189,6 @@ func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL router.GET(baseURL+"/enclaves/historical", wrapper.GetEnclavesHistorical) router.DELETE(baseURL+"/enclaves/:enclave_identifier", wrapper.DeleteEnclavesEnclaveIdentifier) router.GET(baseURL+"/enclaves/:enclave_identifier", wrapper.GetEnclavesEnclaveIdentifier) - router.POST(baseURL+"/enclaves/:enclave_identifier/logs", wrapper.PostEnclavesEnclaveIdentifierLogs) router.POST(baseURL+"/enclaves/:enclave_identifier/stop", wrapper.PostEnclavesEnclaveIdentifierStop) router.GET(baseURL+"/engine/info", wrapper.GetEngineInfo) @@ -313,24 +293,6 @@ func (response GetEnclavesEnclaveIdentifier200JSONResponse) VisitGetEnclavesEncl return json.NewEncoder(w).Encode(response) } -type PostEnclavesEnclaveIdentifierLogsRequestObject struct { - EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` - Body *PostEnclavesEnclaveIdentifierLogsJSONRequestBody -} - -type PostEnclavesEnclaveIdentifierLogsResponseObject interface { - VisitPostEnclavesEnclaveIdentifierLogsResponse(w http.ResponseWriter) error -} - -type PostEnclavesEnclaveIdentifierLogs200JSONResponse ServiceLogs - -func (response PostEnclavesEnclaveIdentifierLogs200JSONResponse) VisitPostEnclavesEnclaveIdentifierLogsResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(200) - - return json.NewEncoder(w).Encode(response) -} - type PostEnclavesEnclaveIdentifierStopRequestObject struct { EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` } @@ -383,9 +345,6 @@ type StrictServerInterface interface { // Get Enclave Info // (GET /enclaves/{enclave_identifier}) GetEnclavesEnclaveIdentifier(ctx context.Context, request GetEnclavesEnclaveIdentifierRequestObject) (GetEnclavesEnclaveIdentifierResponseObject, error) - // Get Service Logs - // (POST /enclaves/{enclave_identifier}/logs) - PostEnclavesEnclaveIdentifierLogs(ctx context.Context, request PostEnclavesEnclaveIdentifierLogsRequestObject) (PostEnclavesEnclaveIdentifierLogsResponseObject, error) // Stop Enclave // (POST /enclaves/{enclave_identifier}/stop) PostEnclavesEnclaveIdentifierStop(ctx context.Context, request PostEnclavesEnclaveIdentifierStopRequestObject) (PostEnclavesEnclaveIdentifierStopResponseObject, error) @@ -557,37 +516,6 @@ func (sh *strictHandler) GetEnclavesEnclaveIdentifier(ctx echo.Context, enclaveI return nil } -// PostEnclavesEnclaveIdentifierLogs operation middleware -func (sh *strictHandler) PostEnclavesEnclaveIdentifierLogs(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error { - var request PostEnclavesEnclaveIdentifierLogsRequestObject - - request.EnclaveIdentifier = enclaveIdentifier - - var body PostEnclavesEnclaveIdentifierLogsJSONRequestBody - if err := ctx.Bind(&body); err != nil { - return err - } - request.Body = &body - - handler := func(ctx echo.Context, request interface{}) (interface{}, error) { - return sh.ssi.PostEnclavesEnclaveIdentifierLogs(ctx.Request().Context(), request.(PostEnclavesEnclaveIdentifierLogsRequestObject)) - } - for _, middleware := range sh.middlewares { - handler = middleware(handler, "PostEnclavesEnclaveIdentifierLogs") - } - - response, err := handler(ctx, request) - - if err != nil { - return err - } else if validResponse, ok := response.(PostEnclavesEnclaveIdentifierLogsResponseObject); ok { - return validResponse.VisitPostEnclavesEnclaveIdentifierLogsResponse(ctx.Response()) - } else if response != nil { - return fmt.Errorf("Unexpected response type: %T", response) - } - return nil -} - // PostEnclavesEnclaveIdentifierStop operation middleware func (sh *strictHandler) PostEnclavesEnclaveIdentifierStop(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error { var request PostEnclavesEnclaveIdentifierStopRequestObject @@ -639,28 +567,24 @@ func (sh *strictHandler) GetEngineInfo(ctx echo.Context) error { // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/8xYzY7bNhB+FYHtUV277c03d+1uDGRtI9YCKYIFwZVGNgOJVMiRWyPwuxfUvyxK1jrJ", - "IjdbGs7PN98MZ/SV+DJOpACBmsy+koQpFgOC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NGV9OSk2mJ+96YGq5KJ+L5", + "G8baOJljgqZu6zxNiTz2EywKQaM2nIhwGuU5o9aCaUzVlUCWJMUbTrc5o9DAIVKSoxtfee9mFdaF/SKU", + "vifxgXEM+U70Ie9lFkeZkDoSPDoIpaO0MG/RyLjGPUoTgmUjdh3NV/3x6Lrjj8R9ui4zdzrPktE9RiyL", + "CKUSlXKqoREWo06DBh3jilGsKjpIyqDZACcdBC4PIxh8R5YjpNWMqeu6fHG/2vznbO/SYVgPQtUvQCV9", + "o3gntYMtWs/oobtnFHYilX57XkZ4cQuoO3fawoxYeeGK1h1rwd5w+6BftzNV13jMnWP2t9tCXelmSGHG", + "l3kK7Mhm6cXJu2EpKk3SrD3LBxX07ln+s0XnYnKgTudEldmNyPa+zL5q4c1ivQEfVl8f5tvbTfiwHGvd", + "9pPSk/4gSddRU3Ix0nb7wVcI7Vn1zF9Tho69K1yjqeANdkKmREMAlGj8o2T6PISZ5CU6zXRizgrM3s0q", + "BB9qdDCb/DmZmSAiQ04yBgH8PZlNZuDb3dGmNK3WuGLpS1Bbck3Wtt4hhaDYKKqFSdnrzYL76JZ4YzJt", + "LX6nJ8OQygRXRci/ZjPzxygOuS5GW5aw2AafflMFzc22ONZN54uP5aq7yK7zOEaldnniVTBs1VS1K5W5", + "enWy5plF3efkDnWLkE/lRChl5ogkq47crpgc1XQ909VHEr9D3ck6E8qR9kqobt4vOSr9j6DH71bG7np+", + "6jaV+Qw5/UANdXj9CI0Feq+B7zc9Nj0wpYVkMbFfE5d09aWx/mTG79nn23tTf5//oLCaVFoa61Dz1v+A", + "PV0/k3rY3z2kHN/PQ8Pq/SNFaSmOjSYuj5Sfms+v0Tit+eOVXi7pY6q0sA/n5VnVI3Rtrv5CIjF4zqeG", + "edWn1WM/LJl6Yfmh5a2jfKK6dk2pnJz+DwAA//+JLmFXNxMAAA==", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_types.gen.go b/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_types.gen.go index a85aa644be..28698d0b6d 100644 --- a/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_types.gen.go +++ b/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_types.gen.go @@ -27,14 +27,6 @@ const ( TEST EnclaveMode = "TEST" ) -// Defines values for LogLineOperator. -const ( - DOESCONTAINMATCHREGEX LogLineOperator = "DOES_CONTAIN_MATCH_REGEX" - DOESCONTAINTEXT LogLineOperator = "DOES_CONTAIN_TEXT" - DOESNOTCONTAINMATCHREGEX LogLineOperator = "DOES_NOT_CONTAIN_MATCH_REGEX" - DOESNOTCONTAINTEXT LogLineOperator = "DOES_NOT_CONTAIN_TEXT" -) - // ApiContainerStatus defines model for ApiContainerStatus. type ApiContainerStatus string @@ -102,36 +94,6 @@ type EngineInfo struct { EngineVersion string `json:"engine_version"` } -// GetServiceLogs defines model for GetServiceLogs. -type GetServiceLogs struct { - ConjunctiveFilters *[]LogLineFilter `json:"conjunctive_filters,omitempty"` - FollowLogs *bool `json:"follow_logs,omitempty"` - NumLogLines *int `json:"num_log_lines,omitempty"` - ReturnAllLogs *bool `json:"return_all_logs,omitempty"` - ServiceUuidSet *[]string `json:"service_uuid_set,omitempty"` -} - -// LogLine defines model for LogLine. -type LogLine struct { - Line []string `json:"line"` - Timestamp Timestamp `json:"timestamp"` -} - -// LogLineFilter defines model for LogLineFilter. -type LogLineFilter struct { - Operator LogLineOperator `json:"operator"` - TextPattern string `json:"text_pattern"` -} - -// LogLineOperator defines model for LogLineOperator. -type LogLineOperator string - -// ServiceLogs defines model for ServiceLogs. -type ServiceLogs struct { - NotFoundServiceUuidSet *[]string `json:"not_found_service_uuid_set,omitempty"` - ServiceLogsByServiceUuid *map[string]LogLine `json:"service_logs_by_service_uuid,omitempty"` -} - // Timestamp defines model for Timestamp. type Timestamp = time.Time @@ -149,6 +111,3 @@ type DeleteEnclavesParams struct { // PostEnclavesJSONRequestBody defines body for PostEnclaves for application/json ContentType. type PostEnclavesJSONRequestBody = CreateEnclave - -// PostEnclavesEnclaveIdentifierLogsJSONRequestBody defines body for PostEnclavesEnclaveIdentifierLogs for application/json ContentType. -type PostEnclavesEnclaveIdentifierLogsJSONRequestBody = GetServiceLogs diff --git a/api/golang/logging/kurtosis_logging_api_bindings/logging_server.gen.go b/api/golang/logging/kurtosis_logging_api_bindings/logging_server.gen.go new file mode 100644 index 0000000000..4d1736ea35 --- /dev/null +++ b/api/golang/logging/kurtosis_logging_api_bindings/logging_server.gen.go @@ -0,0 +1,264 @@ +// Package kurtosis_logging_api_bindings provides primitives to interact with the openapi HTTP API. +// +// Code generated by github.com/deepmap/oapi-codegen version (devel) DO NOT EDIT. +package kurtosis_logging_api_bindings + +import ( + "bytes" + "compress/gzip" + "encoding/base64" + "fmt" + "net/http" + "net/url" + "path" + "strings" + + "github.com/deepmap/oapi-codegen/pkg/runtime" + "github.com/getkin/kin-openapi/openapi3" + "github.com/labstack/echo/v4" +) + +// ServerInterface represents all server handlers. +type ServerInterface interface { + // Get Service Logs + // (GET /enclaves/{enclave_identifier}/logs) + GetEnclavesEnclaveIdentifierLogs(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, params GetEnclavesEnclaveIdentifierLogsParams) error + // Get Service Logs + // (GET /enclaves/{enclave_identifier}/services/{service_uuid}/logs) + GetEnclavesEnclaveIdentifierServicesServiceUuidLogs(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, serviceUuid ServiceUuid, params GetEnclavesEnclaveIdentifierServicesServiceUuidLogsParams) error +} + +// ServerInterfaceWrapper converts echo contexts to parameters. +type ServerInterfaceWrapper struct { + Handler ServerInterface +} + +// GetEnclavesEnclaveIdentifierLogs converts echo context to params. +func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierLogs(ctx echo.Context) error { + var err error + // ------------- Path parameter "enclave_identifier" ------------- + var enclaveIdentifier EnclaveIdentifier + + err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter enclave_identifier: %s", err)) + } + + // Parameter object where we will unmarshal all parameters from the context + var params GetEnclavesEnclaveIdentifierLogsParams + // ------------- Required query parameter "service_uuid_set" ------------- + + err = runtime.BindQueryParameter("form", true, true, "service_uuid_set", ctx.QueryParams(), ¶ms.ServiceUuidSet) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter service_uuid_set: %s", err)) + } + + // ------------- Optional query parameter "follow_logs" ------------- + + err = runtime.BindQueryParameter("form", true, false, "follow_logs", ctx.QueryParams(), ¶ms.FollowLogs) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter follow_logs: %s", err)) + } + + // ------------- Optional query parameter "conjunctive_filters" ------------- + + err = runtime.BindQueryParameter("form", true, false, "conjunctive_filters", ctx.QueryParams(), ¶ms.ConjunctiveFilters) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter conjunctive_filters: %s", err)) + } + + // ------------- Optional query parameter "return_all_logs" ------------- + + err = runtime.BindQueryParameter("form", true, false, "return_all_logs", ctx.QueryParams(), ¶ms.ReturnAllLogs) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter return_all_logs: %s", err)) + } + + // ------------- Optional query parameter "num_log_lines" ------------- + + err = runtime.BindQueryParameter("form", true, false, "num_log_lines", ctx.QueryParams(), ¶ms.NumLogLines) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter num_log_lines: %s", err)) + } + + // Invoke the callback with all the unmarshalled arguments + err = w.Handler.GetEnclavesEnclaveIdentifierLogs(ctx, enclaveIdentifier, params) + return err +} + +// GetEnclavesEnclaveIdentifierServicesServiceUuidLogs converts echo context to params. +func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierServicesServiceUuidLogs(ctx echo.Context) error { + var err error + // ------------- Path parameter "enclave_identifier" ------------- + var enclaveIdentifier EnclaveIdentifier + + err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter enclave_identifier: %s", err)) + } + + // ------------- Path parameter "service_uuid" ------------- + var serviceUuid ServiceUuid + + err = runtime.BindStyledParameterWithLocation("simple", false, "service_uuid", runtime.ParamLocationPath, ctx.Param("service_uuid"), &serviceUuid) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter service_uuid: %s", err)) + } + + // Parameter object where we will unmarshal all parameters from the context + var params GetEnclavesEnclaveIdentifierServicesServiceUuidLogsParams + // ------------- Optional query parameter "follow_logs" ------------- + + err = runtime.BindQueryParameter("form", true, false, "follow_logs", ctx.QueryParams(), ¶ms.FollowLogs) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter follow_logs: %s", err)) + } + + // ------------- Optional query parameter "conjunctive_filters" ------------- + + err = runtime.BindQueryParameter("form", true, false, "conjunctive_filters", ctx.QueryParams(), ¶ms.ConjunctiveFilters) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter conjunctive_filters: %s", err)) + } + + // ------------- Optional query parameter "return_all_logs" ------------- + + err = runtime.BindQueryParameter("form", true, false, "return_all_logs", ctx.QueryParams(), ¶ms.ReturnAllLogs) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter return_all_logs: %s", err)) + } + + // ------------- Optional query parameter "num_log_lines" ------------- + + err = runtime.BindQueryParameter("form", true, false, "num_log_lines", ctx.QueryParams(), ¶ms.NumLogLines) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter num_log_lines: %s", err)) + } + + // Invoke the callback with all the unmarshalled arguments + err = w.Handler.GetEnclavesEnclaveIdentifierServicesServiceUuidLogs(ctx, enclaveIdentifier, serviceUuid, params) + return err +} + +// This is a simple interface which specifies echo.Route addition functions which +// are present on both echo.Echo and echo.Group, since we want to allow using +// either of them for path registration +type EchoRouter interface { + CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route +} + +// RegisterHandlers adds each server route to the EchoRouter. +func RegisterHandlers(router EchoRouter, si ServerInterface) { + RegisterHandlersWithBaseURL(router, si, "") +} + +// Registers handlers, and prepends BaseURL to the paths, so that the paths +// can be served under a prefix. +func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string) { + + wrapper := ServerInterfaceWrapper{ + Handler: si, + } + + router.GET(baseURL+"/enclaves/:enclave_identifier/logs", wrapper.GetEnclavesEnclaveIdentifierLogs) + router.GET(baseURL+"/enclaves/:enclave_identifier/services/:service_uuid/logs", wrapper.GetEnclavesEnclaveIdentifierServicesServiceUuidLogs) + +} + +// Base64 encoded, gzipped, json marshaled Swagger object +var swaggerSpec = []string{ + + "H4sIAAAAAAAC/+xWUW+jOBD+K2juHrmQu3vjrWpzvUjZptqmUqWqQi4MxBXY1B6yG0X895VtSCChCat9", + "6Ms+EczMN9/MfDPODmJZlFKgIA3hDkqmWIGEyr7FUrxVIia+wSjleXvMBYTwXqHagg+CFQjhoKkPOl5j", + "wawPYWGd/1SYQgh/BIfAgTPTwUJmCy7wP+sPtQ+0LQ04U4ptoa59QBHnbIMRT1AQTzkqg5mgjhUviUvD", + "7PFxfuN7ei0VocDEc+9SeYaqJ1OP1ug1QOC7bEpG60MyA1F8UPhecYUJhKQq7ObWsNSkuMgszVTmufwW", + "5TL7sGBdkwGwVylzZMKiiaowdlHOBX6I1zcaQOSCMDNlrU0uVCkRsTw/y/HY7AJPjWrDY4yqiid7yH5l", + "eyY/V9Oua6SRPiJ9YncuzF6WR/FOpFe3Xta6EaqdGCVLVMRdZ/LmdCyuD8QL1MSK8tJwrPaGroNtSs8u", + "aBfpZR9Gvr5hTCZOf7ZOiJvfjKQaOaLL1txkgN8pKhkRKjHcui7ZfaAjxzOclx1uKKrCwNwsZw/R9fJu", + "dTW/i1azpxX47uxuuRo8b8++XK2u/4++zm5nT0Mu3c8HSof2PTh1LZqp6RdRSIpSWQmjuwGxjtZE622G", + "LnrdRseDxZKEm2XH8vte/BGN64Rr61wPVH7VVWUqVcEIQkgY4V9GZnBSGYPCRSptfpxy820hs4yLzLu6", + "n4MPG1TaLejp5O/J1ESRJQpWcgjh38l0MgXfbgubStDsYB3sTrdxHbRbK3OldaLiUswTCOEWadZ4N8/5", + "3nXh9lj3nnseLtzBJBi4D2r/oteJBkb4dG+FEeZDt+4It+O9PsKlf73UL2aodSmFdsr7Zzpt/jAQCtsS", + "VpY5j21Tgjct7WY47N1zSu2OmNVV/3p/qOIYtU6r3GspuPuhKgqmtq7/XgPiNSj+JUE1zdLBrtu2XxBa", + "Q0A3z8eKJ5+kvd+6+zzd1fWPAAAA//+SFq66YgsAAA==", +} + +// GetSwagger returns the content of the embedded swagger specification file +// or error if failed to decode +func decodeSpec() ([]byte, error) { + zipped, err := base64.StdEncoding.DecodeString(strings.Join(swaggerSpec, "")) + if err != nil { + return nil, fmt.Errorf("error base64 decoding spec: %s", err) + } + zr, err := gzip.NewReader(bytes.NewReader(zipped)) + if err != nil { + return nil, fmt.Errorf("error decompressing spec: %s", err) + } + var buf bytes.Buffer + _, err = buf.ReadFrom(zr) + if err != nil { + return nil, fmt.Errorf("error decompressing spec: %s", err) + } + + return buf.Bytes(), nil +} + +var rawSpec = decodeSpecCached() + +// a naive cached of a decoded swagger spec +func decodeSpecCached() func() ([]byte, error) { + data, err := decodeSpec() + return func() ([]byte, error) { + return data, err + } +} + +// Constructs a synthetic filesystem for resolving external references when loading openapi specifications. +func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error) { + var res = make(map[string]func() ([]byte, error)) + if len(pathToFile) > 0 { + res[pathToFile] = rawSpec + } + + return res +} + +// GetSwagger returns the Swagger specification corresponding to the generated code +// in this file. The external references of Swagger specification are resolved. +// The logic of resolving external references is tightly connected to "import-mapping" feature. +// Externally referenced files must be embedded in the corresponding golang packages. +// Urls can be supported but this task was out of the scope. +func GetSwagger() (swagger *openapi3.T, err error) { + var resolvePath = PathToRawSpec("") + + loader := openapi3.NewLoader() + loader.IsExternalRefsAllowed = true + loader.ReadFromURIFunc = func(loader *openapi3.Loader, url *url.URL) ([]byte, error) { + var pathToFile = url.String() + pathToFile = path.Clean(pathToFile) + getSpec, ok := resolvePath[pathToFile] + if !ok { + err1 := fmt.Errorf("path not found: %s", pathToFile) + return nil, err1 + } + return getSpec() + } + var specData []byte + specData, err = rawSpec() + if err != nil { + return + } + swagger, err = loader.LoadFromData(specData) + if err != nil { + return + } + return +} diff --git a/api/golang/logging/kurtosis_logging_api_bindings/logging_types.gen.go b/api/golang/logging/kurtosis_logging_api_bindings/logging_types.gen.go new file mode 100644 index 0000000000..ef706d006f --- /dev/null +++ b/api/golang/logging/kurtosis_logging_api_bindings/logging_types.gen.go @@ -0,0 +1,78 @@ +// Package kurtosis_logging_api_bindings provides primitives to interact with the openapi HTTP API. +// +// Code generated by github.com/deepmap/oapi-codegen version (devel) DO NOT EDIT. +package kurtosis_logging_api_bindings + +import ( + "time" +) + +// Defines values for LogLineOperator. +const ( + DOESCONTAINMATCHREGEX LogLineOperator = "DOES_CONTAIN_MATCH_REGEX" + DOESCONTAINTEXT LogLineOperator = "DOES_CONTAIN_TEXT" + DOESNOTCONTAINMATCHREGEX LogLineOperator = "DOES_NOT_CONTAIN_MATCH_REGEX" + DOESNOTCONTAINTEXT LogLineOperator = "DOES_NOT_CONTAIN_TEXT" +) + +// LogLine defines model for LogLine. +type LogLine struct { + Line []string `json:"line"` + Timestamp Timestamp `json:"timestamp"` +} + +// LogLineFilter defines model for LogLineFilter. +type LogLineFilter struct { + Operator LogLineOperator `json:"operator"` + TextPattern string `json:"text_pattern"` +} + +// LogLineOperator defines model for LogLineOperator. +type LogLineOperator string + +// ServiceLogs defines model for ServiceLogs. +type ServiceLogs struct { + NotFoundServiceUuidSet *[]string `json:"not_found_service_uuid_set,omitempty"` + ServiceLogsByServiceUuid *map[string]LogLine `json:"service_logs_by_service_uuid,omitempty"` +} + +// Timestamp defines model for Timestamp. +type Timestamp = time.Time + +// ConjunctiveFilters defines model for conjunctive_filters. +type ConjunctiveFilters = []LogLineFilter + +// EnclaveIdentifier defines model for enclave_identifier. +type EnclaveIdentifier = string + +// FollowLogs defines model for follow_logs. +type FollowLogs = bool + +// NumLogLines defines model for num_log_lines. +type NumLogLines = int + +// ReturnAllLogs defines model for return_all_logs. +type ReturnAllLogs = bool + +// ServiceUuid defines model for service_uuid. +type ServiceUuid = string + +// ServiceUuidSet defines model for service_uuid_set. +type ServiceUuidSet = []string + +// GetEnclavesEnclaveIdentifierLogsParams defines parameters for GetEnclavesEnclaveIdentifierLogs. +type GetEnclavesEnclaveIdentifierLogsParams struct { + ServiceUuidSet ServiceUuidSet `form:"service_uuid_set" json:"service_uuid_set"` + FollowLogs *FollowLogs `form:"follow_logs,omitempty" json:"follow_logs,omitempty"` + ConjunctiveFilters *ConjunctiveFilters `form:"conjunctive_filters,omitempty" json:"conjunctive_filters,omitempty"` + ReturnAllLogs *ReturnAllLogs `form:"return_all_logs,omitempty" json:"return_all_logs,omitempty"` + NumLogLines *NumLogLines `form:"num_log_lines,omitempty" json:"num_log_lines,omitempty"` +} + +// GetEnclavesEnclaveIdentifierServicesServiceUuidLogsParams defines parameters for GetEnclavesEnclaveIdentifierServicesServiceUuidLogs. +type GetEnclavesEnclaveIdentifierServicesServiceUuidLogsParams struct { + FollowLogs *FollowLogs `form:"follow_logs,omitempty" json:"follow_logs,omitempty"` + ConjunctiveFilters *ConjunctiveFilters `form:"conjunctive_filters,omitempty" json:"conjunctive_filters,omitempty"` + ReturnAllLogs *ReturnAllLogs `form:"return_all_logs,omitempty" json:"return_all_logs,omitempty"` + NumLogLines *NumLogLines `form:"num_log_lines,omitempty" json:"num_log_lines,omitempty"` +} diff --git a/api/openapi/engine/engine_service.yaml b/api/openapi/engine/engine_service.yaml index fc4a8ffa6a..ed23d983f1 100644 --- a/api/openapi/engine/engine_service.yaml +++ b/api/openapi/engine/engine_service.yaml @@ -91,25 +91,6 @@ paths: '200': description: Successful response - /enclaves/{enclave_identifier}/logs: - post: - summary: Get Service Logs - parameters: - - $ref: '#/components/parameters/enclave_identifier' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/GetServiceLogs' - responses: - '200': - description: Successful response - content: - application/json: - schema: - $ref: '#/components/schemas/ServiceLogs' - /enclaves/{enclave_identifier}/stop: post: summary: Stop Enclave @@ -278,68 +259,6 @@ components: items: $ref: '#/components/schemas/EnclaveNameAndUuid' - GetServiceLogs: - type: object - properties: - service_uuid_set: - type: array - items: - type: string - follow_logs: - type: boolean - conjunctive_filters: - type: array - items: - $ref: '#/components/schemas/LogLineFilter' - return_all_logs: - type: boolean - num_log_lines: - type: integer - - ServiceLogs: - type: object - properties: - service_logs_by_service_uuid: - type: object - additionalProperties: - $ref: '#/components/schemas/LogLine' - not_found_service_uuid_set: - type: array - items: - type: string - - LogLine: - type: object - properties: - line: - type: array - items: - type: string - timestamp: - $ref: '#/components/schemas/Timestamp' - required: - - line - - timestamp - - LogLineFilter: - type: object - properties: - operator: - $ref: '#/components/schemas/LogLineOperator' - text_pattern: - type: string - required: - - operator - - text_pattern - - LogLineOperator: - type: string - enum: - - DOES_CONTAIN_TEXT - - DOES_NOT_CONTAIN_TEXT - - DOES_CONTAIN_MATCH_REGEX - - DOES_NOT_CONTAIN_MATCH_REGEX - Timestamp: type: string - format: date-time + format: date-time \ No newline at end of file diff --git a/api/openapi/logging/logging_service.yaml b/api/openapi/logging/logging_service.yaml new file mode 100644 index 0000000000..ce0af72c12 --- /dev/null +++ b/api/openapi/logging/logging_service.yaml @@ -0,0 +1,154 @@ +openapi: 3.0.0 + +info: + title: Logging API + version: 0.1.0 + +paths: + /enclaves/{enclave_identifier}/logs: + get: + summary: Get Service Logs + parameters: + - $ref: "#/components/parameters/enclave_identifier" + - $ref: "#/components/parameters/service_uuid_set" + - $ref: "#/components/parameters/follow_logs" + - $ref: "#/components/parameters/conjunctive_filters" + - $ref: "#/components/parameters/return_all_logs" + - $ref: "#/components/parameters/num_log_lines" + responses: + "200": + description: Successful response + content: + application/json: + schema: + $ref: "#/components/schemas/ServiceLogs" + + /enclaves/{enclave_identifier}/services/{service_uuid}/logs: + get: + summary: Get Service Logs + parameters: + - $ref: "#/components/parameters/enclave_identifier" + - $ref: "#/components/parameters/service_uuid" + - $ref: "#/components/parameters/follow_logs" + - $ref: "#/components/parameters/conjunctive_filters" + - $ref: "#/components/parameters/return_all_logs" + - $ref: "#/components/parameters/num_log_lines" + responses: + "200": + description: Successful response + content: + application/json: + schema: + $ref: "#/components/schemas/ServiceLogs" + +# ========================================================================================================================= +# ========================================================================================================================= +# > > > > > > > > > > > > > > > > > > > > > > > > Data Models < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < +# ========================================================================================================================= +# ========================================================================================================================= + +components: + parameters: + enclave_identifier: + name: enclave_identifier + in: path + required: true + description: UUID, shortened UUID, or name of the enclave + schema: + type: string + + service_uuid: + name: service_uuid + in: path + required: true + schema: + type: string + + service_uuid_set: + name: service_uuid_set + in: query + required: true + schema: + type: array + items: + type: string + + follow_logs: + name: follow_logs + in: query + required: false + schema: + type: boolean + + conjunctive_filters: + name: conjunctive_filters + in: query + required: false + schema: + type: array + items: + $ref: "#/components/schemas/LogLineFilter" + + return_all_logs: + name: return_all_logs + in: query + required: false + schema: + type: boolean + + num_log_lines: + name: num_log_lines + in: query + required: false + schema: + type: integer + + schemas: + + ServiceLogs: + type: object + properties: + service_logs_by_service_uuid: + type: object + additionalProperties: + $ref: "#/components/schemas/LogLine" + not_found_service_uuid_set: + type: array + items: + type: string + + LogLine: + type: object + properties: + line: + type: array + items: + type: string + timestamp: + $ref: "#/components/schemas/Timestamp" + required: + - line + - timestamp + + LogLineFilter: + type: object + properties: + operator: + $ref: "#/components/schemas/LogLineOperator" + text_pattern: + type: string + required: + - operator + - text_pattern + + LogLineOperator: + type: string + enum: + - DOES_CONTAIN_TEXT + - DOES_NOT_CONTAIN_TEXT + - DOES_CONTAIN_MATCH_REGEX + - DOES_NOT_CONTAIN_MATCH_REGEX + + Timestamp: + type: string + format: date-time diff --git a/api/openapi/logging/server.cfg.yaml b/api/openapi/logging/server.cfg.yaml new file mode 100644 index 0000000000..0c1deb8916 --- /dev/null +++ b/api/openapi/logging/server.cfg.yaml @@ -0,0 +1,6 @@ +package: kurtosis_logging_api_bindings +generate: + embedded-spec: true + echo-server: true + strict-server: false +output: api/golang/logging/kurtosis_logging_api_bindings/logging_server.gen.go \ No newline at end of file diff --git a/api/openapi/logging/types.cfg.yaml b/api/openapi/logging/types.cfg.yaml new file mode 100644 index 0000000000..8802f1b78c --- /dev/null +++ b/api/openapi/logging/types.cfg.yaml @@ -0,0 +1,4 @@ +package: kurtosis_logging_api_bindings +generate: + models: true +output: api/golang/logging/kurtosis_logging_api_bindings/logging_types.gen.go \ No newline at end of file diff --git a/api/openapi/scripts/build.sh b/api/openapi/scripts/build.sh index 839f3d5957..8b2d8e363b 100755 --- a/api/openapi/scripts/build.sh +++ b/api/openapi/scripts/build.sh @@ -8,7 +8,9 @@ api_root_dirpath="$(dirname "${script_dirpath}")" echo "Generating data models for REST API " oapi-codegen --config="$api_root_dirpath/engine/types.cfg.yaml" "$api_root_dirpath/engine/engine_service.yaml" oapi-codegen --config="$api_root_dirpath/core/types.cfg.yaml" "$api_root_dirpath/core/core_service.yaml" +oapi-codegen --config="$api_root_dirpath/logging/types.cfg.yaml" "$api_root_dirpath/logging/logging_service.yaml" echo "Generating server code for REST API " oapi-codegen --config="$api_root_dirpath/engine/server.cfg.yaml" "$api_root_dirpath/engine/engine_service.yaml" -oapi-codegen --config="$api_root_dirpath/core/server.cfg.yaml" "$api_root_dirpath/core/core_service.yaml" \ No newline at end of file +oapi-codegen --config="$api_root_dirpath/core/server.cfg.yaml" "$api_root_dirpath/core/core_service.yaml" +oapi-codegen --config="$api_root_dirpath/logging/server.cfg.yaml" "$api_root_dirpath/logging/logging_service.yaml" \ No newline at end of file diff --git a/engine/server/engine/main.go b/engine/server/engine/main.go index 62127f7477..004d06a0b9 100644 --- a/engine/server/engine/main.go +++ b/engine/server/engine/main.go @@ -20,6 +20,7 @@ import ( enclaveApi "github.com/kurtosis-tech/kurtosis/api/golang/core/kurtosis_core_rest_api_bindings" engineApi "github.com/kurtosis-tech/kurtosis/api/golang/engine/kurtosis_engine_rest_api_bindings" "github.com/kurtosis-tech/kurtosis/api/golang/engine/kurtosis_engine_rpc_api_bindings/kurtosis_engine_rpc_api_bindingsconnect" + loggingApi "github.com/kurtosis-tech/kurtosis/api/golang/logging/kurtosis_logging_api_bindings" connect_server "github.com/kurtosis-tech/kurtosis/connect-server" "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/backend_creator" "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/consts" @@ -400,6 +401,30 @@ func restApiServer( } engineApi.RegisterHandlers(e, engineApi.NewStrictHandler(engineRuntime, nil)) + // ============================== Logging API ====================================== + + swagger_logging, err := loggingApi.GetSwagger() + if err != nil { + fmt.Fprintf(os.Stderr, "Error loading swagger spec\n: %s", err) + os.Exit(1) + } + server.ServeSwaggerUI(e, "/api/specs/logging", server.NewSwaggerUIConfig(swagger_logging)) + // Use our validation middleware to check all requests against the + // e.Use(middleware.OapiRequestValidator(swagger_logging)) + loggingRuntime := restApi.LoggingRuntime{ + ImageVersionTag: serverArgs.ImageVersionTag, + EnclaveManager: enclave_manager, + MetricsUserID: serverArgs.MetricsUserID, + DidUserAcceptSendingMetrics: serverArgs.DidUserAcceptSendingMetrics, + PerWeekLogsDatabaseClient: perWeekLogsDatabaseClient, + PerFileLogsDatabaseClient: perFileLogsDatabaseClient, + LogFileManager: logFileManager, + MetricsClient: metricsClient, + } + // TODO(edgar) add logging Close() + // defer loggingRuntime.ShutDown() + loggingApi.RegisterHandlers(e, loggingRuntime) + // ============================== Engine Management API ====================================== // OpenAPI schema. swagger_enclave, err := enclaveApi.GetSwagger() @@ -411,7 +436,7 @@ func restApiServer( // Use our validation middleware to check all requests against the // e.Use(middleware.OapiRequestValidator(swagger_enclave)) - enclaveRuntime, err := restApi.NewEnclaveRuntime(ctx, enclave_manager, false) + enclaveRuntime, err := restApi.NewEnclaveRuntime(ctx, *enclave_manager, false) if err != nil { // TODO(edgar) fix error handling } diff --git a/engine/server/engine/server/enclave_rest_api_handler.go b/engine/server/engine/server/enclave_rest_api_handler.go index 9ebddf29f9..e67618744b 100644 --- a/engine/server/engine/server/enclave_rest_api_handler.go +++ b/engine/server/engine/server/enclave_rest_api_handler.go @@ -5,6 +5,7 @@ import ( "encoding/json" "fmt" "io" + "sync" "github.com/kurtosis-tech/kurtosis/engine/server/engine/enclave_manager" "github.com/kurtosis-tech/kurtosis/engine/server/engine/types" @@ -22,31 +23,60 @@ import ( ) type enclaveRuntime struct { - enclaveManager *enclave_manager.EnclaveManager + enclaveManager enclave_manager.EnclaveManager remoteApiContainerClient map[string]kurtosis_core_rpc_api_bindings.ApiContainerServiceClient + connectOnHostMachine bool + ctx context.Context + lock sync.Mutex } -func NewEnclaveRuntime(ctx context.Context, manager *enclave_manager.EnclaveManager, connectOnHostMachine bool) (*enclaveRuntime, error) { - enclaves, err := manager.GetEnclaves(ctx) +func (runtime enclaveRuntime) refreshEnclaveConnections() error { + runtime.lock.Lock() + defer runtime.lock.Unlock() + + enclaves, err := runtime.enclaveManager.GetEnclaves(runtime.ctx) if err != nil { - return nil, err + return err + } + + // Clean up removed enclaves + for uuid := range runtime.remoteApiContainerClient { + _, found := enclaves[uuid] + if !found { + delete(runtime.remoteApiContainerClient, uuid) + } } - clients := map[string]kurtosis_core_rpc_api_bindings.ApiContainerServiceClient{} + // Add new enclaves - assuming enclaves properties (API container connection) are immutable for uuid, info := range enclaves { - conn, err := getGrpcClientConn(info, connectOnHostMachine) - if err != nil { - logrus.Errorf("Failed to establish gRPC connection with enclave manager service on enclave %s", uuid) - return nil, err + _, found := runtime.remoteApiContainerClient[uuid] + if !found { + conn, err := getGrpcClientConn(info, runtime.connectOnHostMachine) + if err != nil { + logrus.Errorf("Failed to establish gRPC connection with enclave manager service on enclave %s", uuid) + return err + } + logrus.Debugf("Creating gRPC connection with enclave manager service on enclave %s", uuid) + apiContainerClient := kurtosis_core_rpc_api_bindings.NewApiContainerServiceClient(conn) + runtime.remoteApiContainerClient[uuid] = apiContainerClient } - logrus.Debugf("Creating gRPC connection with enclave manager service on enclave %s", uuid) - apiContainerClient := kurtosis_core_rpc_api_bindings.NewApiContainerServiceClient(conn) - clients[uuid] = apiContainerClient } + return nil +} + +func NewEnclaveRuntime(ctx context.Context, manager enclave_manager.EnclaveManager, connectOnHostMachine bool) (*enclaveRuntime, error) { + runtime := enclaveRuntime{ enclaveManager: manager, - remoteApiContainerClient: clients, + remoteApiContainerClient: map[string]kurtosis_core_rpc_api_bindings.ApiContainerServiceClient{}, + connectOnHostMachine: connectOnHostMachine, + ctx: ctx, + } + + err := runtime.refreshEnclaveConnections() + if err != nil { + return nil, err } return &runtime, nil @@ -59,9 +89,12 @@ func NewEnclaveRuntime(ctx context.Context, manager *enclave_manager.EnclaveMana // (GET /enclaves/{enclave_identifier}/artifacts) func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierArtifacts(ctx context.Context, request api.GetEnclavesEnclaveIdentifierArtifactsRequestObject) (api.GetEnclavesEnclaveIdentifierArtifactsResponseObject, error) { enclave_identifier := request.EnclaveIdentifier - apiContainerClient := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) + apiContainerClient, err := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) + if err != nil { + return nil, err + } - artifacts, err := apiContainerClient.ListFilesArtifactNamesAndUuids(ctx, &emptypb.Empty{}) + artifacts, err := (*apiContainerClient).ListFilesArtifactNamesAndUuids(ctx, &emptypb.Empty{}) if err != nil { return nil, err } @@ -81,7 +114,10 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierArtifacts(ctx context // (POST /enclaves/{enclave_identifier}/artifacts/local-file) func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierArtifactsLocalFile(ctx context.Context, request api.PostEnclavesEnclaveIdentifierArtifactsLocalFileRequestObject) (api.PostEnclavesEnclaveIdentifierArtifactsLocalFileResponseObject, error) { enclave_identifier := request.EnclaveIdentifier - apiContainerClient := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) + apiContainerClient, err := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) + if err != nil { + return nil, err + } logrus.Infof("Uploading file artifact to enclave %s", enclave_identifier) uploaded_artifacts := map[string]api.FileArtifactReference{} @@ -93,7 +129,7 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierArtifactsLocalFile(c } filename := part.FileName() - client, err := apiContainerClient.UploadFilesArtifact(ctx) + client, err := (*apiContainerClient).UploadFilesArtifact(ctx) if err != nil { return nil, stacktrace.Propagate(err, "Can't start file upload gRPC call with enclave %s", enclave_identifier) } @@ -131,14 +167,17 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierArtifactsLocalFile(c // (PUT /enclaves/{enclave_identifier}/artifacts/remote-file) func (manager *enclaveRuntime) PutEnclavesEnclaveIdentifierArtifactsRemoteFile(ctx context.Context, request api.PutEnclavesEnclaveIdentifierArtifactsRemoteFileRequestObject) (api.PutEnclavesEnclaveIdentifierArtifactsRemoteFileResponseObject, error) { enclave_identifier := request.EnclaveIdentifier - apiContainerClient := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) + apiContainerClient, err := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) + if err != nil { + return nil, err + } logrus.Infof("Uploading file artifact to enclave %s", enclave_identifier) storeWebFilesArtifactArgs := kurtosis_core_rpc_api_bindings.StoreWebFilesArtifactArgs{ Url: request.Body.Url, Name: request.Body.Name, } - stored_artifact, err := apiContainerClient.StoreWebFilesArtifact(ctx, &storeWebFilesArtifactArgs) + stored_artifact, err := (*apiContainerClient).StoreWebFilesArtifact(ctx, &storeWebFilesArtifactArgs) if err != nil { logrus.Errorf("Can't start file upload gRPC call with enclave %s, error: %s", enclave_identifier, err) return nil, stacktrace.NewError("Can't start file upload gRPC call with enclave %s", enclave_identifier) @@ -155,7 +194,10 @@ func (manager *enclaveRuntime) PutEnclavesEnclaveIdentifierArtifactsRemoteFile(c func (manager *enclaveRuntime) PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier(ctx context.Context, request api.PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierRequestObject) (api.PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierResponseObject, error) { enclave_identifier := request.EnclaveIdentifier service_identifier := request.ServiceIdentifier - apiContainerClient := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) + apiContainerClient, err := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) + if err != nil { + return nil, err + } logrus.Infof("Storing file artifact from service %s on enclave %s", service_identifier, enclave_identifier) storeWebFilesArtifactArgs := kurtosis_core_rpc_api_bindings.StoreFilesArtifactFromServiceArgs{ @@ -163,7 +205,7 @@ func (manager *enclaveRuntime) PutEnclavesEnclaveIdentifierArtifactsServicesServ SourcePath: request.Body.SourcePath, Name: request.Body.Name, } - stored_artifact, err := apiContainerClient.StoreFilesArtifactFromService(ctx, &storeWebFilesArtifactArgs) + stored_artifact, err := (*apiContainerClient).StoreFilesArtifactFromService(ctx, &storeWebFilesArtifactArgs) if err != nil { logrus.Errorf("Can't start file upload gRPC call with enclave %s, error: %s", enclave_identifier, err) return nil, stacktrace.NewError("Can't start file upload gRPC call with enclave %s", enclave_identifier) @@ -180,7 +222,10 @@ func (manager *enclaveRuntime) PutEnclavesEnclaveIdentifierArtifactsServicesServ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier(ctx context.Context, request api.GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierRequestObject) (api.GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierResponseObject, error) { enclave_identifier := request.EnclaveIdentifier artifact_identifier := request.ArtifactIdentifier - apiContainerClient := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) + apiContainerClient, err := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) + if err != nil { + return nil, err + } logrus.Infof("Inspecting file artifact %s on enclave %s", artifact_identifier, enclave_identifier) inspectFilesArtifactContentsRequest := kurtosis_core_rpc_api_bindings.InspectFilesArtifactContentsRequest{ @@ -189,7 +234,7 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierArtifactsArtifactIden FileUuid: artifact_identifier, }, } - stored_artifact, err := apiContainerClient.InspectFilesArtifactContents(ctx, &inspectFilesArtifactContentsRequest) + stored_artifact, err := (*apiContainerClient).InspectFilesArtifactContents(ctx, &inspectFilesArtifactContentsRequest) if err != nil { logrus.Errorf("Can't inspect artifact using gRPC call with enclave %s, error: %s", enclave_identifier, err) return nil, stacktrace.NewError("Can't inspect artifact using gRPC call with enclave %s", enclave_identifier) @@ -213,13 +258,16 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierArtifactsArtifactIden func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownload(ctx context.Context, request api.GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownloadRequestObject) (api.GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownloadResponseObject, error) { enclave_identifier := request.EnclaveIdentifier artifact_identifier := request.ArtifactIdentifier - apiContainerClient := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) + apiContainerClient, err := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) + if err != nil { + return nil, err + } logrus.Infof("Downloading file artifact %s from enclave %s", artifact_identifier, enclave_identifier) downloadFilesArtifactArgs := kurtosis_core_rpc_api_bindings.DownloadFilesArtifactArgs{ Identifier: artifact_identifier, } - client, err := apiContainerClient.DownloadFilesArtifact(ctx, &downloadFilesArtifactArgs) + client, err := (*apiContainerClient).DownloadFilesArtifact(ctx, &downloadFilesArtifactArgs) if err != nil { logrus.Errorf("Can't start file download gRPC call with enclave %s, error: %s", enclave_identifier, err) return nil, stacktrace.NewError("Can't start file download gRPC call with enclave %s", enclave_identifier) @@ -244,14 +292,17 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierArtifactsArtifactIden // (GET /enclaves/{enclave_identifier}/services) func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierServices(ctx context.Context, request api.GetEnclavesEnclaveIdentifierServicesRequestObject) (api.GetEnclavesEnclaveIdentifierServicesResponseObject, error) { enclave_identifier := request.EnclaveIdentifier - apiContainerClient := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) + apiContainerClient, err := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) + if err != nil { + return nil, err + } logrus.Infof("Getting info about services enclave %s", enclave_identifier) service_ids := utils.DerefWith(request.Params.Services, []string{}) getServicesArgs := kurtosis_core_rpc_api_bindings.GetServicesArgs{ ServiceIdentifiers: utils.NewMapFromList(service_ids, func(x string) bool { return true }), } - services, err := apiContainerClient.GetServices(ctx, &getServicesArgs) + services, err := (*apiContainerClient).GetServices(ctx, &getServicesArgs) if err != nil { logrus.Errorf("Can't list services using gRPC call with enclave %s, error: %s", enclave_identifier, err) return nil, stacktrace.NewError("Can't list services using gRPC call with enclave %s", enclave_identifier) @@ -264,10 +315,13 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierServices(ctx context. // (GET /enclaves/{enclave_identifier}/services/history) func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierServicesHistory(ctx context.Context, request api.GetEnclavesEnclaveIdentifierServicesHistoryRequestObject) (api.GetEnclavesEnclaveIdentifierServicesHistoryResponseObject, error) { enclave_identifier := request.EnclaveIdentifier - apiContainerClient := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) + apiContainerClient, err := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) + if err != nil { + return nil, err + } logrus.Infof("Listing services from enclave %s", enclave_identifier) - services, err := apiContainerClient.GetExistingAndHistoricalServiceIdentifiers(ctx, &emptypb.Empty{}) + services, err := (*apiContainerClient).GetExistingAndHistoricalServiceIdentifiers(ctx, &emptypb.Empty{}) if err != nil { logrus.Errorf("Can't list services using gRPC call with enclave %s, error: %s", enclave_identifier, err) return nil, stacktrace.NewError("Can't list services using gRPC call with enclave %s", enclave_identifier) @@ -287,13 +341,16 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierServicesHistory(ctx c // (POST /enclaves/{enclave_identifier}/services/connection) func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierServicesConnection(ctx context.Context, request api.PostEnclavesEnclaveIdentifierServicesConnectionRequestObject) (api.PostEnclavesEnclaveIdentifierServicesConnectionResponseObject, error) { enclave_identifier := request.EnclaveIdentifier - apiContainerClient := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) + apiContainerClient, err := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) + if err != nil { + return nil, err + } logrus.Infof("Listing services from enclave %s", enclave_identifier) connectServicesArgs := kurtosis_core_rpc_api_bindings.ConnectServicesArgs{ Connect: toGrpcConnect(*request.Body), } - _, err := apiContainerClient.ConnectServices(ctx, &connectServicesArgs) + _, err = (*apiContainerClient).ConnectServices(ctx, &connectServicesArgs) if err != nil { logrus.Errorf("Can't list services using gRPC call with enclave %s, error: %s", enclave_identifier, err) return nil, stacktrace.NewError("Can't list services using gRPC call with enclave %s", enclave_identifier) @@ -306,13 +363,16 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierServicesConnection(c func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierServicesServiceIdentifier(ctx context.Context, request api.GetEnclavesEnclaveIdentifierServicesServiceIdentifierRequestObject) (api.GetEnclavesEnclaveIdentifierServicesServiceIdentifierResponseObject, error) { enclave_identifier := request.EnclaveIdentifier service_identifier := request.ServiceIdentifier - apiContainerClient := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) + apiContainerClient, err := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) + if err != nil { + return nil, err + } logrus.Infof("Getting info about service %s from enclave %s", service_identifier, enclave_identifier) getServicesArgs := kurtosis_core_rpc_api_bindings.GetServicesArgs{ ServiceIdentifiers: map[string]bool{service_identifier: true}, } - services, err := apiContainerClient.GetServices(ctx, &getServicesArgs) + services, err := (*apiContainerClient).GetServices(ctx, &getServicesArgs) if err != nil { logrus.Errorf("Can't list services using gRPC call with enclave %s, error: %s", enclave_identifier, err) return nil, stacktrace.NewError("Can't list services using gRPC call with enclave %s", enclave_identifier) @@ -331,14 +391,17 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierServicesServiceIdenti func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand(ctx context.Context, request api.PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandRequestObject) (api.PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandResponseObject, error) { enclave_identifier := request.EnclaveIdentifier service_identifier := request.ServiceIdentifier - apiContainerClient := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) + apiContainerClient, err := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) + if err != nil { + return nil, err + } logrus.Infof("Getting info about service %s from enclave %s", service_identifier, enclave_identifier) execCommandArgs := kurtosis_core_rpc_api_bindings.ExecCommandArgs{ ServiceIdentifier: service_identifier, CommandArgs: request.Body.CommandArgs, } - exec_result, err := apiContainerClient.ExecCommand(ctx, &execCommandArgs) + exec_result, err := (*apiContainerClient).ExecCommand(ctx, &execCommandArgs) if err != nil { logrus.Errorf("Can't execute commands using gRPC call with enclave %s, error: %s", enclave_identifier, err) return nil, stacktrace.NewError("Can't execute commands using gRPC call with enclave %s", enclave_identifier) @@ -356,7 +419,10 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierServicesServiceIdent enclave_identifier := request.EnclaveIdentifier service_identifier := request.ServiceIdentifier port_number := request.PortNumber - apiContainerClient := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) + apiContainerClient, errConn := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) + if errConn != nil { + return nil, errConn + } logrus.Infof("Getting info about service %s from enclave %s", service_identifier, enclave_identifier) endpoint_method := request.Body.HttpMethod @@ -375,7 +441,7 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierServicesServiceIdent RetriesDelayMilliseconds: utils.MapPointer(request.Body.RetriesDelayMilliseconds, castToUInt32), BodyText: request.Body.BodyText, } - _, err = apiContainerClient.WaitForHttpGetEndpointAvailability(ctx, &waitForHttpGetEndpointAvailabilityArgs) + _, err = (*apiContainerClient).WaitForHttpGetEndpointAvailability(ctx, &waitForHttpGetEndpointAvailabilityArgs) case api.POST: waitForHttpPostEndpointAvailabilityArgs := kurtosis_core_rpc_api_bindings.WaitForHttpPostEndpointAvailabilityArgs{ ServiceIdentifier: service_identifier, @@ -386,7 +452,7 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierServicesServiceIdent RetriesDelayMilliseconds: utils.MapPointer(request.Body.RetriesDelayMilliseconds, castToUInt32), BodyText: request.Body.BodyText, } - _, err = apiContainerClient.WaitForHttpPostEndpointAvailability(ctx, &waitForHttpPostEndpointAvailabilityArgs) + _, err = (*apiContainerClient).WaitForHttpPostEndpointAvailability(ctx, &waitForHttpPostEndpointAvailabilityArgs) default: return nil, stacktrace.NewError("Undefined method for availability endpoint: %s", endpoint_method) } @@ -402,10 +468,13 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierServicesServiceIdent // (GET /enclaves/{enclave_identifier}/starlark) func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierStarlark(ctx context.Context, request api.GetEnclavesEnclaveIdentifierStarlarkRequestObject) (api.GetEnclavesEnclaveIdentifierStarlarkResponseObject, error) { enclave_identifier := request.EnclaveIdentifier - apiContainerClient := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) + apiContainerClient, err := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) + if err != nil { + return nil, err + } logrus.Infof("Getting info about last Starlark run on enclave %s", enclave_identifier) - starlark_result, err := apiContainerClient.GetStarlarkRun(ctx, &emptypb.Empty{}) + starlark_result, err := (*apiContainerClient).GetStarlarkRun(ctx, &emptypb.Empty{}) if err != nil { logrus.Errorf("Can't get Starlark info using gRPC call with enclave %s, error: %s", enclave_identifier, err) return nil, stacktrace.NewError("Can't get Starlark info using gRPC call with enclave %s", enclave_identifier) @@ -430,7 +499,10 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierStarlark(ctx context. // (POST /enclaves/{enclave_identifier}/starlark/packages) func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkPackages(ctx context.Context, request api.PostEnclavesEnclaveIdentifierStarlarkPackagesRequestObject) (api.PostEnclavesEnclaveIdentifierStarlarkPackagesResponseObject, error) { enclave_identifier := request.EnclaveIdentifier - apiContainerClient := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) + apiContainerClient, err := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) + if err != nil { + return nil, err + } logrus.Infof("Upload Starlark package on enclave %s", enclave_identifier) for { @@ -440,7 +512,7 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkPackages(ctx break } filename := part.FileName() - client, err := apiContainerClient.UploadStarlarkPackage(ctx) + client, err := (*apiContainerClient).UploadStarlarkPackage(ctx) if err != nil { logrus.Errorf("Can't upload Starlark package using gRPC call with enclave %s, error: %s", enclave_identifier, err) return nil, stacktrace.NewError("Can't upload Starlark package using gRPC call with enclave %s", enclave_identifier) @@ -473,7 +545,10 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkPackages(ctx // (POST /enclaves/{enclave_identifier}/starlark/packages/{package_id}) func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId(ctx context.Context, request api.PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdRequestObject) (api.PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdResponseObject, error) { enclave_identifier := request.EnclaveIdentifier - apiContainerClient := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) + apiContainerClient, err := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) + if err != nil { + return nil, err + } logrus.Infof("Run Starlark package on enclave %s", enclave_identifier) package_id := request.PackageId @@ -500,7 +575,7 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkPackagesPack CloudUserId: request.Body.CloudUserId, ImageDownloadMode: utils.MapPointer(request.Body.ImageDownloadMode, toGrpcImageDownloadMode), } - client, err := apiContainerClient.RunStarlarkPackage(ctx, &runStarlarkPackageArgs) + client, err := (*apiContainerClient).RunStarlarkPackage(ctx, &runStarlarkPackageArgs) if err != nil { logrus.Errorf("Can't run Starlark package using gRPC call with enclave %s, error: %s", enclave_identifier, err) return nil, stacktrace.NewError("Can't run Starlark package using gRPC call with enclave %s", enclave_identifier) @@ -523,7 +598,10 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkPackagesPack // (POST /enclaves/{enclave_identifier}/starlark/scripts) func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx context.Context, request api.PostEnclavesEnclaveIdentifierStarlarkScriptsRequestObject) (api.PostEnclavesEnclaveIdentifierStarlarkScriptsResponseObject, error) { enclave_identifier := request.EnclaveIdentifier - apiContainerClient := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) + apiContainerClient, err := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) + if err != nil { + return nil, err + } logrus.Infof("Run Starlark script on enclave %s", enclave_identifier) flags := utils.MapList(utils.DerefWith(request.Body.ExperimentalFeatures, []api.KurtosisFeatureFlag{}), toGrpcFeatureFlag) @@ -546,7 +624,7 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx CloudUserId: request.Body.CloudUserId, ImageDownloadMode: utils.MapPointer(request.Body.ImageDownloadMode, toGrpcImageDownloadMode), } - client, err := apiContainerClient.RunStarlarkScript(ctx, &runStarlarkScriptArgs) + client, err := (*apiContainerClient).RunStarlarkScript(ctx, &runStarlarkScriptArgs) if err != nil { logrus.Errorf("Can't run Starlark script using gRPC call with enclave %s, error: %s", enclave_identifier, err) return nil, stacktrace.NewError("Can't run Starlark script using gRPC call with enclave %s", enclave_identifier) @@ -587,13 +665,19 @@ func getGrpcClientConn(enclaveInfo *types.EnclaveInfo, connectOnHostMachine bool return grpcConnection, nil } -func (manager enclaveRuntime) GetGrpcClientForEnclaveUUID(enclave_uuid string) kurtosis_core_rpc_api_bindings.ApiContainerServiceClient { +func (manager enclaveRuntime) GetGrpcClientForEnclaveUUID(enclave_uuid string) (*kurtosis_core_rpc_api_bindings.ApiContainerServiceClient, error) { + err := manager.refreshEnclaveConnections() + if err != nil { + return nil, err + } + client, found := manager.remoteApiContainerClient[enclave_uuid] if !found { - // TODO(edgar): add logic to retry/refresh map - panic(fmt.Sprintf("can't find enclave %s", enclave_uuid)) + err := stacktrace.NewError("Enclave '%s' not found", enclave_uuid) + return nil, err } - return client + + return &client, nil } func toGrpcConnect(conn api.Connect) kurtosis_core_rpc_api_bindings.Connect { diff --git a/engine/server/engine/server/engine_rest_api_handler.go b/engine/server/engine/server/engine_rest_api_handler.go index 6dbf025125..a2bef51b3c 100644 --- a/engine/server/engine/server/engine_rest_api_handler.go +++ b/engine/server/engine/server/engine_rest_api_handler.go @@ -2,23 +2,16 @@ package server import ( "context" - "encoding/json" "fmt" - "net/http" - "time" - "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/enclave" - user_service "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/service" "github.com/kurtosis-tech/kurtosis/engine/server/engine/centralized_logs" "github.com/kurtosis-tech/kurtosis/engine/server/engine/centralized_logs/client_implementations/persistent_volume/log_file_manager" - "github.com/kurtosis-tech/kurtosis/engine/server/engine/centralized_logs/logline" "github.com/kurtosis-tech/kurtosis/engine/server/engine/enclave_manager" "github.com/kurtosis-tech/kurtosis/engine/server/engine/types" "github.com/kurtosis-tech/kurtosis/engine/server/engine/utils" "github.com/kurtosis-tech/kurtosis/metrics-library/golang/lib/metrics_client" "github.com/kurtosis-tech/stacktrace" "github.com/sirupsen/logrus" - "golang.org/x/exp/slices" api "github.com/kurtosis-tech/kurtosis/api/golang/engine/kurtosis_engine_rest_api_bindings" ) @@ -56,90 +49,6 @@ func (error Error) Error() string { return "Not Implemented :(" } -func toHttpApiEnclaveContainersStatus(status types.EnclaveContainersStatus) api.EnclaveContainersStatus { - switch status { - case types.EnclaveContainersStatus_EMPTY: - return api.EnclaveContainersStatusEMPTY - case types.EnclaveContainersStatus_STOPPED: - return api.EnclaveContainersStatusSTOPPED - case types.EnclaveContainersStatus_RUNNING: - return api.EnclaveContainersStatusRUNNING - default: - panic(fmt.Sprintf("Undefined mapping of value: %s", status)) - } -} - -func toHttpApiContainerStatus(status types.ContainerStatus) api.ApiContainerStatus { - switch status { - case types.ContainerStatus_NONEXISTENT: - return api.ApiContainerStatusNONEXISTENT - case types.ContainerStatus_STOPPED: - return api.ApiContainerStatusSTOPPED - case types.ContainerStatus_RUNNING: - return api.ApiContainerStatusRUNNING - default: - panic(fmt.Sprintf("Undefined mapping of value: %s", status)) - } -} - -func toHttpApiEnclaveAPIContainerInfo(info types.EnclaveAPIContainerInfo) api.EnclaveAPIContainerInfo { - port := int(info.GrpcPortInsideEnclave) - return api.EnclaveAPIContainerInfo{ - ContainerId: info.ContainerId, - IpInsideEnclave: info.IpInsideEnclave, - GrpcPortInsideEnclave: port, - BridgeIpAddress: info.BridgeIpAddress, - } -} - -func toHttpApiApiContainerHostMachineInfo(info types.EnclaveAPIContainerHostMachineInfo) api.EnclaveAPIContainerHostMachineInfo { - port := int(info.GrpcPortOnHostMachine) - return api.EnclaveAPIContainerHostMachineInfo{ - IpOnHostMachine: info.IpOnHostMachine, - GrpcPortOnHostMachine: port, - } -} - -func toHttpApiEnclaveMode(mode types.EnclaveMode) api.EnclaveMode { - switch mode { - case types.EnclaveMode_PRODUCTION: - return api.PRODUCTION - case types.EnclaveMode_TEST: - return api.TEST - default: - panic(fmt.Sprintf("Undefined mapping of value: %s", mode)) - } -} - -func toHttpApiEnclaveInfo(info types.EnclaveInfo) api.EnclaveInfo { - return api.EnclaveInfo{ - EnclaveUuid: info.EnclaveUuid, - ShortenedUuid: info.ShortenedUuid, - Name: info.Name, - ContainersStatus: toHttpApiEnclaveContainersStatus(info.EnclaveContainersStatus), - ApiContainerStatus: toHttpApiContainerStatus(info.ApiContainerStatus), - ApiContainerInfo: utils.MapPointer(info.ApiContainerInfo, toHttpApiEnclaveAPIContainerInfo), - ApiContainerHostMachineInfo: utils.MapPointer(info.ApiContainerHostMachineInfo, toHttpApiApiContainerHostMachineInfo), - CreationTime: info.CreationTime, - Mode: toHttpApiEnclaveMode(info.Mode), - } -} - -func toHttpApiEnclaveIdentifiers(identifier *types.EnclaveIdentifiers) api.EnclaveIdentifiers { - return api.EnclaveIdentifiers{ - EnclaveUuid: identifier.EnclaveUuid, - Name: identifier.Name, - ShortenedUuid: identifier.ShortenedUuid, - } -} - -func toHttpApiEnclaveNameAndUuid(identifier *types.EnclaveNameAndUuid) api.EnclaveNameAndUuid { - return api.EnclaveNameAndUuid{ - Uuid: identifier.Uuid, - Name: identifier.Name, - } -} - // Delete Enclaves // (DELETE /enclaves) func (engine EngineRuntime) DeleteEnclaves(ctx context.Context, request api.DeleteEnclavesRequestObject) (api.DeleteEnclavesResponseObject, error) { @@ -233,94 +142,6 @@ func (engine EngineRuntime) GetEnclavesEnclaveIdentifier(ctx context.Context, re return nil, Error{} } -// Get Service Logs -// (POST /enclaves/{enclave_identifier}/logs) -func (engine EngineRuntime) PostEnclavesEnclaveIdentifierLogs(ctx context.Context, request api.PostEnclavesEnclaveIdentifierLogsRequestObject) (api.PostEnclavesEnclaveIdentifierLogsResponseObject, error) { - enclaveIdentifier := request.EnclaveIdentifier - enclaveUuid, err := engine.EnclaveManager.GetEnclaveUuidForEnclaveIdentifier(context.Background(), enclaveIdentifier) - - contextWithCancel, cancel := context.WithCancel(ctx) - defer cancel() - - if err != nil { - logrus.Errorf("An error occurred while fetching uuid for enclave '%v'. This could happen if the enclave has been deleted. Treating it as UUID", enclaveIdentifier) - return StreamLogsNotFound{}, nil - } - serviceUuidStrSet := *request.Body.ServiceUuidSet - requestedServiceUuids := make(map[user_service.ServiceUUID]bool, len(serviceUuidStrSet)) - shouldFollowLogs := *request.Body.FollowLogs - shouldReturnAllLogs := *request.Body.ReturnAllLogs - numLogLines := *request.Body.NumLogLines - - for _, serviceUuidStr := range serviceUuidStrSet { - serviceUuid := user_service.ServiceUUID(serviceUuidStr) - requestedServiceUuids[serviceUuid] = true - } - - if engine.PerWeekLogsDatabaseClient == nil || engine.PerFileLogsDatabaseClient == nil { - return nil, stacktrace.NewError("It's not possible to return service logs because there is no logs database client; this is bug in Kurtosis") - } - - var ( - serviceLogsByServiceUuidChan chan map[user_service.ServiceUUID][]logline.LogLine - errChan chan error - cancelCtxFunc func() - ) - - notFoundServiceUuids, err := engine.reportAnyMissingUuidsAndGetNotFoundUuidsListHttp(ctx, enclaveUuid, requestedServiceUuids) - if err != nil { - return nil, stacktrace.Propagate(err, "An error occurred reporting missing user service UUIDs for enclave '%v' and requested service UUIDs '%+v'", enclaveUuid, requestedServiceUuids) - } - - conjunctiveLogLineFilters, err := newConjunctiveLogLineFiltersFromHttpLogLineFilters(*request.Body.ConjunctiveFilters) - if err != nil { - return nil, stacktrace.Propagate(err, "An error occurred creating the conjunctive log line filters from the GRPC's conjunctive log line filters '%+v'", request.Body.ConjunctiveFilters) - } - - // get enclave creation time to determine strategy to pull logs - enclaveCreationTime, err := engine.getEnclaveCreationTime(ctx, enclaveUuid) - if err != nil { - return nil, stacktrace.Propagate(err, "An error occurred while trying to get the enclave creation time to determine how to pull logs.") - } - logsDatabaseClient := engine.getLogsDatabaseClient(enclaveCreationTime) - - serviceLogsByServiceUuidChan, errChan, cancelCtxFunc, err = logsDatabaseClient.StreamUserServiceLogs( - contextWithCancel, - enclaveUuid, - requestedServiceUuids, - conjunctiveLogLineFilters, - shouldFollowLogs, - shouldReturnAllLogs, - uint32(numLogLines)) - if err != nil { - return nil, stacktrace.Propagate( - err, - "An error occurred streaming service logs for UUIDs '%+v' in enclave with ID '%v' using filters '%v+' "+ - "and with should follow logs value as '%v'", - requestedServiceUuids, - enclaveUuid, - conjunctiveLogLineFilters, - shouldFollowLogs, - ) - } - defer func() { - if cancelCtxFunc != nil { - cancelCtxFunc() - } - }() - - streamingResponse := StreamLogs{ - serviceLogsByServiceUuidChan: serviceLogsByServiceUuidChan, - errChan: errChan, - missingServicesUUID: notFoundServiceUuids, - cancelCtxFunc: cancelCtxFunc, - contextWithCancel: contextWithCancel, - } - - return streamingResponse, nil - -} - // Stop Enclave // (POST /enclaves/{enclave_identifier}/stop) func (engine EngineRuntime) PostEnclavesEnclaveIdentifierStop(ctx context.Context, request api.PostEnclavesEnclaveIdentifierStopRequestObject) (api.PostEnclavesEnclaveIdentifierStopResponseObject, error) { @@ -348,171 +169,86 @@ func (engine EngineRuntime) GetEngineInfo(ctx context.Context, request api.GetEn // ============================================== Helper Functions ============================================================================= // ============================================================================================================================================= -type StreamLogs struct { - serviceLogsByServiceUuidChan chan map[user_service.ServiceUUID][]logline.LogLine - errChan chan error - requestedServicesUUID []user_service.ServiceUUID - missingServicesUUID []string - contextWithCancel context.Context - cancelCtxFunc func() -} - -type StreamLogsNotFound struct{} - -func (response StreamLogsNotFound) VisitPostEnclavesEnclaveIdentifierLogsResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(404) - return nil -} - -func (response StreamLogs) VisitPostEnclavesEnclaveIdentifierLogsResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(200) - - enc := json.NewEncoder(w) - for { - select { - //stream case - case serviceLogsByServiceUuid, isChanOpen := <-response.serviceLogsByServiceUuidChan: - //If the channel is closed means that the logs database client won't continue sending streams - if !isChanOpen { - logrus.Debug("Exiting the stream loop after receiving a close signal from the service logs by service UUID channel") - return nil - } - - getServiceLogsResponse := newLogsResponseHttp(response.requestedServicesUUID, serviceLogsByServiceUuid, response.missingServicesUUID) - enc.Encode(getServiceLogsResponse) - //client cancel ctx case - case <-response.contextWithCancel.Done(): - logrus.Debug("The user service logs stream has done") - return nil - //error from logs database case - case err, isChanOpen := <-response.errChan: - if isChanOpen { - logrus.Error(err) - logrus.Debug("Exiting the stream because an error from the logs database client was received through the error chan.") - return nil - } - logrus.Debug("Exiting the stream loop after receiving a close signal from the error chan") - return nil - } +func toHttpApiEnclaveContainersStatus(status types.EnclaveContainersStatus) api.EnclaveContainersStatus { + switch status { + case types.EnclaveContainersStatus_EMPTY: + return api.EnclaveContainersStatusEMPTY + case types.EnclaveContainersStatus_STOPPED: + return api.EnclaveContainersStatusSTOPPED + case types.EnclaveContainersStatus_RUNNING: + return api.EnclaveContainersStatusRUNNING + default: + panic(fmt.Sprintf("Undefined mapping of value: %s", status)) } } -func (service *EngineRuntime) reportAnyMissingUuidsAndGetNotFoundUuidsListHttp( - ctx context.Context, - enclaveUuid enclave.EnclaveUUID, - requestedServiceUuids map[user_service.ServiceUUID]bool, -) ([]string, error) { - // doesn't matter which logs client is used here - existingServiceUuids, err := service.PerWeekLogsDatabaseClient.FilterExistingServiceUuids(ctx, enclaveUuid, requestedServiceUuids) - if err != nil { - return nil, stacktrace.Propagate(err, "An error occurred retrieving the exhaustive list of service UUIDs from the log client for enclave '%v' and for the requested UUIDs '%+v'", enclaveUuid, requestedServiceUuids) - } - - notFoundServiceUuidsMap := getNotFoundServiceUuidsAndEmptyServiceLogsMap(requestedServiceUuids, existingServiceUuids) - var notFoundServiceUuids []string - for service := range notFoundServiceUuidsMap { - notFoundServiceUuids = append(notFoundServiceUuids, service) +func toHttpApiContainerStatus(status types.ContainerStatus) api.ApiContainerStatus { + switch status { + case types.ContainerStatus_NONEXISTENT: + return api.ApiContainerStatusNONEXISTENT + case types.ContainerStatus_STOPPED: + return api.ApiContainerStatusSTOPPED + case types.ContainerStatus_RUNNING: + return api.ApiContainerStatusRUNNING + default: + panic(fmt.Sprintf("Undefined mapping of value: %s", status)) } - return notFoundServiceUuids, nil } -func newLogsResponseHttp( - requestedServiceUuids []user_service.ServiceUUID, - serviceLogsByServiceUuid map[user_service.ServiceUUID][]logline.LogLine, - initialNotFoundServiceUuids []string, -) *api.ServiceLogs { - serviceLogLinesByUuid := make(map[string]api.LogLine, len(serviceLogsByServiceUuid)) - notFoundServiceUuids := make([]string, len(initialNotFoundServiceUuids)) - for _, serviceUuid := range requestedServiceUuids { - serviceUuidStr := string(serviceUuid) - isInNotFoundUuidList := slices.Contains(initialNotFoundServiceUuids, serviceUuidStr) - serviceLogLines, found := serviceLogsByServiceUuid[serviceUuid] - // should continue in the not-found-UUID list - if !found && isInNotFoundUuidList { - notFoundServiceUuids = append(notFoundServiceUuids, serviceUuidStr) - } - - // there is no new log lines but is a found UUID, so it has to be included in the service logs map - if !found && !isInNotFoundUuidList { - serviceLogLinesByUuid[serviceUuidStr] = api.LogLine{ - Line: []string{}, - Timestamp: time.Now(), - } - } - - logLines := newHttpBindingsLogLineFromLogLines(serviceLogLines) - serviceLogLinesByUuid[serviceUuidStr] = logLines - } - - response := &api.ServiceLogs{ - NotFoundServiceUuidSet: ¬FoundServiceUuids, - ServiceLogsByServiceUuid: &serviceLogLinesByUuid, +func toHttpApiEnclaveAPIContainerInfo(info types.EnclaveAPIContainerInfo) api.EnclaveAPIContainerInfo { + port := int(info.GrpcPortInsideEnclave) + return api.EnclaveAPIContainerInfo{ + ContainerId: info.ContainerId, + IpInsideEnclave: info.IpInsideEnclave, + GrpcPortInsideEnclave: port, + BridgeIpAddress: info.BridgeIpAddress, } - return response } -func newHttpBindingsLogLineFromLogLines(logLines []logline.LogLine) api.LogLine { - logLinesStr := make([]string, len(logLines)) - var logTimestamp time.Time - - for logLineIndex, logLine := range logLines { - logLinesStr[logLineIndex] = logLine.GetContent() - logTimestamp = logLine.GetTimestamp() +func toHttpApiApiContainerHostMachineInfo(info types.EnclaveAPIContainerHostMachineInfo) api.EnclaveAPIContainerHostMachineInfo { + port := int(info.GrpcPortOnHostMachine) + return api.EnclaveAPIContainerHostMachineInfo{ + IpOnHostMachine: info.IpOnHostMachine, + GrpcPortOnHostMachine: port, } - - return api.LogLine{Line: logLinesStr, Timestamp: logTimestamp} - } -func newConjunctiveLogLineFiltersFromHttpLogLineFilters( - logLineFilters []api.LogLineFilter, -) (logline.ConjunctiveLogLineFilters, error) { - var conjunctiveLogLineFilters logline.ConjunctiveLogLineFilters - - for _, logLineFilter := range logLineFilters { - var filter *logline.LogLineFilter - operator := logLineFilter.Operator - filterTextPattern := logLineFilter.TextPattern - switch operator { - case api.DOESCONTAINTEXT: - filter = logline.NewDoesContainTextLogLineFilter(filterTextPattern) - case api.DOESNOTCONTAINTEXT: - filter = logline.NewDoesNotContainTextLogLineFilter(filterTextPattern) - case api.DOESCONTAINMATCHREGEX: - filter = logline.NewDoesContainMatchRegexLogLineFilter(filterTextPattern) - case api.DOESNOTCONTAINMATCHREGEX: - filter = logline.NewDoesNotContainMatchRegexLogLineFilter(filterTextPattern) - default: - return nil, stacktrace.NewError("Unrecognized log line filter operator '%v' in GRPC filter '%v'; this is a bug in Kurtosis", operator, logLineFilter) - } - conjunctiveLogLineFilters = append(conjunctiveLogLineFilters, *filter) +func toHttpApiEnclaveMode(mode types.EnclaveMode) api.EnclaveMode { + switch mode { + case types.EnclaveMode_PRODUCTION: + return api.PRODUCTION + case types.EnclaveMode_TEST: + return api.TEST + default: + panic(fmt.Sprintf("Undefined mapping of value: %s", mode)) } - - return conjunctiveLogLineFilters, nil } -// If the enclave was created prior to log retention, return the per file logs client -func (service *EngineRuntime) getLogsDatabaseClient(enclaveCreationTime time.Time) centralized_logs.LogsDatabaseClient { - if enclaveCreationTime.After(logRetentionFeatureReleaseTime) { - return service.PerWeekLogsDatabaseClient - } else { - return service.PerFileLogsDatabaseClient +func toHttpApiEnclaveInfo(info types.EnclaveInfo) api.EnclaveInfo { + return api.EnclaveInfo{ + EnclaveUuid: info.EnclaveUuid, + ShortenedUuid: info.ShortenedUuid, + Name: info.Name, + ContainersStatus: toHttpApiEnclaveContainersStatus(info.EnclaveContainersStatus), + ApiContainerStatus: toHttpApiContainerStatus(info.ApiContainerStatus), + ApiContainerInfo: utils.MapPointer(info.ApiContainerInfo, toHttpApiEnclaveAPIContainerInfo), + ApiContainerHostMachineInfo: utils.MapPointer(info.ApiContainerHostMachineInfo, toHttpApiApiContainerHostMachineInfo), + CreationTime: info.CreationTime, + Mode: toHttpApiEnclaveMode(info.Mode), } } -func (service *EngineRuntime) getEnclaveCreationTime(ctx context.Context, enclaveUuid enclave.EnclaveUUID) (time.Time, error) { - enclaves, err := service.EnclaveManager.GetEnclaves(ctx) - if err != nil { - return time.Time{}, err +func toHttpApiEnclaveIdentifiers(identifier *types.EnclaveIdentifiers) api.EnclaveIdentifiers { + return api.EnclaveIdentifiers{ + EnclaveUuid: identifier.EnclaveUuid, + Name: identifier.Name, + ShortenedUuid: identifier.ShortenedUuid, } +} - enclaveObj, found := enclaves[string(enclaveUuid)] - if !found { - return time.Time{}, stacktrace.NewError("Engine could not find enclave '%v'", enclaveUuid) +func toHttpApiEnclaveNameAndUuid(identifier *types.EnclaveNameAndUuid) api.EnclaveNameAndUuid { + return api.EnclaveNameAndUuid{ + Uuid: identifier.Uuid, + Name: identifier.Name, } - - timestamp := enclaveObj.CreationTime - return timestamp, nil } diff --git a/engine/server/engine/server/logging_api_handler.go b/engine/server/engine/server/logging_api_handler.go new file mode 100644 index 0000000000..e184b60714 --- /dev/null +++ b/engine/server/engine/server/logging_api_handler.go @@ -0,0 +1,404 @@ +package server + +import ( + "context" + "encoding/json" + "net/http" + "time" + + "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/enclave" + user_service "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/service" + "github.com/kurtosis-tech/kurtosis/engine/server/engine/centralized_logs" + "github.com/kurtosis-tech/kurtosis/engine/server/engine/centralized_logs/client_implementations/persistent_volume/log_file_manager" + "github.com/kurtosis-tech/kurtosis/engine/server/engine/centralized_logs/logline" + "github.com/kurtosis-tech/kurtosis/engine/server/engine/enclave_manager" + "github.com/kurtosis-tech/kurtosis/engine/server/engine/utils" + "github.com/kurtosis-tech/kurtosis/metrics-library/golang/lib/metrics_client" + "github.com/kurtosis-tech/stacktrace" + "github.com/labstack/echo/v4" + "github.com/sirupsen/logrus" + "golang.org/x/exp/slices" + "golang.org/x/net/websocket" + + api "github.com/kurtosis-tech/kurtosis/api/golang/logging/kurtosis_logging_api_bindings" +) + +type LoggingRuntime struct { + // The version tag of the engine server image, so it can report its own version + ImageVersionTag string + + EnclaveManager *enclave_manager.EnclaveManager + + // The protected user ID for metrics analytics purpose + MetricsUserID string + + // User consent to send metrics + DidUserAcceptSendingMetrics bool + + // The clients for consuming container logs from the logs' database server + + // per week pulls logs from enclaves created post log retention feature + PerWeekLogsDatabaseClient centralized_logs.LogsDatabaseClient + + // per file pulls logs from enclaves created pre log retention feature + // TODO: remove once users are fully migrated to log retention/new log schema + PerFileLogsDatabaseClient centralized_logs.LogsDatabaseClient + + LogFileManager *log_file_manager.LogFileManager + + MetricsClient metrics_client.MetricsClient +} + +func sendErrorCode(ctx echo.Context, code int, message string) error { + err := ctx.JSON(code, message) + return err +} + +type LogStreamer struct { + serviceLogsByServiceUuidChan chan map[user_service.ServiceUUID][]logline.LogLine + errChan chan error + cancelCtxFunc func() + requestedServiceUuids []user_service.ServiceUUID + notFoundServiceUuids []string +} + +func (engine LoggingRuntime) GetEnclavesEnclaveIdentifierLogs(ctx echo.Context, enclaveIdentifier api.EnclaveIdentifier, params api.GetEnclavesEnclaveIdentifierLogsParams) error { + streamer, err := engine.getLogStreamer( + ctx, + enclaveIdentifier, + utils.MapList(params.ServiceUuidSet, func(x string) user_service.ServiceUUID { return user_service.ServiceUUID(x) }), + params.FollowLogs, + params.ReturnAllLogs, + utils.MapPointer(params.NumLogLines, func(x int) uint32 { return uint32(x) }), + params.ConjunctiveFilters, + ) + if err != nil { + logrus.Error(err) + return sendErrorCode(ctx, http.StatusInternalServerError, "Failed to setup log streaming") + } + + if ctx.IsWebSocket() { + return streamer.streamWithWebsocket(ctx) + } else { + return streamer.streamHTTP(ctx) + } + +} + +func (engine LoggingRuntime) GetEnclavesEnclaveIdentifierServicesServiceUuidLogs(ctx echo.Context, enclaveIdentifier api.EnclaveIdentifier, serviceUuid api.ServiceUuid, params api.GetEnclavesEnclaveIdentifierServicesServiceUuidLogsParams) error { + serviceUuidStrSet := []user_service.ServiceUUID{user_service.ServiceUUID(serviceUuid)} + streamer, err := engine.getLogStreamer( + ctx, + enclaveIdentifier, + serviceUuidStrSet, + params.FollowLogs, + params.ReturnAllLogs, + utils.MapPointer(params.NumLogLines, func(x int) uint32 { return uint32(x) }), + params.ConjunctiveFilters, + ) + if err != nil { + logrus.Error(err) + return sendErrorCode(ctx, http.StatusInternalServerError, "Failed to setup log streaming") + } + + if ctx.IsWebSocket() { + return streamer.streamWithWebsocket(ctx) + } else { + return streamer.streamHTTP(ctx) + } +} + +func (engine LoggingRuntime) getLogStreamer( + ctx echo.Context, + enclaveIdentifier api.EnclaveIdentifier, + serviceUuidList []user_service.ServiceUUID, + maybeShouldFollowLogs *bool, + maybeShouldReturnAllLogs *bool, + maybeNumLogLines *uint32, + maybeFilters *[]api.LogLineFilter, +) (*LogStreamer, error) { + enclaveUuid, err := engine.EnclaveManager.GetEnclaveUuidForEnclaveIdentifier(context.Background(), enclaveIdentifier) + if err != nil { + logrus.Errorf("An error occurred while fetching uuid for enclave '%v'. This could happen if the enclave has been deleted. Treating it as UUID", enclaveIdentifier) + return nil, err + } + + requestedServiceUuids := make(map[user_service.ServiceUUID]bool, len(serviceUuidList)) + shouldFollowLogs := utils.DerefWith(maybeShouldFollowLogs, false) + shouldReturnAllLogs := utils.DerefWith(maybeShouldReturnAllLogs, false) + numLogLines := utils.DerefWith(maybeNumLogLines, 100) + filters := utils.DerefWith(maybeFilters, []api.LogLineFilter{}) + context := ctx.Request().Context() + + for _, serviceUuidStr := range serviceUuidList { + serviceUuid := user_service.ServiceUUID(serviceUuidStr) + requestedServiceUuids[serviceUuid] = true + } + + if engine.PerWeekLogsDatabaseClient == nil || engine.PerFileLogsDatabaseClient == nil { + return nil, stacktrace.NewError("It's not possible to return service logs because there is no logs database client; this is bug in Kurtosis") + } + + var ( + serviceLogsByServiceUuidChan chan map[user_service.ServiceUUID][]logline.LogLine + errChan chan error + cancelCtxFunc func() + ) + + notFoundServiceUuids, err := engine.reportAnyMissingUuidsAndGetNotFoundUuidsListHttp(context, enclaveUuid, requestedServiceUuids) + if err != nil { + return nil, err + } + + conjunctiveLogLineFilters, err := fromHttpLogLineFilters(filters) + if err != nil { + return nil, err + } + + // get enclave creation time to determine strategy to pull logs + enclaveCreationTime, err := engine.getEnclaveCreationTime(context, enclaveUuid) + if err != nil { + return nil, err + } + logsDatabaseClient := engine.getLogsDatabaseClient(enclaveCreationTime) + + serviceLogsByServiceUuidChan, errChan, cancelCtxFunc, err = logsDatabaseClient.StreamUserServiceLogs( + context, + enclaveUuid, + requestedServiceUuids, + conjunctiveLogLineFilters, + shouldFollowLogs, + shouldReturnAllLogs, + uint32(numLogLines)) + if err != nil { + return nil, err + } + + return &LogStreamer{ + serviceLogsByServiceUuidChan: serviceLogsByServiceUuidChan, + errChan: errChan, + cancelCtxFunc: cancelCtxFunc, + notFoundServiceUuids: notFoundServiceUuids, + requestedServiceUuids: serviceUuidList, + }, nil +} + +func (streamer LogStreamer) close() { + streamer.cancelCtxFunc() +} + +func (streamer LogStreamer) streamWithWebsocket(ctx echo.Context) error { + defer streamer.close() + + logrus.Debugf("Starting log stream using Websocket on services: %s", streamer.requestedServiceUuids) + websocket.Handler(func(ws *websocket.Conn) { + defer ws.Close() + + for { + select { + //stream case + case serviceLogsByServiceUuid, isChanOpen := <-streamer.serviceLogsByServiceUuidChan: + //If the channel is closed means that the logs database client won't continue sending streams + if !isChanOpen { + logrus.Debug("Exiting the stream loop after receiving a close signal from the service logs by service UUID channel") + return + } + + getServiceLogsResponse := newLogsResponseHttp(streamer.requestedServiceUuids, serviceLogsByServiceUuid, streamer.notFoundServiceUuids) + err := websocket.JSON.Send(ws, getServiceLogsResponse) + if err != nil { + ctx.Logger().Error(err) + } + + //error from logs database case + case err, isChanOpen := <-streamer.errChan: + if isChanOpen { + logrus.Error(err) + logrus.Debug("Exiting the stream because an error from the logs database client was received through the error chan.") + return + } + logrus.Debug("Exiting the stream loop after receiving a close signal from the error chan") + return + } + } + }).ServeHTTP(ctx.Response(), ctx.Request()) + return nil +} + +func (streamer LogStreamer) streamHTTP(ctx echo.Context) error { + defer streamer.close() + + ctx.Response().Header().Set(echo.HeaderContentType, echo.MIMEApplicationJSON) + ctx.Response().WriteHeader(http.StatusOK) + enc := json.NewEncoder(ctx.Response()) + + logrus.Debugf("Starting log stream using HTTP on services: %s", streamer.requestedServiceUuids) + for { + select { + //stream case + case serviceLogsByServiceUuid, isChanOpen := <-streamer.serviceLogsByServiceUuidChan: + //If the channel is closed means that the logs database client won't continue sending streams + if !isChanOpen { + logrus.Debug("Exiting the stream loop after receiving a close signal from the service logs by service UUID channel") + return nil + } + + getServiceLogsResponse := newLogsResponseHttp(streamer.requestedServiceUuids, serviceLogsByServiceUuid, streamer.notFoundServiceUuids) + if err := enc.Encode(getServiceLogsResponse); err != nil { + return err + } + ctx.Response().Flush() + + //error from logs database case + case err, isChanOpen := <-streamer.errChan: + if isChanOpen { + logrus.Error(err) + logrus.Debug("Exiting the stream because an error from the logs database client was received through the error chan.") + return nil + } + logrus.Debug("Exiting the stream loop after receiving a close signal from the error chan") + return nil + } + } +} + +// ============================================================================================================================================= +// ============================================== Helper Functions ============================================================================= +// ============================================================================================================================================= + +func (service *LoggingRuntime) reportAnyMissingUuidsAndGetNotFoundUuidsListHttp( + ctx context.Context, + enclaveUuid enclave.EnclaveUUID, + requestedServiceUuids map[user_service.ServiceUUID]bool, +) ([]string, error) { + // doesn't matter which logs client is used here + existingServiceUuids, err := service.PerWeekLogsDatabaseClient.FilterExistingServiceUuids(ctx, enclaveUuid, requestedServiceUuids) + if err != nil { + return nil, stacktrace.Propagate(err, "An error occurred retrieving the exhaustive list of service UUIDs from the log client for enclave '%v' and for the requested UUIDs '%+v'", enclaveUuid, requestedServiceUuids) + } + + notFoundServiceUuidsMap := getNotFoundServiceUuidsAndEmptyServiceLogsMap(requestedServiceUuids, existingServiceUuids) + var notFoundServiceUuids []string + for service := range notFoundServiceUuidsMap { + notFoundServiceUuids = append(notFoundServiceUuids, service) + } + return notFoundServiceUuids, nil +} + +// If the enclave was created prior to log retention, return the per file logs client +func (service *LoggingRuntime) getLogsDatabaseClient(enclaveCreationTime time.Time) centralized_logs.LogsDatabaseClient { + if enclaveCreationTime.After(logRetentionFeatureReleaseTime) { + return service.PerWeekLogsDatabaseClient + } else { + return service.PerFileLogsDatabaseClient + } +} + +func (service *LoggingRuntime) getEnclaveCreationTime(ctx context.Context, enclaveUuid enclave.EnclaveUUID) (time.Time, error) { + enclaves, err := service.EnclaveManager.GetEnclaves(ctx) + if err != nil { + return time.Time{}, err + } + + enclaveObj, found := enclaves[string(enclaveUuid)] + if !found { + return time.Time{}, stacktrace.NewError("Engine could not find enclave '%v'", enclaveUuid) + } + + timestamp := enclaveObj.CreationTime + return timestamp, nil +} + +func fromHttpLogLineFilters( + logLineFilters []api.LogLineFilter, +) (logline.ConjunctiveLogLineFilters, error) { + var conjunctiveLogLineFilters logline.ConjunctiveLogLineFilters + + for _, logLineFilter := range logLineFilters { + var filter *logline.LogLineFilter + operator := logLineFilter.Operator + filterTextPattern := logLineFilter.TextPattern + switch operator { + case api.DOESCONTAINTEXT: + filter = logline.NewDoesContainTextLogLineFilter(filterTextPattern) + case api.DOESNOTCONTAINTEXT: + filter = logline.NewDoesNotContainTextLogLineFilter(filterTextPattern) + case api.DOESCONTAINMATCHREGEX: + filter = logline.NewDoesContainMatchRegexLogLineFilter(filterTextPattern) + case api.DOESNOTCONTAINMATCHREGEX: + filter = logline.NewDoesNotContainMatchRegexLogLineFilter(filterTextPattern) + default: + return nil, stacktrace.NewError("Unrecognized log line filter operator '%v' in GRPC filter '%v'; this is a bug in Kurtosis", operator, logLineFilter) + } + conjunctiveLogLineFilters = append(conjunctiveLogLineFilters, *filter) + } + + return conjunctiveLogLineFilters, nil +} + +func (service *EngineRuntime) reportAnyMissingUuidsAndGetNotFoundUuidsListHttp( + ctx context.Context, + enclaveUuid enclave.EnclaveUUID, + requestedServiceUuids map[user_service.ServiceUUID]bool, +) ([]string, error) { + // doesn't matter which logs client is used here + existingServiceUuids, err := service.PerWeekLogsDatabaseClient.FilterExistingServiceUuids(ctx, enclaveUuid, requestedServiceUuids) + if err != nil { + return nil, stacktrace.Propagate(err, "An error occurred retrieving the exhaustive list of service UUIDs from the log client for enclave '%v' and for the requested UUIDs '%+v'", enclaveUuid, requestedServiceUuids) + } + + notFoundServiceUuidsMap := getNotFoundServiceUuidsAndEmptyServiceLogsMap(requestedServiceUuids, existingServiceUuids) + var notFoundServiceUuids []string + for service := range notFoundServiceUuidsMap { + notFoundServiceUuids = append(notFoundServiceUuids, service) + } + return notFoundServiceUuids, nil +} + +func newLogsResponseHttp( + requestedServiceUuids []user_service.ServiceUUID, + serviceLogsByServiceUuid map[user_service.ServiceUUID][]logline.LogLine, + initialNotFoundServiceUuids []string, +) *api.ServiceLogs { + serviceLogLinesByUuid := make(map[string]api.LogLine, len(serviceLogsByServiceUuid)) + notFoundServiceUuids := make([]string, len(initialNotFoundServiceUuids)) + for _, serviceUuid := range requestedServiceUuids { + serviceUuidStr := string(serviceUuid) + isInNotFoundUuidList := slices.Contains(initialNotFoundServiceUuids, serviceUuidStr) + serviceLogLines, found := serviceLogsByServiceUuid[serviceUuid] + // should continue in the not-found-UUID list + if !found && isInNotFoundUuidList { + notFoundServiceUuids = append(notFoundServiceUuids, serviceUuidStr) + } + + // there is no new log lines but is a found UUID, so it has to be included in the service logs map + if !found && !isInNotFoundUuidList { + serviceLogLinesByUuid[serviceUuidStr] = api.LogLine{ + Line: []string{}, + Timestamp: time.Now(), + } + } + + logLines := newHttpBindingsLogLineFromLogLines(serviceLogLines) + serviceLogLinesByUuid[serviceUuidStr] = logLines + } + + response := &api.ServiceLogs{ + NotFoundServiceUuidSet: ¬FoundServiceUuids, + ServiceLogsByServiceUuid: &serviceLogLinesByUuid, + } + return response +} + +func newHttpBindingsLogLineFromLogLines(logLines []logline.LogLine) api.LogLine { + logLinesStr := make([]string, len(logLines)) + var logTimestamp time.Time + + for logLineIndex, logLine := range logLines { + logLinesStr[logLineIndex] = logLine.GetContent() + logTimestamp = logLine.GetTimestamp() + } + + return api.LogLine{Line: logLinesStr, Timestamp: logTimestamp} + +} From ce93eb37713ecb42338217628d62ce58e6880edf Mon Sep 17 00:00:00 2001 From: lostbean Date: Wed, 22 Nov 2023 10:22:31 -0300 Subject: [PATCH 48/95] remove duplicated parameter --- .../api_container_server.gen.go | 126 +++++++++--------- .../api_container_types.gen.go | 1 - api/openapi/core/core_service.yaml | 4 - .../engine/server/enclave_rest_api_handler.go | 2 +- 4 files changed, 64 insertions(+), 69 deletions(-) diff --git a/api/golang/core/kurtosis_core_rest_api_bindings/api_container_server.gen.go b/api/golang/core/kurtosis_core_rest_api_bindings/api_container_server.gen.go index 8d6799f73c..511954fb54 100644 --- a/api/golang/core/kurtosis_core_rest_api_bindings/api_container_server.gen.go +++ b/api/golang/core/kurtosis_core_rest_api_bindings/api_container_server.gen.go @@ -1322,69 +1322,69 @@ func (sh *strictHandler) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx echo.C var swaggerSpec = []string{ "H4sIAAAAAAAC/+w8a2/bOLZ/hdC9QGcWatydXSwu8i1Nk9bY1jHiZHMvJoWWlo5tTilSS1JJPIX/+wVf", - "th6ULKdJ2h3sl2nGJA/Pi4fnRX2NUp4XnAFTMjr+GhVY4BwUCPN/WCiywKlKSAZMkQUBoX/OQKaCFIpw", - "Fh1HVytAfiJiOAfEBSpLkkVxRPSEAqtVFEd6KDoOwowjAf8qiYAsOlaihDiS6QpyrDdT60Ivk0oQtow2", - "mzgCllJ8Bw2kAlsFJvbt1CarwOkXvAS0A4DUCit0TyhFc0DwAGmpQFPaRtMtTkj2zcADtFWgH8a9gguV", - "sDKfd8lST0B2AlIcpStIvyB8hwnFc0KJWncgVIHbh9GCixyr6DgiTP3llx3nCFOwBGFwlCDuSAp71c7N", - "q7KQL5BaAUo5U5gwz1P7U55jliG54iXNqhxGhIVpCuBxCLM3djJI9ZZnBMyRWhAK1wXlOHvLs7X+RaMK", - "TOk/85IqUmChRppLrzOsDNwA8+aEYbEO6J3Z1S4w+51yxiBVbf69Qa/R6cVkcnZ6hUYj9BakQrBYaOEb", - "DVhwcY9FRtjylv0ZvUaTi6QyfVqfgjIi8ZwaZQVW5tHxr5GbHcXRbmn0uYVxrFG0sjIGSPAChHLcSvMs", - "wWJp/iYKchlg8xYiFgKvI2MglFgXnDD1qMV3yR129i/LiGYXptMa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dmsZrmxf/GrVJsZm9awe+g1yK8xyoYKy3N0h2kNWstvE1Gz2yS2ZYUFphQokeVu", + "4f11y+fpMLUmY7MjWrFB6rbP5rM8SMeY5orWdPgztT44DVqTiD30jl+m/Z5M8cxylNAORq4dRQtZ+1z6", + "P3p1Byv1j7dGUEf6aN4mdpXzHATnxqXDHuUYywWUXEUQ+q2WCmE0o3iuGU5YoW9CsFI2OmTMVWA5CJOk", + "AG8CIycrFgsGxmpido/a8z8sy3ewLH+c/288/xIEwZT8DkUm17q92+VqL4k5WhObehuuA59IOuKExTKA", + "RDsfOacUDNZabDpwSK0QXQZQKNDn2UUUfSKqUaACbtdoYOtShvvjpF1APIIdYEzus0HEXqBtIWzQdCFV", + "a99dcmEzHjFjYSavV2bLRBbfwu9KkDusICNVhouiI088HCM9CFJuQQwNuqsW7NpExwc7E4O7aDaxW+x+", + "qOopJXk3BWMzHhLxJ14rjfefQsR1gC2gSZ1EAnC+wFMKt2x0cXV2jG58eUHbf5/82CxgrxQSNWOEzdPG", + "UEEKPVbAjDB9jJYmTSxT5GzHFOdfgBWo4GCAyLoyeWQB+h/ttFs6A9bPeJTZlh3Pw2uv9/0SsE7Zffr1", + "hU735ClP9vb52FbmrrPfYlUanO4dhuH7pY795bUzh/ki3kncq4h4AmGBcJ+j0MMV2O2MR9xiE+tm1TqZ", + "sYv2ZuajefVvfJDYfXiog9AobbbXx3ZucmsnJ6Li6XJbW0yKar5TvDMheKSGBf5nzuBilhz/usfmOGhD", + "pkBUApRJaVnYq7Tf2n9gSopHrDvzWRC37HOrrGB+38mEJojIAXTjGexgV1aClC61tafQ0ZjexqxVF2lu", + "v4uUuI9DOn6VStR53OjoJf0paszeS1C4cY/JM76H5B1kYDGvS98o0steRsCeOCDR0qsRjnZWsi1+tsxK", + "MN5tYInM5BdSVRAa2CBUrbgkfocDyRj7pS3j5QciOKYBCzupbaDdU1ZrpsZktpM/AioBUls9bS7jbArM", + "rQZngtyDwrzNqtiePWkcB8LajjpoXbKed6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F5JNIUFprNvY7/7d/hSbkbwyOS5TGlEQ58hVXtQI/52", + "a2Dsa1g/XnbI668FJr+zxk4cFj9w7qD9xYE/FK+teKvV/wcAAP//SICbs/5UAAA=", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/api/golang/core/kurtosis_core_rest_api_bindings/api_container_types.gen.go b/api/golang/core/kurtosis_core_rest_api_bindings/api_container_types.gen.go index 6e1f416801..24d55912c5 100644 --- a/api/golang/core/kurtosis_core_rest_api_bindings/api_container_types.gen.go +++ b/api/golang/core/kurtosis_core_rest_api_bindings/api_container_types.gen.go @@ -168,7 +168,6 @@ type RunStarlarkPackage struct { // MainFunctionName The name of the main function, the default value is "run" MainFunctionName *string `json:"main_function_name,omitempty"` - PackageId string `json:"package_id"` // Parallelism Defaults to 4 Parallelism *int32 `json:"parallelism,omitempty"` diff --git a/api/openapi/core/core_service.yaml b/api/openapi/core/core_service.yaml index 366709d92c..bfea733cdf 100644 --- a/api/openapi/core/core_service.yaml +++ b/api/openapi/core/core_service.yaml @@ -502,8 +502,6 @@ components: RunStarlarkPackage: type: object properties: - package_id: - type: string local: type: string format: byte @@ -548,8 +546,6 @@ components: description: Defaults to empty image_download_mode: $ref: "#/components/schemas/ImageDownloadMode" - required: - - package_id KurtosisFeatureFlag: type: string diff --git a/engine/server/engine/server/enclave_rest_api_handler.go b/engine/server/engine/server/enclave_rest_api_handler.go index e67618744b..751eede50c 100644 --- a/engine/server/engine/server/enclave_rest_api_handler.go +++ b/engine/server/engine/server/enclave_rest_api_handler.go @@ -562,7 +562,7 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkPackagesPack }) runStarlarkPackageArgs := kurtosis_core_rpc_api_bindings.RunStarlarkPackageArgs{ - PackageId: request.Body.PackageId, + PackageId: package_id, StarlarkPackageContent: nil, SerializedParams: jsonString, DryRun: request.Body.DryRun, From 0fdde59c48d26499afe650b0dee511693d528c65 Mon Sep 17 00:00:00 2001 From: lostbean Date: Wed, 22 Nov 2023 10:56:29 -0300 Subject: [PATCH 49/95] handle dead enclave/missing APIC --- .../engine/server/enclave_rest_api_handler.go | 32 ++++++++++++++----- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/engine/server/engine/server/enclave_rest_api_handler.go b/engine/server/engine/server/enclave_rest_api_handler.go index 751eede50c..ffcafbb01e 100644 --- a/engine/server/engine/server/enclave_rest_api_handler.go +++ b/engine/server/engine/server/enclave_rest_api_handler.go @@ -50,12 +50,16 @@ func (runtime enclaveRuntime) refreshEnclaveConnections() error { // Add new enclaves - assuming enclaves properties (API container connection) are immutable for uuid, info := range enclaves { _, found := runtime.remoteApiContainerClient[uuid] - if !found { - conn, err := getGrpcClientConn(info, runtime.connectOnHostMachine) + if !found && (info != nil) { + conn, err := getGrpcClientConn(*info, runtime.connectOnHostMachine) if err != nil { logrus.Errorf("Failed to establish gRPC connection with enclave manager service on enclave %s", uuid) return err } + if conn == nil { + logrus.Warnf("Unavailable gRPC connection to enclave '%s', skipping it!", uuid) + continue + } logrus.Debugf("Creating gRPC connection with enclave manager service on enclave %s", uuid) apiContainerClient := kurtosis_core_rpc_api_bindings.NewApiContainerServiceClient(conn) runtime.remoteApiContainerClient[uuid] = apiContainerClient @@ -650,13 +654,25 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx // GetGrpcClientConn returns a client conn dialed in to the local port // It is the caller's responsibility to call resultClientConn.close() -func getGrpcClientConn(enclaveInfo *types.EnclaveInfo, connectOnHostMachine bool) (resultClientConn *grpc.ClientConn, resultErr error) { - apiContainerGrpcPort := enclaveInfo.ApiContainerInfo.GrpcPortInsideEnclave - apiContainerIP := enclaveInfo.ApiContainerInfo.BridgeIpAddress - if connectOnHostMachine { - apiContainerGrpcPort = enclaveInfo.ApiContainerHostMachineInfo.GrpcPortOnHostMachine - apiContainerIP = enclaveInfo.ApiContainerHostMachineInfo.IpOnHostMachine +func getGrpcClientConn(enclaveInfo types.EnclaveInfo, connectOnHostMachine bool) (resultClientConn *grpc.ClientConn, resultErr error) { + enclaveAPIContainerInfo := enclaveInfo.ApiContainerInfo + if enclaveAPIContainerInfo == nil { + logrus.Infof("No API container info is available for enclave %s", enclaveInfo.EnclaveUuid) + return nil, nil + } + apiContainerGrpcPort := enclaveAPIContainerInfo.GrpcPortInsideEnclave + apiContainerIP := enclaveAPIContainerInfo.BridgeIpAddress + + enclaveAPIContainerHostMachineInfo := enclaveInfo.ApiContainerHostMachineInfo + if connectOnHostMachine && enclaveAPIContainerHostMachineInfo == nil { + logrus.Infof("No API container info is available for enclave %s", enclaveInfo.EnclaveUuid) + return nil, nil + } + if connectOnHostMachine && (enclaveAPIContainerHostMachineInfo != nil) { + apiContainerGrpcPort = enclaveAPIContainerHostMachineInfo.GrpcPortOnHostMachine + apiContainerIP = enclaveAPIContainerHostMachineInfo.IpOnHostMachine } + grpcServerAddress := fmt.Sprintf("%v:%v", apiContainerIP, apiContainerGrpcPort) grpcConnection, err := grpc.Dial(grpcServerAddress, grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { From 96dba22e44537670e00c8cd50ad144b0113907ee Mon Sep 17 00:00:00 2001 From: lostbean Date: Wed, 22 Nov 2023 15:53:07 -0300 Subject: [PATCH 50/95] fix package run --- .../engine/server/enclave_rest_api_handler.go | 30 +++++++++++++------ 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/engine/server/engine/server/enclave_rest_api_handler.go b/engine/server/engine/server/enclave_rest_api_handler.go index ffcafbb01e..28f89d3792 100644 --- a/engine/server/engine/server/enclave_rest_api_handler.go +++ b/engine/server/engine/server/enclave_rest_api_handler.go @@ -2,6 +2,8 @@ package server import ( "context" + "crypto/sha1" + "encoding/hex" "encoding/json" "fmt" "io" @@ -557,18 +559,18 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkPackagesPack package_id := request.PackageId flags := utils.MapList(utils.DerefWith(request.Body.ExperimentalFeatures, []api.KurtosisFeatureFlag{}), toGrpcFeatureFlag) - jsonString := utils.MapPointer(request.Body.Params, func(v map[string]interface{}) string { - jsonBlob, err := json.Marshal(v) - if err != nil { - panic("Failed to serialize parsed JSON") - } - return string(jsonBlob) - }) + // The gRPC always expect a JSON object even though it's marked as optional, so we need to default to `{}`` + jsonParams := utils.DerefWith(request.Body.Params, map[string]interface{}{}) + jsonBlob, err := json.Marshal(jsonParams) + if err != nil { + panic("Failed to serialize parameters") + } + jsonString := string(jsonBlob) runStarlarkPackageArgs := kurtosis_core_rpc_api_bindings.RunStarlarkPackageArgs{ PackageId: package_id, StarlarkPackageContent: nil, - SerializedParams: jsonString, + SerializedParams: &jsonString, DryRun: request.Body.DryRun, Parallelism: request.Body.Parallelism, ClonePackage: request.Body.ClonePackage, @@ -585,12 +587,22 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkPackagesPack return nil, stacktrace.NewError("Can't run Starlark package using gRPC call with enclave %s", enclave_identifier) } clientStream := grpc_file_streaming.NewClientStream[kurtosis_core_rpc_api_bindings.StreamedDataChunk, []byte](client) + + // TODO: Why the gRPC is not sending the previous hash??? and we need to calc it manually + hasher := sha1.New() + previousBlockHash := "" + blockHash := "" pipeReader := clientStream.PipeReader( package_id, func(dataChunk *kurtosis_core_rpc_api_bindings.StreamedDataChunk) ([]byte, string, error) { - return dataChunk.Data, dataChunk.PreviousChunkHash, nil + blockHash = previousBlockHash + hasher.Reset() + hasher.Write(dataChunk.Data) + previousBlockHash = hex.EncodeToString(hasher.Sum(nil)) + return dataChunk.Data, blockHash, nil }, ) + response := api.PostEnclavesEnclaveIdentifierStarlarkScripts200ApplicationoctetStreamResponse{ Body: pipeReader, ContentLength: 0, // No file size is provided since we are streaming it directly From b70e1a652ccf2069fed3f18cfd6e4e0c156fac52 Mon Sep 17 00:00:00 2001 From: lostbean Date: Wed, 22 Nov 2023 19:13:06 -0300 Subject: [PATCH 51/95] rename with shorter namespace --- .../engine/server/enclave_rest_api_handler.go | 129 +++++++++--------- 1 file changed, 64 insertions(+), 65 deletions(-) diff --git a/engine/server/engine/server/enclave_rest_api_handler.go b/engine/server/engine/server/enclave_rest_api_handler.go index 28f89d3792..312f87dc10 100644 --- a/engine/server/engine/server/enclave_rest_api_handler.go +++ b/engine/server/engine/server/enclave_rest_api_handler.go @@ -19,14 +19,13 @@ import ( "google.golang.org/grpc/credentials/insecure" "google.golang.org/protobuf/types/known/emptypb" - "github.com/kurtosis-tech/kurtosis/api/golang/core/kurtosis_core_rest_api_bindings" api "github.com/kurtosis-tech/kurtosis/api/golang/core/kurtosis_core_rest_api_bindings" - "github.com/kurtosis-tech/kurtosis/api/golang/core/kurtosis_core_rpc_api_bindings" + rpc_api "github.com/kurtosis-tech/kurtosis/api/golang/core/kurtosis_core_rpc_api_bindings" ) type enclaveRuntime struct { enclaveManager enclave_manager.EnclaveManager - remoteApiContainerClient map[string]kurtosis_core_rpc_api_bindings.ApiContainerServiceClient + remoteApiContainerClient map[string]rpc_api.ApiContainerServiceClient connectOnHostMachine bool ctx context.Context lock sync.Mutex @@ -63,7 +62,7 @@ func (runtime enclaveRuntime) refreshEnclaveConnections() error { continue } logrus.Debugf("Creating gRPC connection with enclave manager service on enclave %s", uuid) - apiContainerClient := kurtosis_core_rpc_api_bindings.NewApiContainerServiceClient(conn) + apiContainerClient := rpc_api.NewApiContainerServiceClient(conn) runtime.remoteApiContainerClient[uuid] = apiContainerClient } } @@ -75,7 +74,7 @@ func NewEnclaveRuntime(ctx context.Context, manager enclave_manager.EnclaveManag runtime := enclaveRuntime{ enclaveManager: manager, - remoteApiContainerClient: map[string]kurtosis_core_rpc_api_bindings.ApiContainerServiceClient{}, + remoteApiContainerClient: map[string]rpc_api.ApiContainerServiceClient{}, connectOnHostMachine: connectOnHostMachine, ctx: ctx, } @@ -107,8 +106,8 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierArtifacts(ctx context results := utils.MapList( artifacts.FileNamesAndUuids, - func(x *kurtosis_core_rpc_api_bindings.FilesArtifactNameAndUuid) kurtosis_core_rest_api_bindings.FileArtifactReference { - return kurtosis_core_rest_api_bindings.FileArtifactReference{ + func(x *rpc_api.FilesArtifactNameAndUuid) api.FileArtifactReference { + return api.FileArtifactReference{ Name: x.FileName, Uuid: x.FileUuid, } @@ -139,17 +138,17 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierArtifactsLocalFile(c if err != nil { return nil, stacktrace.Propagate(err, "Can't start file upload gRPC call with enclave %s", enclave_identifier) } - clientStream := grpc_file_streaming.NewClientStream[kurtosis_core_rpc_api_bindings.StreamedDataChunk, kurtosis_core_rpc_api_bindings.UploadFilesArtifactResponse](client) + clientStream := grpc_file_streaming.NewClientStream[rpc_api.StreamedDataChunk, rpc_api.UploadFilesArtifactResponse](client) response, err := clientStream.SendData( filename, part, 0, // Length unknown head of time - func(previousChunkHash string, contentChunk []byte) (*kurtosis_core_rpc_api_bindings.StreamedDataChunk, error) { - return &kurtosis_core_rpc_api_bindings.StreamedDataChunk{ + func(previousChunkHash string, contentChunk []byte) (*rpc_api.StreamedDataChunk, error) { + return &rpc_api.StreamedDataChunk{ Data: contentChunk, PreviousChunkHash: previousChunkHash, - Metadata: &kurtosis_core_rpc_api_bindings.DataChunkMetadata{ + Metadata: &rpc_api.DataChunkMetadata{ Name: filename, }, }, nil @@ -179,7 +178,7 @@ func (manager *enclaveRuntime) PutEnclavesEnclaveIdentifierArtifactsRemoteFile(c } logrus.Infof("Uploading file artifact to enclave %s", enclave_identifier) - storeWebFilesArtifactArgs := kurtosis_core_rpc_api_bindings.StoreWebFilesArtifactArgs{ + storeWebFilesArtifactArgs := rpc_api.StoreWebFilesArtifactArgs{ Url: request.Body.Url, Name: request.Body.Name, } @@ -206,7 +205,7 @@ func (manager *enclaveRuntime) PutEnclavesEnclaveIdentifierArtifactsServicesServ } logrus.Infof("Storing file artifact from service %s on enclave %s", service_identifier, enclave_identifier) - storeWebFilesArtifactArgs := kurtosis_core_rpc_api_bindings.StoreFilesArtifactFromServiceArgs{ + storeWebFilesArtifactArgs := rpc_api.StoreFilesArtifactFromServiceArgs{ ServiceIdentifier: service_identifier, SourcePath: request.Body.SourcePath, Name: request.Body.Name, @@ -234,8 +233,8 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierArtifactsArtifactIden } logrus.Infof("Inspecting file artifact %s on enclave %s", artifact_identifier, enclave_identifier) - inspectFilesArtifactContentsRequest := kurtosis_core_rpc_api_bindings.InspectFilesArtifactContentsRequest{ - FileNamesAndUuid: &kurtosis_core_rpc_api_bindings.FilesArtifactNameAndUuid{ + inspectFilesArtifactContentsRequest := rpc_api.InspectFilesArtifactContentsRequest{ + FileNamesAndUuid: &rpc_api.FilesArtifactNameAndUuid{ FileName: artifact_identifier, FileUuid: artifact_identifier, }, @@ -248,7 +247,7 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierArtifactsArtifactIden artifact_content_list := utils.MapList( stored_artifact.FileDescriptions, - func(x *kurtosis_core_rpc_api_bindings.FileArtifactContentsFileDescription) api.FileArtifactDescription { + func(x *rpc_api.FileArtifactContentsFileDescription) api.FileArtifactDescription { size := int64(x.Size) return api.FileArtifactDescription{ Path: x.Path, @@ -270,7 +269,7 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierArtifactsArtifactIden } logrus.Infof("Downloading file artifact %s from enclave %s", artifact_identifier, enclave_identifier) - downloadFilesArtifactArgs := kurtosis_core_rpc_api_bindings.DownloadFilesArtifactArgs{ + downloadFilesArtifactArgs := rpc_api.DownloadFilesArtifactArgs{ Identifier: artifact_identifier, } client, err := (*apiContainerClient).DownloadFilesArtifact(ctx, &downloadFilesArtifactArgs) @@ -279,10 +278,10 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierArtifactsArtifactIden return nil, stacktrace.NewError("Can't start file download gRPC call with enclave %s", enclave_identifier) } - clientStream := grpc_file_streaming.NewClientStream[kurtosis_core_rpc_api_bindings.StreamedDataChunk, []byte](client) + clientStream := grpc_file_streaming.NewClientStream[rpc_api.StreamedDataChunk, []byte](client) pipeReader := clientStream.PipeReader( artifact_identifier, - func(dataChunk *kurtosis_core_rpc_api_bindings.StreamedDataChunk) ([]byte, string, error) { + func(dataChunk *rpc_api.StreamedDataChunk) ([]byte, string, error) { return dataChunk.Data, dataChunk.PreviousChunkHash, nil }, ) @@ -305,7 +304,7 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierServices(ctx context. logrus.Infof("Getting info about services enclave %s", enclave_identifier) service_ids := utils.DerefWith(request.Params.Services, []string{}) - getServicesArgs := kurtosis_core_rpc_api_bindings.GetServicesArgs{ + getServicesArgs := rpc_api.GetServicesArgs{ ServiceIdentifiers: utils.NewMapFromList(service_ids, func(x string) bool { return true }), } services, err := (*apiContainerClient).GetServices(ctx, &getServicesArgs) @@ -333,7 +332,7 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierServicesHistory(ctx c return nil, stacktrace.NewError("Can't list services using gRPC call with enclave %s", enclave_identifier) } - response := utils.MapList(services.AllIdentifiers, func(service *kurtosis_core_rpc_api_bindings.ServiceIdentifiers) api.ServiceIdentifiers { + response := utils.MapList(services.AllIdentifiers, func(service *rpc_api.ServiceIdentifiers) api.ServiceIdentifiers { return api.ServiceIdentifiers{ ServiceUuid: service.ServiceUuid, ShortenedUuid: service.ShortenedUuid, @@ -353,7 +352,7 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierServicesConnection(c } logrus.Infof("Listing services from enclave %s", enclave_identifier) - connectServicesArgs := kurtosis_core_rpc_api_bindings.ConnectServicesArgs{ + connectServicesArgs := rpc_api.ConnectServicesArgs{ Connect: toGrpcConnect(*request.Body), } _, err = (*apiContainerClient).ConnectServices(ctx, &connectServicesArgs) @@ -375,7 +374,7 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierServicesServiceIdenti } logrus.Infof("Getting info about service %s from enclave %s", service_identifier, enclave_identifier) - getServicesArgs := kurtosis_core_rpc_api_bindings.GetServicesArgs{ + getServicesArgs := rpc_api.GetServicesArgs{ ServiceIdentifiers: map[string]bool{service_identifier: true}, } services, err := (*apiContainerClient).GetServices(ctx, &getServicesArgs) @@ -403,7 +402,7 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierServicesServiceIdent } logrus.Infof("Getting info about service %s from enclave %s", service_identifier, enclave_identifier) - execCommandArgs := kurtosis_core_rpc_api_bindings.ExecCommandArgs{ + execCommandArgs := rpc_api.ExecCommandArgs{ ServiceIdentifier: service_identifier, CommandArgs: request.Body.CommandArgs, } @@ -438,7 +437,7 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierServicesServiceIdent var err error switch endpoint_method { case api.GET: - waitForHttpGetEndpointAvailabilityArgs := kurtosis_core_rpc_api_bindings.WaitForHttpGetEndpointAvailabilityArgs{ + waitForHttpGetEndpointAvailabilityArgs := rpc_api.WaitForHttpGetEndpointAvailabilityArgs{ ServiceIdentifier: service_identifier, Port: uint32(port_number), Path: request.Body.Path, @@ -449,7 +448,7 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierServicesServiceIdent } _, err = (*apiContainerClient).WaitForHttpGetEndpointAvailability(ctx, &waitForHttpGetEndpointAvailabilityArgs) case api.POST: - waitForHttpPostEndpointAvailabilityArgs := kurtosis_core_rpc_api_bindings.WaitForHttpPostEndpointAvailabilityArgs{ + waitForHttpPostEndpointAvailabilityArgs := rpc_api.WaitForHttpPostEndpointAvailabilityArgs{ ServiceIdentifier: service_identifier, Port: uint32(port_number), Path: request.Body.Path, @@ -523,17 +522,17 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkPackages(ctx logrus.Errorf("Can't upload Starlark package using gRPC call with enclave %s, error: %s", enclave_identifier, err) return nil, stacktrace.NewError("Can't upload Starlark package using gRPC call with enclave %s", enclave_identifier) } - clientStream := grpc_file_streaming.NewClientStream[kurtosis_core_rpc_api_bindings.StreamedDataChunk, emptypb.Empty](client) + clientStream := grpc_file_streaming.NewClientStream[rpc_api.StreamedDataChunk, emptypb.Empty](client) _, err = clientStream.SendData( filename, part, 0, // Length unknown head of time - func(previousChunkHash string, contentChunk []byte) (*kurtosis_core_rpc_api_bindings.StreamedDataChunk, error) { - return &kurtosis_core_rpc_api_bindings.StreamedDataChunk{ + func(previousChunkHash string, contentChunk []byte) (*rpc_api.StreamedDataChunk, error) { + return &rpc_api.StreamedDataChunk{ Data: contentChunk, PreviousChunkHash: previousChunkHash, - Metadata: &kurtosis_core_rpc_api_bindings.DataChunkMetadata{ + Metadata: &rpc_api.DataChunkMetadata{ Name: filename, }, }, nil @@ -567,7 +566,7 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkPackagesPack } jsonString := string(jsonBlob) - runStarlarkPackageArgs := kurtosis_core_rpc_api_bindings.RunStarlarkPackageArgs{ + runStarlarkPackageArgs := rpc_api.RunStarlarkPackageArgs{ PackageId: package_id, StarlarkPackageContent: nil, SerializedParams: &jsonString, @@ -586,7 +585,7 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkPackagesPack logrus.Errorf("Can't run Starlark package using gRPC call with enclave %s, error: %s", enclave_identifier, err) return nil, stacktrace.NewError("Can't run Starlark package using gRPC call with enclave %s", enclave_identifier) } - clientStream := grpc_file_streaming.NewClientStream[kurtosis_core_rpc_api_bindings.StreamedDataChunk, []byte](client) + clientStream := grpc_file_streaming.NewClientStream[rpc_api.StreamedDataChunk, []byte](client) // TODO: Why the gRPC is not sending the previous hash??? and we need to calc it manually hasher := sha1.New() @@ -594,7 +593,7 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkPackagesPack blockHash := "" pipeReader := clientStream.PipeReader( package_id, - func(dataChunk *kurtosis_core_rpc_api_bindings.StreamedDataChunk) ([]byte, string, error) { + func(dataChunk *rpc_api.StreamedDataChunk) ([]byte, string, error) { blockHash = previousBlockHash hasher.Reset() hasher.Write(dataChunk.Data) @@ -629,7 +628,7 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx return string(jsonBlob) }) - runStarlarkScriptArgs := kurtosis_core_rpc_api_bindings.RunStarlarkScriptArgs{ + runStarlarkScriptArgs := rpc_api.RunStarlarkScriptArgs{ SerializedScript: request.Body.SerializedScript, SerializedParams: jsonString, DryRun: request.Body.DryRun, @@ -645,10 +644,10 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx logrus.Errorf("Can't run Starlark script using gRPC call with enclave %s, error: %s", enclave_identifier, err) return nil, stacktrace.NewError("Can't run Starlark script using gRPC call with enclave %s", enclave_identifier) } - clientStream := grpc_file_streaming.NewClientStream[kurtosis_core_rpc_api_bindings.StreamedDataChunk, []byte](client) + clientStream := grpc_file_streaming.NewClientStream[rpc_api.StreamedDataChunk, []byte](client) pipeReader := clientStream.PipeReader( "__RunStarlarkScript__", - func(dataChunk *kurtosis_core_rpc_api_bindings.StreamedDataChunk) ([]byte, string, error) { + func(dataChunk *rpc_api.StreamedDataChunk) ([]byte, string, error) { return dataChunk.Data, dataChunk.PreviousChunkHash, nil }, ) @@ -693,7 +692,7 @@ func getGrpcClientConn(enclaveInfo types.EnclaveInfo, connectOnHostMachine bool) return grpcConnection, nil } -func (manager enclaveRuntime) GetGrpcClientForEnclaveUUID(enclave_uuid string) (*kurtosis_core_rpc_api_bindings.ApiContainerServiceClient, error) { +func (manager enclaveRuntime) GetGrpcClientForEnclaveUUID(enclave_uuid string) (*rpc_api.ApiContainerServiceClient, error) { err := manager.refreshEnclaveConnections() if err != nil { return nil, err @@ -708,57 +707,57 @@ func (manager enclaveRuntime) GetGrpcClientForEnclaveUUID(enclave_uuid string) ( return &client, nil } -func toGrpcConnect(conn api.Connect) kurtosis_core_rpc_api_bindings.Connect { +func toGrpcConnect(conn api.Connect) rpc_api.Connect { switch conn { case api.CONNECT: - return kurtosis_core_rpc_api_bindings.Connect_CONNECT + return rpc_api.Connect_CONNECT case api.NOCONNECT: - return kurtosis_core_rpc_api_bindings.Connect_NO_CONNECT + return rpc_api.Connect_NO_CONNECT default: panic(fmt.Sprintf("Missing conversion of Connect Enum value: %s", conn)) } } -func toHttpContainerStatus(status kurtosis_core_rpc_api_bindings.Container_Status) api.ContainerStatus { +func toHttpContainerStatus(status rpc_api.Container_Status) api.ContainerStatus { switch status { - case kurtosis_core_rpc_api_bindings.Container_RUNNING: + case rpc_api.Container_RUNNING: return api.ContainerStatusRUNNING - case kurtosis_core_rpc_api_bindings.Container_STOPPED: + case rpc_api.Container_STOPPED: return api.ContainerStatusSTOPPED - case kurtosis_core_rpc_api_bindings.Container_UNKNOWN: + case rpc_api.Container_UNKNOWN: return api.ContainerStatusUNKNOWN default: panic(fmt.Sprintf("Missing conversion of Container Status Enum value: %s", status)) } } -func toHttpTransportProtocol(protocol kurtosis_core_rpc_api_bindings.Port_TransportProtocol) api.TransportProtocol { +func toHttpTransportProtocol(protocol rpc_api.Port_TransportProtocol) api.TransportProtocol { switch protocol { - case kurtosis_core_rpc_api_bindings.Port_TCP: + case rpc_api.Port_TCP: return api.TCP - case kurtosis_core_rpc_api_bindings.Port_UDP: + case rpc_api.Port_UDP: return api.UDP - case kurtosis_core_rpc_api_bindings.Port_SCTP: + case rpc_api.Port_SCTP: return api.SCTP default: panic(fmt.Sprintf("Missing conversion of Transport Protocol Enum value: %s", protocol)) } } -func toHttpServiceStatus(status kurtosis_core_rpc_api_bindings.ServiceStatus) api.ServiceStatus { +func toHttpServiceStatus(status rpc_api.ServiceStatus) api.ServiceStatus { switch status { - case kurtosis_core_rpc_api_bindings.ServiceStatus_RUNNING: + case rpc_api.ServiceStatus_RUNNING: return api.ServiceStatusRUNNING - case kurtosis_core_rpc_api_bindings.ServiceStatus_STOPPED: + case rpc_api.ServiceStatus_STOPPED: return api.ServiceStatusSTOPPED - case kurtosis_core_rpc_api_bindings.ServiceStatus_UNKNOWN: + case rpc_api.ServiceStatus_UNKNOWN: return api.ServiceStatusUNKNOWN default: panic(fmt.Sprintf("Missing conversion of Service Status Enum value: %s", status)) } } -func toHttpContainer(container *kurtosis_core_rpc_api_bindings.Container) api.Container { +func toHttpContainer(container *rpc_api.Container) api.Container { status := toHttpContainerStatus(container.Status) return api.Container{ CmdArgs: container.CmdArgs, @@ -769,7 +768,7 @@ func toHttpContainer(container *kurtosis_core_rpc_api_bindings.Container) api.Co } } -func toHttpPorts(port *kurtosis_core_rpc_api_bindings.Port) api.Port { +func toHttpPorts(port *rpc_api.Port) api.Port { protocol := toHttpTransportProtocol(port.TransportProtocol) return api.Port{ ApplicationProtocol: &port.MaybeApplicationProtocol, @@ -779,7 +778,7 @@ func toHttpPorts(port *kurtosis_core_rpc_api_bindings.Port) api.Port { } } -func toHttpServiceInfo(service *kurtosis_core_rpc_api_bindings.ServiceInfo) api.ServiceInfo { +func toHttpServiceInfo(service *rpc_api.ServiceInfo) api.ServiceInfo { container := toHttpContainer(service.Container) serviceStatus := toHttpServiceStatus(service.ServiceStatus) publicPorts := utils.MapMapValues(service.MaybePublicPorts, toHttpPorts) @@ -797,41 +796,41 @@ func toHttpServiceInfo(service *kurtosis_core_rpc_api_bindings.ServiceInfo) api. } } -func toHttpFeatureFlag(flag kurtosis_core_rpc_api_bindings.KurtosisFeatureFlag) api.KurtosisFeatureFlag { +func toHttpFeatureFlag(flag rpc_api.KurtosisFeatureFlag) api.KurtosisFeatureFlag { switch flag { - case kurtosis_core_rpc_api_bindings.KurtosisFeatureFlag_NO_INSTRUCTIONS_CACHING: + case rpc_api.KurtosisFeatureFlag_NO_INSTRUCTIONS_CACHING: return api.NOINSTRUCTIONSCACHING default: panic(fmt.Sprintf("Missing conversion of Feature Flag Enum value: %s", flag)) } } -func toHttpRestartPolicy(policy kurtosis_core_rpc_api_bindings.RestartPolicy) api.RestartPolicy { +func toHttpRestartPolicy(policy rpc_api.RestartPolicy) api.RestartPolicy { switch policy { - case kurtosis_core_rpc_api_bindings.RestartPolicy_ALWAYS: + case rpc_api.RestartPolicy_ALWAYS: return api.RestartPolicyALWAYS - case kurtosis_core_rpc_api_bindings.RestartPolicy_NEVER: + case rpc_api.RestartPolicy_NEVER: return api.RestartPolicyNEVER default: panic(fmt.Sprintf("Missing conversion of Restart Policy Enum value: %s", policy)) } } -func toGrpcFeatureFlag(flag api.KurtosisFeatureFlag) kurtosis_core_rpc_api_bindings.KurtosisFeatureFlag { +func toGrpcFeatureFlag(flag api.KurtosisFeatureFlag) rpc_api.KurtosisFeatureFlag { switch flag { case api.NOINSTRUCTIONSCACHING: - return kurtosis_core_rpc_api_bindings.KurtosisFeatureFlag_NO_INSTRUCTIONS_CACHING + return rpc_api.KurtosisFeatureFlag_NO_INSTRUCTIONS_CACHING default: panic(fmt.Sprintf("Missing conversion of Feature Flag Enum value: %s", flag)) } } -func toGrpcImageDownloadMode(flag api.ImageDownloadMode) kurtosis_core_rpc_api_bindings.ImageDownloadMode { +func toGrpcImageDownloadMode(flag api.ImageDownloadMode) rpc_api.ImageDownloadMode { switch flag { case api.ImageDownloadModeALWAYS: - return kurtosis_core_rpc_api_bindings.ImageDownloadMode_always + return rpc_api.ImageDownloadMode_always case api.ImageDownloadModeMISSING: - return kurtosis_core_rpc_api_bindings.ImageDownloadMode_missing + return rpc_api.ImageDownloadMode_missing default: panic(fmt.Sprintf("Missing conversion of Image Download Mode Enum value: %s", flag)) } From fec09f8af7aa34f1fdd4cdcf78dc338109cb3dff Mon Sep 17 00:00:00 2001 From: lostbean Date: Wed, 22 Nov 2023 22:16:29 -0300 Subject: [PATCH 52/95] more restful --- .../api_container_server.gen.go | 214 +++++++++--------- .../api_container_types.gen.go | 8 +- .../engine_server.gen.go | 153 +++++++++---- .../engine_types.gen.go | 11 + api/openapi/core/core_service.yaml | 4 +- api/openapi/engine/engine_service.yaml | 26 ++- .../engine/server/enclave_rest_api_handler.go | 12 +- .../engine/server/engine_rest_api_handler.go | 55 ++++- 8 files changed, 313 insertions(+), 170 deletions(-) diff --git a/api/golang/core/kurtosis_core_rest_api_bindings/api_container_server.gen.go b/api/golang/core/kurtosis_core_rest_api_bindings/api_container_server.gen.go index 511954fb54..c4b772f901 100644 --- a/api/golang/core/kurtosis_core_rest_api_bindings/api_container_server.gen.go +++ b/api/golang/core/kurtosis_core_rest_api_bindings/api_container_server.gen.go @@ -31,11 +31,11 @@ type ServerInterface interface { // (POST /enclaves/{enclave_identifier}/artifacts/local-file) PostEnclavesEnclaveIdentifierArtifactsLocalFile(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error - // (PUT /enclaves/{enclave_identifier}/artifacts/remote-file) - PutEnclavesEnclaveIdentifierArtifactsRemoteFile(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error + // (POST /enclaves/{enclave_identifier}/artifacts/remote-file) + PostEnclavesEnclaveIdentifierArtifactsRemoteFile(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error - // (PUT /enclaves/{enclave_identifier}/artifacts/services/{service_identifier}) - PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, serviceIdentifier ServiceIdentifier) error + // (POST /enclaves/{enclave_identifier}/artifacts/services/{service_identifier}) + PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, serviceIdentifier ServiceIdentifier) error // (GET /enclaves/{enclave_identifier}/artifacts/{artifact_identifier}) GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, artifactIdentifier ArtifactIdentifier) error @@ -111,8 +111,8 @@ func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierArtifactsLocalFile return err } -// PutEnclavesEnclaveIdentifierArtifactsRemoteFile converts echo context to params. -func (w *ServerInterfaceWrapper) PutEnclavesEnclaveIdentifierArtifactsRemoteFile(ctx echo.Context) error { +// PostEnclavesEnclaveIdentifierArtifactsRemoteFile converts echo context to params. +func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierArtifactsRemoteFile(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- var enclaveIdentifier EnclaveIdentifier @@ -123,12 +123,12 @@ func (w *ServerInterfaceWrapper) PutEnclavesEnclaveIdentifierArtifactsRemoteFile } // Invoke the callback with all the unmarshalled arguments - err = w.Handler.PutEnclavesEnclaveIdentifierArtifactsRemoteFile(ctx, enclaveIdentifier) + err = w.Handler.PostEnclavesEnclaveIdentifierArtifactsRemoteFile(ctx, enclaveIdentifier) return err } -// PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier converts echo context to params. -func (w *ServerInterfaceWrapper) PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier(ctx echo.Context) error { +// PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier converts echo context to params. +func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- var enclaveIdentifier EnclaveIdentifier @@ -147,7 +147,7 @@ func (w *ServerInterfaceWrapper) PutEnclavesEnclaveIdentifierArtifactsServicesSe } // Invoke the callback with all the unmarshalled arguments - err = w.Handler.PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier(ctx, enclaveIdentifier, serviceIdentifier) + err = w.Handler.PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier(ctx, enclaveIdentifier, serviceIdentifier) return err } @@ -438,8 +438,8 @@ func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL router.GET(baseURL+"/enclaves/:enclave_identifier/artifacts", wrapper.GetEnclavesEnclaveIdentifierArtifacts) router.POST(baseURL+"/enclaves/:enclave_identifier/artifacts/local-file", wrapper.PostEnclavesEnclaveIdentifierArtifactsLocalFile) - router.PUT(baseURL+"/enclaves/:enclave_identifier/artifacts/remote-file", wrapper.PutEnclavesEnclaveIdentifierArtifactsRemoteFile) - router.PUT(baseURL+"/enclaves/:enclave_identifier/artifacts/services/:service_identifier", wrapper.PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier) + router.POST(baseURL+"/enclaves/:enclave_identifier/artifacts/remote-file", wrapper.PostEnclavesEnclaveIdentifierArtifactsRemoteFile) + router.POST(baseURL+"/enclaves/:enclave_identifier/artifacts/services/:service_identifier", wrapper.PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier) router.GET(baseURL+"/enclaves/:enclave_identifier/artifacts/:artifact_identifier", wrapper.GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier) router.GET(baseURL+"/enclaves/:enclave_identifier/artifacts/:artifact_identifier/download", wrapper.GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownload) router.GET(baseURL+"/enclaves/:enclave_identifier/services", wrapper.GetEnclavesEnclaveIdentifierServices) @@ -490,37 +490,37 @@ func (response PostEnclavesEnclaveIdentifierArtifactsLocalFile200JSONResponse) V return json.NewEncoder(w).Encode(response) } -type PutEnclavesEnclaveIdentifierArtifactsRemoteFileRequestObject struct { +type PostEnclavesEnclaveIdentifierArtifactsRemoteFileRequestObject struct { EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` - Body *PutEnclavesEnclaveIdentifierArtifactsRemoteFileJSONRequestBody + Body *PostEnclavesEnclaveIdentifierArtifactsRemoteFileJSONRequestBody } -type PutEnclavesEnclaveIdentifierArtifactsRemoteFileResponseObject interface { - VisitPutEnclavesEnclaveIdentifierArtifactsRemoteFileResponse(w http.ResponseWriter) error +type PostEnclavesEnclaveIdentifierArtifactsRemoteFileResponseObject interface { + VisitPostEnclavesEnclaveIdentifierArtifactsRemoteFileResponse(w http.ResponseWriter) error } -type PutEnclavesEnclaveIdentifierArtifactsRemoteFile200JSONResponse FileArtifactReference +type PostEnclavesEnclaveIdentifierArtifactsRemoteFile200JSONResponse FileArtifactReference -func (response PutEnclavesEnclaveIdentifierArtifactsRemoteFile200JSONResponse) VisitPutEnclavesEnclaveIdentifierArtifactsRemoteFileResponse(w http.ResponseWriter) error { +func (response PostEnclavesEnclaveIdentifierArtifactsRemoteFile200JSONResponse) VisitPostEnclavesEnclaveIdentifierArtifactsRemoteFileResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") w.WriteHeader(200) return json.NewEncoder(w).Encode(response) } -type PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierRequestObject struct { +type PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierRequestObject struct { EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` ServiceIdentifier ServiceIdentifier `json:"service_identifier"` - Body *PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierJSONRequestBody + Body *PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierJSONRequestBody } -type PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierResponseObject interface { - VisitPutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierResponse(w http.ResponseWriter) error +type PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierResponseObject interface { + VisitPostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierResponse(w http.ResponseWriter) error } -type PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier200JSONResponse FileArtifactReference +type PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier200JSONResponse FileArtifactReference -func (response PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier200JSONResponse) VisitPutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierResponse(w http.ResponseWriter) error { +func (response PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier200JSONResponse) VisitPostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") w.WriteHeader(200) @@ -799,11 +799,11 @@ type StrictServerInterface interface { // (POST /enclaves/{enclave_identifier}/artifacts/local-file) PostEnclavesEnclaveIdentifierArtifactsLocalFile(ctx context.Context, request PostEnclavesEnclaveIdentifierArtifactsLocalFileRequestObject) (PostEnclavesEnclaveIdentifierArtifactsLocalFileResponseObject, error) - // (PUT /enclaves/{enclave_identifier}/artifacts/remote-file) - PutEnclavesEnclaveIdentifierArtifactsRemoteFile(ctx context.Context, request PutEnclavesEnclaveIdentifierArtifactsRemoteFileRequestObject) (PutEnclavesEnclaveIdentifierArtifactsRemoteFileResponseObject, error) + // (POST /enclaves/{enclave_identifier}/artifacts/remote-file) + PostEnclavesEnclaveIdentifierArtifactsRemoteFile(ctx context.Context, request PostEnclavesEnclaveIdentifierArtifactsRemoteFileRequestObject) (PostEnclavesEnclaveIdentifierArtifactsRemoteFileResponseObject, error) - // (PUT /enclaves/{enclave_identifier}/artifacts/services/{service_identifier}) - PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier(ctx context.Context, request PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierRequestObject) (PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierResponseObject, error) + // (POST /enclaves/{enclave_identifier}/artifacts/services/{service_identifier}) + PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier(ctx context.Context, request PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierRequestObject) (PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierResponseObject, error) // (GET /enclaves/{enclave_identifier}/artifacts/{artifact_identifier}) GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier(ctx context.Context, request GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierRequestObject) (GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierResponseObject, error) @@ -911,63 +911,63 @@ func (sh *strictHandler) PostEnclavesEnclaveIdentifierArtifactsLocalFile(ctx ech return nil } -// PutEnclavesEnclaveIdentifierArtifactsRemoteFile operation middleware -func (sh *strictHandler) PutEnclavesEnclaveIdentifierArtifactsRemoteFile(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error { - var request PutEnclavesEnclaveIdentifierArtifactsRemoteFileRequestObject +// PostEnclavesEnclaveIdentifierArtifactsRemoteFile operation middleware +func (sh *strictHandler) PostEnclavesEnclaveIdentifierArtifactsRemoteFile(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error { + var request PostEnclavesEnclaveIdentifierArtifactsRemoteFileRequestObject request.EnclaveIdentifier = enclaveIdentifier - var body PutEnclavesEnclaveIdentifierArtifactsRemoteFileJSONRequestBody + var body PostEnclavesEnclaveIdentifierArtifactsRemoteFileJSONRequestBody if err := ctx.Bind(&body); err != nil { return err } request.Body = &body handler := func(ctx echo.Context, request interface{}) (interface{}, error) { - return sh.ssi.PutEnclavesEnclaveIdentifierArtifactsRemoteFile(ctx.Request().Context(), request.(PutEnclavesEnclaveIdentifierArtifactsRemoteFileRequestObject)) + return sh.ssi.PostEnclavesEnclaveIdentifierArtifactsRemoteFile(ctx.Request().Context(), request.(PostEnclavesEnclaveIdentifierArtifactsRemoteFileRequestObject)) } for _, middleware := range sh.middlewares { - handler = middleware(handler, "PutEnclavesEnclaveIdentifierArtifactsRemoteFile") + handler = middleware(handler, "PostEnclavesEnclaveIdentifierArtifactsRemoteFile") } response, err := handler(ctx, request) if err != nil { return err - } else if validResponse, ok := response.(PutEnclavesEnclaveIdentifierArtifactsRemoteFileResponseObject); ok { - return validResponse.VisitPutEnclavesEnclaveIdentifierArtifactsRemoteFileResponse(ctx.Response()) + } else if validResponse, ok := response.(PostEnclavesEnclaveIdentifierArtifactsRemoteFileResponseObject); ok { + return validResponse.VisitPostEnclavesEnclaveIdentifierArtifactsRemoteFileResponse(ctx.Response()) } else if response != nil { return fmt.Errorf("Unexpected response type: %T", response) } return nil } -// PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier operation middleware -func (sh *strictHandler) PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, serviceIdentifier ServiceIdentifier) error { - var request PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierRequestObject +// PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier operation middleware +func (sh *strictHandler) PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, serviceIdentifier ServiceIdentifier) error { + var request PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierRequestObject request.EnclaveIdentifier = enclaveIdentifier request.ServiceIdentifier = serviceIdentifier - var body PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierJSONRequestBody + var body PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierJSONRequestBody if err := ctx.Bind(&body); err != nil { return err } request.Body = &body handler := func(ctx echo.Context, request interface{}) (interface{}, error) { - return sh.ssi.PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier(ctx.Request().Context(), request.(PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierRequestObject)) + return sh.ssi.PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier(ctx.Request().Context(), request.(PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierRequestObject)) } for _, middleware := range sh.middlewares { - handler = middleware(handler, "PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier") + handler = middleware(handler, "PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier") } response, err := handler(ctx, request) if err != nil { return err - } else if validResponse, ok := response.(PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierResponseObject); ok { - return validResponse.VisitPutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierResponse(ctx.Response()) + } else if validResponse, ok := response.(PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierResponseObject); ok { + return validResponse.VisitPostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierResponse(ctx.Response()) } else if response != nil { return fmt.Errorf("Unexpected response type: %T", response) } @@ -1321,70 +1321,70 @@ func (sh *strictHandler) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx echo.C // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/+w8a2/bOLZ/hdC9QGcWatydXSwu8i1Nk9bY1jHiZHMvJoWWl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UXEUQ+q2WCmE0o3iuGU5YoW9CsFI2OmTMVWA5CJOk", - "AG8CIycrFgsGxmpido/a8z8sy3ewLH+c/288/xIEwZT8DkUm17q92+VqL4k5WhObehuuA59IOuKExTKA", - "RDsfOacUDNZabDpwSK0QXQZQKNDn2UUUfSKqUaACbtdoYOtShvvjpF1APIIdYEzus0HEXqBtIWzQdCFV", - "a99dcmEzHjFjYSavV2bLRBbfwu9KkDusICNVhouiI088HCM9CFJuQQwNuqsW7NpExwc7E4O7aDaxW+x+", - "qOopJXk3BWMzHhLxJ14rjfefQsR1gC2gSZ1EAnC+wFMKt2x0cXV2jG58eUHbf5/82CxgrxQSNWOEzdPG", - "UEEKPVbAjDB9jJYmTSxT5GzHFOdfgBWo4GCAyLoyeWQB+h/ttFs6A9bPeJTZlh3Pw2uv9/0SsE7Zffr1", - "hU735ClP9vb52FbmrrPfYlUanO4dhuH7pY795bUzh/ki3kncq4h4AmGBcJ+j0MMV2O2MR9xiE+tm1TqZ", - "sYv2ZuajefVvfJDYfXiog9AobbbXx3ZucmsnJ6Li6XJbW0yKar5TvDMheKSGBf5nzuBilhz/usfmOGhD", - "pkBUApRJaVnYq7Tf2n9gSopHrDvzWRC37HOrrGB+38mEJojIAXTjGexgV1aClC61tafQ0ZjexqxVF2lu", - "v4uUuI9DOn6VStR53OjoJf0paszeS1C4cY/JM76H5B1kYDGvS98o0steRsCeOCDR0qsRjnZWsi1+tsxK", - "MN5tYInM5BdSVRAa2CBUrbgkfocDyRj7pS3j5QciOKYBCzupbaDdU1ZrpsZktpM/AioBUls9bS7jbArM", - "rQZngtyDwrzNqtiePWkcB8LajjpoXbKed6S+AzoZQgmDvj0qIa1roA5E6nHqSVtXITnUINExJ+BzfHpv", - "MUWWH2J+uteENLcvtQjV4aTvc09EcdhF2WXNzgkjcgHF2V30KIpaeyB2SgbxOfp01CyTdZ6DlLOa7j2R", - "m76BPbdKC3IMzF6+RIjYw5Wx4HMdtEb6CdxIFr9S81oIYCqTCqr1lP59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Ab", + "mKJmB1PPJPvh/KtFpDJ8ffURKY58fciAWreo9+KKBruDG+1ulWjCa3I6csmu8elk5DNd70ZBlmtyqv9P", + "Dydpoodiqa0bTNQ5F76N5yRsxm43f2Ci0DkX6MNkMlq3/qCTZgd3UxpTXiwzBQ8RiQ5nLsns4AhQtWAS", + "qQWRtuDVzBN7HSyx+AIFwtL3jlNAP8HR/Ah9AEo5uuGCFj8fxWS6UKrKSlALbgI3z6r3Z5MkTUaX43gb", + "MWFEEUyzAiheZiWhlEjIOStkh57ZFnc+Q+FcrTemqahmilDfF8LmTh2FVJavOaa0b4Gu62ibo7xVkPAd", + "90doqEz12eTSFRYK3RO1CNCQFMvFkZG0LxyjfzowgwVgqhb/jFfDlXBib6L0CT8ETFlTibBSUFZK+lZ6", + "4gyNa593nJqTO82mujIlNqsl+gfMkL0s0n4pTINcLyFe7BbgFNQ9mJZDS296sCcX6mHkbjE6Z93Srbrk", + "aKixKDEjVU19R4Er05jWIqKoBnXmKje2l+AOhHS24+jPR280O3gFDFckOU7+cvTm6E1itcnwYuDhDb62", + "37msBt7cmblziBzsj0QqpOXbNLIaP20azD0/LJLj5D0oh6h0/26qsifBqvDtUIf3uJkyiDzOWX02+Vbj", + "iBq8f3nzZuuFRNCuOPhN2mzA5nlEr6RUvAO33Re+2q6aj9exE3LPOhL73KKvKAamPem1T8hXXEbEYjvg", + "JMJbcvGt1b4GYS5YNF5KBWVLZCMue8jso0bn3CbFn0h4/rVLZzmh8SBmsPUaZvWN8n9MqXCfOoTH/an1", + "wTYm7VGICVAqfctR+LApcHBayrLu1LyH6TNozpVB/BlVp7fId4daMZ81Jslur7X52utbFfQRivgceue8", + "BDn42n7htnqUJua8WnZoIQ59myfWQxeeyVa30JOoZbp3VeSB4LMqc2d8umr6Lv9Buvo18mB41enUDJms", + "IFfrN6DAXHvo9oukR7g4/o8X17LYk+mX95XCvooX8Zaikh/4O69TBXyPp9xxK/YyQY9UCr//v49y8FyB", + "ei2VAFwe/N74qeTu76RArv3F4e+Bp+L5FklAtU3xGOp7bA7KNLBp9vhqb3Kc/KsGw6Xm+3GNVuTg7XuY", + "+vk7eMNhe+dz+sBrDyS379N9YTceEkkQG+5vvU4/zHPwinK62fYHdmD94/3+t/sTS2dBpOJi2Wlrr1wy", + "MDgKCE95bRML8ECkyZ3d1m/e/PI3ZKGRHFMUnIzDT/kHh9W/Tcoh0sz+jDfoXu/+0eb1h3Ozn8m9bVjB", + "FxLMIN989iBuBm21FmwENid3wNbfNHFt7Ni3bm+Cs8eZx5agg68u/GeFVeEHJyKi3vrkxMtFWO3PTLyY", + "IvpSjxx8DT7qsxrgrbJTXEvfUp5/cTWBjaKaakKrhrSuDKXrl71Ex26C1/MFwnbVe1Br6p5GmdfP4Udc", + "KFtF2K6OfScl378q/MzSc52JXeXGiBY2C45aXF1Fx8e7MD312vUedPorGjmKpdq8dBM1O8wH8Vv8CM5H", + "nz6TRtj+hCbEgR+4bn3Zp6Kx/b7wCE0WRCKpoLJvlax6+Ef54RP+HLPGJ7tMMTTyqYTDLERzsfzB6yBP", + "cDLW4hp83TyzWPXwOQLh2XHE7QvsWoJ4JdEUFpjOvo397t/hS7kZwUOT5zKlEQ19hlTtQc342+2BsS9i", + "/XjZIa+/Fpj8zho7dlj8wLmD9lcH/lC8tuKtVv8fAAD//yqq0RgCVQAA", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/api/golang/core/kurtosis_core_rest_api_bindings/api_container_types.gen.go b/api/golang/core/kurtosis_core_rest_api_bindings/api_container_types.gen.go index 24d55912c5..b24d22a47a 100644 --- a/api/golang/core/kurtosis_core_rest_api_bindings/api_container_types.gen.go +++ b/api/golang/core/kurtosis_core_rest_api_bindings/api_container_types.gen.go @@ -443,11 +443,11 @@ type PostEnclavesEnclaveIdentifierStarlarkPackagesMultipartBody = openapi_types. // PostEnclavesEnclaveIdentifierArtifactsLocalFileMultipartRequestBody defines body for PostEnclavesEnclaveIdentifierArtifactsLocalFile for multipart/form-data ContentType. type PostEnclavesEnclaveIdentifierArtifactsLocalFileMultipartRequestBody = PostEnclavesEnclaveIdentifierArtifactsLocalFileMultipartBody -// PutEnclavesEnclaveIdentifierArtifactsRemoteFileJSONRequestBody defines body for PutEnclavesEnclaveIdentifierArtifactsRemoteFile for application/json ContentType. -type PutEnclavesEnclaveIdentifierArtifactsRemoteFileJSONRequestBody = StoreWebFilesArtifact +// PostEnclavesEnclaveIdentifierArtifactsRemoteFileJSONRequestBody defines body for PostEnclavesEnclaveIdentifierArtifactsRemoteFile for application/json ContentType. +type PostEnclavesEnclaveIdentifierArtifactsRemoteFileJSONRequestBody = StoreWebFilesArtifact -// PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierJSONRequestBody defines body for PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier for application/json ContentType. -type PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierJSONRequestBody = StoreFilesArtifactFromService +// PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierJSONRequestBody defines body for PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier for application/json ContentType. +type PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierJSONRequestBody = StoreFilesArtifactFromService // PostEnclavesEnclaveIdentifierServicesConnectionJSONRequestBody defines body for PostEnclavesEnclaveIdentifierServicesConnection for application/json ContentType. type PostEnclavesEnclaveIdentifierServicesConnectionJSONRequestBody = Connect diff --git a/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_server.gen.go b/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_server.gen.go index 3d2d46ffaa..cfbe15a626 100644 --- a/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_server.gen.go +++ b/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_server.gen.go @@ -40,9 +40,12 @@ type ServerInterface interface { // Get Enclave Info // (GET /enclaves/{enclave_identifier}) GetEnclavesEnclaveIdentifier(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error - // Stop Enclave - // (POST /enclaves/{enclave_identifier}/stop) - PostEnclavesEnclaveIdentifierStop(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error + // Get enclave status + // (GET /enclaves/{enclave_identifier}/status) + GetEnclavesEnclaveIdentifierStatus(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error + // Set enclave status + // (POST /enclaves/{enclave_identifier}/status) + PostEnclavesEnclaveIdentifierStatus(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error // Get Engine Info // (GET /engine/info) GetEngineInfo(ctx echo.Context) error @@ -130,8 +133,8 @@ func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifier(ctx echo.Context) return err } -// PostEnclavesEnclaveIdentifierStop converts echo context to params. -func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierStop(ctx echo.Context) error { +// GetEnclavesEnclaveIdentifierStatus converts echo context to params. +func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierStatus(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- var enclaveIdentifier EnclaveIdentifier @@ -142,7 +145,23 @@ func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierStop(ctx echo.Cont } // Invoke the callback with all the unmarshalled arguments - err = w.Handler.PostEnclavesEnclaveIdentifierStop(ctx, enclaveIdentifier) + err = w.Handler.GetEnclavesEnclaveIdentifierStatus(ctx, enclaveIdentifier) + return err +} + +// PostEnclavesEnclaveIdentifierStatus converts echo context to params. +func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierStatus(ctx echo.Context) error { + var err error + // ------------- Path parameter "enclave_identifier" ------------- + var enclaveIdentifier EnclaveIdentifier + + err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter enclave_identifier: %s", err)) + } + + // Invoke the callback with all the unmarshalled arguments + err = w.Handler.PostEnclavesEnclaveIdentifierStatus(ctx, enclaveIdentifier) return err } @@ -189,7 +208,8 @@ func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL router.GET(baseURL+"/enclaves/historical", wrapper.GetEnclavesHistorical) router.DELETE(baseURL+"/enclaves/:enclave_identifier", wrapper.DeleteEnclavesEnclaveIdentifier) router.GET(baseURL+"/enclaves/:enclave_identifier", wrapper.GetEnclavesEnclaveIdentifier) - router.POST(baseURL+"/enclaves/:enclave_identifier/stop", wrapper.PostEnclavesEnclaveIdentifierStop) + router.GET(baseURL+"/enclaves/:enclave_identifier/status", wrapper.GetEnclavesEnclaveIdentifierStatus) + router.POST(baseURL+"/enclaves/:enclave_identifier/status", wrapper.PostEnclavesEnclaveIdentifierStatus) router.GET(baseURL+"/engine/info", wrapper.GetEngineInfo) } @@ -293,18 +313,36 @@ func (response GetEnclavesEnclaveIdentifier200JSONResponse) VisitGetEnclavesEncl return json.NewEncoder(w).Encode(response) } -type PostEnclavesEnclaveIdentifierStopRequestObject struct { +type GetEnclavesEnclaveIdentifierStatusRequestObject struct { + EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` +} + +type GetEnclavesEnclaveIdentifierStatusResponseObject interface { + VisitGetEnclavesEnclaveIdentifierStatusResponse(w http.ResponseWriter) error +} + +type GetEnclavesEnclaveIdentifierStatus200JSONResponse EnclaveContainersStatus + +func (response GetEnclavesEnclaveIdentifierStatus200JSONResponse) VisitGetEnclavesEnclaveIdentifierStatusResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type PostEnclavesEnclaveIdentifierStatusRequestObject struct { EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` + Body *PostEnclavesEnclaveIdentifierStatusJSONRequestBody } -type PostEnclavesEnclaveIdentifierStopResponseObject interface { - VisitPostEnclavesEnclaveIdentifierStopResponse(w http.ResponseWriter) error +type PostEnclavesEnclaveIdentifierStatusResponseObject interface { + VisitPostEnclavesEnclaveIdentifierStatusResponse(w http.ResponseWriter) error } -type PostEnclavesEnclaveIdentifierStop200Response struct { +type PostEnclavesEnclaveIdentifierStatus200Response struct { } -func (response PostEnclavesEnclaveIdentifierStop200Response) VisitPostEnclavesEnclaveIdentifierStopResponse(w http.ResponseWriter) error { +func (response PostEnclavesEnclaveIdentifierStatus200Response) VisitPostEnclavesEnclaveIdentifierStatusResponse(w http.ResponseWriter) error { w.WriteHeader(200) return nil } @@ -345,9 +383,12 @@ type StrictServerInterface interface { // Get Enclave Info // (GET /enclaves/{enclave_identifier}) GetEnclavesEnclaveIdentifier(ctx context.Context, request GetEnclavesEnclaveIdentifierRequestObject) (GetEnclavesEnclaveIdentifierResponseObject, error) - // Stop Enclave - // (POST /enclaves/{enclave_identifier}/stop) - PostEnclavesEnclaveIdentifierStop(ctx context.Context, request PostEnclavesEnclaveIdentifierStopRequestObject) (PostEnclavesEnclaveIdentifierStopResponseObject, error) + // Get enclave status + // (GET /enclaves/{enclave_identifier}/status) + GetEnclavesEnclaveIdentifierStatus(ctx context.Context, request GetEnclavesEnclaveIdentifierStatusRequestObject) (GetEnclavesEnclaveIdentifierStatusResponseObject, error) + // Set enclave status + // (POST /enclaves/{enclave_identifier}/status) + PostEnclavesEnclaveIdentifierStatus(ctx context.Context, request PostEnclavesEnclaveIdentifierStatusRequestObject) (PostEnclavesEnclaveIdentifierStatusResponseObject, error) // Get Engine Info // (GET /engine/info) GetEngineInfo(ctx context.Context, request GetEngineInfoRequestObject) (GetEngineInfoResponseObject, error) @@ -516,25 +557,56 @@ func (sh *strictHandler) GetEnclavesEnclaveIdentifier(ctx echo.Context, enclaveI return nil } -// PostEnclavesEnclaveIdentifierStop operation middleware -func (sh *strictHandler) PostEnclavesEnclaveIdentifierStop(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error { - var request PostEnclavesEnclaveIdentifierStopRequestObject +// GetEnclavesEnclaveIdentifierStatus operation middleware +func (sh *strictHandler) GetEnclavesEnclaveIdentifierStatus(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error { + var request GetEnclavesEnclaveIdentifierStatusRequestObject + + request.EnclaveIdentifier = enclaveIdentifier + + handler := func(ctx echo.Context, request interface{}) (interface{}, error) { + return sh.ssi.GetEnclavesEnclaveIdentifierStatus(ctx.Request().Context(), request.(GetEnclavesEnclaveIdentifierStatusRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "GetEnclavesEnclaveIdentifierStatus") + } + + response, err := handler(ctx, request) + + if err != nil { + return err + } else if validResponse, ok := response.(GetEnclavesEnclaveIdentifierStatusResponseObject); ok { + return validResponse.VisitGetEnclavesEnclaveIdentifierStatusResponse(ctx.Response()) + } else if response != nil { + return fmt.Errorf("Unexpected response type: %T", response) + } + return nil +} + +// PostEnclavesEnclaveIdentifierStatus operation middleware +func (sh *strictHandler) PostEnclavesEnclaveIdentifierStatus(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error { + var request PostEnclavesEnclaveIdentifierStatusRequestObject request.EnclaveIdentifier = enclaveIdentifier + var body PostEnclavesEnclaveIdentifierStatusJSONRequestBody + if err := ctx.Bind(&body); err != nil { + return err + } + request.Body = &body + handler := func(ctx echo.Context, request interface{}) (interface{}, error) { - return sh.ssi.PostEnclavesEnclaveIdentifierStop(ctx.Request().Context(), request.(PostEnclavesEnclaveIdentifierStopRequestObject)) + return sh.ssi.PostEnclavesEnclaveIdentifierStatus(ctx.Request().Context(), request.(PostEnclavesEnclaveIdentifierStatusRequestObject)) } for _, middleware := range sh.middlewares { - handler = middleware(handler, "PostEnclavesEnclaveIdentifierStop") + handler = middleware(handler, "PostEnclavesEnclaveIdentifierStatus") } response, err := handler(ctx, request) if err != nil { return err - } else if validResponse, ok := response.(PostEnclavesEnclaveIdentifierStopResponseObject); ok { - return validResponse.VisitPostEnclavesEnclaveIdentifierStopResponse(ctx.Response()) + } else if validResponse, ok := response.(PostEnclavesEnclaveIdentifierStatusResponseObject); ok { + return validResponse.VisitPostEnclavesEnclaveIdentifierStatusResponse(ctx.Response()) } else if response != nil { return fmt.Errorf("Unexpected response type: %T", response) } @@ -567,24 +639,25 @@ func (sh *strictHandler) GetEngineInfo(ctx echo.Context) error { // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/8xXTW/jNhD9K8K0R9V225tuaWxkdYhjrG2gRRAIjDi2uZBIhaQCGIH/e0Hq26JkJ9ld", - "7ClwOJx58+bNcPQGsUgzwZFrBcEbZESSFDVK+wt5nJBXjBhFrtmOoTT/pahiyTLNBIcAtttw7nvqIKRG", - "jtQrfgvpcZKiJ3aePqBXOgIfmLmTEX0AH4wFBK4oPkh8yZlECoGWOfqg4gOmxITXx8zcUloyvofTydim", - "4hUjkiR9eOHOsw68wsgjSVKhURNvjjuSJ9pjytuRRNUAX3KUxwZhK4ADybMQCRIOJ4OlOLXs3WTsVnBN", - "GEe51kTnJad5CsEjfN0ul+HyDnxYbx5Wq8UcfFg+LKPFv+F6s1hu4Mk/T9WHW4lE46Jk09RLigylZmh9", - "k4xFcRUySsQ+SvAVEwdr/pntK0rFBI802TutqxoVhDgMUkHtwe8SdxDAb9NGV9OSk2mJ+96YGq5KJ+L5", - "G8baOJljgqZu6zxNiTz2EywKQaM2nIhwGuU5o9aCaUzVlUCWJMUbTrc5o9DAIVKSoxtfee9mFdaF/SKU", - "vifxgXEM+U70Ie9lFkeZkDoSPDoIpaO0MG/RyLjGPUoTgmUjdh3NV/3x6Lrjj8R9ui4zdzrPktE9RiyL", - "CKUSlXKqoREWo06DBh3jilGsKjpIyqDZACcdBC4PIxh8R5YjpNWMqeu6fHG/2vznbO/SYVgPQtUvQCV9", - "o3gntYMtWs/oobtnFHYilX57XkZ4cQuoO3fawoxYeeGK1h1rwd5w+6BftzNV13jMnWP2t9tCXelmSGHG", - "l3kK7Mhm6cXJu2EpKk3SrD3LBxX07ln+s0XnYnKgTudEldmNyPa+zL5q4c1ivQEfVl8f5tvbTfiwHGvd", - "9pPSk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gXggaNOEEhNMgTRnNLJjGWI0EsiQx3nG6TRmFGg6Rkhzt+Ipzdyu/KuxX", + "ofQDCQ+Mo893ogt5L5MwSITUgeDBQSgdxLl5g0bGNe5RmhAsGbBrab7sjyfbGXcg7vO4zOzpvEhG9xiw", + "JCCUSlTKqoZaWIxaDWp0jCtGsaxoLym9Zj2ctBDYPAxgcC1ZDpBWMabGdfniYbX5x9rehUO/GoSqW4BS", + "+kbxVmp7W7Sa0X1nzyhsRSr8drwM8GIXUHvuNIUZsOLAiNYdasHOcLvRr92Zqmo85M4y+5ttoUa66VOY", + "8WWugmxks/ji5N2wGJUmcdKc5b0KunqW/2zR2ZjsqdM5UUV2A7J9KLIvW3izWG/AhdW3x/n2y8Z/XA61", + "bvNK6Ui/l6Rx1BRcXGq7DZF71N1RZAZQD/R97+2F2bdyPRhTvpa9DWatRe8ddkLGRIMHlGj8rajQeQhz", + "AxToNNOR+ZZjdu5WPrhQoYPZ5PfJzAQRCXKSMPDgz8lsMgM32zmzlKbl+pcvixHqrCgm60wnPgUv30TK", + "RUtlx+vF+MneGrXJtLEwnp4NQyoRXOUh/5jNzB+jVOQ6H4lJxMIs+PS7ymmut8yhLjxfmDKu2gvwOg1D", + "VGqXRk4JI6uaKnesIlenStZcz6i7nNyjbhDyoZwIpcx8ItGqJbcRE6ecyme6uiXxe9StrBOhLGmvhGrn", + "/Zqi0n8JevxhZWyv9ad2U5nny+kTNdTi9RYac/RODd+te2x6YEoLyUKSvUIu6eprbf3BjK95BzT3re47", + "4EZh1ak0NNai5r378D2Nn0kd7FcPKcu7u29YXT9SlJbiWGvi8kj5qfn8NxqnMX+cwsslfUzrvfFqQtfl", + "RvS/oLW7895KcZGAo6rd+fKg/3TyfvwlYlv/xl8l1xK7thCbq9csZtNyX+sXabVzfqqUqigfaNBs0yyd", + "nP4NAAD//5Hsw6MyFQAA", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_types.gen.go b/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_types.gen.go index 28698d0b6d..84440ce1a0 100644 --- a/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_types.gen.go +++ b/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_types.gen.go @@ -27,6 +27,11 @@ const ( TEST EnclaveMode = "TEST" ) +// Defines values for EnclaveTargetStatus. +const ( + STOP EnclaveTargetStatus = "STOP" +) + // ApiContainerStatus defines model for ApiContainerStatus. type ApiContainerStatus string @@ -89,6 +94,9 @@ type EnclaveNameAndUuid struct { Uuid string `json:"uuid"` } +// EnclaveTargetStatus defines model for EnclaveTargetStatus. +type EnclaveTargetStatus string + // EngineInfo defines model for EngineInfo. type EngineInfo struct { EngineVersion string `json:"engine_version"` @@ -111,3 +119,6 @@ type DeleteEnclavesParams struct { // PostEnclavesJSONRequestBody defines body for PostEnclaves for application/json ContentType. type PostEnclavesJSONRequestBody = CreateEnclave + +// PostEnclavesEnclaveIdentifierStatusJSONRequestBody defines body for PostEnclavesEnclaveIdentifierStatus for application/json ContentType. +type PostEnclavesEnclaveIdentifierStatusJSONRequestBody = EnclaveTargetStatus diff --git a/api/openapi/core/core_service.yaml b/api/openapi/core/core_service.yaml index bfea733cdf..cdf93c7f40 100644 --- a/api/openapi/core/core_service.yaml +++ b/api/openapi/core/core_service.yaml @@ -234,7 +234,7 @@ paths: $ref: "#/components/schemas/FileArtifactReference" /enclaves/{enclave_identifier}/artifacts/remote-file: - put: + post: description: Tells the API container to download a files artifact from the web to the Kurtosis File System parameters: - $ref: '#/components/parameters/enclave_identifier' @@ -254,7 +254,7 @@ paths: $ref: "#/components/schemas/FileArtifactReference" /enclaves/{enclave_identifier}/artifacts/services/{service_identifier}: - put: + post: description: Tells the API container to copy a files artifact from a service to the Kurtosis File System parameters: - $ref: '#/components/parameters/enclave_identifier' diff --git a/api/openapi/engine/engine_service.yaml b/api/openapi/engine/engine_service.yaml index ed23d983f1..a3748b4110 100644 --- a/api/openapi/engine/engine_service.yaml +++ b/api/openapi/engine/engine_service.yaml @@ -91,11 +91,28 @@ paths: '200': description: Successful response - /enclaves/{enclave_identifier}/stop: + /enclaves/{enclave_identifier}/status: + get: + summary: Get enclave status + parameters: + - $ref: '#/components/parameters/enclave_identifier' + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/EnclaveContainersStatus' post: - summary: Stop Enclave + summary: Set enclave status parameters: - $ref: '#/components/parameters/enclave_identifier' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/EnclaveTargetStatus' responses: '200': description: Successful response @@ -161,6 +178,11 @@ components: - STOPPED - EMPTY + EnclaveTargetStatus: + type: string + enum: + - STOP + ApiContainerStatus: type: string enum: diff --git a/engine/server/engine/server/enclave_rest_api_handler.go b/engine/server/engine/server/enclave_rest_api_handler.go index 312f87dc10..2929a57a41 100644 --- a/engine/server/engine/server/enclave_rest_api_handler.go +++ b/engine/server/engine/server/enclave_rest_api_handler.go @@ -169,8 +169,8 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierArtifactsLocalFile(c return api.PostEnclavesEnclaveIdentifierArtifactsLocalFile200JSONResponse(uploaded_artifacts), nil } -// (PUT /enclaves/{enclave_identifier}/artifacts/remote-file) -func (manager *enclaveRuntime) PutEnclavesEnclaveIdentifierArtifactsRemoteFile(ctx context.Context, request api.PutEnclavesEnclaveIdentifierArtifactsRemoteFileRequestObject) (api.PutEnclavesEnclaveIdentifierArtifactsRemoteFileResponseObject, error) { +// (POST /enclaves/{enclave_identifier}/artifacts/remote-file) +func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierArtifactsRemoteFile(ctx context.Context, request api.PostEnclavesEnclaveIdentifierArtifactsRemoteFileRequestObject) (api.PostEnclavesEnclaveIdentifierArtifactsRemoteFileResponseObject, error) { enclave_identifier := request.EnclaveIdentifier apiContainerClient, err := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) if err != nil { @@ -192,11 +192,11 @@ func (manager *enclaveRuntime) PutEnclavesEnclaveIdentifierArtifactsRemoteFile(c Uuid: stored_artifact.Uuid, Name: request.Body.Name, } - return api.PutEnclavesEnclaveIdentifierArtifactsRemoteFile200JSONResponse(artifact_response), nil + return api.PostEnclavesEnclaveIdentifierArtifactsRemoteFile200JSONResponse(artifact_response), nil } -// (PUT /enclaves/{enclave_identifier}/artifacts/services/{service_identifier}) -func (manager *enclaveRuntime) PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier(ctx context.Context, request api.PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierRequestObject) (api.PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierResponseObject, error) { +// (POST /enclaves/{enclave_identifier}/artifacts/services/{service_identifier}) +func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier(ctx context.Context, request api.PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierRequestObject) (api.PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierResponseObject, error) { enclave_identifier := request.EnclaveIdentifier service_identifier := request.ServiceIdentifier apiContainerClient, err := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) @@ -220,7 +220,7 @@ func (manager *enclaveRuntime) PutEnclavesEnclaveIdentifierArtifactsServicesServ Uuid: stored_artifact.Uuid, Name: request.Body.Name, } - return api.PutEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier200JSONResponse(artifact_response), nil + return api.PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier200JSONResponse(artifact_response), nil } // (GET /enclaves/{enclave_identifier}/artifacts/{artifact_identifier}) diff --git a/engine/server/engine/server/engine_rest_api_handler.go b/engine/server/engine/server/engine_rest_api_handler.go index a2bef51b3c..0e26732a36 100644 --- a/engine/server/engine/server/engine_rest_api_handler.go +++ b/engine/server/engine/server/engine_rest_api_handler.go @@ -142,20 +142,44 @@ func (engine EngineRuntime) GetEnclavesEnclaveIdentifier(ctx context.Context, re return nil, Error{} } -// Stop Enclave -// (POST /enclaves/{enclave_identifier}/stop) -func (engine EngineRuntime) PostEnclavesEnclaveIdentifierStop(ctx context.Context, request api.PostEnclavesEnclaveIdentifierStopRequestObject) (api.PostEnclavesEnclaveIdentifierStopResponseObject, error) { +// Get enclave status +// (GET /enclaves/{enclave_identifier}/status) +func (engine EngineRuntime) GetEnclavesEnclaveIdentifierStatus(ctx context.Context, request api.GetEnclavesEnclaveIdentifierStatusRequestObject) (api.GetEnclavesEnclaveIdentifierStatusResponseObject, error) { enclaveIdentifier := request.EnclaveIdentifier - - if err := engine.MetricsClient.TrackStopEnclave(enclaveIdentifier); err != nil { - logrus.Warnf("An error occurred while logging the stop enclave event for enclave '%v'", enclaveIdentifier) + enclaveList, err := engine.EnclaveManager.GetEnclaves(ctx) + if err != nil { + return nil, stacktrace.Propagate(err, "An error occurred stopping enclave '%v'", enclaveIdentifier) + } + info, found := enclaveList[enclaveIdentifier] + if !found { + err := stacktrace.NewError("Enclave not found: '%s'", enclaveIdentifier) + return nil, err } - if err := engine.EnclaveManager.StopEnclave(ctx, enclaveIdentifier); err != nil { - return nil, stacktrace.Propagate(err, "An error occurred stopping enclave '%v'", enclaveIdentifier) + return api.GetEnclavesEnclaveIdentifierStatus200JSONResponse(toHttpEnclaveContainersStatus(info.EnclaveContainersStatus)), nil +} + +// Set enclave status +// (POST /enclaves/{enclave_identifier}/status) +func (engine EngineRuntime) PostEnclavesEnclaveIdentifierStatus(ctx context.Context, request api.PostEnclavesEnclaveIdentifierStatusRequestObject) (api.PostEnclavesEnclaveIdentifierStatusResponseObject, error) { + enclaveIdentifier := request.EnclaveIdentifier + targetState := request.Body + + switch *targetState { + case api.STOP: + if err := engine.MetricsClient.TrackStopEnclave(enclaveIdentifier); err != nil { + logrus.Warnf("An error occurred while logging the stop enclave event for enclave '%v'", enclaveIdentifier) + } + + if err := engine.EnclaveManager.StopEnclave(ctx, enclaveIdentifier); err != nil { + return nil, stacktrace.Propagate(err, "An error occurred stopping enclave '%v'", enclaveIdentifier) + } + return api.PostEnclavesEnclaveIdentifierStatus200Response{}, nil + default: + err := stacktrace.NewError("Unsupported target state: '%s'", targetState) + return nil, err } - return api.PostEnclavesEnclaveIdentifierStop200Response{}, nil } // Get Engine Info @@ -252,3 +276,16 @@ func toHttpApiEnclaveNameAndUuid(identifier *types.EnclaveNameAndUuid) api.Encla Name: identifier.Name, } } + +func toHttpEnclaveContainersStatus(status types.EnclaveContainersStatus) api.EnclaveContainersStatus { + switch status { + case types.EnclaveContainersStatus_STOPPED: + return api.EnclaveContainersStatusSTOPPED + case types.EnclaveContainersStatus_RUNNING: + return api.EnclaveContainersStatusRUNNING + case types.EnclaveContainersStatus_EMPTY: + return api.EnclaveContainersStatusEMPTY + default: + panic(fmt.Sprintf("Undefined mapping of value: %s", status)) + } +} From 65bce4b2ec58521af8bd51bcc6519fe2d1704f4d Mon Sep 17 00:00:00 2001 From: lostbean Date: Thu, 23 Nov 2023 14:04:40 -0300 Subject: [PATCH 53/95] move availability check to GET --- .../api_container_server.gen.go | 230 +++++++++++------- .../api_container_types.gen.go | 85 ++++--- api/openapi/core/core_service.yaml | 102 +++++--- .../engine/server/enclave_rest_api_handler.go | 30 +-- 4 files changed, 273 insertions(+), 174 deletions(-) diff --git a/api/golang/core/kurtosis_core_rest_api_bindings/api_container_server.gen.go b/api/golang/core/kurtosis_core_rest_api_bindings/api_container_server.gen.go index c4b772f901..273ca17e90 100644 --- a/api/golang/core/kurtosis_core_rest_api_bindings/api_container_server.gen.go +++ b/api/golang/core/kurtosis_core_rest_api_bindings/api_container_server.gen.go @@ -58,8 +58,8 @@ type ServerInterface interface { // (POST /enclaves/{enclave_identifier}/services/{service_identifier}/command) PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, serviceIdentifier ServiceIdentifier) error - // (POST /enclaves/{enclave_identifier}/services/{service_identifier}/endpoints/{port_number}/availability) - PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, serviceIdentifier ServiceIdentifier, portNumber PortNumber) error + // (GET /enclaves/{enclave_identifier}/services/{service_identifier}/endpoints/{port_number}/availability) + GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, serviceIdentifier ServiceIdentifier, portNumber PortNumber, params GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityParams) error // (GET /enclaves/{enclave_identifier}/starlark) GetEnclavesEnclaveIdentifierStarlark(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error @@ -304,8 +304,8 @@ func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierServicesServiceIde return err } -// PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability converts echo context to params. -func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability(ctx echo.Context) error { +// GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability converts echo context to params. +func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- var enclaveIdentifier EnclaveIdentifier @@ -331,8 +331,59 @@ func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierServicesServiceIde return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter port_number: %s", err)) } + // Parameter object where we will unmarshal all parameters from the context + var params GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityParams + // ------------- Optional query parameter "http_method" ------------- + + err = runtime.BindQueryParameter("form", true, false, "http_method", ctx.QueryParams(), ¶ms.HttpMethod) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter http_method: %s", err)) + } + + // ------------- Optional query parameter "path" ------------- + + err = runtime.BindQueryParameter("form", true, false, "path", ctx.QueryParams(), ¶ms.Path) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter path: %s", err)) + } + + // ------------- Optional query parameter "initial_delay_milliseconds" ------------- + + err = runtime.BindQueryParameter("form", true, false, "initial_delay_milliseconds", ctx.QueryParams(), ¶ms.InitialDelayMilliseconds) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter initial_delay_milliseconds: %s", err)) + } + + // ------------- Optional query parameter "retries" ------------- + + err = runtime.BindQueryParameter("form", true, false, "retries", ctx.QueryParams(), ¶ms.Retries) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter retries: %s", err)) + } + + // ------------- Optional query parameter "retries_delay_milliseconds" ------------- + + err = runtime.BindQueryParameter("form", true, false, "retries_delay_milliseconds", ctx.QueryParams(), ¶ms.RetriesDelayMilliseconds) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter retries_delay_milliseconds: %s", err)) + } + + // ------------- Optional query parameter "expected_response" ------------- + + err = runtime.BindQueryParameter("form", true, false, "expected_response", ctx.QueryParams(), ¶ms.ExpectedResponse) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter expected_response: %s", err)) + } + + // ------------- Optional query parameter "request_body" ------------- + + err = runtime.BindQueryParameter("form", true, false, "request_body", ctx.QueryParams(), ¶ms.RequestBody) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter request_body: %s", err)) + } + // Invoke the callback with all the unmarshalled arguments - err = w.Handler.PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability(ctx, enclaveIdentifier, serviceIdentifier, portNumber) + err = w.Handler.GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability(ctx, enclaveIdentifier, serviceIdentifier, portNumber, params) return err } @@ -447,7 +498,7 @@ func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL router.GET(baseURL+"/enclaves/:enclave_identifier/services/history", wrapper.GetEnclavesEnclaveIdentifierServicesHistory) router.GET(baseURL+"/enclaves/:enclave_identifier/services/:service_identifier", wrapper.GetEnclavesEnclaveIdentifierServicesServiceIdentifier) router.POST(baseURL+"/enclaves/:enclave_identifier/services/:service_identifier/command", wrapper.PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand) - router.POST(baseURL+"/enclaves/:enclave_identifier/services/:service_identifier/endpoints/:port_number/availability", wrapper.PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability) + router.GET(baseURL+"/enclaves/:enclave_identifier/services/:service_identifier/endpoints/:port_number/availability", wrapper.GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability) router.GET(baseURL+"/enclaves/:enclave_identifier/starlark", wrapper.GetEnclavesEnclaveIdentifierStarlark) router.POST(baseURL+"/enclaves/:enclave_identifier/starlark/packages", wrapper.PostEnclavesEnclaveIdentifierStarlarkPackages) router.POST(baseURL+"/enclaves/:enclave_identifier/starlark/packages/:package_id", wrapper.PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId) @@ -662,21 +713,21 @@ func (response PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand200J return json.NewEncoder(w).Encode(response) } -type PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityRequestObject struct { +type GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityRequestObject struct { EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` ServiceIdentifier ServiceIdentifier `json:"service_identifier"` PortNumber PortNumber `json:"port_number"` - Body *PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityJSONRequestBody + Params GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityParams } -type PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityResponseObject interface { - VisitPostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityResponse(w http.ResponseWriter) error +type GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityResponseObject interface { + VisitGetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityResponse(w http.ResponseWriter) error } -type PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability200Response struct { +type GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability200Response struct { } -func (response PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability200Response) VisitPostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityResponse(w http.ResponseWriter) error { +func (response GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability200Response) VisitGetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityResponse(w http.ResponseWriter) error { w.WriteHeader(200) return nil } @@ -826,8 +877,8 @@ type StrictServerInterface interface { // (POST /enclaves/{enclave_identifier}/services/{service_identifier}/command) PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand(ctx context.Context, request PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandRequestObject) (PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandResponseObject, error) - // (POST /enclaves/{enclave_identifier}/services/{service_identifier}/endpoints/{port_number}/availability) - PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability(ctx context.Context, request PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityRequestObject) (PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityResponseObject, error) + // (GET /enclaves/{enclave_identifier}/services/{service_identifier}/endpoints/{port_number}/availability) + GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability(ctx context.Context, request GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityRequestObject) (GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityResponseObject, error) // (GET /enclaves/{enclave_identifier}/starlark) GetEnclavesEnclaveIdentifierStarlark(ctx context.Context, request GetEnclavesEnclaveIdentifierStarlarkRequestObject) (GetEnclavesEnclaveIdentifierStarlarkResponseObject, error) @@ -1166,33 +1217,28 @@ func (sh *strictHandler) PostEnclavesEnclaveIdentifierServicesServiceIdentifierC return nil } -// PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability operation middleware -func (sh *strictHandler) PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, serviceIdentifier ServiceIdentifier, portNumber PortNumber) error { - var request PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityRequestObject +// GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability operation middleware +func (sh *strictHandler) GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, serviceIdentifier ServiceIdentifier, portNumber PortNumber, params GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityParams) error { + var request GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityRequestObject request.EnclaveIdentifier = enclaveIdentifier request.ServiceIdentifier = serviceIdentifier request.PortNumber = portNumber - - var body PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityJSONRequestBody - if err := ctx.Bind(&body); err != nil { - return err - } - request.Body = &body + request.Params = params handler := func(ctx echo.Context, request interface{}) (interface{}, error) { - return sh.ssi.PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability(ctx.Request().Context(), request.(PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityRequestObject)) + return sh.ssi.GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability(ctx.Request().Context(), request.(GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityRequestObject)) } for _, middleware := range sh.middlewares { - handler = middleware(handler, "PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability") + handler = middleware(handler, "GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability") } response, err := handler(ctx, request) if err != nil { return err - } else if validResponse, ok := response.(PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityResponseObject); ok { - return validResponse.VisitPostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityResponse(ctx.Response()) + } else if validResponse, ok := response.(GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityResponseObject); ok { + return validResponse.VisitGetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityResponse(ctx.Response()) } else if response != nil { return fmt.Errorf("Unexpected response type: %T", response) } @@ -1321,70 +1367,72 @@ func (sh *strictHandler) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx echo.C // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/+w8a2/bOLZ/hdC9QGcWatydXSwu8i1Nk9bYNjFiZ3MvJoWWlo5tTilSS1JJPIX/+wVf", - "NmVRtpwmaXcxX6YZkzw8Lx6eF/U1yXlZcQZMyeT4a1JhgUtQIMz/YaHIDOcqIwUwRWYEhP65AJkLUinC", - "WXKcTBaA/ETEcAmIC1TXpEjShOgJFVaLJE30UHIchZkmAv5VEwFFcqxEDWki8wWUWG+mlpVeJpUgbJ6s", - "VmkCLKf4DraQimwVmbhrpzZZFc6/4DmgDQCkFlihe0IpmgKCB8hrBZrSNpp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y3vryg7b9PfmwWsFcKiZoxwuZp", - "Y6gghR4rYEaYPkZLkyaWKXK2Y4rzL8AKVHAwQGRdmTyyAP2PdtotnQHrZzzKbMuO5+G11/t+CVin7D79", - "+kKne/yUJ3v7fGwrc9fZb7EqDU73DsPw/VLH/vLamcN8Ee8k7lVEPIGwQLjPUejhCux2xiNusYl1s2qd", - "zNhFezPz0bz6Nz5I7D481EFolDbb62M7N7m1kxNR8XS5rS0mRTXfKd6ZEDxSwwL/M2dwOUuOf91jcxy0", - "IVMgKgHKpLQs7FXab+0/MCXFI9ad+SyIW/a5VVYwv+9kQhNE5AC68Qx2sCsrQUqX2tpT6GhMb2PWqos0", - "t99FStzHIR2/SiXqPG509JL+FDVm7yUo3LjH5BnfQ/IOMrCY16VvFOllLyNgTxyQaOnVCEc7K9kWP1tm", - "JRjvNrBEZvILqSoIDWwQqlZcEr/DgWSM/NKW8fIDERzTgIWd1DbQ7imrNVNjMtvJHwGVAKmtnjaXcTYF", - "5laDM0HuQWHeZlVsz540jgJhbUcdtC5ZzztS3wGdDKGEQd8elZDWNVAHIvU49aStq5AcapDomBPwOT69", - "t5giyw8xP91rQprbl1qE6nDS97knojjsouyqZueEEbmA4uwuehRFrT0QOyWD+Bx9OmqWyTrPQcpZTfee", - "yE3fwJ5bpQU5BmYvXyJE7OHKSPC5Dloj/QRuJItfqXktBDCVSQXVekr/Pp7G8sOKl1z7gHqdfIwxaOPd", - "BBlHbS/nm9zaw/QrkBVnEj46g7YVYPo039pZQ35Bkh7spm6urt5u5kFOaahDfde0besBuzXPcd+FN1gw", - "q4p9UZxx7WFv5LbttbdOxN16wvcxiq39d2mh50cLx/s9A/3R316wlwC/dRxvLsC03fium3PBS5fVaCPb", - "r1bQ7IWJJoN4LXIbp3a0Vk8lp7UCZGciPTNM9dlf7UbrOjeviKtz788XBQjs6K0x7LmBaYNDMdPCBaAb", - "mKJmB1PPJPvh/KtFpDJ8ffURKY58fciAWreo9+KKBruDG+1ulWjCa3I6csmu8elk5DNd70ZBlmtyqv9P", - "Dydpoodiqa0bTNQ5F76N5yRsxm43f2Ci0DkX6MNkMlq3/qCTZgd3UxpTXiwzBQ8RiQ5nLsns4AhQtWAS", - "qQWRtuDVzBN7HSyx+AIFwtL3jlNAP8HR/Ah9AEo5uuGCFj8fxWS6UKrKSlALbgI3z6r3Z5MkTUaX43gb", - "MWFEEUyzAiheZiWhlEjIOStkh57ZFnc+Q+FcrTemqahmilDfF8LmTh2FVJavOaa0b4Gu62ibo7xVkPAd", - "90doqEz12eTSFRYK3RO1CNCQFMvFkZG0LxyjfzowgwVgqhb/jFfDlXBib6L0CT8ETFlTibBSUFZK+lZ6", - "4gyNa593nJqTO82mujIlNqsl+gfMkL0s0n4pTINcLyFe7BbgFNQ9mJZDS296sCcX6mHkbjE6Z93Srbrk", - "aKixKDEjVU19R4Er05jWIqKoBnXmKje2l+AOhHS24+jPR280O3gFDFckOU7+cvTm6E1itcnwYuDhDb62", - "37msBt7cmblziBzsj0QqpOXbNLIaP20azD0/LJLj5D0oh6h0/26qsifBqvDtUIf3uJkyiDzOWX02+Vbj", - "iBq8f3nzZuuFRNCuOPhN2mzA5nlEr6RUvAO33Re+2q6aj9exE3LPOhL73KKvKAamPem1T8hXXEbEYjvg", - "JMJbcvGt1b4GYS5YNF5KBWVLZCMue8jso0bn3CbFn0h4/rVLZzmh8SBmsPUaZvWN8n9MqXCfOoTH/an1", - "wTYm7VGICVAqfctR+LApcHBayrLu1LyH6TNozpVB/BlVp7fId4daMZ81Jslur7X52utbFfQRivgceue8", - "BDn42n7htnqUJua8WnZoIQ59myfWQxeeyVa30JOoZbp3VeSB4LMqc2d8umr6Lv9Buvo18mB41enUDJms", - "IFfrN6DAXHvo9oukR7g4/o8X17LYk+mX95XCvooX8Zaikh/4O69TBXyPp9xxK/YyQY9UCr//v49y8FyB", - "ei2VAFwe/N74qeTu76RArv3F4e+Bp+L5FklAtU3xGOp7bA7KNLBp9vhqb3Kc/KsGw6Xm+3GNVuTg7XuY",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c6bcO9dsuJB01QHTAIoVuTGhEo2GqJ1qpVE5CzJ75EsY0Z+B+/BNYgRIgwtNsqcOSEj//bXKCMV", + "3Km0FHBD4DbCSrQgyoCHO4Wc2x0hsgxQppTfSvSTJAWh2ARRV+eT/30h0Ys14PzFz3sZ78M4Td8+bl/C", + "EgSwLMIJPU0iPxE1DqCmVLyPaa6/upq8CTkpt9IYabetkx90uzZnusVBO3GiNL/NkkpVAmKCM+nyc223", + "w1uXqhuKY7ztyK20RTp39O5Mn0c60Ix6n4n2o2/4LdPn80dnwG0XePLh08n/zZwH/DiZzaxf85vY4WSU", + "+KHYVn+vhOKSyLeANe1vKV7FNzu/SCfns/nl1el8cnE+S09PTt839+uaEdtWn9sRu1tjATm6MJyU6Kcr", + "nRq/3qCPJh6hgM5c3i9/bukfLktKMqwhpaXgimecRt1unbgMcIlKYCZNXhLC7Dss537F1C+4HyU6fE0V", + "KYDHfKsOIU2A62agvBKGEK2XDvF9OrlNmyIYx3T0EkziOOWUZJsOiZ/94+zSaddWl7bC1oPJyCtZTMaX", + "FZspLCgWX6Y2QY4EVpQzSMt6uInGpzWotQme6xS9jpvN4hxxgRhXR9dsskRLTKUtAbHGIp/ClRWlkKOl", + "4IUZP5lOThHlGaY1fMUFHKHJEhH1QiK8M2xAE2ny72u2xjeAFjopqUwwDTmqpHYqNrbeoR+VgnCbEmNK", + "9bQ2jywdJqTvJsNRbsh4R9T7aoEWsOTC5xJad4x8Za04C84pYKYlk1Fe5amvDESLIq7yZJIvnVRuYk7Y", + "wqkkiIfDyMUmFRXrX23EGiUF7koQpACmME2X1ok1464+Y415v0gsbuPa3DnktHAeuQ9y24WbACvDtE2p", + "lfBGz/SHl9W5gucVhTDm0EFIjIsFJixdViwz/i9+Fptanak22z30GuTX2LJp7uqNtu5BJLpORMWuk9iW", + "JRaYUqBEFv3C++tO0NThak0hvSfdsVnubtDni+9IJ6nmjNd0eJvaGk6D1iTiD33kmOrAKVU8tRwltIOR", + "20jTQtZBm/6PXt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+f4doOOwje8oYeBuBZPYlrb9BiqdEEkTN/Z13tIdFDl5RTuttf+AA1j8zHn66", + "P7J01kQqLjadvvbSfbAkMAWEF7yyhQW4I9K0mF1Xr1798jdkoZEMUxRYxuFW/t5h9W9Tcoh0zT7hCbo3", + "un+we/3hwuwnCm8bXvCZBDPO6gfacTdor4XAZmArcgNs+/UF1y+LfY9onZw9zD22BB28D//PSqvCp/ER", + "Ue88jn++DKv9IP7ZFNF/jkqOvwbfsLkf453nv9ET4TXl2Rf3bZZaT81XXVqfudp+vGq0fUFIdOomeLVa", + "I2xXecJGj+Gvti9up1wo+32Wk+aHfL6Xeu9fFX5PaMD08DNaQ6BjtR4yr+crVgNW+2/dDJ/6wI3a3zgb", + "tGXwNaOuAyZqgQPNzt3BdhrPO1CIYqnqFz+iYodpvt/iR4iNhty3N6oKj+jhHPix61qWQy5cdt9ZHaH5", + "mkgkFZT2zYZ1/v5xcviUOcOs8e0j8wWzyJPxw07j5mL5g1/TPIJlbMU1/lq3m98PCIkC4dlxxO1L1EqC", + "eCHRAtaYLr+N/e7fyXNFQUHD/VNFPxENfYJK8kFNybttUrFPC/14xSuvvxaY/M4aO3NY/MCljfbr6z8U", + "r6149/f/HwAA///JDhHEoVcAAA==", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/api/golang/core/kurtosis_core_rest_api_bindings/api_container_types.gen.go b/api/golang/core/kurtosis_core_rest_api_bindings/api_container_types.gen.go index b24d22a47a..37ba3ce5cc 100644 --- a/api/golang/core/kurtosis_core_rest_api_bindings/api_container_types.gen.go +++ b/api/golang/core/kurtosis_core_rest_api_bindings/api_container_types.gen.go @@ -23,6 +23,12 @@ const ( ContainerStatusUNKNOWN ContainerStatus = "UNKNOWN" ) +// Defines values for HttpMethodAvailability. +const ( + GET HttpMethodAvailability = "GET" + POST HttpMethodAvailability = "POST" +) + // Defines values for ImageDownloadMode. const ( ImageDownloadModeALWAYS ImageDownloadMode = "ALWAYS" @@ -54,12 +60,6 @@ const ( UDP TransportProtocol = "UDP" ) -// Defines values for WaitForEndpointAvailabilityHttpMethod. -const ( - GET WaitForEndpointAvailabilityHttpMethod = "GET" - POST WaitForEndpointAvailabilityHttpMethod = "POST" -) - // Connect 0 - CONNECT // Best effort port forwarding // 1 - NO_CONNECT // Port forwarding disabled type Connect string @@ -116,6 +116,9 @@ type FileArtifactReference struct { Uuid string `json:"uuid"` } +// HttpMethodAvailability defines model for HttpMethodAvailability. +type HttpMethodAvailability string + // ImageDownloadMode 0 - ALWAYS // 1 - MISSING type ImageDownloadMode string @@ -391,40 +394,39 @@ type StoreWebFilesArtifact struct { // 2 - UDP type TransportProtocol string -// WaitForEndpointAvailability Wait For HTTP Endpoint Availability -type WaitForEndpointAvailability struct { - // BodyText If the endpoint returns this value, the service will be marked as available (e.g. Hello World). - BodyText *string `json:"body_text,omitempty"` - HttpMethod WaitForEndpointAvailabilityHttpMethod `json:"http_method"` - - // InitialDelayMilliseconds The number of milliseconds to wait until executing the first HTTP call - InitialDelayMilliseconds *int32 `json:"initial_delay_milliseconds,omitempty"` - - // Path The path of the service to check. It mustn't start with the first slash. For instance `service/health` - Path *string `json:"path,omitempty"` - - // Retries Max number of HTTP call attempts that this will execute until giving up and returning an error - Retries *int32 `json:"retries,omitempty"` - - // RetriesDelayMilliseconds Number of milliseconds to wait between retries - RetriesDelayMilliseconds *int32 `json:"retries_delay_milliseconds,omitempty"` -} - -// WaitForEndpointAvailabilityHttpMethod defines model for WaitForEndpointAvailability.HttpMethod. -type WaitForEndpointAvailabilityHttpMethod string - // ArtifactIdentifier defines model for artifact_identifier. type ArtifactIdentifier = string // EnclaveIdentifier The package identifier that will be executed type EnclaveIdentifier = string +// ExpectedResponse defines model for expected_response. +type ExpectedResponse = string + +// HttpMethod defines model for http_method. +type HttpMethod = HttpMethodAvailability + +// InitialDelayMilliseconds defines model for initial_delay_milliseconds. +type InitialDelayMilliseconds = int32 + // PackageId defines model for package_id. type PackageId = string +// Path defines model for path. +type Path = string + // PortNumber defines model for port_number. type PortNumber = int32 +// RequestBody defines model for request_body. +type RequestBody = string + +// Retries defines model for retries. +type Retries = int32 + +// RetriesDelayMilliseconds defines model for retries_delay_milliseconds. +type RetriesDelayMilliseconds = int32 + // ServiceIdentifier defines model for service_identifier. type ServiceIdentifier = string @@ -437,6 +439,30 @@ type GetEnclavesEnclaveIdentifierServicesParams struct { Services *[]string `form:"services,omitempty" json:"services,omitempty"` } +// GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityParams defines parameters for GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability. +type GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityParams struct { + // HttpMethod The HTTP method used to check availability. Default is GET. + HttpMethod *HttpMethod `form:"http_method,omitempty" json:"http_method,omitempty"` + + // Path The path of the service to check. It mustn't start with the first slash. For instance `service/health` + Path *Path `form:"path,omitempty" json:"path,omitempty"` + + // InitialDelayMilliseconds The number of milliseconds to wait until executing the first HTTP call + InitialDelayMilliseconds *InitialDelayMilliseconds `form:"initial_delay_milliseconds,omitempty" json:"initial_delay_milliseconds,omitempty"` + + // Retries Max number of HTTP call attempts that this will execute until giving up and returning an error + Retries *Retries `form:"retries,omitempty" json:"retries,omitempty"` + + // RetriesDelayMilliseconds Number of milliseconds to wait between retries + RetriesDelayMilliseconds *RetriesDelayMilliseconds `form:"retries_delay_milliseconds,omitempty" json:"retries_delay_milliseconds,omitempty"` + + // ExpectedResponse If the endpoint returns this value, the service will be marked as available (e.g. Hello World). + ExpectedResponse *ExpectedResponse `form:"expected_response,omitempty" json:"expected_response,omitempty"` + + // RequestBody If the http_method is set to POST, this value will be send as the body of the availability request. + RequestBody *RequestBody `form:"request_body,omitempty" json:"request_body,omitempty"` +} + // PostEnclavesEnclaveIdentifierStarlarkPackagesMultipartBody defines parameters for PostEnclavesEnclaveIdentifierStarlarkPackages. type PostEnclavesEnclaveIdentifierStarlarkPackagesMultipartBody = openapi_types.File @@ -455,9 +481,6 @@ type PostEnclavesEnclaveIdentifierServicesConnectionJSONRequestBody = Connect // PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandJSONRequestBody defines body for PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand for application/json ContentType. type PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandJSONRequestBody = ExecCommand -// PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityJSONRequestBody defines body for PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability for application/json ContentType. -type PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityJSONRequestBody = WaitForEndpointAvailability - // PostEnclavesEnclaveIdentifierStarlarkPackagesMultipartRequestBody defines body for PostEnclavesEnclaveIdentifierStarlarkPackages for multipart/form-data ContentType. type PostEnclavesEnclaveIdentifierStarlarkPackagesMultipartRequestBody = PostEnclavesEnclaveIdentifierStarlarkPackagesMultipartBody diff --git a/api/openapi/core/core_service.yaml b/api/openapi/core/core_service.yaml index cdf93c7f40..daa73edba3 100644 --- a/api/openapi/core/core_service.yaml +++ b/api/openapi/core/core_service.yaml @@ -153,19 +153,19 @@ paths: $ref: "#/components/schemas/ExecCommandResult" /enclaves/{enclave_identifier}/services/{service_identifier}/endpoints/{port_number}/availability: - post: - description: Block until the given HTTP endpoint returns available, calling it through a HTTP Get request + get: + description: Block until the given HTTP endpoint returns available, calling it through a HTTP request parameters: - $ref: '#/components/parameters/enclave_identifier' - $ref: '#/components/parameters/service_identifier' - $ref: '#/components/parameters/port_number' - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/WaitForEndpointAvailability" - description: Wait For HTTP Get Endpoint Availability - required: true + - $ref: '#/components/parameters/http_method' + - $ref: '#/components/parameters/path' + - $ref: '#/components/parameters/initial_delay_milliseconds' + - $ref: '#/components/parameters/retries' + - $ref: '#/components/parameters/retries_delay_milliseconds' + - $ref: '#/components/parameters/expected_response' + - $ref: '#/components/parameters/request_body' responses: "200": description: Success @@ -322,6 +322,58 @@ components: format: int32 description: The port number to check availability required: true + + http_method: + in: query + name: http_method + description: The HTTP method used to check availability. Default is GET. + schema: + $ref: "#/components/schemas/HttpMethodAvailability" + + path: + in: query + name: path + description: The path of the service to check. It mustn't start with the first slash. For instance `service/health` + schema: + type: string + + initial_delay_milliseconds: + in: query + name: initial_delay_milliseconds + description: The number of milliseconds to wait until executing the first HTTP call + schema: + type: integer + format: int32 + + retries: + in: query + name: retries + description: Max number of HTTP call attempts that this will execute until giving up and returning an error + schema: + type: integer + format: int32 + + retries_delay_milliseconds: + in: query + name: retries_delay_milliseconds + description: Number of milliseconds to wait between retries + schema: + type: integer + format: int32 + + expected_response: + in: query + name: expected_response + description: If the endpoint returns this value, the service will be marked as available (e.g. Hello World). + schema: + type: string + + request_body: + in: query + name: request_body + description: If the http_method is set to POST, this value will be send as the body of the availability request. + schema: + type: string artifact_identifier: in: path @@ -368,6 +420,10 @@ components: - transport_protocol description: Shared Objects (Used By Multiple Endpoints) + HttpMethodAvailability: + type: string + enum: [GET, POST] + Container: type: object properties: @@ -792,34 +848,6 @@ components: - exit_code - log_output - WaitForEndpointAvailability: - type: object - properties: - http_method: - type: string - enum: [GET, POST] - path: - type: string - description: The path of the service to check. It mustn't start with the first slash. For instance `service/health` - initial_delay_milliseconds: - type: integer - format: int32 - description: The number of milliseconds to wait until executing the first HTTP call - retries: - type: integer - format: int32 - description: Max number of HTTP call attempts that this will execute until giving up and returning an error - retries_delay_milliseconds: - type: integer - format: int32 - description: Number of milliseconds to wait between retries - body_text: - type: string - description: If the endpoint returns this value, the service will be marked as available (e.g. Hello World). - description: Wait For HTTP Endpoint Availability - required: - - http_method - FileArtifactReference: type: object properties: diff --git a/engine/server/engine/server/enclave_rest_api_handler.go b/engine/server/engine/server/enclave_rest_api_handler.go index 2929a57a41..3197eb4f77 100644 --- a/engine/server/engine/server/enclave_rest_api_handler.go +++ b/engine/server/engine/server/enclave_rest_api_handler.go @@ -419,19 +419,18 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierServicesServiceIdent return api.PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand200JSONResponse(response), nil } -// (POST /enclaves/{enclave_identifier}/services/{service_identifier}/endpoints/{port_number}/availability) -func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability(ctx context.Context, request api.PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityRequestObject) (api.PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityResponseObject, error) { +// (GET /enclaves/{enclave_identifier}/services/{service_identifier}/endpoints/{port_number}/availability) +func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability(ctx context.Context, request api.GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityRequestObject) (api.GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityResponseObject, error) { enclave_identifier := request.EnclaveIdentifier service_identifier := request.ServiceIdentifier port_number := request.PortNumber + endpoint_method := utils.DerefWith(request.Params.HttpMethod, api.GET) apiContainerClient, errConn := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) if errConn != nil { return nil, errConn } logrus.Infof("Getting info about service %s from enclave %s", service_identifier, enclave_identifier) - endpoint_method := request.Body.HttpMethod - castToUInt32 := func(v int32) uint32 { return uint32(v) } var err error @@ -440,22 +439,23 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierServicesServiceIdent waitForHttpGetEndpointAvailabilityArgs := rpc_api.WaitForHttpGetEndpointAvailabilityArgs{ ServiceIdentifier: service_identifier, Port: uint32(port_number), - Path: request.Body.Path, - InitialDelayMilliseconds: utils.MapPointer(request.Body.InitialDelayMilliseconds, castToUInt32), - Retries: utils.MapPointer(request.Body.Retries, castToUInt32), - RetriesDelayMilliseconds: utils.MapPointer(request.Body.RetriesDelayMilliseconds, castToUInt32), - BodyText: request.Body.BodyText, + Path: request.Params.Path, + InitialDelayMilliseconds: utils.MapPointer(request.Params.InitialDelayMilliseconds, castToUInt32), + Retries: utils.MapPointer(request.Params.Retries, castToUInt32), + RetriesDelayMilliseconds: utils.MapPointer(request.Params.RetriesDelayMilliseconds, castToUInt32), + BodyText: request.Params.ExpectedResponse, } _, err = (*apiContainerClient).WaitForHttpGetEndpointAvailability(ctx, &waitForHttpGetEndpointAvailabilityArgs) case api.POST: waitForHttpPostEndpointAvailabilityArgs := rpc_api.WaitForHttpPostEndpointAvailabilityArgs{ ServiceIdentifier: service_identifier, Port: uint32(port_number), - Path: request.Body.Path, - InitialDelayMilliseconds: utils.MapPointer(request.Body.InitialDelayMilliseconds, castToUInt32), - Retries: utils.MapPointer(request.Body.Retries, castToUInt32), - RetriesDelayMilliseconds: utils.MapPointer(request.Body.RetriesDelayMilliseconds, castToUInt32), - BodyText: request.Body.BodyText, + Path: request.Params.Path, + InitialDelayMilliseconds: utils.MapPointer(request.Params.InitialDelayMilliseconds, castToUInt32), + Retries: utils.MapPointer(request.Params.Retries, castToUInt32), + RetriesDelayMilliseconds: utils.MapPointer(request.Params.RetriesDelayMilliseconds, castToUInt32), + BodyText: request.Params.ExpectedResponse, + RequestBody: request.Params.RequestBody, } _, err = (*apiContainerClient).WaitForHttpPostEndpointAvailability(ctx, &waitForHttpPostEndpointAvailabilityArgs) default: @@ -466,7 +466,7 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierServicesServiceIdent logrus.Errorf("Can't execute commands using gRPC call with enclave %s, error: %s", enclave_identifier, err) return nil, stacktrace.NewError("Can't execute commands using gRPC call with enclave %s", enclave_identifier) } - return api.PostEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability200Response{}, nil + return api.GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability200Response{}, nil } From 67a85a4737d9e4f162d8222a04048db5cd1d1d0b Mon Sep 17 00:00:00 2001 From: lostbean Date: Thu, 23 Nov 2023 14:05:23 -0300 Subject: [PATCH 54/95] add grpcui to test gRPC calls --- flake.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/flake.nix b/flake.nix index a96de7481b..1396bf7b71 100644 --- a/flake.nix +++ b/flake.nix @@ -67,6 +67,7 @@ protoc-gen-connect-go protoc-gen-grpc-web grpc-tools + grpcui oapi-codegen rustc cargo From 7f13fea46ad63c73dacebd5c636759ed6d9fbf60 Mon Sep 17 00:00:00 2001 From: lostbean Date: Thu, 23 Nov 2023 14:06:49 -0300 Subject: [PATCH 55/95] clean file for old protobuf to swagger conversion --- protobuf2swagger.config.js | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 protobuf2swagger.config.js diff --git a/protobuf2swagger.config.js b/protobuf2swagger.config.js deleted file mode 100644 index e621b3d7ed..0000000000 --- a/protobuf2swagger.config.js +++ /dev/null @@ -1,32 +0,0 @@ -const rootFolder = './api/protobuf/core/'; -const fileNames = ['api_container_service.proto']; - -module.exports = { - files: fileNames.map(f => `${rootFolder}/${f}`), - dist: `${rootFolder}/topic-specifications.schema.json`, - long: 'number', - transform(type, result, args) { - switch (type) { - case 'enum': { - const [Enum] = args; - // console.log('enum:', Enum); - return { ...result, type: 'string', enum: Object.keys(Enum.values) }; - } - case 'message': { - const [Type] = args; - // looking for Map fields and converting them to { [key: string]: type; } - const map = Object.values(Type.fields || {}).filter(f => f.map && f.keyType === 'string'); - const newResult = { ...result }; - map.forEach(field => { - newResult.properties[field.name].type = 'object'; - newResult.properties[field.name].additionalProperties = { type: 'string' }; - }); - - // console.log('result', newResult); - return newResult; - } - } - return result; - } -}; - From c7af53e58ffbb138f1e02d91ff717af420b8b6a6 Mon Sep 17 00:00:00 2001 From: lostbean Date: Thu, 23 Nov 2023 16:43:41 -0300 Subject: [PATCH 56/95] handle enclave/engine not found --- .../api_container_server.gen.go | 315 ++++++++++++++---- .../api_container_types.gen.go | 20 ++ .../engine_server.gen.go | 150 +++++++-- .../engine_types.gen.go | 20 ++ api/openapi/core/core_service.yaml | 62 ++++ api/openapi/engine/engine_service.yaml | 51 +++ .../engine/server/enclave_rest_api_handler.go | 115 ++++--- 7 files changed, 600 insertions(+), 133 deletions(-) diff --git a/api/golang/core/kurtosis_core_rest_api_bindings/api_container_server.gen.go b/api/golang/core/kurtosis_core_rest_api_bindings/api_container_server.gen.go index 273ca17e90..69382d8a28 100644 --- a/api/golang/core/kurtosis_core_rest_api_bindings/api_container_server.gen.go +++ b/api/golang/core/kurtosis_core_rest_api_bindings/api_container_server.gen.go @@ -506,6 +506,8 @@ func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL } +type NotOkJSONResponse ResponseInfo + type GetEnclavesEnclaveIdentifierArtifactsRequestObject struct { EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` } @@ -523,6 +525,18 @@ func (response GetEnclavesEnclaveIdentifierArtifacts200JSONResponse) VisitGetEnc return json.NewEncoder(w).Encode(response) } +type GetEnclavesEnclaveIdentifierArtifactsdefaultJSONResponse struct { + Body ResponseInfo + StatusCode int +} + +func (response GetEnclavesEnclaveIdentifierArtifactsdefaultJSONResponse) VisitGetEnclavesEnclaveIdentifierArtifactsResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(response.StatusCode) + + return json.NewEncoder(w).Encode(response.Body) +} + type PostEnclavesEnclaveIdentifierArtifactsLocalFileRequestObject struct { EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` Body *multipart.Reader @@ -541,6 +555,18 @@ func (response PostEnclavesEnclaveIdentifierArtifactsLocalFile200JSONResponse) V return json.NewEncoder(w).Encode(response) } +type PostEnclavesEnclaveIdentifierArtifactsLocalFiledefaultJSONResponse struct { + Body ResponseInfo + StatusCode int +} + +func (response PostEnclavesEnclaveIdentifierArtifactsLocalFiledefaultJSONResponse) VisitPostEnclavesEnclaveIdentifierArtifactsLocalFileResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(response.StatusCode) + + return json.NewEncoder(w).Encode(response.Body) +} + type PostEnclavesEnclaveIdentifierArtifactsRemoteFileRequestObject struct { EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` Body *PostEnclavesEnclaveIdentifierArtifactsRemoteFileJSONRequestBody @@ -559,6 +585,18 @@ func (response PostEnclavesEnclaveIdentifierArtifactsRemoteFile200JSONResponse) return json.NewEncoder(w).Encode(response) } +type PostEnclavesEnclaveIdentifierArtifactsRemoteFiledefaultJSONResponse struct { + Body ResponseInfo + StatusCode int +} + +func (response PostEnclavesEnclaveIdentifierArtifactsRemoteFiledefaultJSONResponse) VisitPostEnclavesEnclaveIdentifierArtifactsRemoteFileResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(response.StatusCode) + + return json.NewEncoder(w).Encode(response.Body) +} + type PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierRequestObject struct { EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` ServiceIdentifier ServiceIdentifier `json:"service_identifier"` @@ -578,6 +616,18 @@ func (response PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier20 return json.NewEncoder(w).Encode(response) } +type PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierdefaultJSONResponse struct { + Body ResponseInfo + StatusCode int +} + +func (response PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierdefaultJSONResponse) VisitPostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(response.StatusCode) + + return json.NewEncoder(w).Encode(response.Body) +} + type GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierRequestObject struct { EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` ArtifactIdentifier ArtifactIdentifier `json:"artifact_identifier"` @@ -596,6 +646,18 @@ func (response GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier200JSONRes return json.NewEncoder(w).Encode(response) } +type GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierdefaultJSONResponse struct { + Body ResponseInfo + StatusCode int +} + +func (response GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierdefaultJSONResponse) VisitGetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(response.StatusCode) + + return json.NewEncoder(w).Encode(response.Body) +} + type GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownloadRequestObject struct { EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` ArtifactIdentifier ArtifactIdentifier `json:"artifact_identifier"` @@ -624,6 +686,18 @@ func (response GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownload20 return err } +type GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownloaddefaultJSONResponse struct { + Body ResponseInfo + StatusCode int +} + +func (response GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownloaddefaultJSONResponse) VisitGetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownloadResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(response.StatusCode) + + return json.NewEncoder(w).Encode(response.Body) +} + type GetEnclavesEnclaveIdentifierServicesRequestObject struct { EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` Params GetEnclavesEnclaveIdentifierServicesParams @@ -642,6 +716,18 @@ func (response GetEnclavesEnclaveIdentifierServices200JSONResponse) VisitGetEncl return json.NewEncoder(w).Encode(response) } +type GetEnclavesEnclaveIdentifierServicesdefaultJSONResponse struct { + Body ResponseInfo + StatusCode int +} + +func (response GetEnclavesEnclaveIdentifierServicesdefaultJSONResponse) VisitGetEnclavesEnclaveIdentifierServicesResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(response.StatusCode) + + return json.NewEncoder(w).Encode(response.Body) +} + type PostEnclavesEnclaveIdentifierServicesConnectionRequestObject struct { EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` Body *PostEnclavesEnclaveIdentifierServicesConnectionJSONRequestBody @@ -659,6 +745,18 @@ func (response PostEnclavesEnclaveIdentifierServicesConnection200Response) Visit return nil } +type PostEnclavesEnclaveIdentifierServicesConnectiondefaultJSONResponse struct { + Body ResponseInfo + StatusCode int +} + +func (response PostEnclavesEnclaveIdentifierServicesConnectiondefaultJSONResponse) VisitPostEnclavesEnclaveIdentifierServicesConnectionResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(response.StatusCode) + + return json.NewEncoder(w).Encode(response.Body) +} + type GetEnclavesEnclaveIdentifierServicesHistoryRequestObject struct { EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` } @@ -676,6 +774,18 @@ func (response GetEnclavesEnclaveIdentifierServicesHistory200JSONResponse) Visit return json.NewEncoder(w).Encode(response) } +type GetEnclavesEnclaveIdentifierServicesHistorydefaultJSONResponse struct { + Body ResponseInfo + StatusCode int +} + +func (response GetEnclavesEnclaveIdentifierServicesHistorydefaultJSONResponse) VisitGetEnclavesEnclaveIdentifierServicesHistoryResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(response.StatusCode) + + return json.NewEncoder(w).Encode(response.Body) +} + type GetEnclavesEnclaveIdentifierServicesServiceIdentifierRequestObject struct { EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` ServiceIdentifier ServiceIdentifier `json:"service_identifier"` @@ -694,6 +804,18 @@ func (response GetEnclavesEnclaveIdentifierServicesServiceIdentifier200JSONRespo return json.NewEncoder(w).Encode(response) } +type GetEnclavesEnclaveIdentifierServicesServiceIdentifierdefaultJSONResponse struct { + Body ResponseInfo + StatusCode int +} + +func (response GetEnclavesEnclaveIdentifierServicesServiceIdentifierdefaultJSONResponse) VisitGetEnclavesEnclaveIdentifierServicesServiceIdentifierResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(response.StatusCode) + + return json.NewEncoder(w).Encode(response.Body) +} + type PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandRequestObject struct { EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` ServiceIdentifier ServiceIdentifier `json:"service_identifier"` @@ -713,6 +835,18 @@ func (response PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand200J return json.NewEncoder(w).Encode(response) } +type PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommanddefaultJSONResponse struct { + Body ResponseInfo + StatusCode int +} + +func (response PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommanddefaultJSONResponse) VisitPostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(response.StatusCode) + + return json.NewEncoder(w).Encode(response.Body) +} + type GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityRequestObject struct { EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` ServiceIdentifier ServiceIdentifier `json:"service_identifier"` @@ -749,6 +883,18 @@ func (response GetEnclavesEnclaveIdentifierStarlark200JSONResponse) VisitGetEncl return json.NewEncoder(w).Encode(response) } +type GetEnclavesEnclaveIdentifierStarlarkdefaultJSONResponse struct { + Body ResponseInfo + StatusCode int +} + +func (response GetEnclavesEnclaveIdentifierStarlarkdefaultJSONResponse) VisitGetEnclavesEnclaveIdentifierStarlarkResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(response.StatusCode) + + return json.NewEncoder(w).Encode(response.Body) +} + type PostEnclavesEnclaveIdentifierStarlarkPackagesRequestObject struct { EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` Body *multipart.Reader @@ -766,6 +912,18 @@ func (response PostEnclavesEnclaveIdentifierStarlarkPackages200Response) VisitPo return nil } +type PostEnclavesEnclaveIdentifierStarlarkPackagesdefaultJSONResponse struct { + Body ResponseInfo + StatusCode int +} + +func (response PostEnclavesEnclaveIdentifierStarlarkPackagesdefaultJSONResponse) VisitPostEnclavesEnclaveIdentifierStarlarkPackagesResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(response.StatusCode) + + return json.NewEncoder(w).Encode(response.Body) +} + type PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdRequestObject struct { EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` PackageId PackageId `json:"package_id"` @@ -804,6 +962,18 @@ func (response PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId200Applicat return err } +type PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIddefaultJSONResponse struct { + Body ResponseInfo + StatusCode int +} + +func (response PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIddefaultJSONResponse) VisitPostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(response.StatusCode) + + return json.NewEncoder(w).Encode(response.Body) +} + type PostEnclavesEnclaveIdentifierStarlarkScriptsRequestObject struct { EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` Body *PostEnclavesEnclaveIdentifierStarlarkScriptsJSONRequestBody @@ -841,6 +1011,18 @@ func (response PostEnclavesEnclaveIdentifierStarlarkScripts200ApplicationoctetSt return err } +type PostEnclavesEnclaveIdentifierStarlarkScriptsdefaultJSONResponse struct { + Body ResponseInfo + StatusCode int +} + +func (response PostEnclavesEnclaveIdentifierStarlarkScriptsdefaultJSONResponse) VisitPostEnclavesEnclaveIdentifierStarlarkScriptsResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(response.StatusCode) + + return json.NewEncoder(w).Encode(response.Body) +} + // StrictServerInterface represents all server handlers. type StrictServerInterface interface { @@ -1367,72 +1549,73 @@ func (sh *strictHandler) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx echo.C // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/+w8f2/bOLJfhdB7QHcPbtzbOxwe8l+apq1xbWLEzvU9bAodLY1tbilSR1JJvEW++wN/", - "WZRFyXKapL3D/rPNmuRwfnNmONTXJONFyRkwJZPjr0mJBS5AgTD/h4UiS5yplOTAFFkSEPrnHGQmSKkI", - "Z8lxMl8D8hMRwwUgLlBVkTwZJURPKLFaJ6NEDyXHUZijRMC/KiIgT46VqGCUyGwNBdabqU2pl0klCFsl", - "9/ejBFhG8Q3sIBXZKjKxb6c2WSXOvuAVoBoAUmus0C2hFC0AwR1klQJNaQTNuxIyBXkqQJacSWjvMVki", - "tQYELC85YQoJUJVgEqk1kegG0wpGZoIEcUMy2O5bYPEFcoQlwjeYULyggH6Co9UReg+UcvSJC5r/fOQF", - "8K8KxCZgSwuxfn6vlSrTAtSa53E2vZ/Pp8hOQJWEHCmOsjVkXzx6hBK1OUJvYIkrqhCR6N3ZvAu9cLsQ", - "sf8WsEyOk/8a1xo7tqNy/F6p8qNZchLsaLAnjCiCaZoDxZu0IJQSCRlnuYwTw6piAQLxJQrnapJuMVGo", - "YopQJ3jCVkY8SyKkslzIMKUddPUgEpK55KLAysxXf/ml1izCFKxAGJqcXqYk/2a9jZhNAP0wwzRgOhBS", - "a83SUJm9khyhiUJFJRV7oZBUWGg81TrgrKRYro/QWy4QYVJhlgH6pwMzXgOmav3PDqY7ynqx5kKlVuod", - "yHOhvFpENbuDjQHcPj4OEbheDVKlC55vOt1IYDjaxCQoje70YjYfBR5lqwQSmHEheqmG6+UTUobcxl22", - "2sCrn80ClCAQMbqP+C4wuq0VIawUFKWSVnUNAQZ1p7zOElfkRpthVSLMcudA9Q+YIRCCi07ELTaHC8Ks", - "G+RNzvs9yQLULQBDNSo9iD6G13AWs/cw9wYaeA+nGhlnChPm3Yn9qSg05+WaVzQPnQsiLG4YETwO8TO1", - "ObzmudOoJaFwVVKO89fOQjSqwJT+s6ioIiUWaqy59DLHysCNMG9B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R9dsskRLTKUtAbHGIp/ClRWlkKOl", - "4IUZP5lOThHlGaY1fMUFHKHJEhH1QiK8M2xAE2ny72u2xjeAFjopqUwwDTmqpHYqNrbeoR+VgnCbEmNK", - "9bQ2jywdJqTvJsNRbsh4R9T7aoEWsOTC5xJad4x8Za04C84pYKYlk1Fe5amvDESLIq7yZJIvnVRuYk7Y", - "wqkkiIfDyMUmFRXrX23EGiUF7koQpACmME2X1ok1464+Y415v0gsbuPa3DnktHAeuQ9y24WbACvDtE2p", - "lfBGz/SHl9W5gucVhTDm0EFIjIsFJixdViwz/i9+Fptanak22z30GuTX2LJp7uqNtu5BJLpORMWuk9iW", - "JRaYUqBEFv3C++tO0NThak0hvSfdsVnubtDni+9IJ6nmjNd0eJvaGk6D1iTiD33kmOrAKVU8tRwltIOR", - "20jTQtZBm/6PXt3BSv3jtRHUkTbN68SucqGH4NzEhNijHGO5gIKrCEK/VVIhjJYUrzTDCcv1SQhWykaH", - "jLsKPAdhkuTgXWDEsmLJZOCsZmb3qD//w7N8B8/yh/1/o/1LEART8jvkqdzqdn/I1V4SC7RmtnY32WZO", - "kXrGCYuVEIkOPjJOKRistdh05jGyQnQlRKFA27NLSYakZOeBCrhdo5mxqznuT7T6gHgEO8CY4mmDiL1A", - "20Ko0XQ5WWvfPrmwJY+4sbAUOKg0ZjKLb+F3KcgNVpCSMsV53lFonkyRHgQpd++GAofuLnH7NtH5QW9l", - "sY9mk7vFzoeyWlCSdVMwNeMhEX/ildJ4/ylEXGfoAprUSSQAZ2u8oHDNzi/mZ8fok7+a0/7fV0/qBeyF", - "QqJijLBV80o4J7key2FJmDajjakzyxFyvmOBsy/AcpRzMEBkVZpCtAD9jw7aLZ0B65c8ymzLjqfhtdf7", - "YRVcp+y+fvtM1j17TMvetY9dZe6y/RarRoF19ziG71d79odXbxH0WaKTeFQRiQTCy/V9gcKAUKA/GI+E", - "xSbXTcttMaOP9mblo3n01zFI7Dw8NEBotAW018d2bnKrlxNR8XSFrS0mRTXfKd6ZuQZuq5z/mTO4WCbH", - "v+7xOQ7ahCkQpQBlSloW9v1o2Np/YEryB6w781UQt+xz617C/N7LhCaIiAG68RR62JUWIKUrbe25KWlM", - "b2PWulhpbt9HSjzGIR2/SiWqLO509JLhFDVm7yUo3HjA5CXfQ3IPGVisqsL37w3ylxGwJw5I9O7WCEcH", - "K+kOP1tuJRjvdrBEpvILKUsIHWyQqpZcEr/DgWRM/dKW8/IDERxHAQs7qW2gPVBWW6bGZNbLHwGlAKm9", - "nnaXcTYF7laDM0nuQWlevSq250Aap4GwdrMOWhVs4Bmpz4BOhlDC4JBOKU/rFqgDMfI4DaSt6yY61CDR", - "MSfgc3z6YDFFlh/ifrrXhDS3D7UI1eGk73NORHHoo+yyYm8JI3IN+dlN1BRFpSMQOyWF+BxtHRVLZZVl", - "IOWyonstsm482HOqtCDHwOzlS4SIPVyZCr7SSWukIcGNpPEjNauEAKZSqaDcThneCNRYftjlJdcxoF4n", - "H+IM2ng3QcZR28v5Jrf2MP3SNVx/cA5tJ8H0Zb5tsIYu6w7tQ8PU+ugaHGYeFJSGOjR0Tdu3HrBb046H", - "LvyETT/oASguuY6wa7ntRu0ti7jZTvg+TrG1f58Wen60cLzdMzAc/d0FewnwW8fx5gJM345v23kreOGq", - "Gm1kh90VNJtposUgXonM5qkdL14WktNKAbIzbYd7UOqzv9qNtvfcvCTunnt/vShAoKc5x7DnEywaHIq5", - "Fi4AfYIFarZADSyyH86/SkRuhq8uPyDFkb8fst3mvhlrEFc02B5utLtVogWv+enUFbtmp/Opr3S9mQZV", - "rvmp/j89nIwSPfR5FGtE9uffzgXIdKLpLDAjZUX91aWrB5seBqKoBnXmSsT20vIGhHRIHv356JUmiJfA", - "cEmS4+QvR6+OXiX2jYWR1NjDG39tv3O6H3u+mrkriOjEByIVwpTuSFPjpzXCOJRJnhwn70A5RKX7t77+", - "OQlWhW/HOo6peso48jjr/rMp7JgTz+D9y6tXO73cQV/U+Ddp0466kXtQ9hvvFWx3sN7vXs/Ntk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d", + "c5x9BpajnINZRFalac4L0P/opN3SGbB+waPMtuz4Prz2et+vq+2U3fe0f5B1Tx/TsnftY1eZ22y/wapB", + "YN0djuHp+vE+eHU2hn9IdhLPKiKZQHgAYl+i0CMV6E7GI2mxqXXTctPM2NODCTof9dC/zUFi8fDQBKF2", + "dKM5Pwa5zq1OTkTF05a2NpgU1XyneGdmU7Opcv5nzuBikRz/ssfnuNVGTIEoBSjT5rNr3w/6zf0HpiR/", + "wLwz3wVx0z419mrM751MqC8RMUD3PYUOdqXtHcMYRpvhTcwam0118F2kxHMc0vKrVKLK4k5HT+lPUW30", + "XoJCwD0GL/gekjvIwGJZFf6MZS9/GVn2xC0S3c82wtHJSrrDz4ZbCb63O1giU/mZlCWEDjYoVUsuiYdw", + "IBkTP7XhvPyHCI6DgIWt1NbQ7imrDVNjMuvkj4BSgNReT7vLOJsCd6uXM0XuQWXedlYMZk8aJ4GwdqsO", + "WhWsZ4zUMaCVIZQwOOQ0m6d1s6hbYuBx6klb2+58qEGiZUzA5/jw3mKKTD/E/bTPCWluBrUI1eGgp4kT", + "URy6KLus2DlhRK4gP7uNmqKodAZih6QQH6Oto2KprLIMpFxUdK9Fbg9j7IkqjZVjy+zlS4SIPVyZCL7U", + "RWvkkIb7ksZDalYJAUylUkG5GdL/cFRt+mEbulzngHqefIgzaOJdXzKO2l7O17m1h+l+p/ODc2g7BaZv", + "822SNXS5PUV/aJq6DV2908yDktJQh/rOafrWA6DV7bjvxGtszuwegOKC6wx7K7fdrL1hEbebAU/jFBvw", + "u7TQ86OB492eD/3R352wlwAPOo43F2DOMvmjTOeCF66r0US2315B/YBRtBnEK5HZOrXlVtJcclopQHak", + "vYUQtPrsrxbQZp+bl8Ttc+/vFwUIdBxYMuy5hnmNQzHXwgWga5ij+rGwnk32w/lXicjO8NXlB6Q48vtD", + "9kaAP6DWiyt62Q5uNE/wRBtes9OJa3ZNT2cT3+l6Owm6XLNT/X/6czJI9KdPg9hhcR//djZAJiNNZ4EZ", + "KS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vTBR", + "scM034N4Dhlbn1MZtZ7Nk/pEh9DQnYaXfbbldu/vHaHZikgkFZT2LpANMP7Se3hFPsOs9u6Zeb0w8hTB", + "YRG/Plk+8828Flv6QQIeft1efLjvkagF4rbfEbd3oisJ4oVEc1hhuvg2gbl/Rz8qNwuufnyvnCyi099h", + "9+Cg4/G7B/ZiD3/9HpqJXuMtePnEOj51WDzjxlHz5YA/VPUxVPX+/v8DAAD//7TdfmEzXAAA", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/api/golang/core/kurtosis_core_rest_api_bindings/api_container_types.gen.go b/api/golang/core/kurtosis_core_rest_api_bindings/api_container_types.gen.go index 37ba3ce5cc..1c8893b959 100644 --- a/api/golang/core/kurtosis_core_rest_api_bindings/api_container_types.gen.go +++ b/api/golang/core/kurtosis_core_rest_api_bindings/api_container_types.gen.go @@ -40,6 +40,13 @@ const ( NOINSTRUCTIONSCACHING KurtosisFeatureFlag = "NO_INSTRUCTIONS_CACHING" ) +// Defines values for ResponseType. +const ( + ERROR ResponseType = "ERROR" + INFO ResponseType = "INFO" + WARNING ResponseType = "WARNING" +) + // Defines values for RestartPolicy. const ( RestartPolicyALWAYS RestartPolicy = "ALWAYS" @@ -140,6 +147,16 @@ type Port struct { WaitTimeout *string `json:"wait_timeout,omitempty"` } +// ResponseInfo defines model for ResponseInfo. +type ResponseInfo struct { + Code uint32 `json:"code"` + Message string `json:"message"` + Type ResponseType `json:"type"` +} + +// ResponseType defines model for ResponseType. +type ResponseType string + // RestartPolicy 0 - NEVER // 1 - ALWAYS type RestartPolicy string @@ -430,6 +447,9 @@ type RetriesDelayMilliseconds = int32 // ServiceIdentifier defines model for service_identifier. type ServiceIdentifier = string +// NotOk defines model for NotOk. +type NotOk = ResponseInfo + // PostEnclavesEnclaveIdentifierArtifactsLocalFileMultipartBody defines parameters for PostEnclavesEnclaveIdentifierArtifactsLocalFile. type PostEnclavesEnclaveIdentifierArtifactsLocalFileMultipartBody = openapi_types.File diff --git a/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_server.gen.go b/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_server.gen.go index cfbe15a626..696e31e5c8 100644 --- a/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_server.gen.go +++ b/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_server.gen.go @@ -214,6 +214,8 @@ func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL } +type NotOkJSONResponse ResponseInfo + type DeleteEnclavesRequestObject struct { Params DeleteEnclavesParams } @@ -231,6 +233,18 @@ func (response DeleteEnclaves200JSONResponse) VisitDeleteEnclavesResponse(w http return json.NewEncoder(w).Encode(response) } +type DeleteEnclavesdefaultJSONResponse struct { + Body ResponseInfo + StatusCode int +} + +func (response DeleteEnclavesdefaultJSONResponse) VisitDeleteEnclavesResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(response.StatusCode) + + return json.NewEncoder(w).Encode(response.Body) +} + type GetEnclavesRequestObject struct { } @@ -247,6 +261,18 @@ func (response GetEnclaves200JSONResponse) VisitGetEnclavesResponse(w http.Respo return json.NewEncoder(w).Encode(response) } +type GetEnclavesdefaultJSONResponse struct { + Body ResponseInfo + StatusCode int +} + +func (response GetEnclavesdefaultJSONResponse) VisitGetEnclavesResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(response.StatusCode) + + return json.NewEncoder(w).Encode(response.Body) +} + type PostEnclavesRequestObject struct { Body *PostEnclavesJSONRequestBody } @@ -264,6 +290,18 @@ func (response PostEnclaves200JSONResponse) VisitPostEnclavesResponse(w http.Res return json.NewEncoder(w).Encode(response) } +type PostEnclavesdefaultJSONResponse struct { + Body ResponseInfo + StatusCode int +} + +func (response PostEnclavesdefaultJSONResponse) VisitPostEnclavesResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(response.StatusCode) + + return json.NewEncoder(w).Encode(response.Body) +} + type GetEnclavesHistoricalRequestObject struct { } @@ -280,6 +318,18 @@ func (response GetEnclavesHistorical200JSONResponse) VisitGetEnclavesHistoricalR return json.NewEncoder(w).Encode(response) } +type GetEnclavesHistoricaldefaultJSONResponse struct { + Body ResponseInfo + StatusCode int +} + +func (response GetEnclavesHistoricaldefaultJSONResponse) VisitGetEnclavesHistoricalResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(response.StatusCode) + + return json.NewEncoder(w).Encode(response.Body) +} + type DeleteEnclavesEnclaveIdentifierRequestObject struct { EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` } @@ -296,6 +346,18 @@ func (response DeleteEnclavesEnclaveIdentifier200Response) VisitDeleteEnclavesEn return nil } +type DeleteEnclavesEnclaveIdentifierdefaultJSONResponse struct { + Body ResponseInfo + StatusCode int +} + +func (response DeleteEnclavesEnclaveIdentifierdefaultJSONResponse) VisitDeleteEnclavesEnclaveIdentifierResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(response.StatusCode) + + return json.NewEncoder(w).Encode(response.Body) +} + type GetEnclavesEnclaveIdentifierRequestObject struct { EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` } @@ -313,6 +375,18 @@ func (response GetEnclavesEnclaveIdentifier200JSONResponse) VisitGetEnclavesEncl return json.NewEncoder(w).Encode(response) } +type GetEnclavesEnclaveIdentifierdefaultJSONResponse struct { + Body ResponseInfo + StatusCode int +} + +func (response GetEnclavesEnclaveIdentifierdefaultJSONResponse) VisitGetEnclavesEnclaveIdentifierResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(response.StatusCode) + + return json.NewEncoder(w).Encode(response.Body) +} + type GetEnclavesEnclaveIdentifierStatusRequestObject struct { EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` } @@ -330,6 +404,18 @@ func (response GetEnclavesEnclaveIdentifierStatus200JSONResponse) VisitGetEnclav return json.NewEncoder(w).Encode(response) } +type GetEnclavesEnclaveIdentifierStatusdefaultJSONResponse struct { + Body ResponseInfo + StatusCode int +} + +func (response GetEnclavesEnclaveIdentifierStatusdefaultJSONResponse) VisitGetEnclavesEnclaveIdentifierStatusResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(response.StatusCode) + + return json.NewEncoder(w).Encode(response.Body) +} + type PostEnclavesEnclaveIdentifierStatusRequestObject struct { EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` Body *PostEnclavesEnclaveIdentifierStatusJSONRequestBody @@ -347,6 +433,18 @@ func (response PostEnclavesEnclaveIdentifierStatus200Response) VisitPostEnclaves return nil } +type PostEnclavesEnclaveIdentifierStatusdefaultJSONResponse struct { + Body ResponseInfo + StatusCode int +} + +func (response PostEnclavesEnclaveIdentifierStatusdefaultJSONResponse) VisitPostEnclavesEnclaveIdentifierStatusResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(response.StatusCode) + + return json.NewEncoder(w).Encode(response.Body) +} + type GetEngineInfoRequestObject struct { } @@ -363,6 +461,18 @@ func (response GetEngineInfo200JSONResponse) VisitGetEngineInfoResponse(w http.R return json.NewEncoder(w).Encode(response) } +type GetEngineInfodefaultJSONResponse struct { + Body ResponseInfo + StatusCode int +} + +func (response GetEngineInfodefaultJSONResponse) VisitGetEngineInfoResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(response.StatusCode) + + return json.NewEncoder(w).Encode(response.Body) +} + // StrictServerInterface represents all server handlers. type StrictServerInterface interface { // Delete Enclaves @@ -639,25 +749,27 @@ func (sh *strictHandler) GetEngineInfo(ctx echo.Context) error { // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/9RXTW/jNhD9K8K0R9V225tu6drI6hDHWNtAiyAQGHFscyGRCkkFMAL/94L6lkXJsrNZ", - "tKfA0XDmzZs3w+E7hCJOBEeuFXjvkBBJYtQos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C", + "qUSlnGyoicWoU6D2jnHFKJYZ7QWlV6wHk5YHLg0nfPAdUZ4ArUJMDavy6f0y+MtZ3lbhrGrMqpuAkvqG", + "8U5oe0u0ejP67h5B2LJk9Xa0nMDFTaB232kSM2T2woDSPVWCneb2H/W6lakqx6fUOXp/syzUQDV9DDO6", + "zFOQt2yWnO28AUtQaZKkzV7ey6B39/JLk86FZE+ejoGy0Z2g7b2NvizhYLoOwIflanH7cBPMFvNTpdt8", + "UjrU7wVpGDQWi3NlFxC5Rd1tRaYB9bi+7X29MD8rx4Mh6WvJu9xsjVUdg5FFfyNkQjRMIGNcf/0CvuNZ", + "SFApsnVDWvwwbMALjOxxJLmC2oZfeHYqoMCaLAGfrlaLFfgwm/++AB/+uF7lT4ErBXV9NkOnROMvlrXH", + "sJtX0QKomY7NWZFH73o5Ax+qjMH46tersTEiUuQkZTCBr1fjqzH4+V6Qoz4qR/RioI9R55GYxOS1M6Mw", + "KaazcvhU+fV6eXl0Q12LjBpD/eHpaHD/Mh5/2Nh+PEQ6Jvd1FkWo1CaLvdINyIXy7aTPQOXxqNgz8nG/", + "nFQtOl4FjxlyUHdRvEPdgPCHUCCUMnNE4mWrhgb07fJtOyLzZaC6Q93CKRXKAdRSqDZSLxkq/Zug+w+j", + "SnudOrRbgFljD5/I01YmLgN8Ea9XB+zXlT/aMaWFZBHJ98Vz3P1WS/8gRu/Z2JqTcXdjuxh56+AbPG6B", + "+db9k+UwvLd2on13s3X8x9PXdC/RGpWWYl/z7nxrvCgCP2s5N/qoZ+2e4+Co3jvenYJ1OVH/FIno7kyX", + "S4oN2VPVtnb+ift0uD/++XQtHMMf0c9PxdqRiqJCzKA8Kufn/kKo9qJPpWtl5aJtI98VSrOHfwMAAP//", + "wdS4oZgYAAA=", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_types.gen.go b/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_types.gen.go index 84440ce1a0..a518805b7e 100644 --- a/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_types.gen.go +++ b/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_types.gen.go @@ -32,6 +32,13 @@ const ( STOP EnclaveTargetStatus = "STOP" ) +// Defines values for ResponseType. +const ( + ERROR ResponseType = "ERROR" + INFO ResponseType = "INFO" + WARNING ResponseType = "WARNING" +) + // ApiContainerStatus defines model for ApiContainerStatus. type ApiContainerStatus string @@ -102,6 +109,16 @@ type EngineInfo struct { EngineVersion string `json:"engine_version"` } +// ResponseInfo defines model for ResponseInfo. +type ResponseInfo struct { + Code uint32 `json:"code"` + Message string `json:"message"` + Type ResponseType `json:"type"` +} + +// ResponseType defines model for ResponseType. +type ResponseType string + // Timestamp defines model for Timestamp. type Timestamp = time.Time @@ -111,6 +128,9 @@ type EnclaveIdentifier = string // RemoveAll defines model for remove_all. type RemoveAll = bool +// NotOk defines model for NotOk. +type NotOk = ResponseInfo + // DeleteEnclavesParams defines parameters for DeleteEnclaves. type DeleteEnclavesParams struct { // RemoveAll If true, remove all enclaves. Default is false diff --git a/api/openapi/core/core_service.yaml b/api/openapi/core/core_service.yaml index daa73edba3..13a2fc7d18 100644 --- a/api/openapi/core/core_service.yaml +++ b/api/openapi/core/core_service.yaml @@ -13,6 +13,8 @@ paths: parameters: - $ref: '#/components/parameters/enclave_identifier' responses: + default: + $ref: '#/components/responses/NotOk' "200": description: Successful request content: @@ -28,6 +30,8 @@ paths: requestBody: $ref: "#/components/requestBodies/fileUploadBody" responses: + default: + $ref: '#/components/responses/NotOk' "200": description: Success @@ -44,6 +48,8 @@ paths: $ref: "#/components/schemas/RunStarlarkPackage" required: true responses: + default: + $ref: '#/components/responses/NotOk' "200": description: Successful request content: @@ -69,6 +75,8 @@ paths: $ref: "#/components/schemas/RunStarlarkScript" required: true responses: + default: + $ref: '#/components/responses/NotOk' "200": description: Successful request content: @@ -88,6 +96,8 @@ paths: - $ref: '#/components/parameters/enclave_identifier' - $ref: '#/components/parameters/service_identifier' responses: + default: + $ref: '#/components/responses/NotOk' "200": description: Successful request content: @@ -101,6 +111,8 @@ paths: parameters: - $ref: '#/components/parameters/enclave_identifier' responses: + default: + $ref: '#/components/responses/NotOk' "200": description: Successful request content: @@ -122,6 +134,8 @@ paths: type: string description: Select services to get information responses: + default: + $ref: '#/components/responses/NotOk' "200": description: Successful request content: @@ -145,6 +159,8 @@ paths: description: Exec Command required: true responses: + default: + $ref: '#/components/responses/NotOk' "200": description: Successful request content: @@ -176,6 +192,8 @@ paths: parameters: - $ref: '#/components/parameters/enclave_identifier' responses: + default: + $ref: '#/components/responses/NotOk' "200": description: Successful request content: @@ -192,6 +210,8 @@ paths: - $ref: '#/components/parameters/artifact_identifier' description: Inspect the content of a file artifact responses: + default: + $ref: '#/components/responses/NotOk' "200": description: Successful request content: @@ -208,6 +228,8 @@ paths: - $ref: '#/components/parameters/enclave_identifier' - $ref: '#/components/parameters/artifact_identifier' responses: + default: + $ref: '#/components/responses/NotOk' "200": description: Successful request content: @@ -224,6 +246,8 @@ paths: requestBody: $ref: "#/components/requestBodies/fileUploadBody" responses: + default: + $ref: '#/components/responses/NotOk' "200": description: Successful request content: @@ -246,6 +270,8 @@ paths: description: Store Web Files Artifact required: true responses: + default: + $ref: '#/components/responses/NotOk' "200": description: Successful request content: @@ -266,6 +292,8 @@ paths: $ref: "#/components/schemas/StoreFilesArtifactFromService" required: true responses: + default: + $ref: '#/components/responses/NotOk' "200": description: Successful request content: @@ -285,6 +313,8 @@ paths: $ref: "#/components/schemas/Connect" required: true responses: + default: + $ref: '#/components/responses/NotOk' "200": description: Successful request @@ -296,6 +326,16 @@ paths: components: + responses: + + NotOk: + description: Unexpected error + content: + application/json: + schema: + $ref: '#/components/schemas/ResponseInfo' + required: true + parameters: enclave_identifier: @@ -402,6 +442,28 @@ components: schemas: + ResponseType: + type: string + enum: + - ERROR + - INFO + - WARNING + + ResponseInfo: + type: object + properties: + type: + $ref: '#/components/schemas/ResponseType' + message: + type: string + code: + type: integer + format: uint32 + required: + - type + - message + - code + Port: type: object properties: diff --git a/api/openapi/engine/engine_service.yaml b/api/openapi/engine/engine_service.yaml index a3748b4110..96d8c586c4 100644 --- a/api/openapi/engine/engine_service.yaml +++ b/api/openapi/engine/engine_service.yaml @@ -9,6 +9,8 @@ paths: get: summary: Get Engine Info responses: + default: + $ref: '#/components/responses/NotOk' '200': description: Successful response content: @@ -20,6 +22,8 @@ paths: get: summary: Get Enclaves responses: + default: + $ref: '#/components/responses/NotOk' '200': description: Successful response content: @@ -38,6 +42,9 @@ paths: schema: $ref: '#/components/schemas/CreateEnclave' responses: + + default: + $ref: '#/components/responses/NotOk' '200': description: Successful response content: @@ -50,6 +57,8 @@ paths: parameters: - $ref: '#/components/parameters/remove_all' responses: + default: + $ref: '#/components/responses/NotOk' '200': description: Successful response content: @@ -61,6 +70,8 @@ paths: get: summary: Get Historical Enclaves responses: + default: + $ref: '#/components/responses/NotOk' '200': description: Successful response content: @@ -76,6 +87,8 @@ paths: parameters: - $ref: '#/components/parameters/enclave_identifier' responses: + default: + $ref: '#/components/responses/NotOk' '200': description: Successful response content: @@ -88,6 +101,8 @@ paths: parameters: - $ref: '#/components/parameters/enclave_identifier' responses: + default: + $ref: '#/components/responses/NotOk' '200': description: Successful response @@ -97,6 +112,8 @@ paths: parameters: - $ref: '#/components/parameters/enclave_identifier' responses: + default: + $ref: '#/components/responses/NotOk' '200': description: Successful response content: @@ -114,6 +131,8 @@ paths: schema: $ref: '#/components/schemas/EnclaveTargetStatus' responses: + default: + $ref: '#/components/responses/NotOk' '200': description: Successful response @@ -125,6 +144,16 @@ paths: components: + responses: + + NotOk: + description: Unexpected error + content: + application/json: + schema: + $ref: '#/components/schemas/ResponseInfo' + required: true + parameters: enclave_identifier: @@ -145,6 +174,28 @@ components: schemas: + ResponseType: + type: string + enum: + - ERROR + - INFO + - WARNING + + ResponseInfo: + type: object + properties: + type: + $ref: '#/components/schemas/ResponseType' + message: + type: string + code: + type: integer + format: uint32 + required: + - type + - message + - code + EngineInfo: type: object properties: diff --git a/engine/server/engine/server/enclave_rest_api_handler.go b/engine/server/engine/server/enclave_rest_api_handler.go index 3197eb4f77..6204a64359 100644 --- a/engine/server/engine/server/enclave_rest_api_handler.go +++ b/engine/server/engine/server/enclave_rest_api_handler.go @@ -7,6 +7,7 @@ import ( "encoding/json" "fmt" "io" + "net/http" "sync" "github.com/kurtosis-tech/kurtosis/engine/server/engine/enclave_manager" @@ -94,9 +95,9 @@ func NewEnclaveRuntime(ctx context.Context, manager enclave_manager.EnclaveManag // (GET /enclaves/{enclave_identifier}/artifacts) func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierArtifacts(ctx context.Context, request api.GetEnclavesEnclaveIdentifierArtifactsRequestObject) (api.GetEnclavesEnclaveIdentifierArtifactsResponseObject, error) { enclave_identifier := request.EnclaveIdentifier - apiContainerClient, err := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) - if err != nil { - return nil, err + apiContainerClient, responseErr := manager.GetApiClientOrResponseError(enclave_identifier) + if responseErr != nil { + return api.GetEnclavesEnclaveIdentifierArtifactsdefaultJSONResponse{Body: *responseErr, StatusCode: int(responseErr.Code)}, nil } artifacts, err := (*apiContainerClient).ListFilesArtifactNamesAndUuids(ctx, &emptypb.Empty{}) @@ -119,9 +120,9 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierArtifacts(ctx context // (POST /enclaves/{enclave_identifier}/artifacts/local-file) func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierArtifactsLocalFile(ctx context.Context, request api.PostEnclavesEnclaveIdentifierArtifactsLocalFileRequestObject) (api.PostEnclavesEnclaveIdentifierArtifactsLocalFileResponseObject, error) { enclave_identifier := request.EnclaveIdentifier - apiContainerClient, err := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) - if err != nil { - return nil, err + apiContainerClient, responseErr := manager.GetApiClientOrResponseError(enclave_identifier) + if responseErr != nil { + return api.PostEnclavesEnclaveIdentifierArtifactsLocalFiledefaultJSONResponse{Body: *responseErr, StatusCode: int(responseErr.Code)}, nil } logrus.Infof("Uploading file artifact to enclave %s", enclave_identifier) @@ -172,9 +173,9 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierArtifactsLocalFile(c // (POST /enclaves/{enclave_identifier}/artifacts/remote-file) func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierArtifactsRemoteFile(ctx context.Context, request api.PostEnclavesEnclaveIdentifierArtifactsRemoteFileRequestObject) (api.PostEnclavesEnclaveIdentifierArtifactsRemoteFileResponseObject, error) { enclave_identifier := request.EnclaveIdentifier - apiContainerClient, err := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) - if err != nil { - return nil, err + apiContainerClient, responseErr := manager.GetApiClientOrResponseError(enclave_identifier) + if responseErr != nil { + return api.PostEnclavesEnclaveIdentifierArtifactsRemoteFiledefaultJSONResponse{Body: *responseErr, StatusCode: int(responseErr.Code)}, nil } logrus.Infof("Uploading file artifact to enclave %s", enclave_identifier) @@ -199,9 +200,9 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierArtifactsRemoteFile( func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier(ctx context.Context, request api.PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierRequestObject) (api.PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierResponseObject, error) { enclave_identifier := request.EnclaveIdentifier service_identifier := request.ServiceIdentifier - apiContainerClient, err := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) - if err != nil { - return nil, err + apiContainerClient, responseErr := manager.GetApiClientOrResponseError(enclave_identifier) + if responseErr != nil { + return api.PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierdefaultJSONResponse{Body: *responseErr, StatusCode: int(responseErr.Code)}, nil } logrus.Infof("Storing file artifact from service %s on enclave %s", service_identifier, enclave_identifier) @@ -227,9 +228,9 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierArtifactsServicesSer func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier(ctx context.Context, request api.GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierRequestObject) (api.GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierResponseObject, error) { enclave_identifier := request.EnclaveIdentifier artifact_identifier := request.ArtifactIdentifier - apiContainerClient, err := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) - if err != nil { - return nil, err + apiContainerClient, responseErr := manager.GetApiClientOrResponseError(enclave_identifier) + if responseErr != nil { + return api.GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierdefaultJSONResponse{Body: *responseErr, StatusCode: int(responseErr.Code)}, nil } logrus.Infof("Inspecting file artifact %s on enclave %s", artifact_identifier, enclave_identifier) @@ -263,9 +264,9 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierArtifactsArtifactIden func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownload(ctx context.Context, request api.GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownloadRequestObject) (api.GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownloadResponseObject, error) { enclave_identifier := request.EnclaveIdentifier artifact_identifier := request.ArtifactIdentifier - apiContainerClient, err := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) - if err != nil { - return nil, err + apiContainerClient, responseErr := manager.GetApiClientOrResponseError(enclave_identifier) + if responseErr != nil { + return api.GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownloaddefaultJSONResponse{Body: *responseErr, StatusCode: int(responseErr.Code)}, nil } logrus.Infof("Downloading file artifact %s from enclave %s", artifact_identifier, enclave_identifier) @@ -297,9 +298,9 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierArtifactsArtifactIden // (GET /enclaves/{enclave_identifier}/services) func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierServices(ctx context.Context, request api.GetEnclavesEnclaveIdentifierServicesRequestObject) (api.GetEnclavesEnclaveIdentifierServicesResponseObject, error) { enclave_identifier := request.EnclaveIdentifier - apiContainerClient, err := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) - if err != nil { - return nil, err + apiContainerClient, responseErr := manager.GetApiClientOrResponseError(enclave_identifier) + if responseErr != nil { + return api.GetEnclavesEnclaveIdentifierServicesdefaultJSONResponse{Body: *responseErr, StatusCode: int(responseErr.Code)}, nil } logrus.Infof("Getting info about services enclave %s", enclave_identifier) @@ -320,9 +321,9 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierServices(ctx context. // (GET /enclaves/{enclave_identifier}/services/history) func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierServicesHistory(ctx context.Context, request api.GetEnclavesEnclaveIdentifierServicesHistoryRequestObject) (api.GetEnclavesEnclaveIdentifierServicesHistoryResponseObject, error) { enclave_identifier := request.EnclaveIdentifier - apiContainerClient, err := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) - if err != nil { - return nil, err + apiContainerClient, responseErr := manager.GetApiClientOrResponseError(enclave_identifier) + if responseErr != nil { + return api.GetEnclavesEnclaveIdentifierServicesHistorydefaultJSONResponse{Body: *responseErr, StatusCode: int(responseErr.Code)}, nil } logrus.Infof("Listing services from enclave %s", enclave_identifier) @@ -346,16 +347,16 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierServicesHistory(ctx c // (POST /enclaves/{enclave_identifier}/services/connection) func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierServicesConnection(ctx context.Context, request api.PostEnclavesEnclaveIdentifierServicesConnectionRequestObject) (api.PostEnclavesEnclaveIdentifierServicesConnectionResponseObject, error) { enclave_identifier := request.EnclaveIdentifier - apiContainerClient, err := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) - if err != nil { - return nil, err + apiContainerClient, responseErr := manager.GetApiClientOrResponseError(enclave_identifier) + if responseErr != nil { + return api.PostEnclavesEnclaveIdentifierServicesConnectiondefaultJSONResponse{Body: *responseErr, StatusCode: int(responseErr.Code)}, nil } logrus.Infof("Listing services from enclave %s", enclave_identifier) connectServicesArgs := rpc_api.ConnectServicesArgs{ Connect: toGrpcConnect(*request.Body), } - _, err = (*apiContainerClient).ConnectServices(ctx, &connectServicesArgs) + _, err := (*apiContainerClient).ConnectServices(ctx, &connectServicesArgs) if err != nil { logrus.Errorf("Can't list services using gRPC call with enclave %s, error: %s", enclave_identifier, err) return nil, stacktrace.NewError("Can't list services using gRPC call with enclave %s", enclave_identifier) @@ -368,9 +369,9 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierServicesConnection(c func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierServicesServiceIdentifier(ctx context.Context, request api.GetEnclavesEnclaveIdentifierServicesServiceIdentifierRequestObject) (api.GetEnclavesEnclaveIdentifierServicesServiceIdentifierResponseObject, error) { enclave_identifier := request.EnclaveIdentifier service_identifier := request.ServiceIdentifier - apiContainerClient, err := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) - if err != nil { - return nil, err + apiContainerClient, responseErr := manager.GetApiClientOrResponseError(enclave_identifier) + if responseErr != nil { + return api.GetEnclavesEnclaveIdentifierServicesServiceIdentifierdefaultJSONResponse{Body: *responseErr, StatusCode: int(responseErr.Code)}, nil } logrus.Infof("Getting info about service %s from enclave %s", service_identifier, enclave_identifier) @@ -396,9 +397,9 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierServicesServiceIdenti func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand(ctx context.Context, request api.PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandRequestObject) (api.PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandResponseObject, error) { enclave_identifier := request.EnclaveIdentifier service_identifier := request.ServiceIdentifier - apiContainerClient, err := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) - if err != nil { - return nil, err + apiContainerClient, responseErr := manager.GetApiClientOrResponseError(enclave_identifier) + if responseErr != nil { + return api.PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommanddefaultJSONResponse{Body: *responseErr, StatusCode: int(responseErr.Code)}, nil } logrus.Infof("Getting info about service %s from enclave %s", service_identifier, enclave_identifier) @@ -473,9 +474,9 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierServicesServiceIdenti // (GET /enclaves/{enclave_identifier}/starlark) func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierStarlark(ctx context.Context, request api.GetEnclavesEnclaveIdentifierStarlarkRequestObject) (api.GetEnclavesEnclaveIdentifierStarlarkResponseObject, error) { enclave_identifier := request.EnclaveIdentifier - apiContainerClient, err := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) - if err != nil { - return nil, err + apiContainerClient, responseErr := manager.GetApiClientOrResponseError(enclave_identifier) + if responseErr != nil { + return api.GetEnclavesEnclaveIdentifierStarlarkdefaultJSONResponse{Body: *responseErr, StatusCode: int(responseErr.Code)}, nil } logrus.Infof("Getting info about last Starlark run on enclave %s", enclave_identifier) @@ -504,9 +505,9 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierStarlark(ctx context. // (POST /enclaves/{enclave_identifier}/starlark/packages) func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkPackages(ctx context.Context, request api.PostEnclavesEnclaveIdentifierStarlarkPackagesRequestObject) (api.PostEnclavesEnclaveIdentifierStarlarkPackagesResponseObject, error) { enclave_identifier := request.EnclaveIdentifier - apiContainerClient, err := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) - if err != nil { - return nil, err + apiContainerClient, responseErr := manager.GetApiClientOrResponseError(enclave_identifier) + if responseErr != nil { + return api.PostEnclavesEnclaveIdentifierStarlarkPackagesdefaultJSONResponse{Body: *responseErr, StatusCode: int(responseErr.Code)}, nil } logrus.Infof("Upload Starlark package on enclave %s", enclave_identifier) @@ -550,9 +551,9 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkPackages(ctx // (POST /enclaves/{enclave_identifier}/starlark/packages/{package_id}) func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId(ctx context.Context, request api.PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdRequestObject) (api.PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdResponseObject, error) { enclave_identifier := request.EnclaveIdentifier - apiContainerClient, err := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) - if err != nil { - return nil, err + apiContainerClient, responseErr := manager.GetApiClientOrResponseError(enclave_identifier) + if responseErr != nil { + return api.PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIddefaultJSONResponse{Body: *responseErr, StatusCode: int(responseErr.Code)}, nil } logrus.Infof("Run Starlark package on enclave %s", enclave_identifier) @@ -613,9 +614,9 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkPackagesPack // (POST /enclaves/{enclave_identifier}/starlark/scripts) func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx context.Context, request api.PostEnclavesEnclaveIdentifierStarlarkScriptsRequestObject) (api.PostEnclavesEnclaveIdentifierStarlarkScriptsResponseObject, error) { enclave_identifier := request.EnclaveIdentifier - apiContainerClient, err := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) - if err != nil { - return nil, err + apiContainerClient, responseErr := manager.GetApiClientOrResponseError(enclave_identifier) + if responseErr != nil { + return api.PostEnclavesEnclaveIdentifierStarlarkScriptsdefaultJSONResponse{Body: *responseErr, StatusCode: int(responseErr.Code)}, nil } logrus.Infof("Run Starlark script on enclave %s", enclave_identifier) @@ -692,6 +693,25 @@ func getGrpcClientConn(enclaveInfo types.EnclaveInfo, connectOnHostMachine bool) return grpcConnection, nil } +func (manager enclaveRuntime) GetApiClientOrResponseError(enclave_uuid string) (*rpc_api.ApiContainerServiceClient, *api.ResponseInfo) { + client, err := manager.GetGrpcClientForEnclaveUUID(enclave_uuid) + if err != nil { + return nil, &api.ResponseInfo{ + Type: api.ERROR, + Message: "Couldn't retrieve connection with enclave", + Code: http.StatusInternalServerError, + } + } + if client == nil { + return nil, &api.ResponseInfo{ + Type: api.INFO, + Message: fmt.Sprintf("enclave '%s' not found", enclave_uuid), + Code: http.StatusNotFound, + } + } + return client, nil +} + func (manager enclaveRuntime) GetGrpcClientForEnclaveUUID(enclave_uuid string) (*rpc_api.ApiContainerServiceClient, error) { err := manager.refreshEnclaveConnections() if err != nil { @@ -700,8 +720,7 @@ func (manager enclaveRuntime) GetGrpcClientForEnclaveUUID(enclave_uuid string) ( client, found := manager.remoteApiContainerClient[enclave_uuid] if !found { - err := stacktrace.NewError("Enclave '%s' not found", enclave_uuid) - return nil, err + return nil, nil } return &client, nil From 5f9ae5b7eb9e73f37c0b61751d9a3ee102f87402 Mon Sep 17 00:00:00 2001 From: lostbean Date: Thu, 23 Nov 2023 18:31:50 -0300 Subject: [PATCH 57/95] clean-up unused code --- engine/server/engine/main.go | 12 ++++-------- .../engine/server/engine_rest_api_handler.go | 18 +----------------- .../engine/server/logging_api_handler.go | 19 ------------------- 3 files changed, 5 insertions(+), 44 deletions(-) diff --git a/engine/server/engine/main.go b/engine/server/engine/main.go index 004d06a0b9..d078821a0c 100644 --- a/engine/server/engine/main.go +++ b/engine/server/engine/main.go @@ -390,14 +390,10 @@ func restApiServer( // We now register our runtime above as the handler for the interface engineRuntime := restApi.EngineRuntime{ - ImageVersionTag: serverArgs.ImageVersionTag, - EnclaveManager: enclave_manager, - MetricsUserID: serverArgs.MetricsUserID, - DidUserAcceptSendingMetrics: serverArgs.DidUserAcceptSendingMetrics, - PerWeekLogsDatabaseClient: perWeekLogsDatabaseClient, - PerFileLogsDatabaseClient: perFileLogsDatabaseClient, - LogFileManager: logFileManager, - MetricsClient: metricsClient, + ImageVersionTag: serverArgs.ImageVersionTag, + EnclaveManager: enclave_manager, + LogFileManager: logFileManager, + MetricsClient: metricsClient, } engineApi.RegisterHandlers(e, engineApi.NewStrictHandler(engineRuntime, nil)) diff --git a/engine/server/engine/server/engine_rest_api_handler.go b/engine/server/engine/server/engine_rest_api_handler.go index 0e26732a36..4c7982463b 100644 --- a/engine/server/engine/server/engine_rest_api_handler.go +++ b/engine/server/engine/server/engine_rest_api_handler.go @@ -4,7 +4,6 @@ import ( "context" "fmt" - "github.com/kurtosis-tech/kurtosis/engine/server/engine/centralized_logs" "github.com/kurtosis-tech/kurtosis/engine/server/engine/centralized_logs/client_implementations/persistent_volume/log_file_manager" "github.com/kurtosis-tech/kurtosis/engine/server/engine/enclave_manager" "github.com/kurtosis-tech/kurtosis/engine/server/engine/types" @@ -22,21 +21,6 @@ type EngineRuntime struct { EnclaveManager *enclave_manager.EnclaveManager - // The protected user ID for metrics analytics purpose - MetricsUserID string - - // User consent to send metrics - DidUserAcceptSendingMetrics bool - - // The clients for consuming container logs from the logs' database server - - // per week pulls logs from enclaves created post log retention feature - PerWeekLogsDatabaseClient centralized_logs.LogsDatabaseClient - - // per file pulls logs from enclaves created pre log retention feature - // TODO: remove once users are fully migrated to log retention/new log schema - PerFileLogsDatabaseClient centralized_logs.LogsDatabaseClient - LogFileManager *log_file_manager.LogFileManager MetricsClient metrics_client.MetricsClient @@ -176,7 +160,7 @@ func (engine EngineRuntime) PostEnclavesEnclaveIdentifierStatus(ctx context.Cont } return api.PostEnclavesEnclaveIdentifierStatus200Response{}, nil default: - err := stacktrace.NewError("Unsupported target state: '%s'", targetState) + err := stacktrace.NewError("Unsupported target state: '%s'", string(*targetState)) return nil, err } diff --git a/engine/server/engine/server/logging_api_handler.go b/engine/server/engine/server/logging_api_handler.go index e184b60714..fc3f3771e3 100644 --- a/engine/server/engine/server/logging_api_handler.go +++ b/engine/server/engine/server/logging_api_handler.go @@ -336,25 +336,6 @@ func fromHttpLogLineFilters( return conjunctiveLogLineFilters, nil } -func (service *EngineRuntime) reportAnyMissingUuidsAndGetNotFoundUuidsListHttp( - ctx context.Context, - enclaveUuid enclave.EnclaveUUID, - requestedServiceUuids map[user_service.ServiceUUID]bool, -) ([]string, error) { - // doesn't matter which logs client is used here - existingServiceUuids, err := service.PerWeekLogsDatabaseClient.FilterExistingServiceUuids(ctx, enclaveUuid, requestedServiceUuids) - if err != nil { - return nil, stacktrace.Propagate(err, "An error occurred retrieving the exhaustive list of service UUIDs from the log client for enclave '%v' and for the requested UUIDs '%+v'", enclaveUuid, requestedServiceUuids) - } - - notFoundServiceUuidsMap := getNotFoundServiceUuidsAndEmptyServiceLogsMap(requestedServiceUuids, existingServiceUuids) - var notFoundServiceUuids []string - for service := range notFoundServiceUuidsMap { - notFoundServiceUuids = append(notFoundServiceUuids, service) - } - return notFoundServiceUuids, nil -} - func newLogsResponseHttp( requestedServiceUuids []user_service.ServiceUUID, serviceLogsByServiceUuid map[user_service.ServiceUUID][]logline.LogLine, From b8f77ba5f5c22bd80afd0585ed897440e79cd73a Mon Sep 17 00:00:00 2001 From: lostbean Date: Mon, 27 Nov 2023 22:56:45 -0300 Subject: [PATCH 58/95] bump go version on CI --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 31e5be1dbb..c3ec873530 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,7 +16,7 @@ param_cli_cluster_backend: ¶m_cli_cluster_backend type: enum enum: ["docker", "kubernetes"] -# Install go version 1.19 to run our integration tests on the minimal version we support +# Install go version to run our integration tests on the minimal version we support steps_install_go: &steps_install_go - run: | wget https://go.dev/dl/go<< pipeline.parameters.go-version >>.linux-amd64.tar.gz @@ -136,7 +136,7 @@ executors: parameters: go-version: type: string - default: "1.19.10" + default: "1.20.11" container-engine-lib-build-cache-key-prefix: type: string default: "go-mod-v1" # Can bump this version to bust the cache @@ -146,7 +146,7 @@ parameters: default: 20.10.7 api-go-version: type: string - default: "1.19.10" + default: "1.20.11" # Separate (and newer) than the API version because we want lots of people to be able to use the Kurtosis API and the API doesn't need to be # the same version as the server rust-version: From 3be499a6e9dc8eb521c5b5b95926c3635d754749 Mon Sep 17 00:00:00 2001 From: lostbean Date: Tue, 28 Nov 2023 12:17:27 -0300 Subject: [PATCH 59/95] Add pointer null checks --- .../server/engine_connect_server_service.go | 59 ++++++++++--------- 1 file changed, 32 insertions(+), 27 deletions(-) diff --git a/engine/server/engine/server/engine_connect_server_service.go b/engine/server/engine/server/engine_connect_server_service.go index 2aa26b5cbd..83e51b18e2 100644 --- a/engine/server/engine/server/engine_connect_server_service.go +++ b/engine/server/engine/server/engine_connect_server_service.go @@ -105,7 +105,7 @@ func toGrpcContainerStatus(status types.ContainerStatus) kurtosis_engine_rpc_api } } -func toGrpcEnclaveAPIContainerInfo(info *types.EnclaveAPIContainerInfo) kurtosis_engine_rpc_api_bindings.EnclaveAPIContainerInfo { +func toGrpcEnclaveAPIContainerInfo(info types.EnclaveAPIContainerInfo) kurtosis_engine_rpc_api_bindings.EnclaveAPIContainerInfo { return kurtosis_engine_rpc_api_bindings.EnclaveAPIContainerInfo{ ContainerId: info.ContainerId, IpInsideEnclave: info.IpInsideEnclave, @@ -114,15 +114,15 @@ func toGrpcEnclaveAPIContainerInfo(info *types.EnclaveAPIContainerInfo) kurtosis } } -func toGrpcApiContainerHostMachineInfo(info *types.EnclaveAPIContainerHostMachineInfo) kurtosis_engine_rpc_api_bindings.EnclaveAPIContainerHostMachineInfo { +func toGrpcApiContainerHostMachineInfo(info types.EnclaveAPIContainerHostMachineInfo) kurtosis_engine_rpc_api_bindings.EnclaveAPIContainerHostMachineInfo { return kurtosis_engine_rpc_api_bindings.EnclaveAPIContainerHostMachineInfo{ IpOnHostMachine: info.IpOnHostMachine, GrpcPortOnHostMachine: info.GrpcPortOnHostMachine, } } -func toGrpcTimestamp(timestamp *time.Time) *timestamppb.Timestamp { - return timestamppb.New(*timestamp) +func toGrpcTimestamp(timestamp time.Time) *timestamppb.Timestamp { + return timestamppb.New(timestamp) } func toGrpcEnclaveMode(mode types.EnclaveMode) kurtosis_engine_rpc_api_bindings.EnclaveMode { @@ -137,45 +137,34 @@ func toGrpcEnclaveMode(mode types.EnclaveMode) kurtosis_engine_rpc_api_bindings. } func toGrpcEnclaveInfo(info types.EnclaveInfo) kurtosis_engine_rpc_api_bindings.EnclaveInfo { - containerInfo := toGrpcEnclaveAPIContainerInfo(info.ApiContainerInfo) - apiHostMachine := toGrpcApiContainerHostMachineInfo(info.ApiContainerHostMachineInfo) + containerInfo := utils.MapPointer(info.ApiContainerInfo, toGrpcEnclaveAPIContainerInfo) + apiHostMachine := utils.MapPointer(info.ApiContainerHostMachineInfo, toGrpcApiContainerHostMachineInfo) return kurtosis_engine_rpc_api_bindings.EnclaveInfo{ EnclaveUuid: info.EnclaveUuid, ShortenedUuid: info.ShortenedUuid, Name: info.Name, ContainersStatus: toGrpcEnclaveContainersStatus(info.EnclaveContainersStatus), ApiContainerStatus: toGrpcContainerStatus(info.ApiContainerStatus), - ApiContainerInfo: &containerInfo, - ApiContainerHostMachineInfo: &apiHostMachine, - CreationTime: toGrpcTimestamp(&info.CreationTime), + ApiContainerInfo: containerInfo, + ApiContainerHostMachineInfo: apiHostMachine, + CreationTime: toGrpcTimestamp(info.CreationTime), Mode: toGrpcEnclaveMode(info.Mode), } } -func toGrpcEnclaveInfos(infos map[string]*types.EnclaveInfo) map[string]*kurtosis_engine_rpc_api_bindings.EnclaveInfo { - info_map := make(map[string]*kurtosis_engine_rpc_api_bindings.EnclaveInfo) - for key, info := range infos { - grpc_info := toGrpcEnclaveInfo(*info) - info_map[key] = &grpc_info - } - return info_map -} - -func toGrpcEnclaveIdentifiers(identifier *types.EnclaveIdentifiers) *kurtosis_engine_rpc_api_bindings.EnclaveIdentifiers { - ident := kurtosis_engine_rpc_api_bindings.EnclaveIdentifiers{ +func toGrpcEnclaveIdentifiers(identifier types.EnclaveIdentifiers) kurtosis_engine_rpc_api_bindings.EnclaveIdentifiers { + return kurtosis_engine_rpc_api_bindings.EnclaveIdentifiers{ EnclaveUuid: identifier.EnclaveUuid, Name: identifier.Name, ShortenedUuid: identifier.ShortenedUuid, } - return &ident } -func toGrpcEnclaveNameAndUuid(identifier *types.EnclaveNameAndUuid) *kurtosis_engine_rpc_api_bindings.EnclaveNameAndUuid { - ident := kurtosis_engine_rpc_api_bindings.EnclaveNameAndUuid{ +func toGrpcEnclaveNameAndUuid(identifier types.EnclaveNameAndUuid) kurtosis_engine_rpc_api_bindings.EnclaveNameAndUuid { + return kurtosis_engine_rpc_api_bindings.EnclaveNameAndUuid{ Uuid: identifier.Uuid, Name: identifier.Name, } - return &ident } func (service *EngineConnectServerService) GetEngineInfo(context.Context, *connect.Request[emptypb.Empty]) (*connect.Response[kurtosis_engine_rpc_api_bindings.GetEngineInfoResponse], error) { @@ -228,7 +217,12 @@ func (service *EngineConnectServerService) GetEnclaves(ctx context.Context, _ *c if err != nil { return nil, stacktrace.Propagate(err, "An error occurred getting info for enclaves") } - response := &kurtosis_engine_rpc_api_bindings.GetEnclavesResponse{EnclaveInfo: toGrpcEnclaveInfos(infoForEnclaves)} + response := &kurtosis_engine_rpc_api_bindings.GetEnclavesResponse{ + EnclaveInfo: utils.MapMapValues( + infoForEnclaves, + func(info *types.EnclaveInfo) *kurtosis_engine_rpc_api_bindings.EnclaveInfo { + return utils.MapPointer(info, toGrpcEnclaveInfo) + })} return connect.NewResponse(response), nil } @@ -237,7 +231,12 @@ func (service *EngineConnectServerService) GetExistingAndHistoricalEnclaveIdenti if err != nil { return nil, stacktrace.Propagate(err, "An error occurred while fetching enclave identifiers") } - response := &kurtosis_engine_rpc_api_bindings.GetExistingAndHistoricalEnclaveIdentifiersResponse{AllIdentifiers: utils.MapList(allIdentifiers, toGrpcEnclaveIdentifiers)} + response := &kurtosis_engine_rpc_api_bindings.GetExistingAndHistoricalEnclaveIdentifiersResponse{ + AllIdentifiers: utils.MapList( + allIdentifiers, + func(identifier *types.EnclaveIdentifiers) *kurtosis_engine_rpc_api_bindings.EnclaveIdentifiers { + return utils.MapPointer(identifier, toGrpcEnclaveIdentifiers) + })} return connect.NewResponse(response), nil } @@ -281,7 +280,13 @@ func (service *EngineConnectServerService) Clean(ctx context.Context, connectArg return nil, stacktrace.Propagate(err, "An error occurred removing all logs.") } } - response := &kurtosis_engine_rpc_api_bindings.CleanResponse{RemovedEnclaveNameAndUuids: utils.MapList(removedEnclaveUuidsAndNames, toGrpcEnclaveNameAndUuid)} + response := &kurtosis_engine_rpc_api_bindings.CleanResponse{ + RemovedEnclaveNameAndUuids: utils.MapList( + removedEnclaveUuidsAndNames, + func(identifier *types.EnclaveNameAndUuid) *kurtosis_engine_rpc_api_bindings.EnclaveNameAndUuid { + return utils.MapPointer(identifier, toGrpcEnclaveNameAndUuid) + }, + )} return connect.NewResponse(response), nil } From 7273d3bd76a8e0c8611f9d210f1076877dfeb487 Mon Sep 17 00:00:00 2001 From: lostbean Date: Tue, 28 Nov 2023 14:55:41 -0300 Subject: [PATCH 60/95] Implement get info handler --- .../engine/server/engine_rest_api_handler.go | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/engine/server/engine/server/engine_rest_api_handler.go b/engine/server/engine/server/engine_rest_api_handler.go index 4c7982463b..4e2a544abd 100644 --- a/engine/server/engine/server/engine_rest_api_handler.go +++ b/engine/server/engine/server/engine_rest_api_handler.go @@ -26,13 +26,6 @@ type EngineRuntime struct { MetricsClient metrics_client.MetricsClient } -type Error struct { -} - -func (error Error) Error() string { - return "Not Implemented :(" -} - // Delete Enclaves // (DELETE /enclaves) func (engine EngineRuntime) DeleteEnclaves(ctx context.Context, request api.DeleteEnclavesRequestObject) (api.DeleteEnclavesResponseObject, error) { @@ -123,7 +116,17 @@ func (engine EngineRuntime) DeleteEnclavesEnclaveIdentifier(ctx context.Context, // Get Enclave Info // (GET /enclaves/{enclave_identifier}) func (engine EngineRuntime) GetEnclavesEnclaveIdentifier(ctx context.Context, request api.GetEnclavesEnclaveIdentifierRequestObject) (api.GetEnclavesEnclaveIdentifierResponseObject, error) { - return nil, Error{} + infoForEnclaves, err := engine.EnclaveManager.GetEnclaves(ctx) + if err != nil { + return nil, stacktrace.Propagate(err, "An error occurred getting info for enclaves") + } + info, found := infoForEnclaves[request.EnclaveIdentifier] + if !found { + notFoundErr := stacktrace.NewError("Enclave '%s' not found.", request.EnclaveIdentifier) + return nil, notFoundErr + } + response := toHttpApiEnclaveInfo(*info) + return api.GetEnclavesEnclaveIdentifier200JSONResponse(response), nil } // Get enclave status From c896a57b43c5476713fc0f49835c4b9606676bf7 Mon Sep 17 00:00:00 2001 From: lostbean Date: Tue, 28 Nov 2023 15:27:47 -0300 Subject: [PATCH 61/95] Rename spec --- .../websocket_server.gen.go} | 30 +++++++++---------- .../websocket_types.gen.go} | 4 +-- api/openapi/logging/server.cfg.yaml | 6 ---- api/openapi/logging/types.cfg.yaml | 4 --- api/openapi/scripts/build.sh | 4 +-- api/openapi/websocket/server.cfg.yaml | 6 ++++ api/openapi/websocket/types.cfg.yaml | 4 +++ .../websocket_service.yaml} | 2 +- engine/server/engine/main.go | 14 ++++----- ...pi_handler.go => websocket_api_handler.go} | 16 +++++----- 10 files changed, 45 insertions(+), 45 deletions(-) rename api/golang/{logging/kurtosis_logging_api_bindings/logging_server.gen.go => websocket/kurtosis_websocket_api_bindings/websocket_server.gen.go} (89%) rename api/golang/{logging/kurtosis_logging_api_bindings/logging_types.gen.go => websocket/kurtosis_websocket_api_bindings/websocket_types.gen.go} (95%) delete mode 100644 api/openapi/logging/server.cfg.yaml delete mode 100644 api/openapi/logging/types.cfg.yaml create mode 100644 api/openapi/websocket/server.cfg.yaml create mode 100644 api/openapi/websocket/types.cfg.yaml rename api/openapi/{logging/logging_service.yaml => websocket/websocket_service.yaml} (99%) rename engine/server/engine/server/{logging_api_handler.go => websocket_api_handler.go} (93%) diff --git a/api/golang/logging/kurtosis_logging_api_bindings/logging_server.gen.go b/api/golang/websocket/kurtosis_websocket_api_bindings/websocket_server.gen.go similarity index 89% rename from api/golang/logging/kurtosis_logging_api_bindings/logging_server.gen.go rename to api/golang/websocket/kurtosis_websocket_api_bindings/websocket_server.gen.go index 4d1736ea35..12d2fe8446 100644 --- a/api/golang/logging/kurtosis_logging_api_bindings/logging_server.gen.go +++ b/api/golang/websocket/kurtosis_websocket_api_bindings/websocket_server.gen.go @@ -1,7 +1,7 @@ -// Package kurtosis_logging_api_bindings provides primitives to interact with the openapi HTTP API. +// Package kurtosis_websocket_api_bindings provides primitives to interact with the openapi HTTP API. // // Code generated by github.com/deepmap/oapi-codegen version (devel) DO NOT EDIT. -package kurtosis_logging_api_bindings +package kurtosis_websocket_api_bindings import ( "bytes" @@ -176,19 +176,19 @@ func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/+xWUW+jOBD+K2juHrmQu3vjrWpzvUjZptqmUqWqQi4MxBXY1B6yG0X895VtSCChCat9", - "6Ms+EczMN9/MfDPODmJZlFKgIA3hDkqmWIGEyr7FUrxVIia+wSjleXvMBYTwXqHagg+CFQjhoKkPOl5j", - "wawPYWGd/1SYQgh/BIfAgTPTwUJmCy7wP+sPtQ+0LQ04U4ptoa59QBHnbIMRT1AQTzkqg5mgjhUviUvD", - "7PFxfuN7ei0VocDEc+9SeYaqJ1OP1ug1QOC7bEpG60MyA1F8UPhecYUJhKQq7ObWsNSkuMgszVTmufwW", - "5TL7sGBdkwGwVylzZMKiiaowdlHOBX6I1zcaQOSCMDNlrU0uVCkRsTw/y/HY7AJPjWrDY4yqiid7yH5l", - "eyY/V9Oua6SRPiJ9YncuzF6WR/FOpFe3Xta6EaqdGCVLVMRdZ/LmdCyuD8QL1MSK8tJwrPaGroNtSs8u", - "aBfpZR9Gvr5hTCZOf7ZOiJvfjKQaOaLL1txkgN8pKhkRKjHcui7ZfaAjxzOclx1uKKrCwNwsZw/R9fJu", - "dTW/i1azpxX47uxuuRo8b8++XK2u/4++zm5nT0Mu3c8HSof2PTh1LZqp6RdRSIpSWQmjuwGxjtZE622G", - "LnrdRseDxZKEm2XH8vte/BGN64Rr61wPVH7VVWUqVcEIQkgY4V9GZnBS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/BR82qLRb0ePR36OxiSMLFKzgEMK/o/FoDL7dFzaZoN7COtid7uMqaPbWyhXXyYpLMU0ghFukSe1d", + "P6d715nbZO2b7rm/dAeToOdGqPyLXicqGODTvhcGmPfduwPcjjf7AJfuBVO9mLHWhRTaae+f8bj+y0Ao", + "bEtYUWQ8tk0JXrW0u+Gwec9ptT1kVlndC/6hjGPUOi0zr6Hgbogyz5nauv57NYhXo/iXBFU3Swe7dtt+", + "QWg1AV0/H0uefJD2fuvu43RXVT8CAAD//zaixr1kCwAA", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/api/golang/logging/kurtosis_logging_api_bindings/logging_types.gen.go b/api/golang/websocket/kurtosis_websocket_api_bindings/websocket_types.gen.go similarity index 95% rename from api/golang/logging/kurtosis_logging_api_bindings/logging_types.gen.go rename to api/golang/websocket/kurtosis_websocket_api_bindings/websocket_types.gen.go index ef706d006f..1fe2468af6 100644 --- a/api/golang/logging/kurtosis_logging_api_bindings/logging_types.gen.go +++ b/api/golang/websocket/kurtosis_websocket_api_bindings/websocket_types.gen.go @@ -1,7 +1,7 @@ -// Package kurtosis_logging_api_bindings provides primitives to interact with the openapi HTTP API. +// Package kurtosis_websocket_api_bindings provides primitives to interact with the openapi HTTP API. // // Code generated by github.com/deepmap/oapi-codegen version (devel) DO NOT EDIT. -package kurtosis_logging_api_bindings +package kurtosis_websocket_api_bindings import ( "time" diff --git a/api/openapi/logging/server.cfg.yaml b/api/openapi/logging/server.cfg.yaml deleted file mode 100644 index 0c1deb8916..0000000000 --- a/api/openapi/logging/server.cfg.yaml +++ /dev/null @@ -1,6 +0,0 @@ -package: kurtosis_logging_api_bindings -generate: - embedded-spec: true - echo-server: true - strict-server: false -output: api/golang/logging/kurtosis_logging_api_bindings/logging_server.gen.go \ No newline at end of file diff --git a/api/openapi/logging/types.cfg.yaml b/api/openapi/logging/types.cfg.yaml deleted file mode 100644 index 8802f1b78c..0000000000 --- a/api/openapi/logging/types.cfg.yaml +++ /dev/null @@ -1,4 +0,0 @@ -package: kurtosis_logging_api_bindings -generate: - models: true -output: api/golang/logging/kurtosis_logging_api_bindings/logging_types.gen.go \ No newline at end of file diff --git a/api/openapi/scripts/build.sh b/api/openapi/scripts/build.sh index 8b2d8e363b..75edfbaafa 100755 --- a/api/openapi/scripts/build.sh +++ b/api/openapi/scripts/build.sh @@ -8,9 +8,9 @@ api_root_dirpath="$(dirname "${script_dirpath}")" echo "Generating data models for REST API " oapi-codegen --config="$api_root_dirpath/engine/types.cfg.yaml" "$api_root_dirpath/engine/engine_service.yaml" oapi-codegen --config="$api_root_dirpath/core/types.cfg.yaml" "$api_root_dirpath/core/core_service.yaml" -oapi-codegen --config="$api_root_dirpath/logging/types.cfg.yaml" "$api_root_dirpath/logging/logging_service.yaml" +oapi-codegen --config="$api_root_dirpath/websocket/types.cfg.yaml" "$api_root_dirpath/websocket/websocket_service.yaml" echo "Generating server code for REST API " oapi-codegen --config="$api_root_dirpath/engine/server.cfg.yaml" "$api_root_dirpath/engine/engine_service.yaml" oapi-codegen --config="$api_root_dirpath/core/server.cfg.yaml" "$api_root_dirpath/core/core_service.yaml" -oapi-codegen --config="$api_root_dirpath/logging/server.cfg.yaml" "$api_root_dirpath/logging/logging_service.yaml" \ No newline at end of file +oapi-codegen --config="$api_root_dirpath/websocket/server.cfg.yaml" "$api_root_dirpath/websocket/websocket_service.yaml" \ No newline at end of file diff --git a/api/openapi/websocket/server.cfg.yaml b/api/openapi/websocket/server.cfg.yaml new file mode 100644 index 0000000000..5eecf6f51f --- /dev/null +++ b/api/openapi/websocket/server.cfg.yaml @@ -0,0 +1,6 @@ +package: kurtosis_websocket_api_bindings +generate: + embedded-spec: true + echo-server: true + strict-server: false +output: api/golang/websocket/kurtosis_websocket_api_bindings/websocket_server.gen.go \ No newline at end of file diff --git a/api/openapi/websocket/types.cfg.yaml b/api/openapi/websocket/types.cfg.yaml new file mode 100644 index 0000000000..edb2290ad1 --- /dev/null +++ b/api/openapi/websocket/types.cfg.yaml @@ -0,0 +1,4 @@ +package: kurtosis_websocket_api_bindings +generate: + models: true +output: api/golang/websocket/kurtosis_websocket_api_bindings/websocket_types.gen.go \ No newline at end of file diff --git a/api/openapi/logging/logging_service.yaml b/api/openapi/websocket/websocket_service.yaml similarity index 99% rename from api/openapi/logging/logging_service.yaml rename to api/openapi/websocket/websocket_service.yaml index ce0af72c12..fb35ae77cf 100644 --- a/api/openapi/logging/logging_service.yaml +++ b/api/openapi/websocket/websocket_service.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: - title: Logging API + title: Websocket API version: 0.1.0 paths: diff --git a/engine/server/engine/main.go b/engine/server/engine/main.go index d078821a0c..599f6c9627 100644 --- a/engine/server/engine/main.go +++ b/engine/server/engine/main.go @@ -20,7 +20,7 @@ import ( enclaveApi "github.com/kurtosis-tech/kurtosis/api/golang/core/kurtosis_core_rest_api_bindings" engineApi "github.com/kurtosis-tech/kurtosis/api/golang/engine/kurtosis_engine_rest_api_bindings" "github.com/kurtosis-tech/kurtosis/api/golang/engine/kurtosis_engine_rpc_api_bindings/kurtosis_engine_rpc_api_bindingsconnect" - loggingApi "github.com/kurtosis-tech/kurtosis/api/golang/logging/kurtosis_logging_api_bindings" + loggingApi "github.com/kurtosis-tech/kurtosis/api/golang/websocket/kurtosis_websocket_api_bindings" connect_server "github.com/kurtosis-tech/kurtosis/connect-server" "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/backend_creator" "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/consts" @@ -399,15 +399,15 @@ func restApiServer( // ============================== Logging API ====================================== - swagger_logging, err := loggingApi.GetSwagger() + swagger_websocket, err := loggingApi.GetSwagger() if err != nil { fmt.Fprintf(os.Stderr, "Error loading swagger spec\n: %s", err) os.Exit(1) } - server.ServeSwaggerUI(e, "/api/specs/logging", server.NewSwaggerUIConfig(swagger_logging)) + server.ServeSwaggerUI(e, "/api/specs/websocket", server.NewSwaggerUIConfig(swagger_websocket)) // Use our validation middleware to check all requests against the - // e.Use(middleware.OapiRequestValidator(swagger_logging)) - loggingRuntime := restApi.LoggingRuntime{ + // e.Use(middleware.OapiRequestValidator(swagger_websocket)) + webSocketRuntime := restApi.WebSocketRuntime{ ImageVersionTag: serverArgs.ImageVersionTag, EnclaveManager: enclave_manager, MetricsUserID: serverArgs.MetricsUserID, @@ -418,8 +418,8 @@ func restApiServer( MetricsClient: metricsClient, } // TODO(edgar) add logging Close() - // defer loggingRuntime.ShutDown() - loggingApi.RegisterHandlers(e, loggingRuntime) + // defer webSocketRuntime.ShutDown() + loggingApi.RegisterHandlers(e, webSocketRuntime) // ============================== Engine Management API ====================================== // OpenAPI schema. diff --git a/engine/server/engine/server/logging_api_handler.go b/engine/server/engine/server/websocket_api_handler.go similarity index 93% rename from engine/server/engine/server/logging_api_handler.go rename to engine/server/engine/server/websocket_api_handler.go index fc3f3771e3..35d0b9a3d9 100644 --- a/engine/server/engine/server/logging_api_handler.go +++ b/engine/server/engine/server/websocket_api_handler.go @@ -20,10 +20,10 @@ import ( "golang.org/x/exp/slices" "golang.org/x/net/websocket" - api "github.com/kurtosis-tech/kurtosis/api/golang/logging/kurtosis_logging_api_bindings" + api "github.com/kurtosis-tech/kurtosis/api/golang/websocket/kurtosis_websocket_api_bindings" ) -type LoggingRuntime struct { +type WebSocketRuntime struct { // The version tag of the engine server image, so it can report its own version ImageVersionTag string @@ -62,7 +62,7 @@ type LogStreamer struct { notFoundServiceUuids []string } -func (engine LoggingRuntime) GetEnclavesEnclaveIdentifierLogs(ctx echo.Context, enclaveIdentifier api.EnclaveIdentifier, params api.GetEnclavesEnclaveIdentifierLogsParams) error { +func (engine WebSocketRuntime) GetEnclavesEnclaveIdentifierLogs(ctx echo.Context, enclaveIdentifier api.EnclaveIdentifier, params api.GetEnclavesEnclaveIdentifierLogsParams) error { streamer, err := engine.getLogStreamer( ctx, enclaveIdentifier, @@ -85,7 +85,7 @@ func (engine LoggingRuntime) GetEnclavesEnclaveIdentifierLogs(ctx echo.Context, } -func (engine LoggingRuntime) GetEnclavesEnclaveIdentifierServicesServiceUuidLogs(ctx echo.Context, enclaveIdentifier api.EnclaveIdentifier, serviceUuid api.ServiceUuid, params api.GetEnclavesEnclaveIdentifierServicesServiceUuidLogsParams) error { +func (engine WebSocketRuntime) GetEnclavesEnclaveIdentifierServicesServiceUuidLogs(ctx echo.Context, enclaveIdentifier api.EnclaveIdentifier, serviceUuid api.ServiceUuid, params api.GetEnclavesEnclaveIdentifierServicesServiceUuidLogsParams) error { serviceUuidStrSet := []user_service.ServiceUUID{user_service.ServiceUUID(serviceUuid)} streamer, err := engine.getLogStreamer( ctx, @@ -108,7 +108,7 @@ func (engine LoggingRuntime) GetEnclavesEnclaveIdentifierServicesServiceUuidLogs } } -func (engine LoggingRuntime) getLogStreamer( +func (engine WebSocketRuntime) getLogStreamer( ctx echo.Context, enclaveIdentifier api.EnclaveIdentifier, serviceUuidList []user_service.ServiceUUID, @@ -266,7 +266,7 @@ func (streamer LogStreamer) streamHTTP(ctx echo.Context) error { // ============================================== Helper Functions ============================================================================= // ============================================================================================================================================= -func (service *LoggingRuntime) reportAnyMissingUuidsAndGetNotFoundUuidsListHttp( +func (service *WebSocketRuntime) reportAnyMissingUuidsAndGetNotFoundUuidsListHttp( ctx context.Context, enclaveUuid enclave.EnclaveUUID, requestedServiceUuids map[user_service.ServiceUUID]bool, @@ -286,7 +286,7 @@ func (service *LoggingRuntime) reportAnyMissingUuidsAndGetNotFoundUuidsListHttp( } // If the enclave was created prior to log retention, return the per file logs client -func (service *LoggingRuntime) getLogsDatabaseClient(enclaveCreationTime time.Time) centralized_logs.LogsDatabaseClient { +func (service *WebSocketRuntime) getLogsDatabaseClient(enclaveCreationTime time.Time) centralized_logs.LogsDatabaseClient { if enclaveCreationTime.After(logRetentionFeatureReleaseTime) { return service.PerWeekLogsDatabaseClient } else { @@ -294,7 +294,7 @@ func (service *LoggingRuntime) getLogsDatabaseClient(enclaveCreationTime time.Ti } } -func (service *LoggingRuntime) getEnclaveCreationTime(ctx context.Context, enclaveUuid enclave.EnclaveUUID) (time.Time, error) { +func (service *WebSocketRuntime) getEnclaveCreationTime(ctx context.Context, enclaveUuid enclave.EnclaveUUID) (time.Time, error) { enclaves, err := service.EnclaveManager.GetEnclaves(ctx) if err != nil { return time.Time{}, err From f46d4b93c8bd29856fe92b934f23b3e107e766f8 Mon Sep 17 00:00:00 2001 From: lostbean Date: Tue, 28 Nov 2023 22:09:09 -0300 Subject: [PATCH 62/95] Split and merge API types --- .../engine_types.gen.go | 144 ----- .../api_types/api_types.gen.go} | 362 +++++++++-- .../api_container_server.gen.go | 414 +++++++------ .../engine_rest_api}/engine_server.gen.go | 133 ++-- .../websocket_api}/websocket_server.gen.go | 82 ++- .../websocket_types.gen.go | 78 --- api/openapi/core/server.cfg.yaml | 6 - api/openapi/core/types.cfg.yaml | 4 - api/openapi/engine/engine_service.yaml | 337 ----------- api/openapi/engine/server.cfg.yaml | 6 - api/openapi/engine/types.cfg.yaml | 4 - api/openapi/generators/api_types.cfg.yaml | 7 + api/openapi/generators/core_server.cfg.yaml | 9 + api/openapi/generators/engine_server.cfg.yaml | 9 + .../generators/websocket_server.cfg.yaml | 9 + api/openapi/scripts/build.sh | 10 +- .../api_types.yaml} | 571 ++++++++---------- api/openapi/specs/core_service.yaml | 331 ++++++++++ api/openapi/specs/engine_service.yaml | 149 +++++ api/openapi/specs/websocket_service.yaml | 42 ++ api/openapi/websocket/server.cfg.yaml | 6 - api/openapi/websocket/types.cfg.yaml | 4 - api/openapi/websocket/websocket_service.yaml | 154 ----- engine/server/engine/main.go | 6 +- .../engine/server/enclave_rest_api_handler.go | 109 ++-- .../engine/server/engine_rest_api_handler.go | 63 +- .../engine/server/websocket_api_handler.go | 37 +- 27 files changed, 1572 insertions(+), 1514 deletions(-) delete mode 100644 api/golang/engine/kurtosis_engine_rest_api_bindings/engine_types.gen.go rename api/golang/{core/kurtosis_core_rest_api_bindings/api_container_types.gen.go => http_rest/api_types/api_types.gen.go} (64%) rename api/golang/{core/kurtosis_core_rest_api_bindings => http_rest/core_rest_api}/api_container_server.gen.go (79%) rename api/golang/{engine/kurtosis_engine_rest_api_bindings => http_rest/engine_rest_api}/engine_server.gen.go (85%) rename api/golang/{websocket/kurtosis_websocket_api_bindings => http_rest/websocket_api}/websocket_server.gen.go (68%) delete mode 100644 api/golang/websocket/kurtosis_websocket_api_bindings/websocket_types.gen.go delete mode 100644 api/openapi/core/server.cfg.yaml delete mode 100644 api/openapi/core/types.cfg.yaml delete mode 100644 api/openapi/engine/engine_service.yaml delete mode 100644 api/openapi/engine/server.cfg.yaml delete mode 100644 api/openapi/engine/types.cfg.yaml create mode 100644 api/openapi/generators/api_types.cfg.yaml create mode 100644 api/openapi/generators/core_server.cfg.yaml create mode 100644 api/openapi/generators/engine_server.cfg.yaml create mode 100644 api/openapi/generators/websocket_server.cfg.yaml rename api/openapi/{core/core_service.yaml => specs/api_types.yaml} (63%) create mode 100644 api/openapi/specs/core_service.yaml create mode 100644 api/openapi/specs/engine_service.yaml create mode 100644 api/openapi/specs/websocket_service.yaml delete mode 100644 api/openapi/websocket/server.cfg.yaml delete mode 100644 api/openapi/websocket/types.cfg.yaml delete mode 100644 api/openapi/websocket/websocket_service.yaml diff --git a/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_types.gen.go b/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_types.gen.go deleted file mode 100644 index a518805b7e..0000000000 --- a/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_types.gen.go +++ /dev/null @@ -1,144 +0,0 @@ -// Package kurtosis_engine_rest_api_bindings provides primitives to interact with the openapi HTTP API. -// -// Code generated by github.com/deepmap/oapi-codegen version (devel) DO NOT EDIT. -package kurtosis_engine_rest_api_bindings - -import ( - "time" -) - -// Defines values for ApiContainerStatus. -const ( - ApiContainerStatusNONEXISTENT ApiContainerStatus = "NON_EXISTENT" - ApiContainerStatusRUNNING ApiContainerStatus = "RUNNING" - ApiContainerStatusSTOPPED ApiContainerStatus = "STOPPED" -) - -// Defines values for EnclaveContainersStatus. -const ( - EnclaveContainersStatusEMPTY EnclaveContainersStatus = "EMPTY" - EnclaveContainersStatusRUNNING EnclaveContainersStatus = "RUNNING" - EnclaveContainersStatusSTOPPED EnclaveContainersStatus = "STOPPED" -) - -// Defines values for EnclaveMode. -const ( - PRODUCTION EnclaveMode = "PRODUCTION" - TEST EnclaveMode = "TEST" -) - -// Defines values for EnclaveTargetStatus. -const ( - STOP EnclaveTargetStatus = "STOP" -) - -// Defines values for ResponseType. -const ( - ERROR ResponseType = "ERROR" - INFO ResponseType = "INFO" - WARNING ResponseType = "WARNING" -) - -// ApiContainerStatus defines model for ApiContainerStatus. -type ApiContainerStatus string - -// CreateEnclave defines model for CreateEnclave. -type CreateEnclave struct { - ApiContainerLogLevel *string `json:"api_container_log_level,omitempty"` - ApiContainerVersionTag *string `json:"api_container_version_tag,omitempty"` - EnclaveName *string `json:"enclave_name,omitempty"` - Mode *EnclaveMode `json:"mode,omitempty"` -} - -// DeletionSummary defines model for DeletionSummary. -type DeletionSummary struct { - RemovedEnclaveNameAndUuids *[]EnclaveNameAndUuid `json:"removed_enclave_name_and_uuids,omitempty"` -} - -// EnclaveAPIContainerHostMachineInfo defines model for EnclaveAPIContainerHostMachineInfo. -type EnclaveAPIContainerHostMachineInfo struct { - GrpcPortOnHostMachine int `json:"grpc_port_on_host_machine"` - IpOnHostMachine string `json:"ip_on_host_machine"` -} - -// EnclaveAPIContainerInfo defines model for EnclaveAPIContainerInfo. -type EnclaveAPIContainerInfo struct { - BridgeIpAddress string `json:"bridge_ip_address"` - ContainerId string `json:"container_id"` - GrpcPortInsideEnclave int `json:"grpc_port_inside_enclave"` - IpInsideEnclave string `json:"ip_inside_enclave"` -} - -// EnclaveContainersStatus defines model for EnclaveContainersStatus. -type EnclaveContainersStatus string - -// EnclaveIdentifiers defines model for EnclaveIdentifiers. -type EnclaveIdentifiers struct { - EnclaveUuid string `json:"enclave_uuid"` - Name string `json:"name"` - ShortenedUuid string `json:"shortened_uuid"` -} - -// EnclaveInfo defines model for EnclaveInfo. -type EnclaveInfo struct { - ApiContainerHostMachineInfo *EnclaveAPIContainerHostMachineInfo `json:"api_container_host_machine_info,omitempty"` - ApiContainerInfo *EnclaveAPIContainerInfo `json:"api_container_info,omitempty"` - ApiContainerStatus ApiContainerStatus `json:"api_container_status"` - ContainersStatus EnclaveContainersStatus `json:"containers_status"` - CreationTime Timestamp `json:"creation_time"` - EnclaveUuid string `json:"enclave_uuid"` - Mode EnclaveMode `json:"mode"` - Name string `json:"name"` - ShortenedUuid string `json:"shortened_uuid"` -} - -// EnclaveMode defines model for EnclaveMode. -type EnclaveMode string - -// EnclaveNameAndUuid defines model for EnclaveNameAndUuid. -type EnclaveNameAndUuid struct { - Name string `json:"name"` - Uuid string `json:"uuid"` -} - -// EnclaveTargetStatus defines model for EnclaveTargetStatus. -type EnclaveTargetStatus string - -// EngineInfo defines model for EngineInfo. -type EngineInfo struct { - EngineVersion string `json:"engine_version"` -} - -// ResponseInfo defines model for ResponseInfo. -type ResponseInfo struct { - Code uint32 `json:"code"` - Message string `json:"message"` - Type ResponseType `json:"type"` -} - -// ResponseType defines model for ResponseType. -type ResponseType string - -// Timestamp defines model for Timestamp. -type Timestamp = time.Time - -// EnclaveIdentifier defines model for enclave_identifier. -type EnclaveIdentifier = string - -// RemoveAll defines model for remove_all. -type RemoveAll = bool - -// NotOk defines model for NotOk. -type NotOk = ResponseInfo - -// DeleteEnclavesParams defines parameters for DeleteEnclaves. -type DeleteEnclavesParams struct { - // RemoveAll If true, remove all enclaves. Default is false - RemoveAll *RemoveAll `form:"remove_all,omitempty" json:"remove_all,omitempty"` -} - -// PostEnclavesJSONRequestBody defines body for PostEnclaves for application/json ContentType. -type PostEnclavesJSONRequestBody = CreateEnclave - -// PostEnclavesEnclaveIdentifierStatusJSONRequestBody defines body for PostEnclavesEnclaveIdentifierStatus for application/json ContentType. -type PostEnclavesEnclaveIdentifierStatusJSONRequestBody = EnclaveTargetStatus diff --git a/api/golang/core/kurtosis_core_rest_api_bindings/api_container_types.gen.go b/api/golang/http_rest/api_types/api_types.gen.go similarity index 64% rename from api/golang/core/kurtosis_core_rest_api_bindings/api_container_types.gen.go rename to api/golang/http_rest/api_types/api_types.gen.go index 1c8893b959..4c09c02e09 100644 --- a/api/golang/core/kurtosis_core_rest_api_bindings/api_container_types.gen.go +++ b/api/golang/http_rest/api_types/api_types.gen.go @@ -1,13 +1,28 @@ -// Package kurtosis_core_rest_api_bindings provides primitives to interact with the openapi HTTP API. +// Package api_types provides primitives to interact with the openapi HTTP API. // // Code generated by github.com/deepmap/oapi-codegen version (devel) DO NOT EDIT. -package kurtosis_core_rest_api_bindings +package api_types import ( + "bytes" + "compress/gzip" + "encoding/base64" "encoding/json" + "fmt" + "net/url" + "path" + "strings" + "time" "github.com/deepmap/oapi-codegen/pkg/runtime" - openapi_types "github.com/deepmap/oapi-codegen/pkg/types" + "github.com/getkin/kin-openapi/openapi3" +) + +// Defines values for ApiContainerStatus. +const ( + ApiContainerStatusNONEXISTENT ApiContainerStatus = "NON_EXISTENT" + ApiContainerStatusRUNNING ApiContainerStatus = "RUNNING" + ApiContainerStatusSTOPPED ApiContainerStatus = "STOPPED" ) // Defines values for Connect. @@ -23,6 +38,24 @@ const ( ContainerStatusUNKNOWN ContainerStatus = "UNKNOWN" ) +// Defines values for EnclaveContainersStatus. +const ( + EnclaveContainersStatusEMPTY EnclaveContainersStatus = "EMPTY" + EnclaveContainersStatusRUNNING EnclaveContainersStatus = "RUNNING" + EnclaveContainersStatusSTOPPED EnclaveContainersStatus = "STOPPED" +) + +// Defines values for EnclaveMode. +const ( + PRODUCTION EnclaveMode = "PRODUCTION" + TEST EnclaveMode = "TEST" +) + +// Defines values for EnclaveTargetStatus. +const ( + STOP EnclaveTargetStatus = "STOP" +) + // Defines values for HttpMethodAvailability. const ( GET HttpMethodAvailability = "GET" @@ -40,6 +73,14 @@ const ( NOINSTRUCTIONSCACHING KurtosisFeatureFlag = "NO_INSTRUCTIONS_CACHING" ) +// Defines values for LogLineOperator. +const ( + DOESCONTAINMATCHREGEX LogLineOperator = "DOES_CONTAIN_MATCH_REGEX" + DOESCONTAINTEXT LogLineOperator = "DOES_CONTAIN_TEXT" + DOESNOTCONTAINMATCHREGEX LogLineOperator = "DOES_NOT_CONTAIN_MATCH_REGEX" + DOESNOTCONTAINTEXT LogLineOperator = "DOES_NOT_CONTAIN_TEXT" +) + // Defines values for ResponseType. const ( ERROR ResponseType = "ERROR" @@ -67,6 +108,9 @@ const ( UDP TransportProtocol = "UDP" ) +// ApiContainerStatus defines model for ApiContainerStatus. +type ApiContainerStatus string + // Connect 0 - CONNECT // Best effort port forwarding // 1 - NO_CONNECT // Port forwarding disabled type Connect string @@ -89,6 +133,73 @@ type Container struct { // 2 - UNKNOWN type ContainerStatus string +// CreateEnclave defines model for CreateEnclave. +type CreateEnclave struct { + ApiContainerLogLevel *string `json:"api_container_log_level,omitempty"` + ApiContainerVersionTag *string `json:"api_container_version_tag,omitempty"` + EnclaveName *string `json:"enclave_name,omitempty"` + Mode *EnclaveMode `json:"mode,omitempty"` +} + +// DeletionSummary defines model for DeletionSummary. +type DeletionSummary struct { + RemovedEnclaveNameAndUuids *[]EnclaveNameAndUuid `json:"removed_enclave_name_and_uuids,omitempty"` +} + +// EnclaveAPIContainerHostMachineInfo defines model for EnclaveAPIContainerHostMachineInfo. +type EnclaveAPIContainerHostMachineInfo struct { + GrpcPortOnHostMachine int `json:"grpc_port_on_host_machine"` + IpOnHostMachine string `json:"ip_on_host_machine"` +} + +// EnclaveAPIContainerInfo defines model for EnclaveAPIContainerInfo. +type EnclaveAPIContainerInfo struct { + BridgeIpAddress string `json:"bridge_ip_address"` + ContainerId string `json:"container_id"` + GrpcPortInsideEnclave int `json:"grpc_port_inside_enclave"` + IpInsideEnclave string `json:"ip_inside_enclave"` +} + +// EnclaveContainersStatus defines model for EnclaveContainersStatus. +type EnclaveContainersStatus string + +// EnclaveIdentifiers defines model for EnclaveIdentifiers. +type EnclaveIdentifiers struct { + EnclaveUuid string `json:"enclave_uuid"` + Name string `json:"name"` + ShortenedUuid string `json:"shortened_uuid"` +} + +// EnclaveInfo defines model for EnclaveInfo. +type EnclaveInfo struct { + ApiContainerHostMachineInfo *EnclaveAPIContainerHostMachineInfo `json:"api_container_host_machine_info,omitempty"` + ApiContainerInfo *EnclaveAPIContainerInfo `json:"api_container_info,omitempty"` + ApiContainerStatus ApiContainerStatus `json:"api_container_status"` + ContainersStatus EnclaveContainersStatus `json:"containers_status"` + CreationTime Timestamp `json:"creation_time"` + EnclaveUuid string `json:"enclave_uuid"` + Mode EnclaveMode `json:"mode"` + Name string `json:"name"` + ShortenedUuid string `json:"shortened_uuid"` +} + +// EnclaveMode defines model for EnclaveMode. +type EnclaveMode string + +// EnclaveNameAndUuid defines model for EnclaveNameAndUuid. +type EnclaveNameAndUuid struct { + Name string `json:"name"` + Uuid string `json:"uuid"` +} + +// EnclaveTargetStatus defines model for EnclaveTargetStatus. +type EnclaveTargetStatus string + +// EngineInfo defines model for EngineInfo. +type EngineInfo struct { + EngineVersion string `json:"engine_version"` +} + // ExecCommand Exec Command type ExecCommand struct { CommandArgs []string `json:"command_args"` @@ -133,6 +244,21 @@ type ImageDownloadMode string // KurtosisFeatureFlag 0 - NO_INSTRUCTIONS_CACHING type KurtosisFeatureFlag string +// LogLine defines model for LogLine. +type LogLine struct { + Line []string `json:"line"` + Timestamp Timestamp `json:"timestamp"` +} + +// LogLineFilter defines model for LogLineFilter. +type LogLineFilter struct { + Operator LogLineOperator `json:"operator"` + TextPattern string `json:"text_pattern"` +} + +// LogLineOperator defines model for LogLineOperator. +type LogLineOperator string + // Port Shared Objects (Used By Multiple Endpoints) type Port struct { ApplicationProtocol *string `json:"application_protocol,omitempty"` @@ -269,6 +395,12 @@ type ServiceInfo struct { ShortenedUuid string `json:"shortened_uuid"` } +// ServiceLogs defines model for ServiceLogs. +type ServiceLogs struct { + NotFoundServiceUuidSet *[]string `json:"not_found_service_uuid_set,omitempty"` + ServiceLogsByServiceUuid *map[string]LogLine `json:"service_logs_by_service_uuid,omitempty"` +} + // ServiceStatus 0 - STOPPED // 1 - RUNNING // 2 - UNKNOWN @@ -406,6 +538,9 @@ type StoreWebFilesArtifact struct { Url string `json:"url"` } +// Timestamp defines model for Timestamp. +type Timestamp = time.Time + // TransportProtocol 0 - TCP // 1 - SCTP // 2 - UDP @@ -414,18 +549,27 @@ type TransportProtocol string // ArtifactIdentifier defines model for artifact_identifier. type ArtifactIdentifier = string -// EnclaveIdentifier The package identifier that will be executed +// ConjunctiveFilters defines model for conjunctive_filters. +type ConjunctiveFilters = []LogLineFilter + +// EnclaveIdentifier defines model for enclave_identifier. type EnclaveIdentifier = string // ExpectedResponse defines model for expected_response. type ExpectedResponse = string +// FollowLogs defines model for follow_logs. +type FollowLogs = bool + // HttpMethod defines model for http_method. type HttpMethod = HttpMethodAvailability // InitialDelayMilliseconds defines model for initial_delay_milliseconds. type InitialDelayMilliseconds = int32 +// NumLogLines defines model for num_log_lines. +type NumLogLines = int + // PackageId defines model for package_id. type PackageId = string @@ -435,6 +579,9 @@ type Path = string // PortNumber defines model for port_number. type PortNumber = int32 +// RemoveAll defines model for remove_all. +type RemoveAll = bool + // RequestBody defines model for request_body. type RequestBody = string @@ -444,71 +591,14 @@ type Retries = int32 // RetriesDelayMilliseconds defines model for retries_delay_milliseconds. type RetriesDelayMilliseconds = int32 +// ReturnAllLogs defines model for return_all_logs. +type ReturnAllLogs = bool + // ServiceIdentifier defines model for service_identifier. type ServiceIdentifier = string -// NotOk defines model for NotOk. -type NotOk = ResponseInfo - -// PostEnclavesEnclaveIdentifierArtifactsLocalFileMultipartBody defines parameters for PostEnclavesEnclaveIdentifierArtifactsLocalFile. -type PostEnclavesEnclaveIdentifierArtifactsLocalFileMultipartBody = openapi_types.File - -// GetEnclavesEnclaveIdentifierServicesParams defines parameters for GetEnclavesEnclaveIdentifierServices. -type GetEnclavesEnclaveIdentifierServicesParams struct { - // Services Select services to get information - Services *[]string `form:"services,omitempty" json:"services,omitempty"` -} - -// GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityParams defines parameters for GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability. -type GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityParams struct { - // HttpMethod The HTTP method used to check availability. Default is GET. - HttpMethod *HttpMethod `form:"http_method,omitempty" json:"http_method,omitempty"` - - // Path The path of the service to check. It mustn't start with the first slash. For instance `service/health` - Path *Path `form:"path,omitempty" json:"path,omitempty"` - - // InitialDelayMilliseconds The number of milliseconds to wait until executing the first HTTP call - InitialDelayMilliseconds *InitialDelayMilliseconds `form:"initial_delay_milliseconds,omitempty" json:"initial_delay_milliseconds,omitempty"` - - // Retries Max number of HTTP call attempts that this will execute until giving up and returning an error - Retries *Retries `form:"retries,omitempty" json:"retries,omitempty"` - - // RetriesDelayMilliseconds Number of milliseconds to wait between retries - RetriesDelayMilliseconds *RetriesDelayMilliseconds `form:"retries_delay_milliseconds,omitempty" json:"retries_delay_milliseconds,omitempty"` - - // ExpectedResponse If the endpoint returns this value, the service will be marked as available (e.g. Hello World). - ExpectedResponse *ExpectedResponse `form:"expected_response,omitempty" json:"expected_response,omitempty"` - - // RequestBody If the http_method is set to POST, this value will be send as the body of the availability request. - RequestBody *RequestBody `form:"request_body,omitempty" json:"request_body,omitempty"` -} - -// PostEnclavesEnclaveIdentifierStarlarkPackagesMultipartBody defines parameters for PostEnclavesEnclaveIdentifierStarlarkPackages. -type PostEnclavesEnclaveIdentifierStarlarkPackagesMultipartBody = openapi_types.File - -// PostEnclavesEnclaveIdentifierArtifactsLocalFileMultipartRequestBody defines body for PostEnclavesEnclaveIdentifierArtifactsLocalFile for multipart/form-data ContentType. -type PostEnclavesEnclaveIdentifierArtifactsLocalFileMultipartRequestBody = PostEnclavesEnclaveIdentifierArtifactsLocalFileMultipartBody - -// PostEnclavesEnclaveIdentifierArtifactsRemoteFileJSONRequestBody defines body for PostEnclavesEnclaveIdentifierArtifactsRemoteFile for application/json ContentType. -type PostEnclavesEnclaveIdentifierArtifactsRemoteFileJSONRequestBody = StoreWebFilesArtifact - -// PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierJSONRequestBody defines body for PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier for application/json ContentType. -type PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierJSONRequestBody = StoreFilesArtifactFromService - -// PostEnclavesEnclaveIdentifierServicesConnectionJSONRequestBody defines body for PostEnclavesEnclaveIdentifierServicesConnection for application/json ContentType. -type PostEnclavesEnclaveIdentifierServicesConnectionJSONRequestBody = Connect - -// PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandJSONRequestBody defines body for PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand for application/json ContentType. -type PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandJSONRequestBody = ExecCommand - -// PostEnclavesEnclaveIdentifierStarlarkPackagesMultipartRequestBody defines body for PostEnclavesEnclaveIdentifierStarlarkPackages for multipart/form-data ContentType. -type PostEnclavesEnclaveIdentifierStarlarkPackagesMultipartRequestBody = PostEnclavesEnclaveIdentifierStarlarkPackagesMultipartBody - -// PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdJSONRequestBody defines body for PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId for application/json ContentType. -type PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdJSONRequestBody = RunStarlarkPackage - -// PostEnclavesEnclaveIdentifierStarlarkScriptsJSONRequestBody defines body for PostEnclavesEnclaveIdentifierStarlarkScripts for application/json ContentType. -type PostEnclavesEnclaveIdentifierStarlarkScriptsJSONRequestBody = RunStarlarkScript +// ServiceUuidSet defines model for service_uuid_set. +type ServiceUuidSet = []string // AsStarlarkInterpretationError returns the union data inside the StarlarkError_Error as a StarlarkInterpretationError func (t StarlarkError_Error) AsStarlarkInterpretationError() (StarlarkInterpretationError, error) { @@ -789,3 +879,143 @@ func (t *StarlarkRunResponseLine) UnmarshalJSON(b []byte) error { err := t.union.UnmarshalJSON(b) return err } + +// Base64 encoded, gzipped, json marshaled Swagger object +var swaggerSpec = []string{ + + "H4sIAAAAAAAC/+w8XW/jNrZ/hdC9wLQLTWb2AxcXeUsTZ8bYiW3YzqaLZqClpWObHYrUkpQz7iL//YIU", + "KVMSJctzd9uXvrSNeHh4vnh4vtx/RSnPC86AKRld/ysqsMA5KBDmLywU2eJUJSQDpsiWgNCfM5CpIIUi", + "nEXX0XoPyAEihnNAXKCyJFkUR0QDFFjtozjSS9F1EGccCfhnSQRk0bUSJcSRTPeQY32YOhZ6m1SCsF30", + "+hpHKWc/lyxV5ADJllBHrDnrnyWI4+mwEKiPnCjIzeb/FrCNrqP/encSx7sKTL77xHefCIN7sz96jR1J", + "WAh8NBQBSyk+wKCYHh+ndzGSey4UMMhQ9TcXVmRbpPaALKKw5AKnXCY4+FpAqiBLBMiCMwldKqeOjqzg", + "hCkkQJWCSaT2RKIDpiXEBkCCOJAU0AuhFG0A5Vh8gQxhifABE4o3FNB3cLW7Qh+BUo6euKDZ91eOsZaa", + "uoQNM7LllPKXhPJdr+Z9kACyDecUMDPY9koVSQ5qz7OwdX9crxeoAkClhAwpjtI9pF8cs4QSdbxCd7DF", + "JVWISPRhsu5j1j/Op2zIBD8qVTyYLTfeiYZ6wogimCYZUHxMckIpkZBylskwM6zMNyC0wfmwmqUXTBQq", + "mSIUwVdIS0XYzih7S4RUlRRSTGkPXwOE+GxuucixMvDqz3+K6ttEmIKdvl+vccTKXGsuoYRBr4abQAEd", + "+xgLnH7BO313wlKx6+h0t5DaY1XbdyUQ6PFpHvbLbqRB00OQ2juv4C6bM7srNFUoL6VibxSSCgtNp9p7", + "upIUy/0VuucCESYVZimgf1g07/aAqdr/o0eNlrNBqrlQSWVHPcRzoZyhBe9Kjxg9vENyHGNCAnJ+gESb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==", +} + +// GetSwagger returns the content of the embedded swagger specification file +// or error if failed to decode +func decodeSpec() ([]byte, error) { + zipped, err := base64.StdEncoding.DecodeString(strings.Join(swaggerSpec, "")) + if err != nil { + return nil, fmt.Errorf("error base64 decoding spec: %s", err) + } + zr, err := gzip.NewReader(bytes.NewReader(zipped)) + if err != nil { + return nil, fmt.Errorf("error decompressing spec: %s", err) + } + var buf bytes.Buffer + _, err = buf.ReadFrom(zr) + if err != nil { + return nil, fmt.Errorf("error decompressing spec: %s", err) + } + + return buf.Bytes(), nil +} + +var rawSpec = decodeSpecCached() + +// a naive cached of a decoded swagger spec +func decodeSpecCached() func() ([]byte, error) { + data, err := decodeSpec() + return func() ([]byte, error) { + return data, err + } +} + +// Constructs a synthetic filesystem for resolving external references when loading openapi specifications. +func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error) { + var res = make(map[string]func() ([]byte, error)) + if len(pathToFile) > 0 { + res[pathToFile] = rawSpec + } + + return res +} + +// GetSwagger returns the Swagger specification corresponding to the generated code +// in this file. The external references of Swagger specification are resolved. +// The logic of resolving external references is tightly connected to "import-mapping" feature. +// Externally referenced files must be embedded in the corresponding golang packages. +// Urls can be supported but this task was out of the scope. +func GetSwagger() (swagger *openapi3.T, err error) { + var resolvePath = PathToRawSpec("") + + loader := openapi3.NewLoader() + loader.IsExternalRefsAllowed = true + loader.ReadFromURIFunc = func(loader *openapi3.Loader, url *url.URL) ([]byte, error) { + var pathToFile = url.String() + pathToFile = path.Clean(pathToFile) + getSpec, ok := resolvePath[pathToFile] + if !ok { + err1 := fmt.Errorf("path not found: %s", pathToFile) + return nil, err1 + } + return getSpec() + } + var specData []byte + specData, err = rawSpec() + if err != nil { + return + } + swagger, err = loader.LoadFromData(specData) + if err != nil { + return + } + return +} diff --git a/api/golang/core/kurtosis_core_rest_api_bindings/api_container_server.gen.go b/api/golang/http_rest/core_rest_api/api_container_server.gen.go similarity index 79% rename from api/golang/core/kurtosis_core_rest_api_bindings/api_container_server.gen.go rename to api/golang/http_rest/core_rest_api/api_container_server.gen.go index 69382d8a28..3ef2171331 100644 --- a/api/golang/core/kurtosis_core_rest_api_bindings/api_container_server.gen.go +++ b/api/golang/http_rest/core_rest_api/api_container_server.gen.go @@ -1,7 +1,7 @@ -// Package kurtosis_core_rest_api_bindings provides primitives to interact with the openapi HTTP API. +// Package core_rest_api provides primitives to interact with the openapi HTTP API. // // Code generated by github.com/deepmap/oapi-codegen version (devel) DO NOT EDIT. -package kurtosis_core_rest_api_bindings +package core_rest_api import ( "bytes" @@ -18,60 +18,125 @@ import ( "strings" "github.com/deepmap/oapi-codegen/pkg/runtime" + openapi_types "github.com/deepmap/oapi-codegen/pkg/types" "github.com/getkin/kin-openapi/openapi3" + externalRef0 "github.com/kurtosis-tech/kurtosis/api/golang/http_rest/api_types" "github.com/labstack/echo/v4" ) +// NotOk defines model for NotOk. +type NotOk = externalRef0.ResponseInfo + +// PostEnclavesEnclaveIdentifierArtifactsLocalFileMultipartBody defines parameters for PostEnclavesEnclaveIdentifierArtifactsLocalFile. +type PostEnclavesEnclaveIdentifierArtifactsLocalFileMultipartBody = openapi_types.File + +// GetEnclavesEnclaveIdentifierServicesParams defines parameters for GetEnclavesEnclaveIdentifierServices. +type GetEnclavesEnclaveIdentifierServicesParams struct { + // Services Select services to get information + Services *[]string `form:"services,omitempty" json:"services,omitempty"` +} + +// GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityParams defines parameters for GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability. +type GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityParams struct { + // HttpMethod The HTTP method used to check availability. Default is GET. + HttpMethod *externalRef0.HttpMethod `form:"http_method,omitempty" json:"http_method,omitempty"` + + // Path The path of the service to check. It mustn't start with the first slash. For instance `service/health` + Path *externalRef0.Path `form:"path,omitempty" json:"path,omitempty"` + + // InitialDelayMilliseconds The number of milliseconds to wait until executing the first HTTP call + InitialDelayMilliseconds *externalRef0.InitialDelayMilliseconds `form:"initial_delay_milliseconds,omitempty" json:"initial_delay_milliseconds,omitempty"` + + // Retries Max number of HTTP call attempts that this will execute until giving up and returning an error + Retries *externalRef0.Retries `form:"retries,omitempty" json:"retries,omitempty"` + + // RetriesDelayMilliseconds Number of milliseconds to wait between retries + RetriesDelayMilliseconds *externalRef0.RetriesDelayMilliseconds `form:"retries_delay_milliseconds,omitempty" json:"retries_delay_milliseconds,omitempty"` + + // ExpectedResponse If the endpoint returns this value, the service will be marked as available (e.g. Hello World). + ExpectedResponse *externalRef0.ExpectedResponse `form:"expected_response,omitempty" json:"expected_response,omitempty"` + + // RequestBody If the http_method is set to POST, this value will be send as the body of the availability request. + RequestBody *externalRef0.RequestBody `form:"request_body,omitempty" json:"request_body,omitempty"` +} + +// PostEnclavesEnclaveIdentifierStarlarkPackagesMultipartBody defines parameters for PostEnclavesEnclaveIdentifierStarlarkPackages. +type PostEnclavesEnclaveIdentifierStarlarkPackagesMultipartBody = openapi_types.File + +// PostEnclavesEnclaveIdentifierArtifactsLocalFileMultipartRequestBody defines body for PostEnclavesEnclaveIdentifierArtifactsLocalFile for multipart/form-data ContentType. +type PostEnclavesEnclaveIdentifierArtifactsLocalFileMultipartRequestBody = PostEnclavesEnclaveIdentifierArtifactsLocalFileMultipartBody + +// PostEnclavesEnclaveIdentifierArtifactsRemoteFileJSONRequestBody defines body for PostEnclavesEnclaveIdentifierArtifactsRemoteFile for application/json ContentType. +type PostEnclavesEnclaveIdentifierArtifactsRemoteFileJSONRequestBody = externalRef0.StoreWebFilesArtifact + +// PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierJSONRequestBody defines body for PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier for application/json ContentType. +type PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierJSONRequestBody = externalRef0.StoreFilesArtifactFromService + +// PostEnclavesEnclaveIdentifierServicesConnectionJSONRequestBody defines body for PostEnclavesEnclaveIdentifierServicesConnection for application/json ContentType. +type PostEnclavesEnclaveIdentifierServicesConnectionJSONRequestBody = externalRef0.Connect + +// PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandJSONRequestBody defines body for PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand for application/json ContentType. +type PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandJSONRequestBody = externalRef0.ExecCommand + +// PostEnclavesEnclaveIdentifierStarlarkPackagesMultipartRequestBody defines body for PostEnclavesEnclaveIdentifierStarlarkPackages for multipart/form-data ContentType. +type PostEnclavesEnclaveIdentifierStarlarkPackagesMultipartRequestBody = PostEnclavesEnclaveIdentifierStarlarkPackagesMultipartBody + +// PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdJSONRequestBody defines body for PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId for application/json ContentType. +type PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdJSONRequestBody = externalRef0.RunStarlarkPackage + +// PostEnclavesEnclaveIdentifierStarlarkScriptsJSONRequestBody defines body for PostEnclavesEnclaveIdentifierStarlarkScripts for application/json ContentType. +type PostEnclavesEnclaveIdentifierStarlarkScriptsJSONRequestBody = externalRef0.RunStarlarkScript + // ServerInterface represents all server handlers. type ServerInterface interface { // (GET /enclaves/{enclave_identifier}/artifacts) - GetEnclavesEnclaveIdentifierArtifacts(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error + GetEnclavesEnclaveIdentifierArtifacts(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier) error // (POST /enclaves/{enclave_identifier}/artifacts/local-file) - PostEnclavesEnclaveIdentifierArtifactsLocalFile(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error + PostEnclavesEnclaveIdentifierArtifactsLocalFile(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier) error // (POST /enclaves/{enclave_identifier}/artifacts/remote-file) - PostEnclavesEnclaveIdentifierArtifactsRemoteFile(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error + PostEnclavesEnclaveIdentifierArtifactsRemoteFile(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier) error // (POST /enclaves/{enclave_identifier}/artifacts/services/{service_identifier}) - PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, serviceIdentifier ServiceIdentifier) error + PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, serviceIdentifier externalRef0.ServiceIdentifier) error // (GET /enclaves/{enclave_identifier}/artifacts/{artifact_identifier}) - GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, artifactIdentifier ArtifactIdentifier) error + GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, artifactIdentifier externalRef0.ArtifactIdentifier) error // (GET /enclaves/{enclave_identifier}/artifacts/{artifact_identifier}/download) - GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownload(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, artifactIdentifier ArtifactIdentifier) error + GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownload(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, artifactIdentifier externalRef0.ArtifactIdentifier) error // (GET /enclaves/{enclave_identifier}/services) - GetEnclavesEnclaveIdentifierServices(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, params GetEnclavesEnclaveIdentifierServicesParams) error + GetEnclavesEnclaveIdentifierServices(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, params GetEnclavesEnclaveIdentifierServicesParams) error // (POST /enclaves/{enclave_identifier}/services/connection) - PostEnclavesEnclaveIdentifierServicesConnection(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error + PostEnclavesEnclaveIdentifierServicesConnection(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier) error // (GET /enclaves/{enclave_identifier}/services/history) - GetEnclavesEnclaveIdentifierServicesHistory(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error + GetEnclavesEnclaveIdentifierServicesHistory(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier) error // (GET /enclaves/{enclave_identifier}/services/{service_identifier}) - GetEnclavesEnclaveIdentifierServicesServiceIdentifier(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, serviceIdentifier ServiceIdentifier) error + GetEnclavesEnclaveIdentifierServicesServiceIdentifier(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, serviceIdentifier externalRef0.ServiceIdentifier) error // (POST /enclaves/{enclave_identifier}/services/{service_identifier}/command) - PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, serviceIdentifier ServiceIdentifier) error + PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, serviceIdentifier externalRef0.ServiceIdentifier) error // (GET /enclaves/{enclave_identifier}/services/{service_identifier}/endpoints/{port_number}/availability) - GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, serviceIdentifier ServiceIdentifier, portNumber PortNumber, params GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityParams) error + GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, serviceIdentifier externalRef0.ServiceIdentifier, portNumber externalRef0.PortNumber, params GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityParams) error // (GET /enclaves/{enclave_identifier}/starlark) - GetEnclavesEnclaveIdentifierStarlark(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error + GetEnclavesEnclaveIdentifierStarlark(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier) error // (POST /enclaves/{enclave_identifier}/starlark/packages) - PostEnclavesEnclaveIdentifierStarlarkPackages(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error + PostEnclavesEnclaveIdentifierStarlarkPackages(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier) error // (POST /enclaves/{enclave_identifier}/starlark/packages/{package_id}) - PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, packageId PackageId) error + PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, packageId externalRef0.PackageId) error // (POST /enclaves/{enclave_identifier}/starlark/scripts) - PostEnclavesEnclaveIdentifierStarlarkScripts(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error + PostEnclavesEnclaveIdentifierStarlarkScripts(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier) error } // ServerInterfaceWrapper converts echo contexts to parameters. @@ -83,7 +148,7 @@ type ServerInterfaceWrapper struct { func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierArtifacts(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- - var enclaveIdentifier EnclaveIdentifier + var enclaveIdentifier externalRef0.EnclaveIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) if err != nil { @@ -99,7 +164,7 @@ func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierArtifacts(ctx echo. func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierArtifactsLocalFile(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- - var enclaveIdentifier EnclaveIdentifier + var enclaveIdentifier externalRef0.EnclaveIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) if err != nil { @@ -115,7 +180,7 @@ func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierArtifactsLocalFile func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierArtifactsRemoteFile(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- - var enclaveIdentifier EnclaveIdentifier + var enclaveIdentifier externalRef0.EnclaveIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) if err != nil { @@ -131,7 +196,7 @@ func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierArtifactsRemoteFil func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- - var enclaveIdentifier EnclaveIdentifier + var enclaveIdentifier externalRef0.EnclaveIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) if err != nil { @@ -139,7 +204,7 @@ func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierArtifactsServicesS } // ------------- Path parameter "service_identifier" ------------- - var serviceIdentifier ServiceIdentifier + var serviceIdentifier externalRef0.ServiceIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "service_identifier", runtime.ParamLocationPath, ctx.Param("service_identifier"), &serviceIdentifier) if err != nil { @@ -155,7 +220,7 @@ func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierArtifactsServicesS func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- - var enclaveIdentifier EnclaveIdentifier + var enclaveIdentifier externalRef0.EnclaveIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) if err != nil { @@ -163,7 +228,7 @@ func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierArtifactsArtifactId } // ------------- Path parameter "artifact_identifier" ------------- - var artifactIdentifier ArtifactIdentifier + var artifactIdentifier externalRef0.ArtifactIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "artifact_identifier", runtime.ParamLocationPath, ctx.Param("artifact_identifier"), &artifactIdentifier) if err != nil { @@ -179,7 +244,7 @@ func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierArtifactsArtifactId func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownload(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- - var enclaveIdentifier EnclaveIdentifier + var enclaveIdentifier externalRef0.EnclaveIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) if err != nil { @@ -187,7 +252,7 @@ func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierArtifactsArtifactId } // ------------- Path parameter "artifact_identifier" ------------- - var artifactIdentifier ArtifactIdentifier + var artifactIdentifier externalRef0.ArtifactIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "artifact_identifier", runtime.ParamLocationPath, ctx.Param("artifact_identifier"), &artifactIdentifier) if err != nil { @@ -203,7 +268,7 @@ func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierArtifactsArtifactId func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierServices(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- - var enclaveIdentifier EnclaveIdentifier + var enclaveIdentifier externalRef0.EnclaveIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) if err != nil { @@ -228,7 +293,7 @@ func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierServices(ctx echo.C func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierServicesConnection(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- - var enclaveIdentifier EnclaveIdentifier + var enclaveIdentifier externalRef0.EnclaveIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) if err != nil { @@ -244,7 +309,7 @@ func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierServicesConnection func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierServicesHistory(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- - var enclaveIdentifier EnclaveIdentifier + var enclaveIdentifier externalRef0.EnclaveIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) if err != nil { @@ -260,7 +325,7 @@ func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierServicesHistory(ctx func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierServicesServiceIdentifier(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- - var enclaveIdentifier EnclaveIdentifier + var enclaveIdentifier externalRef0.EnclaveIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) if err != nil { @@ -268,7 +333,7 @@ func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierServicesServiceIden } // ------------- Path parameter "service_identifier" ------------- - var serviceIdentifier ServiceIdentifier + var serviceIdentifier externalRef0.ServiceIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "service_identifier", runtime.ParamLocationPath, ctx.Param("service_identifier"), &serviceIdentifier) if err != nil { @@ -284,7 +349,7 @@ func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierServicesServiceIden func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- - var enclaveIdentifier EnclaveIdentifier + var enclaveIdentifier externalRef0.EnclaveIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) if err != nil { @@ -292,7 +357,7 @@ func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierServicesServiceIde } // ------------- Path parameter "service_identifier" ------------- - var serviceIdentifier ServiceIdentifier + var serviceIdentifier externalRef0.ServiceIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "service_identifier", runtime.ParamLocationPath, ctx.Param("service_identifier"), &serviceIdentifier) if err != nil { @@ -308,7 +373,7 @@ func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierServicesServiceIde func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- - var enclaveIdentifier EnclaveIdentifier + var enclaveIdentifier externalRef0.EnclaveIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) if err != nil { @@ -316,7 +381,7 @@ func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierServicesServiceIden } // ------------- Path parameter "service_identifier" ------------- - var serviceIdentifier ServiceIdentifier + var serviceIdentifier externalRef0.ServiceIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "service_identifier", runtime.ParamLocationPath, ctx.Param("service_identifier"), &serviceIdentifier) if err != nil { @@ -324,7 +389,7 @@ func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierServicesServiceIden } // ------------- Path parameter "port_number" ------------- - var portNumber PortNumber + var portNumber externalRef0.PortNumber err = runtime.BindStyledParameterWithLocation("simple", false, "port_number", runtime.ParamLocationPath, ctx.Param("port_number"), &portNumber) if err != nil { @@ -391,7 +456,7 @@ func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierServicesServiceIden func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierStarlark(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- - var enclaveIdentifier EnclaveIdentifier + var enclaveIdentifier externalRef0.EnclaveIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) if err != nil { @@ -407,7 +472,7 @@ func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierStarlark(ctx echo.C func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierStarlarkPackages(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- - var enclaveIdentifier EnclaveIdentifier + var enclaveIdentifier externalRef0.EnclaveIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) if err != nil { @@ -423,7 +488,7 @@ func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierStarlarkPackages(c func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- - var enclaveIdentifier EnclaveIdentifier + var enclaveIdentifier externalRef0.EnclaveIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) if err != nil { @@ -431,7 +496,7 @@ func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierStarlarkPackagesPa } // ------------- Path parameter "package_id" ------------- - var packageId PackageId + var packageId externalRef0.PackageId err = runtime.BindStyledParameterWithLocation("simple", false, "package_id", runtime.ParamLocationPath, ctx.Param("package_id"), &packageId) if err != nil { @@ -447,7 +512,7 @@ func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierStarlarkPackagesPa func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- - var enclaveIdentifier EnclaveIdentifier + var enclaveIdentifier externalRef0.EnclaveIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) if err != nil { @@ -506,17 +571,17 @@ func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL } -type NotOkJSONResponse ResponseInfo +type NotOkJSONResponse externalRef0.ResponseInfo type GetEnclavesEnclaveIdentifierArtifactsRequestObject struct { - EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` + EnclaveIdentifier externalRef0.EnclaveIdentifier `json:"enclave_identifier"` } type GetEnclavesEnclaveIdentifierArtifactsResponseObject interface { VisitGetEnclavesEnclaveIdentifierArtifactsResponse(w http.ResponseWriter) error } -type GetEnclavesEnclaveIdentifierArtifacts200JSONResponse []FileArtifactReference +type GetEnclavesEnclaveIdentifierArtifacts200JSONResponse []externalRef0.FileArtifactReference func (response GetEnclavesEnclaveIdentifierArtifacts200JSONResponse) VisitGetEnclavesEnclaveIdentifierArtifactsResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -526,7 +591,7 @@ func (response GetEnclavesEnclaveIdentifierArtifacts200JSONResponse) VisitGetEnc } type GetEnclavesEnclaveIdentifierArtifactsdefaultJSONResponse struct { - Body ResponseInfo + Body externalRef0.ResponseInfo StatusCode int } @@ -538,7 +603,7 @@ func (response GetEnclavesEnclaveIdentifierArtifactsdefaultJSONResponse) VisitGe } type PostEnclavesEnclaveIdentifierArtifactsLocalFileRequestObject struct { - EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` + EnclaveIdentifier externalRef0.EnclaveIdentifier `json:"enclave_identifier"` Body *multipart.Reader } @@ -546,7 +611,7 @@ type PostEnclavesEnclaveIdentifierArtifactsLocalFileResponseObject interface { VisitPostEnclavesEnclaveIdentifierArtifactsLocalFileResponse(w http.ResponseWriter) error } -type PostEnclavesEnclaveIdentifierArtifactsLocalFile200JSONResponse map[string]FileArtifactReference +type PostEnclavesEnclaveIdentifierArtifactsLocalFile200JSONResponse map[string]externalRef0.FileArtifactReference func (response PostEnclavesEnclaveIdentifierArtifactsLocalFile200JSONResponse) VisitPostEnclavesEnclaveIdentifierArtifactsLocalFileResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -556,7 +621,7 @@ func (response PostEnclavesEnclaveIdentifierArtifactsLocalFile200JSONResponse) V } type PostEnclavesEnclaveIdentifierArtifactsLocalFiledefaultJSONResponse struct { - Body ResponseInfo + Body externalRef0.ResponseInfo StatusCode int } @@ -568,7 +633,7 @@ func (response PostEnclavesEnclaveIdentifierArtifactsLocalFiledefaultJSONRespons } type PostEnclavesEnclaveIdentifierArtifactsRemoteFileRequestObject struct { - EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` + EnclaveIdentifier externalRef0.EnclaveIdentifier `json:"enclave_identifier"` Body *PostEnclavesEnclaveIdentifierArtifactsRemoteFileJSONRequestBody } @@ -576,7 +641,7 @@ type PostEnclavesEnclaveIdentifierArtifactsRemoteFileResponseObject interface { VisitPostEnclavesEnclaveIdentifierArtifactsRemoteFileResponse(w http.ResponseWriter) error } -type PostEnclavesEnclaveIdentifierArtifactsRemoteFile200JSONResponse FileArtifactReference +type PostEnclavesEnclaveIdentifierArtifactsRemoteFile200JSONResponse externalRef0.FileArtifactReference func (response PostEnclavesEnclaveIdentifierArtifactsRemoteFile200JSONResponse) VisitPostEnclavesEnclaveIdentifierArtifactsRemoteFileResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -586,7 +651,7 @@ func (response PostEnclavesEnclaveIdentifierArtifactsRemoteFile200JSONResponse) } type PostEnclavesEnclaveIdentifierArtifactsRemoteFiledefaultJSONResponse struct { - Body ResponseInfo + Body externalRef0.ResponseInfo StatusCode int } @@ -598,8 +663,8 @@ func (response PostEnclavesEnclaveIdentifierArtifactsRemoteFiledefaultJSONRespon } type PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierRequestObject struct { - EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` - ServiceIdentifier ServiceIdentifier `json:"service_identifier"` + EnclaveIdentifier externalRef0.EnclaveIdentifier `json:"enclave_identifier"` + ServiceIdentifier externalRef0.ServiceIdentifier `json:"service_identifier"` Body *PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierJSONRequestBody } @@ -607,7 +672,7 @@ type PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierResponseObje VisitPostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierResponse(w http.ResponseWriter) error } -type PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier200JSONResponse FileArtifactReference +type PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier200JSONResponse externalRef0.FileArtifactReference func (response PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier200JSONResponse) VisitPostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -617,7 +682,7 @@ func (response PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier20 } type PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierdefaultJSONResponse struct { - Body ResponseInfo + Body externalRef0.ResponseInfo StatusCode int } @@ -629,15 +694,15 @@ func (response PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierde } type GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierRequestObject struct { - EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` - ArtifactIdentifier ArtifactIdentifier `json:"artifact_identifier"` + EnclaveIdentifier externalRef0.EnclaveIdentifier `json:"enclave_identifier"` + ArtifactIdentifier externalRef0.ArtifactIdentifier `json:"artifact_identifier"` } type GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierResponseObject interface { VisitGetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierResponse(w http.ResponseWriter) error } -type GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier200JSONResponse []FileArtifactDescription +type GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier200JSONResponse []externalRef0.FileArtifactDescription func (response GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier200JSONResponse) VisitGetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -647,7 +712,7 @@ func (response GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier200JSONRes } type GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierdefaultJSONResponse struct { - Body ResponseInfo + Body externalRef0.ResponseInfo StatusCode int } @@ -659,8 +724,8 @@ func (response GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierdefaultJSO } type GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownloadRequestObject struct { - EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` - ArtifactIdentifier ArtifactIdentifier `json:"artifact_identifier"` + EnclaveIdentifier externalRef0.EnclaveIdentifier `json:"enclave_identifier"` + ArtifactIdentifier externalRef0.ArtifactIdentifier `json:"artifact_identifier"` } type GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownloadResponseObject interface { @@ -687,7 +752,7 @@ func (response GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownload20 } type GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownloaddefaultJSONResponse struct { - Body ResponseInfo + Body externalRef0.ResponseInfo StatusCode int } @@ -699,7 +764,7 @@ func (response GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownloadde } type GetEnclavesEnclaveIdentifierServicesRequestObject struct { - EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` + EnclaveIdentifier externalRef0.EnclaveIdentifier `json:"enclave_identifier"` Params GetEnclavesEnclaveIdentifierServicesParams } @@ -707,7 +772,7 @@ type GetEnclavesEnclaveIdentifierServicesResponseObject interface { VisitGetEnclavesEnclaveIdentifierServicesResponse(w http.ResponseWriter) error } -type GetEnclavesEnclaveIdentifierServices200JSONResponse map[string]ServiceInfo +type GetEnclavesEnclaveIdentifierServices200JSONResponse map[string]externalRef0.ServiceInfo func (response GetEnclavesEnclaveIdentifierServices200JSONResponse) VisitGetEnclavesEnclaveIdentifierServicesResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -717,7 +782,7 @@ func (response GetEnclavesEnclaveIdentifierServices200JSONResponse) VisitGetEncl } type GetEnclavesEnclaveIdentifierServicesdefaultJSONResponse struct { - Body ResponseInfo + Body externalRef0.ResponseInfo StatusCode int } @@ -729,7 +794,7 @@ func (response GetEnclavesEnclaveIdentifierServicesdefaultJSONResponse) VisitGet } type PostEnclavesEnclaveIdentifierServicesConnectionRequestObject struct { - EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` + EnclaveIdentifier externalRef0.EnclaveIdentifier `json:"enclave_identifier"` Body *PostEnclavesEnclaveIdentifierServicesConnectionJSONRequestBody } @@ -746,7 +811,7 @@ func (response PostEnclavesEnclaveIdentifierServicesConnection200Response) Visit } type PostEnclavesEnclaveIdentifierServicesConnectiondefaultJSONResponse struct { - Body ResponseInfo + Body externalRef0.ResponseInfo StatusCode int } @@ -758,14 +823,14 @@ func (response PostEnclavesEnclaveIdentifierServicesConnectiondefaultJSONRespons } type GetEnclavesEnclaveIdentifierServicesHistoryRequestObject struct { - EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` + EnclaveIdentifier externalRef0.EnclaveIdentifier `json:"enclave_identifier"` } type GetEnclavesEnclaveIdentifierServicesHistoryResponseObject interface { VisitGetEnclavesEnclaveIdentifierServicesHistoryResponse(w http.ResponseWriter) error } -type GetEnclavesEnclaveIdentifierServicesHistory200JSONResponse []ServiceIdentifiers +type GetEnclavesEnclaveIdentifierServicesHistory200JSONResponse []externalRef0.ServiceIdentifiers func (response GetEnclavesEnclaveIdentifierServicesHistory200JSONResponse) VisitGetEnclavesEnclaveIdentifierServicesHistoryResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -775,7 +840,7 @@ func (response GetEnclavesEnclaveIdentifierServicesHistory200JSONResponse) Visit } type GetEnclavesEnclaveIdentifierServicesHistorydefaultJSONResponse struct { - Body ResponseInfo + Body externalRef0.ResponseInfo StatusCode int } @@ -787,15 +852,15 @@ func (response GetEnclavesEnclaveIdentifierServicesHistorydefaultJSONResponse) V } type GetEnclavesEnclaveIdentifierServicesServiceIdentifierRequestObject struct { - EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` - ServiceIdentifier ServiceIdentifier `json:"service_identifier"` + EnclaveIdentifier externalRef0.EnclaveIdentifier `json:"enclave_identifier"` + ServiceIdentifier externalRef0.ServiceIdentifier `json:"service_identifier"` } type GetEnclavesEnclaveIdentifierServicesServiceIdentifierResponseObject interface { VisitGetEnclavesEnclaveIdentifierServicesServiceIdentifierResponse(w http.ResponseWriter) error } -type GetEnclavesEnclaveIdentifierServicesServiceIdentifier200JSONResponse ServiceInfo +type GetEnclavesEnclaveIdentifierServicesServiceIdentifier200JSONResponse externalRef0.ServiceInfo func (response GetEnclavesEnclaveIdentifierServicesServiceIdentifier200JSONResponse) VisitGetEnclavesEnclaveIdentifierServicesServiceIdentifierResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -805,7 +870,7 @@ func (response GetEnclavesEnclaveIdentifierServicesServiceIdentifier200JSONRespo } type GetEnclavesEnclaveIdentifierServicesServiceIdentifierdefaultJSONResponse struct { - Body ResponseInfo + Body externalRef0.ResponseInfo StatusCode int } @@ -817,8 +882,8 @@ func (response GetEnclavesEnclaveIdentifierServicesServiceIdentifierdefaultJSONR } type PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandRequestObject struct { - EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` - ServiceIdentifier ServiceIdentifier `json:"service_identifier"` + EnclaveIdentifier externalRef0.EnclaveIdentifier `json:"enclave_identifier"` + ServiceIdentifier externalRef0.ServiceIdentifier `json:"service_identifier"` Body *PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandJSONRequestBody } @@ -826,7 +891,7 @@ type PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandResponseObject VisitPostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandResponse(w http.ResponseWriter) error } -type PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand200JSONResponse ExecCommandResult +type PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand200JSONResponse externalRef0.ExecCommandResult func (response PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand200JSONResponse) VisitPostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -836,7 +901,7 @@ func (response PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand200J } type PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommanddefaultJSONResponse struct { - Body ResponseInfo + Body externalRef0.ResponseInfo StatusCode int } @@ -848,9 +913,9 @@ func (response PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommanddefa } type GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityRequestObject struct { - EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` - ServiceIdentifier ServiceIdentifier `json:"service_identifier"` - PortNumber PortNumber `json:"port_number"` + EnclaveIdentifier externalRef0.EnclaveIdentifier `json:"enclave_identifier"` + ServiceIdentifier externalRef0.ServiceIdentifier `json:"service_identifier"` + PortNumber externalRef0.PortNumber `json:"port_number"` Params GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityParams } @@ -867,14 +932,14 @@ func (response GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPor } type GetEnclavesEnclaveIdentifierStarlarkRequestObject struct { - EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` + EnclaveIdentifier externalRef0.EnclaveIdentifier `json:"enclave_identifier"` } type GetEnclavesEnclaveIdentifierStarlarkResponseObject interface { VisitGetEnclavesEnclaveIdentifierStarlarkResponse(w http.ResponseWriter) error } -type GetEnclavesEnclaveIdentifierStarlark200JSONResponse StarlarkDescription +type GetEnclavesEnclaveIdentifierStarlark200JSONResponse externalRef0.StarlarkDescription func (response GetEnclavesEnclaveIdentifierStarlark200JSONResponse) VisitGetEnclavesEnclaveIdentifierStarlarkResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -884,7 +949,7 @@ func (response GetEnclavesEnclaveIdentifierStarlark200JSONResponse) VisitGetEncl } type GetEnclavesEnclaveIdentifierStarlarkdefaultJSONResponse struct { - Body ResponseInfo + Body externalRef0.ResponseInfo StatusCode int } @@ -896,7 +961,7 @@ func (response GetEnclavesEnclaveIdentifierStarlarkdefaultJSONResponse) VisitGet } type PostEnclavesEnclaveIdentifierStarlarkPackagesRequestObject struct { - EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` + EnclaveIdentifier externalRef0.EnclaveIdentifier `json:"enclave_identifier"` Body *multipart.Reader } @@ -913,7 +978,7 @@ func (response PostEnclavesEnclaveIdentifierStarlarkPackages200Response) VisitPo } type PostEnclavesEnclaveIdentifierStarlarkPackagesdefaultJSONResponse struct { - Body ResponseInfo + Body externalRef0.ResponseInfo StatusCode int } @@ -925,8 +990,8 @@ func (response PostEnclavesEnclaveIdentifierStarlarkPackagesdefaultJSONResponse) } type PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdRequestObject struct { - EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` - PackageId PackageId `json:"package_id"` + EnclaveIdentifier externalRef0.EnclaveIdentifier `json:"enclave_identifier"` + PackageId externalRef0.PackageId `json:"package_id"` Body *PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdJSONRequestBody } @@ -934,7 +999,7 @@ type PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdResponseObject interf VisitPostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdResponse(w http.ResponseWriter) error } -type PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId200JSONResponse []StarlarkRunResponseLine +type PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId200JSONResponse []externalRef0.StarlarkRunResponseLine func (response PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId200JSONResponse) VisitPostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -963,7 +1028,7 @@ func (response PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId200Applicat } type PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIddefaultJSONResponse struct { - Body ResponseInfo + Body externalRef0.ResponseInfo StatusCode int } @@ -975,7 +1040,7 @@ func (response PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIddefaultJSON } type PostEnclavesEnclaveIdentifierStarlarkScriptsRequestObject struct { - EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` + EnclaveIdentifier externalRef0.EnclaveIdentifier `json:"enclave_identifier"` Body *PostEnclavesEnclaveIdentifierStarlarkScriptsJSONRequestBody } @@ -983,7 +1048,7 @@ type PostEnclavesEnclaveIdentifierStarlarkScriptsResponseObject interface { VisitPostEnclavesEnclaveIdentifierStarlarkScriptsResponse(w http.ResponseWriter) error } -type PostEnclavesEnclaveIdentifierStarlarkScripts200JSONResponse []StarlarkRunResponseLine +type PostEnclavesEnclaveIdentifierStarlarkScripts200JSONResponse []externalRef0.StarlarkRunResponseLine func (response PostEnclavesEnclaveIdentifierStarlarkScripts200JSONResponse) VisitPostEnclavesEnclaveIdentifierStarlarkScriptsResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -1012,7 +1077,7 @@ func (response PostEnclavesEnclaveIdentifierStarlarkScripts200ApplicationoctetSt } type PostEnclavesEnclaveIdentifierStarlarkScriptsdefaultJSONResponse struct { - Body ResponseInfo + Body externalRef0.ResponseInfo StatusCode int } @@ -1089,7 +1154,7 @@ type strictHandler struct { } // GetEnclavesEnclaveIdentifierArtifacts operation middleware -func (sh *strictHandler) GetEnclavesEnclaveIdentifierArtifacts(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error { +func (sh *strictHandler) GetEnclavesEnclaveIdentifierArtifacts(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier) error { var request GetEnclavesEnclaveIdentifierArtifactsRequestObject request.EnclaveIdentifier = enclaveIdentifier @@ -1114,7 +1179,7 @@ func (sh *strictHandler) GetEnclavesEnclaveIdentifierArtifacts(ctx echo.Context, } // PostEnclavesEnclaveIdentifierArtifactsLocalFile operation middleware -func (sh *strictHandler) PostEnclavesEnclaveIdentifierArtifactsLocalFile(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error { +func (sh *strictHandler) PostEnclavesEnclaveIdentifierArtifactsLocalFile(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier) error { var request PostEnclavesEnclaveIdentifierArtifactsLocalFileRequestObject request.EnclaveIdentifier = enclaveIdentifier @@ -1145,7 +1210,7 @@ func (sh *strictHandler) PostEnclavesEnclaveIdentifierArtifactsLocalFile(ctx ech } // PostEnclavesEnclaveIdentifierArtifactsRemoteFile operation middleware -func (sh *strictHandler) PostEnclavesEnclaveIdentifierArtifactsRemoteFile(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error { +func (sh *strictHandler) PostEnclavesEnclaveIdentifierArtifactsRemoteFile(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier) error { var request PostEnclavesEnclaveIdentifierArtifactsRemoteFileRequestObject request.EnclaveIdentifier = enclaveIdentifier @@ -1176,7 +1241,7 @@ func (sh *strictHandler) PostEnclavesEnclaveIdentifierArtifactsRemoteFile(ctx ec } // PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier operation middleware -func (sh *strictHandler) PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, serviceIdentifier ServiceIdentifier) error { +func (sh *strictHandler) PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, serviceIdentifier externalRef0.ServiceIdentifier) error { var request PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierRequestObject request.EnclaveIdentifier = enclaveIdentifier @@ -1208,7 +1273,7 @@ func (sh *strictHandler) PostEnclavesEnclaveIdentifierArtifactsServicesServiceId } // GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier operation middleware -func (sh *strictHandler) GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, artifactIdentifier ArtifactIdentifier) error { +func (sh *strictHandler) GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, artifactIdentifier externalRef0.ArtifactIdentifier) error { var request GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierRequestObject request.EnclaveIdentifier = enclaveIdentifier @@ -1234,7 +1299,7 @@ func (sh *strictHandler) GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier } // GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownload operation middleware -func (sh *strictHandler) GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownload(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, artifactIdentifier ArtifactIdentifier) error { +func (sh *strictHandler) GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownload(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, artifactIdentifier externalRef0.ArtifactIdentifier) error { var request GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownloadRequestObject request.EnclaveIdentifier = enclaveIdentifier @@ -1260,7 +1325,7 @@ func (sh *strictHandler) GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier } // GetEnclavesEnclaveIdentifierServices operation middleware -func (sh *strictHandler) GetEnclavesEnclaveIdentifierServices(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, params GetEnclavesEnclaveIdentifierServicesParams) error { +func (sh *strictHandler) GetEnclavesEnclaveIdentifierServices(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, params GetEnclavesEnclaveIdentifierServicesParams) error { var request GetEnclavesEnclaveIdentifierServicesRequestObject request.EnclaveIdentifier = enclaveIdentifier @@ -1286,7 +1351,7 @@ func (sh *strictHandler) GetEnclavesEnclaveIdentifierServices(ctx echo.Context, } // PostEnclavesEnclaveIdentifierServicesConnection operation middleware -func (sh *strictHandler) PostEnclavesEnclaveIdentifierServicesConnection(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error { +func (sh *strictHandler) PostEnclavesEnclaveIdentifierServicesConnection(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier) error { var request PostEnclavesEnclaveIdentifierServicesConnectionRequestObject request.EnclaveIdentifier = enclaveIdentifier @@ -1317,7 +1382,7 @@ func (sh *strictHandler) PostEnclavesEnclaveIdentifierServicesConnection(ctx ech } // GetEnclavesEnclaveIdentifierServicesHistory operation middleware -func (sh *strictHandler) GetEnclavesEnclaveIdentifierServicesHistory(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error { +func (sh *strictHandler) GetEnclavesEnclaveIdentifierServicesHistory(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier) error { var request GetEnclavesEnclaveIdentifierServicesHistoryRequestObject request.EnclaveIdentifier = enclaveIdentifier @@ -1342,7 +1407,7 @@ func (sh *strictHandler) GetEnclavesEnclaveIdentifierServicesHistory(ctx echo.Co } // GetEnclavesEnclaveIdentifierServicesServiceIdentifier operation middleware -func (sh *strictHandler) GetEnclavesEnclaveIdentifierServicesServiceIdentifier(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, serviceIdentifier ServiceIdentifier) error { +func (sh *strictHandler) GetEnclavesEnclaveIdentifierServicesServiceIdentifier(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, serviceIdentifier externalRef0.ServiceIdentifier) error { var request GetEnclavesEnclaveIdentifierServicesServiceIdentifierRequestObject request.EnclaveIdentifier = enclaveIdentifier @@ -1368,7 +1433,7 @@ func (sh *strictHandler) GetEnclavesEnclaveIdentifierServicesServiceIdentifier(c } // PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand operation middleware -func (sh *strictHandler) PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, serviceIdentifier ServiceIdentifier) error { +func (sh *strictHandler) PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, serviceIdentifier externalRef0.ServiceIdentifier) error { var request PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandRequestObject request.EnclaveIdentifier = enclaveIdentifier @@ -1400,7 +1465,7 @@ func (sh *strictHandler) PostEnclavesEnclaveIdentifierServicesServiceIdentifierC } // GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability operation middleware -func (sh *strictHandler) GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, serviceIdentifier ServiceIdentifier, portNumber PortNumber, params GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityParams) error { +func (sh *strictHandler) GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, serviceIdentifier externalRef0.ServiceIdentifier, portNumber externalRef0.PortNumber, params GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityParams) error { var request GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityRequestObject request.EnclaveIdentifier = enclaveIdentifier @@ -1428,7 +1493,7 @@ func (sh *strictHandler) GetEnclavesEnclaveIdentifierServicesServiceIdentifierEn } // GetEnclavesEnclaveIdentifierStarlark operation middleware -func (sh *strictHandler) GetEnclavesEnclaveIdentifierStarlark(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error { +func (sh *strictHandler) GetEnclavesEnclaveIdentifierStarlark(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier) error { var request GetEnclavesEnclaveIdentifierStarlarkRequestObject request.EnclaveIdentifier = enclaveIdentifier @@ -1453,7 +1518,7 @@ func (sh *strictHandler) GetEnclavesEnclaveIdentifierStarlark(ctx echo.Context, } // PostEnclavesEnclaveIdentifierStarlarkPackages operation middleware -func (sh *strictHandler) PostEnclavesEnclaveIdentifierStarlarkPackages(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error { +func (sh *strictHandler) PostEnclavesEnclaveIdentifierStarlarkPackages(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier) error { var request PostEnclavesEnclaveIdentifierStarlarkPackagesRequestObject request.EnclaveIdentifier = enclaveIdentifier @@ -1484,7 +1549,7 @@ func (sh *strictHandler) PostEnclavesEnclaveIdentifierStarlarkPackages(ctx echo. } // PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId operation middleware -func (sh *strictHandler) PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, packageId PackageId) error { +func (sh *strictHandler) PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, packageId externalRef0.PackageId) error { var request PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdRequestObject request.EnclaveIdentifier = enclaveIdentifier @@ -1516,7 +1581,7 @@ func (sh *strictHandler) PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId( } // PostEnclavesEnclaveIdentifierStarlarkScripts operation middleware -func (sh *strictHandler) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error { +func (sh *strictHandler) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier) error { var request PostEnclavesEnclaveIdentifierStarlarkScriptsRequestObject request.EnclaveIdentifier = enclaveIdentifier @@ -1549,73 +1614,60 @@ func (sh *strictHandler) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx echo.C // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/+w8e2/bOJ5fhdAd0JmFG3e7i8Uh/6Vp0hrbOkbsbO4wKbS09LPNKUVqSSqpp8h3P/Bl", - "UxYly2naZGfnn2nGIvl7P/n4mmS8KDkDpmRy/DUpscAFKBDm/7BQZIEzlZIcmCILAkL/nIPMBCkV4Sw5", - "TmYrQH4gYrgAxAWqKpIng4ToASVWq2SQ6E/JcXTNQSLgXxURkCfHSlQwSGS2ggJrYGpd6mlSCcKWyf39", - "IAGWUXwLO0hFQEUGdkFqklXi7DNeAtougNQKK3RHKEVzQPAFskqBpjSC5pcSMgV5KkCWnElowhgtkFoB", - "ApaXnDCFBKhKMInUikh0i2kFAzNAgrglGWzgFlh8hhxhifAtJhTPKaCf4Gh5hN4DpRxdc0Hzn4+8AP5V", - "gVgHbGkg1s3vlVJlWoBa8TzOpvez2QTZAaiSkCPFUbaC7LNHj1Ci1kfoLSxwRRUiEr07m7WhF4ILEftv", - "AYvkOPmv4VZjh/arHL5XqvxoppwEEA32hBFFME1zoHidFoRSIiHjLJdxYlhVzEEgvkDhWE3SHSYKVUwR", - "6gRP2NKIZ0GEVJYLGaa0ha4OREIyF1wUWJnx6i+vt5pFmIIlCEOT08uU5N+stxGzCVY/zDDNMi0IqZVm", - "aajMXkmO0EihopKKvVBIKiw0nmoVcFZSLFdH6JwLRJhUmGWA/umWGa4AU7X6ZwvTHWWdWHOhUiv1FuS5", - "UF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Tr5yDilYLDWYtPV2MAK0bV5", - "hQJtz65M61OmjgMVcFCj3QLXF95ffHYt4hFsWcY0uGtE7F20KYQtmq5ObcDtkktLTRC0R3u1C0219S38", - "LgW5xQpSUqY4z1s2A0YTpD+ClLv7d4FDdxvtXUB0zdTZbe2i2dSzsfhQVnNKsnYKJuZ7SMSfeKU03n8K", - "EUd3KxBQp04iAThb4TmFGza+mJ0do2u/far9v+8obSewFwqJijHClvVt+5zk+lsOC8K0Ga1N710OkPMd", - "c5x9BpajnINZRFalac4L0P/opN3SGbB+waPMtuz4Prz2et+vq+2U3fe0f5B1Tx/TsnftY1eZ22y/wapB", - "YN0djuHp+vE+eHU2hn9IdhLPKiKZQHgAYl+i0CMV6E7GI2mxqXXTctPM2NODCTof9dC/zUFi8fDQBKF2", - "dKM5Pwa5zq1OTkTF05a2NpgU1XyneGdmU7Opcv5nzuBikRz/ssfnuNVGTIEoBSjT5rNr3w/6zf0HpiR/", - "wLwz3wVx0z419mrM751MqC8RMUD3PYUOdqXtHcMYRpvhTcwam0118F2kxHMc0vKrVKLK4k5HT+lPUW30", - "XoJCwD0GL/gekjvIwGJZFf6MZS9/GVn2xC0S3c82wtHJSrrDz4ZbCb63O1giU/mZlCWEDjYoVUsuiYdw", - "IBkTP7XhvPyHCI6DgIWt1NbQ7imrDVNjMuvkj4BSgNReT7vLOJsCd6uXM0XuQWXedlYMZk8aJ4GwdqsO", - "WhWsZ4zUMaCVIZQwOOQ0m6d1s6hbYuBx6klb2+58qEGiZUzA5/jw3mKKTD/E/bTPCWluBrUI1eGgp4kT", - "URy6KLus2DlhRK4gP7uNmqKodAZih6QQH6Oto2KprLIMpFxUdK9Fbg9j7IkqjZVjy+zlS4SIPVyZCL7U", - "RWvkkIb7ksZDalYJAUylUkG5GdL/cFRt+mEbulzngHqefIgzaOJdXzKO2l7O17m1h+l+p/ODc2g7BaZv", - "822SNXS5PUV/aJq6DV2908yDktJQh/rOafrWA6DV7bjvxGtszuwegOKC6wx7K7fdrL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X10L1J7YxS4Oy4asiHHvujr56RHqgPDU6Wll/+tM", + "KrX3bH3bO14+ShCNvjZu2e6XAXlovWq2fcKpu7+EPDxLeXR9FkQqLpa9EeDMPcgKzA3hOa9towduiDSH", + "Xpf14eEPPyO7GkkxRYH17e9J3jqq/jItoMg5/pPKBHZWQnd2+k+uJPlKpUDLNz9ZVY7T5oFB3DnbUyGw", + "9e2CXAFbv2BxtwSwPxlvSt+7Oe0ONIL3DX+vojV82hEBx8bjjoerX7sPOp4wdP0jYDm+DV4Orsath4Z9", + "ceol5eln9yKuQbZ5S9d5XLx+Mjxa37QmujAWvF4UCNtZXhSj+/CJx561KRfKvop70X4++VgGsXtW+Ipz", + "wPDw8fKQ1bEqhozb8nZ4wGz/wnD40Dtu1H1ZPmjL4A1pXxCL2uxAs3OH0r3G8wYUoliq5makqNl+yPdb", + "PIWMbcgBfatn86g+0RE0dhdS5JBjuc0brAfooiASSQWVvQ1nA4x/9hE+Ekkxa71RNS/NI49x9ov47cny", + "iR/m9djSAyl4fNvcPVoNSNQCddvviNtXAbUE8UyiORSY5l+mMPdz8lC5WXD76mvlZBFMf4XTg2HVYc/d", + "rdiD3b9DM9Ej3m4vHxnj546KJ9w46r6d+Qeq9wHV1eq/AQAA//+FfH4X30kAAA==", } // GetSwagger returns the content of the embedded swagger specification file @@ -1655,6 +1707,14 @@ func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error) { res[pathToFile] = rawSpec } + pathPrefix := path.Dir(pathToFile) + + for rawPath, rawFunc := range externalRef0.PathToRawSpec(path.Join(pathPrefix, "./api_types.yaml")) { + if _, ok := res[rawPath]; ok { + // it is not possible to compare functions in golang, so always overwrite the old value + } + res[rawPath] = rawFunc + } return res } diff --git a/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_server.gen.go b/api/golang/http_rest/engine_rest_api/engine_server.gen.go similarity index 85% rename from api/golang/engine/kurtosis_engine_rest_api_bindings/engine_server.gen.go rename to api/golang/http_rest/engine_rest_api/engine_server.gen.go index 696e31e5c8..f10c17b9c2 100644 --- a/api/golang/engine/kurtosis_engine_rest_api_bindings/engine_server.gen.go +++ b/api/golang/http_rest/engine_rest_api/engine_server.gen.go @@ -1,7 +1,7 @@ -// Package kurtosis_engine_rest_api_bindings provides primitives to interact with the openapi HTTP API. +// Package engine_rest_api provides primitives to interact with the openapi HTTP API. // // Code generated by github.com/deepmap/oapi-codegen version (devel) DO NOT EDIT. -package kurtosis_engine_rest_api_bindings +package engine_rest_api import ( "bytes" @@ -17,9 +17,25 @@ import ( "github.com/deepmap/oapi-codegen/pkg/runtime" "github.com/getkin/kin-openapi/openapi3" + externalRef0 "github.com/kurtosis-tech/kurtosis/api/golang/http_rest/api_types" "github.com/labstack/echo/v4" ) +// NotOk defines model for NotOk. +type NotOk = externalRef0.ResponseInfo + +// DeleteEnclavesParams defines parameters for DeleteEnclaves. +type DeleteEnclavesParams struct { + // RemoveAll If true, remove all enclaves. Default is false + RemoveAll *externalRef0.RemoveAll `form:"remove_all,omitempty" json:"remove_all,omitempty"` +} + +// PostEnclavesJSONRequestBody defines body for PostEnclaves for application/json ContentType. +type PostEnclavesJSONRequestBody = externalRef0.CreateEnclave + +// PostEnclavesEnclaveIdentifierStatusJSONRequestBody defines body for PostEnclavesEnclaveIdentifierStatus for application/json ContentType. +type PostEnclavesEnclaveIdentifierStatusJSONRequestBody = externalRef0.EnclaveTargetStatus + // ServerInterface represents all server handlers. type ServerInterface interface { // Delete Enclaves @@ -36,16 +52,16 @@ type ServerInterface interface { GetEnclavesHistorical(ctx echo.Context) error // Destroy Enclave // (DELETE /enclaves/{enclave_identifier}) - DeleteEnclavesEnclaveIdentifier(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error + DeleteEnclavesEnclaveIdentifier(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier) error // Get Enclave Info // (GET /enclaves/{enclave_identifier}) - GetEnclavesEnclaveIdentifier(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error + GetEnclavesEnclaveIdentifier(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier) error // Get enclave status // (GET /enclaves/{enclave_identifier}/status) - GetEnclavesEnclaveIdentifierStatus(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error + GetEnclavesEnclaveIdentifierStatus(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier) error // Set enclave status // (POST /enclaves/{enclave_identifier}/status) - PostEnclavesEnclaveIdentifierStatus(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error + PostEnclavesEnclaveIdentifierStatus(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier) error // Get Engine Info // (GET /engine/info) GetEngineInfo(ctx echo.Context) error @@ -105,7 +121,7 @@ func (w *ServerInterfaceWrapper) GetEnclavesHistorical(ctx echo.Context) error { func (w *ServerInterfaceWrapper) DeleteEnclavesEnclaveIdentifier(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- - var enclaveIdentifier EnclaveIdentifier + var enclaveIdentifier externalRef0.EnclaveIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) if err != nil { @@ -121,7 +137,7 @@ func (w *ServerInterfaceWrapper) DeleteEnclavesEnclaveIdentifier(ctx echo.Contex func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifier(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- - var enclaveIdentifier EnclaveIdentifier + var enclaveIdentifier externalRef0.EnclaveIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) if err != nil { @@ -137,7 +153,7 @@ func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifier(ctx echo.Context) func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierStatus(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- - var enclaveIdentifier EnclaveIdentifier + var enclaveIdentifier externalRef0.EnclaveIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) if err != nil { @@ -153,7 +169,7 @@ func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierStatus(ctx echo.Con func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierStatus(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- - var enclaveIdentifier EnclaveIdentifier + var enclaveIdentifier externalRef0.EnclaveIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) if err != nil { @@ -214,7 +230,7 @@ func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL } -type NotOkJSONResponse ResponseInfo +type NotOkJSONResponse externalRef0.ResponseInfo type DeleteEnclavesRequestObject struct { Params DeleteEnclavesParams @@ -224,7 +240,7 @@ type DeleteEnclavesResponseObject interface { VisitDeleteEnclavesResponse(w http.ResponseWriter) error } -type DeleteEnclaves200JSONResponse DeletionSummary +type DeleteEnclaves200JSONResponse externalRef0.DeletionSummary func (response DeleteEnclaves200JSONResponse) VisitDeleteEnclavesResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -234,7 +250,7 @@ func (response DeleteEnclaves200JSONResponse) VisitDeleteEnclavesResponse(w http } type DeleteEnclavesdefaultJSONResponse struct { - Body ResponseInfo + Body externalRef0.ResponseInfo StatusCode int } @@ -252,7 +268,7 @@ type GetEnclavesResponseObject interface { VisitGetEnclavesResponse(w http.ResponseWriter) error } -type GetEnclaves200JSONResponse map[string]EnclaveInfo +type GetEnclaves200JSONResponse map[string]externalRef0.EnclaveInfo func (response GetEnclaves200JSONResponse) VisitGetEnclavesResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -262,7 +278,7 @@ func (response GetEnclaves200JSONResponse) VisitGetEnclavesResponse(w http.Respo } type GetEnclavesdefaultJSONResponse struct { - Body ResponseInfo + Body externalRef0.ResponseInfo StatusCode int } @@ -281,7 +297,7 @@ type PostEnclavesResponseObject interface { VisitPostEnclavesResponse(w http.ResponseWriter) error } -type PostEnclaves200JSONResponse EnclaveInfo +type PostEnclaves200JSONResponse externalRef0.EnclaveInfo func (response PostEnclaves200JSONResponse) VisitPostEnclavesResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -291,7 +307,7 @@ func (response PostEnclaves200JSONResponse) VisitPostEnclavesResponse(w http.Res } type PostEnclavesdefaultJSONResponse struct { - Body ResponseInfo + Body externalRef0.ResponseInfo StatusCode int } @@ -309,7 +325,7 @@ type GetEnclavesHistoricalResponseObject interface { VisitGetEnclavesHistoricalResponse(w http.ResponseWriter) error } -type GetEnclavesHistorical200JSONResponse []EnclaveIdentifiers +type GetEnclavesHistorical200JSONResponse []externalRef0.EnclaveIdentifiers func (response GetEnclavesHistorical200JSONResponse) VisitGetEnclavesHistoricalResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -319,7 +335,7 @@ func (response GetEnclavesHistorical200JSONResponse) VisitGetEnclavesHistoricalR } type GetEnclavesHistoricaldefaultJSONResponse struct { - Body ResponseInfo + Body externalRef0.ResponseInfo StatusCode int } @@ -331,7 +347,7 @@ func (response GetEnclavesHistoricaldefaultJSONResponse) VisitGetEnclavesHistori } type DeleteEnclavesEnclaveIdentifierRequestObject struct { - EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` + EnclaveIdentifier externalRef0.EnclaveIdentifier `json:"enclave_identifier"` } type DeleteEnclavesEnclaveIdentifierResponseObject interface { @@ -347,7 +363,7 @@ func (response DeleteEnclavesEnclaveIdentifier200Response) VisitDeleteEnclavesEn } type DeleteEnclavesEnclaveIdentifierdefaultJSONResponse struct { - Body ResponseInfo + Body externalRef0.ResponseInfo StatusCode int } @@ -359,14 +375,14 @@ func (response DeleteEnclavesEnclaveIdentifierdefaultJSONResponse) VisitDeleteEn } type GetEnclavesEnclaveIdentifierRequestObject struct { - EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` + EnclaveIdentifier externalRef0.EnclaveIdentifier `json:"enclave_identifier"` } type GetEnclavesEnclaveIdentifierResponseObject interface { VisitGetEnclavesEnclaveIdentifierResponse(w http.ResponseWriter) error } -type GetEnclavesEnclaveIdentifier200JSONResponse EnclaveInfo +type GetEnclavesEnclaveIdentifier200JSONResponse externalRef0.EnclaveInfo func (response GetEnclavesEnclaveIdentifier200JSONResponse) VisitGetEnclavesEnclaveIdentifierResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -376,7 +392,7 @@ func (response GetEnclavesEnclaveIdentifier200JSONResponse) VisitGetEnclavesEncl } type GetEnclavesEnclaveIdentifierdefaultJSONResponse struct { - Body ResponseInfo + Body externalRef0.ResponseInfo StatusCode int } @@ -388,14 +404,14 @@ func (response GetEnclavesEnclaveIdentifierdefaultJSONResponse) VisitGetEnclaves } type GetEnclavesEnclaveIdentifierStatusRequestObject struct { - EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` + EnclaveIdentifier externalRef0.EnclaveIdentifier `json:"enclave_identifier"` } type GetEnclavesEnclaveIdentifierStatusResponseObject interface { VisitGetEnclavesEnclaveIdentifierStatusResponse(w http.ResponseWriter) error } -type GetEnclavesEnclaveIdentifierStatus200JSONResponse EnclaveContainersStatus +type GetEnclavesEnclaveIdentifierStatus200JSONResponse externalRef0.EnclaveContainersStatus func (response GetEnclavesEnclaveIdentifierStatus200JSONResponse) VisitGetEnclavesEnclaveIdentifierStatusResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -405,7 +421,7 @@ func (response GetEnclavesEnclaveIdentifierStatus200JSONResponse) VisitGetEnclav } type GetEnclavesEnclaveIdentifierStatusdefaultJSONResponse struct { - Body ResponseInfo + Body externalRef0.ResponseInfo StatusCode int } @@ -417,7 +433,7 @@ func (response GetEnclavesEnclaveIdentifierStatusdefaultJSONResponse) VisitGetEn } type PostEnclavesEnclaveIdentifierStatusRequestObject struct { - EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` + EnclaveIdentifier externalRef0.EnclaveIdentifier `json:"enclave_identifier"` Body *PostEnclavesEnclaveIdentifierStatusJSONRequestBody } @@ -434,7 +450,7 @@ func (response PostEnclavesEnclaveIdentifierStatus200Response) VisitPostEnclaves } type PostEnclavesEnclaveIdentifierStatusdefaultJSONResponse struct { - Body ResponseInfo + Body externalRef0.ResponseInfo StatusCode int } @@ -452,7 +468,7 @@ type GetEngineInfoResponseObject interface { VisitGetEngineInfoResponse(w http.ResponseWriter) error } -type GetEngineInfo200JSONResponse EngineInfo +type GetEngineInfo200JSONResponse externalRef0.EngineInfo func (response GetEngineInfo200JSONResponse) VisitGetEngineInfoResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -462,7 +478,7 @@ func (response GetEngineInfo200JSONResponse) VisitGetEngineInfoResponse(w http.R } type GetEngineInfodefaultJSONResponse struct { - Body ResponseInfo + Body externalRef0.ResponseInfo StatusCode int } @@ -618,7 +634,7 @@ func (sh *strictHandler) GetEnclavesHistorical(ctx echo.Context) error { } // DeleteEnclavesEnclaveIdentifier operation middleware -func (sh *strictHandler) DeleteEnclavesEnclaveIdentifier(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error { +func (sh *strictHandler) DeleteEnclavesEnclaveIdentifier(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier) error { var request DeleteEnclavesEnclaveIdentifierRequestObject request.EnclaveIdentifier = enclaveIdentifier @@ -643,7 +659,7 @@ func (sh *strictHandler) DeleteEnclavesEnclaveIdentifier(ctx echo.Context, encla } // GetEnclavesEnclaveIdentifier operation middleware -func (sh *strictHandler) GetEnclavesEnclaveIdentifier(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error { +func (sh *strictHandler) GetEnclavesEnclaveIdentifier(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier) error { var request GetEnclavesEnclaveIdentifierRequestObject request.EnclaveIdentifier = enclaveIdentifier @@ -668,7 +684,7 @@ func (sh *strictHandler) GetEnclavesEnclaveIdentifier(ctx echo.Context, enclaveI } // GetEnclavesEnclaveIdentifierStatus operation middleware -func (sh *strictHandler) GetEnclavesEnclaveIdentifierStatus(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error { +func (sh *strictHandler) GetEnclavesEnclaveIdentifierStatus(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier) error { var request GetEnclavesEnclaveIdentifierStatusRequestObject request.EnclaveIdentifier = enclaveIdentifier @@ -693,7 +709,7 @@ func (sh *strictHandler) GetEnclavesEnclaveIdentifierStatus(ctx echo.Context, en } // PostEnclavesEnclaveIdentifierStatus operation middleware -func (sh *strictHandler) PostEnclavesEnclaveIdentifierStatus(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error { +func (sh *strictHandler) PostEnclavesEnclaveIdentifierStatus(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier) error { var request PostEnclavesEnclaveIdentifierStatusRequestObject request.EnclaveIdentifier = enclaveIdentifier @@ -749,27 +765,24 @@ func (sh *strictHandler) GetEngineInfo(ctx echo.Context) error { // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/9RYXW/qOBP+K9G872W2sOfccddt2R4uCghS7a6qKnLjAXw2sVPbqRZV/PeVE+eLOJDu", - "aZHOHeDxfDzzzHiGN4hEkgqOXCuYvEFKJElQo8y/IY9i8ooho8g12zCU5leKKpIs1UxwmMDDw+zW99RO", - "SI0cqVd8F9LjJEFPbDy9Q88qAh+YuZMSvQMfjARMXFZ8kPiSMYkUJlpm6IOKdpgQY17vU3NLacn4Fg4H", - "I5uIVwxJHHfdm228XIFXCHkkjktv1JV3ixuSxdpjytuQWFUOvmQo97WHDQMOT56FiJFwOBS+qFRwhTl+", - "c6EXf5sP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PiQn+rQPVF3dD8b2nusN0pjKlsAT", + "rN00o+dhq33X7NNjyh/Y+9IcXBqjgHHdu7XSGSeYQyEkffwArSMhCTeoXZ/RGL7x9616cNz1dW9t9ytx", + "DroYQZXZuCB7riEoCUrtuwpRdrlcQAAtdjC7+OtiZpNTOUqeC5jDx4vZxQwCpz9c/WEjBSrhkCK5MixE", + "bgoWCcyri6W5N4073omkR3/RnUnYEw/l055A+DCbvZs82L//PAphVcQxGrMuUtakAc7IqaCpAG3GYaVn", + "nKxoLtkaHdbCUwawQRqjeIPUg/CXUOBJIuwrni4H03zEBmq2tGesTg/VDdIAp1wZD1BLZYZIPRdo6G+V", + "7N5tVIZKsByS0crl8oRzOujEeYCv6mVdwUHH/HArDCktYu6k7qHZ/dxZ/yJGbxGbfY03FptnG96u+N4c", + "D8B8HX/Mlcfv1lG1b162nm/JqaV7jtVoSKtdN3eHV+NZEfhd6dzbo6yOe2gGw05Bv7kFq0Yb/haNGKv/", + "8zWlLpmZ9rvj8BV3crjf//r0Sf/jL9HTt2LlaUXFECuUw0Y/TxOh/UI56bi2Uc66Nty3QhO2/D8AAP//", + "ZD3EVgAVAAA=", } // GetSwagger returns the content of the embedded swagger specification file @@ -809,6 +822,14 @@ func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error) { res[pathToFile] = rawSpec } + pathPrefix := path.Dir(pathToFile) + + for rawPath, rawFunc := range externalRef0.PathToRawSpec(path.Join(pathPrefix, "./api_types.yaml")) { + if _, ok := res[rawPath]; ok { + // it is not possible to compare functions in golang, so always overwrite the old value + } + res[rawPath] = rawFunc + } return res } diff --git a/api/golang/websocket/kurtosis_websocket_api_bindings/websocket_server.gen.go b/api/golang/http_rest/websocket_api/websocket_server.gen.go similarity index 68% rename from api/golang/websocket/kurtosis_websocket_api_bindings/websocket_server.gen.go rename to api/golang/http_rest/websocket_api/websocket_server.gen.go index 12d2fe8446..a488333d55 100644 --- a/api/golang/websocket/kurtosis_websocket_api_bindings/websocket_server.gen.go +++ b/api/golang/http_rest/websocket_api/websocket_server.gen.go @@ -1,7 +1,7 @@ -// Package kurtosis_websocket_api_bindings provides primitives to interact with the openapi HTTP API. +// Package websocket_api provides primitives to interact with the openapi HTTP API. // // Code generated by github.com/deepmap/oapi-codegen version (devel) DO NOT EDIT. -package kurtosis_websocket_api_bindings +package websocket_api import ( "bytes" @@ -15,17 +15,35 @@ import ( "github.com/deepmap/oapi-codegen/pkg/runtime" "github.com/getkin/kin-openapi/openapi3" + externalRef0 "github.com/kurtosis-tech/kurtosis/api/golang/http_rest/api_types" "github.com/labstack/echo/v4" ) +// GetEnclavesEnclaveIdentifierLogsParams defines parameters for GetEnclavesEnclaveIdentifierLogs. +type GetEnclavesEnclaveIdentifierLogsParams struct { + ServiceUuidSet externalRef0.ServiceUuidSet `form:"service_uuid_set" json:"service_uuid_set"` + FollowLogs *externalRef0.FollowLogs `form:"follow_logs,omitempty" json:"follow_logs,omitempty"` + ConjunctiveFilters *externalRef0.ConjunctiveFilters `form:"conjunctive_filters,omitempty" json:"conjunctive_filters,omitempty"` + ReturnAllLogs *externalRef0.ReturnAllLogs `form:"return_all_logs,omitempty" json:"return_all_logs,omitempty"` + NumLogLines *externalRef0.NumLogLines `form:"num_log_lines,omitempty" json:"num_log_lines,omitempty"` +} + +// GetEnclavesEnclaveIdentifierServicesServiceIdentifierLogsParams defines parameters for GetEnclavesEnclaveIdentifierServicesServiceIdentifierLogs. +type GetEnclavesEnclaveIdentifierServicesServiceIdentifierLogsParams struct { + FollowLogs *externalRef0.FollowLogs `form:"follow_logs,omitempty" json:"follow_logs,omitempty"` + ConjunctiveFilters *externalRef0.ConjunctiveFilters `form:"conjunctive_filters,omitempty" json:"conjunctive_filters,omitempty"` + ReturnAllLogs *externalRef0.ReturnAllLogs `form:"return_all_logs,omitempty" json:"return_all_logs,omitempty"` + NumLogLines *externalRef0.NumLogLines `form:"num_log_lines,omitempty" json:"num_log_lines,omitempty"` +} + // ServerInterface represents all server handlers. type ServerInterface interface { // Get Service Logs // (GET /enclaves/{enclave_identifier}/logs) - GetEnclavesEnclaveIdentifierLogs(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, params GetEnclavesEnclaveIdentifierLogsParams) error + GetEnclavesEnclaveIdentifierLogs(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, params GetEnclavesEnclaveIdentifierLogsParams) error // Get Service Logs - // (GET /enclaves/{enclave_identifier}/services/{service_uuid}/logs) - GetEnclavesEnclaveIdentifierServicesServiceUuidLogs(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, serviceUuid ServiceUuid, params GetEnclavesEnclaveIdentifierServicesServiceUuidLogsParams) error + // (GET /enclaves/{enclave_identifier}/services/{service_identifier}/logs) + GetEnclavesEnclaveIdentifierServicesServiceIdentifierLogs(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, serviceIdentifier externalRef0.ServiceIdentifier, params GetEnclavesEnclaveIdentifierServicesServiceIdentifierLogsParams) error } // ServerInterfaceWrapper converts echo contexts to parameters. @@ -37,7 +55,7 @@ type ServerInterfaceWrapper struct { func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierLogs(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- - var enclaveIdentifier EnclaveIdentifier + var enclaveIdentifier externalRef0.EnclaveIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) if err != nil { @@ -86,27 +104,27 @@ func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierLogs(ctx echo.Conte return err } -// GetEnclavesEnclaveIdentifierServicesServiceUuidLogs converts echo context to params. -func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierServicesServiceUuidLogs(ctx echo.Context) error { +// GetEnclavesEnclaveIdentifierServicesServiceIdentifierLogs converts echo context to params. +func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierServicesServiceIdentifierLogs(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- - var enclaveIdentifier EnclaveIdentifier + var enclaveIdentifier externalRef0.EnclaveIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter enclave_identifier: %s", err)) } - // ------------- Path parameter "service_uuid" ------------- - var serviceUuid ServiceUuid + // ------------- Path parameter "service_identifier" ------------- + var serviceIdentifier externalRef0.ServiceIdentifier - err = runtime.BindStyledParameterWithLocation("simple", false, "service_uuid", runtime.ParamLocationPath, ctx.Param("service_uuid"), &serviceUuid) + err = runtime.BindStyledParameterWithLocation("simple", false, "service_identifier", runtime.ParamLocationPath, ctx.Param("service_identifier"), &serviceIdentifier) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter service_uuid: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter service_identifier: %s", err)) } // Parameter object where we will unmarshal all parameters from the context - var params GetEnclavesEnclaveIdentifierServicesServiceUuidLogsParams + var params GetEnclavesEnclaveIdentifierServicesServiceIdentifierLogsParams // ------------- Optional query parameter "follow_logs" ------------- err = runtime.BindQueryParameter("form", true, false, "follow_logs", ctx.QueryParams(), ¶ms.FollowLogs) @@ -136,7 +154,7 @@ func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierServicesServiceUuid } // Invoke the callback with all the unmarshalled arguments - err = w.Handler.GetEnclavesEnclaveIdentifierServicesServiceUuidLogs(ctx, enclaveIdentifier, serviceUuid, params) + err = w.Handler.GetEnclavesEnclaveIdentifierServicesServiceIdentifierLogs(ctx, enclaveIdentifier, serviceIdentifier, params) return err } @@ -169,26 +187,24 @@ func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL } router.GET(baseURL+"/enclaves/:enclave_identifier/logs", wrapper.GetEnclavesEnclaveIdentifierLogs) - router.GET(baseURL+"/enclaves/:enclave_identifier/services/:service_uuid/logs", wrapper.GetEnclavesEnclaveIdentifierServicesServiceUuidLogs) + router.GET(baseURL+"/enclaves/:enclave_identifier/services/:service_identifier/logs", wrapper.GetEnclavesEnclaveIdentifierServicesServiceIdentifierLogs) } // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/+xWUW+jOBD+K2juHrmQu3vjrWpzvUjZptqm2kpVhRwYEnfBpvaQ3Sjiv69sQwIJTVjt", - "Q1/2iWBmvvlm5ptxdhDLvJACBWkId1AwxXIkVPYtluK1FDHxDUYpz5pjLiCEtxLVFnwQLEcIe0190PEa", - "c2Z9CHPr/KfCFEL4IzgEDpyZDmZyNeMC/7P+UPlA28KAM6XYFqrKBxRxxjYY8QQF8ZSjMpgJ6ljxgrg0", - "zB4fpze+p9dSEQpMPPculWeoejL1aI1eDQS+y6ZgtD4k0xPFB4VvJVeYQEiqxHZuNUtNiouVpZnKLJPf", - "okyu3i1Y26QHbCllhkxYNFHmxi7KuMB38bpGPYhcEK5MWSuTC5VKRCzLznI8NrvAU6Pa8BijsuTJHrJb", - "2Y7Jz9W07RpppPdIn9idC7OX5VG8E+lVjZe1roVqJ0bJAhVx15msPh2K6wPxHDWxvLg0HIu9oetgk9Kz", - "C9pGetmHkctXjMnE6c7WCXHzm5FUA0d03pibDPA7RQUjQiX6W9cmuw905HiG87zFDUWZG5ib+eQhup7f", - "La6md9Fi8rQA353dzRe9583Zp6vF9f/R58nt5KnPpf35QOnQvgenrlk9Nd0iCklRKkthdNcj1sGaaLzN", - "0EXLbXQ8WCxJuFl2LLvvxB/QuFa4ps5VT+UXbVWmUuWMIISEEf5lZAYnlTEoXKTS5scpM9++4FLL+CuS", - "d3U/BR82qLRb0ePR36OxiSMLFKzgEMK/o/FoDL7dFzaZoN7COtid7uMqaPbWyhXXyYpLMU0ghFukSe1d", - "P6d715nbZO2b7rm/dAeToOdGqPyLXicqGODTvhcGmPfduwPcjjf7AJfuBVO9mLHWhRTaae+f8bj+y0Ao", - "bEtYUWQ8tk0JXrW0u+Gwec9ptT1kVlndC/6hjGPUOi0zr6Hgbogyz5nauv57NYhXo/iXBFU3Swe7dtt+", - "QWg1AV0/H0uefJD2fuvu43RXVT8CAAD//zaixr1kCwAA", + "H4sIAAAAAAAC/+xVTYvbMBD9K0Lt0cRpe/Ot0A8COSxslx5KMYo8TrSVR15plDYE//ciWdk4iTfrpZRe", + "ejJ2Zt68mfdmsufSNK1BQHK82PNWWNEAgY1v0uC9R0lqC2Wt9OGzQl7wBw92xzOOogFejIZm3MkNNCLm", + "EDQx+bWFmhf8VX4snPdhLl+a9VIhfIr5vMs47doALqwVO951GQeUWmyhVBUgqVqBDZgVOGlVS8oEZnd3", + "iw8ZcxtjCRAq1r8bywJVZmpGG2AJiGd9N62gzbGZkSoZt/DglYWKF2Q9DHtLLB1ZhetIszZam5+lNusn", + "BzYMGQFbGaNBYERD34S4UiuEJ/FOg0YQFRKsw1i70At5i6XQ+irH87BneDqwWyWvi/NlAyzFsWPcQRVp", + "kIRCsIw2gtKnphFYBT29rtgKGPwC6QkqpnBcvhEeL5PvAOC9qkoH9NR8LuKulXncgLN6Fy7vDlkx+rav", + "sUwytda0YEn1RkBDZW08huojlCdWPDYcVC5XuxO0ACCqSgUBhb45qT9hmQflzOoeJMUJn3/pgpC1iWQV", + "6fDbV1g5I38Asfc3C57xLVjXe2g+ezObB1zTAopW8YK/m81nc55FI0Rmedphl+8vt7nLD65f95MKPYnQ", + "4KLiBf8M9DFlp+fiMXXZ78HwTn4bn8MxJB+5J132bNaFpBNyhldlQvjY1Z6Qdn4XJqScnqfue9gU1xp0", + "vZHezufpD4cAoySibbWSUZT83gXd94Nluma84cZEZ51eoFsvJThXe80OFPql900j7K7XnyUQllCy5wyV", + "xHL5/vL6/IHdEg2Xnv/Uhy/L+u/Ev+PErvsdAAD//xARwii0CQAA", } // GetSwagger returns the content of the embedded swagger specification file @@ -228,6 +244,14 @@ func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error) { res[pathToFile] = rawSpec } + pathPrefix := path.Dir(pathToFile) + + for rawPath, rawFunc := range externalRef0.PathToRawSpec(path.Join(pathPrefix, "./api_types.yaml")) { + if _, ok := res[rawPath]; ok { + // it is not possible to compare functions in golang, so always overwrite the old value + } + res[rawPath] = rawFunc + } return res } diff --git a/api/golang/websocket/kurtosis_websocket_api_bindings/websocket_types.gen.go b/api/golang/websocket/kurtosis_websocket_api_bindings/websocket_types.gen.go deleted file mode 100644 index 1fe2468af6..0000000000 --- a/api/golang/websocket/kurtosis_websocket_api_bindings/websocket_types.gen.go +++ /dev/null @@ -1,78 +0,0 @@ -// Package kurtosis_websocket_api_bindings provides primitives to interact with the openapi HTTP API. -// -// Code generated by github.com/deepmap/oapi-codegen version (devel) DO NOT EDIT. -package kurtosis_websocket_api_bindings - -import ( - "time" -) - -// Defines values for LogLineOperator. -const ( - DOESCONTAINMATCHREGEX LogLineOperator = "DOES_CONTAIN_MATCH_REGEX" - DOESCONTAINTEXT LogLineOperator = "DOES_CONTAIN_TEXT" - DOESNOTCONTAINMATCHREGEX LogLineOperator = "DOES_NOT_CONTAIN_MATCH_REGEX" - DOESNOTCONTAINTEXT LogLineOperator = "DOES_NOT_CONTAIN_TEXT" -) - -// LogLine defines model for LogLine. -type LogLine struct { - Line []string `json:"line"` - Timestamp Timestamp `json:"timestamp"` -} - -// LogLineFilter defines model for LogLineFilter. -type LogLineFilter struct { - Operator LogLineOperator `json:"operator"` - TextPattern string `json:"text_pattern"` -} - -// LogLineOperator defines model for LogLineOperator. -type LogLineOperator string - -// ServiceLogs defines model for ServiceLogs. -type ServiceLogs struct { - NotFoundServiceUuidSet *[]string `json:"not_found_service_uuid_set,omitempty"` - ServiceLogsByServiceUuid *map[string]LogLine `json:"service_logs_by_service_uuid,omitempty"` -} - -// Timestamp defines model for Timestamp. -type Timestamp = time.Time - -// ConjunctiveFilters defines model for conjunctive_filters. -type ConjunctiveFilters = []LogLineFilter - -// EnclaveIdentifier defines model for enclave_identifier. -type EnclaveIdentifier = string - -// FollowLogs defines model for follow_logs. -type FollowLogs = bool - -// NumLogLines defines model for num_log_lines. -type NumLogLines = int - -// ReturnAllLogs defines model for return_all_logs. -type ReturnAllLogs = bool - -// ServiceUuid defines model for service_uuid. -type ServiceUuid = string - -// ServiceUuidSet defines model for service_uuid_set. -type ServiceUuidSet = []string - -// GetEnclavesEnclaveIdentifierLogsParams defines parameters for GetEnclavesEnclaveIdentifierLogs. -type GetEnclavesEnclaveIdentifierLogsParams struct { - ServiceUuidSet ServiceUuidSet `form:"service_uuid_set" json:"service_uuid_set"` - FollowLogs *FollowLogs `form:"follow_logs,omitempty" json:"follow_logs,omitempty"` - ConjunctiveFilters *ConjunctiveFilters `form:"conjunctive_filters,omitempty" json:"conjunctive_filters,omitempty"` - ReturnAllLogs *ReturnAllLogs `form:"return_all_logs,omitempty" json:"return_all_logs,omitempty"` - NumLogLines *NumLogLines `form:"num_log_lines,omitempty" json:"num_log_lines,omitempty"` -} - -// GetEnclavesEnclaveIdentifierServicesServiceUuidLogsParams defines parameters for GetEnclavesEnclaveIdentifierServicesServiceUuidLogs. -type GetEnclavesEnclaveIdentifierServicesServiceUuidLogsParams struct { - FollowLogs *FollowLogs `form:"follow_logs,omitempty" json:"follow_logs,omitempty"` - ConjunctiveFilters *ConjunctiveFilters `form:"conjunctive_filters,omitempty" json:"conjunctive_filters,omitempty"` - ReturnAllLogs *ReturnAllLogs `form:"return_all_logs,omitempty" json:"return_all_logs,omitempty"` - NumLogLines *NumLogLines `form:"num_log_lines,omitempty" json:"num_log_lines,omitempty"` -} diff --git a/api/openapi/core/server.cfg.yaml b/api/openapi/core/server.cfg.yaml deleted file mode 100644 index a7f63cab68..0000000000 --- a/api/openapi/core/server.cfg.yaml +++ /dev/null @@ -1,6 +0,0 @@ -package: kurtosis_core_rest_api_bindings -generate: - embedded-spec: true - echo-server: true - strict-server: true -output: api/golang/core/kurtosis_core_rest_api_bindings/api_container_server.gen.go \ No newline at end of file diff --git a/api/openapi/core/types.cfg.yaml b/api/openapi/core/types.cfg.yaml deleted file mode 100644 index bd0c20d926..0000000000 --- a/api/openapi/core/types.cfg.yaml +++ /dev/null @@ -1,4 +0,0 @@ -package: kurtosis_core_rest_api_bindings -generate: - models: true -output: api/golang/core/kurtosis_core_rest_api_bindings/api_container_types.gen.go \ No newline at end of file diff --git a/api/openapi/engine/engine_service.yaml b/api/openapi/engine/engine_service.yaml deleted file mode 100644 index 96d8c586c4..0000000000 --- a/api/openapi/engine/engine_service.yaml +++ /dev/null @@ -1,337 +0,0 @@ -openapi: 3.0.0 - -info: - title: Engine API - version: 0.1.0 - -paths: - /engine/info: - get: - summary: Get Engine Info - responses: - default: - $ref: '#/components/responses/NotOk' - '200': - description: Successful response - content: - application/json: - schema: - $ref: '#/components/schemas/EngineInfo' - - /enclaves: - get: - summary: Get Enclaves - responses: - default: - $ref: '#/components/responses/NotOk' - '200': - description: Successful response - content: - application/json: - schema: - type: object - additionalProperties: - $ref: '#/components/schemas/EnclaveInfo' - - post: - summary: Create Enclave - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/CreateEnclave' - responses: - - default: - $ref: '#/components/responses/NotOk' - '200': - description: Successful response - content: - application/json: - schema: - $ref: '#/components/schemas/EnclaveInfo' - - delete: - summary: Delete Enclaves - parameters: - - $ref: '#/components/parameters/remove_all' - responses: - default: - $ref: '#/components/responses/NotOk' - '200': - description: Successful response - content: - application/json: - schema: - $ref: '#/components/schemas/DeletionSummary' - - /enclaves/historical: - get: - summary: Get Historical Enclaves - responses: - default: - $ref: '#/components/responses/NotOk' - '200': - description: Successful response - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/EnclaveIdentifiers' - - /enclaves/{enclave_identifier}: - get: - summary: Get Enclave Info - parameters: - - $ref: '#/components/parameters/enclave_identifier' - responses: - default: - $ref: '#/components/responses/NotOk' - '200': - description: Successful response - content: - application/json: - schema: - $ref: '#/components/schemas/EnclaveInfo' - - delete: - summary: Destroy Enclave - parameters: - - $ref: '#/components/parameters/enclave_identifier' - responses: - default: - $ref: '#/components/responses/NotOk' - '200': - description: Successful response - - /enclaves/{enclave_identifier}/status: - get: - summary: Get enclave status - parameters: - - $ref: '#/components/parameters/enclave_identifier' - responses: - default: - $ref: '#/components/responses/NotOk' - '200': - description: Successful response - content: - application/json: - schema: - $ref: '#/components/schemas/EnclaveContainersStatus' - post: - summary: Set enclave status - parameters: - - $ref: '#/components/parameters/enclave_identifier' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/EnclaveTargetStatus' - responses: - default: - $ref: '#/components/responses/NotOk' - '200': - description: Successful response - -# ========================================================================================================================= -# ========================================================================================================================= -# > > > > > > > > > > > > > > > > > > > > > > > > Data Models < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < -# ========================================================================================================================= -# ========================================================================================================================= - -components: - - responses: - - NotOk: - description: Unexpected error - content: - application/json: - schema: - $ref: '#/components/schemas/ResponseInfo' - required: true - - parameters: - - enclave_identifier: - name: enclave_identifier - in: path - required: true - description: UUID, shortened UUID, or name of the enclave - schema: - type: string - - remove_all: - name: remove_all - in: query - required: false - description: If true, remove all enclaves. Default is false - schema: - type: boolean - - schemas: - - ResponseType: - type: string - enum: - - ERROR - - INFO - - WARNING - - ResponseInfo: - type: object - properties: - type: - $ref: '#/components/schemas/ResponseType' - message: - type: string - code: - type: integer - format: uint32 - required: - - type - - message - - code - - EngineInfo: - type: object - properties: - engine_version: - type: string - required: - - engine_version - - CreateEnclave: - type: object - properties: - enclave_name: - type: string - api_container_version_tag: - type: string - api_container_log_level: - type: string - mode: - $ref: '#/components/schemas/EnclaveMode' - - EnclaveMode: - type: string - enum: - - TEST - - PRODUCTION - - EnclaveContainersStatus: - type: string - enum: - - RUNNING - - STOPPED - - EMPTY - - EnclaveTargetStatus: - type: string - enum: - - STOP - - ApiContainerStatus: - type: string - enum: - - RUNNING - - STOPPED - - NON_EXISTENT - - EnclaveInfo: - type: object - properties: - enclave_uuid: - type: string - name: - type: string - shortened_uuid: - type: string - containers_status: - $ref: '#/components/schemas/EnclaveContainersStatus' - api_container_status: - $ref: '#/components/schemas/ApiContainerStatus' - api_container_info: - $ref: '#/components/schemas/EnclaveAPIContainerInfo' - api_container_host_machine_info: - $ref: '#/components/schemas/EnclaveAPIContainerHostMachineInfo' - creation_time: - $ref: '#/components/schemas/Timestamp' - mode: - $ref: '#/components/schemas/EnclaveMode' - required: - - enclave_uuid - - name - - shortened_uuid - - containers_status - - api_container_status - - creation_time - - mode - - EnclaveAPIContainerInfo: - type: object - properties: - container_id: - type: string - ip_inside_enclave: - type: string - grpc_port_inside_enclave: - type: integer - bridge_ip_address: - type: string - required: - - container_id - - ip_inside_enclave - - grpc_port_inside_enclave - - bridge_ip_address - - EnclaveAPIContainerHostMachineInfo: - type: object - properties: - ip_on_host_machine: - type: string - grpc_port_on_host_machine: - type: integer - required: - - ip_on_host_machine - - grpc_port_on_host_machine - - EnclaveIdentifiers: - type: object - properties: - enclave_uuid: - type: string - name: - type: string - shortened_uuid: - type: string - required: - - enclave_uuid - - name - - shortened_uuid - - EnclaveNameAndUuid: - type: object - properties: - name: - type: string - uuid: - type: string - required: - - name - - uuid - - DeletionSummary: - type: object - properties: - removed_enclave_name_and_uuids: - type: array - items: - $ref: '#/components/schemas/EnclaveNameAndUuid' - - Timestamp: - type: string - format: date-time \ No newline at end of file diff --git a/api/openapi/engine/server.cfg.yaml b/api/openapi/engine/server.cfg.yaml deleted file mode 100644 index 96a9e3afba..0000000000 --- a/api/openapi/engine/server.cfg.yaml +++ /dev/null @@ -1,6 +0,0 @@ -package: kurtosis_engine_rest_api_bindings -generate: - embedded-spec: true - echo-server: true - strict-server: true -output: api/golang/engine/kurtosis_engine_rest_api_bindings/engine_server.gen.go \ No newline at end of file diff --git a/api/openapi/engine/types.cfg.yaml b/api/openapi/engine/types.cfg.yaml deleted file mode 100644 index 9e4f8fc94c..0000000000 --- a/api/openapi/engine/types.cfg.yaml +++ /dev/null @@ -1,4 +0,0 @@ -package: kurtosis_engine_rest_api_bindings -generate: - models: true -output: api/golang/engine/kurtosis_engine_rest_api_bindings/engine_types.gen.go \ No newline at end of file diff --git a/api/openapi/generators/api_types.cfg.yaml b/api/openapi/generators/api_types.cfg.yaml new file mode 100644 index 0000000000..356a925593 --- /dev/null +++ b/api/openapi/generators/api_types.cfg.yaml @@ -0,0 +1,7 @@ +package: api_types +generate: + models: true + embedded-spec: true +output: api/golang/http_rest/api_types/api_types.gen.go +output-options: + skip-prune: true \ No newline at end of file diff --git a/api/openapi/generators/core_server.cfg.yaml b/api/openapi/generators/core_server.cfg.yaml new file mode 100644 index 0000000000..5a6004103f --- /dev/null +++ b/api/openapi/generators/core_server.cfg.yaml @@ -0,0 +1,9 @@ +package: core_rest_api +generate: + embedded-spec: true + echo-server: true + strict-server: true + models: true +import-mapping: + ./api_types.yaml: github.com/kurtosis-tech/kurtosis/api/golang/http_rest/api_types +output: api/golang/http_rest/core_rest_api/api_container_server.gen.go \ No newline at end of file diff --git a/api/openapi/generators/engine_server.cfg.yaml b/api/openapi/generators/engine_server.cfg.yaml new file mode 100644 index 0000000000..911a2f5467 --- /dev/null +++ b/api/openapi/generators/engine_server.cfg.yaml @@ -0,0 +1,9 @@ +package: engine_rest_api +generate: + embedded-spec: true + echo-server: true + strict-server: true + models: true +import-mapping: + ./api_types.yaml: github.com/kurtosis-tech/kurtosis/api/golang/http_rest/api_types +output: api/golang/http_rest/engine_rest_api/engine_server.gen.go \ No newline at end of file diff --git a/api/openapi/generators/websocket_server.cfg.yaml b/api/openapi/generators/websocket_server.cfg.yaml new file mode 100644 index 0000000000..cba2dd4142 --- /dev/null +++ b/api/openapi/generators/websocket_server.cfg.yaml @@ -0,0 +1,9 @@ +package: websocket_api +generate: + embedded-spec: true + echo-server: true + strict-server: false + models: true +import-mapping: + ./api_types.yaml: github.com/kurtosis-tech/kurtosis/api/golang/http_rest/api_types +output: api/golang/http_rest/websocket_api/websocket_server.gen.go \ No newline at end of file diff --git a/api/openapi/scripts/build.sh b/api/openapi/scripts/build.sh index 75edfbaafa..1e3ae859b9 100755 --- a/api/openapi/scripts/build.sh +++ b/api/openapi/scripts/build.sh @@ -6,11 +6,9 @@ script_dirpath="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" api_root_dirpath="$(dirname "${script_dirpath}")" echo "Generating data models for REST API " -oapi-codegen --config="$api_root_dirpath/engine/types.cfg.yaml" "$api_root_dirpath/engine/engine_service.yaml" -oapi-codegen --config="$api_root_dirpath/core/types.cfg.yaml" "$api_root_dirpath/core/core_service.yaml" -oapi-codegen --config="$api_root_dirpath/websocket/types.cfg.yaml" "$api_root_dirpath/websocket/websocket_service.yaml" +oapi-codegen --config="$api_root_dirpath/generators/api_types.cfg.yaml" "$api_root_dirpath/specs/api_types.yaml" echo "Generating server code for REST API " -oapi-codegen --config="$api_root_dirpath/engine/server.cfg.yaml" "$api_root_dirpath/engine/engine_service.yaml" -oapi-codegen --config="$api_root_dirpath/core/server.cfg.yaml" "$api_root_dirpath/core/core_service.yaml" -oapi-codegen --config="$api_root_dirpath/websocket/server.cfg.yaml" "$api_root_dirpath/websocket/websocket_service.yaml" \ No newline at end of file +oapi-codegen --config="$api_root_dirpath/generators/engine_server.cfg.yaml" "$api_root_dirpath/specs/engine_service.yaml" +oapi-codegen --config="$api_root_dirpath/generators/core_server.cfg.yaml" "$api_root_dirpath/specs/core_service.yaml" +oapi-codegen --config="$api_root_dirpath/generators/websocket_server.cfg.yaml" "$api_root_dirpath/specs/websocket_service.yaml" \ No newline at end of file diff --git a/api/openapi/core/core_service.yaml b/api/openapi/specs/api_types.yaml similarity index 63% rename from api/openapi/core/core_service.yaml rename to api/openapi/specs/api_types.yaml index 13a2fc7d18..0ed532b06a 100644 --- a/api/openapi/core/core_service.yaml +++ b/api/openapi/specs/api_types.yaml @@ -1,322 +1,10 @@ openapi: 3.0.0 info: - title: Enclave API - description: API to manipulate the enclaves + title: API Types version: 0.1.0 -paths: - - /enclaves/{enclave_identifier}/starlark: - get: - description: Get last Starlark run - parameters: - - $ref: '#/components/parameters/enclave_identifier' - responses: - default: - $ref: '#/components/responses/NotOk' - "200": - description: Successful request - content: - application/json: - schema: - $ref: "#/components/schemas/StarlarkDescription" - - /enclaves/{enclave_identifier}/starlark/packages: - post: - description: Uploads a Starlark package. This step is required before the package can be executed with RunStarlarkPackage - parameters: - - $ref: '#/components/parameters/enclave_identifier' - requestBody: - $ref: "#/components/requestBodies/fileUploadBody" - responses: - default: - $ref: '#/components/responses/NotOk' - "200": - description: Success - - /enclaves/{enclave_identifier}/starlark/packages/{package_id}: - post: - description: Executes a Starlark script on the user's behalf - parameters: - - $ref: '#/components/parameters/enclave_identifier' - - $ref: '#/components/parameters/package_id' - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/RunStarlarkPackage" - required: true - responses: - default: - $ref: '#/components/responses/NotOk' - "200": - description: Successful request - content: - application/octet-stream: - schema: - type: string - format: binary - application/json: - schema: - type: array - items: - $ref: "#/components/schemas/StarlarkRunResponseLine" - - /enclaves/{enclave_identifier}/starlark/scripts: - post: - description: Executes a Starlark script on the user's behalf - parameters: - - $ref: '#/components/parameters/enclave_identifier' - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/RunStarlarkScript" - required: true - responses: - default: - $ref: '#/components/responses/NotOk' - "200": - description: Successful request - content: - application/octet-stream: - schema: - type: string - format: binary - application/json: - schema: - type: array - items: - $ref: "#/components/schemas/StarlarkRunResponseLine" - - /enclaves/{enclave_identifier}/services/{service_identifier}: - get: - parameters: - - $ref: '#/components/parameters/enclave_identifier' - - $ref: '#/components/parameters/service_identifier' - responses: - default: - $ref: '#/components/responses/NotOk' - "200": - description: Successful request - content: - application/json: - schema: - $ref: "#/components/schemas/ServiceInfo" - - /enclaves/{enclave_identifier}/services/history: - get: - description: Returns information about all existing & historical services - parameters: - - $ref: '#/components/parameters/enclave_identifier' - responses: - default: - $ref: '#/components/responses/NotOk' - "200": - description: Successful request - content: - application/json: - schema: - type: array - items: - $ref: "#/components/schemas/ServiceIdentifiers" - - /enclaves/{enclave_identifier}/services: - get: - parameters: - - $ref: '#/components/parameters/enclave_identifier' - - in: query - name: services - schema: - type: array - items: - type: string - description: Select services to get information - responses: - default: - $ref: '#/components/responses/NotOk' - "200": - description: Successful request - content: - application/json: - schema: - type: object - additionalProperties: - $ref: "#/components/schemas/ServiceInfo" - - /enclaves/{enclave_identifier}/services/{service_identifier}/command: - post: - description: Executes the given command inside a running container - parameters: - - $ref: '#/components/parameters/enclave_identifier' - - $ref: '#/components/parameters/service_identifier' - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/ExecCommand" - description: Exec Command - required: true - responses: - default: - $ref: '#/components/responses/NotOk' - "200": - description: Successful request - content: - application/json: - schema: - $ref: "#/components/schemas/ExecCommandResult" - - /enclaves/{enclave_identifier}/services/{service_identifier}/endpoints/{port_number}/availability: - get: - description: Block until the given HTTP endpoint returns available, calling it through a HTTP request - parameters: - - $ref: '#/components/parameters/enclave_identifier' - - $ref: '#/components/parameters/service_identifier' - - $ref: '#/components/parameters/port_number' - - $ref: '#/components/parameters/http_method' - - $ref: '#/components/parameters/path' - - $ref: '#/components/parameters/initial_delay_milliseconds' - - $ref: '#/components/parameters/retries' - - $ref: '#/components/parameters/retries_delay_milliseconds' - - $ref: '#/components/parameters/expected_response' - - $ref: '#/components/parameters/request_body' - responses: - "200": - description: Success - - /enclaves/{enclave_identifier}/artifacts: - get: - description: List all files artifacts - parameters: - - $ref: '#/components/parameters/enclave_identifier' - responses: - default: - $ref: '#/components/responses/NotOk' - "200": - description: Successful request - content: - application/json: - schema: - type: array - items: - $ref: "#/components/schemas/FileArtifactReference" - - /enclaves/{enclave_identifier}/artifacts/{artifact_identifier}: - get: - parameters: - - $ref: '#/components/parameters/enclave_identifier' - - $ref: '#/components/parameters/artifact_identifier' - description: Inspect the content of a file artifact - responses: - default: - $ref: '#/components/responses/NotOk' - "200": - description: Successful request - content: - application/json: - schema: - type: array - items: - $ref: "#/components/schemas/FileArtifactDescription" - - /enclaves/{enclave_identifier}/artifacts/{artifact_identifier}/download: - get: - description: Downloads a files artifact from the Kurtosis File System - parameters: - - $ref: '#/components/parameters/enclave_identifier' - - $ref: '#/components/parameters/artifact_identifier' - responses: - default: - $ref: '#/components/responses/NotOk' - "200": - description: Successful request - content: - application/octet-stream: - schema: - type: string - format: binary - - /enclaves/{enclave_identifier}/artifacts/local-file: - post: - description: Uploads a files artifact to the Kurtosis File System - parameters: - - $ref: '#/components/parameters/enclave_identifier' - requestBody: - $ref: "#/components/requestBodies/fileUploadBody" - responses: - default: - $ref: '#/components/responses/NotOk' - "200": - description: Successful request - content: - application/json: - schema: - type: object - additionalProperties: - $ref: "#/components/schemas/FileArtifactReference" - - /enclaves/{enclave_identifier}/artifacts/remote-file: - post: - description: Tells the API container to download a files artifact from the web to the Kurtosis File System - parameters: - - $ref: '#/components/parameters/enclave_identifier' - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/StoreWebFilesArtifact" - description: Store Web Files Artifact - required: true - responses: - default: - $ref: '#/components/responses/NotOk' - "200": - description: Successful request - content: - application/json: - schema: - $ref: "#/components/schemas/FileArtifactReference" - - /enclaves/{enclave_identifier}/artifacts/services/{service_identifier}: - post: - description: Tells the API container to copy a files artifact from a service to the Kurtosis File System - parameters: - - $ref: '#/components/parameters/enclave_identifier' - - $ref: '#/components/parameters/service_identifier' - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/StoreFilesArtifactFromService" - required: true - responses: - default: - $ref: '#/components/responses/NotOk' - "200": - description: Successful request - content: - application/json: - schema: - $ref: "#/components/schemas/FileArtifactReference" - - /enclaves/{enclave_identifier}/services/connection: - post: - description: User services port forwarding - parameters: - - $ref: '#/components/parameters/enclave_identifier' - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/Connect" - required: true - responses: - default: - $ref: '#/components/responses/NotOk' - "200": - description: Successful request +paths: {} # Specs for types only # ========================================================================================================================= # ========================================================================================================================= @@ -326,26 +14,25 @@ paths: components: - responses: + requestBodies: - NotOk: - description: Unexpected error + fileUploadBody: content: - application/json: + multipart/form-data: schema: - $ref: '#/components/schemas/ResponseInfo' - required: true + type: string + format: binary parameters: enclave_identifier: - in: path name: enclave_identifier + in: path + required: true + description: UUID, shortened UUID, or name of the enclave schema: type: string - description: The package identifier that will be executed - required: true - + service_identifier: in: path name: service_identifier @@ -353,7 +40,24 @@ components: type: string description: The service identifier of the container that the command should be executed in required: true + + service_uuid_set: + name: service_uuid_set + in: query + required: true + schema: + type: array + items: + type: string + remove_all: + name: remove_all + in: query + required: false + description: If true, remove all enclaves. Default is false + schema: + type: boolean + port_number: in: path name: port_number @@ -431,14 +135,35 @@ components: description: The package identifier that will be executed required: true - requestBodies: + follow_logs: + name: follow_logs + in: query + required: false + schema: + type: boolean - fileUploadBody: - content: - multipart/form-data: - schema: - type: string - format: binary + conjunctive_filters: + name: conjunctive_filters + in: query + required: false + schema: + type: array + items: + $ref: "#/components/schemas/LogLineFilter" + + return_all_logs: + name: return_all_logs + in: query + required: false + schema: + type: boolean + + num_log_lines: + name: num_log_lines + in: query + required: false + schema: + type: integer schemas: @@ -464,6 +189,146 @@ components: - message - code + EngineInfo: + type: object + properties: + engine_version: + type: string + required: + - engine_version + + CreateEnclave: + type: object + properties: + enclave_name: + type: string + api_container_version_tag: + type: string + api_container_log_level: + type: string + mode: + $ref: '#/components/schemas/EnclaveMode' + + EnclaveMode: + type: string + enum: + - TEST + - PRODUCTION + + EnclaveContainersStatus: + type: string + enum: + - RUNNING + - STOPPED + - EMPTY + + EnclaveTargetStatus: + type: string + enum: + - STOP + + ApiContainerStatus: + type: string + enum: + - RUNNING + - STOPPED + - NON_EXISTENT + + EnclaveInfo: + type: object + properties: + enclave_uuid: + type: string + name: + type: string + shortened_uuid: + type: string + containers_status: + $ref: '#/components/schemas/EnclaveContainersStatus' + api_container_status: + $ref: '#/components/schemas/ApiContainerStatus' + api_container_info: + $ref: '#/components/schemas/EnclaveAPIContainerInfo' + api_container_host_machine_info: + $ref: '#/components/schemas/EnclaveAPIContainerHostMachineInfo' + creation_time: + $ref: '#/components/schemas/Timestamp' + mode: + $ref: '#/components/schemas/EnclaveMode' + required: + - enclave_uuid + - name + - shortened_uuid + - containers_status + - api_container_status + - creation_time + - mode + + EnclaveAPIContainerInfo: + type: object + properties: + container_id: + type: string + ip_inside_enclave: + type: string + grpc_port_inside_enclave: + type: integer + bridge_ip_address: + type: string + required: + - container_id + - ip_inside_enclave + - grpc_port_inside_enclave + - bridge_ip_address + + EnclaveAPIContainerHostMachineInfo: + type: object + properties: + ip_on_host_machine: + type: string + grpc_port_on_host_machine: + type: integer + required: + - ip_on_host_machine + - grpc_port_on_host_machine + + EnclaveIdentifiers: + type: object + properties: + enclave_uuid: + type: string + name: + type: string + shortened_uuid: + type: string + required: + - enclave_uuid + - name + - shortened_uuid + + EnclaveNameAndUuid: + type: object + properties: + name: + type: string + uuid: + type: string + required: + - name + - uuid + + DeletionSummary: + type: object + properties: + removed_enclave_name_and_uuids: + type: array + items: + $ref: '#/components/schemas/EnclaveNameAndUuid' + + Timestamp: + type: string + format: date-time + Port: type: object properties: @@ -1032,3 +897,47 @@ components: 0 - STOPPED 1 - RUNNING 2 - UNKNOWN + + ServiceLogs: + type: object + properties: + service_logs_by_service_uuid: + type: object + additionalProperties: + $ref: "#/components/schemas/LogLine" + not_found_service_uuid_set: + type: array + items: + type: string + + LogLine: + type: object + properties: + line: + type: array + items: + type: string + timestamp: + $ref: "#/components/schemas/Timestamp" + required: + - line + - timestamp + + LogLineFilter: + type: object + properties: + operator: + $ref: "#/components/schemas/LogLineOperator" + text_pattern: + type: string + required: + - operator + - text_pattern + + LogLineOperator: + type: string + enum: + - DOES_CONTAIN_TEXT + - DOES_NOT_CONTAIN_TEXT + - DOES_CONTAIN_MATCH_REGEX + - DOES_NOT_CONTAIN_MATCH_REGEX diff --git a/api/openapi/specs/core_service.yaml b/api/openapi/specs/core_service.yaml new file mode 100644 index 0000000000..d4b04095aa --- /dev/null +++ b/api/openapi/specs/core_service.yaml @@ -0,0 +1,331 @@ +openapi: 3.0.0 + +info: + title: Enclave API + description: API to manipulate the enclaves + version: 0.1.0 + +paths: + + /enclaves/{enclave_identifier}/starlark: + get: + description: Get last Starlark run + parameters: + - $ref: './api_types.yaml#/components/parameters/enclave_identifier' + responses: + default: + $ref: '#/components/responses/NotOk' + "200": + description: Successful request + content: + application/json: + schema: + $ref: "./api_types.yaml#/components/schemas/StarlarkDescription" + + /enclaves/{enclave_identifier}/starlark/packages: + post: + description: Uploads a Starlark package. This step is required before the package can be executed with RunStarlarkPackage + parameters: + - $ref: './api_types.yaml#/components/parameters/enclave_identifier' + requestBody: + $ref: "./api_types.yaml#/components/requestBodies/fileUploadBody" + responses: + default: + $ref: '#/components/responses/NotOk' + "200": + description: Success + + /enclaves/{enclave_identifier}/starlark/packages/{package_id}: + post: + description: Executes a Starlark script on the user's behalf + parameters: + - $ref: './api_types.yaml#/components/parameters/enclave_identifier' + - $ref: './api_types.yaml#/components/parameters/package_id' + requestBody: + content: + application/json: + schema: + $ref: "./api_types.yaml#/components/schemas/RunStarlarkPackage" + required: true + responses: + default: + $ref: '#/components/responses/NotOk' + "200": + description: Successful request + content: + application/octet-stream: + schema: + type: string + format: binary + application/json: + schema: + type: array + items: + $ref: "./api_types.yaml#/components/schemas/StarlarkRunResponseLine" + + /enclaves/{enclave_identifier}/starlark/scripts: + post: + description: Executes a Starlark script on the user's behalf + parameters: + - $ref: './api_types.yaml#/components/parameters/enclave_identifier' + requestBody: + content: + application/json: + schema: + $ref: "./api_types.yaml#/components/schemas/RunStarlarkScript" + required: true + responses: + default: + $ref: '#/components/responses/NotOk' + "200": + description: Successful request + content: + application/octet-stream: + schema: + type: string + format: binary + application/json: + schema: + type: array + items: + $ref: "./api_types.yaml#/components/schemas/StarlarkRunResponseLine" + + /enclaves/{enclave_identifier}/services/{service_identifier}: + get: + parameters: + - $ref: './api_types.yaml#/components/parameters/enclave_identifier' + - $ref: './api_types.yaml#/components/parameters/service_identifier' + responses: + default: + $ref: '#/components/responses/NotOk' + "200": + description: Successful request + content: + application/json: + schema: + $ref: "./api_types.yaml#/components/schemas/ServiceInfo" + + /enclaves/{enclave_identifier}/services/history: + get: + description: Returns information about all existing & historical services + parameters: + - $ref: './api_types.yaml#/components/parameters/enclave_identifier' + responses: + default: + $ref: '#/components/responses/NotOk' + "200": + description: Successful request + content: + application/json: + schema: + type: array + items: + $ref: "./api_types.yaml#/components/schemas/ServiceIdentifiers" + + /enclaves/{enclave_identifier}/services: + get: + parameters: + - $ref: './api_types.yaml#/components/parameters/enclave_identifier' + - in: query + name: services + schema: + type: array + items: + type: string + description: Select services to get information + responses: + default: + $ref: '#/components/responses/NotOk' + "200": + description: Successful request + content: + application/json: + schema: + type: object + additionalProperties: + $ref: "./api_types.yaml#/components/schemas/ServiceInfo" + + /enclaves/{enclave_identifier}/services/{service_identifier}/command: + post: + description: Executes the given command inside a running container + parameters: + - $ref: './api_types.yaml#/components/parameters/enclave_identifier' + - $ref: './api_types.yaml#/components/parameters/service_identifier' + requestBody: + content: + application/json: + schema: + $ref: "./api_types.yaml#/components/schemas/ExecCommand" + description: Exec Command + required: true + responses: + default: + $ref: '#/components/responses/NotOk' + "200": + description: Successful request + content: + application/json: + schema: + $ref: "./api_types.yaml#/components/schemas/ExecCommandResult" + + /enclaves/{enclave_identifier}/services/{service_identifier}/endpoints/{port_number}/availability: + get: + description: Block until the given HTTP endpoint returns available, calling it through a HTTP request + parameters: + - $ref: './api_types.yaml#/components/parameters/enclave_identifier' + - $ref: './api_types.yaml#/components/parameters/service_identifier' + - $ref: './api_types.yaml#/components/parameters/port_number' + - $ref: './api_types.yaml#/components/parameters/http_method' + - $ref: './api_types.yaml#/components/parameters/path' + - $ref: './api_types.yaml#/components/parameters/initial_delay_milliseconds' + - $ref: './api_types.yaml#/components/parameters/retries' + - $ref: './api_types.yaml#/components/parameters/retries_delay_milliseconds' + - $ref: './api_types.yaml#/components/parameters/expected_response' + - $ref: './api_types.yaml#/components/parameters/request_body' + responses: + "200": + description: Success + + /enclaves/{enclave_identifier}/artifacts: + get: + description: List all files artifacts + parameters: + - $ref: './api_types.yaml#/components/parameters/enclave_identifier' + responses: + default: + $ref: '#/components/responses/NotOk' + "200": + description: Successful request + content: + application/json: + schema: + type: array + items: + $ref: "./api_types.yaml#/components/schemas/FileArtifactReference" + + /enclaves/{enclave_identifier}/artifacts/{artifact_identifier}: + get: + parameters: + - $ref: './api_types.yaml#/components/parameters/enclave_identifier' + - $ref: './api_types.yaml#/components/parameters/artifact_identifier' + description: Inspect the content of a file artifact + responses: + default: + $ref: '#/components/responses/NotOk' + "200": + description: Successful request + content: + application/json: + schema: + type: array + items: + $ref: "./api_types.yaml#/components/schemas/FileArtifactDescription" + + /enclaves/{enclave_identifier}/artifacts/{artifact_identifier}/download: + get: + description: Downloads a files artifact from the Kurtosis File System + parameters: + - $ref: './api_types.yaml#/components/parameters/enclave_identifier' + - $ref: './api_types.yaml#/components/parameters/artifact_identifier' + responses: + default: + $ref: '#/components/responses/NotOk' + "200": + description: Successful request + content: + application/octet-stream: + schema: + type: string + format: binary + + /enclaves/{enclave_identifier}/artifacts/local-file: + post: + description: Uploads a files artifact to the Kurtosis File System + parameters: + - $ref: './api_types.yaml#/components/parameters/enclave_identifier' + requestBody: + $ref: "./api_types.yaml#/components/requestBodies/fileUploadBody" + responses: + default: + $ref: '#/components/responses/NotOk' + "200": + description: Successful request + content: + application/json: + schema: + type: object + additionalProperties: + $ref: "./api_types.yaml#/components/schemas/FileArtifactReference" + + /enclaves/{enclave_identifier}/artifacts/remote-file: + post: + description: Tells the API container to download a files artifact from the web to the Kurtosis File System + parameters: + - $ref: './api_types.yaml#/components/parameters/enclave_identifier' + requestBody: + content: + application/json: + schema: + $ref: "./api_types.yaml#/components/schemas/StoreWebFilesArtifact" + description: Store Web Files Artifact + required: true + responses: + default: + $ref: '#/components/responses/NotOk' + "200": + description: Successful request + content: + application/json: + schema: + $ref: "./api_types.yaml#/components/schemas/FileArtifactReference" + + /enclaves/{enclave_identifier}/artifacts/services/{service_identifier}: + post: + description: Tells the API container to copy a files artifact from a service to the Kurtosis File System + parameters: + - $ref: './api_types.yaml#/components/parameters/enclave_identifier' + - $ref: './api_types.yaml#/components/parameters/service_identifier' + requestBody: + content: + application/json: + schema: + $ref: "./api_types.yaml#/components/schemas/StoreFilesArtifactFromService" + required: true + responses: + default: + $ref: '#/components/responses/NotOk' + "200": + description: Successful request + content: + application/json: + schema: + $ref: "./api_types.yaml#/components/schemas/FileArtifactReference" + + /enclaves/{enclave_identifier}/services/connection: + post: + description: User services port forwarding + parameters: + - $ref: './api_types.yaml#/components/parameters/enclave_identifier' + requestBody: + content: + application/json: + schema: + $ref: "./api_types.yaml#/components/schemas/Connect" + required: true + responses: + default: + $ref: '#/components/responses/NotOk' + "200": + description: Successful request + +components: + + responses: + + NotOk: + description: Unexpected error + content: + application/json: + schema: + $ref: './api_types.yaml#/components/schemas/ResponseInfo' + required: true diff --git a/api/openapi/specs/engine_service.yaml b/api/openapi/specs/engine_service.yaml new file mode 100644 index 0000000000..4b9c517f88 --- /dev/null +++ b/api/openapi/specs/engine_service.yaml @@ -0,0 +1,149 @@ +openapi: 3.0.0 + +info: + title: Engine API + version: 0.1.0 + +paths: + /engine/info: + get: + summary: Get Engine Info + responses: + default: + $ref: '#/components/responses/NotOk' + '200': + description: Successful response + content: + application/json: + schema: + $ref: './api_types.yaml#/components/schemas/EngineInfo' + + /enclaves: + get: + summary: Get Enclaves + responses: + default: + $ref: '#/components/responses/NotOk' + '200': + description: Successful response + content: + application/json: + schema: + type: object + additionalProperties: + $ref: './api_types.yaml#/components/schemas/EnclaveInfo' + + post: + summary: Create Enclave + requestBody: + required: true + content: + application/json: + schema: + $ref: './api_types.yaml#/components/schemas/CreateEnclave' + responses: + + default: + $ref: '#/components/responses/NotOk' + '200': + description: Successful response + content: + application/json: + schema: + $ref: './api_types.yaml#/components/schemas/EnclaveInfo' + + delete: + summary: Delete Enclaves + parameters: + - $ref: './api_types.yaml#/components/parameters/remove_all' + responses: + default: + $ref: '#/components/responses/NotOk' + '200': + description: Successful response + content: + application/json: + schema: + $ref: './api_types.yaml#/components/schemas/DeletionSummary' + + /enclaves/historical: + get: + summary: Get Historical Enclaves + responses: + default: + $ref: '#/components/responses/NotOk' + '200': + description: Successful response + content: + application/json: + schema: + type: array + items: + $ref: './api_types.yaml#/components/schemas/EnclaveIdentifiers' + + /enclaves/{enclave_identifier}: + get: + summary: Get Enclave Info + parameters: + - $ref: './api_types.yaml#/components/parameters/enclave_identifier' + responses: + default: + $ref: '#/components/responses/NotOk' + '200': + description: Successful response + content: + application/json: + schema: + $ref: './api_types.yaml#/components/schemas/EnclaveInfo' + + delete: + summary: Destroy Enclave + parameters: + - $ref: './api_types.yaml#/components/parameters/enclave_identifier' + responses: + default: + $ref: '#/components/responses/NotOk' + '200': + description: Successful response + + /enclaves/{enclave_identifier}/status: + get: + summary: Get enclave status + parameters: + - $ref: './api_types.yaml#/components/parameters/enclave_identifier' + responses: + default: + $ref: '#/components/responses/NotOk' + '200': + description: Successful response + content: + application/json: + schema: + $ref: './api_types.yaml#/components/schemas/EnclaveContainersStatus' + post: + summary: Set enclave status + parameters: + - $ref: './api_types.yaml#/components/parameters/enclave_identifier' + requestBody: + required: true + content: + application/json: + schema: + $ref: './api_types.yaml#/components/schemas/EnclaveTargetStatus' + responses: + default: + $ref: '#/components/responses/NotOk' + '200': + description: Successful response + +components: + + responses: + + NotOk: + description: Unexpected error + content: + application/json: + schema: + $ref: './api_types.yaml#/components/schemas/ResponseInfo' + required: true \ No newline at end of file diff --git a/api/openapi/specs/websocket_service.yaml b/api/openapi/specs/websocket_service.yaml new file mode 100644 index 0000000000..0eef058677 --- /dev/null +++ b/api/openapi/specs/websocket_service.yaml @@ -0,0 +1,42 @@ +openapi: 3.0.0 + +info: + title: Websocket API + version: 0.1.0 + +paths: + /enclaves/{enclave_identifier}/logs: + get: + summary: Get Service Logs + parameters: + - $ref: "./api_types.yaml#/components/parameters/enclave_identifier" + - $ref: "./api_types.yaml#/components/parameters/service_uuid_set" + - $ref: "./api_types.yaml#/components/parameters/follow_logs" + - $ref: "./api_types.yaml#/components/parameters/conjunctive_filters" + - $ref: "./api_types.yaml#/components/parameters/return_all_logs" + - $ref: "./api_types.yaml#/components/parameters/num_log_lines" + responses: + "200": + description: Successful response + content: + application/json: + schema: + $ref: "./api_types.yaml#/components/schemas/ServiceLogs" + + /enclaves/{enclave_identifier}/services/{service_identifier}/logs: + get: + summary: Get Service Logs + parameters: + - $ref: "./api_types.yaml#/components/parameters/enclave_identifier" + - $ref: "./api_types.yaml#/components/parameters/service_identifier" + - $ref: "./api_types.yaml#/components/parameters/follow_logs" + - $ref: "./api_types.yaml#/components/parameters/conjunctive_filters" + - $ref: "./api_types.yaml#/components/parameters/return_all_logs" + - $ref: "./api_types.yaml#/components/parameters/num_log_lines" + responses: + "200": + description: Successful response + content: + application/json: + schema: + $ref: "./api_types.yaml#/components/schemas/ServiceLogs" diff --git a/api/openapi/websocket/server.cfg.yaml b/api/openapi/websocket/server.cfg.yaml deleted file mode 100644 index 5eecf6f51f..0000000000 --- a/api/openapi/websocket/server.cfg.yaml +++ /dev/null @@ -1,6 +0,0 @@ -package: kurtosis_websocket_api_bindings -generate: - embedded-spec: true - echo-server: true - strict-server: false -output: api/golang/websocket/kurtosis_websocket_api_bindings/websocket_server.gen.go \ No newline at end of file diff --git a/api/openapi/websocket/types.cfg.yaml b/api/openapi/websocket/types.cfg.yaml deleted file mode 100644 index edb2290ad1..0000000000 --- a/api/openapi/websocket/types.cfg.yaml +++ /dev/null @@ -1,4 +0,0 @@ -package: kurtosis_websocket_api_bindings -generate: - models: true -output: api/golang/websocket/kurtosis_websocket_api_bindings/websocket_types.gen.go \ No newline at end of file diff --git a/api/openapi/websocket/websocket_service.yaml b/api/openapi/websocket/websocket_service.yaml deleted file mode 100644 index fb35ae77cf..0000000000 --- a/api/openapi/websocket/websocket_service.yaml +++ /dev/null @@ -1,154 +0,0 @@ -openapi: 3.0.0 - -info: - title: Websocket API - version: 0.1.0 - -paths: - /enclaves/{enclave_identifier}/logs: - get: - summary: Get Service Logs - parameters: - - $ref: "#/components/parameters/enclave_identifier" - - $ref: "#/components/parameters/service_uuid_set" - - $ref: "#/components/parameters/follow_logs" - - $ref: "#/components/parameters/conjunctive_filters" - - $ref: "#/components/parameters/return_all_logs" - - $ref: "#/components/parameters/num_log_lines" - responses: - "200": - description: Successful response - content: - application/json: - schema: - $ref: "#/components/schemas/ServiceLogs" - - /enclaves/{enclave_identifier}/services/{service_uuid}/logs: - get: - summary: Get Service Logs - parameters: - - $ref: "#/components/parameters/enclave_identifier" - - $ref: "#/components/parameters/service_uuid" - - $ref: "#/components/parameters/follow_logs" - - $ref: "#/components/parameters/conjunctive_filters" - - $ref: "#/components/parameters/return_all_logs" - - $ref: "#/components/parameters/num_log_lines" - responses: - "200": - description: Successful response - content: - application/json: - schema: - $ref: "#/components/schemas/ServiceLogs" - -# ========================================================================================================================= -# ========================================================================================================================= -# > > > > > > > > > > > > > > > > > > > > > > > > Data Models < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < -# ========================================================================================================================= -# ========================================================================================================================= - -components: - parameters: - enclave_identifier: - name: enclave_identifier - in: path - required: true - description: UUID, shortened UUID, or name of the enclave - schema: - type: string - - service_uuid: - name: service_uuid - in: path - required: true - schema: - type: string - - service_uuid_set: - name: service_uuid_set - in: query - required: true - schema: - type: array - items: - type: string - - follow_logs: - name: follow_logs - in: query - required: false - schema: - type: boolean - - conjunctive_filters: - name: conjunctive_filters - in: query - required: false - schema: - type: array - items: - $ref: "#/components/schemas/LogLineFilter" - - return_all_logs: - name: return_all_logs - in: query - required: false - schema: - type: boolean - - num_log_lines: - name: num_log_lines - in: query - required: false - schema: - type: integer - - schemas: - - ServiceLogs: - type: object - properties: - service_logs_by_service_uuid: - type: object - additionalProperties: - $ref: "#/components/schemas/LogLine" - not_found_service_uuid_set: - type: array - items: - type: string - - LogLine: - type: object - properties: - line: - type: array - items: - type: string - timestamp: - $ref: "#/components/schemas/Timestamp" - required: - - line - - timestamp - - LogLineFilter: - type: object - properties: - operator: - $ref: "#/components/schemas/LogLineOperator" - text_pattern: - type: string - required: - - operator - - text_pattern - - LogLineOperator: - type: string - enum: - - DOES_CONTAIN_TEXT - - DOES_NOT_CONTAIN_TEXT - - DOES_CONTAIN_MATCH_REGEX - - DOES_NOT_CONTAIN_MATCH_REGEX - - Timestamp: - type: string - format: date-time diff --git a/engine/server/engine/main.go b/engine/server/engine/main.go index 599f6c9627..2c63f8fe94 100644 --- a/engine/server/engine/main.go +++ b/engine/server/engine/main.go @@ -17,10 +17,10 @@ import ( "strings" "time" - enclaveApi "github.com/kurtosis-tech/kurtosis/api/golang/core/kurtosis_core_rest_api_bindings" - engineApi "github.com/kurtosis-tech/kurtosis/api/golang/engine/kurtosis_engine_rest_api_bindings" "github.com/kurtosis-tech/kurtosis/api/golang/engine/kurtosis_engine_rpc_api_bindings/kurtosis_engine_rpc_api_bindingsconnect" - loggingApi "github.com/kurtosis-tech/kurtosis/api/golang/websocket/kurtosis_websocket_api_bindings" + enclaveApi "github.com/kurtosis-tech/kurtosis/api/golang/http_rest/core_rest_api" + engineApi "github.com/kurtosis-tech/kurtosis/api/golang/http_rest/engine_rest_api" + loggingApi "github.com/kurtosis-tech/kurtosis/api/golang/http_rest/websocket_api" connect_server "github.com/kurtosis-tech/kurtosis/connect-server" "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/backend_creator" "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/consts" diff --git a/engine/server/engine/server/enclave_rest_api_handler.go b/engine/server/engine/server/enclave_rest_api_handler.go index 6204a64359..fecacbd173 100644 --- a/engine/server/engine/server/enclave_rest_api_handler.go +++ b/engine/server/engine/server/enclave_rest_api_handler.go @@ -20,8 +20,9 @@ import ( "google.golang.org/grpc/credentials/insecure" "google.golang.org/protobuf/types/known/emptypb" - api "github.com/kurtosis-tech/kurtosis/api/golang/core/kurtosis_core_rest_api_bindings" rpc_api "github.com/kurtosis-tech/kurtosis/api/golang/core/kurtosis_core_rpc_api_bindings" + api_type "github.com/kurtosis-tech/kurtosis/api/golang/http_rest/api_types" + api "github.com/kurtosis-tech/kurtosis/api/golang/http_rest/core_rest_api" ) type enclaveRuntime struct { @@ -107,8 +108,8 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierArtifacts(ctx context results := utils.MapList( artifacts.FileNamesAndUuids, - func(x *rpc_api.FilesArtifactNameAndUuid) api.FileArtifactReference { - return api.FileArtifactReference{ + func(x *rpc_api.FilesArtifactNameAndUuid) api_type.FileArtifactReference { + return api_type.FileArtifactReference{ Name: x.FileName, Uuid: x.FileUuid, } @@ -126,7 +127,7 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierArtifactsLocalFile(c } logrus.Infof("Uploading file artifact to enclave %s", enclave_identifier) - uploaded_artifacts := map[string]api.FileArtifactReference{} + uploaded_artifacts := map[string]api_type.FileArtifactReference{} for { // Get next part (file) from the the multipart POST request part, err := request.Body.NextPart() @@ -159,7 +160,7 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierArtifactsLocalFile(c // The response is nil when a file artifact with the same has already been uploaded // TODO (edgar) Is this the expected behavior? If so, we should be explicit about it. if response != nil { - artifact_response := api.FileArtifactReference{ + artifact_response := api_type.FileArtifactReference{ Name: response.Name, Uuid: response.Uuid, } @@ -189,7 +190,7 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierArtifactsRemoteFile( return nil, stacktrace.NewError("Can't start file upload gRPC call with enclave %s", enclave_identifier) } - artifact_response := api.FileArtifactReference{ + artifact_response := api_type.FileArtifactReference{ Uuid: stored_artifact.Uuid, Name: request.Body.Name, } @@ -217,7 +218,7 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierArtifactsServicesSer return nil, stacktrace.NewError("Can't start file upload gRPC call with enclave %s", enclave_identifier) } - artifact_response := api.FileArtifactReference{ + artifact_response := api_type.FileArtifactReference{ Uuid: stored_artifact.Uuid, Name: request.Body.Name, } @@ -248,9 +249,9 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierArtifactsArtifactIden artifact_content_list := utils.MapList( stored_artifact.FileDescriptions, - func(x *rpc_api.FileArtifactContentsFileDescription) api.FileArtifactDescription { + func(x *rpc_api.FileArtifactContentsFileDescription) api_type.FileArtifactDescription { size := int64(x.Size) - return api.FileArtifactDescription{ + return api_type.FileArtifactDescription{ Path: x.Path, Size: size, TextPreview: x.TextPreview, @@ -333,8 +334,8 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierServicesHistory(ctx c return nil, stacktrace.NewError("Can't list services using gRPC call with enclave %s", enclave_identifier) } - response := utils.MapList(services.AllIdentifiers, func(service *rpc_api.ServiceIdentifiers) api.ServiceIdentifiers { - return api.ServiceIdentifiers{ + response := utils.MapList(services.AllIdentifiers, func(service *rpc_api.ServiceIdentifiers) api_type.ServiceIdentifiers { + return api_type.ServiceIdentifiers{ ServiceUuid: service.ServiceUuid, ShortenedUuid: service.ShortenedUuid, Name: service.Name, @@ -413,7 +414,7 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierServicesServiceIdent return nil, stacktrace.NewError("Can't execute commands using gRPC call with enclave %s", enclave_identifier) } - response := api.ExecCommandResult{ + response := api_type.ExecCommandResult{ ExitCode: exec_result.ExitCode, LogOutput: exec_result.LogOutput, } @@ -425,7 +426,7 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierServicesServiceIdenti enclave_identifier := request.EnclaveIdentifier service_identifier := request.ServiceIdentifier port_number := request.PortNumber - endpoint_method := utils.DerefWith(request.Params.HttpMethod, api.GET) + endpoint_method := utils.DerefWith(request.Params.HttpMethod, api_type.GET) apiContainerClient, errConn := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) if errConn != nil { return nil, errConn @@ -436,7 +437,7 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierServicesServiceIdenti var err error switch endpoint_method { - case api.GET: + case api_type.GET: waitForHttpGetEndpointAvailabilityArgs := rpc_api.WaitForHttpGetEndpointAvailabilityArgs{ ServiceIdentifier: service_identifier, Port: uint32(port_number), @@ -447,7 +448,7 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierServicesServiceIdenti BodyText: request.Params.ExpectedResponse, } _, err = (*apiContainerClient).WaitForHttpGetEndpointAvailability(ctx, &waitForHttpGetEndpointAvailabilityArgs) - case api.POST: + case api_type.POST: waitForHttpPostEndpointAvailabilityArgs := rpc_api.WaitForHttpPostEndpointAvailabilityArgs{ ServiceIdentifier: service_identifier, Port: uint32(port_number), @@ -488,7 +489,7 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierStarlark(ctx context. flags := utils.MapList(starlark_result.ExperimentalFeatures, toHttpFeatureFlag) policy := toHttpRestartPolicy(starlark_result.RestartPolicy) - response := api.StarlarkDescription{ + response := api_type.StarlarkDescription{ ExperimentalFeatures: flags, MainFunctionName: starlark_result.MainFunctionName, PackageId: starlark_result.PackageId, @@ -558,7 +559,7 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkPackagesPack logrus.Infof("Run Starlark package on enclave %s", enclave_identifier) package_id := request.PackageId - flags := utils.MapList(utils.DerefWith(request.Body.ExperimentalFeatures, []api.KurtosisFeatureFlag{}), toGrpcFeatureFlag) + flags := utils.MapList(utils.DerefWith(request.Body.ExperimentalFeatures, []api_type.KurtosisFeatureFlag{}), toGrpcFeatureFlag) // The gRPC always expect a JSON object even though it's marked as optional, so we need to default to `{}`` jsonParams := utils.DerefWith(request.Body.Params, map[string]interface{}{}) jsonBlob, err := json.Marshal(jsonParams) @@ -620,7 +621,7 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx } logrus.Infof("Run Starlark script on enclave %s", enclave_identifier) - flags := utils.MapList(utils.DerefWith(request.Body.ExperimentalFeatures, []api.KurtosisFeatureFlag{}), toGrpcFeatureFlag) + flags := utils.MapList(utils.DerefWith(request.Body.ExperimentalFeatures, []api_type.KurtosisFeatureFlag{}), toGrpcFeatureFlag) jsonString := utils.MapPointer(request.Body.Params, func(v map[string]interface{}) string { jsonBlob, err := json.Marshal(v) if err != nil { @@ -693,18 +694,18 @@ func getGrpcClientConn(enclaveInfo types.EnclaveInfo, connectOnHostMachine bool) return grpcConnection, nil } -func (manager enclaveRuntime) GetApiClientOrResponseError(enclave_uuid string) (*rpc_api.ApiContainerServiceClient, *api.ResponseInfo) { +func (manager enclaveRuntime) GetApiClientOrResponseError(enclave_uuid string) (*rpc_api.ApiContainerServiceClient, *api_type.ResponseInfo) { client, err := manager.GetGrpcClientForEnclaveUUID(enclave_uuid) if err != nil { - return nil, &api.ResponseInfo{ - Type: api.ERROR, + return nil, &api_type.ResponseInfo{ + Type: api_type.ERROR, Message: "Couldn't retrieve connection with enclave", Code: http.StatusInternalServerError, } } if client == nil { - return nil, &api.ResponseInfo{ - Type: api.INFO, + return nil, &api_type.ResponseInfo{ + Type: api_type.INFO, Message: fmt.Sprintf("enclave '%s' not found", enclave_uuid), Code: http.StatusNotFound, } @@ -726,59 +727,59 @@ func (manager enclaveRuntime) GetGrpcClientForEnclaveUUID(enclave_uuid string) ( return &client, nil } -func toGrpcConnect(conn api.Connect) rpc_api.Connect { +func toGrpcConnect(conn api_type.Connect) rpc_api.Connect { switch conn { - case api.CONNECT: + case api_type.CONNECT: return rpc_api.Connect_CONNECT - case api.NOCONNECT: + case api_type.NOCONNECT: return rpc_api.Connect_NO_CONNECT default: panic(fmt.Sprintf("Missing conversion of Connect Enum value: %s", conn)) } } -func toHttpContainerStatus(status rpc_api.Container_Status) api.ContainerStatus { +func toHttpContainerStatus(status rpc_api.Container_Status) api_type.ContainerStatus { switch status { case rpc_api.Container_RUNNING: - return api.ContainerStatusRUNNING + return api_type.ContainerStatusRUNNING case rpc_api.Container_STOPPED: - return api.ContainerStatusSTOPPED + return api_type.ContainerStatusSTOPPED case rpc_api.Container_UNKNOWN: - return api.ContainerStatusUNKNOWN + return api_type.ContainerStatusUNKNOWN default: panic(fmt.Sprintf("Missing conversion of Container Status Enum value: %s", status)) } } -func toHttpTransportProtocol(protocol rpc_api.Port_TransportProtocol) api.TransportProtocol { +func toHttpTransportProtocol(protocol rpc_api.Port_TransportProtocol) api_type.TransportProtocol { switch protocol { case rpc_api.Port_TCP: - return api.TCP + return api_type.TCP case rpc_api.Port_UDP: - return api.UDP + return api_type.UDP case rpc_api.Port_SCTP: - return api.SCTP + return api_type.SCTP default: panic(fmt.Sprintf("Missing conversion of Transport Protocol Enum value: %s", protocol)) } } -func toHttpServiceStatus(status rpc_api.ServiceStatus) api.ServiceStatus { +func toHttpServiceStatus(status rpc_api.ServiceStatus) api_type.ServiceStatus { switch status { case rpc_api.ServiceStatus_RUNNING: - return api.ServiceStatusRUNNING + return api_type.ServiceStatusRUNNING case rpc_api.ServiceStatus_STOPPED: - return api.ServiceStatusSTOPPED + return api_type.ServiceStatusSTOPPED case rpc_api.ServiceStatus_UNKNOWN: - return api.ServiceStatusUNKNOWN + return api_type.ServiceStatusUNKNOWN default: panic(fmt.Sprintf("Missing conversion of Service Status Enum value: %s", status)) } } -func toHttpContainer(container *rpc_api.Container) api.Container { +func toHttpContainer(container *rpc_api.Container) api_type.Container { status := toHttpContainerStatus(container.Status) - return api.Container{ + return api_type.Container{ CmdArgs: container.CmdArgs, EntrypointArgs: container.EntrypointArgs, EnvVars: container.EnvVars, @@ -787,9 +788,9 @@ func toHttpContainer(container *rpc_api.Container) api.Container { } } -func toHttpPorts(port *rpc_api.Port) api.Port { +func toHttpPorts(port *rpc_api.Port) api_type.Port { protocol := toHttpTransportProtocol(port.TransportProtocol) - return api.Port{ + return api_type.Port{ ApplicationProtocol: &port.MaybeApplicationProtocol, WaitTimeout: &port.MaybeWaitTimeout, Number: int32(port.Number), @@ -797,12 +798,12 @@ func toHttpPorts(port *rpc_api.Port) api.Port { } } -func toHttpServiceInfo(service *rpc_api.ServiceInfo) api.ServiceInfo { +func toHttpServiceInfo(service *rpc_api.ServiceInfo) api_type.ServiceInfo { container := toHttpContainer(service.Container) serviceStatus := toHttpServiceStatus(service.ServiceStatus) publicPorts := utils.MapMapValues(service.MaybePublicPorts, toHttpPorts) privatePorts := utils.MapMapValues(service.PrivatePorts, toHttpPorts) - return api.ServiceInfo{ + return api_type.ServiceInfo{ Container: container, PublicIpAddr: &service.MaybePublicIpAddr, PublicPorts: &publicPorts, @@ -815,40 +816,40 @@ func toHttpServiceInfo(service *rpc_api.ServiceInfo) api.ServiceInfo { } } -func toHttpFeatureFlag(flag rpc_api.KurtosisFeatureFlag) api.KurtosisFeatureFlag { +func toHttpFeatureFlag(flag rpc_api.KurtosisFeatureFlag) api_type.KurtosisFeatureFlag { switch flag { case rpc_api.KurtosisFeatureFlag_NO_INSTRUCTIONS_CACHING: - return api.NOINSTRUCTIONSCACHING + return api_type.NOINSTRUCTIONSCACHING default: panic(fmt.Sprintf("Missing conversion of Feature Flag Enum value: %s", flag)) } } -func toHttpRestartPolicy(policy rpc_api.RestartPolicy) api.RestartPolicy { +func toHttpRestartPolicy(policy rpc_api.RestartPolicy) api_type.RestartPolicy { switch policy { case rpc_api.RestartPolicy_ALWAYS: - return api.RestartPolicyALWAYS + return api_type.RestartPolicyALWAYS case rpc_api.RestartPolicy_NEVER: - return api.RestartPolicyNEVER + return api_type.RestartPolicyNEVER default: panic(fmt.Sprintf("Missing conversion of Restart Policy Enum value: %s", policy)) } } -func toGrpcFeatureFlag(flag api.KurtosisFeatureFlag) rpc_api.KurtosisFeatureFlag { +func toGrpcFeatureFlag(flag api_type.KurtosisFeatureFlag) rpc_api.KurtosisFeatureFlag { switch flag { - case api.NOINSTRUCTIONSCACHING: + case api_type.NOINSTRUCTIONSCACHING: return rpc_api.KurtosisFeatureFlag_NO_INSTRUCTIONS_CACHING default: panic(fmt.Sprintf("Missing conversion of Feature Flag Enum value: %s", flag)) } } -func toGrpcImageDownloadMode(flag api.ImageDownloadMode) rpc_api.ImageDownloadMode { +func toGrpcImageDownloadMode(flag api_type.ImageDownloadMode) rpc_api.ImageDownloadMode { switch flag { - case api.ImageDownloadModeALWAYS: + case api_type.ImageDownloadModeALWAYS: return rpc_api.ImageDownloadMode_always - case api.ImageDownloadModeMISSING: + case api_type.ImageDownloadModeMISSING: return rpc_api.ImageDownloadMode_missing default: panic(fmt.Sprintf("Missing conversion of Image Download Mode Enum value: %s", flag)) diff --git a/engine/server/engine/server/engine_rest_api_handler.go b/engine/server/engine/server/engine_rest_api_handler.go index 4e2a544abd..d7ddebe174 100644 --- a/engine/server/engine/server/engine_rest_api_handler.go +++ b/engine/server/engine/server/engine_rest_api_handler.go @@ -12,7 +12,8 @@ import ( "github.com/kurtosis-tech/stacktrace" "github.com/sirupsen/logrus" - api "github.com/kurtosis-tech/kurtosis/api/golang/engine/kurtosis_engine_rest_api_bindings" + api_type "github.com/kurtosis-tech/kurtosis/api/golang/http_rest/api_types" + api "github.com/kurtosis-tech/kurtosis/api/golang/http_rest/engine_rest_api" ) type EngineRuntime struct { @@ -39,7 +40,7 @@ func (engine EngineRuntime) DeleteEnclaves(ctx context.Context, request api.Dele } } removedApiResponse := utils.MapList(removedEnclaveUuidsAndNames, toHttpApiEnclaveNameAndUuid) - return api.DeleteEnclaves200JSONResponse(api.DeletionSummary{RemovedEnclaveNameAndUuids: &removedApiResponse}), nil + return api.DeleteEnclaves200JSONResponse(api_type.DeletionSummary{RemovedEnclaveNameAndUuids: &removedApiResponse}), nil } // Get Enclaves @@ -49,7 +50,7 @@ func (engine EngineRuntime) GetEnclaves(ctx context.Context, request api.GetEncl if err != nil { return nil, stacktrace.Propagate(err, "An error occurred getting info for enclaves") } - response := utils.MapMapValues(infoForEnclaves, func(enclave *types.EnclaveInfo) api.EnclaveInfo { return toHttpApiEnclaveInfo(*enclave) }) + response := utils.MapMapValues(infoForEnclaves, func(enclave *types.EnclaveInfo) api_type.EnclaveInfo { return toHttpApiEnclaveInfo(*enclave) }) return api.GetEnclaves200JSONResponse(response), nil } @@ -67,7 +68,7 @@ func (engine EngineRuntime) PostEnclaves(ctx context.Context, request api.PostEn } isProduction := false - if *request.Body.Mode == api.PRODUCTION { + if *request.Body.Mode == api_type.PRODUCTION { isProduction = true } @@ -153,7 +154,7 @@ func (engine EngineRuntime) PostEnclavesEnclaveIdentifierStatus(ctx context.Cont targetState := request.Body switch *targetState { - case api.STOP: + case api_type.STOP: if err := engine.MetricsClient.TrackStopEnclave(enclaveIdentifier); err != nil { logrus.Warnf("An error occurred while logging the stop enclave event for enclave '%v'", enclaveIdentifier) } @@ -172,7 +173,7 @@ func (engine EngineRuntime) PostEnclavesEnclaveIdentifierStatus(ctx context.Cont // Get Engine Info // (GET /engine/info) func (engine EngineRuntime) GetEngineInfo(ctx context.Context, request api.GetEngineInfoRequestObject) (api.GetEngineInfoResponseObject, error) { - result := api.EngineInfo{EngineVersion: engine.ImageVersionTag} + result := api_type.EngineInfo{EngineVersion: engine.ImageVersionTag} return api.GetEngineInfo200JSONResponse(result), nil } @@ -180,35 +181,35 @@ func (engine EngineRuntime) GetEngineInfo(ctx context.Context, request api.GetEn // ============================================== Helper Functions ============================================================================= // ============================================================================================================================================= -func toHttpApiEnclaveContainersStatus(status types.EnclaveContainersStatus) api.EnclaveContainersStatus { +func toHttpApiEnclaveContainersStatus(status types.EnclaveContainersStatus) api_type.EnclaveContainersStatus { switch status { case types.EnclaveContainersStatus_EMPTY: - return api.EnclaveContainersStatusEMPTY + return api_type.EnclaveContainersStatusEMPTY case types.EnclaveContainersStatus_STOPPED: - return api.EnclaveContainersStatusSTOPPED + return api_type.EnclaveContainersStatusSTOPPED case types.EnclaveContainersStatus_RUNNING: - return api.EnclaveContainersStatusRUNNING + return api_type.EnclaveContainersStatusRUNNING default: panic(fmt.Sprintf("Undefined mapping of value: %s", status)) } } -func toHttpApiContainerStatus(status types.ContainerStatus) api.ApiContainerStatus { +func toHttpApiContainerStatus(status types.ContainerStatus) api_type.ApiContainerStatus { switch status { case types.ContainerStatus_NONEXISTENT: - return api.ApiContainerStatusNONEXISTENT + return api_type.ApiContainerStatusNONEXISTENT case types.ContainerStatus_STOPPED: - return api.ApiContainerStatusSTOPPED + return api_type.ApiContainerStatusSTOPPED case types.ContainerStatus_RUNNING: - return api.ApiContainerStatusRUNNING + return api_type.ApiContainerStatusRUNNING default: panic(fmt.Sprintf("Undefined mapping of value: %s", status)) } } -func toHttpApiEnclaveAPIContainerInfo(info types.EnclaveAPIContainerInfo) api.EnclaveAPIContainerInfo { +func toHttpApiEnclaveAPIContainerInfo(info types.EnclaveAPIContainerInfo) api_type.EnclaveAPIContainerInfo { port := int(info.GrpcPortInsideEnclave) - return api.EnclaveAPIContainerInfo{ + return api_type.EnclaveAPIContainerInfo{ ContainerId: info.ContainerId, IpInsideEnclave: info.IpInsideEnclave, GrpcPortInsideEnclave: port, @@ -216,27 +217,27 @@ func toHttpApiEnclaveAPIContainerInfo(info types.EnclaveAPIContainerInfo) api.En } } -func toHttpApiApiContainerHostMachineInfo(info types.EnclaveAPIContainerHostMachineInfo) api.EnclaveAPIContainerHostMachineInfo { +func toHttpApiApiContainerHostMachineInfo(info types.EnclaveAPIContainerHostMachineInfo) api_type.EnclaveAPIContainerHostMachineInfo { port := int(info.GrpcPortOnHostMachine) - return api.EnclaveAPIContainerHostMachineInfo{ + return api_type.EnclaveAPIContainerHostMachineInfo{ IpOnHostMachine: info.IpOnHostMachine, GrpcPortOnHostMachine: port, } } -func toHttpApiEnclaveMode(mode types.EnclaveMode) api.EnclaveMode { +func toHttpApiEnclaveMode(mode types.EnclaveMode) api_type.EnclaveMode { switch mode { case types.EnclaveMode_PRODUCTION: - return api.PRODUCTION + return api_type.PRODUCTION case types.EnclaveMode_TEST: - return api.TEST + return api_type.TEST default: panic(fmt.Sprintf("Undefined mapping of value: %s", mode)) } } -func toHttpApiEnclaveInfo(info types.EnclaveInfo) api.EnclaveInfo { - return api.EnclaveInfo{ +func toHttpApiEnclaveInfo(info types.EnclaveInfo) api_type.EnclaveInfo { + return api_type.EnclaveInfo{ EnclaveUuid: info.EnclaveUuid, ShortenedUuid: info.ShortenedUuid, Name: info.Name, @@ -249,29 +250,29 @@ func toHttpApiEnclaveInfo(info types.EnclaveInfo) api.EnclaveInfo { } } -func toHttpApiEnclaveIdentifiers(identifier *types.EnclaveIdentifiers) api.EnclaveIdentifiers { - return api.EnclaveIdentifiers{ +func toHttpApiEnclaveIdentifiers(identifier *types.EnclaveIdentifiers) api_type.EnclaveIdentifiers { + return api_type.EnclaveIdentifiers{ EnclaveUuid: identifier.EnclaveUuid, Name: identifier.Name, ShortenedUuid: identifier.ShortenedUuid, } } -func toHttpApiEnclaveNameAndUuid(identifier *types.EnclaveNameAndUuid) api.EnclaveNameAndUuid { - return api.EnclaveNameAndUuid{ +func toHttpApiEnclaveNameAndUuid(identifier *types.EnclaveNameAndUuid) api_type.EnclaveNameAndUuid { + return api_type.EnclaveNameAndUuid{ Uuid: identifier.Uuid, Name: identifier.Name, } } -func toHttpEnclaveContainersStatus(status types.EnclaveContainersStatus) api.EnclaveContainersStatus { +func toHttpEnclaveContainersStatus(status types.EnclaveContainersStatus) api_type.EnclaveContainersStatus { switch status { case types.EnclaveContainersStatus_STOPPED: - return api.EnclaveContainersStatusSTOPPED + return api_type.EnclaveContainersStatusSTOPPED case types.EnclaveContainersStatus_RUNNING: - return api.EnclaveContainersStatusRUNNING + return api_type.EnclaveContainersStatusRUNNING case types.EnclaveContainersStatus_EMPTY: - return api.EnclaveContainersStatusEMPTY + return api_type.EnclaveContainersStatusEMPTY default: panic(fmt.Sprintf("Undefined mapping of value: %s", status)) } diff --git a/engine/server/engine/server/websocket_api_handler.go b/engine/server/engine/server/websocket_api_handler.go index 35d0b9a3d9..3fd6e64561 100644 --- a/engine/server/engine/server/websocket_api_handler.go +++ b/engine/server/engine/server/websocket_api_handler.go @@ -20,7 +20,8 @@ import ( "golang.org/x/exp/slices" "golang.org/x/net/websocket" - api "github.com/kurtosis-tech/kurtosis/api/golang/websocket/kurtosis_websocket_api_bindings" + api_type "github.com/kurtosis-tech/kurtosis/api/golang/http_rest/api_types" + api "github.com/kurtosis-tech/kurtosis/api/golang/http_rest/websocket_api" ) type WebSocketRuntime struct { @@ -62,7 +63,7 @@ type LogStreamer struct { notFoundServiceUuids []string } -func (engine WebSocketRuntime) GetEnclavesEnclaveIdentifierLogs(ctx echo.Context, enclaveIdentifier api.EnclaveIdentifier, params api.GetEnclavesEnclaveIdentifierLogsParams) error { +func (engine WebSocketRuntime) GetEnclavesEnclaveIdentifierLogs(ctx echo.Context, enclaveIdentifier api_type.EnclaveIdentifier, params api.GetEnclavesEnclaveIdentifierLogsParams) error { streamer, err := engine.getLogStreamer( ctx, enclaveIdentifier, @@ -85,8 +86,8 @@ func (engine WebSocketRuntime) GetEnclavesEnclaveIdentifierLogs(ctx echo.Context } -func (engine WebSocketRuntime) GetEnclavesEnclaveIdentifierServicesServiceUuidLogs(ctx echo.Context, enclaveIdentifier api.EnclaveIdentifier, serviceUuid api.ServiceUuid, params api.GetEnclavesEnclaveIdentifierServicesServiceUuidLogsParams) error { - serviceUuidStrSet := []user_service.ServiceUUID{user_service.ServiceUUID(serviceUuid)} +func (engine WebSocketRuntime) GetEnclavesEnclaveIdentifierServicesServiceIdentifierLogs(ctx echo.Context, enclaveIdentifier api_type.EnclaveIdentifier, serviceIdentifier api_type.ServiceIdentifier, params api.GetEnclavesEnclaveIdentifierServicesServiceIdentifierLogsParams) error { + serviceUuidStrSet := []user_service.ServiceUUID{user_service.ServiceUUID(serviceIdentifier)} streamer, err := engine.getLogStreamer( ctx, enclaveIdentifier, @@ -110,12 +111,12 @@ func (engine WebSocketRuntime) GetEnclavesEnclaveIdentifierServicesServiceUuidLo func (engine WebSocketRuntime) getLogStreamer( ctx echo.Context, - enclaveIdentifier api.EnclaveIdentifier, + enclaveIdentifier api_type.EnclaveIdentifier, serviceUuidList []user_service.ServiceUUID, maybeShouldFollowLogs *bool, maybeShouldReturnAllLogs *bool, maybeNumLogLines *uint32, - maybeFilters *[]api.LogLineFilter, + maybeFilters *[]api_type.LogLineFilter, ) (*LogStreamer, error) { enclaveUuid, err := engine.EnclaveManager.GetEnclaveUuidForEnclaveIdentifier(context.Background(), enclaveIdentifier) if err != nil { @@ -127,7 +128,7 @@ func (engine WebSocketRuntime) getLogStreamer( shouldFollowLogs := utils.DerefWith(maybeShouldFollowLogs, false) shouldReturnAllLogs := utils.DerefWith(maybeShouldReturnAllLogs, false) numLogLines := utils.DerefWith(maybeNumLogLines, 100) - filters := utils.DerefWith(maybeFilters, []api.LogLineFilter{}) + filters := utils.DerefWith(maybeFilters, []api_type.LogLineFilter{}) context := ctx.Request().Context() for _, serviceUuidStr := range serviceUuidList { @@ -310,7 +311,7 @@ func (service *WebSocketRuntime) getEnclaveCreationTime(ctx context.Context, enc } func fromHttpLogLineFilters( - logLineFilters []api.LogLineFilter, + logLineFilters []api_type.LogLineFilter, ) (logline.ConjunctiveLogLineFilters, error) { var conjunctiveLogLineFilters logline.ConjunctiveLogLineFilters @@ -319,13 +320,13 @@ func fromHttpLogLineFilters( operator := logLineFilter.Operator filterTextPattern := logLineFilter.TextPattern switch operator { - case api.DOESCONTAINTEXT: + case api_type.DOESCONTAINTEXT: filter = logline.NewDoesContainTextLogLineFilter(filterTextPattern) - case api.DOESNOTCONTAINTEXT: + case api_type.DOESNOTCONTAINTEXT: filter = logline.NewDoesNotContainTextLogLineFilter(filterTextPattern) - case api.DOESCONTAINMATCHREGEX: + case api_type.DOESCONTAINMATCHREGEX: filter = logline.NewDoesContainMatchRegexLogLineFilter(filterTextPattern) - case api.DOESNOTCONTAINMATCHREGEX: + case api_type.DOESNOTCONTAINMATCHREGEX: filter = logline.NewDoesNotContainMatchRegexLogLineFilter(filterTextPattern) default: return nil, stacktrace.NewError("Unrecognized log line filter operator '%v' in GRPC filter '%v'; this is a bug in Kurtosis", operator, logLineFilter) @@ -340,8 +341,8 @@ func newLogsResponseHttp( requestedServiceUuids []user_service.ServiceUUID, serviceLogsByServiceUuid map[user_service.ServiceUUID][]logline.LogLine, initialNotFoundServiceUuids []string, -) *api.ServiceLogs { - serviceLogLinesByUuid := make(map[string]api.LogLine, len(serviceLogsByServiceUuid)) +) *api_type.ServiceLogs { + serviceLogLinesByUuid := make(map[string]api_type.LogLine, len(serviceLogsByServiceUuid)) notFoundServiceUuids := make([]string, len(initialNotFoundServiceUuids)) for _, serviceUuid := range requestedServiceUuids { serviceUuidStr := string(serviceUuid) @@ -354,7 +355,7 @@ func newLogsResponseHttp( // there is no new log lines but is a found UUID, so it has to be included in the service logs map if !found && !isInNotFoundUuidList { - serviceLogLinesByUuid[serviceUuidStr] = api.LogLine{ + serviceLogLinesByUuid[serviceUuidStr] = api_type.LogLine{ Line: []string{}, Timestamp: time.Now(), } @@ -364,14 +365,14 @@ func newLogsResponseHttp( serviceLogLinesByUuid[serviceUuidStr] = logLines } - response := &api.ServiceLogs{ + response := &api_type.ServiceLogs{ NotFoundServiceUuidSet: ¬FoundServiceUuids, ServiceLogsByServiceUuid: &serviceLogLinesByUuid, } return response } -func newHttpBindingsLogLineFromLogLines(logLines []logline.LogLine) api.LogLine { +func newHttpBindingsLogLineFromLogLines(logLines []logline.LogLine) api_type.LogLine { logLinesStr := make([]string, len(logLines)) var logTimestamp time.Time @@ -380,6 +381,6 @@ func newHttpBindingsLogLineFromLogLines(logLines []logline.LogLine) api.LogLine logTimestamp = logLine.GetTimestamp() } - return api.LogLine{Line: logLinesStr, Timestamp: logTimestamp} + return api_type.LogLine{Line: logLinesStr, Timestamp: logTimestamp} } From ade15b714de6e3764f37f43fb4ff9ef20270dd53 Mon Sep 17 00:00:00 2001 From: lostbean Date: Wed, 29 Nov 2023 18:01:49 -0300 Subject: [PATCH 63/95] Add async starlark logs --- .../http_rest/api_types/api_types.gen.go | 218 ++++++++++++------ .../core_rest_api/api_container_server.gen.go | 196 ++++++++-------- .../websocket_api/websocket_server.gen.go | 58 ++++- api/openapi/specs/api_types.yaml | 44 +++- api/openapi/specs/core_service.yaml | 18 +- api/openapi/specs/websocket_service.yaml | 30 +++ .../engine/server/enclave_rest_api_handler.go | 207 ++++++++++++++--- .../engine/server/websocket_api_handler.go | 5 + engine/server/engine/utils/list.go | 10 + 9 files changed, 557 insertions(+), 229 deletions(-) diff --git a/api/golang/http_rest/api_types/api_types.gen.go b/api/golang/http_rest/api_types/api_types.gen.go index 4c09c02e09..3d92ea53b1 100644 --- a/api/golang/http_rest/api_types/api_types.gen.go +++ b/api/golang/http_rest/api_types/api_types.gen.go @@ -111,6 +111,14 @@ const ( // ApiContainerStatus defines model for ApiContainerStatus. type ApiContainerStatus string +// AsyncStarlarkExecutionLogs Use it to asynchronously retrieve the execution logs via Websockets or http streaming +type AsyncStarlarkExecutionLogs struct { + // AsyncStarlarkExecutionLogs Execution UUID to asynchronously retrieve the execution logs + AsyncStarlarkExecutionLogs struct { + StarlarkExecutionUuid string `json:"starlark_execution_uuid"` + } `json:"async_starlark_execution_logs"` +} + // Connect 0 - CONNECT // Best effort port forwarding // 1 - NO_CONNECT // Port forwarding disabled type Connect string @@ -487,11 +495,14 @@ type StarlarkInterpretationError struct { // StarlarkRunFinishedEvent defines model for StarlarkRunFinishedEvent. type StarlarkRunFinishedEvent struct { RunFinishedEvent struct { - IsRunSuccessful bool `json:"is_run_successful"` - SerializedOutput string `json:"serialized_output"` + IsRunSuccessful bool `json:"is_run_successful"` + SerializedOutput *string `json:"serialized_output,omitempty"` } `json:"run_finished_event"` } +// StarlarkRunLogs Starlark Execution Logs +type StarlarkRunLogs = []StarlarkRunResponseLine + // StarlarkRunProgress defines model for StarlarkRunProgress. type StarlarkRunProgress struct { ProgressInfo struct { @@ -501,6 +512,11 @@ type StarlarkRunProgress struct { } `json:"progress_info"` } +// StarlarkRunResponse defines model for StarlarkRunResponse. +type StarlarkRunResponse struct { + union json.RawMessage +} + // StarlarkRunResponseLine Starlark Execution Response type StarlarkRunResponseLine struct { union json.RawMessage @@ -591,6 +607,9 @@ type Retries = int32 // RetriesDelayMilliseconds defines model for retries_delay_milliseconds. type RetriesDelayMilliseconds = int32 +// RetrieveLogsAsync defines model for retrieve_logs_async. +type RetrieveLogsAsync = bool + // ReturnAllLogs defines model for return_all_logs. type ReturnAllLogs = bool @@ -600,6 +619,9 @@ type ServiceIdentifier = string // ServiceUuidSet defines model for service_uuid_set. type ServiceUuidSet = []string +// StarlarkExecutionUuid defines model for starlark_execution_uuid. +type StarlarkExecutionUuid = string + // AsStarlarkInterpretationError returns the union data inside the StarlarkError_Error as a StarlarkInterpretationError func (t StarlarkError_Error) AsStarlarkInterpretationError() (StarlarkInterpretationError, error) { var body StarlarkInterpretationError @@ -688,6 +710,68 @@ func (t *StarlarkError_Error) UnmarshalJSON(b []byte) error { return err } +// AsAsyncStarlarkExecutionLogs returns the union data inside the StarlarkRunResponse as a AsyncStarlarkExecutionLogs +func (t StarlarkRunResponse) AsAsyncStarlarkExecutionLogs() (AsyncStarlarkExecutionLogs, error) { + var body AsyncStarlarkExecutionLogs + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAsyncStarlarkExecutionLogs overwrites any union data inside the StarlarkRunResponse as the provided AsyncStarlarkExecutionLogs +func (t *StarlarkRunResponse) FromAsyncStarlarkExecutionLogs(v AsyncStarlarkExecutionLogs) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAsyncStarlarkExecutionLogs performs a merge with any union data inside the StarlarkRunResponse, using the provided AsyncStarlarkExecutionLogs +func (t *StarlarkRunResponse) MergeAsyncStarlarkExecutionLogs(v AsyncStarlarkExecutionLogs) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JsonMerge(b, t.union) + t.union = merged + return err +} + +// AsStarlarkRunLogs returns the union data inside the StarlarkRunResponse as a StarlarkRunLogs +func (t StarlarkRunResponse) AsStarlarkRunLogs() (StarlarkRunLogs, error) { + var body StarlarkRunLogs + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromStarlarkRunLogs overwrites any union data inside the StarlarkRunResponse as the provided StarlarkRunLogs +func (t *StarlarkRunResponse) FromStarlarkRunLogs(v StarlarkRunLogs) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeStarlarkRunLogs performs a merge with any union data inside the StarlarkRunResponse, using the provided StarlarkRunLogs +func (t *StarlarkRunResponse) MergeStarlarkRunLogs(v StarlarkRunLogs) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JsonMerge(b, t.union) + t.union = merged + return err +} + +func (t StarlarkRunResponse) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *StarlarkRunResponse) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + // AsStarlarkInstruction returns the union data inside the StarlarkRunResponseLine as a StarlarkInstruction func (t StarlarkRunResponseLine) AsStarlarkInstruction() (StarlarkInstruction, error) { var body StarlarkInstruction @@ -883,69 +967,73 @@ func (t *StarlarkRunResponseLine) UnmarshalJSON(b []byte) error { // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/+w8XW/jNrZ/hdC9wLQLTWb2AxcXeUsTZ8bYiW3YzqaLZqClpWObHYrUkpQz7iL//YIU", - "KVMSJctzd9uXvrSNeHh4vnh4vtx/RSnPC86AKRld/ysqsMA5KBDmLywU2eJUJSQDpsiWgNCfM5CpIIUi", - "nEXX0XoPyAEihnNAXKCyJFkUR0QDFFjtozjSS9F1EGccCfhnSQRk0bUSJcSRTPeQY32YOhZ6m1SCsF30", - "+hpHKWc/lyxV5ADJllBHrDnrnyWI4+mwEKiPnCjIzeb/FrCNrqP/encSx7sKTL77xHefCIN7sz96jR1J", - "WAh8NBQBSyk+wKCYHh+ndzGSey4UMMhQ9TcXVmRbpPaALKKw5AKnXCY4+FpAqiBLBMiCMwldKqeOjqzg", - "hCkkQJWCSaT2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plA3HBuaoKv02VtwO5gJyrAEM/l1IhjLYU7zTghGU6OqiqgZUOGXfleY4qtepcYMCyQnl2z1mtzOpB", + "f/4fz/I7eJb/2P//0/4lCIIp+RWyRNa6faYe3pkSitVWVevJSfHgJD/CQq02RAcfKacUUtcWou/hcbWJ", + "ttXGNkTbC/qYBMXMUwG7ajBP5LXMDKcdhoh00syBJqOWEGeJdjehYfOSaojbl547gVfcH1Xs9rPt34R3", + "IcgBq7q4FcZqukC28nXa3uo59KZe1ruIvjMN9goMyWzus6HzoSg3lKT9EizMe1+IP/BSab7/4DOOXvYg", + "oC2dRAJwuscbCk9sNl9PPqBH112s/b/LJTYT2BuFRMkYYbt2131GMv0ugy1h2oyOpnNEms8JTEcoTp+B", + "ZSjjYIjIsjCtJQL0/3TQXsnpQb/lQbArOP49WDu9H1ewssrelKl+E+te/Sst+9Q+TpW5vyh1ApVXpRpy", + "DK497MSlcpVsecmyJNh6ODqF52abTtDNMTndj2/RFZdhfA31Y/WJ+fs1zbgzerDy8ZsEYeHgKRDw+J9B", + "nIuHRkQ8w3eOQPRvrvRJUedszqSavARPO8JpQq3QsX9pHNT6gKM7P7RyG61BJILb0xedd0AKGrjrBDVd", + "8l2Vc485g/k2+vDTGddqqU2ZAlEIUCabWdF+jcfN/RumJPuGeXVfqJ32pVOMNM8HQWiTCBiga9aEAbiS", + "/sRoiKN6+NnW0dPlh0QJh3Kk56lUokzDTkdPGS9Ra/RZgfyFRwze8jMiD4iBxa7M3bepo/xlgOy1JRJs", + "OjWbo2Oy5ATPjlvx3vc7WCIT+UyKArLQdwtxVHBJ3AoXirFwUzvOy70I8Bh7EPZK22J75F7VoIb2bBAf", + "AYUAqb2edpdhmDx3q8mZu/xFt9lmVmjNkTIuvM06vVzRMmcjz0h9BvQC4kqn474BamSticauEGp5Gilb", + "X/uJr0GiZ4yHc3j46G0KTL/E/fTP8WXuHmoBqf1Bv885EeRhSLJlye4II3IP2eQQNEVR6gikGpJAeIy2", + "jpIlskxTkHJb0rMW2XQbnTlVOpTPYhBg+AwC4U9g6uRZ89nJ5+pDkosOkWXJXJ3y5FpSHyDe0IXgO9e3", + "fNL8ZN8k4ZM8LYUAphKpoKiHjL+ItaZfVi7nOvTU8+S3+KAu322SYdbOKkEbrTP7v/R+ymBctDvwKdXY", + "oNXp3euXMDOuS+asUi6b3zu4NFRvju/RofZFgbmv0GPndM+XC1Zr+7KxEx+x+WT4Aha3vL1vpzeXjnke", + "6gG/z8HQWX/IJBweHR5fzrwYz/7phLMCuKXDfHMBpmHR9SveCZ7bzE5/o/NwWajdRRjM+/FSpNVdvecX", + "bTaS01IBqkZWv8fgZXWrp9VCdUsDL4htaTifGvQYGOhKNPA8wqaFUMi1cAHoETao3fs5sp5yOX6lCDQB", + "PCw/I8WRKwVWP0jgulBHoaLJDqCx9rsG69Mqwwre2hb8DqPd/q5gnnB9s7A5wtXNeuEShLcLLzm4vtF/", + "6ddRHOlXX+LQ18fu/FZEUf3uejFF62NhMjt1s3v0/uqPV+81f7wAhgsSfYj+fPX+6n1U/SaI3qvX1/8L", + "AAD//6YRv9ydSQAA", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/api/golang/http_rest/core_rest_api/api_container_server.gen.go b/api/golang/http_rest/core_rest_api/api_container_server.gen.go index 3ef2171331..897a8f3dae 100644 --- a/api/golang/http_rest/core_rest_api/api_container_server.gen.go +++ b/api/golang/http_rest/core_rest_api/api_container_server.gen.go @@ -63,6 +63,18 @@ type GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAva // PostEnclavesEnclaveIdentifierStarlarkPackagesMultipartBody defines parameters for PostEnclavesEnclaveIdentifierStarlarkPackages. type PostEnclavesEnclaveIdentifierStarlarkPackagesMultipartBody = openapi_types.File +// PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdParams defines parameters for PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId. +type PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdParams struct { + // RetrieveLogsAsync If false, block http response until all logs are available. Default is true + RetrieveLogsAsync *externalRef0.RetrieveLogsAsync `form:"retrieve_logs_async,omitempty" json:"retrieve_logs_async,omitempty"` +} + +// PostEnclavesEnclaveIdentifierStarlarkScriptsParams defines parameters for PostEnclavesEnclaveIdentifierStarlarkScripts. +type PostEnclavesEnclaveIdentifierStarlarkScriptsParams struct { + // RetrieveLogsAsync If false, block http response until all logs are available. Default is true + RetrieveLogsAsync *externalRef0.RetrieveLogsAsync `form:"retrieve_logs_async,omitempty" json:"retrieve_logs_async,omitempty"` +} + // PostEnclavesEnclaveIdentifierArtifactsLocalFileMultipartRequestBody defines body for PostEnclavesEnclaveIdentifierArtifactsLocalFile for multipart/form-data ContentType. type PostEnclavesEnclaveIdentifierArtifactsLocalFileMultipartRequestBody = PostEnclavesEnclaveIdentifierArtifactsLocalFileMultipartBody @@ -133,10 +145,10 @@ type ServerInterface interface { PostEnclavesEnclaveIdentifierStarlarkPackages(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier) error // (POST /enclaves/{enclave_identifier}/starlark/packages/{package_id}) - PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, packageId externalRef0.PackageId) error + PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, packageId externalRef0.PackageId, params PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdParams) error // (POST /enclaves/{enclave_identifier}/starlark/scripts) - PostEnclavesEnclaveIdentifierStarlarkScripts(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier) error + PostEnclavesEnclaveIdentifierStarlarkScripts(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, params PostEnclavesEnclaveIdentifierStarlarkScriptsParams) error } // ServerInterfaceWrapper converts echo contexts to parameters. @@ -503,8 +515,17 @@ func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierStarlarkPackagesPa return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter package_id: %s", err)) } + // Parameter object where we will unmarshal all parameters from the context + var params PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdParams + // ------------- Optional query parameter "retrieve_logs_async" ------------- + + err = runtime.BindQueryParameter("form", true, false, "retrieve_logs_async", ctx.QueryParams(), ¶ms.RetrieveLogsAsync) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter retrieve_logs_async: %s", err)) + } + // Invoke the callback with all the unmarshalled arguments - err = w.Handler.PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId(ctx, enclaveIdentifier, packageId) + err = w.Handler.PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId(ctx, enclaveIdentifier, packageId, params) return err } @@ -519,8 +540,17 @@ func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierStarlarkScripts(ct return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter enclave_identifier: %s", err)) } + // Parameter object where we will unmarshal all parameters from the context + var params PostEnclavesEnclaveIdentifierStarlarkScriptsParams + // ------------- Optional query parameter "retrieve_logs_async" ------------- + + err = runtime.BindQueryParameter("form", true, false, "retrieve_logs_async", ctx.QueryParams(), ¶ms.RetrieveLogsAsync) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter retrieve_logs_async: %s", err)) + } + // Invoke the callback with all the unmarshalled arguments - err = w.Handler.PostEnclavesEnclaveIdentifierStarlarkScripts(ctx, enclaveIdentifier) + err = w.Handler.PostEnclavesEnclaveIdentifierStarlarkScripts(ctx, enclaveIdentifier, params) return err } @@ -992,6 +1022,7 @@ func (response PostEnclavesEnclaveIdentifierStarlarkPackagesdefaultJSONResponse) type PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdRequestObject struct { EnclaveIdentifier externalRef0.EnclaveIdentifier `json:"enclave_identifier"` PackageId externalRef0.PackageId `json:"package_id"` + Params PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdParams Body *PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdJSONRequestBody } @@ -999,7 +1030,7 @@ type PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdResponseObject interf VisitPostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdResponse(w http.ResponseWriter) error } -type PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId200JSONResponse []externalRef0.StarlarkRunResponseLine +type PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId200JSONResponse externalRef0.StarlarkRunResponse func (response PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId200JSONResponse) VisitPostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -1008,25 +1039,6 @@ func (response PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId200JSONResp return json.NewEncoder(w).Encode(response) } -type PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId200ApplicationoctetStreamResponse struct { - Body io.Reader - ContentLength int64 -} - -func (response PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId200ApplicationoctetStreamResponse) VisitPostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "application/octet-stream") - if response.ContentLength != 0 { - w.Header().Set("Content-Length", fmt.Sprint(response.ContentLength)) - } - w.WriteHeader(200) - - if closer, ok := response.Body.(io.ReadCloser); ok { - defer closer.Close() - } - _, err := io.Copy(w, response.Body) - return err -} - type PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIddefaultJSONResponse struct { Body externalRef0.ResponseInfo StatusCode int @@ -1041,6 +1053,7 @@ func (response PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIddefaultJSON type PostEnclavesEnclaveIdentifierStarlarkScriptsRequestObject struct { EnclaveIdentifier externalRef0.EnclaveIdentifier `json:"enclave_identifier"` + Params PostEnclavesEnclaveIdentifierStarlarkScriptsParams Body *PostEnclavesEnclaveIdentifierStarlarkScriptsJSONRequestBody } @@ -1048,7 +1061,7 @@ type PostEnclavesEnclaveIdentifierStarlarkScriptsResponseObject interface { VisitPostEnclavesEnclaveIdentifierStarlarkScriptsResponse(w http.ResponseWriter) error } -type PostEnclavesEnclaveIdentifierStarlarkScripts200JSONResponse []externalRef0.StarlarkRunResponseLine +type PostEnclavesEnclaveIdentifierStarlarkScripts200JSONResponse externalRef0.StarlarkRunResponse func (response PostEnclavesEnclaveIdentifierStarlarkScripts200JSONResponse) VisitPostEnclavesEnclaveIdentifierStarlarkScriptsResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -1057,25 +1070,6 @@ func (response PostEnclavesEnclaveIdentifierStarlarkScripts200JSONResponse) Visi return json.NewEncoder(w).Encode(response) } -type PostEnclavesEnclaveIdentifierStarlarkScripts200ApplicationoctetStreamResponse struct { - Body io.Reader - ContentLength int64 -} - -func (response PostEnclavesEnclaveIdentifierStarlarkScripts200ApplicationoctetStreamResponse) VisitPostEnclavesEnclaveIdentifierStarlarkScriptsResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "application/octet-stream") - if response.ContentLength != 0 { - w.Header().Set("Content-Length", fmt.Sprint(response.ContentLength)) - } - w.WriteHeader(200) - - if closer, ok := response.Body.(io.ReadCloser); ok { - defer closer.Close() - } - _, err := io.Copy(w, response.Body) - return err -} - type PostEnclavesEnclaveIdentifierStarlarkScriptsdefaultJSONResponse struct { Body externalRef0.ResponseInfo StatusCode int @@ -1549,11 +1543,12 @@ func (sh *strictHandler) PostEnclavesEnclaveIdentifierStarlarkPackages(ctx echo. } // PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId operation middleware -func (sh *strictHandler) PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, packageId externalRef0.PackageId) error { +func (sh *strictHandler) PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, packageId externalRef0.PackageId, params PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdParams) error { var request PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdRequestObject request.EnclaveIdentifier = enclaveIdentifier request.PackageId = packageId + request.Params = params var body PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdJSONRequestBody if err := ctx.Bind(&body); err != nil { @@ -1581,10 +1576,11 @@ func (sh *strictHandler) PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId( } // PostEnclavesEnclaveIdentifierStarlarkScripts operation middleware -func (sh *strictHandler) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier) error { +func (sh *strictHandler) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, params PostEnclavesEnclaveIdentifierStarlarkScriptsParams) error { var request PostEnclavesEnclaveIdentifierStarlarkScriptsRequestObject request.EnclaveIdentifier = enclaveIdentifier + request.Params = params var body PostEnclavesEnclaveIdentifierStarlarkScriptsJSONRequestBody if err := ctx.Bind(&body); err != nil { @@ -1614,60 +1610,60 @@ func (sh *strictHandler) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx echo.C // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/+xba2/btvr/KoT+f6Db4MbZBcNB3vWStMbpUiNJ0QMshUdLjyyuFKmRVBIv8Hc/4M2i", - "LMqW0zTJdvamaSJensvvuZK8TVJeVpwBUzI5uk0qLHAJCoT5DQtFcpyqGcmAKZITEPrPGchUkEoRzpKj", - "5KIA5AcihktAXKC6JlkySogeUGFVJKNEf0qOomuOEgF/1ERAlhwpUcMokWkBJdabqWWlp0klCFskq9Uo", - "AZZSfAVbifrwYfJ6hGTBhQIGGbK/c+EIzJEqALmF4nRGdtmTzJsKUgXZTICsOJPQpXLi6cgqTphCAlQt", -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HinbeOFR4E9MQe+5jUMllRJC256qrpqYk/VzH", + "h11jjOh0LRUULSHPuBwg5fcanTc2DtyTuP24d93NwWAiPNkZB2++UGPukpzuU6DQQTy+Btnm2R4VOgNK", + "pW+LhXcBAvfZUq/tNOEK5l9B104M4l9R2e5lvB+PiDHZd8fE5gWJL1XpO6ju09BUV7DIyU37GsnmTrqb", + "8XLdobc4vGZ3z5rr0kXZ6oHdiyKP9u6K3ML5qurfmS9vmgnV/7R230TudW86k7MpkyVkans1C5gbk+xe", + "0rhDqub/8+B6GbvZ/vA5X9jgeKJZX1RXJj4SdyqNn47Inlg9yM3dUY38+X8ddeKZAvVcKgG4uPXFwcfT", + "FB8pA00YLkAfne5LSjtMAKr9lsdQR9clKNMs1gy1Y6jYrVdZoxUx7n33AT8/Qh0QjlKeVva/zaQye3nU", + "93Lj5aMEUctr5+ro7TIgr1ov62OfcOrub9YOz1IeXZ4rIhUX684IcOLeRwXmhvCcV7bRA9dEmknOeXVw", + "8MPPyEIjGaYosL7be5J3Dqu/TAsoMpx+UpnA3krozk7/yZUkX6kUaPjmJyvKSVbfmo87ZzvSAFvfLskl", + "sO2zDDf6xn7cW5e+d3PaLdUILu3/vYrW8L1CRDl2Xiw8XP3afqXwhFXXv8mVk5vgId9m0nj31xWnXpin", + "U/axVK3Z5mlb663v9v3UaHt9mOjCWPBquULY7vKsGN2HT3ztSZtxoewjtaPma8bHMoj9u8JHlQOWh2+J", + "h0DHajVkXc9T3gG7/YO/4UvveFD7ofegI4MnnV1BLGqzA83OzaU7jectKESxVPV1P1Gx22m+P+IpZGxD", + "ZvSNns2j+kSH0MTdspBDxnK71zLH6GxFJJIKSnvFywYY/5YhfPmQYdZ4eGkefkdemNwu4jc3yyc+zOuw", + "pQcS8OSmvlCzGZCoBeK23xG3V90rCeKZRHNYYbr4MoG5n9OHys2CK0WDfXLz/fLXSuUipvDAQ4fY9aWn", + "4aLs8fKRdfbUYfEwmvpIuufehfzNVW+z+W8AAAD//1aISs4OSQAA", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/api/golang/http_rest/websocket_api/websocket_server.gen.go b/api/golang/http_rest/websocket_api/websocket_server.gen.go index a488333d55..259b50c29d 100644 --- a/api/golang/http_rest/websocket_api/websocket_server.gen.go +++ b/api/golang/http_rest/websocket_api/websocket_server.gen.go @@ -19,6 +19,9 @@ import ( "github.com/labstack/echo/v4" ) +// NotOk defines model for NotOk. +type NotOk = externalRef0.ResponseInfo + // GetEnclavesEnclaveIdentifierLogsParams defines parameters for GetEnclavesEnclaveIdentifierLogs. type GetEnclavesEnclaveIdentifierLogsParams struct { ServiceUuidSet externalRef0.ServiceUuidSet `form:"service_uuid_set" json:"service_uuid_set"` @@ -44,6 +47,9 @@ type ServerInterface interface { // Get Service Logs // (GET /enclaves/{enclave_identifier}/services/{service_identifier}/logs) GetEnclavesEnclaveIdentifierServicesServiceIdentifierLogs(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, serviceIdentifier externalRef0.ServiceIdentifier, params GetEnclavesEnclaveIdentifierServicesServiceIdentifierLogsParams) error + + // (GET /enclaves/{enclave_identifier}/starlark/executions/{starlark_execution_uuid}/logs) + GetEnclavesEnclaveIdentifierStarlarkExecutionsStarlarkExecutionUuidLogs(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, starlarkExecutionUuid externalRef0.StarlarkExecutionUuid) error } // ServerInterfaceWrapper converts echo contexts to parameters. @@ -158,6 +164,30 @@ func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierServicesServiceIden return err } +// GetEnclavesEnclaveIdentifierStarlarkExecutionsStarlarkExecutionUuidLogs converts echo context to params. +func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierStarlarkExecutionsStarlarkExecutionUuidLogs(ctx echo.Context) error { + var err error + // ------------- Path parameter "enclave_identifier" ------------- + var enclaveIdentifier externalRef0.EnclaveIdentifier + + err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter enclave_identifier: %s", err)) + } + + // ------------- Path parameter "starlark_execution_uuid" ------------- + var starlarkExecutionUuid externalRef0.StarlarkExecutionUuid + + err = runtime.BindStyledParameterWithLocation("simple", false, "starlark_execution_uuid", runtime.ParamLocationPath, ctx.Param("starlark_execution_uuid"), &starlarkExecutionUuid) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter starlark_execution_uuid: %s", err)) + } + + // Invoke the callback with all the unmarshalled arguments + err = w.Handler.GetEnclavesEnclaveIdentifierStarlarkExecutionsStarlarkExecutionUuidLogs(ctx, enclaveIdentifier, starlarkExecutionUuid) + return err +} + // This is a simple interface which specifies echo.Route addition functions which // are present on both echo.Echo and echo.Group, since we want to allow using // either of them for path registration @@ -188,23 +218,29 @@ func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL router.GET(baseURL+"/enclaves/:enclave_identifier/logs", wrapper.GetEnclavesEnclaveIdentifierLogs) router.GET(baseURL+"/enclaves/:enclave_identifier/services/:service_identifier/logs", wrapper.GetEnclavesEnclaveIdentifierServicesServiceIdentifierLogs) + router.GET(baseURL+"/enclaves/:enclave_identifier/starlark/executions/:starlark_execution_uuid/logs", wrapper.GetEnclavesEnclaveIdentifierStarlarkExecutionsStarlarkExecutionUuidLogs) } // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/+xVTYvbMBD9K0Lt0cRpe/Ot0A8COSxslx5KMYo8TrSVR15plDYE//ciWdk4iTfrpZRe", - "ejJ2Zt68mfdmsufSNK1BQHK82PNWWNEAgY1v0uC9R0lqC2Wt9OGzQl7wBw92xzOOogFejIZm3MkNNCLm", - "EDQx+bWFmhf8VX4snPdhLl+a9VIhfIr5vMs47doALqwVO951GQeUWmyhVBUgqVqBDZgVOGlVS8oEZnd3", - "iw8ZcxtjCRAq1r8bywJVZmpGG2AJiGd9N62gzbGZkSoZt/DglYWKF2Q9DHtLLB1ZhetIszZam5+lNusn", - "BzYMGQFbGaNBYERD34S4UiuEJ/FOg0YQFRKsw1i70At5i6XQ+irH87BneDqwWyWvi/NlAyzFsWPcQRVp", - "kIRCsIw2gtKnphFYBT29rtgKGPwC6QkqpnBcvhEeL5PvAOC9qkoH9NR8LuKulXncgLN6Fy7vDlkx+rav", - "sUwytda0YEn1RkBDZW08huojlCdWPDYcVC5XuxO0ACCqSgUBhb45qT9hmQflzOoeJMUJn3/pgpC1iWQV", - "6fDbV1g5I38Asfc3C57xLVjXe2g+ezObB1zTAopW8YK/m81nc55FI0Rmedphl+8vt7nLD65f95MKPYnQ", - "4KLiBf8M9DFlp+fiMXXZ78HwTn4bn8MxJB+5J132bNaFpBNyhldlQvjY1Z6Qdn4XJqScnqfue9gU1xp0", - "vZHezufpD4cAoySibbWSUZT83gXd94Nluma84cZEZ51eoFsvJThXe80OFPql900j7K7XnyUQllCy5wyV", - "xHL5/vL6/IHdEg2Xnv/Uhy/L+u/Ev+PErvsdAAD//xARwii0CQAA", + "H4sIAAAAAAAC/+xXS2/bRhD+K4ttgV4IU01uvBWoUwgwGsOOkUNgEKvlUFqbnKX3oUYQ+N+LfVCiRFKh", + "kKK5RBdCxMw3r28e3FMu60YioNE029OGKVaDAeX/cYkvFrkRW8hLUXWvBdKMvllQO5pQZDXQbFQ0oZpv", + "oGZex0DtlX9VUNKM/pIeDadBTKd3cn0nED54fdom1OwaB86UYjvatgkF5BXbQi4KQCNKAcphFqC5Eo0R", + "0nn29LT8MyF6I5UBhIKE/1IR5yqRJTEbIBGIJiGahpnNMZgRKwlV8GaFgoJmRlnoxxa91EYJXHs3S1lV", + "8p+8kuvJhPVFRsBWUlbA0KOhrZ1cXgmESbxToRFEgQbWLq2ti8VYhTmrqos+not9w08Naiv45eJ82gCJ", + "cuQo11WFSzRMIChiNszEV3XNsHD1tFVBVkDgK3BroCACx8s34sd15esArBVFrsFM5Wcgd8nMoQPO7I2w", + "XBumKqZe8xCqkOhNjGfTonizJ8k0khjF+GsgegfhcszIY4QmAca1RcP4K1tPtMKUK9ck1BNONxJ1oO/f", + "0nx8jfPFAPr0sqapBGfOQPqiXXD7HuKlofEQoZdYymDsbBwgfG2AO8KAUjI0QFR22Cf6bgQq2YAyAuII", + "LMA9S6lqZmhGrUDz/h1NBm2V0Bq0domcrvG8SD452ZC1LsVfAsDRRhI8ez74IVcvwI0z9RhYeRcb+zQe", + "lCYvpUXH1xGSz+TosUXcXMhXuxM0X8+iEK4ArLo/sT9j/PfMdUG1Y2FGZj5Y7BLntQdNcqD87aEVOgWa", + "UInwsaTZl8uudRhL1EZZ7pHbZJ7ObWDdTOkHi/dKrhVoPVun59UDaFuZa6x9ECj0BorbrWvFuYqfmcJA", + "jbkuuu589v0pYqcZYSpX08+w0pK/giF/3C9pQregdCjd4ub3m4UrtmwAWSNoRt/fLG4WNPFjyjMqjdta", + "p/vh3m7Tbr+tA8MdF/2UWRY0o3+BuY3a8bk8qN6Fjde/iCZIchRJRy6HqQz1tAatOEOnfz/MEB+7z2ao", + "nV8AM1ROD5H2+Wz4v1ss/rPR3590I5P/0XIOWpe2Ip0LYfjbumZqF+pPIgiJKMm3CBWLpdP98M74DrpF", + "N3R8/lAeXqf1k4k/iolxtqaH28yRcvxgGzDz1MGwGkGPXYjo70irQf2myQo2rCppcg2zuz148HLw5smK", + "4v/k+cRR+90UmfWVO3W4DL8ELvPozYL2l1ABJXNLf8LuIaI0HN6t//0bAAD///QElcf6DwAA", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/api/openapi/specs/api_types.yaml b/api/openapi/specs/api_types.yaml index 0ed532b06a..91c21a4c65 100644 --- a/api/openapi/specs/api_types.yaml +++ b/api/openapi/specs/api_types.yaml @@ -41,6 +41,14 @@ components: description: The service identifier of the container that the command should be executed in required: true + starlark_execution_uuid: + name: starlark_execution_uuid + in: path + schema: + type: string + description: The unique identifier to track the execution of a Starlark script or package + required: true + service_uuid_set: name: service_uuid_set in: query @@ -49,6 +57,14 @@ components: type: array items: type: string + + retrieve_logs_async: + name: retrieve_logs_async + in: query + required: false + description: If false, block http response until all logs are available. Default is true + schema: + type: boolean remove_all: name: remove_all @@ -537,6 +553,13 @@ components: description: |- 0 - NO_INSTRUCTIONS_CACHING + StarlarkRunLogs: + type: array + items: + $ref: "#/components/schemas/StarlarkRunResponseLine" + description: |- + Starlark Execution Logs + StarlarkRunResponseLine: oneOf: - $ref: "#/components/schemas/StarlarkInstruction" @@ -729,10 +752,29 @@ components: type: string required: - is_run_successful - - serialized_output required: - run_finished_event + AsyncStarlarkExecutionLogs: + type: object + properties: + async_starlark_execution_logs: + type: object + properties: + starlark_execution_uuid: + type: string + description: Execution UUID to asynchronously retrieve the execution logs + required: + - starlark_execution_uuid + description: Use it to asynchronously retrieve the execution logs via Websockets or http streaming + required: + - async_starlark_execution_logs + + StarlarkRunResponse: + oneOf: + - $ref: "#/components/schemas/AsyncStarlarkExecutionLogs" + - $ref: "#/components/schemas/StarlarkRunLogs" + ServiceIdentifiers: type: object properties: diff --git a/api/openapi/specs/core_service.yaml b/api/openapi/specs/core_service.yaml index d4b04095aa..bdfdad7a97 100644 --- a/api/openapi/specs/core_service.yaml +++ b/api/openapi/specs/core_service.yaml @@ -41,6 +41,7 @@ paths: parameters: - $ref: './api_types.yaml#/components/parameters/enclave_identifier' - $ref: './api_types.yaml#/components/parameters/package_id' + - $ref: './api_types.yaml#/components/parameters/retrieve_logs_async' requestBody: content: application/json: @@ -53,21 +54,16 @@ paths: "200": description: Successful request content: - application/octet-stream: - schema: - type: string - format: binary application/json: schema: - type: array - items: - $ref: "./api_types.yaml#/components/schemas/StarlarkRunResponseLine" + $ref: "./api_types.yaml#/components/schemas/StarlarkRunResponse" /enclaves/{enclave_identifier}/starlark/scripts: post: description: Executes a Starlark script on the user's behalf parameters: - $ref: './api_types.yaml#/components/parameters/enclave_identifier' + - $ref: './api_types.yaml#/components/parameters/retrieve_logs_async' requestBody: content: application/json: @@ -80,15 +76,9 @@ paths: "200": description: Successful request content: - application/octet-stream: - schema: - type: string - format: binary application/json: schema: - type: array - items: - $ref: "./api_types.yaml#/components/schemas/StarlarkRunResponseLine" + $ref: "./api_types.yaml#/components/schemas/StarlarkRunResponse" /enclaves/{enclave_identifier}/services/{service_identifier}: get: diff --git a/api/openapi/specs/websocket_service.yaml b/api/openapi/specs/websocket_service.yaml index 0eef058677..2bc0ed6200 100644 --- a/api/openapi/specs/websocket_service.yaml +++ b/api/openapi/specs/websocket_service.yaml @@ -40,3 +40,33 @@ paths: application/json: schema: $ref: "./api_types.yaml#/components/schemas/ServiceLogs" + + /enclaves/{enclave_identifier}/starlark/executions/{starlark_execution_uuid}/logs: + get: + description: Executes a Starlark script on the user's behalf + parameters: + - $ref: './api_types.yaml#/components/parameters/enclave_identifier' + - $ref: './api_types.yaml#/components/parameters/starlark_execution_uuid' + responses: + default: + $ref: '#/components/responses/NotOk' + "200": + description: Successful request + content: + application/json: + schema: + type: array + items: + $ref: "./api_types.yaml#/components/schemas/StarlarkRunResponseLine" + +components: + + responses: + + NotOk: + description: Unexpected error + content: + application/json: + schema: + $ref: './api_types.yaml#/components/schemas/ResponseInfo' + required: true \ No newline at end of file diff --git a/engine/server/engine/server/enclave_rest_api_handler.go b/engine/server/engine/server/enclave_rest_api_handler.go index fecacbd173..00380943c4 100644 --- a/engine/server/engine/server/enclave_rest_api_handler.go +++ b/engine/server/engine/server/enclave_rest_api_handler.go @@ -2,8 +2,6 @@ package server import ( "context" - "crypto/sha1" - "encoding/hex" "encoding/json" "fmt" "io" @@ -582,34 +580,63 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkPackagesPack CloudUserId: request.Body.CloudUserId, ImageDownloadMode: utils.MapPointer(request.Body.ImageDownloadMode, toGrpcImageDownloadMode), } - client, err := (*apiContainerClient).RunStarlarkPackage(ctx, &runStarlarkPackageArgs) + + ctxWithCancel, cancelCtxFunc := context.WithCancel(ctx) + stream, err := (*apiContainerClient).RunStarlarkPackage(ctxWithCancel, &runStarlarkPackageArgs) if err != nil { + cancelCtxFunc() logrus.Errorf("Can't run Starlark package using gRPC call with enclave %s, error: %s", enclave_identifier, err) - return nil, stacktrace.NewError("Can't run Starlark package using gRPC call with enclave %s", enclave_identifier) + return nil, stacktrace.Propagate(err, "Can't run Starlark package using gRPC call with enclave %s", enclave_identifier) } - clientStream := grpc_file_streaming.NewClientStream[rpc_api.StreamedDataChunk, []byte](client) - // TODO: Why the gRPC is not sending the previous hash??? and we need to calc it manually - hasher := sha1.New() - previousBlockHash := "" - blockHash := "" - pipeReader := clientStream.PipeReader( - package_id, - func(dataChunk *rpc_api.StreamedDataChunk) ([]byte, string, error) { - blockHash = previousBlockHash - hasher.Reset() - hasher.Write(dataChunk.Data) - previousBlockHash = hex.EncodeToString(hasher.Sum(nil)) - return dataChunk.Data, blockHash, nil - }, - ) + asyncLogs := NewAsyncStarlarkLogs(cancelCtxFunc) + go asyncLogs.RunAsyncStarlarkLogs(stream) - response := api.PostEnclavesEnclaveIdentifierStarlarkScripts200ApplicationoctetStreamResponse{ - Body: pipeReader, - ContentLength: 0, // No file size is provided since we are streaming it directly + var response api_type.StarlarkRunResponse + response.FromStarlarkRunLogs(utils.MapList(asyncLogs.WaitAndConsumeAll(), toHttpApiStarlarkRunResponseLine)) + + return api.PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId200JSONResponse(response), nil +} + +type AsyncStarlarkLogs struct { + cancelCtxFunc context.CancelFunc + starlarkRunResponseLineChan chan *rpc_api.StarlarkRunResponseLine +} + +func NewAsyncStarlarkLogs(cancelCtxFunc context.CancelFunc) AsyncStarlarkLogs { + starlarkResponseLineChan := make(chan *rpc_api.StarlarkRunResponseLine) + return AsyncStarlarkLogs{ + cancelCtxFunc: cancelCtxFunc, + starlarkRunResponseLineChan: starlarkResponseLineChan, } +} - return api.PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId200ApplicationoctetStreamResponse(response), nil +func (async AsyncStarlarkLogs) RunAsyncStarlarkLogs(stream grpc.ClientStream) { + defer func() { + close(async.starlarkRunResponseLineChan) + async.cancelCtxFunc() + }() + for { + responseLine := new(rpc_api.StarlarkRunResponseLine) + err := stream.RecvMsg(responseLine) + if err == io.EOF { + logrus.Debugf("Successfully reached the end of the response stream. Closing.") + return + } + if err != nil { + logrus.Errorf("Unexpected error happened reading the stream. Client might have cancelled the stream\n%v", err.Error()) + return + } + async.starlarkRunResponseLineChan <- responseLine + } +} + +func (async AsyncStarlarkLogs) WaitAndConsumeAll() []rpc_api.StarlarkRunResponseLine { + var logs []rpc_api.StarlarkRunResponseLine + for elem := range async.starlarkRunResponseLineChan { + logs = append(logs, *elem) + } + return logs } // (POST /enclaves/{enclave_identifier}/starlark/scripts) @@ -641,24 +668,22 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx CloudUserId: request.Body.CloudUserId, ImageDownloadMode: utils.MapPointer(request.Body.ImageDownloadMode, toGrpcImageDownloadMode), } - client, err := (*apiContainerClient).RunStarlarkScript(ctx, &runStarlarkScriptArgs) + + ctxWithCancel, cancelCtxFunc := context.WithCancel(ctx) + stream, err := (*apiContainerClient).RunStarlarkScript(ctxWithCancel, &runStarlarkScriptArgs) if err != nil { - logrus.Errorf("Can't run Starlark script using gRPC call with enclave %s, error: %s", enclave_identifier, err) - return nil, stacktrace.NewError("Can't run Starlark script using gRPC call with enclave %s", enclave_identifier) - } - clientStream := grpc_file_streaming.NewClientStream[rpc_api.StreamedDataChunk, []byte](client) - pipeReader := clientStream.PipeReader( - "__RunStarlarkScript__", - func(dataChunk *rpc_api.StreamedDataChunk) ([]byte, string, error) { - return dataChunk.Data, dataChunk.PreviousChunkHash, nil - }, - ) - response := api.PostEnclavesEnclaveIdentifierStarlarkScripts200ApplicationoctetStreamResponse{ - Body: pipeReader, - ContentLength: 0, // No file size is provided since we are streaming it directly + cancelCtxFunc() + logrus.Errorf("Can't run Starlark package using gRPC call with enclave %s, error: %s", enclave_identifier, err) + return nil, stacktrace.Propagate(err, "Can't run Starlark script package using gRPC call with enclave %s", enclave_identifier) } - return api.PostEnclavesEnclaveIdentifierStarlarkScripts200ApplicationoctetStreamResponse(response), nil + asyncLogs := NewAsyncStarlarkLogs(cancelCtxFunc) + go asyncLogs.RunAsyncStarlarkLogs(stream) + + var response api_type.StarlarkRunResponse + response.FromStarlarkRunLogs(utils.MapList(asyncLogs.WaitAndConsumeAll(), toHttpApiStarlarkRunResponseLine)) + + return api.PostEnclavesEnclaveIdentifierStarlarkScripts200JSONResponse(response), nil } // =============================================================================================================== @@ -855,3 +880,109 @@ func toGrpcImageDownloadMode(flag api_type.ImageDownloadMode) rpc_api.ImageDownl panic(fmt.Sprintf("Missing conversion of Image Download Mode Enum value: %s", flag)) } } + +func toHttpApiStarlarkRunResponseLine(line rpc_api.StarlarkRunResponseLine) api_type.StarlarkRunResponseLine { + if runError := line.GetError(); runError != nil { + var http_type api_type.StarlarkRunResponseLine + http_type.FromStarlarkError(toHttpStarlarkError(*runError)) + return http_type + } + + if runInfo := line.GetInfo(); runInfo != nil { + var http_type api_type.StarlarkRunResponseLine + http_type.FromStarlarkInfo(toHttpStarlarkInfo(*runInfo)) + return http_type + } + + if runInstruction := line.GetInstruction(); runInstruction != nil { + var http_type api_type.StarlarkRunResponseLine + http_type.FromStarlarkInstruction(toHttpStarlarkInstruction(*runInstruction)) + return http_type + } + + if runInstructionResult := line.GetInstructionResult(); runInstructionResult != nil { + var http_type api_type.StarlarkRunResponseLine + http_type.FromStarlarkInstructionResult(toHttpStarlarkInstructionResult(*runInstructionResult)) + return http_type + } + + if runProgressInfo := line.GetProgressInfo(); runProgressInfo != nil { + var http_type api_type.StarlarkRunResponseLine + http_type.FromStarlarkRunProgress(toHttpStarlarkProgressInfo(*runProgressInfo)) + return http_type + } + + if runWarning := line.GetWarning(); runWarning != nil { + var http_type api_type.StarlarkRunResponseLine + http_type.FromStarlarkWarning(toHttpStarlarkWarning(*runWarning)) + return http_type + } + + if runFinishedEvent := line.GetRunFinishedEvent(); runFinishedEvent != nil { + var http_type api_type.StarlarkRunResponseLine + http_type.FromStarlarkRunFinishedEvent(toHttpStarlarkRunFinishedEvent(*runFinishedEvent)) + return http_type + } + + return api_type.StarlarkRunResponseLine{} +} + +func toHttpStarlarkError(rpc_value rpc_api.StarlarkError) api_type.StarlarkError { + return api_type.StarlarkError{ + // Error: rpc_value.Error, + } + +} +func toHttpStarlarkInfo(rpc_value rpc_api.StarlarkInfo) api_type.StarlarkInfo { + var info api_type.StarlarkInfo + info.Info.Instruction.InfoMessage = "" + return info +} + +func toHttpStarlarkInstruction(rpc_value rpc_api.StarlarkInstruction) api_type.StarlarkInstruction { + return api_type.StarlarkInstruction{ + Arguments: utils.MapList( + utils.FilterListNils(rpc_value.Arguments), + toHttpStarlarkInstructionArgument, + ), + } +} + +func toHttpStarlarkInstructionResult(rpc_value rpc_api.StarlarkInstructionResult) api_type.StarlarkInstructionResult { + var instructionResult api_type.StarlarkInstructionResult + instructionResult.InstructionResult.SerializedInstructionResult = rpc_value.SerializedInstructionResult + return instructionResult +} + +func toHttpStarlarkProgressInfo(rpc_value rpc_api.StarlarkRunProgress) api_type.StarlarkRunProgress { + var progress api_type.StarlarkRunProgress + progress.ProgressInfo.CurrentStepInfo = rpc_value.CurrentStepInfo + progress.ProgressInfo.CurrentStepNumber = int32(rpc_value.CurrentStepNumber) + progress.ProgressInfo.TotalSteps = int32(rpc_value.TotalSteps) + return progress +} + +func toHttpStarlarkWarning(rpc_value rpc_api.StarlarkWarning) api_type.StarlarkWarning { + var warning api_type.StarlarkWarning + warning.Warning.WarningMessage = rpc_value.WarningMessage + return warning +} + +func toHttpStarlarkRunResponseLine(rpc_value rpc_api.StarlarkRunResponseLine) api_type.StarlarkRunResponseLine { + return api_type.StarlarkRunResponseLine{} + +} +func toHttpStarlarkRunFinishedEvent(rpc_value rpc_api.StarlarkRunFinishedEvent) api_type.StarlarkRunFinishedEvent { + var event api_type.StarlarkRunFinishedEvent + event.RunFinishedEvent.IsRunSuccessful = rpc_value.IsRunSuccessful + event.RunFinishedEvent.SerializedOutput = rpc_value.SerializedOutput + return event +} + +func toHttpStarlarkInstructionArgument(rpc_value rpc_api.StarlarkInstructionArg) api_type.StarlarkInstructionArgument { + return api_type.StarlarkInstructionArgument{ + ArgName: rpc_value.ArgName, + IsRepresentative: rpc_value.IsRepresentative, + SerializedArgValue: rpc_value.SerializedArgValue, + } +} diff --git a/engine/server/engine/server/websocket_api_handler.go b/engine/server/engine/server/websocket_api_handler.go index 3fd6e64561..45269a0ece 100644 --- a/engine/server/engine/server/websocket_api_handler.go +++ b/engine/server/engine/server/websocket_api_handler.go @@ -109,6 +109,11 @@ func (engine WebSocketRuntime) GetEnclavesEnclaveIdentifierServicesServiceIdenti } } +// (GET /enclaves/{enclave_identifier}/starlark/executions/{starlark_execution_uuid}/logs) +func (engine WebSocketRuntime) GetEnclavesEnclaveIdentifierStarlarkExecutionsStarlarkExecutionUuidLogs(ctx echo.Context, enclaveIdentifier api_type.EnclaveIdentifier, starlarkExecutionUuid api_type.StarlarkExecutionUuid) error { + return nil +} + func (engine WebSocketRuntime) getLogStreamer( ctx echo.Context, enclaveIdentifier api_type.EnclaveIdentifier, diff --git a/engine/server/engine/utils/list.go b/engine/server/engine/utils/list.go index 344945329f..656f270322 100644 --- a/engine/server/engine/utils/list.go +++ b/engine/server/engine/utils/list.go @@ -19,3 +19,13 @@ func MapListStopOnError[T, U any](data []T, f func(T) (U, error)) ([]U, error) { } return res, nil } + +func FilterListNils[T any](data []*T) []T { + filterList := make([]T, len(data)) + for _, elem := range data { + if elem != nil { + filterList = append(filterList, *elem) + } + } + return filterList +} From 0a7a7961fe9f2bbf1a0cf58faa188e93b241877e Mon Sep 17 00:00:00 2001 From: lostbean Date: Wed, 29 Nov 2023 18:47:25 -0300 Subject: [PATCH 64/95] Merge OpenAPI specs --- .../http_rest/api_types/api_types.gen.go | 257 ++++---- .../core_rest_api/api_container_server.gen.go | 427 ++++++------- .../engine_rest_api/engine_server.gen.go | 133 ++-- .../websocket_api/websocket_server.gen.go | 91 ++- api/openapi/generators/api_types.cfg.yaml | 3 - api/openapi/generators/core_server.cfg.yaml | 11 +- api/openapi/generators/engine_server.cfg.yaml | 11 +- .../generators/websocket_server.cfg.yaml | 11 +- api/openapi/scripts/build.sh | 8 +- api/openapi/specs/core_service.yaml | 321 ---------- api/openapi/specs/engine_service.yaml | 149 ----- .../{api_types.yaml => kurtosis_api.yaml} | 575 +++++++++++++++++- api/openapi/specs/websocket_service.yaml | 72 --- .../engine/server/websocket_api_handler.go | 5 +- 14 files changed, 981 insertions(+), 1093 deletions(-) delete mode 100644 api/openapi/specs/core_service.yaml delete mode 100644 api/openapi/specs/engine_service.yaml rename api/openapi/specs/{api_types.yaml => kurtosis_api.yaml} (56%) delete mode 100644 api/openapi/specs/websocket_service.yaml diff --git a/api/golang/http_rest/api_types/api_types.gen.go b/api/golang/http_rest/api_types/api_types.gen.go index 3d92ea53b1..4264dddf25 100644 --- a/api/golang/http_rest/api_types/api_types.gen.go +++ b/api/golang/http_rest/api_types/api_types.gen.go @@ -4,18 +4,11 @@ package api_types import ( - "bytes" - "compress/gzip" - "encoding/base64" "encoding/json" - "fmt" - "net/url" - "path" - "strings" "time" "github.com/deepmap/oapi-codegen/pkg/runtime" - "github.com/getkin/kin-openapi/openapi3" + openapi_types "github.com/deepmap/oapi-codegen/pkg/types" ) // Defines values for ApiContainerStatus. @@ -622,6 +615,110 @@ type ServiceUuidSet = []string // StarlarkExecutionUuid defines model for starlark_execution_uuid. type StarlarkExecutionUuid = string +// NotOk defines model for NotOk. +type NotOk = ResponseInfo + +// DeleteEnclavesParams defines parameters for DeleteEnclaves. +type DeleteEnclavesParams struct { + // RemoveAll If true, remove all enclaves. Default is false + RemoveAll *RemoveAll `form:"remove_all,omitempty" json:"remove_all,omitempty"` +} + +// PostEnclavesEnclaveIdentifierArtifactsLocalFileMultipartBody defines parameters for PostEnclavesEnclaveIdentifierArtifactsLocalFile. +type PostEnclavesEnclaveIdentifierArtifactsLocalFileMultipartBody = openapi_types.File + +// GetEnclavesEnclaveIdentifierLogsParams defines parameters for GetEnclavesEnclaveIdentifierLogs. +type GetEnclavesEnclaveIdentifierLogsParams struct { + ServiceUuidSet ServiceUuidSet `form:"service_uuid_set" json:"service_uuid_set"` + FollowLogs *FollowLogs `form:"follow_logs,omitempty" json:"follow_logs,omitempty"` + ConjunctiveFilters *ConjunctiveFilters `form:"conjunctive_filters,omitempty" json:"conjunctive_filters,omitempty"` + ReturnAllLogs *ReturnAllLogs `form:"return_all_logs,omitempty" json:"return_all_logs,omitempty"` + NumLogLines *NumLogLines `form:"num_log_lines,omitempty" json:"num_log_lines,omitempty"` +} + +// GetEnclavesEnclaveIdentifierServicesParams defines parameters for GetEnclavesEnclaveIdentifierServices. +type GetEnclavesEnclaveIdentifierServicesParams struct { + // Services Select services to get information + Services *[]string `form:"services,omitempty" json:"services,omitempty"` +} + +// GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityParams defines parameters for GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability. +type GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityParams struct { + // HttpMethod The HTTP method used to check availability. Default is GET. + HttpMethod *HttpMethod `form:"http_method,omitempty" json:"http_method,omitempty"` + + // Path The path of the service to check. It mustn't start with the first slash. For instance `service/health` + Path *Path `form:"path,omitempty" json:"path,omitempty"` + + // InitialDelayMilliseconds The number of milliseconds to wait until executing the first HTTP call + InitialDelayMilliseconds *InitialDelayMilliseconds `form:"initial_delay_milliseconds,omitempty" json:"initial_delay_milliseconds,omitempty"` + + // Retries Max number of HTTP call attempts that this will execute until giving up and returning an error + Retries *Retries `form:"retries,omitempty" json:"retries,omitempty"` + + // RetriesDelayMilliseconds Number of milliseconds to wait between retries + RetriesDelayMilliseconds *RetriesDelayMilliseconds `form:"retries_delay_milliseconds,omitempty" json:"retries_delay_milliseconds,omitempty"` + + // ExpectedResponse If the endpoint returns this value, the service will be marked as available (e.g. Hello World). + ExpectedResponse *ExpectedResponse `form:"expected_response,omitempty" json:"expected_response,omitempty"` + + // RequestBody If the http_method is set to POST, this value will be send as the body of the availability request. + RequestBody *RequestBody `form:"request_body,omitempty" json:"request_body,omitempty"` +} + +// GetEnclavesEnclaveIdentifierServicesServiceIdentifierLogsParams defines parameters for GetEnclavesEnclaveIdentifierServicesServiceIdentifierLogs. +type GetEnclavesEnclaveIdentifierServicesServiceIdentifierLogsParams struct { + FollowLogs *FollowLogs `form:"follow_logs,omitempty" json:"follow_logs,omitempty"` + ConjunctiveFilters *ConjunctiveFilters `form:"conjunctive_filters,omitempty" json:"conjunctive_filters,omitempty"` + ReturnAllLogs *ReturnAllLogs `form:"return_all_logs,omitempty" json:"return_all_logs,omitempty"` + NumLogLines *NumLogLines `form:"num_log_lines,omitempty" json:"num_log_lines,omitempty"` +} + +// PostEnclavesEnclaveIdentifierStarlarkPackagesMultipartBody defines parameters for PostEnclavesEnclaveIdentifierStarlarkPackages. +type PostEnclavesEnclaveIdentifierStarlarkPackagesMultipartBody = openapi_types.File + +// PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdParams defines parameters for PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId. +type PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdParams struct { + // RetrieveLogsAsync If false, block http response until all logs are available. Default is true + RetrieveLogsAsync *RetrieveLogsAsync `form:"retrieve_logs_async,omitempty" json:"retrieve_logs_async,omitempty"` +} + +// PostEnclavesEnclaveIdentifierStarlarkScriptsParams defines parameters for PostEnclavesEnclaveIdentifierStarlarkScripts. +type PostEnclavesEnclaveIdentifierStarlarkScriptsParams struct { + // RetrieveLogsAsync If false, block http response until all logs are available. Default is true + RetrieveLogsAsync *RetrieveLogsAsync `form:"retrieve_logs_async,omitempty" json:"retrieve_logs_async,omitempty"` +} + +// PostEnclavesJSONRequestBody defines body for PostEnclaves for application/json ContentType. +type PostEnclavesJSONRequestBody = CreateEnclave + +// PostEnclavesEnclaveIdentifierArtifactsLocalFileMultipartRequestBody defines body for PostEnclavesEnclaveIdentifierArtifactsLocalFile for multipart/form-data ContentType. +type PostEnclavesEnclaveIdentifierArtifactsLocalFileMultipartRequestBody = PostEnclavesEnclaveIdentifierArtifactsLocalFileMultipartBody + +// PostEnclavesEnclaveIdentifierArtifactsRemoteFileJSONRequestBody defines body for PostEnclavesEnclaveIdentifierArtifactsRemoteFile for application/json ContentType. +type PostEnclavesEnclaveIdentifierArtifactsRemoteFileJSONRequestBody = StoreWebFilesArtifact + +// PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierJSONRequestBody defines body for PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier for application/json ContentType. +type PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierJSONRequestBody = StoreFilesArtifactFromService + +// PostEnclavesEnclaveIdentifierServicesConnectionJSONRequestBody defines body for PostEnclavesEnclaveIdentifierServicesConnection for application/json ContentType. +type PostEnclavesEnclaveIdentifierServicesConnectionJSONRequestBody = Connect + +// PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandJSONRequestBody defines body for PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand for application/json ContentType. +type PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandJSONRequestBody = ExecCommand + +// PostEnclavesEnclaveIdentifierStarlarkPackagesMultipartRequestBody defines body for PostEnclavesEnclaveIdentifierStarlarkPackages for multipart/form-data ContentType. +type PostEnclavesEnclaveIdentifierStarlarkPackagesMultipartRequestBody = PostEnclavesEnclaveIdentifierStarlarkPackagesMultipartBody + +// PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdJSONRequestBody defines body for PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId for application/json ContentType. +type PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdJSONRequestBody = RunStarlarkPackage + +// PostEnclavesEnclaveIdentifierStarlarkScriptsJSONRequestBody defines body for PostEnclavesEnclaveIdentifierStarlarkScripts for application/json ContentType. +type PostEnclavesEnclaveIdentifierStarlarkScriptsJSONRequestBody = RunStarlarkScript + +// PostEnclavesEnclaveIdentifierStatusJSONRequestBody defines body for PostEnclavesEnclaveIdentifierStatus for application/json ContentType. +type PostEnclavesEnclaveIdentifierStatusJSONRequestBody = EnclaveTargetStatus + // AsStarlarkInterpretationError returns the union data inside the StarlarkError_Error as a StarlarkInterpretationError func (t StarlarkError_Error) AsStarlarkInterpretationError() (StarlarkInterpretationError, error) { var body StarlarkInterpretationError @@ -963,147 +1060,3 @@ func (t *StarlarkRunResponseLine) UnmarshalJSON(b []byte) error { err := t.union.UnmarshalJSON(b) return err } - -// Base64 encoded, gzipped, json marshaled Swagger object -var swaggerSpec = []string{ - - "H4sIAAAAAAAC/+xcX2/jOJL/KoTugJ5ZqNO9f3A49FsmcbqN7diG7WxmMWloaalsc0KRGpJy2rPIdz+Q", - "IiXKomS5b3fmZV9mOhJZrPqxqlisKvmfUcrzgjNgSkYf/hkVWOAcFAjzFxaKbHGqEpIBU2RLQOjHGchU", - "kEIRzqIP0XoPyA1EDOeAuEBlSbIojogeUGC1j+JIv4o+BGnGkYBfSiIgiz4oUUIcyXQPOdaLqWOhp0kl", - "CNtFr69xlHL2c8lSRQ6QbAl1zJq1filBHJvFQkN94kRBbib/t4Bt9CH6r3cNHO+qYfLdZ777TBjcmfnR", - "a+xYwkLgo+EIWErxAQZheniY3sZI7rlQwCBD1d9cWMi2SO0BWUJh5AKrXAYcfC0gVZAlAmTBmYQul1PH", - "R1ZwwhQSoErBJFJ7ItEB0xJiM0CCOJAU0AuhFG0A5Vg8Q4awRPiACcUbCug7uNpdoU9AKUePXNDs+ysn", - "2Mk2dRkbFmTLKeUvCeW73p33hwSIbTingJmhtleqSHJQe56FtfvTer1A1QBUSsiQ4ijdQ/rshCWUqOMV", - "uoUtLqlCRKKPk3WfsP5yPmdDKvhJqeLe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Z89nJ5+pDkosOkWXJXJ3y5FpSHyDe0IXgO9e3", - "fNL8ZN8k4ZM8LYUAphKpoKiHjL+ItaZfVi7nOvTU8+S3+KAu322SYdbOKkEbrTP7v/R+ymBctDvwKdXY", - "oNXp3euXMDOuS+asUi6b3zu4NFRvju/RofZFgbmv0GPndM+XC1Zr+7KxEx+x+WT4Aha3vL1vpzeXjnke", - "6gG/z8HQWX/IJBweHR5fzrwYz/7phLMCuKXDfHMBpmHR9SveCZ7bzE5/o/NwWajdRRjM+/FSpNVdvecX", - "bTaS01IBqkZWv8fgZXWrp9VCdUsDL4htaTifGvQYGOhKNPA8wqaFUMi1cAHoETao3fs5sp5yOX6lCDQB", - "PCw/I8WRKwVWP0jgulBHoaLJDqCx9rsG69Mqwwre2hb8DqPd/q5gnnB9s7A5wtXNeuEShLcLLzm4vtF/", - "6ddRHOlXX+LQ18fu/FZEUf3uejFF62NhMjt1s3v0/uqPV+81f7wAhgsSfYj+fPX+6n1U/SaI3qvX1/8L", - "AAD//6YRv9ydSQAA", -} - -// GetSwagger returns the content of the embedded swagger specification file -// or error if failed to decode -func decodeSpec() ([]byte, error) { - zipped, err := base64.StdEncoding.DecodeString(strings.Join(swaggerSpec, "")) - if err != nil { - return nil, fmt.Errorf("error base64 decoding spec: %s", err) - } - zr, err := gzip.NewReader(bytes.NewReader(zipped)) - if err != nil { - return nil, fmt.Errorf("error decompressing spec: %s", err) - } - var buf bytes.Buffer - _, err = buf.ReadFrom(zr) - if err != nil { - return nil, fmt.Errorf("error decompressing spec: %s", err) - } - - return buf.Bytes(), nil -} - -var rawSpec = decodeSpecCached() - -// a naive cached of a decoded swagger spec -func decodeSpecCached() func() ([]byte, error) { - data, err := decodeSpec() - return func() ([]byte, error) { - return data, err - } -} - -// Constructs a synthetic filesystem for resolving external references when loading openapi specifications. -func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error) { - var res = make(map[string]func() ([]byte, error)) - if len(pathToFile) > 0 { - res[pathToFile] = rawSpec - } - - return res -} - -// GetSwagger returns the Swagger specification corresponding to the generated code -// in this file. The external references of Swagger specification are resolved. -// The logic of resolving external references is tightly connected to "import-mapping" feature. -// Externally referenced files must be embedded in the corresponding golang packages. -// Urls can be supported but this task was out of the scope. -func GetSwagger() (swagger *openapi3.T, err error) { - var resolvePath = PathToRawSpec("") - - loader := openapi3.NewLoader() - loader.IsExternalRefsAllowed = true - loader.ReadFromURIFunc = func(loader *openapi3.Loader, url *url.URL) ([]byte, error) { - var pathToFile = url.String() - pathToFile = path.Clean(pathToFile) - getSpec, ok := resolvePath[pathToFile] - if !ok { - err1 := fmt.Errorf("path not found: %s", pathToFile) - return nil, err1 - } - return getSpec() - } - var specData []byte - specData, err = rawSpec() - if err != nil { - return - } - swagger, err = loader.LoadFromData(specData) - if err != nil { - return - } - return -} diff --git a/api/golang/http_rest/core_rest_api/api_container_server.gen.go b/api/golang/http_rest/core_rest_api/api_container_server.gen.go index 897a8f3dae..208fac2985 100644 --- a/api/golang/http_rest/core_rest_api/api_container_server.gen.go +++ b/api/golang/http_rest/core_rest_api/api_container_server.gen.go @@ -18,137 +18,61 @@ import ( "strings" "github.com/deepmap/oapi-codegen/pkg/runtime" - openapi_types "github.com/deepmap/oapi-codegen/pkg/types" "github.com/getkin/kin-openapi/openapi3" - externalRef0 "github.com/kurtosis-tech/kurtosis/api/golang/http_rest/api_types" + . "github.com/kurtosis-tech/kurtosis/api/golang/http_rest/api_types" "github.com/labstack/echo/v4" ) -// NotOk defines model for NotOk. -type NotOk = externalRef0.ResponseInfo - -// PostEnclavesEnclaveIdentifierArtifactsLocalFileMultipartBody defines parameters for PostEnclavesEnclaveIdentifierArtifactsLocalFile. -type PostEnclavesEnclaveIdentifierArtifactsLocalFileMultipartBody = openapi_types.File - -// GetEnclavesEnclaveIdentifierServicesParams defines parameters for GetEnclavesEnclaveIdentifierServices. -type GetEnclavesEnclaveIdentifierServicesParams struct { - // Services Select services to get information - Services *[]string `form:"services,omitempty" json:"services,omitempty"` -} - -// GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityParams defines parameters for GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability. -type GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityParams struct { - // HttpMethod The HTTP method used to check availability. Default is GET. - HttpMethod *externalRef0.HttpMethod `form:"http_method,omitempty" json:"http_method,omitempty"` - - // Path The path of the service to check. It mustn't start with the first slash. For instance `service/health` - Path *externalRef0.Path `form:"path,omitempty" json:"path,omitempty"` - - // InitialDelayMilliseconds The number of milliseconds to wait until executing the first HTTP call - InitialDelayMilliseconds *externalRef0.InitialDelayMilliseconds `form:"initial_delay_milliseconds,omitempty" json:"initial_delay_milliseconds,omitempty"` - - // Retries Max number of HTTP call attempts that this will execute until giving up and returning an error - Retries *externalRef0.Retries `form:"retries,omitempty" json:"retries,omitempty"` - - // RetriesDelayMilliseconds Number of milliseconds to wait between retries - RetriesDelayMilliseconds *externalRef0.RetriesDelayMilliseconds `form:"retries_delay_milliseconds,omitempty" json:"retries_delay_milliseconds,omitempty"` - - // ExpectedResponse If the endpoint returns this value, the service will be marked as available (e.g. Hello World). - ExpectedResponse *externalRef0.ExpectedResponse `form:"expected_response,omitempty" json:"expected_response,omitempty"` - - // RequestBody If the http_method is set to POST, this value will be send as the body of the availability request. - RequestBody *externalRef0.RequestBody `form:"request_body,omitempty" json:"request_body,omitempty"` -} - -// PostEnclavesEnclaveIdentifierStarlarkPackagesMultipartBody defines parameters for PostEnclavesEnclaveIdentifierStarlarkPackages. -type PostEnclavesEnclaveIdentifierStarlarkPackagesMultipartBody = openapi_types.File - -// PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdParams defines parameters for PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId. -type PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdParams struct { - // RetrieveLogsAsync If false, block http response until all logs are available. Default is true - RetrieveLogsAsync *externalRef0.RetrieveLogsAsync `form:"retrieve_logs_async,omitempty" json:"retrieve_logs_async,omitempty"` -} - -// PostEnclavesEnclaveIdentifierStarlarkScriptsParams defines parameters for PostEnclavesEnclaveIdentifierStarlarkScripts. -type PostEnclavesEnclaveIdentifierStarlarkScriptsParams struct { - // RetrieveLogsAsync If false, block http response until all logs are available. Default is true - RetrieveLogsAsync *externalRef0.RetrieveLogsAsync `form:"retrieve_logs_async,omitempty" json:"retrieve_logs_async,omitempty"` -} - -// PostEnclavesEnclaveIdentifierArtifactsLocalFileMultipartRequestBody defines body for PostEnclavesEnclaveIdentifierArtifactsLocalFile for multipart/form-data ContentType. -type PostEnclavesEnclaveIdentifierArtifactsLocalFileMultipartRequestBody = PostEnclavesEnclaveIdentifierArtifactsLocalFileMultipartBody - -// PostEnclavesEnclaveIdentifierArtifactsRemoteFileJSONRequestBody defines body for PostEnclavesEnclaveIdentifierArtifactsRemoteFile for application/json ContentType. -type PostEnclavesEnclaveIdentifierArtifactsRemoteFileJSONRequestBody = externalRef0.StoreWebFilesArtifact - -// PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierJSONRequestBody defines body for PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier for application/json ContentType. -type PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierJSONRequestBody = externalRef0.StoreFilesArtifactFromService - -// PostEnclavesEnclaveIdentifierServicesConnectionJSONRequestBody defines body for PostEnclavesEnclaveIdentifierServicesConnection for application/json ContentType. -type PostEnclavesEnclaveIdentifierServicesConnectionJSONRequestBody = externalRef0.Connect - -// PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandJSONRequestBody defines body for PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand for application/json ContentType. -type PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandJSONRequestBody = externalRef0.ExecCommand - -// PostEnclavesEnclaveIdentifierStarlarkPackagesMultipartRequestBody defines body for PostEnclavesEnclaveIdentifierStarlarkPackages for multipart/form-data ContentType. -type PostEnclavesEnclaveIdentifierStarlarkPackagesMultipartRequestBody = PostEnclavesEnclaveIdentifierStarlarkPackagesMultipartBody - -// PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdJSONRequestBody defines body for PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId for application/json ContentType. -type PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdJSONRequestBody = externalRef0.RunStarlarkPackage - -// PostEnclavesEnclaveIdentifierStarlarkScriptsJSONRequestBody defines body for PostEnclavesEnclaveIdentifierStarlarkScripts for application/json ContentType. -type PostEnclavesEnclaveIdentifierStarlarkScriptsJSONRequestBody = externalRef0.RunStarlarkScript - // ServerInterface represents all server handlers. type ServerInterface interface { // (GET /enclaves/{enclave_identifier}/artifacts) - GetEnclavesEnclaveIdentifierArtifacts(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier) error + GetEnclavesEnclaveIdentifierArtifacts(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error // (POST /enclaves/{enclave_identifier}/artifacts/local-file) - PostEnclavesEnclaveIdentifierArtifactsLocalFile(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier) error + PostEnclavesEnclaveIdentifierArtifactsLocalFile(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error // (POST /enclaves/{enclave_identifier}/artifacts/remote-file) - PostEnclavesEnclaveIdentifierArtifactsRemoteFile(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier) error + PostEnclavesEnclaveIdentifierArtifactsRemoteFile(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error // (POST /enclaves/{enclave_identifier}/artifacts/services/{service_identifier}) - PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, serviceIdentifier externalRef0.ServiceIdentifier) error + PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, serviceIdentifier ServiceIdentifier) error // (GET /enclaves/{enclave_identifier}/artifacts/{artifact_identifier}) - GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, artifactIdentifier externalRef0.ArtifactIdentifier) error + GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, artifactIdentifier ArtifactIdentifier) error // (GET /enclaves/{enclave_identifier}/artifacts/{artifact_identifier}/download) - GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownload(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, artifactIdentifier externalRef0.ArtifactIdentifier) error + GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownload(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, artifactIdentifier ArtifactIdentifier) error // (GET /enclaves/{enclave_identifier}/services) - GetEnclavesEnclaveIdentifierServices(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, params GetEnclavesEnclaveIdentifierServicesParams) error + GetEnclavesEnclaveIdentifierServices(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, params GetEnclavesEnclaveIdentifierServicesParams) error // (POST /enclaves/{enclave_identifier}/services/connection) - PostEnclavesEnclaveIdentifierServicesConnection(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier) error + PostEnclavesEnclaveIdentifierServicesConnection(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error // (GET /enclaves/{enclave_identifier}/services/history) - GetEnclavesEnclaveIdentifierServicesHistory(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier) error + GetEnclavesEnclaveIdentifierServicesHistory(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error // (GET /enclaves/{enclave_identifier}/services/{service_identifier}) - GetEnclavesEnclaveIdentifierServicesServiceIdentifier(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, serviceIdentifier externalRef0.ServiceIdentifier) error + GetEnclavesEnclaveIdentifierServicesServiceIdentifier(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, serviceIdentifier ServiceIdentifier) error // (POST /enclaves/{enclave_identifier}/services/{service_identifier}/command) - PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, serviceIdentifier externalRef0.ServiceIdentifier) error + PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, serviceIdentifier ServiceIdentifier) error // (GET /enclaves/{enclave_identifier}/services/{service_identifier}/endpoints/{port_number}/availability) - GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, serviceIdentifier externalRef0.ServiceIdentifier, portNumber externalRef0.PortNumber, params GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityParams) error + GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, serviceIdentifier ServiceIdentifier, portNumber PortNumber, params GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityParams) error // (GET /enclaves/{enclave_identifier}/starlark) - GetEnclavesEnclaveIdentifierStarlark(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier) error + GetEnclavesEnclaveIdentifierStarlark(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error // (POST /enclaves/{enclave_identifier}/starlark/packages) - PostEnclavesEnclaveIdentifierStarlarkPackages(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier) error + PostEnclavesEnclaveIdentifierStarlarkPackages(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error // (POST /enclaves/{enclave_identifier}/starlark/packages/{package_id}) - PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, packageId externalRef0.PackageId, params PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdParams) error + PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, packageId PackageId, params PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdParams) error // (POST /enclaves/{enclave_identifier}/starlark/scripts) - PostEnclavesEnclaveIdentifierStarlarkScripts(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, params PostEnclavesEnclaveIdentifierStarlarkScriptsParams) error + PostEnclavesEnclaveIdentifierStarlarkScripts(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, params PostEnclavesEnclaveIdentifierStarlarkScriptsParams) error } // ServerInterfaceWrapper converts echo contexts to parameters. @@ -160,7 +84,7 @@ type ServerInterfaceWrapper struct { func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierArtifacts(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- - var enclaveIdentifier externalRef0.EnclaveIdentifier + var enclaveIdentifier EnclaveIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) if err != nil { @@ -176,7 +100,7 @@ func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierArtifacts(ctx echo. func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierArtifactsLocalFile(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- - var enclaveIdentifier externalRef0.EnclaveIdentifier + var enclaveIdentifier EnclaveIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) if err != nil { @@ -192,7 +116,7 @@ func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierArtifactsLocalFile func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierArtifactsRemoteFile(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- - var enclaveIdentifier externalRef0.EnclaveIdentifier + var enclaveIdentifier EnclaveIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) if err != nil { @@ -208,7 +132,7 @@ func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierArtifactsRemoteFil func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- - var enclaveIdentifier externalRef0.EnclaveIdentifier + var enclaveIdentifier EnclaveIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) if err != nil { @@ -216,7 +140,7 @@ func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierArtifactsServicesS } // ------------- Path parameter "service_identifier" ------------- - var serviceIdentifier externalRef0.ServiceIdentifier + var serviceIdentifier ServiceIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "service_identifier", runtime.ParamLocationPath, ctx.Param("service_identifier"), &serviceIdentifier) if err != nil { @@ -232,7 +156,7 @@ func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierArtifactsServicesS func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- - var enclaveIdentifier externalRef0.EnclaveIdentifier + var enclaveIdentifier EnclaveIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) if err != nil { @@ -240,7 +164,7 @@ func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierArtifactsArtifactId } // ------------- Path parameter "artifact_identifier" ------------- - var artifactIdentifier externalRef0.ArtifactIdentifier + var artifactIdentifier ArtifactIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "artifact_identifier", runtime.ParamLocationPath, ctx.Param("artifact_identifier"), &artifactIdentifier) if err != nil { @@ -256,7 +180,7 @@ func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierArtifactsArtifactId func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownload(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- - var enclaveIdentifier externalRef0.EnclaveIdentifier + var enclaveIdentifier EnclaveIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) if err != nil { @@ -264,7 +188,7 @@ func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierArtifactsArtifactId } // ------------- Path parameter "artifact_identifier" ------------- - var artifactIdentifier externalRef0.ArtifactIdentifier + var artifactIdentifier ArtifactIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "artifact_identifier", runtime.ParamLocationPath, ctx.Param("artifact_identifier"), &artifactIdentifier) if err != nil { @@ -280,7 +204,7 @@ func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierArtifactsArtifactId func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierServices(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- - var enclaveIdentifier externalRef0.EnclaveIdentifier + var enclaveIdentifier EnclaveIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) if err != nil { @@ -305,7 +229,7 @@ func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierServices(ctx echo.C func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierServicesConnection(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- - var enclaveIdentifier externalRef0.EnclaveIdentifier + var enclaveIdentifier EnclaveIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) if err != nil { @@ -321,7 +245,7 @@ func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierServicesConnection func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierServicesHistory(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- - var enclaveIdentifier externalRef0.EnclaveIdentifier + var enclaveIdentifier EnclaveIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) if err != nil { @@ -337,7 +261,7 @@ func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierServicesHistory(ctx func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierServicesServiceIdentifier(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- - var enclaveIdentifier externalRef0.EnclaveIdentifier + var enclaveIdentifier EnclaveIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) if err != nil { @@ -345,7 +269,7 @@ func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierServicesServiceIden } // ------------- Path parameter "service_identifier" ------------- - var serviceIdentifier externalRef0.ServiceIdentifier + var serviceIdentifier ServiceIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "service_identifier", runtime.ParamLocationPath, ctx.Param("service_identifier"), &serviceIdentifier) if err != nil { @@ -361,7 +285,7 @@ func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierServicesServiceIden func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- - var enclaveIdentifier externalRef0.EnclaveIdentifier + var enclaveIdentifier EnclaveIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) if err != nil { @@ -369,7 +293,7 @@ func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierServicesServiceIde } // ------------- Path parameter "service_identifier" ------------- - var serviceIdentifier externalRef0.ServiceIdentifier + var serviceIdentifier ServiceIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "service_identifier", runtime.ParamLocationPath, ctx.Param("service_identifier"), &serviceIdentifier) if err != nil { @@ -385,7 +309,7 @@ func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierServicesServiceIde func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- - var enclaveIdentifier externalRef0.EnclaveIdentifier + var enclaveIdentifier EnclaveIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) if err != nil { @@ -393,7 +317,7 @@ func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierServicesServiceIden } // ------------- Path parameter "service_identifier" ------------- - var serviceIdentifier externalRef0.ServiceIdentifier + var serviceIdentifier ServiceIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "service_identifier", runtime.ParamLocationPath, ctx.Param("service_identifier"), &serviceIdentifier) if err != nil { @@ -401,7 +325,7 @@ func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierServicesServiceIden } // ------------- Path parameter "port_number" ------------- - var portNumber externalRef0.PortNumber + var portNumber PortNumber err = runtime.BindStyledParameterWithLocation("simple", false, "port_number", runtime.ParamLocationPath, ctx.Param("port_number"), &portNumber) if err != nil { @@ -468,7 +392,7 @@ func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierServicesServiceIden func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierStarlark(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- - var enclaveIdentifier externalRef0.EnclaveIdentifier + var enclaveIdentifier EnclaveIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) if err != nil { @@ -484,7 +408,7 @@ func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierStarlark(ctx echo.C func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierStarlarkPackages(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- - var enclaveIdentifier externalRef0.EnclaveIdentifier + var enclaveIdentifier EnclaveIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) if err != nil { @@ -500,7 +424,7 @@ func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierStarlarkPackages(c func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- - var enclaveIdentifier externalRef0.EnclaveIdentifier + var enclaveIdentifier EnclaveIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) if err != nil { @@ -508,7 +432,7 @@ func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierStarlarkPackagesPa } // ------------- Path parameter "package_id" ------------- - var packageId externalRef0.PackageId + var packageId PackageId err = runtime.BindStyledParameterWithLocation("simple", false, "package_id", runtime.ParamLocationPath, ctx.Param("package_id"), &packageId) if err != nil { @@ -533,7 +457,7 @@ func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierStarlarkPackagesPa func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- - var enclaveIdentifier externalRef0.EnclaveIdentifier + var enclaveIdentifier EnclaveIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) if err != nil { @@ -601,17 +525,17 @@ func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL } -type NotOkJSONResponse externalRef0.ResponseInfo +type NotOkJSONResponse ResponseInfo type GetEnclavesEnclaveIdentifierArtifactsRequestObject struct { - EnclaveIdentifier externalRef0.EnclaveIdentifier `json:"enclave_identifier"` + EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` } type GetEnclavesEnclaveIdentifierArtifactsResponseObject interface { VisitGetEnclavesEnclaveIdentifierArtifactsResponse(w http.ResponseWriter) error } -type GetEnclavesEnclaveIdentifierArtifacts200JSONResponse []externalRef0.FileArtifactReference +type GetEnclavesEnclaveIdentifierArtifacts200JSONResponse []FileArtifactReference func (response GetEnclavesEnclaveIdentifierArtifacts200JSONResponse) VisitGetEnclavesEnclaveIdentifierArtifactsResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -621,7 +545,7 @@ func (response GetEnclavesEnclaveIdentifierArtifacts200JSONResponse) VisitGetEnc } type GetEnclavesEnclaveIdentifierArtifactsdefaultJSONResponse struct { - Body externalRef0.ResponseInfo + Body ResponseInfo StatusCode int } @@ -633,7 +557,7 @@ func (response GetEnclavesEnclaveIdentifierArtifactsdefaultJSONResponse) VisitGe } type PostEnclavesEnclaveIdentifierArtifactsLocalFileRequestObject struct { - EnclaveIdentifier externalRef0.EnclaveIdentifier `json:"enclave_identifier"` + EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` Body *multipart.Reader } @@ -641,7 +565,7 @@ type PostEnclavesEnclaveIdentifierArtifactsLocalFileResponseObject interface { VisitPostEnclavesEnclaveIdentifierArtifactsLocalFileResponse(w http.ResponseWriter) error } -type PostEnclavesEnclaveIdentifierArtifactsLocalFile200JSONResponse map[string]externalRef0.FileArtifactReference +type PostEnclavesEnclaveIdentifierArtifactsLocalFile200JSONResponse map[string]FileArtifactReference func (response PostEnclavesEnclaveIdentifierArtifactsLocalFile200JSONResponse) VisitPostEnclavesEnclaveIdentifierArtifactsLocalFileResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -651,7 +575,7 @@ func (response PostEnclavesEnclaveIdentifierArtifactsLocalFile200JSONResponse) V } type PostEnclavesEnclaveIdentifierArtifactsLocalFiledefaultJSONResponse struct { - Body externalRef0.ResponseInfo + Body ResponseInfo StatusCode int } @@ -663,7 +587,7 @@ func (response PostEnclavesEnclaveIdentifierArtifactsLocalFiledefaultJSONRespons } type PostEnclavesEnclaveIdentifierArtifactsRemoteFileRequestObject struct { - EnclaveIdentifier externalRef0.EnclaveIdentifier `json:"enclave_identifier"` + EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` Body *PostEnclavesEnclaveIdentifierArtifactsRemoteFileJSONRequestBody } @@ -671,7 +595,7 @@ type PostEnclavesEnclaveIdentifierArtifactsRemoteFileResponseObject interface { VisitPostEnclavesEnclaveIdentifierArtifactsRemoteFileResponse(w http.ResponseWriter) error } -type PostEnclavesEnclaveIdentifierArtifactsRemoteFile200JSONResponse externalRef0.FileArtifactReference +type PostEnclavesEnclaveIdentifierArtifactsRemoteFile200JSONResponse FileArtifactReference func (response PostEnclavesEnclaveIdentifierArtifactsRemoteFile200JSONResponse) VisitPostEnclavesEnclaveIdentifierArtifactsRemoteFileResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -681,7 +605,7 @@ func (response PostEnclavesEnclaveIdentifierArtifactsRemoteFile200JSONResponse) } type PostEnclavesEnclaveIdentifierArtifactsRemoteFiledefaultJSONResponse struct { - Body externalRef0.ResponseInfo + Body ResponseInfo StatusCode int } @@ -693,8 +617,8 @@ func (response PostEnclavesEnclaveIdentifierArtifactsRemoteFiledefaultJSONRespon } type PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierRequestObject struct { - EnclaveIdentifier externalRef0.EnclaveIdentifier `json:"enclave_identifier"` - ServiceIdentifier externalRef0.ServiceIdentifier `json:"service_identifier"` + EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` + ServiceIdentifier ServiceIdentifier `json:"service_identifier"` Body *PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierJSONRequestBody } @@ -702,7 +626,7 @@ type PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierResponseObje VisitPostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierResponse(w http.ResponseWriter) error } -type PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier200JSONResponse externalRef0.FileArtifactReference +type PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier200JSONResponse FileArtifactReference func (response PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier200JSONResponse) VisitPostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -712,7 +636,7 @@ func (response PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier20 } type PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierdefaultJSONResponse struct { - Body externalRef0.ResponseInfo + Body ResponseInfo StatusCode int } @@ -724,15 +648,15 @@ func (response PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierde } type GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierRequestObject struct { - EnclaveIdentifier externalRef0.EnclaveIdentifier `json:"enclave_identifier"` - ArtifactIdentifier externalRef0.ArtifactIdentifier `json:"artifact_identifier"` + EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` + ArtifactIdentifier ArtifactIdentifier `json:"artifact_identifier"` } type GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierResponseObject interface { VisitGetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierResponse(w http.ResponseWriter) error } -type GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier200JSONResponse []externalRef0.FileArtifactDescription +type GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier200JSONResponse []FileArtifactDescription func (response GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier200JSONResponse) VisitGetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -742,7 +666,7 @@ func (response GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier200JSONRes } type GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierdefaultJSONResponse struct { - Body externalRef0.ResponseInfo + Body ResponseInfo StatusCode int } @@ -754,8 +678,8 @@ func (response GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierdefaultJSO } type GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownloadRequestObject struct { - EnclaveIdentifier externalRef0.EnclaveIdentifier `json:"enclave_identifier"` - ArtifactIdentifier externalRef0.ArtifactIdentifier `json:"artifact_identifier"` + EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` + ArtifactIdentifier ArtifactIdentifier `json:"artifact_identifier"` } type GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownloadResponseObject interface { @@ -782,7 +706,7 @@ func (response GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownload20 } type GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownloaddefaultJSONResponse struct { - Body externalRef0.ResponseInfo + Body ResponseInfo StatusCode int } @@ -794,7 +718,7 @@ func (response GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownloadde } type GetEnclavesEnclaveIdentifierServicesRequestObject struct { - EnclaveIdentifier externalRef0.EnclaveIdentifier `json:"enclave_identifier"` + EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` Params GetEnclavesEnclaveIdentifierServicesParams } @@ -802,7 +726,7 @@ type GetEnclavesEnclaveIdentifierServicesResponseObject interface { VisitGetEnclavesEnclaveIdentifierServicesResponse(w http.ResponseWriter) error } -type GetEnclavesEnclaveIdentifierServices200JSONResponse map[string]externalRef0.ServiceInfo +type GetEnclavesEnclaveIdentifierServices200JSONResponse map[string]ServiceInfo func (response GetEnclavesEnclaveIdentifierServices200JSONResponse) VisitGetEnclavesEnclaveIdentifierServicesResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -812,7 +736,7 @@ func (response GetEnclavesEnclaveIdentifierServices200JSONResponse) VisitGetEncl } type GetEnclavesEnclaveIdentifierServicesdefaultJSONResponse struct { - Body externalRef0.ResponseInfo + Body ResponseInfo StatusCode int } @@ -824,7 +748,7 @@ func (response GetEnclavesEnclaveIdentifierServicesdefaultJSONResponse) VisitGet } type PostEnclavesEnclaveIdentifierServicesConnectionRequestObject struct { - EnclaveIdentifier externalRef0.EnclaveIdentifier `json:"enclave_identifier"` + EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` Body *PostEnclavesEnclaveIdentifierServicesConnectionJSONRequestBody } @@ -841,7 +765,7 @@ func (response PostEnclavesEnclaveIdentifierServicesConnection200Response) Visit } type PostEnclavesEnclaveIdentifierServicesConnectiondefaultJSONResponse struct { - Body externalRef0.ResponseInfo + Body ResponseInfo StatusCode int } @@ -853,14 +777,14 @@ func (response PostEnclavesEnclaveIdentifierServicesConnectiondefaultJSONRespons } type GetEnclavesEnclaveIdentifierServicesHistoryRequestObject struct { - EnclaveIdentifier externalRef0.EnclaveIdentifier `json:"enclave_identifier"` + EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` } type GetEnclavesEnclaveIdentifierServicesHistoryResponseObject interface { VisitGetEnclavesEnclaveIdentifierServicesHistoryResponse(w http.ResponseWriter) error } -type GetEnclavesEnclaveIdentifierServicesHistory200JSONResponse []externalRef0.ServiceIdentifiers +type GetEnclavesEnclaveIdentifierServicesHistory200JSONResponse []ServiceIdentifiers func (response GetEnclavesEnclaveIdentifierServicesHistory200JSONResponse) VisitGetEnclavesEnclaveIdentifierServicesHistoryResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -870,7 +794,7 @@ func (response GetEnclavesEnclaveIdentifierServicesHistory200JSONResponse) Visit } type GetEnclavesEnclaveIdentifierServicesHistorydefaultJSONResponse struct { - Body externalRef0.ResponseInfo + Body ResponseInfo StatusCode int } @@ -882,15 +806,15 @@ func (response GetEnclavesEnclaveIdentifierServicesHistorydefaultJSONResponse) V } type GetEnclavesEnclaveIdentifierServicesServiceIdentifierRequestObject struct { - EnclaveIdentifier externalRef0.EnclaveIdentifier `json:"enclave_identifier"` - ServiceIdentifier externalRef0.ServiceIdentifier `json:"service_identifier"` + EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` + ServiceIdentifier ServiceIdentifier `json:"service_identifier"` } type GetEnclavesEnclaveIdentifierServicesServiceIdentifierResponseObject interface { VisitGetEnclavesEnclaveIdentifierServicesServiceIdentifierResponse(w http.ResponseWriter) error } -type GetEnclavesEnclaveIdentifierServicesServiceIdentifier200JSONResponse externalRef0.ServiceInfo +type GetEnclavesEnclaveIdentifierServicesServiceIdentifier200JSONResponse ServiceInfo func (response GetEnclavesEnclaveIdentifierServicesServiceIdentifier200JSONResponse) VisitGetEnclavesEnclaveIdentifierServicesServiceIdentifierResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -900,7 +824,7 @@ func (response GetEnclavesEnclaveIdentifierServicesServiceIdentifier200JSONRespo } type GetEnclavesEnclaveIdentifierServicesServiceIdentifierdefaultJSONResponse struct { - Body externalRef0.ResponseInfo + Body ResponseInfo StatusCode int } @@ -912,8 +836,8 @@ func (response GetEnclavesEnclaveIdentifierServicesServiceIdentifierdefaultJSONR } type PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandRequestObject struct { - EnclaveIdentifier externalRef0.EnclaveIdentifier `json:"enclave_identifier"` - ServiceIdentifier externalRef0.ServiceIdentifier `json:"service_identifier"` + EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` + ServiceIdentifier ServiceIdentifier `json:"service_identifier"` Body *PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandJSONRequestBody } @@ -921,7 +845,7 @@ type PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandResponseObject VisitPostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandResponse(w http.ResponseWriter) error } -type PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand200JSONResponse externalRef0.ExecCommandResult +type PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand200JSONResponse ExecCommandResult func (response PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand200JSONResponse) VisitPostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -931,7 +855,7 @@ func (response PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand200J } type PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommanddefaultJSONResponse struct { - Body externalRef0.ResponseInfo + Body ResponseInfo StatusCode int } @@ -943,9 +867,9 @@ func (response PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommanddefa } type GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityRequestObject struct { - EnclaveIdentifier externalRef0.EnclaveIdentifier `json:"enclave_identifier"` - ServiceIdentifier externalRef0.ServiceIdentifier `json:"service_identifier"` - PortNumber externalRef0.PortNumber `json:"port_number"` + EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` + ServiceIdentifier ServiceIdentifier `json:"service_identifier"` + PortNumber PortNumber `json:"port_number"` Params GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityParams } @@ -962,14 +886,14 @@ func (response GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPor } type GetEnclavesEnclaveIdentifierStarlarkRequestObject struct { - EnclaveIdentifier externalRef0.EnclaveIdentifier `json:"enclave_identifier"` + EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` } type GetEnclavesEnclaveIdentifierStarlarkResponseObject interface { VisitGetEnclavesEnclaveIdentifierStarlarkResponse(w http.ResponseWriter) error } -type GetEnclavesEnclaveIdentifierStarlark200JSONResponse externalRef0.StarlarkDescription +type GetEnclavesEnclaveIdentifierStarlark200JSONResponse StarlarkDescription func (response GetEnclavesEnclaveIdentifierStarlark200JSONResponse) VisitGetEnclavesEnclaveIdentifierStarlarkResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -979,7 +903,7 @@ func (response GetEnclavesEnclaveIdentifierStarlark200JSONResponse) VisitGetEncl } type GetEnclavesEnclaveIdentifierStarlarkdefaultJSONResponse struct { - Body externalRef0.ResponseInfo + Body ResponseInfo StatusCode int } @@ -991,7 +915,7 @@ func (response GetEnclavesEnclaveIdentifierStarlarkdefaultJSONResponse) VisitGet } type PostEnclavesEnclaveIdentifierStarlarkPackagesRequestObject struct { - EnclaveIdentifier externalRef0.EnclaveIdentifier `json:"enclave_identifier"` + EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` Body *multipart.Reader } @@ -1008,7 +932,7 @@ func (response PostEnclavesEnclaveIdentifierStarlarkPackages200Response) VisitPo } type PostEnclavesEnclaveIdentifierStarlarkPackagesdefaultJSONResponse struct { - Body externalRef0.ResponseInfo + Body ResponseInfo StatusCode int } @@ -1020,8 +944,8 @@ func (response PostEnclavesEnclaveIdentifierStarlarkPackagesdefaultJSONResponse) } type PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdRequestObject struct { - EnclaveIdentifier externalRef0.EnclaveIdentifier `json:"enclave_identifier"` - PackageId externalRef0.PackageId `json:"package_id"` + EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` + PackageId PackageId `json:"package_id"` Params PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdParams Body *PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdJSONRequestBody } @@ -1030,7 +954,7 @@ type PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdResponseObject interf VisitPostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdResponse(w http.ResponseWriter) error } -type PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId200JSONResponse externalRef0.StarlarkRunResponse +type PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId200JSONResponse StarlarkRunResponse func (response PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId200JSONResponse) VisitPostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -1040,7 +964,7 @@ func (response PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId200JSONResp } type PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIddefaultJSONResponse struct { - Body externalRef0.ResponseInfo + Body ResponseInfo StatusCode int } @@ -1052,7 +976,7 @@ func (response PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIddefaultJSON } type PostEnclavesEnclaveIdentifierStarlarkScriptsRequestObject struct { - EnclaveIdentifier externalRef0.EnclaveIdentifier `json:"enclave_identifier"` + EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` Params PostEnclavesEnclaveIdentifierStarlarkScriptsParams Body *PostEnclavesEnclaveIdentifierStarlarkScriptsJSONRequestBody } @@ -1061,7 +985,7 @@ type PostEnclavesEnclaveIdentifierStarlarkScriptsResponseObject interface { VisitPostEnclavesEnclaveIdentifierStarlarkScriptsResponse(w http.ResponseWriter) error } -type PostEnclavesEnclaveIdentifierStarlarkScripts200JSONResponse externalRef0.StarlarkRunResponse +type PostEnclavesEnclaveIdentifierStarlarkScripts200JSONResponse StarlarkRunResponse func (response PostEnclavesEnclaveIdentifierStarlarkScripts200JSONResponse) VisitPostEnclavesEnclaveIdentifierStarlarkScriptsResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -1071,7 +995,7 @@ func (response PostEnclavesEnclaveIdentifierStarlarkScripts200JSONResponse) Visi } type PostEnclavesEnclaveIdentifierStarlarkScriptsdefaultJSONResponse struct { - Body externalRef0.ResponseInfo + Body ResponseInfo StatusCode int } @@ -1148,7 +1072,7 @@ type strictHandler struct { } // GetEnclavesEnclaveIdentifierArtifacts operation middleware -func (sh *strictHandler) GetEnclavesEnclaveIdentifierArtifacts(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier) error { +func (sh *strictHandler) GetEnclavesEnclaveIdentifierArtifacts(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error { var request GetEnclavesEnclaveIdentifierArtifactsRequestObject request.EnclaveIdentifier = enclaveIdentifier @@ -1173,7 +1097,7 @@ func (sh *strictHandler) GetEnclavesEnclaveIdentifierArtifacts(ctx echo.Context, } // PostEnclavesEnclaveIdentifierArtifactsLocalFile operation middleware -func (sh *strictHandler) PostEnclavesEnclaveIdentifierArtifactsLocalFile(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier) error { +func (sh *strictHandler) PostEnclavesEnclaveIdentifierArtifactsLocalFile(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error { var request PostEnclavesEnclaveIdentifierArtifactsLocalFileRequestObject request.EnclaveIdentifier = enclaveIdentifier @@ -1204,7 +1128,7 @@ func (sh *strictHandler) PostEnclavesEnclaveIdentifierArtifactsLocalFile(ctx ech } // PostEnclavesEnclaveIdentifierArtifactsRemoteFile operation middleware -func (sh *strictHandler) PostEnclavesEnclaveIdentifierArtifactsRemoteFile(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier) error { +func (sh *strictHandler) PostEnclavesEnclaveIdentifierArtifactsRemoteFile(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error { var request PostEnclavesEnclaveIdentifierArtifactsRemoteFileRequestObject request.EnclaveIdentifier = enclaveIdentifier @@ -1235,7 +1159,7 @@ func (sh *strictHandler) PostEnclavesEnclaveIdentifierArtifactsRemoteFile(ctx ec } // PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier operation middleware -func (sh *strictHandler) PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, serviceIdentifier externalRef0.ServiceIdentifier) error { +func (sh *strictHandler) PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, serviceIdentifier ServiceIdentifier) error { var request PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierRequestObject request.EnclaveIdentifier = enclaveIdentifier @@ -1267,7 +1191,7 @@ func (sh *strictHandler) PostEnclavesEnclaveIdentifierArtifactsServicesServiceId } // GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier operation middleware -func (sh *strictHandler) GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, artifactIdentifier externalRef0.ArtifactIdentifier) error { +func (sh *strictHandler) GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, artifactIdentifier ArtifactIdentifier) error { var request GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierRequestObject request.EnclaveIdentifier = enclaveIdentifier @@ -1293,7 +1217,7 @@ func (sh *strictHandler) GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier } // GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownload operation middleware -func (sh *strictHandler) GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownload(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, artifactIdentifier externalRef0.ArtifactIdentifier) error { +func (sh *strictHandler) GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownload(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, artifactIdentifier ArtifactIdentifier) error { var request GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownloadRequestObject request.EnclaveIdentifier = enclaveIdentifier @@ -1319,7 +1243,7 @@ func (sh *strictHandler) GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier } // GetEnclavesEnclaveIdentifierServices operation middleware -func (sh *strictHandler) GetEnclavesEnclaveIdentifierServices(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, params GetEnclavesEnclaveIdentifierServicesParams) error { +func (sh *strictHandler) GetEnclavesEnclaveIdentifierServices(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, params GetEnclavesEnclaveIdentifierServicesParams) error { var request GetEnclavesEnclaveIdentifierServicesRequestObject request.EnclaveIdentifier = enclaveIdentifier @@ -1345,7 +1269,7 @@ func (sh *strictHandler) GetEnclavesEnclaveIdentifierServices(ctx echo.Context, } // PostEnclavesEnclaveIdentifierServicesConnection operation middleware -func (sh *strictHandler) PostEnclavesEnclaveIdentifierServicesConnection(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier) error { +func (sh *strictHandler) PostEnclavesEnclaveIdentifierServicesConnection(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error { var request PostEnclavesEnclaveIdentifierServicesConnectionRequestObject request.EnclaveIdentifier = enclaveIdentifier @@ -1376,7 +1300,7 @@ func (sh *strictHandler) PostEnclavesEnclaveIdentifierServicesConnection(ctx ech } // GetEnclavesEnclaveIdentifierServicesHistory operation middleware -func (sh *strictHandler) GetEnclavesEnclaveIdentifierServicesHistory(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier) error { +func (sh *strictHandler) GetEnclavesEnclaveIdentifierServicesHistory(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error { var request GetEnclavesEnclaveIdentifierServicesHistoryRequestObject request.EnclaveIdentifier = enclaveIdentifier @@ -1401,7 +1325,7 @@ func (sh *strictHandler) GetEnclavesEnclaveIdentifierServicesHistory(ctx echo.Co } // GetEnclavesEnclaveIdentifierServicesServiceIdentifier operation middleware -func (sh *strictHandler) GetEnclavesEnclaveIdentifierServicesServiceIdentifier(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, serviceIdentifier externalRef0.ServiceIdentifier) error { +func (sh *strictHandler) GetEnclavesEnclaveIdentifierServicesServiceIdentifier(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, serviceIdentifier ServiceIdentifier) error { var request GetEnclavesEnclaveIdentifierServicesServiceIdentifierRequestObject request.EnclaveIdentifier = enclaveIdentifier @@ -1427,7 +1351,7 @@ func (sh *strictHandler) GetEnclavesEnclaveIdentifierServicesServiceIdentifier(c } // PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand operation middleware -func (sh *strictHandler) PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, serviceIdentifier externalRef0.ServiceIdentifier) error { +func (sh *strictHandler) PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, serviceIdentifier ServiceIdentifier) error { var request PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandRequestObject request.EnclaveIdentifier = enclaveIdentifier @@ -1459,7 +1383,7 @@ func (sh *strictHandler) PostEnclavesEnclaveIdentifierServicesServiceIdentifierC } // GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability operation middleware -func (sh *strictHandler) GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, serviceIdentifier externalRef0.ServiceIdentifier, portNumber externalRef0.PortNumber, params GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityParams) error { +func (sh *strictHandler) GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, serviceIdentifier ServiceIdentifier, portNumber PortNumber, params GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityParams) error { var request GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityRequestObject request.EnclaveIdentifier = enclaveIdentifier @@ -1487,7 +1411,7 @@ func (sh *strictHandler) GetEnclavesEnclaveIdentifierServicesServiceIdentifierEn } // GetEnclavesEnclaveIdentifierStarlark operation middleware -func (sh *strictHandler) GetEnclavesEnclaveIdentifierStarlark(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier) error { +func (sh *strictHandler) GetEnclavesEnclaveIdentifierStarlark(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error { var request GetEnclavesEnclaveIdentifierStarlarkRequestObject request.EnclaveIdentifier = enclaveIdentifier @@ -1512,7 +1436,7 @@ func (sh *strictHandler) GetEnclavesEnclaveIdentifierStarlark(ctx echo.Context, } // PostEnclavesEnclaveIdentifierStarlarkPackages operation middleware -func (sh *strictHandler) PostEnclavesEnclaveIdentifierStarlarkPackages(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier) error { +func (sh *strictHandler) PostEnclavesEnclaveIdentifierStarlarkPackages(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error { var request PostEnclavesEnclaveIdentifierStarlarkPackagesRequestObject request.EnclaveIdentifier = enclaveIdentifier @@ -1543,7 +1467,7 @@ func (sh *strictHandler) PostEnclavesEnclaveIdentifierStarlarkPackages(ctx echo. } // PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId operation middleware -func (sh *strictHandler) PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, packageId externalRef0.PackageId, params PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdParams) error { +func (sh *strictHandler) PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, packageId PackageId, params PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdParams) error { var request PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdRequestObject request.EnclaveIdentifier = enclaveIdentifier @@ -1576,7 +1500,7 @@ func (sh *strictHandler) PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId( } // PostEnclavesEnclaveIdentifierStarlarkScripts operation middleware -func (sh *strictHandler) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, params PostEnclavesEnclaveIdentifierStarlarkScriptsParams) error { +func (sh *strictHandler) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, params PostEnclavesEnclaveIdentifierStarlarkScriptsParams) error { var request PostEnclavesEnclaveIdentifierStarlarkScriptsRequestObject request.EnclaveIdentifier = enclaveIdentifier @@ -1610,60 +1534,77 @@ func (sh *strictHandler) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx echo.C // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/+w7a2/bttp/hdD7At0G184uGA7yLb0bp0uNJEUPsBQaLT22uVCkRlJJvMD//YA3i7Io", - "WUnTJNvZl6aJyIfP/UreJBkvSs6AKZkc3iQlFrgABcL8hoUiC5yplOTAFFkQEPrPOchMkFIRzpLD5GwF", - "yC9EDBeAuEBVRfJklBC9oMRqlYwS/Sk5jMIcJQL+qIiAPDlUooJRIrMVFFgfptal3iaVIGyZbDajBFhG", - "8SX0IvXx4/TVCMkVFwoY5Mj+zoVDcIHUCpADFMczcsot0bwuIVOQpwJkyZmENpZTj0decsIUEqAqwSRS", - "KyLRJaYVjMwCCeKSZICuCKVoDqjA4gJyhCXCl5hQPKeAvoHxcozeAaUcfeKC5t+OPWF/VCDWAWUtxPoJ", - "WSlVpgWoFc/j0n93djZDdgGqJORIcZStILvw6BFK1HqMXsECV1QhItHb12dd6IXHhYj9v4BFcpj836TW", - "2In9KifvlCp/MVuOghMN9oQRRTBNc6B4nRaEUiIh4yyXcWJYVcxBaBUJ12qSrjBRqGKKUATXkFWKsKUR", - "z4IIqSwXMkxpB109iIRkLrgosDLr1Y8/JCMvEMIULEEYmkqcXeCl1s04De47qnUXqRVWW/2x6EOHhQbQ", - "b6fxBkwHQmrlrc4rs1eSMZoqVFRSsWcKSYWFxlOtAs5KiuVqjN5wgQiTCrMM0G8OzGQFmKrVbx1Md5T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mJyvKSVbfmo87ZzvSAFvfLskl", - "sO2zDDf6xn7cW5e+d3PaLdUILu3/vYrW8L1CRDl2Xiw8XP3afqXwhFXXv8mVk5vgId9m0nj31xWnXpin", - "U/axVK3Z5mlb663v9v3UaHt9mOjCWPBquULY7vKsGN2HT3ztSZtxoewjtaPma8bHMoj9u8JHlQOWh2+J", - "h0DHajVkXc9T3gG7/YO/4UvveFD7ofegI4MnnV1BLGqzA83OzaU7jectKESxVPV1P1Gx22m+P+IpZGxD", - "ZvSNns2j+kSH0MTdspBDxnK71zLH6GxFJJIKSnvFywYY/5YhfPmQYdZ4eGkefkdemNwu4jc3yyc+zOuw", - "pQcS8OSmvlCzGZCoBeK23xG3V90rCeKZRHNYYbr4MoG5n9OHys2CK0WDfXLz/fLXSuUipvDAQ4fY9aWn", - "4aLs8fKRdfbUYfEwmvpIuufehfzNVW+z+W8AAAD//1aISs4OSQAA", + "H4sIAAAAAAAC/+x8a2/bOLrwXyH0vkBnFmrcnV0sDvotk6ZtsG1iOM7mHEwKLS09tjmlSS1JJfUU+e8H", + "vEmURcly2qbpwXyZaSxenvuND/k5yfmm5AyYksnLz0mJBd6AAmH+wkKRJc5VRgpgiiwJCP1zATIXpFSE", + "s+RlMl8D8gMRwxtAXKCqIkWSJkQPKLFaJ2miPyUvo2umiYD/VERAkbxUooI0kfkaNlhvpralniaVIGyV", + "3N+nCbCc4lsYBOrq6uxViuSaCwUMCmT/5sIBuERqDcgtFIczssuBYH4qIVdQZAJkyZmELpRnHo6i5IQp", + "JEBVgkmk1kSiW0wrSM0ACeKW5IDuCKVoAWiDxUcoEJYI32JC8YIC+gmOVkfoLVDK0TUXtPj5yCP2nwrE", + "NsCsA9gwImulymwDas2LOPffzudTZAegSkKBFEf5GvKPHjxCidoeoVewxBVViEj05nTeB164XQjY/xew", + "TF4m/2/SSOzEfpWTt0qV782U42BHAz1hRBFMswIo3mYbQimRkHNWyDgyrNosQGgRCcdqlO4wUahiilAE", + "nyCvFGErw54lEVJZKuSY0h68BgAJ0VxyscHKjFd/+yVJPUMIU7ACYXAqcf4Rr7RsxnFw31Eju0itsarl", + "x4IPPRoarH6YxJtlegBSa691Xpi9kByhM4U2lVTsmUJSYaHhVOuAspJiuT5Cr7lAhEmFWQ7o326ZyRow", + "Vet/9xDdYTYINRcqs1zvAZ4L5cUiKtk9ZAzWHaLjGIbr2SBVtuDFtteMBIqjVUyC0uBOLy7naWBRaiGQ", + "wIwJ0VP1up4/IWbIbdynqy24hsksQAkCEaV7jz8FSldrEcJKwaZU0oquQcCA7oTXaeKK3Go1rEqEWeEM", + "qP4BMwRCcNELuIXmcEaYeaOsyfmwJVmAugNgqAFlANCvYTXsUreQUb6SGZZblkdlaYmphBQtKM8/GqFC", + "3lE4mmvu6DUQFtB4oJZ910I+iFEbjIjoLDingJmB3On63jDEm5bA7jmhzjlTmDBvCO1Pm42WGbnmFS1C", + "s4gIi6t0BI5DLGSjyL/ywunCklC4KinHxa9OtzWowJT+56aiipRYqInm7/MCK7NuhO0LwrAhcmdPu6vl", + "n9nxnKuLjzsb4bKkJMealJPfpabn55Ged+aWPmNLblHcCcSYDzecPhp+2sl67WPN/0uFBcXi46l1q5y9", + "46uIQl1JQMQYNSM1a8EZryTdIi9SNpryi1gZvSUYXcNC8vwjKKlDQCPSUgnAG02jNCkFL0EoxxGzdiYd", + "SFm9nJHXLlA1zCbGPAy4zt6RXU0k3WNRveD91jvxQy0RfPE75KozcRjb7vQ0OeGM6X92KPECPUcnF+fn", + "pydzNJmgX0EqBMul9p7GhS65uMOiIGx1w/6KnqPziywYPm0PQQWR2qroGARYtdGwutFJmjRTAxA9aQyI", + "VttNStOicL4pMiwsI4mCjYzQtl4RC4G3iUk5lNiaGP1Bk2+zW+wyqqIgmlyYTltg9S3SkJ1sdExmDVFk", + "vFRYVXKfttaEubTDI2Kkf27t1sU+bagYYNcjK639ojJzOb+YTk9fISsVs6vz87PzN+iG/YKeo6vzf55f", + "XJ8HQuBGJ2niRiZp4kfFZEHr54k19X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khdcdHcrJ5+7FxvsHiXPOy22PKOPw4vdXFmYX+spON8pXke1076zIvdBvqhG9sf99", + "Ozj8U+DbAv858vjIfW+gd8ZkCbmq7w8Dcz2Mu3eRHhD2+X88uqjGnl95/PgxPPz/cSLIqPhMvAvvlSPf", + "zSgHnPwoY/hAyfL7/zgSxnMF6rm9on3whfcnJTzuzvj+gd4XB1I0nvne/30tDu8QEKg2gx5C7b9XoExj", + "mGaGP0XtvvQgG7AitmLfLdoP3yEfCdsmn3wWUodvub2R709d45mtBNGwcOc+/mFhl5e2k2bbJ5xC+OcK", + "xodGT5HFttK17fUxM/dyWKCUCC94ZStV8IlI09t5U7148cs/UFM3Q4GOHm5v3jqofpgaVqRd/amHH3uT", + "tAd7iyeXLX2jLKVl1H8k7k7y5t2KuFW3p6Jgs/EVuQVWP2vkWuaxbxNvEvWHWfuOtATPZvzfSrHDF0Mi", + "8rLzZsjjZdvdd0J+LGn2z1zKyefgbbz7Cd55WiHq4H41r5HZ98caYTevxXWez6yfJEvrm8hEp/GCV6s1", + "wnaWp076NSxn/ZrBlAtl3307bj8Q+L10ZP+s8J3CEcPD5znHrI7Vesy4gdcxR8z2b+iNH/rAjbpvp47a", + "Mnglsc/VRdX4G2ni+KzUdUj0quUbUIhiqZo7iaJih+mU3+IpBJFjumFataunZoAdjJO6gV5LQPxtuAeI", + "wcTd+ZBjTlB3b6keofmaSCQVlPbGm/Wb/mmH8CGIHLPWe4zmPdjIgxuHBTLtyfKJn7v22IPHFyXP88nn", + "5sbP/YiQNJAA+x1x+xhAJUE8k2gBa0yXX8ZD9/+zx4pCgztPo11N+6XTbxW0RrTjkQ+DYg2mT9Y+Wojk", + "dxbjSwfF4wjvdxJH95jGn9IYk0Z7CdcOXREGE9c9d39//78BAAD//8v6pDubYQAA", } // GetSwagger returns the content of the embedded swagger specification file @@ -1703,14 +1644,6 @@ func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error) { res[pathToFile] = rawSpec } - pathPrefix := path.Dir(pathToFile) - - for rawPath, rawFunc := range externalRef0.PathToRawSpec(path.Join(pathPrefix, "./api_types.yaml")) { - if _, ok := res[rawPath]; ok { - // it is not possible to compare functions in golang, so always overwrite the old value - } - res[rawPath] = rawFunc - } return res } diff --git a/api/golang/http_rest/engine_rest_api/engine_server.gen.go b/api/golang/http_rest/engine_rest_api/engine_server.gen.go index f10c17b9c2..61553f5ce2 100644 --- a/api/golang/http_rest/engine_rest_api/engine_server.gen.go +++ b/api/golang/http_rest/engine_rest_api/engine_server.gen.go @@ -17,25 +17,10 @@ import ( "github.com/deepmap/oapi-codegen/pkg/runtime" "github.com/getkin/kin-openapi/openapi3" - externalRef0 "github.com/kurtosis-tech/kurtosis/api/golang/http_rest/api_types" + . "github.com/kurtosis-tech/kurtosis/api/golang/http_rest/api_types" "github.com/labstack/echo/v4" ) -// NotOk defines model for NotOk. -type NotOk = externalRef0.ResponseInfo - -// DeleteEnclavesParams defines parameters for DeleteEnclaves. -type DeleteEnclavesParams struct { - // RemoveAll If true, remove all enclaves. Default is false - RemoveAll *externalRef0.RemoveAll `form:"remove_all,omitempty" json:"remove_all,omitempty"` -} - -// PostEnclavesJSONRequestBody defines body for PostEnclaves for application/json ContentType. -type PostEnclavesJSONRequestBody = externalRef0.CreateEnclave - -// PostEnclavesEnclaveIdentifierStatusJSONRequestBody defines body for PostEnclavesEnclaveIdentifierStatus for application/json ContentType. -type PostEnclavesEnclaveIdentifierStatusJSONRequestBody = externalRef0.EnclaveTargetStatus - // ServerInterface represents all server handlers. type ServerInterface interface { // Delete Enclaves @@ -52,16 +37,16 @@ type ServerInterface interface { GetEnclavesHistorical(ctx echo.Context) error // Destroy Enclave // (DELETE /enclaves/{enclave_identifier}) - DeleteEnclavesEnclaveIdentifier(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier) error + DeleteEnclavesEnclaveIdentifier(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error // Get Enclave Info // (GET /enclaves/{enclave_identifier}) - GetEnclavesEnclaveIdentifier(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier) error + GetEnclavesEnclaveIdentifier(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error // Get enclave status // (GET /enclaves/{enclave_identifier}/status) - GetEnclavesEnclaveIdentifierStatus(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier) error + GetEnclavesEnclaveIdentifierStatus(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error // Set enclave status // (POST /enclaves/{enclave_identifier}/status) - PostEnclavesEnclaveIdentifierStatus(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier) error + PostEnclavesEnclaveIdentifierStatus(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error // Get Engine Info // (GET /engine/info) GetEngineInfo(ctx echo.Context) error @@ -121,7 +106,7 @@ func (w *ServerInterfaceWrapper) GetEnclavesHistorical(ctx echo.Context) error { func (w *ServerInterfaceWrapper) DeleteEnclavesEnclaveIdentifier(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- - var enclaveIdentifier externalRef0.EnclaveIdentifier + var enclaveIdentifier EnclaveIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) if err != nil { @@ -137,7 +122,7 @@ func (w *ServerInterfaceWrapper) DeleteEnclavesEnclaveIdentifier(ctx echo.Contex func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifier(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- - var enclaveIdentifier externalRef0.EnclaveIdentifier + var enclaveIdentifier EnclaveIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) if err != nil { @@ -153,7 +138,7 @@ func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifier(ctx echo.Context) func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierStatus(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- - var enclaveIdentifier externalRef0.EnclaveIdentifier + var enclaveIdentifier EnclaveIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) if err != nil { @@ -169,7 +154,7 @@ func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierStatus(ctx echo.Con func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierStatus(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- - var enclaveIdentifier externalRef0.EnclaveIdentifier + var enclaveIdentifier EnclaveIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) if err != nil { @@ -230,7 +215,7 @@ func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL } -type NotOkJSONResponse externalRef0.ResponseInfo +type NotOkJSONResponse ResponseInfo type DeleteEnclavesRequestObject struct { Params DeleteEnclavesParams @@ -240,7 +225,7 @@ type DeleteEnclavesResponseObject interface { VisitDeleteEnclavesResponse(w http.ResponseWriter) error } -type DeleteEnclaves200JSONResponse externalRef0.DeletionSummary +type DeleteEnclaves200JSONResponse DeletionSummary func (response DeleteEnclaves200JSONResponse) VisitDeleteEnclavesResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -250,7 +235,7 @@ func (response DeleteEnclaves200JSONResponse) VisitDeleteEnclavesResponse(w http } type DeleteEnclavesdefaultJSONResponse struct { - Body externalRef0.ResponseInfo + Body ResponseInfo StatusCode int } @@ -268,7 +253,7 @@ type GetEnclavesResponseObject interface { VisitGetEnclavesResponse(w http.ResponseWriter) error } -type GetEnclaves200JSONResponse map[string]externalRef0.EnclaveInfo +type GetEnclaves200JSONResponse map[string]EnclaveInfo func (response GetEnclaves200JSONResponse) VisitGetEnclavesResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -278,7 +263,7 @@ func (response GetEnclaves200JSONResponse) VisitGetEnclavesResponse(w http.Respo } type GetEnclavesdefaultJSONResponse struct { - Body externalRef0.ResponseInfo + Body ResponseInfo StatusCode int } @@ -297,7 +282,7 @@ type PostEnclavesResponseObject interface { VisitPostEnclavesResponse(w http.ResponseWriter) error } -type PostEnclaves200JSONResponse externalRef0.EnclaveInfo +type PostEnclaves200JSONResponse EnclaveInfo func (response PostEnclaves200JSONResponse) VisitPostEnclavesResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -307,7 +292,7 @@ func (response PostEnclaves200JSONResponse) VisitPostEnclavesResponse(w http.Res } type PostEnclavesdefaultJSONResponse struct { - Body externalRef0.ResponseInfo + Body ResponseInfo StatusCode int } @@ -325,7 +310,7 @@ type GetEnclavesHistoricalResponseObject interface { VisitGetEnclavesHistoricalResponse(w http.ResponseWriter) error } -type GetEnclavesHistorical200JSONResponse []externalRef0.EnclaveIdentifiers +type GetEnclavesHistorical200JSONResponse []EnclaveIdentifiers func (response GetEnclavesHistorical200JSONResponse) VisitGetEnclavesHistoricalResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -335,7 +320,7 @@ func (response GetEnclavesHistorical200JSONResponse) VisitGetEnclavesHistoricalR } type GetEnclavesHistoricaldefaultJSONResponse struct { - Body externalRef0.ResponseInfo + Body ResponseInfo StatusCode int } @@ -347,7 +332,7 @@ func (response GetEnclavesHistoricaldefaultJSONResponse) VisitGetEnclavesHistori } type DeleteEnclavesEnclaveIdentifierRequestObject struct { - EnclaveIdentifier externalRef0.EnclaveIdentifier `json:"enclave_identifier"` + EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` } type DeleteEnclavesEnclaveIdentifierResponseObject interface { @@ -363,7 +348,7 @@ func (response DeleteEnclavesEnclaveIdentifier200Response) VisitDeleteEnclavesEn } type DeleteEnclavesEnclaveIdentifierdefaultJSONResponse struct { - Body externalRef0.ResponseInfo + Body ResponseInfo StatusCode int } @@ -375,14 +360,14 @@ func (response DeleteEnclavesEnclaveIdentifierdefaultJSONResponse) VisitDeleteEn } type GetEnclavesEnclaveIdentifierRequestObject struct { - EnclaveIdentifier externalRef0.EnclaveIdentifier `json:"enclave_identifier"` + EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` } type GetEnclavesEnclaveIdentifierResponseObject interface { VisitGetEnclavesEnclaveIdentifierResponse(w http.ResponseWriter) error } -type GetEnclavesEnclaveIdentifier200JSONResponse externalRef0.EnclaveInfo +type GetEnclavesEnclaveIdentifier200JSONResponse EnclaveInfo func (response GetEnclavesEnclaveIdentifier200JSONResponse) VisitGetEnclavesEnclaveIdentifierResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -392,7 +377,7 @@ func (response GetEnclavesEnclaveIdentifier200JSONResponse) VisitGetEnclavesEncl } type GetEnclavesEnclaveIdentifierdefaultJSONResponse struct { - Body externalRef0.ResponseInfo + Body ResponseInfo StatusCode int } @@ -404,14 +389,14 @@ func (response GetEnclavesEnclaveIdentifierdefaultJSONResponse) VisitGetEnclaves } type GetEnclavesEnclaveIdentifierStatusRequestObject struct { - EnclaveIdentifier externalRef0.EnclaveIdentifier `json:"enclave_identifier"` + EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` } type GetEnclavesEnclaveIdentifierStatusResponseObject interface { VisitGetEnclavesEnclaveIdentifierStatusResponse(w http.ResponseWriter) error } -type GetEnclavesEnclaveIdentifierStatus200JSONResponse externalRef0.EnclaveContainersStatus +type GetEnclavesEnclaveIdentifierStatus200JSONResponse EnclaveContainersStatus func (response GetEnclavesEnclaveIdentifierStatus200JSONResponse) VisitGetEnclavesEnclaveIdentifierStatusResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -421,7 +406,7 @@ func (response GetEnclavesEnclaveIdentifierStatus200JSONResponse) VisitGetEnclav } type GetEnclavesEnclaveIdentifierStatusdefaultJSONResponse struct { - Body externalRef0.ResponseInfo + Body ResponseInfo StatusCode int } @@ -433,7 +418,7 @@ func (response GetEnclavesEnclaveIdentifierStatusdefaultJSONResponse) VisitGetEn } type PostEnclavesEnclaveIdentifierStatusRequestObject struct { - EnclaveIdentifier externalRef0.EnclaveIdentifier `json:"enclave_identifier"` + EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` Body *PostEnclavesEnclaveIdentifierStatusJSONRequestBody } @@ -450,7 +435,7 @@ func (response PostEnclavesEnclaveIdentifierStatus200Response) VisitPostEnclaves } type PostEnclavesEnclaveIdentifierStatusdefaultJSONResponse struct { - Body externalRef0.ResponseInfo + Body ResponseInfo StatusCode int } @@ -468,7 +453,7 @@ type GetEngineInfoResponseObject interface { VisitGetEngineInfoResponse(w http.ResponseWriter) error } -type GetEngineInfo200JSONResponse externalRef0.EngineInfo +type GetEngineInfo200JSONResponse EngineInfo func (response GetEngineInfo200JSONResponse) VisitGetEngineInfoResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -478,7 +463,7 @@ func (response GetEngineInfo200JSONResponse) VisitGetEngineInfoResponse(w http.R } type GetEngineInfodefaultJSONResponse struct { - Body externalRef0.ResponseInfo + Body ResponseInfo StatusCode int } @@ -634,7 +619,7 @@ func (sh *strictHandler) GetEnclavesHistorical(ctx echo.Context) error { } // DeleteEnclavesEnclaveIdentifier operation middleware -func (sh *strictHandler) DeleteEnclavesEnclaveIdentifier(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier) error { +func (sh *strictHandler) DeleteEnclavesEnclaveIdentifier(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error { var request DeleteEnclavesEnclaveIdentifierRequestObject request.EnclaveIdentifier = enclaveIdentifier @@ -659,7 +644,7 @@ func (sh *strictHandler) DeleteEnclavesEnclaveIdentifier(ctx echo.Context, encla } // GetEnclavesEnclaveIdentifier operation middleware -func (sh *strictHandler) GetEnclavesEnclaveIdentifier(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier) error { +func (sh *strictHandler) GetEnclavesEnclaveIdentifier(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error { var request GetEnclavesEnclaveIdentifierRequestObject request.EnclaveIdentifier = enclaveIdentifier @@ -684,7 +669,7 @@ func (sh *strictHandler) GetEnclavesEnclaveIdentifier(ctx echo.Context, enclaveI } // GetEnclavesEnclaveIdentifierStatus operation middleware -func (sh *strictHandler) GetEnclavesEnclaveIdentifierStatus(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier) error { +func (sh *strictHandler) GetEnclavesEnclaveIdentifierStatus(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error { var request GetEnclavesEnclaveIdentifierStatusRequestObject request.EnclaveIdentifier = enclaveIdentifier @@ -709,7 +694,7 @@ func (sh *strictHandler) GetEnclavesEnclaveIdentifierStatus(ctx echo.Context, en } // PostEnclavesEnclaveIdentifierStatus operation middleware -func (sh *strictHandler) PostEnclavesEnclaveIdentifierStatus(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier) error { +func (sh *strictHandler) PostEnclavesEnclaveIdentifierStatus(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error { var request PostEnclavesEnclaveIdentifierStatusRequestObject request.EnclaveIdentifier = enclaveIdentifier @@ -765,24 +750,30 @@ func (sh *strictHandler) GetEngineInfo(ctx echo.Context) error { // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/9RXTW/bOBD9K8TsHoXI2958yzZB6kNSo04OiyAQWGlssyuRCjkK1gj03xekvi2qdtrY", - "QG+2NJyPN/OGT68QqyxXEiUZmL9CzjXPkFC7fyjjlL9gJBKUJNYCtX2aoIm1yEkoCXN4eFhcBcxslSaU", - "mLDqv9JM8gyZWjPaIqsdQQDCnsk5bSEAawFzX5QAND4XQmMCc9IFBmDiLWbchqddbk8Z0kJuoCytbaZe", - "MOJpOk5vsWbOAauMGE/TJhtzwa5wzYuUmDBszVPTJ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ZtKt0", + "q0dKI/VbQeoHjcXitbJbYbkB3WxFpgG1mL5pPb0g+1eMB33CV6N3mVkbqxoKI4v+WsgYazRCKeX6w3vk", + "O46FGJTCGzek+Yd+A97K0J56kgkodfi5ZV0OrazKAvDxYjFbIB9Npn/MkI/+ultkR4ErBGV9Vl0nWMM7", + "m7WnsJtT0QKoqWbm35+p1EJR5S3Gy5V3N58gHx0Dh25vfru5NbpEAhwnFI3Qh5vbm1vkZ+tBBn5QTOr5", + "XM9AZw6Z+GQlNCFolA9pxQyqMvZyh/niRrwkCSqz/eHpZH5/f3t7sen9dJZ0DPDLNIpAqXXKvMIMlBFl", + "S0qbgqPFQb5uZFN/MbBadLwKPBpvVFka6MlMP6CbuH4CXeH6KVwwIdT8wmxeK64eDb049E6y/DrgfQL9", + "CnKJUA7o5kLVsfuegtK/C7K7WDrVN69DvVuYjffwhrlci811QpH7W0TDFYyDX/aLYEuVFpJGOFs2X8vv", + "zyX1T6I2ZN2rjtXNde9qCV4635nrNXj3zTubQ/8e3fB/cNN2XBm1Ne9rtFilpdh15ebrLfaqmPyqTaDS", + "j71M7zl5GmCp6RpH2YXnAOqAiQizd2tqhptBjGbE0HAOpwL5QiNDZ59OCm6IrH3xeGkZARH/ciYw6SWM", + "iU0/4AvfBxEHkeAcojwHh/DlB8ZuGNPZUemUYOohxpxcQBJwkghqCmufXSzxNH7OIvqCKcPPlFF9AZcH", + "xFRjybD8Nog4gB8QpSakRr39GB4/Ziv4GTYECY6+4Q2cyRXs7VNIyWGYiLxN9tZr9+bBJ8iyuHH4Jc6R", + "5p3S9c4U67J3vKM5a9J/8wBcfotwXdH03yXePjjLXsHJq8i8BMUdRHuxHO+W3jSlj1quOhkZre2D0eHw", + "XwAAAP//wQWlse4dAAA=", } // GetSwagger returns the content of the embedded swagger specification file @@ -822,14 +813,6 @@ func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error) { res[pathToFile] = rawSpec } - pathPrefix := path.Dir(pathToFile) - - for rawPath, rawFunc := range externalRef0.PathToRawSpec(path.Join(pathPrefix, "./api_types.yaml")) { - if _, ok := res[rawPath]; ok { - // it is not possible to compare functions in golang, so always overwrite the old value - } - res[rawPath] = rawFunc - } return res } diff --git a/api/golang/http_rest/websocket_api/websocket_server.gen.go b/api/golang/http_rest/websocket_api/websocket_server.gen.go index 259b50c29d..47261a4eae 100644 --- a/api/golang/http_rest/websocket_api/websocket_server.gen.go +++ b/api/golang/http_rest/websocket_api/websocket_server.gen.go @@ -15,41 +15,21 @@ import ( "github.com/deepmap/oapi-codegen/pkg/runtime" "github.com/getkin/kin-openapi/openapi3" - externalRef0 "github.com/kurtosis-tech/kurtosis/api/golang/http_rest/api_types" + . "github.com/kurtosis-tech/kurtosis/api/golang/http_rest/api_types" "github.com/labstack/echo/v4" ) -// NotOk defines model for NotOk. -type NotOk = externalRef0.ResponseInfo - -// GetEnclavesEnclaveIdentifierLogsParams defines parameters for GetEnclavesEnclaveIdentifierLogs. -type GetEnclavesEnclaveIdentifierLogsParams struct { - ServiceUuidSet externalRef0.ServiceUuidSet `form:"service_uuid_set" json:"service_uuid_set"` - FollowLogs *externalRef0.FollowLogs `form:"follow_logs,omitempty" json:"follow_logs,omitempty"` - ConjunctiveFilters *externalRef0.ConjunctiveFilters `form:"conjunctive_filters,omitempty" json:"conjunctive_filters,omitempty"` - ReturnAllLogs *externalRef0.ReturnAllLogs `form:"return_all_logs,omitempty" json:"return_all_logs,omitempty"` - NumLogLines *externalRef0.NumLogLines `form:"num_log_lines,omitempty" json:"num_log_lines,omitempty"` -} - -// GetEnclavesEnclaveIdentifierServicesServiceIdentifierLogsParams defines parameters for GetEnclavesEnclaveIdentifierServicesServiceIdentifierLogs. -type GetEnclavesEnclaveIdentifierServicesServiceIdentifierLogsParams struct { - FollowLogs *externalRef0.FollowLogs `form:"follow_logs,omitempty" json:"follow_logs,omitempty"` - ConjunctiveFilters *externalRef0.ConjunctiveFilters `form:"conjunctive_filters,omitempty" json:"conjunctive_filters,omitempty"` - ReturnAllLogs *externalRef0.ReturnAllLogs `form:"return_all_logs,omitempty" json:"return_all_logs,omitempty"` - NumLogLines *externalRef0.NumLogLines `form:"num_log_lines,omitempty" json:"num_log_lines,omitempty"` -} - // ServerInterface represents all server handlers. type ServerInterface interface { // Get Service Logs // (GET /enclaves/{enclave_identifier}/logs) - GetEnclavesEnclaveIdentifierLogs(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, params GetEnclavesEnclaveIdentifierLogsParams) error + GetEnclavesEnclaveIdentifierLogs(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, params GetEnclavesEnclaveIdentifierLogsParams) error // Get Service Logs // (GET /enclaves/{enclave_identifier}/services/{service_identifier}/logs) - GetEnclavesEnclaveIdentifierServicesServiceIdentifierLogs(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, serviceIdentifier externalRef0.ServiceIdentifier, params GetEnclavesEnclaveIdentifierServicesServiceIdentifierLogsParams) error + GetEnclavesEnclaveIdentifierServicesServiceIdentifierLogs(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, serviceIdentifier ServiceIdentifier, params GetEnclavesEnclaveIdentifierServicesServiceIdentifierLogsParams) error // (GET /enclaves/{enclave_identifier}/starlark/executions/{starlark_execution_uuid}/logs) - GetEnclavesEnclaveIdentifierStarlarkExecutionsStarlarkExecutionUuidLogs(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, starlarkExecutionUuid externalRef0.StarlarkExecutionUuid) error + GetEnclavesEnclaveIdentifierStarlarkExecutionsStarlarkExecutionUuidLogs(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, starlarkExecutionUuid StarlarkExecutionUuid) error } // ServerInterfaceWrapper converts echo contexts to parameters. @@ -61,7 +41,7 @@ type ServerInterfaceWrapper struct { func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierLogs(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- - var enclaveIdentifier externalRef0.EnclaveIdentifier + var enclaveIdentifier EnclaveIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) if err != nil { @@ -114,7 +94,7 @@ func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierLogs(ctx echo.Conte func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierServicesServiceIdentifierLogs(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- - var enclaveIdentifier externalRef0.EnclaveIdentifier + var enclaveIdentifier EnclaveIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) if err != nil { @@ -122,7 +102,7 @@ func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierServicesServiceIden } // ------------- Path parameter "service_identifier" ------------- - var serviceIdentifier externalRef0.ServiceIdentifier + var serviceIdentifier ServiceIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "service_identifier", runtime.ParamLocationPath, ctx.Param("service_identifier"), &serviceIdentifier) if err != nil { @@ -168,7 +148,7 @@ func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierServicesServiceIden func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierStarlarkExecutionsStarlarkExecutionUuidLogs(ctx echo.Context) error { var err error // ------------- Path parameter "enclave_identifier" ------------- - var enclaveIdentifier externalRef0.EnclaveIdentifier + var enclaveIdentifier EnclaveIdentifier err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) if err != nil { @@ -176,7 +156,7 @@ func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierStarlarkExecutionsS } // ------------- Path parameter "starlark_execution_uuid" ------------- - var starlarkExecutionUuid externalRef0.StarlarkExecutionUuid + var starlarkExecutionUuid StarlarkExecutionUuid err = runtime.BindStyledParameterWithLocation("simple", false, "starlark_execution_uuid", runtime.ParamLocationPath, ctx.Param("starlark_execution_uuid"), &starlarkExecutionUuid) if err != nil { @@ -225,22 +205,35 @@ func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/+xXS2/bRhD+K4ttgV4IU01uvBWoUwgwGsOOkUNgEKvlUFqbnKX3oUYQ+N+LfVCiRFKh", - "kKK5RBdCxMw3r28e3FMu60YioNE029OGKVaDAeX/cYkvFrkRW8hLUXWvBdKMvllQO5pQZDXQbFQ0oZpv", - "oGZex0DtlX9VUNKM/pIeDadBTKd3cn0nED54fdom1OwaB86UYjvatgkF5BXbQi4KQCNKAcphFqC5Eo0R", - "0nn29LT8MyF6I5UBhIKE/1IR5yqRJTEbIBGIJiGahpnNMZgRKwlV8GaFgoJmRlnoxxa91EYJXHs3S1lV", - "8p+8kuvJhPVFRsBWUlbA0KOhrZ1cXgmESbxToRFEgQbWLq2ti8VYhTmrqos+not9w08Naiv45eJ82gCJ", - "cuQo11WFSzRMIChiNszEV3XNsHD1tFVBVkDgK3BroCACx8s34sd15esArBVFrsFM5Wcgd8nMoQPO7I2w", - "XBumKqZe8xCqkOhNjGfTonizJ8k0khjF+GsgegfhcszIY4QmAca1RcP4K1tPtMKUK9ck1BNONxJ1oO/f", - "0nx8jfPFAPr0sqapBGfOQPqiXXD7HuKlofEQoZdYymDsbBwgfG2AO8KAUjI0QFR22Cf6bgQq2YAyAuII", - "LMA9S6lqZmhGrUDz/h1NBm2V0Bq0domcrvG8SD452ZC1LsVfAsDRRhI8ez74IVcvwI0z9RhYeRcb+zQe", - "lCYvpUXH1xGSz+TosUXcXMhXuxM0X8+iEK4ArLo/sT9j/PfMdUG1Y2FGZj5Y7BLntQdNcqD87aEVOgWa", - "UInwsaTZl8uudRhL1EZZ7pHbZJ7ObWDdTOkHi/dKrhVoPVun59UDaFuZa6x9ECj0BorbrWvFuYqfmcJA", - "jbkuuu589v0pYqcZYSpX08+w0pK/giF/3C9pQregdCjd4ub3m4UrtmwAWSNoRt/fLG4WNPFjyjMqjdta", - "p/vh3m7Tbr+tA8MdF/2UWRY0o3+BuY3a8bk8qN6Fjde/iCZIchRJRy6HqQz1tAatOEOnfz/MEB+7z2ao", - "nV8AM1ROD5H2+Wz4v1ss/rPR3590I5P/0XIOWpe2Ip0LYfjbumZqF+pPIgiJKMm3CBWLpdP98M74DrpF", - "N3R8/lAeXqf1k4k/iolxtqaH28yRcvxgGzDz1MGwGkGPXYjo70irQf2myQo2rCppcg2zuz148HLw5smK", - "4v/k+cRR+90UmfWVO3W4DL8ELvPozYL2l1ABJXNLf8LuIaI0HN6t//0bAAD///QElcf6DwAA", + "H4sIAAAAAAAC/+xZW2/bthf/KgL/f2AvapS1b34LWrczlsWB464FikCgpSObjUQqvLjNDH/3gSIl60LJ", + "Uhqse9hTYulcf+fCo8MDiliWMwpUCjQ7oBxznIEEXvyKGP2qaCTJHsKEpOVjQtEMPSrgT8hHFGeAZk5S", + "H4loBxkueCRkBfP/OSRohv4XnBQHhkwE12x7TSi8L/jR0UfyKdfCMef4CR2PPgIapXgPIYmBSpIQ4Fpm", + "DCLiJJeEacs+fly88z2xY1wChdgzvxn3tKkeSzy5A88KQr7xJsdyd3LGocVHHB4V4RCjmeQK6r5ZK4Xk", + "hG4LMxOWpuxbmLJtL2B1EoewDWMpYFpIoyrTdGFKKPTKaxI5JBIqYathPWpfpOI0xGk6aGOb7IydAvie", + "RMPBWe/As3Teia6MSsSoxIQC9+QOS/soyzCNdTxVGnsb8OA7REpC7BHqDp/DjmnhKwUoReJQgOzDp0M3", + "pKaqgJY+R5YLiXmK+UNoXCWMFircaCpKHlUDTMk8yXH0YBK9FKExxt6dFe0ZMboschw94G1PKfSZMgXQ", + "IuFEzqgw6XvD5PLB9hcJtIAX53lKIqwVBF+Fdu5QkzjUNFZW9IImzChrtQMK33OIdMIA58wUgGXWsm3T", + "KbofZzlwSYyZqX06NnA+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lxqXSwHinOCZujNxeXFJfKLpVgBQmB3w/rH0T/9DHZESMZJhNP2m0N3nXwcQxNgLkmCIymm", + "UQcpi3D6Sg84Exk5ZEzCczjtF7wIDt3l60Rng0P570vLCGL2jaYMx6OElYvxrdlumF0XYXQRoxn6AHJu", + "ue3fRcV6bVbl9auUnmZ9IgkcVw59narG1VnDjOCpXzyMIHdd7Ixga18djGBp3mAc71tb49eXly+2M65v", + "uRwr47tq4vJKE8zWWGUZ5k8m/p4V4tl4S6zz5YvuP4Czoo0dz2dZWTijUrKqsohRCuWX9gQ+06SepjE9", + "u6QHJQT2YucFJAGNc0Z0fA8549KObMcA7zFJ8YakRL6Ay89vCDZRhP37UzvFNK7/esW/qlfY0W1cLlvi", + "oFqf6rR23+Z1crvpovkMAeG6PqTFJaMSwH8R3gZ2OE2QP6U22jto0XnyUZH4n6yUnhvPH06ySevX9kdi", + "95p4OBMfFYhibo4hwXar5NJbeRSYW9nituSHsjOw98liWpqWXMHB/heS+DhNhAFjtF6pTqRbQiGwXwvH", + "4/HvAAAA//+SqAa/FyMAAA==", } // GetSwagger returns the content of the embedded swagger specification file @@ -280,14 +273,6 @@ func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error) { res[pathToFile] = rawSpec } - pathPrefix := path.Dir(pathToFile) - - for rawPath, rawFunc := range externalRef0.PathToRawSpec(path.Join(pathPrefix, "./api_types.yaml")) { - if _, ok := res[rawPath]; ok { - // it is not possible to compare functions in golang, so always overwrite the old value - } - res[rawPath] = rawFunc - } return res } diff --git a/api/openapi/generators/api_types.cfg.yaml b/api/openapi/generators/api_types.cfg.yaml index 356a925593..e063278144 100644 --- a/api/openapi/generators/api_types.cfg.yaml +++ b/api/openapi/generators/api_types.cfg.yaml @@ -1,7 +1,4 @@ package: api_types generate: models: true - embedded-spec: true output: api/golang/http_rest/api_types/api_types.gen.go -output-options: - skip-prune: true \ No newline at end of file diff --git a/api/openapi/generators/core_server.cfg.yaml b/api/openapi/generators/core_server.cfg.yaml index 5a6004103f..d13017a2d2 100644 --- a/api/openapi/generators/core_server.cfg.yaml +++ b/api/openapi/generators/core_server.cfg.yaml @@ -3,7 +3,10 @@ generate: embedded-spec: true echo-server: true strict-server: true - models: true -import-mapping: - ./api_types.yaml: github.com/kurtosis-tech/kurtosis/api/golang/http_rest/api_types -output: api/golang/http_rest/core_rest_api/api_container_server.gen.go \ No newline at end of file +additional-imports: + - package: github.com/kurtosis-tech/kurtosis/api/golang/http_rest/api_types + alias: . +output: api/golang/http_rest/core_rest_api/api_container_server.gen.go +output-options: + include-tags: + - enclave diff --git a/api/openapi/generators/engine_server.cfg.yaml b/api/openapi/generators/engine_server.cfg.yaml index 911a2f5467..4111bf6914 100644 --- a/api/openapi/generators/engine_server.cfg.yaml +++ b/api/openapi/generators/engine_server.cfg.yaml @@ -3,7 +3,10 @@ generate: embedded-spec: true echo-server: true strict-server: true - models: true -import-mapping: - ./api_types.yaml: github.com/kurtosis-tech/kurtosis/api/golang/http_rest/api_types -output: api/golang/http_rest/engine_rest_api/engine_server.gen.go \ No newline at end of file +additional-imports: + - package: github.com/kurtosis-tech/kurtosis/api/golang/http_rest/api_types + alias: . +output: api/golang/http_rest/engine_rest_api/engine_server.gen.go +output-options: + include-tags: + - engine diff --git a/api/openapi/generators/websocket_server.cfg.yaml b/api/openapi/generators/websocket_server.cfg.yaml index cba2dd4142..24faafe384 100644 --- a/api/openapi/generators/websocket_server.cfg.yaml +++ b/api/openapi/generators/websocket_server.cfg.yaml @@ -3,7 +3,10 @@ generate: embedded-spec: true echo-server: true strict-server: false - models: true -import-mapping: - ./api_types.yaml: github.com/kurtosis-tech/kurtosis/api/golang/http_rest/api_types -output: api/golang/http_rest/websocket_api/websocket_server.gen.go \ No newline at end of file +additional-imports: + - package: github.com/kurtosis-tech/kurtosis/api/golang/http_rest/api_types + alias: . +output: api/golang/http_rest/websocket_api/websocket_server.gen.go +output-options: + include-tags: + - streaming diff --git a/api/openapi/scripts/build.sh b/api/openapi/scripts/build.sh index 1e3ae859b9..fd7907fa86 100755 --- a/api/openapi/scripts/build.sh +++ b/api/openapi/scripts/build.sh @@ -6,9 +6,9 @@ script_dirpath="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" api_root_dirpath="$(dirname "${script_dirpath}")" echo "Generating data models for REST API " -oapi-codegen --config="$api_root_dirpath/generators/api_types.cfg.yaml" "$api_root_dirpath/specs/api_types.yaml" +oapi-codegen --config="$api_root_dirpath/generators/api_types.cfg.yaml" "$api_root_dirpath/specs/kurtosis_api.yaml" echo "Generating server code for REST API " -oapi-codegen --config="$api_root_dirpath/generators/engine_server.cfg.yaml" "$api_root_dirpath/specs/engine_service.yaml" -oapi-codegen --config="$api_root_dirpath/generators/core_server.cfg.yaml" "$api_root_dirpath/specs/core_service.yaml" -oapi-codegen --config="$api_root_dirpath/generators/websocket_server.cfg.yaml" "$api_root_dirpath/specs/websocket_service.yaml" \ No newline at end of file +oapi-codegen --config="$api_root_dirpath/generators/engine_server.cfg.yaml" "$api_root_dirpath/specs/kurtosis_api.yaml" +oapi-codegen --config="$api_root_dirpath/generators/core_server.cfg.yaml" "$api_root_dirpath/specs/kurtosis_api.yaml" +oapi-codegen --config="$api_root_dirpath/generators/websocket_server.cfg.yaml" "$api_root_dirpath/specs/kurtosis_api.yaml" \ No newline at end of file diff --git a/api/openapi/specs/core_service.yaml b/api/openapi/specs/core_service.yaml deleted file mode 100644 index bdfdad7a97..0000000000 --- a/api/openapi/specs/core_service.yaml +++ /dev/null @@ -1,321 +0,0 @@ -openapi: 3.0.0 - -info: - title: Enclave API - description: API to manipulate the enclaves - version: 0.1.0 - -paths: - - /enclaves/{enclave_identifier}/starlark: - get: - description: Get last Starlark run - parameters: - - $ref: './api_types.yaml#/components/parameters/enclave_identifier' - responses: - default: - $ref: '#/components/responses/NotOk' - "200": - description: Successful request - content: - application/json: - schema: - $ref: "./api_types.yaml#/components/schemas/StarlarkDescription" - - /enclaves/{enclave_identifier}/starlark/packages: - post: - description: Uploads a Starlark package. This step is required before the package can be executed with RunStarlarkPackage - parameters: - - $ref: './api_types.yaml#/components/parameters/enclave_identifier' - requestBody: - $ref: "./api_types.yaml#/components/requestBodies/fileUploadBody" - responses: - default: - $ref: '#/components/responses/NotOk' - "200": - description: Success - - /enclaves/{enclave_identifier}/starlark/packages/{package_id}: - post: - description: Executes a Starlark script on the user's behalf - parameters: - - $ref: './api_types.yaml#/components/parameters/enclave_identifier' - - $ref: './api_types.yaml#/components/parameters/package_id' - - $ref: './api_types.yaml#/components/parameters/retrieve_logs_async' - requestBody: - content: - application/json: - schema: - $ref: "./api_types.yaml#/components/schemas/RunStarlarkPackage" - required: true - responses: - default: - $ref: '#/components/responses/NotOk' - "200": - description: Successful request - content: - application/json: - schema: - $ref: "./api_types.yaml#/components/schemas/StarlarkRunResponse" - - /enclaves/{enclave_identifier}/starlark/scripts: - post: - description: Executes a Starlark script on the user's behalf - parameters: - - $ref: './api_types.yaml#/components/parameters/enclave_identifier' - - $ref: './api_types.yaml#/components/parameters/retrieve_logs_async' - requestBody: - content: - application/json: - schema: - $ref: "./api_types.yaml#/components/schemas/RunStarlarkScript" - required: true - responses: - default: - $ref: '#/components/responses/NotOk' - "200": - description: Successful request - content: - application/json: - schema: - $ref: "./api_types.yaml#/components/schemas/StarlarkRunResponse" - - /enclaves/{enclave_identifier}/services/{service_identifier}: - get: - parameters: - - $ref: './api_types.yaml#/components/parameters/enclave_identifier' - - $ref: './api_types.yaml#/components/parameters/service_identifier' - responses: - default: - $ref: '#/components/responses/NotOk' - "200": - description: Successful request - content: - application/json: - schema: - $ref: "./api_types.yaml#/components/schemas/ServiceInfo" - - /enclaves/{enclave_identifier}/services/history: - get: - description: Returns information about all existing & historical services - parameters: - - $ref: './api_types.yaml#/components/parameters/enclave_identifier' - responses: - default: - $ref: '#/components/responses/NotOk' - "200": - description: Successful request - content: - application/json: - schema: - type: array - items: - $ref: "./api_types.yaml#/components/schemas/ServiceIdentifiers" - - /enclaves/{enclave_identifier}/services: - get: - parameters: - - $ref: './api_types.yaml#/components/parameters/enclave_identifier' - - in: query - name: services - schema: - type: array - items: - type: string - description: Select services to get information - responses: - default: - $ref: '#/components/responses/NotOk' - "200": - description: Successful request - content: - application/json: - schema: - type: object - additionalProperties: - $ref: "./api_types.yaml#/components/schemas/ServiceInfo" - - /enclaves/{enclave_identifier}/services/{service_identifier}/command: - post: - description: Executes the given command inside a running container - parameters: - - $ref: './api_types.yaml#/components/parameters/enclave_identifier' - - $ref: './api_types.yaml#/components/parameters/service_identifier' - requestBody: - content: - application/json: - schema: - $ref: "./api_types.yaml#/components/schemas/ExecCommand" - description: Exec Command - required: true - responses: - default: - $ref: '#/components/responses/NotOk' - "200": - description: Successful request - content: - application/json: - schema: - $ref: "./api_types.yaml#/components/schemas/ExecCommandResult" - - /enclaves/{enclave_identifier}/services/{service_identifier}/endpoints/{port_number}/availability: - get: - description: Block until the given HTTP endpoint returns available, calling it through a HTTP request - parameters: - - $ref: './api_types.yaml#/components/parameters/enclave_identifier' - - $ref: './api_types.yaml#/components/parameters/service_identifier' - - $ref: './api_types.yaml#/components/parameters/port_number' - - $ref: './api_types.yaml#/components/parameters/http_method' - - $ref: './api_types.yaml#/components/parameters/path' - - $ref: './api_types.yaml#/components/parameters/initial_delay_milliseconds' - - $ref: './api_types.yaml#/components/parameters/retries' - - $ref: './api_types.yaml#/components/parameters/retries_delay_milliseconds' - - $ref: './api_types.yaml#/components/parameters/expected_response' - - $ref: './api_types.yaml#/components/parameters/request_body' - responses: - "200": - description: Success - - /enclaves/{enclave_identifier}/artifacts: - get: - description: List all files artifacts - parameters: - - $ref: './api_types.yaml#/components/parameters/enclave_identifier' - responses: - default: - $ref: '#/components/responses/NotOk' - "200": - description: Successful request - content: - application/json: - schema: - type: array - items: - $ref: "./api_types.yaml#/components/schemas/FileArtifactReference" - - /enclaves/{enclave_identifier}/artifacts/{artifact_identifier}: - get: - parameters: - - $ref: './api_types.yaml#/components/parameters/enclave_identifier' - - $ref: './api_types.yaml#/components/parameters/artifact_identifier' - description: Inspect the content of a file artifact - responses: - default: - $ref: '#/components/responses/NotOk' - "200": - description: Successful request - content: - application/json: - schema: - type: array - items: - $ref: "./api_types.yaml#/components/schemas/FileArtifactDescription" - - /enclaves/{enclave_identifier}/artifacts/{artifact_identifier}/download: - get: - description: Downloads a files artifact from the Kurtosis File System - parameters: - - $ref: './api_types.yaml#/components/parameters/enclave_identifier' - - $ref: './api_types.yaml#/components/parameters/artifact_identifier' - responses: - default: - $ref: '#/components/responses/NotOk' - "200": - description: Successful request - content: - application/octet-stream: - schema: - type: string - format: binary - - /enclaves/{enclave_identifier}/artifacts/local-file: - post: - description: Uploads a files artifact to the Kurtosis File System - parameters: - - $ref: './api_types.yaml#/components/parameters/enclave_identifier' - requestBody: - $ref: "./api_types.yaml#/components/requestBodies/fileUploadBody" - responses: - default: - $ref: '#/components/responses/NotOk' - "200": - description: Successful request - content: - application/json: - schema: - type: object - additionalProperties: - $ref: "./api_types.yaml#/components/schemas/FileArtifactReference" - - /enclaves/{enclave_identifier}/artifacts/remote-file: - post: - description: Tells the API container to download a files artifact from the web to the Kurtosis File System - parameters: - - $ref: './api_types.yaml#/components/parameters/enclave_identifier' - requestBody: - content: - application/json: - schema: - $ref: "./api_types.yaml#/components/schemas/StoreWebFilesArtifact" - description: Store Web Files Artifact - required: true - responses: - default: - $ref: '#/components/responses/NotOk' - "200": - description: Successful request - content: - application/json: - schema: - $ref: "./api_types.yaml#/components/schemas/FileArtifactReference" - - /enclaves/{enclave_identifier}/artifacts/services/{service_identifier}: - post: - description: Tells the API container to copy a files artifact from a service to the Kurtosis File System - parameters: - - $ref: './api_types.yaml#/components/parameters/enclave_identifier' - - $ref: './api_types.yaml#/components/parameters/service_identifier' - requestBody: - content: - application/json: - schema: - $ref: "./api_types.yaml#/components/schemas/StoreFilesArtifactFromService" - required: true - responses: - default: - $ref: '#/components/responses/NotOk' - "200": - description: Successful request - content: - application/json: - schema: - $ref: "./api_types.yaml#/components/schemas/FileArtifactReference" - - /enclaves/{enclave_identifier}/services/connection: - post: - description: User services port forwarding - parameters: - - $ref: './api_types.yaml#/components/parameters/enclave_identifier' - requestBody: - content: - application/json: - schema: - $ref: "./api_types.yaml#/components/schemas/Connect" - required: true - responses: - default: - $ref: '#/components/responses/NotOk' - "200": - description: Successful request - -components: - - responses: - - NotOk: - description: Unexpected error - content: - application/json: - schema: - $ref: './api_types.yaml#/components/schemas/ResponseInfo' - required: true diff --git a/api/openapi/specs/engine_service.yaml b/api/openapi/specs/engine_service.yaml deleted file mode 100644 index 4b9c517f88..0000000000 --- a/api/openapi/specs/engine_service.yaml +++ /dev/null @@ -1,149 +0,0 @@ -openapi: 3.0.0 - -info: - title: Engine API - version: 0.1.0 - -paths: - /engine/info: - get: - summary: Get Engine Info - responses: - default: - $ref: '#/components/responses/NotOk' - '200': - description: Successful response - content: - application/json: - schema: - $ref: './api_types.yaml#/components/schemas/EngineInfo' - - /enclaves: - get: - summary: Get Enclaves - responses: - default: - $ref: '#/components/responses/NotOk' - '200': - description: Successful response - content: - application/json: - schema: - type: object - additionalProperties: - $ref: './api_types.yaml#/components/schemas/EnclaveInfo' - - post: - summary: Create Enclave - requestBody: - required: true - content: - application/json: - schema: - $ref: './api_types.yaml#/components/schemas/CreateEnclave' - responses: - - default: - $ref: '#/components/responses/NotOk' - '200': - description: Successful response - content: - application/json: - schema: - $ref: './api_types.yaml#/components/schemas/EnclaveInfo' - - delete: - summary: Delete Enclaves - parameters: - - $ref: './api_types.yaml#/components/parameters/remove_all' - responses: - default: - $ref: '#/components/responses/NotOk' - '200': - description: Successful response - content: - application/json: - schema: - $ref: './api_types.yaml#/components/schemas/DeletionSummary' - - /enclaves/historical: - get: - summary: Get Historical Enclaves - responses: - default: - $ref: '#/components/responses/NotOk' - '200': - description: Successful response - content: - application/json: - schema: - type: array - items: - $ref: './api_types.yaml#/components/schemas/EnclaveIdentifiers' - - /enclaves/{enclave_identifier}: - get: - summary: Get Enclave Info - parameters: - - $ref: './api_types.yaml#/components/parameters/enclave_identifier' - responses: - default: - $ref: '#/components/responses/NotOk' - '200': - description: Successful response - content: - application/json: - schema: - $ref: './api_types.yaml#/components/schemas/EnclaveInfo' - - delete: - summary: Destroy Enclave - parameters: - - $ref: './api_types.yaml#/components/parameters/enclave_identifier' - responses: - default: - $ref: '#/components/responses/NotOk' - '200': - description: Successful response - - /enclaves/{enclave_identifier}/status: - get: - summary: Get enclave status - parameters: - - $ref: './api_types.yaml#/components/parameters/enclave_identifier' - responses: - default: - $ref: '#/components/responses/NotOk' - '200': - description: Successful response - content: - application/json: - schema: - $ref: './api_types.yaml#/components/schemas/EnclaveContainersStatus' - post: - summary: Set enclave status - parameters: - - $ref: './api_types.yaml#/components/parameters/enclave_identifier' - requestBody: - required: true - content: - application/json: - schema: - $ref: './api_types.yaml#/components/schemas/EnclaveTargetStatus' - responses: - default: - $ref: '#/components/responses/NotOk' - '200': - description: Successful response - -components: - - responses: - - NotOk: - description: Unexpected error - content: - application/json: - schema: - $ref: './api_types.yaml#/components/schemas/ResponseInfo' - required: true \ No newline at end of file diff --git a/api/openapi/specs/api_types.yaml b/api/openapi/specs/kurtosis_api.yaml similarity index 56% rename from api/openapi/specs/api_types.yaml rename to api/openapi/specs/kurtosis_api.yaml index 91c21a4c65..4000caf05b 100644 --- a/api/openapi/specs/api_types.yaml +++ b/api/openapi/specs/kurtosis_api.yaml @@ -1,10 +1,571 @@ openapi: 3.0.0 info: - title: API Types + title: Kurtosis REST API version: 0.1.0 -paths: {} # Specs for types only +paths: + + # ========================================================================================================================= + # ========================================================================================================================= + # > > > > > > > > > > > > > > > > > > > > > > > > Engine API < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < + # ========================================================================================================================= + # ========================================================================================================================= + + /engine/info: + get: + tags: + - engine + summary: Get Engine Info + responses: + default: + $ref: '#/components/responses/NotOk' + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/EngineInfo' + + /enclaves: + get: + tags: + - engine + summary: Get Enclaves + responses: + default: + $ref: '#/components/responses/NotOk' + '200': + description: Successful response + content: + application/json: + schema: + type: object + additionalProperties: + $ref: '#/components/schemas/EnclaveInfo' + + post: + tags: + - engine + summary: Create Enclave + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateEnclave' + responses: + + default: + $ref: '#/components/responses/NotOk' + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/EnclaveInfo' + + delete: + tags: + - engine + summary: Delete Enclaves + parameters: + - $ref: '#/components/parameters/remove_all' + responses: + default: + $ref: '#/components/responses/NotOk' + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/DeletionSummary' + + /enclaves/historical: + get: + tags: + - engine + summary: Get Historical Enclaves + responses: + default: + $ref: '#/components/responses/NotOk' + '200': + description: Successful response + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/EnclaveIdentifiers' + + /enclaves/{enclave_identifier}: + get: + tags: + - engine + summary: Get Enclave Info + parameters: + - $ref: '#/components/parameters/enclave_identifier' + responses: + default: + $ref: '#/components/responses/NotOk' + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/EnclaveInfo' + + delete: + tags: + - engine + summary: Destroy Enclave + parameters: + - $ref: '#/components/parameters/enclave_identifier' + responses: + default: + $ref: '#/components/responses/NotOk' + '200': + description: Successful response + + /enclaves/{enclave_identifier}/status: + get: + tags: + - engine + summary: Get enclave status + parameters: + - $ref: '#/components/parameters/enclave_identifier' + responses: + default: + $ref: '#/components/responses/NotOk' + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/EnclaveContainersStatus' + post: + tags: + - engine + summary: Set enclave status + parameters: + - $ref: '#/components/parameters/enclave_identifier' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/EnclaveTargetStatus' + responses: + default: + $ref: '#/components/responses/NotOk' + '200': + description: Successful response + + # ========================================================================================================================= + # ========================================================================================================================= + # > > > > > > > > > > > > > > > > > > > > > > > > Enclave API < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < + # ========================================================================================================================= + # ========================================================================================================================= + + /enclaves/{enclave_identifier}/starlark: + get: + tags: + - enclave + description: Get last Starlark run + parameters: + - $ref: '#/components/parameters/enclave_identifier' + responses: + default: + $ref: '#/components/responses/NotOk' + "200": + description: Successful request + content: + application/json: + schema: + $ref: "#/components/schemas/StarlarkDescription" + + /enclaves/{enclave_identifier}/starlark/packages: + post: + tags: + - enclave + description: Uploads a Starlark package. This step is required before the package can be executed with RunStarlarkPackage + parameters: + - $ref: '#/components/parameters/enclave_identifier' + requestBody: + $ref: "#/components/requestBodies/fileUploadBody" + responses: + default: + $ref: '#/components/responses/NotOk' + "200": + description: Success + + /enclaves/{enclave_identifier}/starlark/packages/{package_id}: + post: + tags: + - enclave + description: Executes a Starlark script on the user's behalf + parameters: + - $ref: '#/components/parameters/enclave_identifier' + - $ref: '#/components/parameters/package_id' + - $ref: '#/components/parameters/retrieve_logs_async' + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/RunStarlarkPackage" + required: true + responses: + default: + $ref: '#/components/responses/NotOk' + "200": + description: Successful request + content: + application/json: + schema: + $ref: "#/components/schemas/StarlarkRunResponse" + + /enclaves/{enclave_identifier}/starlark/scripts: + post: + tags: + - enclave + description: Executes a Starlark script on the user's behalf + parameters: + - $ref: '#/components/parameters/enclave_identifier' + - $ref: '#/components/parameters/retrieve_logs_async' + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/RunStarlarkScript" + required: true + responses: + default: + $ref: '#/components/responses/NotOk' + "200": + description: Successful request + content: + application/json: + schema: + $ref: "#/components/schemas/StarlarkRunResponse" + + /enclaves/{enclave_identifier}/services/{service_identifier}: + get: + tags: + - enclave + parameters: + - $ref: '#/components/parameters/enclave_identifier' + - $ref: '#/components/parameters/service_identifier' + responses: + default: + $ref: '#/components/responses/NotOk' + "200": + description: Successful request + content: + application/json: + schema: + $ref: "#/components/schemas/ServiceInfo" + + /enclaves/{enclave_identifier}/services/history: + get: + tags: + - enclave + description: Returns information about all existing & historical services + parameters: + - $ref: '#/components/parameters/enclave_identifier' + responses: + default: + $ref: '#/components/responses/NotOk' + "200": + description: Successful request + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/ServiceIdentifiers" + + /enclaves/{enclave_identifier}/services: + get: + tags: + - enclave + parameters: + - $ref: '#/components/parameters/enclave_identifier' + - in: query + name: services + schema: + type: array + items: + type: string + description: Select services to get information + responses: + default: + $ref: '#/components/responses/NotOk' + "200": + description: Successful request + content: + application/json: + schema: + type: object + additionalProperties: + $ref: "#/components/schemas/ServiceInfo" + + /enclaves/{enclave_identifier}/services/{service_identifier}/command: + post: + tags: + - enclave + description: Executes the given command inside a running container + parameters: + - $ref: '#/components/parameters/enclave_identifier' + - $ref: '#/components/parameters/service_identifier' + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/ExecCommand" + description: Exec Command + required: true + responses: + default: + $ref: '#/components/responses/NotOk' + "200": + description: Successful request + content: + application/json: + schema: + $ref: "#/components/schemas/ExecCommandResult" + + /enclaves/{enclave_identifier}/services/{service_identifier}/endpoints/{port_number}/availability: + get: + tags: + - enclave + description: Block until the given HTTP endpoint returns available, calling it through a HTTP request + parameters: + - $ref: '#/components/parameters/enclave_identifier' + - $ref: '#/components/parameters/service_identifier' + - $ref: '#/components/parameters/port_number' + - $ref: '#/components/parameters/http_method' + - $ref: '#/components/parameters/path' + - $ref: '#/components/parameters/initial_delay_milliseconds' + - $ref: '#/components/parameters/retries' + - $ref: '#/components/parameters/retries_delay_milliseconds' + - $ref: '#/components/parameters/expected_response' + - $ref: '#/components/parameters/request_body' + responses: + "200": + description: Success + + /enclaves/{enclave_identifier}/artifacts: + get: + tags: + - enclave + description: List all files artifacts + parameters: + - $ref: '#/components/parameters/enclave_identifier' + responses: + default: + $ref: '#/components/responses/NotOk' + "200": + description: Successful request + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/FileArtifactReference" + + /enclaves/{enclave_identifier}/artifacts/{artifact_identifier}: + get: + tags: + - enclave + parameters: + - $ref: '#/components/parameters/enclave_identifier' + - $ref: '#/components/parameters/artifact_identifier' + description: Inspect the content of a file artifact + responses: + default: + $ref: '#/components/responses/NotOk' + "200": + description: Successful request + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/FileArtifactDescription" + + /enclaves/{enclave_identifier}/artifacts/{artifact_identifier}/download: + get: + tags: + - enclave + description: Downloads a files artifact from the Kurtosis File System + parameters: + - $ref: '#/components/parameters/enclave_identifier' + - $ref: '#/components/parameters/artifact_identifier' + responses: + default: + $ref: '#/components/responses/NotOk' + "200": + description: Successful request + content: + application/octet-stream: + schema: + type: string + format: binary + + /enclaves/{enclave_identifier}/artifacts/local-file: + post: + tags: + - enclave + description: Uploads a files artifact to the Kurtosis File System + parameters: + - $ref: '#/components/parameters/enclave_identifier' + requestBody: + $ref: "#/components/requestBodies/fileUploadBody" + responses: + default: + $ref: '#/components/responses/NotOk' + "200": + description: Successful request + content: + application/json: + schema: + type: object + additionalProperties: + $ref: "#/components/schemas/FileArtifactReference" + + /enclaves/{enclave_identifier}/artifacts/remote-file: + post: + tags: + - enclave + description: Tells the API container to download a files artifact from the web to the Kurtosis File System + parameters: + - $ref: '#/components/parameters/enclave_identifier' + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/StoreWebFilesArtifact" + description: Store Web Files Artifact + required: true + responses: + default: + $ref: '#/components/responses/NotOk' + "200": + description: Successful request + content: + application/json: + schema: + $ref: "#/components/schemas/FileArtifactReference" + + /enclaves/{enclave_identifier}/artifacts/services/{service_identifier}: + post: + tags: + - enclave + description: Tells the API container to copy a files artifact from a service to the Kurtosis File System + parameters: + - $ref: '#/components/parameters/enclave_identifier' + - $ref: '#/components/parameters/service_identifier' + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/StoreFilesArtifactFromService" + required: true + responses: + default: + $ref: '#/components/responses/NotOk' + "200": + description: Successful request + content: + application/json: + schema: + $ref: "#/components/schemas/FileArtifactReference" + + /enclaves/{enclave_identifier}/services/connection: + post: + tags: + - enclave + description: User services port forwarding + parameters: + - $ref: '#/components/parameters/enclave_identifier' + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/Connect" + required: true + responses: + default: + $ref: '#/components/responses/NotOk' + "200": + description: Successful request + + # ========================================================================================================================= + # ========================================================================================================================= + # > > > > > > > > > > > > > > > > > > > > > > > > Websocket API < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < + # ========================================================================================================================= + # ========================================================================================================================= + + /enclaves/{enclave_identifier}/logs: + get: + tags: + - streaming + summary: Get Service Logs + parameters: + - $ref: "#/components/parameters/enclave_identifier" + - $ref: "#/components/parameters/service_uuid_set" + - $ref: "#/components/parameters/follow_logs" + - $ref: "#/components/parameters/conjunctive_filters" + - $ref: "#/components/parameters/return_all_logs" + - $ref: "#/components/parameters/num_log_lines" + responses: + "200": + description: Successful response + content: + application/json: + schema: + $ref: "#/components/schemas/ServiceLogs" + + /enclaves/{enclave_identifier}/services/{service_identifier}/logs: + get: + tags: + - streaming + summary: Get Service Logs + parameters: + - $ref: "#/components/parameters/enclave_identifier" + - $ref: "#/components/parameters/service_identifier" + - $ref: "#/components/parameters/follow_logs" + - $ref: "#/components/parameters/conjunctive_filters" + - $ref: "#/components/parameters/return_all_logs" + - $ref: "#/components/parameters/num_log_lines" + responses: + "200": + description: Successful response + content: + application/json: + schema: + $ref: "#/components/schemas/ServiceLogs" + + /enclaves/{enclave_identifier}/starlark/executions/{starlark_execution_uuid}/logs: + get: + tags: + - streaming + description: Executes a Starlark script on the user's behalf + parameters: + - $ref: '#/components/parameters/enclave_identifier' + - $ref: '#/components/parameters/starlark_execution_uuid' + responses: + default: + $ref: '#/components/responses/NotOk' + "200": + description: Successful request + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/StarlarkRunResponseLine" + # ========================================================================================================================= # ========================================================================================================================= @@ -14,6 +575,16 @@ paths: {} # Specs for types only components: + responses: + + NotOk: + description: Unexpected error + content: + application/json: + schema: + $ref: '#/components/schemas/ResponseInfo' + required: true + requestBodies: fileUploadBody: diff --git a/api/openapi/specs/websocket_service.yaml b/api/openapi/specs/websocket_service.yaml deleted file mode 100644 index 2bc0ed6200..0000000000 --- a/api/openapi/specs/websocket_service.yaml +++ /dev/null @@ -1,72 +0,0 @@ -openapi: 3.0.0 - -info: - title: Websocket API - version: 0.1.0 - -paths: - /enclaves/{enclave_identifier}/logs: - get: - summary: Get Service Logs - parameters: - - $ref: "./api_types.yaml#/components/parameters/enclave_identifier" - - $ref: "./api_types.yaml#/components/parameters/service_uuid_set" - - $ref: "./api_types.yaml#/components/parameters/follow_logs" - - $ref: "./api_types.yaml#/components/parameters/conjunctive_filters" - - $ref: "./api_types.yaml#/components/parameters/return_all_logs" - - $ref: "./api_types.yaml#/components/parameters/num_log_lines" - responses: - "200": - description: Successful response - content: - application/json: - schema: - $ref: "./api_types.yaml#/components/schemas/ServiceLogs" - - /enclaves/{enclave_identifier}/services/{service_identifier}/logs: - get: - summary: Get Service Logs - parameters: - - $ref: "./api_types.yaml#/components/parameters/enclave_identifier" - - $ref: "./api_types.yaml#/components/parameters/service_identifier" - - $ref: "./api_types.yaml#/components/parameters/follow_logs" - - $ref: "./api_types.yaml#/components/parameters/conjunctive_filters" - - $ref: "./api_types.yaml#/components/parameters/return_all_logs" - - $ref: "./api_types.yaml#/components/parameters/num_log_lines" - responses: - "200": - description: Successful response - content: - application/json: - schema: - $ref: "./api_types.yaml#/components/schemas/ServiceLogs" - - /enclaves/{enclave_identifier}/starlark/executions/{starlark_execution_uuid}/logs: - get: - description: Executes a Starlark script on the user's behalf - parameters: - - $ref: './api_types.yaml#/components/parameters/enclave_identifier' - - $ref: './api_types.yaml#/components/parameters/starlark_execution_uuid' - responses: - default: - $ref: '#/components/responses/NotOk' - "200": - description: Successful request - content: - application/json: - schema: - type: array - items: - $ref: "./api_types.yaml#/components/schemas/StarlarkRunResponseLine" - -components: - - responses: - - NotOk: - description: Unexpected error - content: - application/json: - schema: - $ref: './api_types.yaml#/components/schemas/ResponseInfo' - required: true \ No newline at end of file diff --git a/engine/server/engine/server/websocket_api_handler.go b/engine/server/engine/server/websocket_api_handler.go index 45269a0ece..be7a130566 100644 --- a/engine/server/engine/server/websocket_api_handler.go +++ b/engine/server/engine/server/websocket_api_handler.go @@ -21,7 +21,6 @@ import ( "golang.org/x/net/websocket" api_type "github.com/kurtosis-tech/kurtosis/api/golang/http_rest/api_types" - api "github.com/kurtosis-tech/kurtosis/api/golang/http_rest/websocket_api" ) type WebSocketRuntime struct { @@ -63,7 +62,7 @@ type LogStreamer struct { notFoundServiceUuids []string } -func (engine WebSocketRuntime) GetEnclavesEnclaveIdentifierLogs(ctx echo.Context, enclaveIdentifier api_type.EnclaveIdentifier, params api.GetEnclavesEnclaveIdentifierLogsParams) error { +func (engine WebSocketRuntime) GetEnclavesEnclaveIdentifierLogs(ctx echo.Context, enclaveIdentifier api_type.EnclaveIdentifier, params api_type.GetEnclavesEnclaveIdentifierLogsParams) error { streamer, err := engine.getLogStreamer( ctx, enclaveIdentifier, @@ -86,7 +85,7 @@ func (engine WebSocketRuntime) GetEnclavesEnclaveIdentifierLogs(ctx echo.Context } -func (engine WebSocketRuntime) GetEnclavesEnclaveIdentifierServicesServiceIdentifierLogs(ctx echo.Context, enclaveIdentifier api_type.EnclaveIdentifier, serviceIdentifier api_type.ServiceIdentifier, params api.GetEnclavesEnclaveIdentifierServicesServiceIdentifierLogsParams) error { +func (engine WebSocketRuntime) GetEnclavesEnclaveIdentifierServicesServiceIdentifierLogs(ctx echo.Context, enclaveIdentifier api_type.EnclaveIdentifier, serviceIdentifier api_type.ServiceIdentifier, params api_type.GetEnclavesEnclaveIdentifierServicesServiceIdentifierLogsParams) error { serviceUuidStrSet := []user_service.ServiceUUID{user_service.ServiceUUID(serviceIdentifier)} streamer, err := engine.getLogStreamer( ctx, From 26cddd434837db7f511a1ae8801724de68803838 Mon Sep 17 00:00:00 2001 From: lostbean Date: Wed, 29 Nov 2023 19:05:47 -0300 Subject: [PATCH 65/95] Fix create enclave optional params and keep ctx in background --- .../http_rest/api_types/api_types.gen.go | 38 ++++++++------- .../core_rest_api/api_container_server.gen.go | 44 ++++++++--------- .../engine_rest_api/engine_server.gen.go | 48 +++++++++---------- api/openapi/specs/kurtosis_api.yaml | 14 ++++-- .../engine/server/enclave_rest_api_handler.go | 22 ++++++--- .../engine/server/engine_rest_api_handler.go | 14 ++++-- 6 files changed, 103 insertions(+), 77 deletions(-) diff --git a/api/golang/http_rest/api_types/api_types.gen.go b/api/golang/http_rest/api_types/api_types.gen.go index 4264dddf25..e530f923b3 100644 --- a/api/golang/http_rest/api_types/api_types.gen.go +++ b/api/golang/http_rest/api_types/api_types.gen.go @@ -136,9 +136,10 @@ type ContainerStatus string // CreateEnclave defines model for CreateEnclave. type CreateEnclave struct { + // ApiContainerLogLevel Enclave log level, defaults to INFO ApiContainerLogLevel *string `json:"api_container_log_level,omitempty"` - ApiContainerVersionTag *string `json:"api_container_version_tag,omitempty"` - EnclaveName *string `json:"enclave_name,omitempty"` + ApiContainerVersionTag string `json:"api_container_version_tag"` + EnclaveName string `json:"enclave_name"` Mode *EnclaveMode `json:"mode,omitempty"` } @@ -507,6 +508,11 @@ type StarlarkRunProgress struct { // StarlarkRunResponse defines model for StarlarkRunResponse. type StarlarkRunResponse struct { + StarlarkExecutionLogs *StarlarkRunResponse_StarlarkExecutionLogs `json:"starlark_execution_logs,omitempty"` +} + +// StarlarkRunResponse_StarlarkExecutionLogs defines model for StarlarkRunResponse.StarlarkExecutionLogs. +type StarlarkRunResponse_StarlarkExecutionLogs struct { union json.RawMessage } @@ -807,22 +813,22 @@ func (t *StarlarkError_Error) UnmarshalJSON(b []byte) error { return err } -// AsAsyncStarlarkExecutionLogs returns the union data inside the StarlarkRunResponse as a AsyncStarlarkExecutionLogs -func (t StarlarkRunResponse) AsAsyncStarlarkExecutionLogs() (AsyncStarlarkExecutionLogs, error) { +// AsAsyncStarlarkExecutionLogs returns the union data inside the StarlarkRunResponse_StarlarkExecutionLogs as a AsyncStarlarkExecutionLogs +func (t StarlarkRunResponse_StarlarkExecutionLogs) AsAsyncStarlarkExecutionLogs() (AsyncStarlarkExecutionLogs, error) { var body AsyncStarlarkExecutionLogs err := json.Unmarshal(t.union, &body) return body, err } -// FromAsyncStarlarkExecutionLogs overwrites any union data inside the StarlarkRunResponse as the provided AsyncStarlarkExecutionLogs -func (t *StarlarkRunResponse) FromAsyncStarlarkExecutionLogs(v AsyncStarlarkExecutionLogs) error { +// FromAsyncStarlarkExecutionLogs overwrites any union data inside the StarlarkRunResponse_StarlarkExecutionLogs as the provided AsyncStarlarkExecutionLogs +func (t *StarlarkRunResponse_StarlarkExecutionLogs) FromAsyncStarlarkExecutionLogs(v AsyncStarlarkExecutionLogs) error { b, err := json.Marshal(v) t.union = b return err } -// MergeAsyncStarlarkExecutionLogs performs a merge with any union data inside the StarlarkRunResponse, using the provided AsyncStarlarkExecutionLogs -func (t *StarlarkRunResponse) MergeAsyncStarlarkExecutionLogs(v AsyncStarlarkExecutionLogs) error { +// MergeAsyncStarlarkExecutionLogs performs a merge with any union data inside the StarlarkRunResponse_StarlarkExecutionLogs, using the provided AsyncStarlarkExecutionLogs +func (t *StarlarkRunResponse_StarlarkExecutionLogs) MergeAsyncStarlarkExecutionLogs(v AsyncStarlarkExecutionLogs) error { b, err := json.Marshal(v) if err != nil { return err @@ -833,22 +839,22 @@ func (t *StarlarkRunResponse) MergeAsyncStarlarkExecutionLogs(v AsyncStarlarkExe return err } -// AsStarlarkRunLogs returns the union data inside the StarlarkRunResponse as a StarlarkRunLogs -func (t StarlarkRunResponse) AsStarlarkRunLogs() (StarlarkRunLogs, error) { +// AsStarlarkRunLogs returns the union data inside the StarlarkRunResponse_StarlarkExecutionLogs as a StarlarkRunLogs +func (t StarlarkRunResponse_StarlarkExecutionLogs) AsStarlarkRunLogs() (StarlarkRunLogs, error) { var body StarlarkRunLogs err := json.Unmarshal(t.union, &body) return body, err } -// FromStarlarkRunLogs overwrites any union data inside the StarlarkRunResponse as the provided StarlarkRunLogs -func (t *StarlarkRunResponse) FromStarlarkRunLogs(v StarlarkRunLogs) error { +// FromStarlarkRunLogs overwrites any union data inside the StarlarkRunResponse_StarlarkExecutionLogs as the provided StarlarkRunLogs +func (t *StarlarkRunResponse_StarlarkExecutionLogs) FromStarlarkRunLogs(v StarlarkRunLogs) error { b, err := json.Marshal(v) t.union = b return err } -// MergeStarlarkRunLogs performs a merge with any union data inside the StarlarkRunResponse, using the provided StarlarkRunLogs -func (t *StarlarkRunResponse) MergeStarlarkRunLogs(v StarlarkRunLogs) error { +// MergeStarlarkRunLogs performs a merge with any union data inside the StarlarkRunResponse_StarlarkExecutionLogs, using the provided StarlarkRunLogs +func (t *StarlarkRunResponse_StarlarkExecutionLogs) MergeStarlarkRunLogs(v StarlarkRunLogs) error { b, err := json.Marshal(v) if err != nil { return err @@ -859,12 +865,12 @@ func (t *StarlarkRunResponse) MergeStarlarkRunLogs(v StarlarkRunLogs) error { return err } -func (t StarlarkRunResponse) MarshalJSON() ([]byte, error) { +func (t StarlarkRunResponse_StarlarkExecutionLogs) MarshalJSON() ([]byte, error) { b, err := t.union.MarshalJSON() return b, err } -func (t *StarlarkRunResponse) UnmarshalJSON(b []byte) error { +func (t *StarlarkRunResponse_StarlarkExecutionLogs) UnmarshalJSON(b []byte) error { err := t.union.UnmarshalJSON(b) return err } diff --git a/api/golang/http_rest/core_rest_api/api_container_server.gen.go b/api/golang/http_rest/core_rest_api/api_container_server.gen.go index 208fac2985..79c65bccba 100644 --- a/api/golang/http_rest/core_rest_api/api_container_server.gen.go +++ b/api/golang/http_rest/core_rest_api/api_container_server.gen.go @@ -1583,28 +1583,28 @@ var swaggerSpec = []string{ "VzVRYzwbpI+AUoDUVk+byziZAnOrlzNJ7kFpXjMrtudIHKcBs3azDlpt2EgfqX1AL0EoYXBI56THtV7U", "LZF6mEbi1nc6H0qQ6BkT0Dk+fDSbItMPMT/9c0Kcu04tgnU46Pv4iSgMQ5jNKvaaMC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f5i170hL8OLG", + "/60UO3xsJCIvO8+NPF623X1i5MeSZv9Cppx8Dp7Vu5/gnVcZog7uV/OQmX26rBF289Bc5+XN+jWztL7E", + "THQaL3i1WiNsZ3nqpF/DctYPIUy5UPbJuOP224LfS0f2zwqfOBwxPHzZc8zqWK3HjBt4WHPEbP/83vih", + "D9yo++zqqC2DBxb7XF1Ujb+RJo7PSl2HRK9avgGFKJaquc4oKnaYTvktnkIQOaYbplW7emoG2ME4qVu/", + "tATEn5V7gBhM3HUROeYEdfeC6xGar4lEUkFpL8tZv+lfhQjfkMgxaz3laJ6SjbzVcVgg054sn/i5a489", + "eHxR8jyffG4uC92PCEkDCbDfEbfvCFQSxDOJFrDGdPllPHT/P3usKDS4LjXa1bQfSf1WQWtEOx75MCjW", + "m/pk7aOFSH5nMb50UDyO8H4ncXTvcPwpjTFptPd37dAVYTBx3XP39/f/GwAA//8LPZ/g1mEAAA==", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/api/golang/http_rest/engine_rest_api/engine_server.gen.go b/api/golang/http_rest/engine_rest_api/engine_server.gen.go index 61553f5ce2..bdaa80f92e 100644 --- a/api/golang/http_rest/engine_rest_api/engine_server.gen.go +++ b/api/golang/http_rest/engine_rest_api/engine_server.gen.go @@ -750,30 +750,30 @@ func (sh *strictHandler) GetEngineInfo(ctx echo.Context) error { // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/9RY227bOBN+FYH/f6lG2fbOd9nG2xqL2IbtYHdRBAIjjm22FKmSVLaG4XdfUKIsyaIU", - "yXUM9E6HOX5z4Az3KBJxIjhwrdBojxIscQwaZPYGPGL4BUJKgGu6piDNVwIqkjTRVHA0Qo+Pk3vfU1sh", - "NXAgXv4upMdxDJ5Ye3oLnhWEfEQNT4L1FvnIUKCRS4uPJHxPqQSCRlqm4CMVbSHGRr3eJYZLaUn5Bh0O", - "hjYWLxBixprmTdZeJsDLiTzMWGGNuvHuYY1Tpj2qvDVm6mjg9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NrdMv+", + "0UXbcT3VVbwvUWKlEnzfF5svl9iLYvKrFoFaPfaM3HPiNMBC0Q2OzOXqCOog5hGO322oHm5GHdQjhoJz", + "TkoQzzTSdPbpJOHG8DoUj6/NIyD8XxZzTAYxi/l2GPCF7aOIg4gzBlEeg2PO5Q1jP+7Q2V7p5aDzIcGM", + "vAInYCTlVCfWwVwssSx5Mh59xjTGTzSm6hVMHuFThUWMxbdRxAH8gCjTLtXi7cew/GhW8DN0CFIcfcNb", + "OPNUcLBPISXHcSzyMjlYrt2bR3eQVXHj8Ev0kfad0uV6ijXZK+9ozpr039wBr79FuK5ohu8Sb++c1SDn", + "5FmkX4LiDqI7Wcq7pTcN6VLKRScjLbV7MDoe/wsAAP//2z51CloeAAA=", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/api/openapi/specs/kurtosis_api.yaml b/api/openapi/specs/kurtosis_api.yaml index 4000caf05b..edd85e6361 100644 --- a/api/openapi/specs/kurtosis_api.yaml +++ b/api/openapi/specs/kurtosis_api.yaml @@ -793,8 +793,13 @@ components: type: string api_container_log_level: type: string + description: Enclave log level, defaults to INFO mode: $ref: '#/components/schemas/EnclaveMode' + description: Enclave mode, defaults to TEST + required: + - enclave_name + - api_container_version_tag EnclaveMode: type: string @@ -1342,9 +1347,12 @@ components: - async_starlark_execution_logs StarlarkRunResponse: - oneOf: - - $ref: "#/components/schemas/AsyncStarlarkExecutionLogs" - - $ref: "#/components/schemas/StarlarkRunLogs" + type: object + properties: + starlark_execution_logs: + oneOf: + - $ref: "#/components/schemas/AsyncStarlarkExecutionLogs" + - $ref: "#/components/schemas/StarlarkRunLogs" ServiceIdentifiers: type: object diff --git a/engine/server/engine/server/enclave_rest_api_handler.go b/engine/server/engine/server/enclave_rest_api_handler.go index 00380943c4..847ee88b13 100644 --- a/engine/server/engine/server/enclave_rest_api_handler.go +++ b/engine/server/engine/server/enclave_rest_api_handler.go @@ -61,7 +61,6 @@ func (runtime enclaveRuntime) refreshEnclaveConnections() error { logrus.Warnf("Unavailable gRPC connection to enclave '%s', skipping it!", uuid) continue } - logrus.Debugf("Creating gRPC connection with enclave manager service on enclave %s", uuid) apiContainerClient := rpc_api.NewApiContainerServiceClient(conn) runtime.remoteApiContainerClient[uuid] = apiContainerClient } @@ -566,6 +565,8 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkPackagesPack } jsonString := string(jsonBlob) + isRemote := utils.DerefWith(request.Body.Remote, false) + logrus.Infof("Executing Starlark package `%s` with remote %t", package_id, isRemote) runStarlarkPackageArgs := rpc_api.RunStarlarkPackageArgs{ PackageId: package_id, StarlarkPackageContent: nil, @@ -581,7 +582,7 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkPackagesPack ImageDownloadMode: utils.MapPointer(request.Body.ImageDownloadMode, toGrpcImageDownloadMode), } - ctxWithCancel, cancelCtxFunc := context.WithCancel(ctx) + ctxWithCancel, cancelCtxFunc := context.WithCancel(context.Background()) stream, err := (*apiContainerClient).RunStarlarkPackage(ctxWithCancel, &runStarlarkPackageArgs) if err != nil { cancelCtxFunc() @@ -592,9 +593,11 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkPackagesPack asyncLogs := NewAsyncStarlarkLogs(cancelCtxFunc) go asyncLogs.RunAsyncStarlarkLogs(stream) - var response api_type.StarlarkRunResponse - response.FromStarlarkRunLogs(utils.MapList(asyncLogs.WaitAndConsumeAll(), toHttpApiStarlarkRunResponseLine)) + logs := utils.MapList(asyncLogs.WaitAndConsumeAll(), toHttpApiStarlarkRunResponseLine) + var sync_logs api_type.StarlarkRunResponse_StarlarkExecutionLogs + sync_logs.FromStarlarkRunLogs(logs) + response := api_type.StarlarkRunResponse{StarlarkExecutionLogs: &sync_logs} return api.PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId200JSONResponse(response), nil } @@ -612,7 +615,9 @@ func NewAsyncStarlarkLogs(cancelCtxFunc context.CancelFunc) AsyncStarlarkLogs { } func (async AsyncStarlarkLogs) RunAsyncStarlarkLogs(stream grpc.ClientStream) { + logrus.Debugf("Asynchronously reading the stream of Starlark execution logs") defer func() { + logrus.Debugf("Streaming of Starlark execution logs is done, cleaning up resources") close(async.starlarkRunResponseLineChan) async.cancelCtxFunc() }() @@ -669,7 +674,7 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx ImageDownloadMode: utils.MapPointer(request.Body.ImageDownloadMode, toGrpcImageDownloadMode), } - ctxWithCancel, cancelCtxFunc := context.WithCancel(ctx) + ctxWithCancel, cancelCtxFunc := context.WithCancel(context.Background()) stream, err := (*apiContainerClient).RunStarlarkScript(ctxWithCancel, &runStarlarkScriptArgs) if err != nil { cancelCtxFunc() @@ -680,9 +685,11 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx asyncLogs := NewAsyncStarlarkLogs(cancelCtxFunc) go asyncLogs.RunAsyncStarlarkLogs(stream) - var response api_type.StarlarkRunResponse - response.FromStarlarkRunLogs(utils.MapList(asyncLogs.WaitAndConsumeAll(), toHttpApiStarlarkRunResponseLine)) + logs := utils.MapList(asyncLogs.WaitAndConsumeAll(), toHttpApiStarlarkRunResponseLine) + var sync_logs api_type.StarlarkRunResponse_StarlarkExecutionLogs + sync_logs.FromStarlarkRunLogs(logs) + response := api_type.StarlarkRunResponse{StarlarkExecutionLogs: &sync_logs} return api.PostEnclavesEnclaveIdentifierStarlarkScripts200JSONResponse(response), nil } @@ -716,6 +723,7 @@ func getGrpcClientConn(enclaveInfo types.EnclaveInfo, connectOnHostMachine bool) if err != nil { return nil, stacktrace.Propagate(err, "Expected to be able to create a GRPC client connection on address '%v', but a non-nil error was returned", grpcServerAddress) } + logrus.Debugf("Creating gRPC connection with enclave manager service on enclave %s on %s", enclaveInfo.EnclaveUuid, grpcServerAddress) return grpcConnection, nil } diff --git a/engine/server/engine/server/engine_rest_api_handler.go b/engine/server/engine/server/engine_rest_api_handler.go index d7ddebe174..f93641ffb8 100644 --- a/engine/server/engine/server/engine_rest_api_handler.go +++ b/engine/server/engine/server/engine_rest_api_handler.go @@ -57,27 +57,31 @@ func (engine EngineRuntime) GetEnclaves(ctx context.Context, request api.GetEncl // Create Enclave // (POST /enclaves) func (engine EngineRuntime) PostEnclaves(ctx context.Context, request api.PostEnclavesRequestObject) (api.PostEnclavesResponseObject, error) { - if err := engine.MetricsClient.TrackCreateEnclave(*request.Body.EnclaveName, subnetworkDisableBecauseItIsDeprecated); err != nil { + enclave_mode := utils.DerefWith(request.Body.Mode, api_type.TEST) + enclave_name := request.Body.EnclaveName + apic_version_tag := request.Body.ApiContainerVersionTag + + if err := engine.MetricsClient.TrackCreateEnclave(enclave_name, subnetworkDisableBecauseItIsDeprecated); err != nil { logrus.Warn("An error occurred while logging the create enclave event") } logrus.Debugf("request: %+v", request) - apiContainerLogLevel, err := logrus.ParseLevel(*request.Body.ApiContainerLogLevel) + apiContainerLogLevel, err := logrus.ParseLevel(utils.DerefWith(request.Body.ApiContainerLogLevel, "INFO")) if err != nil { return nil, stacktrace.Propagate(err, "An error occurred parsing the log level string '%v':", request.Body.ApiContainerLogLevel) } isProduction := false - if *request.Body.Mode == api_type.PRODUCTION { + if enclave_mode == api_type.PRODUCTION { isProduction = true } enclaveInfo, err := engine.EnclaveManager.CreateEnclave( ctx, engine.ImageVersionTag, - *request.Body.ApiContainerVersionTag, + apic_version_tag, apiContainerLogLevel, - *request.Body.EnclaveName, + enclave_name, isProduction, ) if err != nil { From d70c58811029cffaa2879cd0eb345dc1b4fac65c Mon Sep 17 00:00:00 2001 From: lostbean Date: Thu, 30 Nov 2023 12:12:17 -0300 Subject: [PATCH 66/95] add async logs to websocket api --- engine/server/engine/main.go | 8 +- .../engine/mapping/to_http/starlark_logs.go | 114 +++++++++++ .../engine/server/enclave_rest_api_handler.go | 178 +++--------------- .../engine/server/websocket_api_handler.go | 35 +++- .../server/engine/streaming/starlark_logs.go | 67 +++++++ .../streaming/streaming_pool_manager.go | 47 +++++ 6 files changed, 290 insertions(+), 159 deletions(-) create mode 100644 engine/server/engine/mapping/to_http/starlark_logs.go create mode 100644 engine/server/engine/streaming/starlark_logs.go create mode 100644 engine/server/engine/streaming/streaming_pool_manager.go diff --git a/engine/server/engine/main.go b/engine/server/engine/main.go index 2c63f8fe94..a8d4b2179b 100644 --- a/engine/server/engine/main.go +++ b/engine/server/engine/main.go @@ -17,6 +17,7 @@ import ( "strings" "time" + "github.com/kurtosis-tech/kurtosis/api/golang/core/kurtosis_core_rpc_api_bindings" "github.com/kurtosis-tech/kurtosis/api/golang/engine/kurtosis_engine_rpc_api_bindings/kurtosis_engine_rpc_api_bindingsconnect" enclaveApi "github.com/kurtosis-tech/kurtosis/api/golang/http_rest/core_rest_api" engineApi "github.com/kurtosis-tech/kurtosis/api/golang/http_rest/engine_rest_api" @@ -40,6 +41,7 @@ import ( "github.com/kurtosis-tech/kurtosis/engine/server/engine/enclave_manager" "github.com/kurtosis-tech/kurtosis/engine/server/engine/server" restApi "github.com/kurtosis-tech/kurtosis/engine/server/engine/server" + "github.com/kurtosis-tech/kurtosis/engine/server/engine/streaming" "github.com/kurtosis-tech/kurtosis/metrics-library/golang/lib/analytics_logger" "github.com/kurtosis-tech/kurtosis/metrics-library/golang/lib/metrics_client" "github.com/kurtosis-tech/kurtosis/metrics-library/golang/lib/source" @@ -369,6 +371,9 @@ func restApiServer( logFileManager *log_file_manager.LogFileManager, metricsClient metrics_client.MetricsClient, ) { + + asyncStarlarkLogs := streaming.NewStreamerPool[kurtosis_core_rpc_api_bindings.StarlarkRunResponseLine]() + logrus.Info("Running REST API server...") // This is how you set up a basic Echo router @@ -416,6 +421,7 @@ func restApiServer( PerFileLogsDatabaseClient: perFileLogsDatabaseClient, LogFileManager: logFileManager, MetricsClient: metricsClient, + AsyncStarlarkLogs: asyncStarlarkLogs, } // TODO(edgar) add logging Close() // defer webSocketRuntime.ShutDown() @@ -432,7 +438,7 @@ func restApiServer( // Use our validation middleware to check all requests against the // e.Use(middleware.OapiRequestValidator(swagger_enclave)) - enclaveRuntime, err := restApi.NewEnclaveRuntime(ctx, *enclave_manager, false) + enclaveRuntime, err := restApi.NewEnclaveRuntime(ctx, *enclave_manager, asyncStarlarkLogs, true) if err != nil { // TODO(edgar) fix error handling } diff --git a/engine/server/engine/mapping/to_http/starlark_logs.go b/engine/server/engine/mapping/to_http/starlark_logs.go new file mode 100644 index 0000000000..976ebc1b12 --- /dev/null +++ b/engine/server/engine/mapping/to_http/starlark_logs.go @@ -0,0 +1,114 @@ +package to_http + +import ( + "github.com/kurtosis-tech/kurtosis/engine/server/engine/utils" + + rpc_api "github.com/kurtosis-tech/kurtosis/api/golang/core/kurtosis_core_rpc_api_bindings" + api_type "github.com/kurtosis-tech/kurtosis/api/golang/http_rest/api_types" +) + +func ToHttpApiStarlarkRunResponseLine(line rpc_api.StarlarkRunResponseLine) api_type.StarlarkRunResponseLine { + if runError := line.GetError(); runError != nil { + var http_type api_type.StarlarkRunResponseLine + http_type.FromStarlarkError(ToHttpStarlarkError(*runError)) + return http_type + } + + if runInfo := line.GetInfo(); runInfo != nil { + var http_type api_type.StarlarkRunResponseLine + http_type.FromStarlarkInfo(ToHttpStarlarkInfo(*runInfo)) + return http_type + } + + if runInstruction := line.GetInstruction(); runInstruction != nil { + var http_type api_type.StarlarkRunResponseLine + http_type.FromStarlarkInstruction(ToHttpStarlarkInstruction(*runInstruction)) + return http_type + } + + if runInstructionResult := line.GetInstructionResult(); runInstructionResult != nil { + var http_type api_type.StarlarkRunResponseLine + http_type.FromStarlarkInstructionResult(ToHttpStarlarkInstructionResult(*runInstructionResult)) + return http_type + } + + if runProgressInfo := line.GetProgressInfo(); runProgressInfo != nil { + var http_type api_type.StarlarkRunResponseLine + http_type.FromStarlarkRunProgress(ToHttpStarlarkProgressInfo(*runProgressInfo)) + return http_type + } + + if runWarning := line.GetWarning(); runWarning != nil { + var http_type api_type.StarlarkRunResponseLine + http_type.FromStarlarkWarning(ToHttpStarlarkWarning(*runWarning)) + return http_type + } + + if runFinishedEvent := line.GetRunFinishedEvent(); runFinishedEvent != nil { + var http_type api_type.StarlarkRunResponseLine + http_type.FromStarlarkRunFinishedEvent(ToHttpStarlarkRunFinishedEvent(*runFinishedEvent)) + return http_type + } + + return api_type.StarlarkRunResponseLine{} +} + +func ToHttpStarlarkError(rpc_value rpc_api.StarlarkError) api_type.StarlarkError { + return api_type.StarlarkError{ + // Error: rpc_value.Error, + } + +} +func ToHttpStarlarkInfo(rpc_value rpc_api.StarlarkInfo) api_type.StarlarkInfo { + var info api_type.StarlarkInfo + info.Info.Instruction.InfoMessage = "" + return info +} + +func ToHttpStarlarkInstruction(rpc_value rpc_api.StarlarkInstruction) api_type.StarlarkInstruction { + return api_type.StarlarkInstruction{ + Arguments: utils.MapList( + utils.FilterListNils(rpc_value.Arguments), + ToHttpStarlarkInstructionArgument, + ), + } +} + +func ToHttpStarlarkInstructionResult(rpc_value rpc_api.StarlarkInstructionResult) api_type.StarlarkInstructionResult { + var instructionResult api_type.StarlarkInstructionResult + instructionResult.InstructionResult.SerializedInstructionResult = rpc_value.SerializedInstructionResult + return instructionResult +} + +func ToHttpStarlarkProgressInfo(rpc_value rpc_api.StarlarkRunProgress) api_type.StarlarkRunProgress { + var progress api_type.StarlarkRunProgress + progress.ProgressInfo.CurrentStepInfo = rpc_value.CurrentStepInfo + progress.ProgressInfo.CurrentStepNumber = int32(rpc_value.CurrentStepNumber) + progress.ProgressInfo.TotalSteps = int32(rpc_value.TotalSteps) + return progress +} + +func ToHttpStarlarkWarning(rpc_value rpc_api.StarlarkWarning) api_type.StarlarkWarning { + var warning api_type.StarlarkWarning + warning.Warning.WarningMessage = rpc_value.WarningMessage + return warning +} + +func ToHttpStarlarkRunResponseLine(rpc_value rpc_api.StarlarkRunResponseLine) api_type.StarlarkRunResponseLine { + return api_type.StarlarkRunResponseLine{} + +} +func ToHttpStarlarkRunFinishedEvent(rpc_value rpc_api.StarlarkRunFinishedEvent) api_type.StarlarkRunFinishedEvent { + var event api_type.StarlarkRunFinishedEvent + event.RunFinishedEvent.IsRunSuccessful = rpc_value.IsRunSuccessful + event.RunFinishedEvent.SerializedOutput = rpc_value.SerializedOutput + return event +} + +func ToHttpStarlarkInstructionArgument(rpc_value rpc_api.StarlarkInstructionArg) api_type.StarlarkInstructionArgument { + return api_type.StarlarkInstructionArgument{ + ArgName: rpc_value.ArgName, + IsRepresentative: rpc_value.IsRepresentative, + SerializedArgValue: rpc_value.SerializedArgValue, + } +} diff --git a/engine/server/engine/server/enclave_rest_api_handler.go b/engine/server/engine/server/enclave_rest_api_handler.go index 847ee88b13..06e9e67e24 100644 --- a/engine/server/engine/server/enclave_rest_api_handler.go +++ b/engine/server/engine/server/enclave_rest_api_handler.go @@ -9,6 +9,8 @@ import ( "sync" "github.com/kurtosis-tech/kurtosis/engine/server/engine/enclave_manager" + "github.com/kurtosis-tech/kurtosis/engine/server/engine/mapping/to_http" + "github.com/kurtosis-tech/kurtosis/engine/server/engine/streaming" "github.com/kurtosis-tech/kurtosis/engine/server/engine/types" "github.com/kurtosis-tech/kurtosis/engine/server/engine/utils" "github.com/kurtosis-tech/kurtosis/grpc-file-transfer/golang/grpc_file_streaming" @@ -29,6 +31,7 @@ type enclaveRuntime struct { connectOnHostMachine bool ctx context.Context lock sync.Mutex + asyncStarlarkLogs streaming.StreamerPool[rpc_api.StarlarkRunResponseLine] } func (runtime enclaveRuntime) refreshEnclaveConnections() error { @@ -69,13 +72,14 @@ func (runtime enclaveRuntime) refreshEnclaveConnections() error { return nil } -func NewEnclaveRuntime(ctx context.Context, manager enclave_manager.EnclaveManager, connectOnHostMachine bool) (*enclaveRuntime, error) { +func NewEnclaveRuntime(ctx context.Context, manager enclave_manager.EnclaveManager, asyncStarlarkLogs streaming.StreamerPool[rpc_api.StarlarkRunResponseLine], connectOnHostMachine bool) (*enclaveRuntime, error) { runtime := enclaveRuntime{ enclaveManager: manager, remoteApiContainerClient: map[string]rpc_api.ApiContainerServiceClient{}, connectOnHostMachine: connectOnHostMachine, ctx: ctx, + asyncStarlarkLogs: asyncStarlarkLogs, } err := runtime.refreshEnclaveConnections() @@ -590,58 +594,24 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkPackagesPack return nil, stacktrace.Propagate(err, "Can't run Starlark package using gRPC call with enclave %s", enclave_identifier) } - asyncLogs := NewAsyncStarlarkLogs(cancelCtxFunc) - go asyncLogs.RunAsyncStarlarkLogs(stream) + asyncLogs := streaming.NewAsyncStarlarkLogs(cancelCtxFunc) + go asyncLogs.AttachStream(stream) - logs := utils.MapList(asyncLogs.WaitAndConsumeAll(), toHttpApiStarlarkRunResponseLine) + isAsyncRetrieval := utils.DerefWith(request.Params.RetrieveLogsAsync, true) var sync_logs api_type.StarlarkRunResponse_StarlarkExecutionLogs - sync_logs.FromStarlarkRunLogs(logs) - - response := api_type.StarlarkRunResponse{StarlarkExecutionLogs: &sync_logs} - return api.PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId200JSONResponse(response), nil -} - -type AsyncStarlarkLogs struct { - cancelCtxFunc context.CancelFunc - starlarkRunResponseLineChan chan *rpc_api.StarlarkRunResponseLine -} -func NewAsyncStarlarkLogs(cancelCtxFunc context.CancelFunc) AsyncStarlarkLogs { - starlarkResponseLineChan := make(chan *rpc_api.StarlarkRunResponseLine) - return AsyncStarlarkLogs{ - cancelCtxFunc: cancelCtxFunc, - starlarkRunResponseLineChan: starlarkResponseLineChan, - } -} - -func (async AsyncStarlarkLogs) RunAsyncStarlarkLogs(stream grpc.ClientStream) { - logrus.Debugf("Asynchronously reading the stream of Starlark execution logs") - defer func() { - logrus.Debugf("Streaming of Starlark execution logs is done, cleaning up resources") - close(async.starlarkRunResponseLineChan) - async.cancelCtxFunc() - }() - for { - responseLine := new(rpc_api.StarlarkRunResponseLine) - err := stream.RecvMsg(responseLine) - if err == io.EOF { - logrus.Debugf("Successfully reached the end of the response stream. Closing.") - return - } - if err != nil { - logrus.Errorf("Unexpected error happened reading the stream. Client might have cancelled the stream\n%v", err.Error()) - return - } - async.starlarkRunResponseLineChan <- responseLine + if !isAsyncRetrieval { + logs := utils.MapList(asyncLogs.WaitAndConsumeAll(), to_http.ToHttpApiStarlarkRunResponseLine) + sync_logs.FromStarlarkRunLogs(logs) + } else { + async_uuid := manager.asyncStarlarkLogs.Add(asyncLogs) + var async_logs api_type.AsyncStarlarkExecutionLogs + async_logs.AsyncStarlarkExecutionLogs.StarlarkExecutionUuid = string(async_uuid) + sync_logs.FromAsyncStarlarkExecutionLogs(async_logs) } -} -func (async AsyncStarlarkLogs) WaitAndConsumeAll() []rpc_api.StarlarkRunResponseLine { - var logs []rpc_api.StarlarkRunResponseLine - for elem := range async.starlarkRunResponseLineChan { - logs = append(logs, *elem) - } - return logs + response := api_type.StarlarkRunResponse{StarlarkExecutionLogs: &sync_logs} + return api.PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId200JSONResponse(response), nil } // (POST /enclaves/{enclave_identifier}/starlark/scripts) @@ -682,10 +652,10 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx return nil, stacktrace.Propagate(err, "Can't run Starlark script package using gRPC call with enclave %s", enclave_identifier) } - asyncLogs := NewAsyncStarlarkLogs(cancelCtxFunc) - go asyncLogs.RunAsyncStarlarkLogs(stream) + asyncLogs := streaming.NewAsyncStarlarkLogs(cancelCtxFunc) + go asyncLogs.AttachStream(stream) - logs := utils.MapList(asyncLogs.WaitAndConsumeAll(), toHttpApiStarlarkRunResponseLine) + logs := utils.MapList(asyncLogs.WaitAndConsumeAll(), to_http.ToHttpApiStarlarkRunResponseLine) var sync_logs api_type.StarlarkRunResponse_StarlarkExecutionLogs sync_logs.FromStarlarkRunLogs(logs) @@ -888,109 +858,3 @@ func toGrpcImageDownloadMode(flag api_type.ImageDownloadMode) rpc_api.ImageDownl panic(fmt.Sprintf("Missing conversion of Image Download Mode Enum value: %s", flag)) } } - -func toHttpApiStarlarkRunResponseLine(line rpc_api.StarlarkRunResponseLine) api_type.StarlarkRunResponseLine { - if runError := line.GetError(); runError != nil { - var http_type api_type.StarlarkRunResponseLine - http_type.FromStarlarkError(toHttpStarlarkError(*runError)) - return http_type - } - - if runInfo := line.GetInfo(); runInfo != nil { - var http_type api_type.StarlarkRunResponseLine - http_type.FromStarlarkInfo(toHttpStarlarkInfo(*runInfo)) - return http_type - } - - if runInstruction := line.GetInstruction(); runInstruction != nil { - var http_type api_type.StarlarkRunResponseLine - http_type.FromStarlarkInstruction(toHttpStarlarkInstruction(*runInstruction)) - return http_type - } - - if runInstructionResult := line.GetInstructionResult(); runInstructionResult != nil { - var http_type api_type.StarlarkRunResponseLine - http_type.FromStarlarkInstructionResult(toHttpStarlarkInstructionResult(*runInstructionResult)) - return http_type - } - - if runProgressInfo := line.GetProgressInfo(); runProgressInfo != nil { - var http_type api_type.StarlarkRunResponseLine - http_type.FromStarlarkRunProgress(toHttpStarlarkProgressInfo(*runProgressInfo)) - return http_type - } - - if runWarning := line.GetWarning(); runWarning != nil { - var http_type api_type.StarlarkRunResponseLine - http_type.FromStarlarkWarning(toHttpStarlarkWarning(*runWarning)) - return http_type - } - - if runFinishedEvent := line.GetRunFinishedEvent(); runFinishedEvent != nil { - var http_type api_type.StarlarkRunResponseLine - http_type.FromStarlarkRunFinishedEvent(toHttpStarlarkRunFinishedEvent(*runFinishedEvent)) - return http_type - } - - return api_type.StarlarkRunResponseLine{} -} - -func toHttpStarlarkError(rpc_value rpc_api.StarlarkError) api_type.StarlarkError { - return api_type.StarlarkError{ - // Error: rpc_value.Error, - } - -} -func toHttpStarlarkInfo(rpc_value rpc_api.StarlarkInfo) api_type.StarlarkInfo { - var info api_type.StarlarkInfo - info.Info.Instruction.InfoMessage = "" - return info -} - -func toHttpStarlarkInstruction(rpc_value rpc_api.StarlarkInstruction) api_type.StarlarkInstruction { - return api_type.StarlarkInstruction{ - Arguments: utils.MapList( - utils.FilterListNils(rpc_value.Arguments), - toHttpStarlarkInstructionArgument, - ), - } -} - -func toHttpStarlarkInstructionResult(rpc_value rpc_api.StarlarkInstructionResult) api_type.StarlarkInstructionResult { - var instructionResult api_type.StarlarkInstructionResult - instructionResult.InstructionResult.SerializedInstructionResult = rpc_value.SerializedInstructionResult - return instructionResult -} - -func toHttpStarlarkProgressInfo(rpc_value rpc_api.StarlarkRunProgress) api_type.StarlarkRunProgress { - var progress api_type.StarlarkRunProgress - progress.ProgressInfo.CurrentStepInfo = rpc_value.CurrentStepInfo - progress.ProgressInfo.CurrentStepNumber = int32(rpc_value.CurrentStepNumber) - progress.ProgressInfo.TotalSteps = int32(rpc_value.TotalSteps) - return progress -} - -func toHttpStarlarkWarning(rpc_value rpc_api.StarlarkWarning) api_type.StarlarkWarning { - var warning api_type.StarlarkWarning - warning.Warning.WarningMessage = rpc_value.WarningMessage - return warning -} - -func toHttpStarlarkRunResponseLine(rpc_value rpc_api.StarlarkRunResponseLine) api_type.StarlarkRunResponseLine { - return api_type.StarlarkRunResponseLine{} - -} -func toHttpStarlarkRunFinishedEvent(rpc_value rpc_api.StarlarkRunFinishedEvent) api_type.StarlarkRunFinishedEvent { - var event api_type.StarlarkRunFinishedEvent - event.RunFinishedEvent.IsRunSuccessful = rpc_value.IsRunSuccessful - event.RunFinishedEvent.SerializedOutput = rpc_value.SerializedOutput - return event -} - -func toHttpStarlarkInstructionArgument(rpc_value rpc_api.StarlarkInstructionArg) api_type.StarlarkInstructionArgument { - return api_type.StarlarkInstructionArgument{ - ArgName: rpc_value.ArgName, - IsRepresentative: rpc_value.IsRepresentative, - SerializedArgValue: rpc_value.SerializedArgValue, - } -} diff --git a/engine/server/engine/server/websocket_api_handler.go b/engine/server/engine/server/websocket_api_handler.go index be7a130566..e14618a309 100644 --- a/engine/server/engine/server/websocket_api_handler.go +++ b/engine/server/engine/server/websocket_api_handler.go @@ -12,6 +12,8 @@ import ( "github.com/kurtosis-tech/kurtosis/engine/server/engine/centralized_logs/client_implementations/persistent_volume/log_file_manager" "github.com/kurtosis-tech/kurtosis/engine/server/engine/centralized_logs/logline" "github.com/kurtosis-tech/kurtosis/engine/server/engine/enclave_manager" + "github.com/kurtosis-tech/kurtosis/engine/server/engine/mapping/to_http" + "github.com/kurtosis-tech/kurtosis/engine/server/engine/streaming" "github.com/kurtosis-tech/kurtosis/engine/server/engine/utils" "github.com/kurtosis-tech/kurtosis/metrics-library/golang/lib/metrics_client" "github.com/kurtosis-tech/stacktrace" @@ -20,6 +22,7 @@ import ( "golang.org/x/exp/slices" "golang.org/x/net/websocket" + rpc_api "github.com/kurtosis-tech/kurtosis/api/golang/core/kurtosis_core_rpc_api_bindings" api_type "github.com/kurtosis-tech/kurtosis/api/golang/http_rest/api_types" ) @@ -46,7 +49,8 @@ type WebSocketRuntime struct { LogFileManager *log_file_manager.LogFileManager - MetricsClient metrics_client.MetricsClient + MetricsClient metrics_client.MetricsClient + AsyncStarlarkLogs streaming.StreamerPool[rpc_api.StarlarkRunResponseLine] } func sendErrorCode(ctx echo.Context, code int, message string) error { @@ -110,6 +114,35 @@ func (engine WebSocketRuntime) GetEnclavesEnclaveIdentifierServicesServiceIdenti // (GET /enclaves/{enclave_identifier}/starlark/executions/{starlark_execution_uuid}/logs) func (engine WebSocketRuntime) GetEnclavesEnclaveIdentifierStarlarkExecutionsStarlarkExecutionUuidLogs(ctx echo.Context, enclaveIdentifier api_type.EnclaveIdentifier, starlarkExecutionUuid api_type.StarlarkExecutionUuid) error { + async_log_uuid := string(starlarkExecutionUuid) + + if ctx.IsWebSocket() { + logrus.Infof("Starting log stream using Websocket for streamer UUUID: %s", starlarkExecutionUuid) + websocket.Handler(func(ws *websocket.Conn) { + defer ws.Close() + found, _ := engine.AsyncStarlarkLogs.Consume(streaming.StreamerUUID(async_log_uuid), func(logline *rpc_api.StarlarkRunResponseLine) { + println(logline.String()) + err := websocket.JSON.Send(ws, utils.MapPointer(logline, to_http.ToHttpApiStarlarkRunResponseLine)) + if err != nil { + ctx.Logger().Error(err) + } + }) + println(found) + }).ServeHTTP(ctx.Response(), ctx.Request()) + } else { + logrus.Infof("Starting log stream using plain HTTP for streamer UUUID: %s", starlarkExecutionUuid) + ctx.Response().Header().Set(echo.HeaderContentType, echo.MIMEApplicationJSON) + ctx.Response().WriteHeader(http.StatusOK) + enc := json.NewEncoder(ctx.Response()) + found, _ := engine.AsyncStarlarkLogs.Consume(streaming.StreamerUUID(async_log_uuid), func(logline *rpc_api.StarlarkRunResponseLine) { + if err := enc.Encode(utils.MapPointer(logline, to_http.ToHttpApiStarlarkRunResponseLine)); err != nil { + return //TODO handle error on Consume call + } + ctx.Response().Flush() + }) + println(found) + } + return nil } diff --git a/engine/server/engine/streaming/starlark_logs.go b/engine/server/engine/streaming/starlark_logs.go new file mode 100644 index 0000000000..239b97fa9e --- /dev/null +++ b/engine/server/engine/streaming/starlark_logs.go @@ -0,0 +1,67 @@ +package streaming + +import ( + "context" + "io" + + "github.com/sirupsen/logrus" + "google.golang.org/grpc" + + rpc_api "github.com/kurtosis-tech/kurtosis/api/golang/core/kurtosis_core_rpc_api_bindings" + "github.com/kurtosis-tech/kurtosis/engine/server/engine/utils" +) + +type AsyncStarlarkLogs struct { + cancelCtxFunc context.CancelFunc + starlarkRunResponseLineChan chan *rpc_api.StarlarkRunResponseLine +} + +func NewAsyncStarlarkLogs(cancelCtxFunc context.CancelFunc) AsyncStarlarkLogs { + starlarkResponseLineChan := make(chan *rpc_api.StarlarkRunResponseLine) + return AsyncStarlarkLogs{ + cancelCtxFunc: cancelCtxFunc, + starlarkRunResponseLineChan: starlarkResponseLineChan, + } +} + +func (async AsyncStarlarkLogs) Close() { + logrus.Debugf("Streaming of Starlark execution logs is done, cleaning up resources") + close(async.starlarkRunResponseLineChan) + async.cancelCtxFunc() +} + +func (async AsyncStarlarkLogs) AttachStream(stream grpc.ClientStream) { + logrus.Debugf("Asynchronously reading the stream of Starlark execution logs") + defer func() { + async.Close() + }() + for { + responseLine := new(rpc_api.StarlarkRunResponseLine) + err := stream.RecvMsg(responseLine) + if err == io.EOF { + logrus.Debugf("Successfully reached the end of the response stream. Closing.") + return + } + if err != nil { + logrus.Errorf("Unexpected error happened reading the stream. Client might have cancelled the stream\n%v", err.Error()) + return + } + async.starlarkRunResponseLineChan <- responseLine + } +} + +func (async AsyncStarlarkLogs) WaitAndConsumeAll() []rpc_api.StarlarkRunResponseLine { + var logs []*rpc_api.StarlarkRunResponseLine + async.Consume(func(elem *rpc_api.StarlarkRunResponseLine) { + if elem != nil { + logs = append(logs, elem) + } + }) + return utils.FilterListNils(logs) +} + +func (async AsyncStarlarkLogs) Consume(consumer func(*rpc_api.StarlarkRunResponseLine)) { + for elem := range async.starlarkRunResponseLineChan { + consumer(elem) + } +} diff --git a/engine/server/engine/streaming/streaming_pool_manager.go b/engine/server/engine/streaming/streaming_pool_manager.go new file mode 100644 index 0000000000..efa53dcf9f --- /dev/null +++ b/engine/server/engine/streaming/streaming_pool_manager.go @@ -0,0 +1,47 @@ +package streaming + +import ( + "github.com/google/uuid" + "google.golang.org/grpc" +) + +type Streamer[T any] interface { + Close() + AttachStream(stream grpc.ClientStream) + WaitAndConsumeAll() []T + Consume(consumer func(*T)) +} + +type StreamerPool[T any] struct { + pool map[string]Streamer[T] +} + +type StreamerUUID string + +func NewStreamerPool[T any]() StreamerPool[T] { + return StreamerPool[T]{ + pool: make(map[string]Streamer[T]), + } +} + +func (pool StreamerPool[T]) Add(streamer Streamer[T]) StreamerUUID { + id := uuid.New() + id_str := id.String() + pool.pool[id_str] = streamer + println("Size: %d", len(pool.pool)) + return StreamerUUID(id_str) +} + +func (pool StreamerPool[T]) Consume(uuid StreamerUUID, consumer func(*T)) (bool, error) { + println("Size: %d", len(pool.pool)) + streamer, found := pool.pool[string(uuid)] + if !found { + return false, nil + } else { + delete(pool.pool, string(uuid)) + } + + streamer.Consume(consumer) + + return true, nil +} From b83b517dfabf4de840e0fbea2cb331b0eb68fdfd Mon Sep 17 00:00:00 2001 From: lostbean Date: Thu, 30 Nov 2023 21:57:03 -0300 Subject: [PATCH 67/95] Use LRU with TTL to manage logs streamers --- engine/server/engine/main.go | 5 +- .../engine/server/enclave_rest_api_handler.go | 6 +- .../engine/server/websocket_api_handler.go | 10 ++-- .../server/engine/streaming/starlark_logs.go | 46 ++++++++++---- .../streaming/streaming_pool_manager.go | 60 +++++++++++++------ engine/server/go.mod | 6 +- engine/server/go.sum | 6 ++ 7 files changed, 100 insertions(+), 39 deletions(-) diff --git a/engine/server/engine/main.go b/engine/server/engine/main.go index a8d4b2179b..08badbfcc5 100644 --- a/engine/server/engine/main.go +++ b/engine/server/engine/main.go @@ -73,6 +73,9 @@ const ( shouldFlushMetricsClientQueueOnEachEvent = false restAPIPortAddr uint16 = 9779 + + streamerPoolSize = 1000 + streamerExpirationTime = time.Hour * 24 ) // Nil indicates that the KurtosisBackend should not operate in API container mode, which is appropriate here @@ -372,7 +375,7 @@ func restApiServer( metricsClient metrics_client.MetricsClient, ) { - asyncStarlarkLogs := streaming.NewStreamerPool[kurtosis_core_rpc_api_bindings.StarlarkRunResponseLine]() + asyncStarlarkLogs := streaming.NewStreamerPool[*kurtosis_core_rpc_api_bindings.StarlarkRunResponseLine](streamerPoolSize, streamerExpirationTime) logrus.Info("Running REST API server...") diff --git a/engine/server/engine/server/enclave_rest_api_handler.go b/engine/server/engine/server/enclave_rest_api_handler.go index 06e9e67e24..ebe2cba60f 100644 --- a/engine/server/engine/server/enclave_rest_api_handler.go +++ b/engine/server/engine/server/enclave_rest_api_handler.go @@ -31,7 +31,7 @@ type enclaveRuntime struct { connectOnHostMachine bool ctx context.Context lock sync.Mutex - asyncStarlarkLogs streaming.StreamerPool[rpc_api.StarlarkRunResponseLine] + asyncStarlarkLogs streaming.StreamerPool[*rpc_api.StarlarkRunResponseLine] } func (runtime enclaveRuntime) refreshEnclaveConnections() error { @@ -72,7 +72,7 @@ func (runtime enclaveRuntime) refreshEnclaveConnections() error { return nil } -func NewEnclaveRuntime(ctx context.Context, manager enclave_manager.EnclaveManager, asyncStarlarkLogs streaming.StreamerPool[rpc_api.StarlarkRunResponseLine], connectOnHostMachine bool) (*enclaveRuntime, error) { +func NewEnclaveRuntime(ctx context.Context, manager enclave_manager.EnclaveManager, asyncStarlarkLogs streaming.StreamerPool[*rpc_api.StarlarkRunResponseLine], connectOnHostMachine bool) (*enclaveRuntime, error) { runtime := enclaveRuntime{ enclaveManager: manager, @@ -604,7 +604,7 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkPackagesPack logs := utils.MapList(asyncLogs.WaitAndConsumeAll(), to_http.ToHttpApiStarlarkRunResponseLine) sync_logs.FromStarlarkRunLogs(logs) } else { - async_uuid := manager.asyncStarlarkLogs.Add(asyncLogs) + async_uuid := manager.asyncStarlarkLogs.Add(&asyncLogs) var async_logs api_type.AsyncStarlarkExecutionLogs async_logs.AsyncStarlarkExecutionLogs.StarlarkExecutionUuid = string(async_uuid) sync_logs.FromAsyncStarlarkExecutionLogs(async_logs) diff --git a/engine/server/engine/server/websocket_api_handler.go b/engine/server/engine/server/websocket_api_handler.go index e14618a309..b57e1c64f9 100644 --- a/engine/server/engine/server/websocket_api_handler.go +++ b/engine/server/engine/server/websocket_api_handler.go @@ -50,7 +50,7 @@ type WebSocketRuntime struct { LogFileManager *log_file_manager.LogFileManager MetricsClient metrics_client.MetricsClient - AsyncStarlarkLogs streaming.StreamerPool[rpc_api.StarlarkRunResponseLine] + AsyncStarlarkLogs streaming.StreamerPool[*rpc_api.StarlarkRunResponseLine] } func sendErrorCode(ctx echo.Context, code int, message string) error { @@ -120,12 +120,13 @@ func (engine WebSocketRuntime) GetEnclavesEnclaveIdentifierStarlarkExecutionsSta logrus.Infof("Starting log stream using Websocket for streamer UUUID: %s", starlarkExecutionUuid) websocket.Handler(func(ws *websocket.Conn) { defer ws.Close() - found, _ := engine.AsyncStarlarkLogs.Consume(streaming.StreamerUUID(async_log_uuid), func(logline *rpc_api.StarlarkRunResponseLine) { + found, _ := engine.AsyncStarlarkLogs.Consume(streaming.StreamerUUID(async_log_uuid), func(logline *rpc_api.StarlarkRunResponseLine) error { println(logline.String()) err := websocket.JSON.Send(ws, utils.MapPointer(logline, to_http.ToHttpApiStarlarkRunResponseLine)) if err != nil { ctx.Logger().Error(err) } + return nil }) println(found) }).ServeHTTP(ctx.Response(), ctx.Request()) @@ -134,11 +135,12 @@ func (engine WebSocketRuntime) GetEnclavesEnclaveIdentifierStarlarkExecutionsSta ctx.Response().Header().Set(echo.HeaderContentType, echo.MIMEApplicationJSON) ctx.Response().WriteHeader(http.StatusOK) enc := json.NewEncoder(ctx.Response()) - found, _ := engine.AsyncStarlarkLogs.Consume(streaming.StreamerUUID(async_log_uuid), func(logline *rpc_api.StarlarkRunResponseLine) { + found, _ := engine.AsyncStarlarkLogs.Consume(streaming.StreamerUUID(async_log_uuid), func(logline *rpc_api.StarlarkRunResponseLine) error { if err := enc.Encode(utils.MapPointer(logline, to_http.ToHttpApiStarlarkRunResponseLine)); err != nil { - return //TODO handle error on Consume call + return err } ctx.Response().Flush() + return nil }) println(found) } diff --git a/engine/server/engine/streaming/starlark_logs.go b/engine/server/engine/streaming/starlark_logs.go index 239b97fa9e..dccb576efe 100644 --- a/engine/server/engine/streaming/starlark_logs.go +++ b/engine/server/engine/streaming/starlark_logs.go @@ -11,29 +11,43 @@ import ( "github.com/kurtosis-tech/kurtosis/engine/server/engine/utils" ) -type AsyncStarlarkLogs struct { +type asyncStarlarkLogs struct { + ctx context.Context cancelCtxFunc context.CancelFunc starlarkRunResponseLineChan chan *rpc_api.StarlarkRunResponseLine + markedForConsumption bool } -func NewAsyncStarlarkLogs(cancelCtxFunc context.CancelFunc) AsyncStarlarkLogs { +func NewAsyncStarlarkLogs(cancelCtxFunc context.CancelFunc) asyncStarlarkLogs { + ctx, cancel := context.WithCancel(context.Background()) starlarkResponseLineChan := make(chan *rpc_api.StarlarkRunResponseLine) - return AsyncStarlarkLogs{ - cancelCtxFunc: cancelCtxFunc, + markedForConsumption := false + return asyncStarlarkLogs{ + ctx: ctx, + cancelCtxFunc: cancel, starlarkRunResponseLineChan: starlarkResponseLineChan, + markedForConsumption: markedForConsumption, } } -func (async AsyncStarlarkLogs) Close() { +func (async *asyncStarlarkLogs) MarkForConsumption() { + markedForConsumption := true + async.markedForConsumption = markedForConsumption +} + +func (async *asyncStarlarkLogs) IsMarkedForConsumption() bool { + return async.markedForConsumption +} + +func (async *asyncStarlarkLogs) Close() { logrus.Debugf("Streaming of Starlark execution logs is done, cleaning up resources") - close(async.starlarkRunResponseLineChan) async.cancelCtxFunc() } -func (async AsyncStarlarkLogs) AttachStream(stream grpc.ClientStream) { +func (async *asyncStarlarkLogs) AttachStream(stream grpc.ClientStream) { logrus.Debugf("Asynchronously reading the stream of Starlark execution logs") defer func() { - async.Close() + close(async.starlarkRunResponseLineChan) }() for { responseLine := new(rpc_api.StarlarkRunResponseLine) @@ -46,22 +60,30 @@ func (async AsyncStarlarkLogs) AttachStream(stream grpc.ClientStream) { logrus.Errorf("Unexpected error happened reading the stream. Client might have cancelled the stream\n%v", err.Error()) return } - async.starlarkRunResponseLineChan <- responseLine + select { + case <-async.ctx.Done(): + logrus.Debugf("Resources have been closed before consuming all the upstream data") + return + case async.starlarkRunResponseLineChan <- responseLine: + println("> next ") + } } } -func (async AsyncStarlarkLogs) WaitAndConsumeAll() []rpc_api.StarlarkRunResponseLine { +func (async *asyncStarlarkLogs) WaitAndConsumeAll() []rpc_api.StarlarkRunResponseLine { var logs []*rpc_api.StarlarkRunResponseLine - async.Consume(func(elem *rpc_api.StarlarkRunResponseLine) { + async.Consume(func(elem *rpc_api.StarlarkRunResponseLine) error { if elem != nil { logs = append(logs, elem) } + return nil }) return utils.FilterListNils(logs) } -func (async AsyncStarlarkLogs) Consume(consumer func(*rpc_api.StarlarkRunResponseLine)) { +func (async *asyncStarlarkLogs) Consume(consumer func(*rpc_api.StarlarkRunResponseLine) error) error { for elem := range async.starlarkRunResponseLineChan { consumer(elem) } + return nil } diff --git a/engine/server/engine/streaming/streaming_pool_manager.go b/engine/server/engine/streaming/streaming_pool_manager.go index efa53dcf9f..a332700d58 100644 --- a/engine/server/engine/streaming/streaming_pool_manager.go +++ b/engine/server/engine/streaming/streaming_pool_manager.go @@ -1,47 +1,73 @@ package streaming import ( + "time" + "github.com/google/uuid" - "google.golang.org/grpc" + "github.com/kurtosis-tech/kurtosis/api/golang/core/kurtosis_core_rpc_api_bindings" + "github.com/sirupsen/logrus" + + "github.com/hashicorp/golang-lru/v2/expirable" ) type Streamer[T any] interface { Close() - AttachStream(stream grpc.ClientStream) WaitAndConsumeAll() []T - Consume(consumer func(*T)) + Consume(consumer func(T) error) error + MarkForConsumption() + IsMarkedForConsumption() bool } type StreamerPool[T any] struct { - pool map[string]Streamer[T] + pool expirable.LRU[StreamerUUID, *asyncStarlarkLogs] } type StreamerUUID string -func NewStreamerPool[T any]() StreamerPool[T] { +func NewStreamerPool[T any](pool_size uint, expires_after time.Duration) StreamerPool[T] { + + pool := expirable.NewLRU( + int(pool_size), + func(uuid StreamerUUID, streamer *asyncStarlarkLogs) { + logrus.Infof("Removing async log uuid %s from pool.", uuid) + if streamer.IsMarkedForConsumption() { + // Skipping pool exit eviction because stream is still begin consumed. Context should + // be cancel after consumption is done. + logrus.Debugf("Async log uuid %s is marked for consumption, skipping pool exit eviction", uuid) + return + } + streamer.Close() + }, + expires_after, + ) + return StreamerPool[T]{ - pool: make(map[string]Streamer[T]), + pool: *pool, } } -func (pool StreamerPool[T]) Add(streamer Streamer[T]) StreamerUUID { +func (streamerPool StreamerPool[T]) Add(streamer *asyncStarlarkLogs) StreamerUUID { id := uuid.New() - id_str := id.String() - pool.pool[id_str] = streamer - println("Size: %d", len(pool.pool)) - return StreamerUUID(id_str) + id_str := StreamerUUID(id.String()) + streamerPool.pool.Add(id_str, streamer) + return id_str } -func (pool StreamerPool[T]) Consume(uuid StreamerUUID, consumer func(*T)) (bool, error) { - println("Size: %d", len(pool.pool)) - streamer, found := pool.pool[string(uuid)] +func (streamerPool StreamerPool[T]) Consume(uuid StreamerUUID, consumer func(*kurtosis_core_rpc_api_bindings.StarlarkRunResponseLine) error) (bool, error) { + streamer, found := streamerPool.pool.Get(uuid) if !found { return false, nil - } else { - delete(pool.pool, string(uuid)) } - streamer.Consume(consumer) + streamer.MarkForConsumption() + removed := streamerPool.pool.Remove(uuid) + + if removed { + defer streamer.Close() + if err := streamer.Consume(consumer); err != nil { + return true, err + } + } return true, nil } diff --git a/engine/server/go.mod b/engine/server/go.mod index ec709d3729..9558418ff2 100644 --- a/engine/server/go.mod +++ b/engine/server/go.mod @@ -40,7 +40,7 @@ require ( github.com/gammazero/workerpool v1.1.2 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/protobuf v1.5.3 // indirect - github.com/google/uuid v1.3.0 // indirect + github.com/google/uuid v1.3.1 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.0.2 // indirect github.com/pkg/errors v0.9.1 // indirect @@ -69,10 +69,12 @@ require ( github.com/go-logr/logr v1.2.3 // indirect github.com/go-openapi/jsonpointer v0.19.6 // indirect github.com/go-openapi/jsonreference v0.20.1 // indirect - github.com/go-openapi/swag v0.22.3 // indirect + github.com/go-openapi/swag v0.22.4 // indirect github.com/google/gnostic v0.5.7-v3refs // indirect github.com/google/go-cmp v0.5.9 // indirect github.com/google/gofuzz v1.1.0 // indirect + github.com/hashicorp/golang-lru v1.0.2 // indirect + github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/imdario/mergo v0.3.16 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect diff --git a/engine/server/go.sum b/engine/server/go.sum index 7ec701f8e7..c062f5a0b3 100644 --- a/engine/server/go.sum +++ b/engine/server/go.sum @@ -95,6 +95,7 @@ github.com/go-openapi/jsonreference v0.20.1 h1:FBLnyygC4/IZZr893oiomc9XaghoveYTr github.com/go-openapi/jsonreference v0.20.1/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= @@ -164,12 +165,17 @@ github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm4 github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= +github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= From 67cc0337a35772988776c6b769477c003799812a Mon Sep 17 00:00:00 2001 From: lostbean Date: Thu, 30 Nov 2023 23:30:13 -0300 Subject: [PATCH 68/95] move code into better modules --- .../server/engine/mapping/to_grpc/engine.go | 39 ++ .../server/engine/mapping/to_http/engine.go | 193 ++++++++ .../engine/mapping/to_http/service_logs.go | 59 +++ .../engine/mapping/to_logline/service_logs.go | 33 ++ .../engine/server/enclave_rest_api_handler.go | 148 +----- .../engine/server/engine_rest_api_handler.go | 116 +---- .../engine/server/websocket_api_handler.go | 441 ++++++------------ .../server/engine/streaming/service_logs.go | 218 +++++++++ .../server/engine/streaming/starlark_logs.go | 1 - .../streaming/streaming_pool_manager.go | 10 +- 10 files changed, 711 insertions(+), 547 deletions(-) create mode 100644 engine/server/engine/mapping/to_grpc/engine.go create mode 100644 engine/server/engine/mapping/to_http/engine.go create mode 100644 engine/server/engine/mapping/to_http/service_logs.go create mode 100644 engine/server/engine/mapping/to_logline/service_logs.go create mode 100644 engine/server/engine/streaming/service_logs.go diff --git a/engine/server/engine/mapping/to_grpc/engine.go b/engine/server/engine/mapping/to_grpc/engine.go new file mode 100644 index 0000000000..73d5b66a6f --- /dev/null +++ b/engine/server/engine/mapping/to_grpc/engine.go @@ -0,0 +1,39 @@ +package to_grpc + +import ( + "fmt" + + rpc_api "github.com/kurtosis-tech/kurtosis/api/golang/core/kurtosis_core_rpc_api_bindings" + api_type "github.com/kurtosis-tech/kurtosis/api/golang/http_rest/api_types" +) + +func ToGrpcConnect(conn api_type.Connect) rpc_api.Connect { + switch conn { + case api_type.CONNECT: + return rpc_api.Connect_CONNECT + case api_type.NOCONNECT: + return rpc_api.Connect_NO_CONNECT + default: + panic(fmt.Sprintf("Missing conversion of Connect Enum value: %s", conn)) + } +} + +func ToGrpcFeatureFlag(flag api_type.KurtosisFeatureFlag) rpc_api.KurtosisFeatureFlag { + switch flag { + case api_type.NOINSTRUCTIONSCACHING: + return rpc_api.KurtosisFeatureFlag_NO_INSTRUCTIONS_CACHING + default: + panic(fmt.Sprintf("Missing conversion of Feature Flag Enum value: %s", flag)) + } +} + +func ToGrpcImageDownloadMode(flag api_type.ImageDownloadMode) rpc_api.ImageDownloadMode { + switch flag { + case api_type.ImageDownloadModeALWAYS: + return rpc_api.ImageDownloadMode_always + case api_type.ImageDownloadModeMISSING: + return rpc_api.ImageDownloadMode_missing + default: + panic(fmt.Sprintf("Missing conversion of Image Download Mode Enum value: %s", flag)) + } +} diff --git a/engine/server/engine/mapping/to_http/engine.go b/engine/server/engine/mapping/to_http/engine.go new file mode 100644 index 0000000000..c272cf38a4 --- /dev/null +++ b/engine/server/engine/mapping/to_http/engine.go @@ -0,0 +1,193 @@ +package to_http + +import ( + "fmt" + + "github.com/kurtosis-tech/kurtosis/engine/server/engine/types" + "github.com/kurtosis-tech/kurtosis/engine/server/engine/utils" + + rpc_api "github.com/kurtosis-tech/kurtosis/api/golang/core/kurtosis_core_rpc_api_bindings" + api_type "github.com/kurtosis-tech/kurtosis/api/golang/http_rest/api_types" +) + +func ToHttpEnclaveContainersStatus(status types.EnclaveContainersStatus) api_type.EnclaveContainersStatus { + switch status { + case types.EnclaveContainersStatus_EMPTY: + return api_type.EnclaveContainersStatusEMPTY + case types.EnclaveContainersStatus_STOPPED: + return api_type.EnclaveContainersStatusSTOPPED + case types.EnclaveContainersStatus_RUNNING: + return api_type.EnclaveContainersStatusRUNNING + default: + panic(fmt.Sprintf("Undefined mapping of value: %s", status)) + } +} + +func ToHttpApiContainerStatus(status types.ContainerStatus) api_type.ApiContainerStatus { + switch status { + case types.ContainerStatus_NONEXISTENT: + return api_type.ApiContainerStatusNONEXISTENT + case types.ContainerStatus_STOPPED: + return api_type.ApiContainerStatusSTOPPED + case types.ContainerStatus_RUNNING: + return api_type.ApiContainerStatusRUNNING + default: + panic(fmt.Sprintf("Undefined mapping of value: %s", status)) + } +} + +func ToHttpEnclaveAPIContainerInfo(info types.EnclaveAPIContainerInfo) api_type.EnclaveAPIContainerInfo { + port := int(info.GrpcPortInsideEnclave) + return api_type.EnclaveAPIContainerInfo{ + ContainerId: info.ContainerId, + IpInsideEnclave: info.IpInsideEnclave, + GrpcPortInsideEnclave: port, + BridgeIpAddress: info.BridgeIpAddress, + } +} + +func ToHttpApiContainerHostMachineInfo(info types.EnclaveAPIContainerHostMachineInfo) api_type.EnclaveAPIContainerHostMachineInfo { + port := int(info.GrpcPortOnHostMachine) + return api_type.EnclaveAPIContainerHostMachineInfo{ + IpOnHostMachine: info.IpOnHostMachine, + GrpcPortOnHostMachine: port, + } +} + +func ToHttpEnclaveMode(mode types.EnclaveMode) api_type.EnclaveMode { + switch mode { + case types.EnclaveMode_PRODUCTION: + return api_type.PRODUCTION + case types.EnclaveMode_TEST: + return api_type.TEST + default: + panic(fmt.Sprintf("Undefined mapping of value: %s", mode)) + } +} + +func ToHttpEnclaveInfo(info types.EnclaveInfo) api_type.EnclaveInfo { + return api_type.EnclaveInfo{ + EnclaveUuid: info.EnclaveUuid, + ShortenedUuid: info.ShortenedUuid, + Name: info.Name, + ContainersStatus: ToHttpEnclaveContainersStatus(info.EnclaveContainersStatus), + ApiContainerStatus: ToHttpApiContainerStatus(info.ApiContainerStatus), + ApiContainerInfo: utils.MapPointer(info.ApiContainerInfo, ToHttpEnclaveAPIContainerInfo), + ApiContainerHostMachineInfo: utils.MapPointer(info.ApiContainerHostMachineInfo, ToHttpApiContainerHostMachineInfo), + CreationTime: info.CreationTime, + Mode: ToHttpEnclaveMode(info.Mode), + } +} + +func ToHttpEnclaveIdentifiers(identifier *types.EnclaveIdentifiers) api_type.EnclaveIdentifiers { + return api_type.EnclaveIdentifiers{ + EnclaveUuid: identifier.EnclaveUuid, + Name: identifier.Name, + ShortenedUuid: identifier.ShortenedUuid, + } +} + +func ToHttpEnclaveNameAndUuid(identifier *types.EnclaveNameAndUuid) api_type.EnclaveNameAndUuid { + return api_type.EnclaveNameAndUuid{ + Uuid: identifier.Uuid, + Name: identifier.Name, + } +} + +func ToHttpContainerStatus(status rpc_api.Container_Status) api_type.ContainerStatus { + switch status { + case rpc_api.Container_RUNNING: + return api_type.ContainerStatusRUNNING + case rpc_api.Container_STOPPED: + return api_type.ContainerStatusSTOPPED + case rpc_api.Container_UNKNOWN: + return api_type.ContainerStatusUNKNOWN + default: + panic(fmt.Sprintf("Missing conversion of Container Status Enum value: %s", status)) + } +} + +func ToHttpTransportProtocol(protocol rpc_api.Port_TransportProtocol) api_type.TransportProtocol { + switch protocol { + case rpc_api.Port_TCP: + return api_type.TCP + case rpc_api.Port_UDP: + return api_type.UDP + case rpc_api.Port_SCTP: + return api_type.SCTP + default: + panic(fmt.Sprintf("Missing conversion of Transport Protocol Enum value: %s", protocol)) + } +} + +func ToHttpServiceStatus(status rpc_api.ServiceStatus) api_type.ServiceStatus { + switch status { + case rpc_api.ServiceStatus_RUNNING: + return api_type.ServiceStatusRUNNING + case rpc_api.ServiceStatus_STOPPED: + return api_type.ServiceStatusSTOPPED + case rpc_api.ServiceStatus_UNKNOWN: + return api_type.ServiceStatusUNKNOWN + default: + panic(fmt.Sprintf("Missing conversion of Service Status Enum value: %s", status)) + } +} + +func ToHttpContainer(container *rpc_api.Container) api_type.Container { + status := ToHttpContainerStatus(container.Status) + return api_type.Container{ + CmdArgs: container.CmdArgs, + EntrypointArgs: container.EntrypointArgs, + EnvVars: container.EnvVars, + ImageName: container.ImageName, + Status: status, + } +} + +func ToHttpPorts(port *rpc_api.Port) api_type.Port { + protocol := ToHttpTransportProtocol(port.TransportProtocol) + return api_type.Port{ + ApplicationProtocol: &port.MaybeApplicationProtocol, + WaitTimeout: &port.MaybeWaitTimeout, + Number: int32(port.Number), + TransportProtocol: protocol, + } +} + +func ToHttpServiceInfo(service *rpc_api.ServiceInfo) api_type.ServiceInfo { + container := ToHttpContainer(service.Container) + serviceStatus := ToHttpServiceStatus(service.ServiceStatus) + publicPorts := utils.MapMapValues(service.MaybePublicPorts, ToHttpPorts) + privatePorts := utils.MapMapValues(service.PrivatePorts, ToHttpPorts) + return api_type.ServiceInfo{ + Container: container, + PublicIpAddr: &service.MaybePublicIpAddr, + PublicPorts: &publicPorts, + Name: service.Name, + PrivateIpAddr: service.PrivateIpAddr, + PrivatePorts: privatePorts, + ServiceStatus: serviceStatus, + ServiceUuid: service.ServiceUuid, + ShortenedUuid: service.ShortenedUuid, + } +} + +func ToHttpFeatureFlag(flag rpc_api.KurtosisFeatureFlag) api_type.KurtosisFeatureFlag { + switch flag { + case rpc_api.KurtosisFeatureFlag_NO_INSTRUCTIONS_CACHING: + return api_type.NOINSTRUCTIONSCACHING + default: + panic(fmt.Sprintf("Missing conversion of Feature Flag Enum value: %s", flag)) + } +} + +func ToHttpRestartPolicy(policy rpc_api.RestartPolicy) api_type.RestartPolicy { + switch policy { + case rpc_api.RestartPolicy_ALWAYS: + return api_type.RestartPolicyALWAYS + case rpc_api.RestartPolicy_NEVER: + return api_type.RestartPolicyNEVER + default: + panic(fmt.Sprintf("Missing conversion of Restart Policy Enum value: %s", policy)) + } +} diff --git a/engine/server/engine/mapping/to_http/service_logs.go b/engine/server/engine/mapping/to_http/service_logs.go new file mode 100644 index 0000000000..d7931ed196 --- /dev/null +++ b/engine/server/engine/mapping/to_http/service_logs.go @@ -0,0 +1,59 @@ +package to_http + +import ( + "time" + + user_service "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/service" + "github.com/kurtosis-tech/kurtosis/engine/server/engine/centralized_logs/logline" + "golang.org/x/exp/slices" + + api_type "github.com/kurtosis-tech/kurtosis/api/golang/http_rest/api_types" +) + +func ToHttpServiceLogs( + requestedServiceUuids []user_service.ServiceUUID, + serviceLogsByServiceUuid map[user_service.ServiceUUID][]logline.LogLine, + initialNotFoundServiceUuids []string, +) *api_type.ServiceLogs { + serviceLogLinesByUuid := make(map[string]api_type.LogLine, len(serviceLogsByServiceUuid)) + notFoundServiceUuids := make([]string, len(initialNotFoundServiceUuids)) + for _, serviceUuid := range requestedServiceUuids { + serviceUuidStr := string(serviceUuid) + isInNotFoundUuidList := slices.Contains(initialNotFoundServiceUuids, serviceUuidStr) + serviceLogLines, found := serviceLogsByServiceUuid[serviceUuid] + // should continue in the not-found-UUID list + if !found && isInNotFoundUuidList { + notFoundServiceUuids = append(notFoundServiceUuids, serviceUuidStr) + } + + // there is no new log lines but is a found UUID, so it has to be included in the service logs map + if !found && !isInNotFoundUuidList { + serviceLogLinesByUuid[serviceUuidStr] = api_type.LogLine{ + Line: []string{}, + Timestamp: time.Now(), + } + } + + logLines := ToHttpLogLines(serviceLogLines) + serviceLogLinesByUuid[serviceUuidStr] = logLines + } + + response := &api_type.ServiceLogs{ + NotFoundServiceUuidSet: ¬FoundServiceUuids, + ServiceLogsByServiceUuid: &serviceLogLinesByUuid, + } + return response +} + +func ToHttpLogLines(logLines []logline.LogLine) api_type.LogLine { + logLinesStr := make([]string, len(logLines)) + var logTimestamp time.Time + + for logLineIndex, logLine := range logLines { + logLinesStr[logLineIndex] = logLine.GetContent() + logTimestamp = logLine.GetTimestamp() + } + + return api_type.LogLine{Line: logLinesStr, Timestamp: logTimestamp} + +} diff --git a/engine/server/engine/mapping/to_logline/service_logs.go b/engine/server/engine/mapping/to_logline/service_logs.go new file mode 100644 index 0000000000..d01d58ad49 --- /dev/null +++ b/engine/server/engine/mapping/to_logline/service_logs.go @@ -0,0 +1,33 @@ +package to_logline + +import ( + "github.com/kurtosis-tech/kurtosis/engine/server/engine/centralized_logs/logline" + "github.com/kurtosis-tech/stacktrace" + + api_type "github.com/kurtosis-tech/kurtosis/api/golang/http_rest/api_types" +) + +func ToLoglineLogLineFilters(logLineFilters []api_type.LogLineFilter) (logline.ConjunctiveLogLineFilters, error) { + var conjunctiveLogLineFilters logline.ConjunctiveLogLineFilters + + for _, logLineFilter := range logLineFilters { + var filter *logline.LogLineFilter + operator := logLineFilter.Operator + filterTextPattern := logLineFilter.TextPattern + switch operator { + case api_type.DOESCONTAINTEXT: + filter = logline.NewDoesContainTextLogLineFilter(filterTextPattern) + case api_type.DOESNOTCONTAINTEXT: + filter = logline.NewDoesNotContainTextLogLineFilter(filterTextPattern) + case api_type.DOESCONTAINMATCHREGEX: + filter = logline.NewDoesContainMatchRegexLogLineFilter(filterTextPattern) + case api_type.DOESNOTCONTAINMATCHREGEX: + filter = logline.NewDoesNotContainMatchRegexLogLineFilter(filterTextPattern) + default: + return nil, stacktrace.NewError("Unrecognized log line filter operator '%v' in GRPC filter '%v'; this is a bug in Kurtosis", operator, logLineFilter) + } + conjunctiveLogLineFilters = append(conjunctiveLogLineFilters, *filter) + } + + return conjunctiveLogLineFilters, nil +} diff --git a/engine/server/engine/server/enclave_rest_api_handler.go b/engine/server/engine/server/enclave_rest_api_handler.go index ebe2cba60f..36b082b646 100644 --- a/engine/server/engine/server/enclave_rest_api_handler.go +++ b/engine/server/engine/server/enclave_rest_api_handler.go @@ -9,6 +9,7 @@ import ( "sync" "github.com/kurtosis-tech/kurtosis/engine/server/engine/enclave_manager" + "github.com/kurtosis-tech/kurtosis/engine/server/engine/mapping/to_grpc" "github.com/kurtosis-tech/kurtosis/engine/server/engine/mapping/to_http" "github.com/kurtosis-tech/kurtosis/engine/server/engine/streaming" "github.com/kurtosis-tech/kurtosis/engine/server/engine/types" @@ -316,7 +317,7 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierServices(ctx context. return nil, stacktrace.NewError("Can't list services using gRPC call with enclave %s", enclave_identifier) } - mapped_services := utils.MapMapValues(services.ServiceInfo, toHttpServiceInfo) + mapped_services := utils.MapMapValues(services.ServiceInfo, to_http.ToHttpServiceInfo) return api.GetEnclavesEnclaveIdentifierServices200JSONResponse(mapped_services), nil } @@ -356,7 +357,7 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierServicesConnection(c logrus.Infof("Listing services from enclave %s", enclave_identifier) connectServicesArgs := rpc_api.ConnectServicesArgs{ - Connect: toGrpcConnect(*request.Body), + Connect: to_grpc.ToGrpcConnect(*request.Body), } _, err := (*apiContainerClient).ConnectServices(ctx, &connectServicesArgs) if err != nil { @@ -386,7 +387,7 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierServicesServiceIdenti return nil, stacktrace.NewError("Can't list services using gRPC call with enclave %s", enclave_identifier) } - mapped_services := utils.MapMapValues(services.ServiceInfo, toHttpServiceInfo) + mapped_services := utils.MapMapValues(services.ServiceInfo, to_http.ToHttpServiceInfo) selected_service, found := mapped_services[service_identifier] if !found { // TODO(edgar) add 404 return @@ -488,8 +489,8 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierStarlark(ctx context. return nil, stacktrace.NewError("Can't get Starlark info using gRPC call with enclave %s", enclave_identifier) } - flags := utils.MapList(starlark_result.ExperimentalFeatures, toHttpFeatureFlag) - policy := toHttpRestartPolicy(starlark_result.RestartPolicy) + flags := utils.MapList(starlark_result.ExperimentalFeatures, to_http.ToHttpFeatureFlag) + policy := to_http.ToHttpRestartPolicy(starlark_result.RestartPolicy) response := api_type.StarlarkDescription{ ExperimentalFeatures: flags, MainFunctionName: starlark_result.MainFunctionName, @@ -560,7 +561,7 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkPackagesPack logrus.Infof("Run Starlark package on enclave %s", enclave_identifier) package_id := request.PackageId - flags := utils.MapList(utils.DerefWith(request.Body.ExperimentalFeatures, []api_type.KurtosisFeatureFlag{}), toGrpcFeatureFlag) + flags := utils.MapList(utils.DerefWith(request.Body.ExperimentalFeatures, []api_type.KurtosisFeatureFlag{}), to_grpc.ToGrpcFeatureFlag) // The gRPC always expect a JSON object even though it's marked as optional, so we need to default to `{}`` jsonParams := utils.DerefWith(request.Body.Params, map[string]interface{}{}) jsonBlob, err := json.Marshal(jsonParams) @@ -583,7 +584,7 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkPackagesPack ExperimentalFeatures: flags, CloudInstanceId: request.Body.CloudInstanceId, CloudUserId: request.Body.CloudUserId, - ImageDownloadMode: utils.MapPointer(request.Body.ImageDownloadMode, toGrpcImageDownloadMode), + ImageDownloadMode: utils.MapPointer(request.Body.ImageDownloadMode, to_grpc.ToGrpcImageDownloadMode), } ctxWithCancel, cancelCtxFunc := context.WithCancel(context.Background()) @@ -623,7 +624,7 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx } logrus.Infof("Run Starlark script on enclave %s", enclave_identifier) - flags := utils.MapList(utils.DerefWith(request.Body.ExperimentalFeatures, []api_type.KurtosisFeatureFlag{}), toGrpcFeatureFlag) + flags := utils.MapList(utils.DerefWith(request.Body.ExperimentalFeatures, []api_type.KurtosisFeatureFlag{}), to_grpc.ToGrpcFeatureFlag) jsonString := utils.MapPointer(request.Body.Params, func(v map[string]interface{}) string { jsonBlob, err := json.Marshal(v) if err != nil { @@ -641,7 +642,7 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx ExperimentalFeatures: flags, CloudInstanceId: request.Body.CloudInstanceId, CloudUserId: request.Body.CloudUserId, - ImageDownloadMode: utils.MapPointer(request.Body.ImageDownloadMode, toGrpcImageDownloadMode), + ImageDownloadMode: utils.MapPointer(request.Body.ImageDownloadMode, to_grpc.ToGrpcImageDownloadMode), } ctxWithCancel, cancelCtxFunc := context.WithCancel(context.Background()) @@ -729,132 +730,3 @@ func (manager enclaveRuntime) GetGrpcClientForEnclaveUUID(enclave_uuid string) ( return &client, nil } - -func toGrpcConnect(conn api_type.Connect) rpc_api.Connect { - switch conn { - case api_type.CONNECT: - return rpc_api.Connect_CONNECT - case api_type.NOCONNECT: - return rpc_api.Connect_NO_CONNECT - default: - panic(fmt.Sprintf("Missing conversion of Connect Enum value: %s", conn)) - } -} - -func toHttpContainerStatus(status rpc_api.Container_Status) api_type.ContainerStatus { - switch status { - case rpc_api.Container_RUNNING: - return api_type.ContainerStatusRUNNING - case rpc_api.Container_STOPPED: - return api_type.ContainerStatusSTOPPED - case rpc_api.Container_UNKNOWN: - return api_type.ContainerStatusUNKNOWN - default: - panic(fmt.Sprintf("Missing conversion of Container Status Enum value: %s", status)) - } -} - -func toHttpTransportProtocol(protocol rpc_api.Port_TransportProtocol) api_type.TransportProtocol { - switch protocol { - case rpc_api.Port_TCP: - return api_type.TCP - case rpc_api.Port_UDP: - return api_type.UDP - case rpc_api.Port_SCTP: - return api_type.SCTP - default: - panic(fmt.Sprintf("Missing conversion of Transport Protocol Enum value: %s", protocol)) - } -} - -func toHttpServiceStatus(status rpc_api.ServiceStatus) api_type.ServiceStatus { - switch status { - case rpc_api.ServiceStatus_RUNNING: - return api_type.ServiceStatusRUNNING - case rpc_api.ServiceStatus_STOPPED: - return api_type.ServiceStatusSTOPPED - case rpc_api.ServiceStatus_UNKNOWN: - return api_type.ServiceStatusUNKNOWN - default: - panic(fmt.Sprintf("Missing conversion of Service Status Enum value: %s", status)) - } -} - -func toHttpContainer(container *rpc_api.Container) api_type.Container { - status := toHttpContainerStatus(container.Status) - return api_type.Container{ - CmdArgs: container.CmdArgs, - EntrypointArgs: container.EntrypointArgs, - EnvVars: container.EnvVars, - ImageName: container.ImageName, - Status: status, - } -} - -func toHttpPorts(port *rpc_api.Port) api_type.Port { - protocol := toHttpTransportProtocol(port.TransportProtocol) - return api_type.Port{ - ApplicationProtocol: &port.MaybeApplicationProtocol, - WaitTimeout: &port.MaybeWaitTimeout, - Number: int32(port.Number), - TransportProtocol: protocol, - } -} - -func toHttpServiceInfo(service *rpc_api.ServiceInfo) api_type.ServiceInfo { - container := toHttpContainer(service.Container) - serviceStatus := toHttpServiceStatus(service.ServiceStatus) - publicPorts := utils.MapMapValues(service.MaybePublicPorts, toHttpPorts) - privatePorts := utils.MapMapValues(service.PrivatePorts, toHttpPorts) - return api_type.ServiceInfo{ - Container: container, - PublicIpAddr: &service.MaybePublicIpAddr, - PublicPorts: &publicPorts, - Name: service.Name, - PrivateIpAddr: service.PrivateIpAddr, - PrivatePorts: privatePorts, - ServiceStatus: serviceStatus, - ServiceUuid: service.ServiceUuid, - ShortenedUuid: service.ShortenedUuid, - } -} - -func toHttpFeatureFlag(flag rpc_api.KurtosisFeatureFlag) api_type.KurtosisFeatureFlag { - switch flag { - case rpc_api.KurtosisFeatureFlag_NO_INSTRUCTIONS_CACHING: - return api_type.NOINSTRUCTIONSCACHING - default: - panic(fmt.Sprintf("Missing conversion of Feature Flag Enum value: %s", flag)) - } -} - -func toHttpRestartPolicy(policy rpc_api.RestartPolicy) api_type.RestartPolicy { - switch policy { - case rpc_api.RestartPolicy_ALWAYS: - return api_type.RestartPolicyALWAYS - case rpc_api.RestartPolicy_NEVER: - return api_type.RestartPolicyNEVER - default: - panic(fmt.Sprintf("Missing conversion of Restart Policy Enum value: %s", policy)) - } -} - -func toGrpcFeatureFlag(flag api_type.KurtosisFeatureFlag) rpc_api.KurtosisFeatureFlag { - switch flag { - case api_type.NOINSTRUCTIONSCACHING: - return rpc_api.KurtosisFeatureFlag_NO_INSTRUCTIONS_CACHING - default: - panic(fmt.Sprintf("Missing conversion of Feature Flag Enum value: %s", flag)) - } -} - -func toGrpcImageDownloadMode(flag api_type.ImageDownloadMode) rpc_api.ImageDownloadMode { - switch flag { - case api_type.ImageDownloadModeALWAYS: - return rpc_api.ImageDownloadMode_always - case api_type.ImageDownloadModeMISSING: - return rpc_api.ImageDownloadMode_missing - default: - panic(fmt.Sprintf("Missing conversion of Image Download Mode Enum value: %s", flag)) - } -} diff --git a/engine/server/engine/server/engine_rest_api_handler.go b/engine/server/engine/server/engine_rest_api_handler.go index f93641ffb8..bbc3dd2fde 100644 --- a/engine/server/engine/server/engine_rest_api_handler.go +++ b/engine/server/engine/server/engine_rest_api_handler.go @@ -2,10 +2,10 @@ package server import ( "context" - "fmt" "github.com/kurtosis-tech/kurtosis/engine/server/engine/centralized_logs/client_implementations/persistent_volume/log_file_manager" "github.com/kurtosis-tech/kurtosis/engine/server/engine/enclave_manager" + "github.com/kurtosis-tech/kurtosis/engine/server/engine/mapping/to_http" "github.com/kurtosis-tech/kurtosis/engine/server/engine/types" "github.com/kurtosis-tech/kurtosis/engine/server/engine/utils" "github.com/kurtosis-tech/kurtosis/metrics-library/golang/lib/metrics_client" @@ -39,7 +39,7 @@ func (engine EngineRuntime) DeleteEnclaves(ctx context.Context, request api.Dele return nil, stacktrace.Propagate(err, "An error occurred removing all logs.") } } - removedApiResponse := utils.MapList(removedEnclaveUuidsAndNames, toHttpApiEnclaveNameAndUuid) + removedApiResponse := utils.MapList(removedEnclaveUuidsAndNames, to_http.ToHttpEnclaveNameAndUuid) return api.DeleteEnclaves200JSONResponse(api_type.DeletionSummary{RemovedEnclaveNameAndUuids: &removedApiResponse}), nil } @@ -50,7 +50,7 @@ func (engine EngineRuntime) GetEnclaves(ctx context.Context, request api.GetEncl if err != nil { return nil, stacktrace.Propagate(err, "An error occurred getting info for enclaves") } - response := utils.MapMapValues(infoForEnclaves, func(enclave *types.EnclaveInfo) api_type.EnclaveInfo { return toHttpApiEnclaveInfo(*enclave) }) + response := utils.MapMapValues(infoForEnclaves, func(enclave *types.EnclaveInfo) api_type.EnclaveInfo { return to_http.ToHttpEnclaveInfo(*enclave) }) return api.GetEnclaves200JSONResponse(response), nil } @@ -88,7 +88,7 @@ func (engine EngineRuntime) PostEnclaves(ctx context.Context, request api.PostEn return nil, stacktrace.Propagate(err, "An error occurred creating new enclave with name '%v'", request.Body.EnclaveName) } - response := toHttpApiEnclaveInfo(*enclaveInfo) + response := to_http.ToHttpEnclaveInfo(*enclaveInfo) return api.PostEnclaves200JSONResponse(response), nil } @@ -99,7 +99,7 @@ func (engine EngineRuntime) GetEnclavesHistorical(ctx context.Context, request a if err != nil { return nil, stacktrace.Propagate(err, "An error occurred while fetching enclave identifiers") } - identifiers_map_api := utils.MapList(allIdentifiers, toHttpApiEnclaveIdentifiers) + identifiers_map_api := utils.MapList(allIdentifiers, to_http.ToHttpEnclaveIdentifiers) return api.GetEnclavesHistorical200JSONResponse(identifiers_map_api), nil } @@ -130,7 +130,7 @@ func (engine EngineRuntime) GetEnclavesEnclaveIdentifier(ctx context.Context, re notFoundErr := stacktrace.NewError("Enclave '%s' not found.", request.EnclaveIdentifier) return nil, notFoundErr } - response := toHttpApiEnclaveInfo(*info) + response := to_http.ToHttpEnclaveInfo(*info) return api.GetEnclavesEnclaveIdentifier200JSONResponse(response), nil } @@ -148,7 +148,7 @@ func (engine EngineRuntime) GetEnclavesEnclaveIdentifierStatus(ctx context.Conte return nil, err } - return api.GetEnclavesEnclaveIdentifierStatus200JSONResponse(toHttpEnclaveContainersStatus(info.EnclaveContainersStatus)), nil + return api.GetEnclavesEnclaveIdentifierStatus200JSONResponse(to_http.ToHttpEnclaveContainersStatus(info.EnclaveContainersStatus)), nil } // Set enclave status @@ -171,7 +171,6 @@ func (engine EngineRuntime) PostEnclavesEnclaveIdentifierStatus(ctx context.Cont err := stacktrace.NewError("Unsupported target state: '%s'", string(*targetState)) return nil, err } - } // Get Engine Info @@ -180,104 +179,3 @@ func (engine EngineRuntime) GetEngineInfo(ctx context.Context, request api.GetEn result := api_type.EngineInfo{EngineVersion: engine.ImageVersionTag} return api.GetEngineInfo200JSONResponse(result), nil } - -// ============================================================================================================================================= -// ============================================== Helper Functions ============================================================================= -// ============================================================================================================================================= - -func toHttpApiEnclaveContainersStatus(status types.EnclaveContainersStatus) api_type.EnclaveContainersStatus { - switch status { - case types.EnclaveContainersStatus_EMPTY: - return api_type.EnclaveContainersStatusEMPTY - case types.EnclaveContainersStatus_STOPPED: - return api_type.EnclaveContainersStatusSTOPPED - case types.EnclaveContainersStatus_RUNNING: - return api_type.EnclaveContainersStatusRUNNING - default: - panic(fmt.Sprintf("Undefined mapping of value: %s", status)) - } -} - -func toHttpApiContainerStatus(status types.ContainerStatus) api_type.ApiContainerStatus { - switch status { - case types.ContainerStatus_NONEXISTENT: - return api_type.ApiContainerStatusNONEXISTENT - case types.ContainerStatus_STOPPED: - return api_type.ApiContainerStatusSTOPPED - case types.ContainerStatus_RUNNING: - return api_type.ApiContainerStatusRUNNING - default: - panic(fmt.Sprintf("Undefined mapping of value: %s", status)) - } -} - -func toHttpApiEnclaveAPIContainerInfo(info types.EnclaveAPIContainerInfo) api_type.EnclaveAPIContainerInfo { - port := int(info.GrpcPortInsideEnclave) - return api_type.EnclaveAPIContainerInfo{ - ContainerId: info.ContainerId, - IpInsideEnclave: info.IpInsideEnclave, - GrpcPortInsideEnclave: port, - BridgeIpAddress: info.BridgeIpAddress, - } -} - -func toHttpApiApiContainerHostMachineInfo(info types.EnclaveAPIContainerHostMachineInfo) api_type.EnclaveAPIContainerHostMachineInfo { - port := int(info.GrpcPortOnHostMachine) - return api_type.EnclaveAPIContainerHostMachineInfo{ - IpOnHostMachine: info.IpOnHostMachine, - GrpcPortOnHostMachine: port, - } -} - -func toHttpApiEnclaveMode(mode types.EnclaveMode) api_type.EnclaveMode { - switch mode { - case types.EnclaveMode_PRODUCTION: - return api_type.PRODUCTION - case types.EnclaveMode_TEST: - return api_type.TEST - default: - panic(fmt.Sprintf("Undefined mapping of value: %s", mode)) - } -} - -func toHttpApiEnclaveInfo(info types.EnclaveInfo) api_type.EnclaveInfo { - return api_type.EnclaveInfo{ - EnclaveUuid: info.EnclaveUuid, - ShortenedUuid: info.ShortenedUuid, - Name: info.Name, - ContainersStatus: toHttpApiEnclaveContainersStatus(info.EnclaveContainersStatus), - ApiContainerStatus: toHttpApiContainerStatus(info.ApiContainerStatus), - ApiContainerInfo: utils.MapPointer(info.ApiContainerInfo, toHttpApiEnclaveAPIContainerInfo), - ApiContainerHostMachineInfo: utils.MapPointer(info.ApiContainerHostMachineInfo, toHttpApiApiContainerHostMachineInfo), - CreationTime: info.CreationTime, - Mode: toHttpApiEnclaveMode(info.Mode), - } -} - -func toHttpApiEnclaveIdentifiers(identifier *types.EnclaveIdentifiers) api_type.EnclaveIdentifiers { - return api_type.EnclaveIdentifiers{ - EnclaveUuid: identifier.EnclaveUuid, - Name: identifier.Name, - ShortenedUuid: identifier.ShortenedUuid, - } -} - -func toHttpApiEnclaveNameAndUuid(identifier *types.EnclaveNameAndUuid) api_type.EnclaveNameAndUuid { - return api_type.EnclaveNameAndUuid{ - Uuid: identifier.Uuid, - Name: identifier.Name, - } -} - -func toHttpEnclaveContainersStatus(status types.EnclaveContainersStatus) api_type.EnclaveContainersStatus { - switch status { - case types.EnclaveContainersStatus_STOPPED: - return api_type.EnclaveContainersStatusSTOPPED - case types.EnclaveContainersStatus_RUNNING: - return api_type.EnclaveContainersStatusRUNNING - case types.EnclaveContainersStatus_EMPTY: - return api_type.EnclaveContainersStatusEMPTY - default: - panic(fmt.Sprintf("Undefined mapping of value: %s", status)) - } -} diff --git a/engine/server/engine/server/websocket_api_handler.go b/engine/server/engine/server/websocket_api_handler.go index b57e1c64f9..fbf0c03dbb 100644 --- a/engine/server/engine/server/websocket_api_handler.go +++ b/engine/server/engine/server/websocket_api_handler.go @@ -1,25 +1,20 @@ package server import ( - "context" "encoding/json" + "fmt" "net/http" - "time" - "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/enclave" user_service "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/service" "github.com/kurtosis-tech/kurtosis/engine/server/engine/centralized_logs" "github.com/kurtosis-tech/kurtosis/engine/server/engine/centralized_logs/client_implementations/persistent_volume/log_file_manager" - "github.com/kurtosis-tech/kurtosis/engine/server/engine/centralized_logs/logline" "github.com/kurtosis-tech/kurtosis/engine/server/engine/enclave_manager" "github.com/kurtosis-tech/kurtosis/engine/server/engine/mapping/to_http" "github.com/kurtosis-tech/kurtosis/engine/server/engine/streaming" "github.com/kurtosis-tech/kurtosis/engine/server/engine/utils" "github.com/kurtosis-tech/kurtosis/metrics-library/golang/lib/metrics_client" - "github.com/kurtosis-tech/stacktrace" "github.com/labstack/echo/v4" "github.com/sirupsen/logrus" - "golang.org/x/exp/slices" "golang.org/x/net/websocket" rpc_api "github.com/kurtosis-tech/kurtosis/api/golang/core/kurtosis_core_rpc_api_bindings" @@ -53,23 +48,13 @@ type WebSocketRuntime struct { AsyncStarlarkLogs streaming.StreamerPool[*rpc_api.StarlarkRunResponseLine] } -func sendErrorCode(ctx echo.Context, code int, message string) error { - err := ctx.JSON(code, message) - return err -} - -type LogStreamer struct { - serviceLogsByServiceUuidChan chan map[user_service.ServiceUUID][]logline.LogLine - errChan chan error - cancelCtxFunc func() - requestedServiceUuids []user_service.ServiceUUID - notFoundServiceUuids []string -} - func (engine WebSocketRuntime) GetEnclavesEnclaveIdentifierLogs(ctx echo.Context, enclaveIdentifier api_type.EnclaveIdentifier, params api_type.GetEnclavesEnclaveIdentifierLogsParams) error { - streamer, err := engine.getLogStreamer( - ctx, + streamer, err := streaming.NewServiceLogStreamer( + ctx.Request().Context(), + engine.EnclaveManager, enclaveIdentifier, + engine.PerWeekLogsDatabaseClient, + engine.PerFileLogsDatabaseClient, utils.MapList(params.ServiceUuidSet, func(x string) user_service.ServiceUUID { return user_service.ServiceUUID(x) }), params.FollowLogs, params.ReturnAllLogs, @@ -77,23 +62,38 @@ func (engine WebSocketRuntime) GetEnclavesEnclaveIdentifierLogs(ctx echo.Context params.ConjunctiveFilters, ) if err != nil { - logrus.Error(err) - return sendErrorCode(ctx, http.StatusInternalServerError, "Failed to setup log streaming") + logrus.WithFields(logrus.Fields{ + "enclave_identifier": enclaveIdentifier, + "parameters": params, + }).Error("Failed to create log stream") + errInfo := api_type.ResponseInfo{ + Code: http.StatusInternalServerError, + Message: "Failed to create log stream", + Type: api_type.ERROR, + } + replyWithResponseInfo(ctx, errInfo) + return nil } if ctx.IsWebSocket() { - return streamer.streamWithWebsocket(ctx) + logrus.Infof("Starting log stream using Websocket") + streamServiceLogsWithWebsocket(ctx, *streamer) } else { - return streamer.streamHTTP(ctx) + logrus.Infof("Starting log stream using plain HTTP") + streamServiceLogsWithHTTP(ctx, *streamer) } + return nil } func (engine WebSocketRuntime) GetEnclavesEnclaveIdentifierServicesServiceIdentifierLogs(ctx echo.Context, enclaveIdentifier api_type.EnclaveIdentifier, serviceIdentifier api_type.ServiceIdentifier, params api_type.GetEnclavesEnclaveIdentifierServicesServiceIdentifierLogsParams) error { serviceUuidStrSet := []user_service.ServiceUUID{user_service.ServiceUUID(serviceIdentifier)} - streamer, err := engine.getLogStreamer( - ctx, + streamer, err := streaming.NewServiceLogStreamer( + ctx.Request().Context(), + engine.EnclaveManager, enclaveIdentifier, + engine.PerWeekLogsDatabaseClient, + engine.PerFileLogsDatabaseClient, serviceUuidStrSet, params.FollowLogs, params.ReturnAllLogs, @@ -101,325 +101,172 @@ func (engine WebSocketRuntime) GetEnclavesEnclaveIdentifierServicesServiceIdenti params.ConjunctiveFilters, ) if err != nil { - logrus.Error(err) - return sendErrorCode(ctx, http.StatusInternalServerError, "Failed to setup log streaming") + logrus.WithFields(logrus.Fields{ + "enclave_identifier": enclaveIdentifier, + "parameters": params, + }).Error("Failed to create log stream") + errInfo := api_type.ResponseInfo{ + Code: http.StatusInternalServerError, + Message: "Failed to create log stream", + Type: api_type.ERROR, + } + replyWithResponseInfo(ctx, errInfo) + return nil } if ctx.IsWebSocket() { - return streamer.streamWithWebsocket(ctx) + logrus.Infof("Starting log stream using Websocket") + streamServiceLogsWithWebsocket(ctx, *streamer) } else { - return streamer.streamHTTP(ctx) + logrus.Infof("Starting log stream using plain HTTP") + streamServiceLogsWithHTTP(ctx, *streamer) } + + return nil } // (GET /enclaves/{enclave_identifier}/starlark/executions/{starlark_execution_uuid}/logs) func (engine WebSocketRuntime) GetEnclavesEnclaveIdentifierStarlarkExecutionsStarlarkExecutionUuidLogs(ctx echo.Context, enclaveIdentifier api_type.EnclaveIdentifier, starlarkExecutionUuid api_type.StarlarkExecutionUuid) error { - async_log_uuid := string(starlarkExecutionUuid) + async_log_uuid := streaming.StreamerUUID(starlarkExecutionUuid) if ctx.IsWebSocket() { logrus.Infof("Starting log stream using Websocket for streamer UUUID: %s", starlarkExecutionUuid) - websocket.Handler(func(ws *websocket.Conn) { - defer ws.Close() - found, _ := engine.AsyncStarlarkLogs.Consume(streaming.StreamerUUID(async_log_uuid), func(logline *rpc_api.StarlarkRunResponseLine) error { - println(logline.String()) - err := websocket.JSON.Send(ws, utils.MapPointer(logline, to_http.ToHttpApiStarlarkRunResponseLine)) - if err != nil { - ctx.Logger().Error(err) - } - return nil - }) - println(found) - }).ServeHTTP(ctx.Response(), ctx.Request()) + streamWithWebsocket(ctx, engine.AsyncStarlarkLogs, async_log_uuid) } else { logrus.Infof("Starting log stream using plain HTTP for streamer UUUID: %s", starlarkExecutionUuid) - ctx.Response().Header().Set(echo.HeaderContentType, echo.MIMEApplicationJSON) - ctx.Response().WriteHeader(http.StatusOK) - enc := json.NewEncoder(ctx.Response()) - found, _ := engine.AsyncStarlarkLogs.Consume(streaming.StreamerUUID(async_log_uuid), func(logline *rpc_api.StarlarkRunResponseLine) error { - if err := enc.Encode(utils.MapPointer(logline, to_http.ToHttpApiStarlarkRunResponseLine)); err != nil { - return err - } - ctx.Response().Flush() - return nil - }) - println(found) + streamWithHTTP(ctx, engine.AsyncStarlarkLogs, async_log_uuid) } return nil } -func (engine WebSocketRuntime) getLogStreamer( - ctx echo.Context, - enclaveIdentifier api_type.EnclaveIdentifier, - serviceUuidList []user_service.ServiceUUID, - maybeShouldFollowLogs *bool, - maybeShouldReturnAllLogs *bool, - maybeNumLogLines *uint32, - maybeFilters *[]api_type.LogLineFilter, -) (*LogStreamer, error) { - enclaveUuid, err := engine.EnclaveManager.GetEnclaveUuidForEnclaveIdentifier(context.Background(), enclaveIdentifier) - if err != nil { - logrus.Errorf("An error occurred while fetching uuid for enclave '%v'. This could happen if the enclave has been deleted. Treating it as UUID", enclaveIdentifier) - return nil, err - } - - requestedServiceUuids := make(map[user_service.ServiceUUID]bool, len(serviceUuidList)) - shouldFollowLogs := utils.DerefWith(maybeShouldFollowLogs, false) - shouldReturnAllLogs := utils.DerefWith(maybeShouldReturnAllLogs, false) - numLogLines := utils.DerefWith(maybeNumLogLines, 100) - filters := utils.DerefWith(maybeFilters, []api_type.LogLineFilter{}) - context := ctx.Request().Context() - - for _, serviceUuidStr := range serviceUuidList { - serviceUuid := user_service.ServiceUUID(serviceUuidStr) - requestedServiceUuids[serviceUuid] = true - } - - if engine.PerWeekLogsDatabaseClient == nil || engine.PerFileLogsDatabaseClient == nil { - return nil, stacktrace.NewError("It's not possible to return service logs because there is no logs database client; this is bug in Kurtosis") - } - - var ( - serviceLogsByServiceUuidChan chan map[user_service.ServiceUUID][]logline.LogLine - errChan chan error - cancelCtxFunc func() - ) - - notFoundServiceUuids, err := engine.reportAnyMissingUuidsAndGetNotFoundUuidsListHttp(context, enclaveUuid, requestedServiceUuids) - if err != nil { - return nil, err - } +// ============================================================================================================================================= +// ============================================== Helper Functions ============================================================================= +// ============================================================================================================================================= - conjunctiveLogLineFilters, err := fromHttpLogLineFilters(filters) - if err != nil { - return nil, err - } +func replyWithResponseInfo(ctx echo.Context, response api_type.ResponseInfo) { + ctx.Response().Header().Set(echo.HeaderContentType, echo.MIMEApplicationJSON) + enc := json.NewEncoder(ctx.Response()) + ctx.Response().WriteHeader(int(response.Code)) + enc.Encode(response) +} - // get enclave creation time to determine strategy to pull logs - enclaveCreationTime, err := engine.getEnclaveCreationTime(context, enclaveUuid) - if err != nil { - return nil, err +func streamWithWebsocket[T any](ctx echo.Context, streamerPool streaming.StreamerPool[T], streamerUUID streaming.StreamerUUID) { + notFoundErr := api_type.ResponseInfo{ + Type: api_type.INFO, + Message: fmt.Sprintf("Log streaming '%s' not found. Either it has been consumed or has expired.", streamerUUID), + Code: http.StatusNotFound, } - logsDatabaseClient := engine.getLogsDatabaseClient(enclaveCreationTime) - - serviceLogsByServiceUuidChan, errChan, cancelCtxFunc, err = logsDatabaseClient.StreamUserServiceLogs( - context, - enclaveUuid, - requestedServiceUuids, - conjunctiveLogLineFilters, - shouldFollowLogs, - shouldReturnAllLogs, - uint32(numLogLines)) - if err != nil { - return nil, err + inPool := streamerPool.Contains(streamerUUID) + if !inPool { + replyWithResponseInfo(ctx, notFoundErr) } - return &LogStreamer{ - serviceLogsByServiceUuidChan: serviceLogsByServiceUuidChan, - errChan: errChan, - cancelCtxFunc: cancelCtxFunc, - notFoundServiceUuids: notFoundServiceUuids, - requestedServiceUuids: serviceUuidList, - }, nil -} - -func (streamer LogStreamer) close() { - streamer.cancelCtxFunc() -} - -func (streamer LogStreamer) streamWithWebsocket(ctx echo.Context) error { - defer streamer.close() - - logrus.Debugf("Starting log stream using Websocket on services: %s", streamer.requestedServiceUuids) websocket.Handler(func(ws *websocket.Conn) { defer ws.Close() - - for { - select { - //stream case - case serviceLogsByServiceUuid, isChanOpen := <-streamer.serviceLogsByServiceUuidChan: - //If the channel is closed means that the logs database client won't continue sending streams - if !isChanOpen { - logrus.Debug("Exiting the stream loop after receiving a close signal from the service logs by service UUID channel") - return - } - - getServiceLogsResponse := newLogsResponseHttp(streamer.requestedServiceUuids, serviceLogsByServiceUuid, streamer.notFoundServiceUuids) - err := websocket.JSON.Send(ws, getServiceLogsResponse) - if err != nil { - ctx.Logger().Error(err) - } - - //error from logs database case - case err, isChanOpen := <-streamer.errChan: - if isChanOpen { - logrus.Error(err) - logrus.Debug("Exiting the stream because an error from the logs database client was received through the error chan.") - return - } - logrus.Debug("Exiting the stream loop after receiving a close signal from the error chan") - return + found, err := streamerPool.Consume(streaming.StreamerUUID(streamerUUID), func(logline *rpc_api.StarlarkRunResponseLine) error { + err := websocket.JSON.Send(ws, utils.MapPointer(logline, to_http.ToHttpApiStarlarkRunResponseLine)) + if err != nil { + return err } - } - }).ServeHTTP(ctx.Response(), ctx.Request()) - return nil -} - -func (streamer LogStreamer) streamHTTP(ctx echo.Context) error { - defer streamer.close() - - ctx.Response().Header().Set(echo.HeaderContentType, echo.MIMEApplicationJSON) - ctx.Response().WriteHeader(http.StatusOK) - enc := json.NewEncoder(ctx.Response()) + return nil + }) - logrus.Debugf("Starting log stream using HTTP on services: %s", streamer.requestedServiceUuids) - for { - select { - //stream case - case serviceLogsByServiceUuid, isChanOpen := <-streamer.serviceLogsByServiceUuidChan: - //If the channel is closed means that the logs database client won't continue sending streams - if !isChanOpen { - logrus.Debug("Exiting the stream loop after receiving a close signal from the service logs by service UUID channel") - return nil - } + if !found { + websocket.JSON.Send(ws, notFoundErr) + } - getServiceLogsResponse := newLogsResponseHttp(streamer.requestedServiceUuids, serviceLogsByServiceUuid, streamer.notFoundServiceUuids) - if err := enc.Encode(getServiceLogsResponse); err != nil { - return err - } - ctx.Response().Flush() - - //error from logs database case - case err, isChanOpen := <-streamer.errChan: - if isChanOpen { - logrus.Error(err) - logrus.Debug("Exiting the stream because an error from the logs database client was received through the error chan.") - return nil + if err != nil { + logrus.Errorf("Failed to stream all data %s", err) + streamingErr := api_type.ResponseInfo{ + Type: api_type.ERROR, + Message: fmt.Sprintf("Log streaming '%s' failed while sending the data", streamerUUID), + Code: http.StatusInternalServerError, } - logrus.Debug("Exiting the stream loop after receiving a close signal from the error chan") - return nil + websocket.JSON.Send(ws, streamingErr) } - } + }).ServeHTTP(ctx.Response(), ctx.Request()) } -// ============================================================================================================================================= -// ============================================== Helper Functions ============================================================================= -// ============================================================================================================================================= - -func (service *WebSocketRuntime) reportAnyMissingUuidsAndGetNotFoundUuidsListHttp( - ctx context.Context, - enclaveUuid enclave.EnclaveUUID, - requestedServiceUuids map[user_service.ServiceUUID]bool, -) ([]string, error) { - // doesn't matter which logs client is used here - existingServiceUuids, err := service.PerWeekLogsDatabaseClient.FilterExistingServiceUuids(ctx, enclaveUuid, requestedServiceUuids) - if err != nil { - return nil, stacktrace.Propagate(err, "An error occurred retrieving the exhaustive list of service UUIDs from the log client for enclave '%v' and for the requested UUIDs '%+v'", enclaveUuid, requestedServiceUuids) - } - - notFoundServiceUuidsMap := getNotFoundServiceUuidsAndEmptyServiceLogsMap(requestedServiceUuids, existingServiceUuids) - var notFoundServiceUuids []string - for service := range notFoundServiceUuidsMap { - notFoundServiceUuids = append(notFoundServiceUuids, service) +func streamWithHTTP[T any](ctx echo.Context, streamerPool streaming.StreamerPool[T], streamerUUID streaming.StreamerUUID) { + notFoundErr := api_type.ResponseInfo{ + Type: api_type.INFO, + Message: fmt.Sprintf("Log streaming '%s' not found. Either it has been consumed or has expired.", streamerUUID), + Code: http.StatusNotFound, } - return notFoundServiceUuids, nil -} - -// If the enclave was created prior to log retention, return the per file logs client -func (service *WebSocketRuntime) getLogsDatabaseClient(enclaveCreationTime time.Time) centralized_logs.LogsDatabaseClient { - if enclaveCreationTime.After(logRetentionFeatureReleaseTime) { - return service.PerWeekLogsDatabaseClient - } else { - return service.PerFileLogsDatabaseClient + inPool := streamerPool.Contains(streamerUUID) + if !inPool { + replyWithResponseInfo(ctx, notFoundErr) } -} -func (service *WebSocketRuntime) getEnclaveCreationTime(ctx context.Context, enclaveUuid enclave.EnclaveUUID) (time.Time, error) { - enclaves, err := service.EnclaveManager.GetEnclaves(ctx) - if err != nil { - return time.Time{}, err - } + ctx.Response().Header().Set(echo.HeaderContentType, echo.MIMEApplicationJSON) + enc := json.NewEncoder(ctx.Response()) + ctx.Response().WriteHeader(http.StatusOK) + found, err := streamerPool.Consume(streaming.StreamerUUID(streamerUUID), func(logline *rpc_api.StarlarkRunResponseLine) error { + if err := enc.Encode(utils.MapPointer(logline, to_http.ToHttpApiStarlarkRunResponseLine)); err != nil { + return err + } + ctx.Response().Flush() + return nil + }) - enclaveObj, found := enclaves[string(enclaveUuid)] if !found { - return time.Time{}, stacktrace.NewError("Engine could not find enclave '%v'", enclaveUuid) + enc.Encode(notFoundErr) } - timestamp := enclaveObj.CreationTime - return timestamp, nil -} - -func fromHttpLogLineFilters( - logLineFilters []api_type.LogLineFilter, -) (logline.ConjunctiveLogLineFilters, error) { - var conjunctiveLogLineFilters logline.ConjunctiveLogLineFilters - - for _, logLineFilter := range logLineFilters { - var filter *logline.LogLineFilter - operator := logLineFilter.Operator - filterTextPattern := logLineFilter.TextPattern - switch operator { - case api_type.DOESCONTAINTEXT: - filter = logline.NewDoesContainTextLogLineFilter(filterTextPattern) - case api_type.DOESNOTCONTAINTEXT: - filter = logline.NewDoesNotContainTextLogLineFilter(filterTextPattern) - case api_type.DOESCONTAINMATCHREGEX: - filter = logline.NewDoesContainMatchRegexLogLineFilter(filterTextPattern) - case api_type.DOESNOTCONTAINMATCHREGEX: - filter = logline.NewDoesNotContainMatchRegexLogLineFilter(filterTextPattern) - default: - return nil, stacktrace.NewError("Unrecognized log line filter operator '%v' in GRPC filter '%v'; this is a bug in Kurtosis", operator, logLineFilter) + if err != nil { + logrus.Errorf("Failed to stream all data %s", err) + streamingErr := api_type.ResponseInfo{ + Type: api_type.ERROR, + Message: fmt.Sprintf("Log streaming '%s' failed while sending the data", streamerUUID), + Code: http.StatusInternalServerError, } - conjunctiveLogLineFilters = append(conjunctiveLogLineFilters, *filter) + enc.Encode(streamingErr) } - - return conjunctiveLogLineFilters, nil } -func newLogsResponseHttp( - requestedServiceUuids []user_service.ServiceUUID, - serviceLogsByServiceUuid map[user_service.ServiceUUID][]logline.LogLine, - initialNotFoundServiceUuids []string, -) *api_type.ServiceLogs { - serviceLogLinesByUuid := make(map[string]api_type.LogLine, len(serviceLogsByServiceUuid)) - notFoundServiceUuids := make([]string, len(initialNotFoundServiceUuids)) - for _, serviceUuid := range requestedServiceUuids { - serviceUuidStr := string(serviceUuid) - isInNotFoundUuidList := slices.Contains(initialNotFoundServiceUuids, serviceUuidStr) - serviceLogLines, found := serviceLogsByServiceUuid[serviceUuid] - // should continue in the not-found-UUID list - if !found && isInNotFoundUuidList { - notFoundServiceUuids = append(notFoundServiceUuids, serviceUuidStr) - } +func streamServiceLogsWithWebsocket(ctx echo.Context, streamer streaming.ServiceLogStreamer) { + websocket.Handler(func(ws *websocket.Conn) { + defer ws.Close() + err := streamer.Consume(func(logline *api_type.ServiceLogs) error { + err := websocket.JSON.Send(ws, logline) + if err != nil { + return err + } + return nil + }) - // there is no new log lines but is a found UUID, so it has to be included in the service logs map - if !found && !isInNotFoundUuidList { - serviceLogLinesByUuid[serviceUuidStr] = api_type.LogLine{ - Line: []string{}, - Timestamp: time.Now(), + if err != nil { + logrus.Errorf("Failed to stream all data %s", err) + streamingErr := api_type.ResponseInfo{ + Type: api_type.ERROR, + Message: fmt.Sprintf("Log streaming failed while sending the data"), + Code: http.StatusInternalServerError, } + websocket.JSON.Send(ws, streamingErr) } - - logLines := newHttpBindingsLogLineFromLogLines(serviceLogLines) - serviceLogLinesByUuid[serviceUuidStr] = logLines - } - - response := &api_type.ServiceLogs{ - NotFoundServiceUuidSet: ¬FoundServiceUuids, - ServiceLogsByServiceUuid: &serviceLogLinesByUuid, - } - return response + }).ServeHTTP(ctx.Response(), ctx.Request()) } -func newHttpBindingsLogLineFromLogLines(logLines []logline.LogLine) api_type.LogLine { - logLinesStr := make([]string, len(logLines)) - var logTimestamp time.Time +func streamServiceLogsWithHTTP(ctx echo.Context, streamer streaming.ServiceLogStreamer) { + ctx.Response().Header().Set(echo.HeaderContentType, echo.MIMEApplicationJSON) + enc := json.NewEncoder(ctx.Response()) + ctx.Response().WriteHeader(http.StatusOK) + err := streamer.Consume(func(logline *api_type.ServiceLogs) error { + if err := enc.Encode(logline); err != nil { + return err + } + ctx.Response().Flush() + return nil + }) - for logLineIndex, logLine := range logLines { - logLinesStr[logLineIndex] = logLine.GetContent() - logTimestamp = logLine.GetTimestamp() + if err != nil { + logrus.Errorf("Failed to stream all data %s", err) + streamingErr := api_type.ResponseInfo{ + Type: api_type.ERROR, + Message: fmt.Sprintf("Log streaming failed while sending the data"), + Code: http.StatusInternalServerError, + } + enc.Encode(streamingErr) } - - return api_type.LogLine{Line: logLinesStr, Timestamp: logTimestamp} - } diff --git a/engine/server/engine/streaming/service_logs.go b/engine/server/engine/streaming/service_logs.go new file mode 100644 index 0000000000..f5b775236f --- /dev/null +++ b/engine/server/engine/streaming/service_logs.go @@ -0,0 +1,218 @@ +package streaming + +import ( + "context" + "time" + + "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/enclave" + user_service "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/service" + "github.com/kurtosis-tech/kurtosis/engine/server/engine/centralized_logs" + "github.com/kurtosis-tech/kurtosis/engine/server/engine/centralized_logs/logline" + "github.com/kurtosis-tech/kurtosis/engine/server/engine/enclave_manager" + "github.com/kurtosis-tech/kurtosis/engine/server/engine/mapping/to_http" + "github.com/kurtosis-tech/kurtosis/engine/server/engine/mapping/to_logline" + "github.com/kurtosis-tech/kurtosis/engine/server/engine/utils" + "github.com/kurtosis-tech/stacktrace" + "github.com/sirupsen/logrus" + + api_type "github.com/kurtosis-tech/kurtosis/api/golang/http_rest/api_types" +) + +var ( + logRetentionFeatureReleaseTime = time.Date(2023, 9, 7, 13, 0, 0, 0, time.UTC) +) + +type ServiceLogStreamer struct { + serviceLogsByServiceUuidChan chan map[user_service.ServiceUUID][]logline.LogLine + errChan chan error + cancelCtxFunc func() + requestedServiceUuids []user_service.ServiceUUID + notFoundServiceUuids []string +} + +func NewServiceLogStreamer( + ctx context.Context, + enclaveManager *enclave_manager.EnclaveManager, + enclaveIdentifier api_type.EnclaveIdentifier, + perWeekLogsDatabaseClient centralized_logs.LogsDatabaseClient, + perFileLogsDatabaseClient centralized_logs.LogsDatabaseClient, + serviceUuidList []user_service.ServiceUUID, + maybeShouldFollowLogs *bool, + maybeShouldReturnAllLogs *bool, + maybeNumLogLines *uint32, + maybeFilters *[]api_type.LogLineFilter, +) (*ServiceLogStreamer, error) { + enclaveUuid, err := enclaveManager.GetEnclaveUuidForEnclaveIdentifier(ctx, enclaveIdentifier) + if err != nil { + logrus.Errorf("An error occurred while fetching uuid for enclave '%v'. This could happen if the enclave has been deleted. Treating it as UUID", enclaveIdentifier) + return nil, err + } + + requestedServiceUuids := make(map[user_service.ServiceUUID]bool, len(serviceUuidList)) + shouldFollowLogs := utils.DerefWith(maybeShouldFollowLogs, false) + shouldReturnAllLogs := utils.DerefWith(maybeShouldReturnAllLogs, false) + numLogLines := utils.DerefWith(maybeNumLogLines, 100) + filters := utils.DerefWith(maybeFilters, []api_type.LogLineFilter{}) + + for _, serviceUuidStr := range serviceUuidList { + serviceUuid := user_service.ServiceUUID(serviceUuidStr) + requestedServiceUuids[serviceUuid] = true + } + + if perWeekLogsDatabaseClient == nil || perFileLogsDatabaseClient == nil { + return nil, stacktrace.NewError("It's not possible to return service logs because there is no logs database client; this is bug in Kurtosis") + } + + var ( + serviceLogsByServiceUuidChan chan map[user_service.ServiceUUID][]logline.LogLine + errChan chan error + cancelCtxFunc func() + ) + + notFoundServiceUuids, err := reportAnyMissingUuidsAndGetNotFoundUuidsListHttp(ctx, enclaveUuid, perWeekLogsDatabaseClient, requestedServiceUuids) + if err != nil { + return nil, err + } + + conjunctiveLogLineFilters, err := to_logline.ToLoglineLogLineFilters(filters) + if err != nil { + return nil, err + } + + // get enclave creation time to determine strategy to pull logs + shouldUseLegacyPerFileLogs, err := shouldUseLegacyPerFileLogsDatabaseClient(ctx, enclaveManager, enclaveUuid) + if err != nil { + return nil, err + } + + var logsDatabaseClient centralized_logs.LogsDatabaseClient + if *shouldUseLegacyPerFileLogs { + logsDatabaseClient = perFileLogsDatabaseClient + } else { + logsDatabaseClient = perWeekLogsDatabaseClient + } + + serviceLogsByServiceUuidChan, errChan, cancelCtxFunc, err = logsDatabaseClient.StreamUserServiceLogs( + ctx, + enclaveUuid, + requestedServiceUuids, + conjunctiveLogLineFilters, + shouldFollowLogs, + shouldReturnAllLogs, + uint32(numLogLines)) + if err != nil { + return nil, err + } + + return &ServiceLogStreamer{ + serviceLogsByServiceUuidChan: serviceLogsByServiceUuidChan, + errChan: errChan, + cancelCtxFunc: cancelCtxFunc, + notFoundServiceUuids: notFoundServiceUuids, + requestedServiceUuids: serviceUuidList, + }, nil +} + +func (streamer ServiceLogStreamer) Close() { + streamer.cancelCtxFunc() +} + +func (streamer ServiceLogStreamer) Consume(consumer func(*api_type.ServiceLogs) error) error { + for { + select { + //stream case + case serviceLogsByServiceUuid, isChanOpen := <-streamer.serviceLogsByServiceUuidChan: + //If the channel is closed means that the logs database client won't continue sending streams + if !isChanOpen { + logrus.Debug("Exiting the stream loop after receiving a close signal from the service logs by service UUID channel") + return nil + } + + serviceLogsResponse := to_http.ToHttpServiceLogs(streamer.requestedServiceUuids, serviceLogsByServiceUuid, streamer.notFoundServiceUuids) + err := consumer(serviceLogsResponse) + if err != nil { + return err + } + + //error from logs database case + case err, isChanOpen := <-streamer.errChan: + if isChanOpen { + logrus.Error(err) + logrus.Debug("Exiting the stream because an error from the logs database client was received through the error chan.") + return nil + } + logrus.Debug("Exiting the stream loop after receiving a close signal from the error chan") + return nil + } + } +} + +// ============================================================================================================================================= +// ============================================== Helper Functions ============================================================================= +// ============================================================================================================================================= + +func reportAnyMissingUuidsAndGetNotFoundUuidsListHttp( + ctx context.Context, + enclaveUuid enclave.EnclaveUUID, + perWeekLogsDatabaseClient centralized_logs.LogsDatabaseClient, + requestedServiceUuids map[user_service.ServiceUUID]bool, +) ([]string, error) { + // doesn't matter which logs client is used here + existingServiceUuids, err := perWeekLogsDatabaseClient.FilterExistingServiceUuids(ctx, enclaveUuid, requestedServiceUuids) + if err != nil { + return nil, stacktrace.Propagate(err, "An error occurred retrieving the exhaustive list of service UUIDs from the log client for enclave '%v' and for the requested UUIDs '%+v'", enclaveUuid, requestedServiceUuids) + } + + notFoundServiceUuidsMap := getNotFoundServiceUuidsAndEmptyServiceLogsMap(requestedServiceUuids, existingServiceUuids) + var notFoundServiceUuids []string + for service := range notFoundServiceUuidsMap { + notFoundServiceUuids = append(notFoundServiceUuids, service) + } + return notFoundServiceUuids, nil +} + +// If the enclave was created prior to log retention, return the per file logs client +func shouldUseLegacyPerFileLogsDatabaseClient(ctx context.Context, enclaveManager *enclave_manager.EnclaveManager, enclaveUuid enclave.EnclaveUUID) (*bool, error) { + enclaveCreationTime, err := getEnclaveCreationTime(ctx, enclaveManager, enclaveUuid) + if err != nil { + return nil, err + } + if enclaveCreationTime.After(logRetentionFeatureReleaseTime) { + yes := true + return &yes, nil + } else { + no := false + return &no, nil + } +} + +func getEnclaveCreationTime(ctx context.Context, enclaveManager *enclave_manager.EnclaveManager, enclaveUuid enclave.EnclaveUUID) (time.Time, error) { + enclaves, err := enclaveManager.GetEnclaves(ctx) + if err != nil { + return time.Time{}, err + } + + enclaveObj, found := enclaves[string(enclaveUuid)] + if !found { + return time.Time{}, stacktrace.NewError("Engine could not find enclave '%v'", enclaveUuid) + } + + timestamp := enclaveObj.CreationTime + return timestamp, nil +} + +func getNotFoundServiceUuidsAndEmptyServiceLogsMap( + requestedServiceUuids map[user_service.ServiceUUID]bool, + existingServiceUuids map[user_service.ServiceUUID]bool, +) map[string]bool { + notFoundServiceUuids := map[string]bool{} + + for requestedServiceUuid := range requestedServiceUuids { + if _, found := existingServiceUuids[requestedServiceUuid]; !found { + requestedServiceUuidStr := string(requestedServiceUuid) + notFoundServiceUuids[requestedServiceUuidStr] = true + } + } + + return notFoundServiceUuids +} diff --git a/engine/server/engine/streaming/starlark_logs.go b/engine/server/engine/streaming/starlark_logs.go index dccb576efe..c1057ba12e 100644 --- a/engine/server/engine/streaming/starlark_logs.go +++ b/engine/server/engine/streaming/starlark_logs.go @@ -65,7 +65,6 @@ func (async *asyncStarlarkLogs) AttachStream(stream grpc.ClientStream) { logrus.Debugf("Resources have been closed before consuming all the upstream data") return case async.starlarkRunResponseLineChan <- responseLine: - println("> next ") } } } diff --git a/engine/server/engine/streaming/streaming_pool_manager.go b/engine/server/engine/streaming/streaming_pool_manager.go index a332700d58..d3c7f1f0f7 100644 --- a/engine/server/engine/streaming/streaming_pool_manager.go +++ b/engine/server/engine/streaming/streaming_pool_manager.go @@ -19,7 +19,7 @@ type Streamer[T any] interface { } type StreamerPool[T any] struct { - pool expirable.LRU[StreamerUUID, *asyncStarlarkLogs] + pool *expirable.LRU[StreamerUUID, *asyncStarlarkLogs] } type StreamerUUID string @@ -42,10 +42,14 @@ func NewStreamerPool[T any](pool_size uint, expires_after time.Duration) Streame ) return StreamerPool[T]{ - pool: *pool, + pool: pool, } } +func (streamerPool StreamerPool[T]) Contains(uuid StreamerUUID) bool { + return streamerPool.pool.Contains(uuid) +} + func (streamerPool StreamerPool[T]) Add(streamer *asyncStarlarkLogs) StreamerUUID { id := uuid.New() id_str := StreamerUUID(id.String()) @@ -59,6 +63,8 @@ func (streamerPool StreamerPool[T]) Consume(uuid StreamerUUID, consumer func(*ku return false, nil } + // Mark for consumption so it doesn't get evicted (closed) when removed from + // from the LRU cache. It'll be closed after the consumption is done (see below) streamer.MarkForConsumption() removed := streamerPool.pool.Remove(uuid) From e9e3289922c1028fc60ca5fbf07cc604e8475c0b Mon Sep 17 00:00:00 2001 From: lostbean Date: Fri, 1 Dec 2023 16:15:27 -0300 Subject: [PATCH 69/95] add missing Error conversion --- engine/server/engine/main.go | 2 +- .../engine/mapping/to_http/starlark_logs.go | 30 +++++++++++++++++-- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/engine/server/engine/main.go b/engine/server/engine/main.go index 08badbfcc5..3a254a1e41 100644 --- a/engine/server/engine/main.go +++ b/engine/server/engine/main.go @@ -441,7 +441,7 @@ func restApiServer( // Use our validation middleware to check all requests against the // e.Use(middleware.OapiRequestValidator(swagger_enclave)) - enclaveRuntime, err := restApi.NewEnclaveRuntime(ctx, *enclave_manager, asyncStarlarkLogs, true) + enclaveRuntime, err := restApi.NewEnclaveRuntime(ctx, *enclave_manager, asyncStarlarkLogs, false) if err != nil { // TODO(edgar) fix error handling } diff --git a/engine/server/engine/mapping/to_http/starlark_logs.go b/engine/server/engine/mapping/to_http/starlark_logs.go index 976ebc1b12..be6cb1c0a0 100644 --- a/engine/server/engine/mapping/to_http/starlark_logs.go +++ b/engine/server/engine/mapping/to_http/starlark_logs.go @@ -54,11 +54,37 @@ func ToHttpApiStarlarkRunResponseLine(line rpc_api.StarlarkRunResponseLine) api_ } func ToHttpStarlarkError(rpc_value rpc_api.StarlarkError) api_type.StarlarkError { - return api_type.StarlarkError{ - // Error: rpc_value.Error, + var http_type api_type.StarlarkError + if runError := rpc_value.GetExecutionError(); runError != nil { + http_type.Error.FromStarlarkExecutionError(ToHttpStarlarkExecutionError(*runError)) } + if runError := rpc_value.GetInterpretationError(); runError != nil { + http_type.Error.FromStarlarkInterpretationError(ToHttpStarlarkInterpretationError(*runError)) + } + if runError := rpc_value.GetValidationError(); runError != nil { + http_type.Error.FromStarlarkValidationError(ToHttpStarlarkValidationError(*runError)) + } + return http_type +} + +func ToHttpStarlarkExecutionError(rpc_value rpc_api.StarlarkExecutionError) api_type.StarlarkExecutionError { + var http_type api_type.StarlarkExecutionError + http_type.ExecutionError.ErrorMessage = rpc_value.ErrorMessage + return http_type +} + +func ToHttpStarlarkInterpretationError(rpc_value rpc_api.StarlarkInterpretationError) api_type.StarlarkInterpretationError { + var http_type api_type.StarlarkInterpretationError + http_type.InterpretationError.ErrorMessage = rpc_value.ErrorMessage + return http_type +} +func ToHttpStarlarkValidationError(rpc_value rpc_api.StarlarkValidationError) api_type.StarlarkValidationError { + var http_type api_type.StarlarkValidationError + http_type.ValidationError.ErrorMessage = rpc_value.ErrorMessage + return http_type } + func ToHttpStarlarkInfo(rpc_value rpc_api.StarlarkInfo) api_type.StarlarkInfo { var info api_type.StarlarkInfo info.Info.Instruction.InfoMessage = "" From b0813988c587e7b9fe30a0e67157811147c098a9 Mon Sep 17 00:00:00 2001 From: lostbean Date: Fri, 1 Dec 2023 17:00:51 -0300 Subject: [PATCH 70/95] return after reply --- .../engine/server/websocket_api_handler.go | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/engine/server/engine/server/websocket_api_handler.go b/engine/server/engine/server/websocket_api_handler.go index fbf0c03dbb..b1a198089a 100644 --- a/engine/server/engine/server/websocket_api_handler.go +++ b/engine/server/engine/server/websocket_api_handler.go @@ -71,7 +71,7 @@ func (engine WebSocketRuntime) GetEnclavesEnclaveIdentifierLogs(ctx echo.Context Message: "Failed to create log stream", Type: api_type.ERROR, } - replyWithResponseInfo(ctx, errInfo) + writeResponseInfo(ctx, errInfo) return nil } @@ -110,7 +110,7 @@ func (engine WebSocketRuntime) GetEnclavesEnclaveIdentifierServicesServiceIdenti Message: "Failed to create log stream", Type: api_type.ERROR, } - replyWithResponseInfo(ctx, errInfo) + writeResponseInfo(ctx, errInfo) return nil } @@ -131,10 +131,10 @@ func (engine WebSocketRuntime) GetEnclavesEnclaveIdentifierStarlarkExecutionsSta if ctx.IsWebSocket() { logrus.Infof("Starting log stream using Websocket for streamer UUUID: %s", starlarkExecutionUuid) - streamWithWebsocket(ctx, engine.AsyncStarlarkLogs, async_log_uuid) + streamStarlarkLogsWithWebsocket(ctx, engine.AsyncStarlarkLogs, async_log_uuid) } else { logrus.Infof("Starting log stream using plain HTTP for streamer UUUID: %s", starlarkExecutionUuid) - streamWithHTTP(ctx, engine.AsyncStarlarkLogs, async_log_uuid) + streamStarlarkLogsWithHTTP(ctx, engine.AsyncStarlarkLogs, async_log_uuid) } return nil @@ -144,14 +144,14 @@ func (engine WebSocketRuntime) GetEnclavesEnclaveIdentifierStarlarkExecutionsSta // ============================================== Helper Functions ============================================================================= // ============================================================================================================================================= -func replyWithResponseInfo(ctx echo.Context, response api_type.ResponseInfo) { +func writeResponseInfo(ctx echo.Context, response api_type.ResponseInfo) { ctx.Response().Header().Set(echo.HeaderContentType, echo.MIMEApplicationJSON) enc := json.NewEncoder(ctx.Response()) ctx.Response().WriteHeader(int(response.Code)) enc.Encode(response) } -func streamWithWebsocket[T any](ctx echo.Context, streamerPool streaming.StreamerPool[T], streamerUUID streaming.StreamerUUID) { +func streamStarlarkLogsWithWebsocket[T any](ctx echo.Context, streamerPool streaming.StreamerPool[T], streamerUUID streaming.StreamerUUID) { notFoundErr := api_type.ResponseInfo{ Type: api_type.INFO, Message: fmt.Sprintf("Log streaming '%s' not found. Either it has been consumed or has expired.", streamerUUID), @@ -159,7 +159,8 @@ func streamWithWebsocket[T any](ctx echo.Context, streamerPool streaming.Streame } inPool := streamerPool.Contains(streamerUUID) if !inPool { - replyWithResponseInfo(ctx, notFoundErr) + writeResponseInfo(ctx, notFoundErr) + return } websocket.Handler(func(ws *websocket.Conn) { @@ -188,7 +189,7 @@ func streamWithWebsocket[T any](ctx echo.Context, streamerPool streaming.Streame }).ServeHTTP(ctx.Response(), ctx.Request()) } -func streamWithHTTP[T any](ctx echo.Context, streamerPool streaming.StreamerPool[T], streamerUUID streaming.StreamerUUID) { +func streamStarlarkLogsWithHTTP[T any](ctx echo.Context, streamerPool streaming.StreamerPool[T], streamerUUID streaming.StreamerUUID) { notFoundErr := api_type.ResponseInfo{ Type: api_type.INFO, Message: fmt.Sprintf("Log streaming '%s' not found. Either it has been consumed or has expired.", streamerUUID), @@ -196,7 +197,8 @@ func streamWithHTTP[T any](ctx echo.Context, streamerPool streaming.StreamerPool } inPool := streamerPool.Contains(streamerUUID) if !inPool { - replyWithResponseInfo(ctx, notFoundErr) + writeResponseInfo(ctx, notFoundErr) + return } ctx.Response().Header().Set(echo.HeaderContentType, echo.MIMEApplicationJSON) From 82783a96ca8bbb50e1f445bc093546400ea1605b Mon Sep 17 00:00:00 2001 From: lostbean Date: Fri, 1 Dec 2023 21:19:06 -0300 Subject: [PATCH 71/95] fix return values --- .../server/engine/mapping/to_grpc/engine.go | 8 +++ .../server/engine/mapping/to_http/engine.go | 13 ++++ .../engine/mapping/to_http/starlark_logs.go | 70 +++++++++++-------- .../engine/server/enclave_rest_api_handler.go | 8 +-- .../engine/server/websocket_api_handler.go | 4 +- engine/server/engine/utils/list.go | 2 +- 6 files changed, 68 insertions(+), 37 deletions(-) diff --git a/engine/server/engine/mapping/to_grpc/engine.go b/engine/server/engine/mapping/to_grpc/engine.go index 73d5b66a6f..efc5dea116 100644 --- a/engine/server/engine/mapping/to_grpc/engine.go +++ b/engine/server/engine/mapping/to_grpc/engine.go @@ -5,8 +5,13 @@ import ( rpc_api "github.com/kurtosis-tech/kurtosis/api/golang/core/kurtosis_core_rpc_api_bindings" api_type "github.com/kurtosis-tech/kurtosis/api/golang/http_rest/api_types" + "github.com/sirupsen/logrus" ) +func warnUnmatchedValue[T any](value T) { + logrus.Warnf("Unmatched gRPC %T to Http mapping, returning empty value", value) +} + func ToGrpcConnect(conn api_type.Connect) rpc_api.Connect { switch conn { case api_type.CONNECT: @@ -14,6 +19,7 @@ func ToGrpcConnect(conn api_type.Connect) rpc_api.Connect { case api_type.NOCONNECT: return rpc_api.Connect_NO_CONNECT default: + warnUnmatchedValue(conn) panic(fmt.Sprintf("Missing conversion of Connect Enum value: %s", conn)) } } @@ -23,6 +29,7 @@ func ToGrpcFeatureFlag(flag api_type.KurtosisFeatureFlag) rpc_api.KurtosisFeatur case api_type.NOINSTRUCTIONSCACHING: return rpc_api.KurtosisFeatureFlag_NO_INSTRUCTIONS_CACHING default: + warnUnmatchedValue(flag) panic(fmt.Sprintf("Missing conversion of Feature Flag Enum value: %s", flag)) } } @@ -34,6 +41,7 @@ func ToGrpcImageDownloadMode(flag api_type.ImageDownloadMode) rpc_api.ImageDownl case api_type.ImageDownloadModeMISSING: return rpc_api.ImageDownloadMode_missing default: + warnUnmatchedValue(flag) panic(fmt.Sprintf("Missing conversion of Image Download Mode Enum value: %s", flag)) } } diff --git a/engine/server/engine/mapping/to_http/engine.go b/engine/server/engine/mapping/to_http/engine.go index c272cf38a4..4a0b0c8f6e 100644 --- a/engine/server/engine/mapping/to_http/engine.go +++ b/engine/server/engine/mapping/to_http/engine.go @@ -5,11 +5,16 @@ import ( "github.com/kurtosis-tech/kurtosis/engine/server/engine/types" "github.com/kurtosis-tech/kurtosis/engine/server/engine/utils" + "github.com/sirupsen/logrus" rpc_api "github.com/kurtosis-tech/kurtosis/api/golang/core/kurtosis_core_rpc_api_bindings" api_type "github.com/kurtosis-tech/kurtosis/api/golang/http_rest/api_types" ) +func warnUnmatchedValue[T any](value T) { + logrus.Warnf("Unmatched gRPC %T to Http mapping, returning empty value", value) +} + func ToHttpEnclaveContainersStatus(status types.EnclaveContainersStatus) api_type.EnclaveContainersStatus { switch status { case types.EnclaveContainersStatus_EMPTY: @@ -19,6 +24,7 @@ func ToHttpEnclaveContainersStatus(status types.EnclaveContainersStatus) api_typ case types.EnclaveContainersStatus_RUNNING: return api_type.EnclaveContainersStatusRUNNING default: + warnUnmatchedValue(status) panic(fmt.Sprintf("Undefined mapping of value: %s", status)) } } @@ -32,6 +38,7 @@ func ToHttpApiContainerStatus(status types.ContainerStatus) api_type.ApiContaine case types.ContainerStatus_RUNNING: return api_type.ApiContainerStatusRUNNING default: + warnUnmatchedValue(status) panic(fmt.Sprintf("Undefined mapping of value: %s", status)) } } @@ -61,6 +68,7 @@ func ToHttpEnclaveMode(mode types.EnclaveMode) api_type.EnclaveMode { case types.EnclaveMode_TEST: return api_type.TEST default: + warnUnmatchedValue(mode) panic(fmt.Sprintf("Undefined mapping of value: %s", mode)) } } @@ -103,6 +111,7 @@ func ToHttpContainerStatus(status rpc_api.Container_Status) api_type.ContainerSt case rpc_api.Container_UNKNOWN: return api_type.ContainerStatusUNKNOWN default: + warnUnmatchedValue(status) panic(fmt.Sprintf("Missing conversion of Container Status Enum value: %s", status)) } } @@ -116,6 +125,7 @@ func ToHttpTransportProtocol(protocol rpc_api.Port_TransportProtocol) api_type.T case rpc_api.Port_SCTP: return api_type.SCTP default: + warnUnmatchedValue(protocol) panic(fmt.Sprintf("Missing conversion of Transport Protocol Enum value: %s", protocol)) } } @@ -129,6 +139,7 @@ func ToHttpServiceStatus(status rpc_api.ServiceStatus) api_type.ServiceStatus { case rpc_api.ServiceStatus_UNKNOWN: return api_type.ServiceStatusUNKNOWN default: + warnUnmatchedValue(status) panic(fmt.Sprintf("Missing conversion of Service Status Enum value: %s", status)) } } @@ -177,6 +188,7 @@ func ToHttpFeatureFlag(flag rpc_api.KurtosisFeatureFlag) api_type.KurtosisFeatur case rpc_api.KurtosisFeatureFlag_NO_INSTRUCTIONS_CACHING: return api_type.NOINSTRUCTIONSCACHING default: + warnUnmatchedValue(flag) panic(fmt.Sprintf("Missing conversion of Feature Flag Enum value: %s", flag)) } } @@ -188,6 +200,7 @@ func ToHttpRestartPolicy(policy rpc_api.RestartPolicy) api_type.RestartPolicy { case rpc_api.RestartPolicy_NEVER: return api_type.RestartPolicyNEVER default: + warnUnmatchedValue(policy) panic(fmt.Sprintf("Missing conversion of Restart Policy Enum value: %s", policy)) } } diff --git a/engine/server/engine/mapping/to_http/starlark_logs.go b/engine/server/engine/mapping/to_http/starlark_logs.go index be6cb1c0a0..9449300023 100644 --- a/engine/server/engine/mapping/to_http/starlark_logs.go +++ b/engine/server/engine/mapping/to_http/starlark_logs.go @@ -1,70 +1,84 @@ package to_http import ( + "reflect" + "github.com/kurtosis-tech/kurtosis/engine/server/engine/utils" + "github.com/sirupsen/logrus" rpc_api "github.com/kurtosis-tech/kurtosis/api/golang/core/kurtosis_core_rpc_api_bindings" api_type "github.com/kurtosis-tech/kurtosis/api/golang/http_rest/api_types" ) -func ToHttpApiStarlarkRunResponseLine(line rpc_api.StarlarkRunResponseLine) api_type.StarlarkRunResponseLine { - if runError := line.GetError(); runError != nil { - var http_type api_type.StarlarkRunResponseLine - http_type.FromStarlarkError(ToHttpStarlarkError(*runError)) - return http_type +func ToHttpStarlarkRunResponseLine(rpc_value rpc_api.StarlarkRunResponseLine) *api_type.StarlarkRunResponseLine { + var http_type api_type.StarlarkRunResponseLine + if runError := rpc_value.GetError(); runError != nil { + if value := ToHttpStarlarkError(*runError); value != nil { + http_type.FromStarlarkError(*value) + return &http_type + } + return nil } - if runInfo := line.GetInfo(); runInfo != nil { - var http_type api_type.StarlarkRunResponseLine + if runInfo := rpc_value.GetInfo(); runInfo != nil { http_type.FromStarlarkInfo(ToHttpStarlarkInfo(*runInfo)) - return http_type + return &http_type } - if runInstruction := line.GetInstruction(); runInstruction != nil { - var http_type api_type.StarlarkRunResponseLine + if runInstruction := rpc_value.GetInstruction(); runInstruction != nil { http_type.FromStarlarkInstruction(ToHttpStarlarkInstruction(*runInstruction)) - return http_type + return &http_type } - if runInstructionResult := line.GetInstructionResult(); runInstructionResult != nil { - var http_type api_type.StarlarkRunResponseLine + if runInstructionResult := rpc_value.GetInstructionResult(); runInstructionResult != nil { http_type.FromStarlarkInstructionResult(ToHttpStarlarkInstructionResult(*runInstructionResult)) - return http_type + return &http_type } - if runProgressInfo := line.GetProgressInfo(); runProgressInfo != nil { - var http_type api_type.StarlarkRunResponseLine + if runProgressInfo := rpc_value.GetProgressInfo(); runProgressInfo != nil { http_type.FromStarlarkRunProgress(ToHttpStarlarkProgressInfo(*runProgressInfo)) - return http_type + return &http_type } - if runWarning := line.GetWarning(); runWarning != nil { - var http_type api_type.StarlarkRunResponseLine + if runWarning := rpc_value.GetWarning(); runWarning != nil { http_type.FromStarlarkWarning(ToHttpStarlarkWarning(*runWarning)) - return http_type + return &http_type } - if runFinishedEvent := line.GetRunFinishedEvent(); runFinishedEvent != nil { - var http_type api_type.StarlarkRunResponseLine + if runFinishedEvent := rpc_value.GetRunFinishedEvent(); runFinishedEvent != nil { http_type.FromStarlarkRunFinishedEvent(ToHttpStarlarkRunFinishedEvent(*runFinishedEvent)) - return http_type + return &http_type } - return api_type.StarlarkRunResponseLine{} + logrus.WithFields(logrus.Fields{ + "type": reflect.TypeOf(rpc_value).Name(), + "value": rpc_value.String(), + }).Warnf("Unmatched gRPC to Http mapping, returning empty value") + return nil } -func ToHttpStarlarkError(rpc_value rpc_api.StarlarkError) api_type.StarlarkError { +func ToHttpStarlarkError(rpc_value rpc_api.StarlarkError) *api_type.StarlarkError { var http_type api_type.StarlarkError if runError := rpc_value.GetExecutionError(); runError != nil { http_type.Error.FromStarlarkExecutionError(ToHttpStarlarkExecutionError(*runError)) + return &http_type } + if runError := rpc_value.GetInterpretationError(); runError != nil { http_type.Error.FromStarlarkInterpretationError(ToHttpStarlarkInterpretationError(*runError)) + return &http_type } + if runError := rpc_value.GetValidationError(); runError != nil { http_type.Error.FromStarlarkValidationError(ToHttpStarlarkValidationError(*runError)) + return &http_type } - return http_type + + logrus.WithFields(logrus.Fields{ + "type": reflect.TypeOf(rpc_value).Name(), + "value": rpc_value.String(), + }).Warnf("Unmatched gRPC to Http mapping, returning empty value") + return nil } func ToHttpStarlarkExecutionError(rpc_value rpc_api.StarlarkExecutionError) api_type.StarlarkExecutionError { @@ -120,10 +134,6 @@ func ToHttpStarlarkWarning(rpc_value rpc_api.StarlarkWarning) api_type.StarlarkW return warning } -func ToHttpStarlarkRunResponseLine(rpc_value rpc_api.StarlarkRunResponseLine) api_type.StarlarkRunResponseLine { - return api_type.StarlarkRunResponseLine{} - -} func ToHttpStarlarkRunFinishedEvent(rpc_value rpc_api.StarlarkRunFinishedEvent) api_type.StarlarkRunFinishedEvent { var event api_type.StarlarkRunFinishedEvent event.RunFinishedEvent.IsRunSuccessful = rpc_value.IsRunSuccessful diff --git a/engine/server/engine/server/enclave_rest_api_handler.go b/engine/server/engine/server/enclave_rest_api_handler.go index 36b082b646..bdb1e24cbf 100644 --- a/engine/server/engine/server/enclave_rest_api_handler.go +++ b/engine/server/engine/server/enclave_rest_api_handler.go @@ -602,8 +602,8 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkPackagesPack var sync_logs api_type.StarlarkRunResponse_StarlarkExecutionLogs if !isAsyncRetrieval { - logs := utils.MapList(asyncLogs.WaitAndConsumeAll(), to_http.ToHttpApiStarlarkRunResponseLine) - sync_logs.FromStarlarkRunLogs(logs) + logs := utils.MapList(asyncLogs.WaitAndConsumeAll(), to_http.ToHttpStarlarkRunResponseLine) + sync_logs.FromStarlarkRunLogs(utils.FilterListNils(logs)) } else { async_uuid := manager.asyncStarlarkLogs.Add(&asyncLogs) var async_logs api_type.AsyncStarlarkExecutionLogs @@ -656,9 +656,9 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx asyncLogs := streaming.NewAsyncStarlarkLogs(cancelCtxFunc) go asyncLogs.AttachStream(stream) - logs := utils.MapList(asyncLogs.WaitAndConsumeAll(), to_http.ToHttpApiStarlarkRunResponseLine) + logs := utils.MapList(asyncLogs.WaitAndConsumeAll(), to_http.ToHttpStarlarkRunResponseLine) var sync_logs api_type.StarlarkRunResponse_StarlarkExecutionLogs - sync_logs.FromStarlarkRunLogs(logs) + sync_logs.FromStarlarkRunLogs(utils.FilterListNils(logs)) response := api_type.StarlarkRunResponse{StarlarkExecutionLogs: &sync_logs} return api.PostEnclavesEnclaveIdentifierStarlarkScripts200JSONResponse(response), nil diff --git a/engine/server/engine/server/websocket_api_handler.go b/engine/server/engine/server/websocket_api_handler.go index b1a198089a..61f0b11629 100644 --- a/engine/server/engine/server/websocket_api_handler.go +++ b/engine/server/engine/server/websocket_api_handler.go @@ -166,7 +166,7 @@ func streamStarlarkLogsWithWebsocket[T any](ctx echo.Context, streamerPool strea websocket.Handler(func(ws *websocket.Conn) { defer ws.Close() found, err := streamerPool.Consume(streaming.StreamerUUID(streamerUUID), func(logline *rpc_api.StarlarkRunResponseLine) error { - err := websocket.JSON.Send(ws, utils.MapPointer(logline, to_http.ToHttpApiStarlarkRunResponseLine)) + err := websocket.JSON.Send(ws, utils.MapPointer(logline, to_http.ToHttpStarlarkRunResponseLine)) if err != nil { return err } @@ -205,7 +205,7 @@ func streamStarlarkLogsWithHTTP[T any](ctx echo.Context, streamerPool streaming. enc := json.NewEncoder(ctx.Response()) ctx.Response().WriteHeader(http.StatusOK) found, err := streamerPool.Consume(streaming.StreamerUUID(streamerUUID), func(logline *rpc_api.StarlarkRunResponseLine) error { - if err := enc.Encode(utils.MapPointer(logline, to_http.ToHttpApiStarlarkRunResponseLine)); err != nil { + if err := enc.Encode(utils.MapPointer(logline, to_http.ToHttpStarlarkRunResponseLine)); err != nil { return err } ctx.Response().Flush() diff --git a/engine/server/engine/utils/list.go b/engine/server/engine/utils/list.go index 656f270322..fbadf75387 100644 --- a/engine/server/engine/utils/list.go +++ b/engine/server/engine/utils/list.go @@ -21,7 +21,7 @@ func MapListStopOnError[T, U any](data []T, f func(T) (U, error)) ([]U, error) { } func FilterListNils[T any](data []*T) []T { - filterList := make([]T, len(data)) + filterList := make([]T, 0) for _, elem := range data { if elem != nil { filterList = append(filterList, *elem) From f3cb0c0d363bed2402603420b7e120d146980482 Mon Sep 17 00:00:00 2001 From: lostbean Date: Sat, 2 Dec 2023 13:01:37 -0300 Subject: [PATCH 72/95] remove deprecated field from rest api --- .../http_rest/api_types/api_types.gen.go | 6 - .../core_rest_api/api_container_server.gen.go | 141 ++++----- .../engine_rest_api/engine_server.gen.go | 48 +-- .../websocket_api/websocket_server.gen.go | 87 +++-- api/openapi/specs/kurtosis_api.yaml | 299 +++++++++--------- engine/server/engine/main.go | 2 +- .../engine/server/enclave_rest_api_handler.go | 9 +- .../engine/server/websocket_api_handler.go | 4 +- 8 files changed, 292 insertions(+), 304 deletions(-) diff --git a/api/golang/http_rest/api_types/api_types.gen.go b/api/golang/http_rest/api_types/api_types.gen.go index e530f923b3..df48f9f004 100644 --- a/api/golang/http_rest/api_types/api_types.gen.go +++ b/api/golang/http_rest/api_types/api_types.gen.go @@ -311,9 +311,6 @@ type RunStarlarkPackage struct { // 1 - MISSING ImageDownloadMode *ImageDownloadMode `json:"image_download_mode,omitempty"` - // Local the payload of the local module - Local *[]byte `json:"local,omitempty"` - // MainFunctionName The name of the main function, the default value is "run" MainFunctionName *string `json:"main_function_name,omitempty"` @@ -325,9 +322,6 @@ type RunStarlarkPackage struct { // RelativePathToMainFile The relative main file filepath, the default value is the "main.star" file in the root of a package RelativePathToMainFile *string `json:"relative_path_to_main_file,omitempty"` - - // Remote just a flag to indicate the module must be cloned inside the API - Remote *bool `json:"remote,omitempty"` } // RunStarlarkScript defines model for RunStarlarkScript. diff --git a/api/golang/http_rest/core_rest_api/api_container_server.gen.go b/api/golang/http_rest/core_rest_api/api_container_server.gen.go index 79c65bccba..8814df6e94 100644 --- a/api/golang/http_rest/core_rest_api/api_container_server.gen.go +++ b/api/golang/http_rest/core_rest_api/api_container_server.gen.go @@ -1534,77 +1534,76 @@ func (sh *strictHandler) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx echo.C // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/+x8a2/bOLrwXyH0vkBnFmrcnV0sDvotk6ZtsG1iOM7mHEwKLS09tjmlSS1JJfUU+e8H", - "vEmURcly2qbpwXyZaSxenvuND/k5yfmm5AyYksnLz0mJBd6AAmH+wkKRJc5VRgpgiiwJCP1zATIXpFSE", - "s+RlMl8D8gMRwxtAXKCqIkWSJkQPKLFaJ2miPyUvo2umiYD/VERAkbxUooI0kfkaNlhvpralniaVIGyV", - "3N+nCbCc4lsYBOrq6uxViuSaCwUMCmT/5sIBuERqDcgtFIczssuBYH4qIVdQZAJkyZmELpRnHo6i5IQp", - "JEBVgkmk1kSiW0wrSM0ACeKW5IDuCKVoAWiDxUcoEJYI32JC8YIC+gmOVkfoLVDK0TUXtPj5yCP2nwrE", - "NsCsA9gwImulymwDas2LOPffzudTZAegSkKBFEf5GvKPHjxCidoeoVewxBVViEj05nTeB164XQjY/xew", - "TF4m/2/SSOzEfpWTt0qV782U42BHAz1hRBFMswIo3mYbQimRkHNWyDgyrNosQGgRCcdqlO4wUahiilAE", - "nyCvFGErw54lEVJZKuSY0h68BgAJ0VxyscHKjFd/+yVJPUMIU7ACYXAqcf4Rr7RsxnFw31Eju0itsarl", - "x4IPPRoarH6YxJtlegBSa691Xpi9kByhM4U2lVTsmUJSYaHhVOuAspJiuT5Cr7lAhEmFWQ7o326ZyRow", - "Vet/9xDdYTYINRcqs1zvAZ4L5cUiKtk9ZAzWHaLjGIbr2SBVtuDFtteMBIqjVUyC0uBOLy7naWBRaiGQ", - "wIwJ0VP1up4/IWbIbdynqy24hsksQAkCEaV7jz8FSldrEcJKwaZU0oquQcCA7oTXaeKK3Go1rEqEWeEM", - "qP4BMwRCcNELuIXmcEaYeaOsyfmwJVmAugNgqAFlANCvYTXsUreQUb6SGZZblkdlaYmphBQtKM8/GqFC", - "3lE4mmvu6DUQFtB4oJZ910I+iFEbjIjoLDingJmB3On63jDEm5bA7jmhzjlTmDBvCO1Pm42WGbnmFS1C", - "s4gIi6t0BI5DLGSjyL/ywunCklC4KinHxa9OtzWowJT+56aiipRYqInm7/MCK7NuhO0LwrAhcmdPu6vl", - "n9nxnKuLjzsb4bKkJMealJPfpabn55Ged+aWPmNLblHcCcSYDzecPhp+2sl67WPN/0uFBcXi46l1q5y9", - "46uIQl1JQMQYNSM1a8EZryTdIi9SNpryi1gZvSUYXcNC8vwjKKlDQCPSUgnAG02jNCkFL0EoxxGzdiYd", - "SFm9nJHXLlA1zCbGPAy4zt6RXU0k3WNRveD91jvxQy0RfPE75KozcRjb7vQ0OeGM6X92KPECPUcnF+fn", - "pydzNJmgX0EqBMul9p7GhS65uMOiIGx1w/6KnqPziywYPm0PQQWR2qroGARYtdGwutFJm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V7Kgo2G1+TO2DlU0Ku2x77DvMqUX+ctW9JS+2piv+sFLv+", + "SkdAXvbe6Xi6bLv9NsePJc3+aUk5+lJ7j+5hhPeeMwg6uDfmBTD75lcl7OaFttaTleUzYHF5+5foNF7w", + "Yr1B2M7y1Im/huUsXxCYcqHsW2unzUf5vpeOHJ5VfxtwwPD6k5hDVsdqM2Rcz4uUA2b7d+uGD33kRu33", + "SgdtWXuZsMvVBdX4G2ni8KzUdUh0quU7UIhiqarrjKJgx+mU3+I5BJFDumEatavnZoAdjCN3r0MOOerc", + "v4l6ghYbIpFUkNtbbdbB+XcP6q8kpJg1His0j6UGXqM4LuJoTpbP/IC0Q3G/H89HX6pbPQ8DYseaBNjv", + "iNs7+IUE8UKiJWwwXf0+Hrr/j58qXKzdaxrsE5rPgH6r6DKgHU98ahNqIn22hsxCJL+zGM8dFE8jvN9J", + "HN2DGX9IY0ga7UVbO3RNGIxcm5v+pRTWsuFax13hV1Cr4Ovh4f8DAAD//++l68PxYAAA", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/api/golang/http_rest/engine_rest_api/engine_server.gen.go b/api/golang/http_rest/engine_rest_api/engine_server.gen.go index bdaa80f92e..00991f40d6 100644 --- a/api/golang/http_rest/engine_rest_api/engine_server.gen.go +++ b/api/golang/http_rest/engine_rest_api/engine_server.gen.go @@ -750,30 +750,30 @@ func (sh *strictHandler) GetEngineInfo(ctx echo.Context) error { // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/9RYW2/bthf/KgL//0c1yto3v2WN1xpDHMN2sA1FIDDisc1WIlWSymoY/u4DKepmUYrk", - "Jgb6psvhufzOnQcU8STlDJiSaHJAKRY4AQXCvAGLYvwMISXAFN1QEPorARkJmirKGZqgh4fZre/JHRcK", - "GBAvf+fCYzgBj288tQPPMkI+ovpMitUO+UhToIlLio8EfM+oAIImSmTgIxntIMFavNqn+pRUgrItOh41", - "bcKfIcRx3FZvtvEMAy8n8nAcF9rI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ufj+XFH/JGpj1r36WN1e9y4W4JXxvbHegPfYvh86Da/RLftH", + "F23H9VRX8b5EiZVK8ENfbD5fYi+Kya9aBGr12DNyXxKnARaKbnFkLldHUAcxj3D8bkv1cDPqoB4xFLzk", + "pATxRCNNZ5/OEm4Mr2Px+No8AsL/ZTHHZBCzmO+GAV/YPoo4iDhjEOUxOOZc3jAO4w692Cu9HHQ+JJiR", + "V+AEjKSc6sQ6moslliWPxqNPmMb4kcZUvYLJI3yqsIix+DaKOEhx9A3vQL7sVHC0TyElp3Es8no2WK5d", + "cEeX+nVxNfBLFPz25c/lir812SsvU140kr+5A15/3HfdpQwf+t/eOetBzsmzSL8ExWVBd7KUl0BvGtKl", + "lIuOMFpq7wRTliD4AVGm9dGl134My4/m+rGqv6fTfwEAAP//IO+1sjweAAA=", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/api/golang/http_rest/websocket_api/websocket_server.gen.go b/api/golang/http_rest/websocket_api/websocket_server.gen.go index 47261a4eae..4738ae0c61 100644 --- a/api/golang/http_rest/websocket_api/websocket_server.gen.go +++ b/api/golang/http_rest/websocket_api/websocket_server.gen.go @@ -21,15 +21,15 @@ import ( // ServerInterface represents all server handlers. type ServerInterface interface { - // Get Service Logs + // Get enclave logs // (GET /enclaves/{enclave_identifier}/logs) GetEnclavesEnclaveIdentifierLogs(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, params GetEnclavesEnclaveIdentifierLogsParams) error - // Get Service Logs + // Get service logs // (GET /enclaves/{enclave_identifier}/services/{service_identifier}/logs) GetEnclavesEnclaveIdentifierServicesServiceIdentifierLogs(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, serviceIdentifier ServiceIdentifier, params GetEnclavesEnclaveIdentifierServicesServiceIdentifierLogsParams) error - - // (GET /enclaves/{enclave_identifier}/starlark/executions/{starlark_execution_uuid}/logs) - GetEnclavesEnclaveIdentifierStarlarkExecutionsStarlarkExecutionUuidLogs(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, starlarkExecutionUuid StarlarkExecutionUuid) error + // Get Starlark execution logs + // (GET /starlark/executions/{starlark_execution_uuid}/logs) + GetStarlarkExecutionsStarlarkExecutionUuidLogs(ctx echo.Context, starlarkExecutionUuid StarlarkExecutionUuid) error } // ServerInterfaceWrapper converts echo contexts to parameters. @@ -144,17 +144,9 @@ func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierServicesServiceIden return err } -// GetEnclavesEnclaveIdentifierStarlarkExecutionsStarlarkExecutionUuidLogs converts echo context to params. -func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierStarlarkExecutionsStarlarkExecutionUuidLogs(ctx echo.Context) error { +// GetStarlarkExecutionsStarlarkExecutionUuidLogs converts echo context to params. +func (w *ServerInterfaceWrapper) GetStarlarkExecutionsStarlarkExecutionUuidLogs(ctx echo.Context) error { var err error - // ------------- Path parameter "enclave_identifier" ------------- - var enclaveIdentifier EnclaveIdentifier - - err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) - if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter enclave_identifier: %s", err)) - } - // ------------- Path parameter "starlark_execution_uuid" ------------- var starlarkExecutionUuid StarlarkExecutionUuid @@ -164,7 +156,7 @@ func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierStarlarkExecutionsS } // Invoke the callback with all the unmarshalled arguments - err = w.Handler.GetEnclavesEnclaveIdentifierStarlarkExecutionsStarlarkExecutionUuidLogs(ctx, enclaveIdentifier, starlarkExecutionUuid) + err = w.Handler.GetStarlarkExecutionsStarlarkExecutionUuidLogs(ctx, starlarkExecutionUuid) return err } @@ -198,42 +190,45 @@ func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL router.GET(baseURL+"/enclaves/:enclave_identifier/logs", wrapper.GetEnclavesEnclaveIdentifierLogs) router.GET(baseURL+"/enclaves/:enclave_identifier/services/:service_identifier/logs", wrapper.GetEnclavesEnclaveIdentifierServicesServiceIdentifierLogs) - router.GET(baseURL+"/enclaves/:enclave_identifier/starlark/executions/:starlark_execution_uuid/logs", wrapper.GetEnclavesEnclaveIdentifierStarlarkExecutionsStarlarkExecutionUuidLogs) + router.GET(baseURL+"/starlark/executions/:starlark_execution_uuid/logs", wrapper.GetStarlarkExecutionsStarlarkExecutionUuidLogs) } // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/+xZW2/bthf/KgL/f2AvapS1b34LWrczlsWB464FikCgpSObjUQqvLjNDH/3gSIl60LJ", - "Uhqse9hTYulcf+fCo8MDiliWMwpUCjQ7oBxznIEEXvyKGP2qaCTJHsKEpOVjQtEMPSrgT8hHFGeAZk5S", - "H4loBxkueCRkBfP/OSRohv4XnBQHhkwE12x7TSi8L/jR0UfyKdfCMef4CR2PPgIapXgPIYmBSpIQ4Fpm", - "DCLiJJeEacs+fly88z2xY1wChdgzvxn3tKkeSzy5A88KQr7xJsdyd3LGocVHHB4V4RCjmeQK6r5ZK4Xk", - "hG4LMxOWpuxbmLJtL2B1EoewDWMpYFpIoyrTdGFKKPTKaxI5JBIqYathPWpfpOI0xGk6aGOb7IydAvie", - "RMPBWe/As3Teia6MSsSoxIQC9+QOS/soyzCNdTxVGnsb8OA7REpC7BHqDp/DjmnhKwUoReJQgOzDp0M3", - "pKaqgJY+R5YLiXmK+UNoXCWMFircaCpKHlUDTMk8yXH0YBK9FKExxt6dFe0ZMboschw94G1PKfSZMgXQ", - "IuFEzqgw6XvD5PLB9hcJtIAX53lKIqwVBF+Fdu5QkzjUNFZW9IImzChrtQMK33OIdMIA58wUgGXWsm3T", - "KbofZzlwSYyZqX06NnA+kiQDIXGWn7N5XREacEokvxildUn3lRq2+QqR1HqafbJjuP4fS8ZHtttlSa49", - "gO8yzLGUwKm7NurGVopajAM2L2u2AVWZFvNuOb8L3y5v1leLm3A9/7xGvnl2s1w7n5fP/rhav/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Xkx3fw+w1kHatU+u1ft2UpT8wlD+Al5eYx7xk41LCHHzL77p1EoNddkOXtYkdv7", + "OQ3oDpSu6u766h9X11aXLECwgtMb+vPV9dU1DcqhWBmE0M2G7cMhOD6GW65RKh6zrP/meThOPkyhCZlC", + "nrIY9WXUYSZjlv1kG5wLGRXkEuElnO4LXofPw+Hrhc6Gz/W/ry0jTOQ3kUmWTBJWD8Y31XSjC9HvAOsr", + "BGIJr8hqyzUBkRSSCyQxE0SjApaXQ1hLQtZ7Ahy3oIhGa57YfBaMfIS1lvETIImlEFBiIvmbgljmOYgE", + "kr8TqUgGGxbvyW+r1b2Ty8XmigZuBMelmCeVWTPnlPs7bzx6X03w2zc8J86QI0nouQk5BaAtrsF0aAJP", + "+z5kArnvvmkCW/9GYwJL92Ll8NgbZr+5vn61UXZ7+OaZZD80jSCpTaAlUcrcd4NPeGNtWM3dy/G3yXOm", + "9p5EtjjKbOJ/ok2e0XKmdKZcagSYVFsNXBxz/jK+Cm33lzG9GJtGJYTuhuoVJNXwocPnQip0vechZDvG", + "M7bmGcdXcPk8stUXdP8nyObKRru/PxTyLuP6E/R+GOi1c/zloOea6WlF6YhDd+GqX8YVPrv/Ip4cLhNR", + "xXWyXjRH0g0XELp22q40MpvpvAUb/2XxGcR56KGJTAkTx4vq4wV2+ZuAb6CAcMGRM4SEGM3FhvyhABWH", + "nbtSYnov4j+uPovVFkj5UEm22LUuf2WgTQ4JkSLbEyliIEwkBL4XXAFhKYJyNEV1ca7IG7KVRun6pYIy", + "00sNl4MjmYiNn8V0cBzc5ejBygfDkxch4qnfAPzPsHDRhUR/bDL84cQ4dnw1oPFVoMOTmmMocjj8NwAA", + "///HXnYVZiUAAA==", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/api/openapi/specs/kurtosis_api.yaml b/api/openapi/specs/kurtosis_api.yaml index edd85e6361..3b238c855c 100644 --- a/api/openapi/specs/kurtosis_api.yaml +++ b/api/openapi/specs/kurtosis_api.yaml @@ -5,13 +5,12 @@ info: version: 0.1.0 paths: - # ========================================================================================================================= # ========================================================================================================================= - # > > > > > > > > > > > > > > > > > > > > > > > > Engine API < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < + # > > > > > > > > > > > > > > > > > > > > > > > > Engine API < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < # ========================================================================================================================= # ========================================================================================================================= - + /engine/info: get: tags: @@ -19,13 +18,13 @@ paths: summary: Get Engine Info responses: default: - $ref: '#/components/responses/NotOk' - '200': + $ref: "#/components/responses/NotOk" + "200": description: Successful response content: application/json: schema: - $ref: '#/components/schemas/EngineInfo' + $ref: "#/components/schemas/EngineInfo" /enclaves: get: @@ -34,16 +33,16 @@ paths: summary: Get Enclaves responses: default: - $ref: '#/components/responses/NotOk' - '200': + $ref: "#/components/responses/NotOk" + "200": description: Successful response content: application/json: schema: type: object additionalProperties: - $ref: '#/components/schemas/EnclaveInfo' - + $ref: "#/components/schemas/EnclaveInfo" + post: tags: - engine @@ -53,34 +52,33 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/CreateEnclave' + $ref: "#/components/schemas/CreateEnclave" responses: - default: - $ref: '#/components/responses/NotOk' - '200': + $ref: "#/components/responses/NotOk" + "200": description: Successful response content: application/json: schema: - $ref: '#/components/schemas/EnclaveInfo' - + $ref: "#/components/schemas/EnclaveInfo" + delete: tags: - engine summary: Delete Enclaves parameters: - - $ref: '#/components/parameters/remove_all' + - $ref: "#/components/parameters/remove_all" responses: default: - $ref: '#/components/responses/NotOk' - '200': + $ref: "#/components/responses/NotOk" + "200": description: Successful response content: application/json: schema: - $ref: '#/components/schemas/DeletionSummary' - + $ref: "#/components/schemas/DeletionSummary" + /enclaves/historical: get: tags: @@ -88,15 +86,15 @@ paths: summary: Get Historical Enclaves responses: default: - $ref: '#/components/responses/NotOk' - '200': + $ref: "#/components/responses/NotOk" + "200": description: Successful response content: application/json: schema: type: array items: - $ref: '#/components/schemas/EnclaveIdentifiers' + $ref: "#/components/schemas/EnclaveIdentifiers" /enclaves/{enclave_identifier}: get: @@ -104,27 +102,27 @@ paths: - engine summary: Get Enclave Info parameters: - - $ref: '#/components/parameters/enclave_identifier' + - $ref: "#/components/parameters/enclave_identifier" responses: default: - $ref: '#/components/responses/NotOk' - '200': + $ref: "#/components/responses/NotOk" + "200": description: Successful response content: application/json: schema: - $ref: '#/components/schemas/EnclaveInfo' + $ref: "#/components/schemas/EnclaveInfo" delete: tags: - engine summary: Destroy Enclave parameters: - - $ref: '#/components/parameters/enclave_identifier' + - $ref: "#/components/parameters/enclave_identifier" responses: default: - $ref: '#/components/responses/NotOk' - '200': + $ref: "#/components/responses/NotOk" + "200": description: Successful response /enclaves/{enclave_identifier}/status: @@ -133,50 +131,50 @@ paths: - engine summary: Get enclave status parameters: - - $ref: '#/components/parameters/enclave_identifier' + - $ref: "#/components/parameters/enclave_identifier" responses: default: - $ref: '#/components/responses/NotOk' - '200': + $ref: "#/components/responses/NotOk" + "200": description: Successful response content: application/json: schema: - $ref: '#/components/schemas/EnclaveContainersStatus' + $ref: "#/components/schemas/EnclaveContainersStatus" post: tags: - engine summary: Set enclave status parameters: - - $ref: '#/components/parameters/enclave_identifier' + - $ref: "#/components/parameters/enclave_identifier" requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/EnclaveTargetStatus' + $ref: "#/components/schemas/EnclaveTargetStatus" responses: default: - $ref: '#/components/responses/NotOk' - '200': + $ref: "#/components/responses/NotOk" + "200": description: Successful response # ========================================================================================================================= # ========================================================================================================================= - # > > > > > > > > > > > > > > > > > > > > > > > > Enclave API < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < + # > > > > > > > > > > > > > > > > > > > > > > > > Enclave API < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < # ========================================================================================================================= # ========================================================================================================================= - + /enclaves/{enclave_identifier}/starlark: get: tags: - enclave description: Get last Starlark run parameters: - - $ref: '#/components/parameters/enclave_identifier' + - $ref: "#/components/parameters/enclave_identifier" responses: default: - $ref: '#/components/responses/NotOk' + $ref: "#/components/responses/NotOk" "200": description: Successful request content: @@ -190,12 +188,12 @@ paths: - enclave description: Uploads a Starlark package. This step is required before the package can be executed with RunStarlarkPackage parameters: - - $ref: '#/components/parameters/enclave_identifier' + - $ref: "#/components/parameters/enclave_identifier" requestBody: $ref: "#/components/requestBodies/fileUploadBody" responses: default: - $ref: '#/components/responses/NotOk' + $ref: "#/components/responses/NotOk" "200": description: Success @@ -205,9 +203,9 @@ paths: - enclave description: Executes a Starlark script on the user's behalf parameters: - - $ref: '#/components/parameters/enclave_identifier' - - $ref: '#/components/parameters/package_id' - - $ref: '#/components/parameters/retrieve_logs_async' + - $ref: "#/components/parameters/enclave_identifier" + - $ref: "#/components/parameters/package_id" + - $ref: "#/components/parameters/retrieve_logs_async" requestBody: content: application/json: @@ -216,7 +214,7 @@ paths: required: true responses: default: - $ref: '#/components/responses/NotOk' + $ref: "#/components/responses/NotOk" "200": description: Successful request content: @@ -230,8 +228,8 @@ paths: - enclave description: Executes a Starlark script on the user's behalf parameters: - - $ref: '#/components/parameters/enclave_identifier' - - $ref: '#/components/parameters/retrieve_logs_async' + - $ref: "#/components/parameters/enclave_identifier" + - $ref: "#/components/parameters/retrieve_logs_async" requestBody: content: application/json: @@ -240,7 +238,7 @@ paths: required: true responses: default: - $ref: '#/components/responses/NotOk' + $ref: "#/components/responses/NotOk" "200": description: Successful request content: @@ -253,11 +251,11 @@ paths: tags: - enclave parameters: - - $ref: '#/components/parameters/enclave_identifier' - - $ref: '#/components/parameters/service_identifier' + - $ref: "#/components/parameters/enclave_identifier" + - $ref: "#/components/parameters/service_identifier" responses: default: - $ref: '#/components/responses/NotOk' + $ref: "#/components/responses/NotOk" "200": description: Successful request content: @@ -271,10 +269,10 @@ paths: - enclave description: Returns information about all existing & historical services parameters: - - $ref: '#/components/parameters/enclave_identifier' + - $ref: "#/components/parameters/enclave_identifier" responses: default: - $ref: '#/components/responses/NotOk' + $ref: "#/components/responses/NotOk" "200": description: Successful request content: @@ -289,7 +287,7 @@ paths: tags: - enclave parameters: - - $ref: '#/components/parameters/enclave_identifier' + - $ref: "#/components/parameters/enclave_identifier" - in: query name: services schema: @@ -299,7 +297,7 @@ paths: description: Select services to get information responses: default: - $ref: '#/components/responses/NotOk' + $ref: "#/components/responses/NotOk" "200": description: Successful request content: @@ -315,8 +313,8 @@ paths: - enclave description: Executes the given command inside a running container parameters: - - $ref: '#/components/parameters/enclave_identifier' - - $ref: '#/components/parameters/service_identifier' + - $ref: "#/components/parameters/enclave_identifier" + - $ref: "#/components/parameters/service_identifier" requestBody: content: application/json: @@ -326,7 +324,7 @@ paths: required: true responses: default: - $ref: '#/components/responses/NotOk' + $ref: "#/components/responses/NotOk" "200": description: Successful request content: @@ -340,16 +338,16 @@ paths: - enclave description: Block until the given HTTP endpoint returns available, calling it through a HTTP request parameters: - - $ref: '#/components/parameters/enclave_identifier' - - $ref: '#/components/parameters/service_identifier' - - $ref: '#/components/parameters/port_number' - - $ref: '#/components/parameters/http_method' - - $ref: '#/components/parameters/path' - - $ref: '#/components/parameters/initial_delay_milliseconds' - - $ref: '#/components/parameters/retries' - - $ref: '#/components/parameters/retries_delay_milliseconds' - - $ref: '#/components/parameters/expected_response' - - $ref: '#/components/parameters/request_body' + - $ref: "#/components/parameters/enclave_identifier" + - $ref: "#/components/parameters/service_identifier" + - $ref: "#/components/parameters/port_number" + - $ref: "#/components/parameters/http_method" + - $ref: "#/components/parameters/path" + - $ref: "#/components/parameters/initial_delay_milliseconds" + - $ref: "#/components/parameters/retries" + - $ref: "#/components/parameters/retries_delay_milliseconds" + - $ref: "#/components/parameters/expected_response" + - $ref: "#/components/parameters/request_body" responses: "200": description: Success @@ -360,10 +358,10 @@ paths: - enclave description: List all files artifacts parameters: - - $ref: '#/components/parameters/enclave_identifier' + - $ref: "#/components/parameters/enclave_identifier" responses: default: - $ref: '#/components/responses/NotOk' + $ref: "#/components/responses/NotOk" "200": description: Successful request content: @@ -378,12 +376,12 @@ paths: tags: - enclave parameters: - - $ref: '#/components/parameters/enclave_identifier' - - $ref: '#/components/parameters/artifact_identifier' + - $ref: "#/components/parameters/enclave_identifier" + - $ref: "#/components/parameters/artifact_identifier" description: Inspect the content of a file artifact responses: default: - $ref: '#/components/responses/NotOk' + $ref: "#/components/responses/NotOk" "200": description: Successful request content: @@ -399,11 +397,11 @@ paths: - enclave description: Downloads a files artifact from the Kurtosis File System parameters: - - $ref: '#/components/parameters/enclave_identifier' - - $ref: '#/components/parameters/artifact_identifier' + - $ref: "#/components/parameters/enclave_identifier" + - $ref: "#/components/parameters/artifact_identifier" responses: default: - $ref: '#/components/responses/NotOk' + $ref: "#/components/responses/NotOk" "200": description: Successful request content: @@ -418,12 +416,12 @@ paths: - enclave description: Uploads a files artifact to the Kurtosis File System parameters: - - $ref: '#/components/parameters/enclave_identifier' + - $ref: "#/components/parameters/enclave_identifier" requestBody: $ref: "#/components/requestBodies/fileUploadBody" responses: default: - $ref: '#/components/responses/NotOk' + $ref: "#/components/responses/NotOk" "200": description: Successful request content: @@ -439,7 +437,7 @@ paths: - enclave description: Tells the API container to download a files artifact from the web to the Kurtosis File System parameters: - - $ref: '#/components/parameters/enclave_identifier' + - $ref: "#/components/parameters/enclave_identifier" requestBody: content: application/json: @@ -449,7 +447,7 @@ paths: required: true responses: default: - $ref: '#/components/responses/NotOk' + $ref: "#/components/responses/NotOk" "200": description: Successful request content: @@ -463,8 +461,8 @@ paths: - enclave description: Tells the API container to copy a files artifact from a service to the Kurtosis File System parameters: - - $ref: '#/components/parameters/enclave_identifier' - - $ref: '#/components/parameters/service_identifier' + - $ref: "#/components/parameters/enclave_identifier" + - $ref: "#/components/parameters/service_identifier" requestBody: content: application/json: @@ -473,7 +471,7 @@ paths: required: true responses: default: - $ref: '#/components/responses/NotOk' + $ref: "#/components/responses/NotOk" "200": description: Successful request content: @@ -487,7 +485,7 @@ paths: - enclave description: User services port forwarding parameters: - - $ref: '#/components/parameters/enclave_identifier' + - $ref: "#/components/parameters/enclave_identifier" requestBody: content: application/json: @@ -496,7 +494,7 @@ paths: required: true responses: default: - $ref: '#/components/responses/NotOk' + $ref: "#/components/responses/NotOk" "200": description: Successful request @@ -510,7 +508,10 @@ paths: get: tags: - streaming - summary: Get Service Logs + summary: Get enclave logs + description: |- + Get enclave logs. This endpoint can stream the logs by either starting + a Websocket connection (recommended) or legacy HTTP streaming. parameters: - $ref: "#/components/parameters/enclave_identifier" - $ref: "#/components/parameters/service_uuid_set" @@ -519,6 +520,8 @@ paths: - $ref: "#/components/parameters/return_all_logs" - $ref: "#/components/parameters/num_log_lines" responses: + default: + $ref: "#/components/responses/NotOk" "200": description: Successful response content: @@ -530,7 +533,10 @@ paths: get: tags: - streaming - summary: Get Service Logs + summary: Get service logs + description: |- + Get service logs. This endpoint can stream the logs by either starting + a Websocket connection (recommended) or legacy HTTP streaming. parameters: - $ref: "#/components/parameters/enclave_identifier" - $ref: "#/components/parameters/service_identifier" @@ -539,6 +545,8 @@ paths: - $ref: "#/components/parameters/return_all_logs" - $ref: "#/components/parameters/num_log_lines" responses: + default: + $ref: "#/components/responses/NotOk" "200": description: Successful response content: @@ -546,17 +554,21 @@ paths: schema: $ref: "#/components/schemas/ServiceLogs" - /enclaves/{enclave_identifier}/starlark/executions/{starlark_execution_uuid}/logs: + /starlark/executions/{starlark_execution_uuid}/logs: get: tags: - streaming - description: Executes a Starlark script on the user's behalf + summary: Get Starlark execution logs + description: |- + Stream the logs of an Starlark execution that were initiated using `retrieve_logs_async`. + The async logs can be consumed only once and expire after consumption or 2 hours after creation. + This endpoint can stream the logs by either starting a Websocket connection (recommended) or + legacy HTTP streaming. parameters: - - $ref: '#/components/parameters/enclave_identifier' - - $ref: '#/components/parameters/starlark_execution_uuid' + - $ref: "#/components/parameters/starlark_execution_uuid" responses: default: - $ref: '#/components/responses/NotOk' + $ref: "#/components/responses/NotOk" "200": description: Successful request content: @@ -566,27 +578,23 @@ paths: items: $ref: "#/components/schemas/StarlarkRunResponseLine" - # ========================================================================================================================= # ========================================================================================================================= -# > > > > > > > > > > > > > > > > > > > > > > > > Data Models < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < +# > > > > > > > > > > > > > > > > > > > > > > > > Data Models < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < # ========================================================================================================================= # ========================================================================================================================= components: - responses: - NotOk: description: Unexpected error content: application/json: schema: - $ref: '#/components/schemas/ResponseInfo' + $ref: "#/components/schemas/ResponseInfo" required: true requestBodies: - fileUploadBody: content: multipart/form-data: @@ -595,7 +603,6 @@ components: format: binary parameters: - enclave_identifier: name: enclave_identifier in: path @@ -603,7 +610,7 @@ components: description: UUID, shortened UUID, or name of the enclave schema: type: string - + service_identifier: in: path name: service_identifier @@ -636,7 +643,7 @@ components: description: If false, block http response until all logs are available. Default is true schema: type: boolean - + remove_all: name: remove_all in: query @@ -653,7 +660,7 @@ components: format: int32 description: The port number to check availability required: true - + http_method: in: query name: http_method @@ -670,7 +677,7 @@ components: initial_delay_milliseconds: in: query - name: initial_delay_milliseconds + name: initial_delay_milliseconds description: The number of milliseconds to wait until executing the first HTTP call schema: type: integer @@ -678,7 +685,7 @@ components: retries: in: query - name: retries + name: retries description: Max number of HTTP call attempts that this will execute until giving up and returning an error schema: type: integer @@ -686,26 +693,26 @@ components: retries_delay_milliseconds: in: query - name: retries_delay_milliseconds + name: retries_delay_milliseconds description: Number of milliseconds to wait between retries schema: type: integer format: int32 - + expected_response: in: query - name: expected_response + name: expected_response description: If the endpoint returns this value, the service will be marked as available (e.g. Hello World). schema: type: string - + request_body: in: query - name: request_body + name: request_body description: If the http_method is set to POST, this value will be send as the body of the availability request. schema: type: string - + artifact_identifier: in: path name: artifact_identifier @@ -713,7 +720,7 @@ components: type: string description: The artifact name or uuid required: true - + package_id: in: path name: package_id @@ -753,19 +760,18 @@ components: type: integer schemas: - ResponseType: type: string enum: - ERROR - INFO - - WARNING + - WARNING ResponseInfo: type: object properties: type: - $ref: '#/components/schemas/ResponseType' + $ref: "#/components/schemas/ResponseType" message: type: string code: @@ -795,30 +801,30 @@ components: type: string description: Enclave log level, defaults to INFO mode: - $ref: '#/components/schemas/EnclaveMode' + $ref: "#/components/schemas/EnclaveMode" description: Enclave mode, defaults to TEST required: - enclave_name - api_container_version_tag - + EnclaveMode: type: string enum: - TEST - PRODUCTION - + EnclaveContainersStatus: type: string enum: - RUNNING - STOPPED - EMPTY - + EnclaveTargetStatus: type: string enum: - STOP - + ApiContainerStatus: type: string enum: @@ -836,17 +842,17 @@ components: shortened_uuid: type: string containers_status: - $ref: '#/components/schemas/EnclaveContainersStatus' + $ref: "#/components/schemas/EnclaveContainersStatus" api_container_status: - $ref: '#/components/schemas/ApiContainerStatus' + $ref: "#/components/schemas/ApiContainerStatus" api_container_info: - $ref: '#/components/schemas/EnclaveAPIContainerInfo' + $ref: "#/components/schemas/EnclaveAPIContainerInfo" api_container_host_machine_info: - $ref: '#/components/schemas/EnclaveAPIContainerHostMachineInfo' + $ref: "#/components/schemas/EnclaveAPIContainerHostMachineInfo" creation_time: - $ref: '#/components/schemas/Timestamp' + $ref: "#/components/schemas/Timestamp" mode: - $ref: '#/components/schemas/EnclaveMode' + $ref: "#/components/schemas/EnclaveMode" required: - enclave_uuid - name @@ -893,7 +899,7 @@ components: type: string shortened_uuid: type: string - required: + required: - enclave_uuid - name - shortened_uuid @@ -905,7 +911,7 @@ components: type: string uuid: type: string - required: + required: - name - uuid @@ -915,7 +921,7 @@ components: removed_enclave_name_and_uuids: type: array items: - $ref: '#/components/schemas/EnclaveNameAndUuid' + $ref: "#/components/schemas/EnclaveNameAndUuid" Timestamp: type: string @@ -1077,13 +1083,6 @@ components: RunStarlarkPackage: type: object properties: - local: - type: string - format: byte - description: the payload of the local module - remote: - type: boolean - description: just a flag to indicate the module must be cloned inside the API params: type: object additionalProperties: true @@ -1137,7 +1136,7 @@ components: Starlark Execution Logs StarlarkRunResponseLine: - oneOf: + oneOf: - $ref: "#/components/schemas/StarlarkInstruction" - $ref: "#/components/schemas/StarlarkError" - $ref: "#/components/schemas/StarlarkRunProgress" @@ -1248,9 +1247,9 @@ components: properties: error: oneOf: - - $ref: "#/components/schemas/StarlarkInterpretationError" - - $ref: "#/components/schemas/StarlarkValidationError" - - $ref: "#/components/schemas/StarlarkExecutionError" + - $ref: "#/components/schemas/StarlarkInterpretationError" + - $ref: "#/components/schemas/StarlarkValidationError" + - $ref: "#/components/schemas/StarlarkExecutionError" required: - error @@ -1334,7 +1333,7 @@ components: AsyncStarlarkExecutionLogs: type: object properties: - async_starlark_execution_logs: + async_starlark_execution_logs: type: object properties: starlark_execution_uuid: @@ -1342,18 +1341,18 @@ components: description: Execution UUID to asynchronously retrieve the execution logs required: - starlark_execution_uuid - description: Use it to asynchronously retrieve the execution logs via Websockets or http streaming + description: Use it to asynchronously retrieve the execution logs via Websockets or http streaming required: - async_starlark_execution_logs StarlarkRunResponse: type: object properties: - starlark_execution_logs: - oneOf: - - $ref: "#/components/schemas/AsyncStarlarkExecutionLogs" - - $ref: "#/components/schemas/StarlarkRunLogs" - + starlark_execution_logs: + oneOf: + - $ref: "#/components/schemas/AsyncStarlarkExecutionLogs" + - $ref: "#/components/schemas/StarlarkRunLogs" + ServiceIdentifiers: type: object properties: diff --git a/engine/server/engine/main.go b/engine/server/engine/main.go index 3a254a1e41..7f0bf4e7f5 100644 --- a/engine/server/engine/main.go +++ b/engine/server/engine/main.go @@ -75,7 +75,7 @@ const ( restAPIPortAddr uint16 = 9779 streamerPoolSize = 1000 - streamerExpirationTime = time.Hour * 24 + streamerExpirationTime = time.Hour * 2 ) // Nil indicates that the KurtosisBackend should not operate in API container mode, which is appropriate here diff --git a/engine/server/engine/server/enclave_rest_api_handler.go b/engine/server/engine/server/enclave_rest_api_handler.go index bdb1e24cbf..0a740e1242 100644 --- a/engine/server/engine/server/enclave_rest_api_handler.go +++ b/engine/server/engine/server/enclave_rest_api_handler.go @@ -558,7 +558,6 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkPackagesPack if responseErr != nil { return api.PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIddefaultJSONResponse{Body: *responseErr, StatusCode: int(responseErr.Code)}, nil } - logrus.Infof("Run Starlark package on enclave %s", enclave_identifier) package_id := request.PackageId flags := utils.MapList(utils.DerefWith(request.Body.ExperimentalFeatures, []api_type.KurtosisFeatureFlag{}), to_grpc.ToGrpcFeatureFlag) @@ -570,11 +569,9 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkPackagesPack } jsonString := string(jsonBlob) - isRemote := utils.DerefWith(request.Body.Remote, false) - logrus.Infof("Executing Starlark package `%s` with remote %t", package_id, isRemote) + logrus.Infof("Executing Starlark package `%s`", package_id) runStarlarkPackageArgs := rpc_api.RunStarlarkPackageArgs{ PackageId: package_id, - StarlarkPackageContent: nil, SerializedParams: &jsonString, DryRun: request.Body.DryRun, Parallelism: request.Body.Parallelism, @@ -585,6 +582,10 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkPackagesPack CloudInstanceId: request.Body.CloudInstanceId, CloudUserId: request.Body.CloudUserId, ImageDownloadMode: utils.MapPointer(request.Body.ImageDownloadMode, to_grpc.ToGrpcImageDownloadMode), + // Deprecated: If the package is local, it should have been uploaded with UploadStarlarkPackage prior to calling + // RunStarlarkPackage. If the package is remote and must be cloned within the APIC, use the standalone boolean flag + // clone_package below + StarlarkPackageContent: nil, } ctxWithCancel, cancelCtxFunc := context.WithCancel(context.Background()) diff --git a/engine/server/engine/server/websocket_api_handler.go b/engine/server/engine/server/websocket_api_handler.go index 61f0b11629..55c4f09dfd 100644 --- a/engine/server/engine/server/websocket_api_handler.go +++ b/engine/server/engine/server/websocket_api_handler.go @@ -125,8 +125,8 @@ func (engine WebSocketRuntime) GetEnclavesEnclaveIdentifierServicesServiceIdenti return nil } -// (GET /enclaves/{enclave_identifier}/starlark/executions/{starlark_execution_uuid}/logs) -func (engine WebSocketRuntime) GetEnclavesEnclaveIdentifierStarlarkExecutionsStarlarkExecutionUuidLogs(ctx echo.Context, enclaveIdentifier api_type.EnclaveIdentifier, starlarkExecutionUuid api_type.StarlarkExecutionUuid) error { +// (GET /starlark/executions/{starlark_execution_uuid}/logs) +func (engine WebSocketRuntime) GetStarlarkExecutionsStarlarkExecutionUuidLogs(ctx echo.Context, starlarkExecutionUuid api_type.StarlarkExecutionUuid) error { async_log_uuid := streaming.StreamerUUID(starlarkExecutionUuid) if ctx.IsWebSocket() { From cfa8a31656a7b4965405ea9455a5e7cc855c32fb Mon Sep 17 00:00:00 2001 From: lostbean Date: Sat, 2 Dec 2023 17:32:51 -0300 Subject: [PATCH 73/95] make improvements to the API names and descriptions --- .../http_rest/api_types/api_types.gen.go | 24 +- .../core_rest_api/api_container_server.gen.go | 208 +++++++++--------- .../engine_rest_api/engine_server.gen.go | 123 ++++++----- .../websocket_api/websocket_server.gen.go | 66 +++--- api/openapi/specs/kurtosis_api.yaml | 71 +++--- .../engine/enclave_manager/enclave_creator.go | 10 +- .../engine/enclave_manager/enclave_manager.go | 16 +- .../enclave_manager/enclave_manager_test.go | 6 +- .../server/engine/mapping/to_http/engine.go | 16 +- .../server/engine_connect_server_service.go | 10 +- .../engine/server/engine_rest_api_handler.go | 10 +- engine/server/engine/types/engine_types.go | 12 +- 12 files changed, 298 insertions(+), 274 deletions(-) diff --git a/api/golang/http_rest/api_types/api_types.gen.go b/api/golang/http_rest/api_types/api_types.gen.go index df48f9f004..398ee2fe01 100644 --- a/api/golang/http_rest/api_types/api_types.gen.go +++ b/api/golang/http_rest/api_types/api_types.gen.go @@ -31,19 +31,19 @@ const ( ContainerStatusUNKNOWN ContainerStatus = "UNKNOWN" ) -// Defines values for EnclaveContainersStatus. -const ( - EnclaveContainersStatusEMPTY EnclaveContainersStatus = "EMPTY" - EnclaveContainersStatusRUNNING EnclaveContainersStatus = "RUNNING" - EnclaveContainersStatusSTOPPED EnclaveContainersStatus = "STOPPED" -) - // Defines values for EnclaveMode. const ( PRODUCTION EnclaveMode = "PRODUCTION" TEST EnclaveMode = "TEST" ) +// Defines values for EnclaveStatus. +const ( + EnclaveStatusEMPTY EnclaveStatus = "EMPTY" + EnclaveStatusRUNNING EnclaveStatus = "RUNNING" + EnclaveStatusSTOPPED EnclaveStatus = "STOPPED" +) + // Defines values for EnclaveTargetStatus. const ( STOP EnclaveTargetStatus = "STOP" @@ -162,9 +162,6 @@ type EnclaveAPIContainerInfo struct { IpInsideEnclave string `json:"ip_inside_enclave"` } -// EnclaveContainersStatus defines model for EnclaveContainersStatus. -type EnclaveContainersStatus string - // EnclaveIdentifiers defines model for EnclaveIdentifiers. type EnclaveIdentifiers struct { EnclaveUuid string `json:"enclave_uuid"` @@ -177,7 +174,7 @@ type EnclaveInfo struct { ApiContainerHostMachineInfo *EnclaveAPIContainerHostMachineInfo `json:"api_container_host_machine_info,omitempty"` ApiContainerInfo *EnclaveAPIContainerInfo `json:"api_container_info,omitempty"` ApiContainerStatus ApiContainerStatus `json:"api_container_status"` - ContainersStatus EnclaveContainersStatus `json:"containers_status"` + ContainersStatus EnclaveStatus `json:"containers_status"` CreationTime Timestamp `json:"creation_time"` EnclaveUuid string `json:"enclave_uuid"` Mode EnclaveMode `json:"mode"` @@ -194,6 +191,9 @@ type EnclaveNameAndUuid struct { Uuid string `json:"uuid"` } +// EnclaveStatus defines model for EnclaveStatus. +type EnclaveStatus string + // EnclaveTargetStatus defines model for EnclaveTargetStatus. type EnclaveTargetStatus string @@ -620,7 +620,7 @@ type NotOk = ResponseInfo // DeleteEnclavesParams defines parameters for DeleteEnclaves. type DeleteEnclavesParams struct { - // RemoveAll If true, remove all enclaves. Default is false + // RemoveAll If true, remove all enclaves. Otherwise only remove stopped enclaves. Default is false RemoveAll *RemoveAll `form:"remove_all,omitempty" json:"remove_all,omitempty"` } diff --git a/api/golang/http_rest/core_rest_api/api_container_server.gen.go b/api/golang/http_rest/core_rest_api/api_container_server.gen.go index 8814df6e94..92780b75dc 100644 --- a/api/golang/http_rest/core_rest_api/api_container_server.gen.go +++ b/api/golang/http_rest/core_rest_api/api_container_server.gen.go @@ -25,52 +25,52 @@ import ( // ServerInterface represents all server handlers. type ServerInterface interface { - + // List all files artifacts // (GET /enclaves/{enclave_identifier}/artifacts) GetEnclavesEnclaveIdentifierArtifacts(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error - + // Uploads local file artifact to the Kurtosis File System // (POST /enclaves/{enclave_identifier}/artifacts/local-file) PostEnclavesEnclaveIdentifierArtifactsLocalFile(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error - + // Add remote file to Kurtosis File System // (POST /enclaves/{enclave_identifier}/artifacts/remote-file) PostEnclavesEnclaveIdentifierArtifactsRemoteFile(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error - + // Add service's file to Kurtosis File System // (POST /enclaves/{enclave_identifier}/artifacts/services/{service_identifier}) PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, serviceIdentifier ServiceIdentifier) error - + // Inspect the content of a file artifact // (GET /enclaves/{enclave_identifier}/artifacts/{artifact_identifier}) GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, artifactIdentifier ArtifactIdentifier) error - + // Downloads a files artifact from the Kurtosis File System // (GET /enclaves/{enclave_identifier}/artifacts/{artifact_identifier}/download) GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownload(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, artifactIdentifier ArtifactIdentifier) error - + // Returns detailed information about alls services within the enclave // (GET /enclaves/{enclave_identifier}/services) GetEnclavesEnclaveIdentifierServices(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, params GetEnclavesEnclaveIdentifierServicesParams) error - + // User services port forwarding // (POST /enclaves/{enclave_identifier}/services/connection) PostEnclavesEnclaveIdentifierServicesConnection(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error - + // Returns information about all existing & historical services // (GET /enclaves/{enclave_identifier}/services/history) GetEnclavesEnclaveIdentifierServicesHistory(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error - + // Returns detailed information about a specific service // (GET /enclaves/{enclave_identifier}/services/{service_identifier}) GetEnclavesEnclaveIdentifierServicesServiceIdentifier(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, serviceIdentifier ServiceIdentifier) error - + // Executes the given command inside a running service's container // (POST /enclaves/{enclave_identifier}/services/{service_identifier}/command) PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, serviceIdentifier ServiceIdentifier) error - + // Check for service availability // (GET /enclaves/{enclave_identifier}/services/{service_identifier}/endpoints/{port_number}/availability) GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, serviceIdentifier ServiceIdentifier, portNumber PortNumber, params GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityParams) error - + // Get last Starlark run // (GET /enclaves/{enclave_identifier}/starlark) GetEnclavesEnclaveIdentifierStarlark(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error - + // Uploads a Starlark package // (POST /enclaves/{enclave_identifier}/starlark/packages) PostEnclavesEnclaveIdentifierStarlarkPackages(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error - + // Executes a Starlark package on the user's behalf // (POST /enclaves/{enclave_identifier}/starlark/packages/{package_id}) PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, packageId PackageId, params PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdParams) error - + // Executes a Starlark script on the user's behalf // (POST /enclaves/{enclave_identifier}/starlark/scripts) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, params PostEnclavesEnclaveIdentifierStarlarkScriptsParams) error } @@ -1008,52 +1008,52 @@ func (response PostEnclavesEnclaveIdentifierStarlarkScriptsdefaultJSONResponse) // StrictServerInterface represents all server handlers. type StrictServerInterface interface { - + // List all files artifacts // (GET /enclaves/{enclave_identifier}/artifacts) GetEnclavesEnclaveIdentifierArtifacts(ctx context.Context, request GetEnclavesEnclaveIdentifierArtifactsRequestObject) (GetEnclavesEnclaveIdentifierArtifactsResponseObject, error) - + // Uploads local file artifact to the Kurtosis File System // (POST /enclaves/{enclave_identifier}/artifacts/local-file) PostEnclavesEnclaveIdentifierArtifactsLocalFile(ctx context.Context, request PostEnclavesEnclaveIdentifierArtifactsLocalFileRequestObject) (PostEnclavesEnclaveIdentifierArtifactsLocalFileResponseObject, error) - + // Add remote file to Kurtosis File System // (POST /enclaves/{enclave_identifier}/artifacts/remote-file) PostEnclavesEnclaveIdentifierArtifactsRemoteFile(ctx context.Context, request PostEnclavesEnclaveIdentifierArtifactsRemoteFileRequestObject) (PostEnclavesEnclaveIdentifierArtifactsRemoteFileResponseObject, error) - + // Add service's file to Kurtosis File System // (POST /enclaves/{enclave_identifier}/artifacts/services/{service_identifier}) PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier(ctx context.Context, request PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierRequestObject) (PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierResponseObject, error) - + // Inspect the content of a file artifact // (GET /enclaves/{enclave_identifier}/artifacts/{artifact_identifier}) GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier(ctx context.Context, request GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierRequestObject) (GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierResponseObject, error) - + // Downloads a files artifact from the Kurtosis File System // (GET /enclaves/{enclave_identifier}/artifacts/{artifact_identifier}/download) GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownload(ctx context.Context, request GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownloadRequestObject) (GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownloadResponseObject, error) - + // Returns detailed information about alls services within the enclave // (GET /enclaves/{enclave_identifier}/services) GetEnclavesEnclaveIdentifierServices(ctx context.Context, request GetEnclavesEnclaveIdentifierServicesRequestObject) (GetEnclavesEnclaveIdentifierServicesResponseObject, error) - + // User services port forwarding // (POST /enclaves/{enclave_identifier}/services/connection) PostEnclavesEnclaveIdentifierServicesConnection(ctx context.Context, request PostEnclavesEnclaveIdentifierServicesConnectionRequestObject) (PostEnclavesEnclaveIdentifierServicesConnectionResponseObject, error) - + // Returns information about all existing & historical services // (GET /enclaves/{enclave_identifier}/services/history) GetEnclavesEnclaveIdentifierServicesHistory(ctx context.Context, request GetEnclavesEnclaveIdentifierServicesHistoryRequestObject) (GetEnclavesEnclaveIdentifierServicesHistoryResponseObject, error) - + // Returns detailed information about a specific service // (GET /enclaves/{enclave_identifier}/services/{service_identifier}) GetEnclavesEnclaveIdentifierServicesServiceIdentifier(ctx context.Context, request GetEnclavesEnclaveIdentifierServicesServiceIdentifierRequestObject) (GetEnclavesEnclaveIdentifierServicesServiceIdentifierResponseObject, error) - + // Executes the given command inside a running service's container // (POST /enclaves/{enclave_identifier}/services/{service_identifier}/command) PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand(ctx context.Context, request PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandRequestObject) (PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandResponseObject, error) - + // Check for service availability // (GET /enclaves/{enclave_identifier}/services/{service_identifier}/endpoints/{port_number}/availability) GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability(ctx context.Context, request GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityRequestObject) (GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityResponseObject, error) - + // Get last Starlark run // (GET /enclaves/{enclave_identifier}/starlark) GetEnclavesEnclaveIdentifierStarlark(ctx context.Context, request GetEnclavesEnclaveIdentifierStarlarkRequestObject) (GetEnclavesEnclaveIdentifierStarlarkResponseObject, error) - + // Uploads a Starlark package // (POST /enclaves/{enclave_identifier}/starlark/packages) PostEnclavesEnclaveIdentifierStarlarkPackages(ctx context.Context, request PostEnclavesEnclaveIdentifierStarlarkPackagesRequestObject) (PostEnclavesEnclaveIdentifierStarlarkPackagesResponseObject, error) - + // Executes a Starlark package on the user's behalf // (POST /enclaves/{enclave_identifier}/starlark/packages/{package_id}) PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId(ctx context.Context, request PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdRequestObject) (PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdResponseObject, error) - + // Executes a Starlark script on the user's behalf // (POST /enclaves/{enclave_identifier}/starlark/scripts) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx context.Context, request PostEnclavesEnclaveIdentifierStarlarkScriptsRequestObject) (PostEnclavesEnclaveIdentifierStarlarkScriptsResponseObject, error) } @@ -1534,76 +1534,80 @@ func (sh *strictHandler) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx echo.C // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/+w8a2/bOLZ/hdC9QGcWatydXSwu+i1Nk9bY1jFsZ3MvJoWWlo5tbmhSS1JJPUX++wVf", - "eliULGfaNF3Ml5nG4uO8Xzzklyjl25wzYEpGr79EORZ4CwqE+QsLRVY4VQnJgCmyIiD0zxnIVJBcEc6i", - "19FiA8gPRAxvAXGBioJkURwRPSDHahPFkf4UvQ6uGUcC/l0QAVn0WokC4kimG9hivZna5XqaVIKwdfTw", - "EEfAUorvoBeoq6vx2xjJDRcKGGTI/s2FA3CF1AaQWygMZ2CXI8H8nEOqIEsEyJwzCW0oxx6OLOeEKSRA", - "FYJJpDZEojtMC4jNAAnijqSA7gmlaAloi8UtZAhLhO8woXhJAf0EJ+sT9B4o5eiaC5r9fOIR+3cBYlfD", - "rAVYPyIbpfJkC2rDszD33y8WU2QHoEJChhRH6QbSWw8eoUTtTtBbWOGCKkQkene+6AKvvl0dsP8WsI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vPyHAIxxjYSd2DbAHsirkqghnvXSR0Au", - "QGqrp81lmEw1c6uXM0nuUWleNSu050AcpzVm7WcdtNiygT5S+4BOglDC4JiWQ49ruahbIvYwDcSt61i7", - "LkGiY0yNzuHhg9kUmH6M+emeU8e57dQCWNcHfR8/EYShD7NZwS4II3ID2fldUBVFoSMQOySB8BitHQVL", - "ZJGmIOWqoAc1supiOOBVWisfpEEA4AMUCLellVWlqhXsg23uOsqJzArmT74+aCULOJDa0Knga50rB5oq", - "3Jck7MnTQghgKpEK8nLI8GamxvTjDmC5Dj31PPkYG9SGu7lkGLSDQtCk1gH+z2o3OQ427vl2wWFhcU8f", - "5NDo1guoDWuH4PHB+YOD8jyrboocG+VXnn9wlH5UTF/XhaFz2q7piN2aZnDoxGts+tKPAHHFNScrvu0n", - "PS0ZvCsHfB+f0tq/T5s8PVow3h/4MBz8/QkHEfBbh+HmAkwPlW+huhB864pCbWCHHbU0G5uCtTReiNSm", - "+R0375aS00IBsiPtTZtapdT+ajcqz9d5Ttz5+uFyWw2AnkYpQ55rWDYoFDItXAC6hiVqtqMNPKM4nn6F", - "oIE65uwDUhz54zV768U3xg2iil62hxrtzqFgvXBxNnW1wvnZYuoLhW+ntSLh4kz/pT9HcaQ/fYpD1wq8", - "H1dEUf3NF/LQ7Hy+QKfTcRRHdyCk2/vkzyevNJw8B4ZzEr2O/nLy6uRVZK9wGQaMXNVd//EQV3+ONkQq", - "LkiK6f6XL+0rkw9Dxow87c3GawjIzQcilbl20uS49vpaaozRGWfR6+gdqHO3l/t/dcJ2WptVv+fa4cqq", - "IaPAXdCHT3vXKn559eqoSxWDYsNwb2e747h17WJexsH+Cpc5+rbHr127lviM7B0RE0ZgHcX86q/DRia2", - "GMrPkWkueukrtDmXAd7aXiKJ8B5zfedvKcuaGGi+kwq2Lb5PuRzA+A8anAtbJf1KEuCv8+y6iVq78TPa", - "u+7z8DuF6DFnR4dkqnSOz1WoBGy5ggNStQBKpW+Cq1//qtn9lsSVjXP3sPwG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gIydGYoKdFPFxIy9GaLPhmPlgI6dTkv+XPbAauc0SQXXPGU", + "06DarYL2ASpRCcykicnra/YZy7mfMfUTbuNIh26JIhvgId2qgxAT3LkRKCuEQUTzpQN8H0+WKYMAxCEe", + "bXjgbX9n12gU3STagJR4BT0mblgsMNdjd9EyC1R7xBayPoTmbkvPlaez2dksiqPx5N1ZFEeXx7NJF1PO", + "wCSSppySdNshBaf/OJ05iSvlqxQA/TGKveAFtyiYD1umNmEWID7lDJK8+twE43INam1C0iplV0WjZnJm", + "ctZcHV2xKjJXWu/VJ/mUTl5QChlaCr4x34+n4xNEeYpptb7iAo7QeImIeiER3vlslibS5OOu2BpfA1oA", + "MFSYEBUyVEitaG3EuoM/ygXhNkWGKdXD2jSyeJhAuRsNh7lB4z1RH4oFWsCSi3r4ZM5XVmxcpgtiTfUi", + "S3ymMJgkdZkKk4yBTa62IcNk1ykkiLuvkYltIgrWP9scaxAVHTsLsgGmME2WVrE3fdE+eQxZhEB8Yn39", + "zBmpZOM0Rt/KbbOm1QcmLFkWLDWaO+xFmAx77QpGz0F+jr3syFwWyWYriURXkSjYVRQib44FphQokZt+", + "Ev91x93r0IDm+qsnULMZnl131V+ZoQwrbLwTjYfn/JK9G7hGAcXnfd5Eu3yJ4omlKKEdhCx9ZLuydjf1", + "f/TsDlLqH6/MQR1pAbqK7CznNAnOjTeLPchBW9XW15WUnxsIg4rwD5H8QyR/fyIpQRBMyW+QJbLk7T2p", + "uNaUkJNzblPJ4zIMCyRHjlkoo0201U45pWCg1semw5jYHqLLaLtrbxffDInvJjUWcLsGw2yXAt8ftfUt", + "4gHsWMbk8htI7F20fQgVmC7Aa+3bdy4dznQtrzgoz2bClPvQOxfkGitISJ7gLOu49xhPkf4IUu5eshIm", + "SQY71Q6dm+hgozdN2YezCQRD9iEvFpSk3RhMzfc6En/ihdJw/6kOuA73BTSxk0gATtd4QeGKTc7mp6/R", + "pb/j1vrfp2KqCeyFQqJgjLBVs7YiI5n+lsGSMC1GW5O0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CuYL5ydTlys8P5lPfaLw7bSWJJyf6L/05yiO", + "9KfPcehZgbfjiiiqv/lEHpqdns+XBUXH03EUR9cgpNv+6M9HrzSoPAeGcxK9jv5y9OroVWRfcZkzGLnE", + "u/7jNq7+HK2JVFxsd3/+3n4yeTtkzMjT3uy6AsM3mhmMLhln0evoPahTt4T7f3VxdlzOjhvPVzssVDVk", + "FHjieft557XEL69eHfRWYpDLFy7ZbBcSt15TnJfurX+ZZW607a1q164lPiP79MO8wCg2G6yPMPpIpDIv", + "eprCZEprsPZgfvVPYSPjVww9y5EpLHrps7M5l4FznXI54GA/6pXe2eTmA52wf4Wz7SZa7aHOaOeVzu09", + "meQuVz77eKa0aU/BNJYW0hWPNWqzfcF2qYI04Oh8KxVs7s1TAjZcQYupdqwEUCp9/Vv95VdN5eMddq9q", + "5m5gsQeFu7DwzAD+iDz8II+5wlY8xFLddrz5HO6+knIHiXgSATjOMmSZ0XK/4o/D8O6SUo6+t98e3t5J", + "BFKebzvYH9ffZj+wADhPWbbqXh5EHuK9swJPNx9VijpDhdumL/nvLiSO7i/k48rJ90Bbkdv7uZP+H0/O", + "qqEOKU/vl9bLDJ7HMx0zmUOqyvfbwFx1aust2MOzzsh7Cg/NQ75C8/fDSzxVoF7a99IHvz5/AjbxFJU9", + "Tt0D6hyX1t0/0JvuO3GQN5cPxSY7pwBUC5aHUGvlFShTsaZP1F/vtns3yAqsgGrZ9y728zOETfV6zmcK", + "lmauq1MGChNq2kuUdEZ4wQsTf8vqOG6IWruS/FrR5h14tfQeU/tm318vHx6Le348qRb6geMY36JguK/1", + "+BGzBFGd8E4/hPseb5WQu7um+eDW+N0k0QIV9M/jp3j5Doo1gm9EmvLgq+LVq1/+huxZkRRTVNOm9zr+", + "rtjwzrzwwwVpjxQcNYzDD2MLkHZ7ybIqJX8M/hilVU+Me9iDFqfUmmn8e0X19T4iAV7Z6STydAF+u3vI", + "03CyLQ4Am2VakWtgZUct9+gE+4cWtSRAVWP/GDztG2nK0fda973bEd5p3uAUY5NGb0y/M9vhrMLJ9KNr", + "Negsm57F5VtnogNVwYvVGmE7y1M6fggNXPZLmHKhbGe542YLwueSt/2z6p0QBwyvNwAdsjpW6yHjevpv", + "Dpjtu/QNH3rHjdrdWQdtWevD2GUygyphR6pPTHPLJS991d1Glw8vtMMDalc6cjfXxk/+EfzbIQVAjfzb", + "k2j096AQxVJVz2RFwe565G6JkXvsIrvvKvxdIm49zz1C8zWRSCrI7VM/a1N9M4h664gUs0YHR9NBNtCi", + "46DLi53J8ge/fu6Q7we66m0fz0Oxxuh79SKq706r3inblDIpQVYr1z+l6gyiPZAMcsq3mzJj3OasN1v/", + "qj1GRL2g9IpZ444wsx0cbftIAa6EyjY++dLRaPGL7Svq2NA3wW60ftTLXbFrgqvek0dobJqwUMlRzqUk", + "C3tFYluvmry36YTLMttVyL9jr5A1F3qbnILyEKo1XDGTtkMlJ6IvgaarX47uJw3u/+On8vVrz+YGG+Fm", + "l9nHCg0CeuaJb/lCNcpPHAa0hQxxm8MsJIgXEi1gjenyvkrDoiMfWU1ohfuHjri7jjh3p/Q0muGZZN01", + "u/mPFnW75QNLun1gb4euCIORK2/Vv5SKoORvHVaEBa6KLW5v/z8AAP//cGremulkAAA=", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/api/golang/http_rest/engine_rest_api/engine_server.gen.go b/api/golang/http_rest/engine_rest_api/engine_server.gen.go index 00991f40d6..2c11fa71d0 100644 --- a/api/golang/http_rest/engine_rest_api/engine_server.gen.go +++ b/api/golang/http_rest/engine_rest_api/engine_server.gen.go @@ -23,22 +23,22 @@ import ( // ServerInterface represents all server handlers. type ServerInterface interface { - // Delete Enclaves + // Delete enclaves // (DELETE /enclaves) DeleteEnclaves(ctx echo.Context, params DeleteEnclavesParams) error - // Get Enclaves + // List enclaves // (GET /enclaves) GetEnclaves(ctx echo.Context) error - // Create Enclave + // Create enclave // (POST /enclaves) PostEnclaves(ctx echo.Context) error - // Get Historical Enclaves - // (GET /enclaves/historical) - GetEnclavesHistorical(ctx echo.Context) error - // Destroy Enclave + // List all enclave identifiers + // (GET /enclaves/history) + GetEnclavesHistory(ctx echo.Context) error + // Destroy enclave // (DELETE /enclaves/{enclave_identifier}) DeleteEnclavesEnclaveIdentifier(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error - // Get Enclave Info + // Get enclave detailed info // (GET /enclaves/{enclave_identifier}) GetEnclavesEnclaveIdentifier(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error // Get enclave status @@ -47,7 +47,7 @@ type ServerInterface interface { // Set enclave status // (POST /enclaves/{enclave_identifier}/status) PostEnclavesEnclaveIdentifierStatus(ctx echo.Context, enclaveIdentifier EnclaveIdentifier) error - // Get Engine Info + // Get engine info // (GET /engine/info) GetEngineInfo(ctx echo.Context) error } @@ -93,12 +93,12 @@ func (w *ServerInterfaceWrapper) PostEnclaves(ctx echo.Context) error { return err } -// GetEnclavesHistorical converts echo context to params. -func (w *ServerInterfaceWrapper) GetEnclavesHistorical(ctx echo.Context) error { +// GetEnclavesHistory converts echo context to params. +func (w *ServerInterfaceWrapper) GetEnclavesHistory(ctx echo.Context) error { var err error // Invoke the callback with all the unmarshalled arguments - err = w.Handler.GetEnclavesHistorical(ctx) + err = w.Handler.GetEnclavesHistory(ctx) return err } @@ -206,7 +206,7 @@ func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL router.DELETE(baseURL+"/enclaves", wrapper.DeleteEnclaves) router.GET(baseURL+"/enclaves", wrapper.GetEnclaves) router.POST(baseURL+"/enclaves", wrapper.PostEnclaves) - router.GET(baseURL+"/enclaves/historical", wrapper.GetEnclavesHistorical) + router.GET(baseURL+"/enclaves/history", wrapper.GetEnclavesHistory) router.DELETE(baseURL+"/enclaves/:enclave_identifier", wrapper.DeleteEnclavesEnclaveIdentifier) router.GET(baseURL+"/enclaves/:enclave_identifier", wrapper.GetEnclavesEnclaveIdentifier) router.GET(baseURL+"/enclaves/:enclave_identifier/status", wrapper.GetEnclavesEnclaveIdentifierStatus) @@ -303,28 +303,28 @@ func (response PostEnclavesdefaultJSONResponse) VisitPostEnclavesResponse(w http return json.NewEncoder(w).Encode(response.Body) } -type GetEnclavesHistoricalRequestObject struct { +type GetEnclavesHistoryRequestObject struct { } -type GetEnclavesHistoricalResponseObject interface { - VisitGetEnclavesHistoricalResponse(w http.ResponseWriter) error +type GetEnclavesHistoryResponseObject interface { + VisitGetEnclavesHistoryResponse(w http.ResponseWriter) error } -type GetEnclavesHistorical200JSONResponse []EnclaveIdentifiers +type GetEnclavesHistory200JSONResponse []EnclaveIdentifiers -func (response GetEnclavesHistorical200JSONResponse) VisitGetEnclavesHistoricalResponse(w http.ResponseWriter) error { +func (response GetEnclavesHistory200JSONResponse) VisitGetEnclavesHistoryResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") w.WriteHeader(200) return json.NewEncoder(w).Encode(response) } -type GetEnclavesHistoricaldefaultJSONResponse struct { +type GetEnclavesHistorydefaultJSONResponse struct { Body ResponseInfo StatusCode int } -func (response GetEnclavesHistoricaldefaultJSONResponse) VisitGetEnclavesHistoricalResponse(w http.ResponseWriter) error { +func (response GetEnclavesHistorydefaultJSONResponse) VisitGetEnclavesHistoryResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") w.WriteHeader(response.StatusCode) @@ -396,7 +396,7 @@ type GetEnclavesEnclaveIdentifierStatusResponseObject interface { VisitGetEnclavesEnclaveIdentifierStatusResponse(w http.ResponseWriter) error } -type GetEnclavesEnclaveIdentifierStatus200JSONResponse EnclaveContainersStatus +type GetEnclavesEnclaveIdentifierStatus200JSONResponse EnclaveStatus func (response GetEnclavesEnclaveIdentifierStatus200JSONResponse) VisitGetEnclavesEnclaveIdentifierStatusResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -476,22 +476,22 @@ func (response GetEngineInfodefaultJSONResponse) VisitGetEngineInfoResponse(w ht // StrictServerInterface represents all server handlers. type StrictServerInterface interface { - // Delete Enclaves + // Delete enclaves // (DELETE /enclaves) DeleteEnclaves(ctx context.Context, request DeleteEnclavesRequestObject) (DeleteEnclavesResponseObject, error) - // Get Enclaves + // List enclaves // (GET /enclaves) GetEnclaves(ctx context.Context, request GetEnclavesRequestObject) (GetEnclavesResponseObject, error) - // Create Enclave + // Create enclave // (POST /enclaves) PostEnclaves(ctx context.Context, request PostEnclavesRequestObject) (PostEnclavesResponseObject, error) - // Get Historical Enclaves - // (GET /enclaves/historical) - GetEnclavesHistorical(ctx context.Context, request GetEnclavesHistoricalRequestObject) (GetEnclavesHistoricalResponseObject, error) - // Destroy Enclave + // List all enclave identifiers + // (GET /enclaves/history) + GetEnclavesHistory(ctx context.Context, request GetEnclavesHistoryRequestObject) (GetEnclavesHistoryResponseObject, error) + // Destroy enclave // (DELETE /enclaves/{enclave_identifier}) DeleteEnclavesEnclaveIdentifier(ctx context.Context, request DeleteEnclavesEnclaveIdentifierRequestObject) (DeleteEnclavesEnclaveIdentifierResponseObject, error) - // Get Enclave Info + // Get enclave detailed info // (GET /enclaves/{enclave_identifier}) GetEnclavesEnclaveIdentifier(ctx context.Context, request GetEnclavesEnclaveIdentifierRequestObject) (GetEnclavesEnclaveIdentifierResponseObject, error) // Get enclave status @@ -500,7 +500,7 @@ type StrictServerInterface interface { // Set enclave status // (POST /enclaves/{enclave_identifier}/status) PostEnclavesEnclaveIdentifierStatus(ctx context.Context, request PostEnclavesEnclaveIdentifierStatusRequestObject) (PostEnclavesEnclaveIdentifierStatusResponseObject, error) - // Get Engine Info + // Get engine info // (GET /engine/info) GetEngineInfo(ctx context.Context, request GetEngineInfoRequestObject) (GetEngineInfoResponseObject, error) } @@ -595,23 +595,23 @@ func (sh *strictHandler) PostEnclaves(ctx echo.Context) error { return nil } -// GetEnclavesHistorical operation middleware -func (sh *strictHandler) GetEnclavesHistorical(ctx echo.Context) error { - var request GetEnclavesHistoricalRequestObject +// GetEnclavesHistory operation middleware +func (sh *strictHandler) GetEnclavesHistory(ctx echo.Context) error { + var request GetEnclavesHistoryRequestObject handler := func(ctx echo.Context, request interface{}) (interface{}, error) { - return sh.ssi.GetEnclavesHistorical(ctx.Request().Context(), request.(GetEnclavesHistoricalRequestObject)) + return sh.ssi.GetEnclavesHistory(ctx.Request().Context(), request.(GetEnclavesHistoryRequestObject)) } for _, middleware := range sh.middlewares { - handler = middleware(handler, "GetEnclavesHistorical") + handler = middleware(handler, "GetEnclavesHistory") } response, err := handler(ctx, request) if err != nil { return err - } else if validResponse, ok := response.(GetEnclavesHistoricalResponseObject); ok { - return validResponse.VisitGetEnclavesHistoricalResponse(ctx.Response()) + } else if validResponse, ok := response.(GetEnclavesHistoryResponseObject); ok { + return validResponse.VisitGetEnclavesHistoryResponse(ctx.Response()) } else if response != nil { return fmt.Errorf("Unexpected response type: %T", response) } @@ -750,30 +750,31 @@ func (sh *strictHandler) GetEngineInfo(ctx echo.Context) error { // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/9RYW2/bthf/KgL//0c1yto3v2WN1xpDbMN2sA1FIDDisc1WIlWSymoY/u4DKepmUYqU", - "Jgb6psvhufzOnUcU8STlDJiSaHJEKRY4AQXCvAGLYvwEISXAFN1SEPorARkJmirKGZqg+/vZre/JPRcK", - "GBAvf+fCYzgBj289tQfPMkI+ovpMitUe+UhToIlLio8EfM+oAIImSmTgIxntIcFavDqk+pRUgrIdOp00", - "bcKfIMRx3FZvtvUMAy8n8nAcF9rIK+8WtjiLlUelt8WxLBX8noE4VBrWBDg0eeQ8BszQKddFppxJMPjN", - "uVp80w8RZwqY0o84TWMaYa1e8FVqHY81lv8XsEUT9L+gckuQ/5XByrKesS3PhZ15gsGPFCIFxAMhuDDY", - "2MOa901KP3KmMGUg1gqrzPo4S9DkC1rdz+ez+Sfko/VmsVxOb5GP5ot5OP17tt5M5xv04J9D76OPArCC", - "qfWujh/BUxCK5vbjlIZRITKM+S6M4QkcXrIcvJjvPEPieyR3jfQU92bzPxbIIb7J/wmEpJyFCu8c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", + "wUyF7e3VFU/jRxvRJ8Ii8sgipl/A5TNiqomMiPx6FrGfkPAr2YB6Hpe/z58CRg/nicga22C9+Vp9ds9f", + "Fvcav0TnL+6rLt/7y/ufZw3krw77yw/7rnub4SP/6wdnOSg4We2YF7+4mOgukfLC6VUTudRy0Sw2Wnvn", + "lrLxwA8IU2OPabj5x6D8aG9Mq657OPwXAAD//xayxLO8HgAA", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/api/golang/http_rest/websocket_api/websocket_server.gen.go b/api/golang/http_rest/websocket_api/websocket_server.gen.go index 4738ae0c61..59527a4f3b 100644 --- a/api/golang/http_rest/websocket_api/websocket_server.gen.go +++ b/api/golang/http_rest/websocket_api/websocket_server.gen.go @@ -21,7 +21,7 @@ import ( // ServerInterface represents all server handlers. type ServerInterface interface { - // Get enclave logs + // Get enclave's services logs // (GET /enclaves/{enclave_identifier}/logs) GetEnclavesEnclaveIdentifierLogs(ctx echo.Context, enclaveIdentifier EnclaveIdentifier, params GetEnclavesEnclaveIdentifierLogsParams) error // Get service logs @@ -197,38 +197,38 @@ func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/+xaX2/bOBL/KgTvHu4AbZTrvuUt2HW7xvXiwHGvC7SBlpZGNhuJVMmhW1/g736gRMn6", - "Q8tyLkBxwD4louY/Z34cDf1MY5kXUoBATW+eacEUywFBlU+xFF+MiJHvIEp5Vi9zQW/oVwNqTwMqWA70", - "xksaUB1vIWclD0JeMv9VQUpv6F/Co+KwItPhe7l5zwW8LfnpIaC4L6xwphTb08MhoCDijO0g4gkI5CkH", - "ZWUmoGPFC+TSWvbhw/zXgOitVAgCElI9S0WsqUSmBLdAnCAaVN4UDLdHZzxaAqrgq+EKEnqDykDbN2el", - "RsXFpjQzlVkmv0WZ3JwMWJvEI2wtZQZMlNKEyS1dlHEBJ+V1iTwSuUDY2LAerC9olIhYlo3a2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HRBJ7udckE8tB11AS24YXHBJb+vcvucTDrfnN5+WqT7u5sLjDofmj7RNKYQCuinPnP", + "ipDw1tq4HstX03FbFMwBWZXnfpP/YvoJ7hCXuRL5RNuUo9X06URhNVImVWELLPv0P4/vDFB+BRQ7KiH2", + "d1mvIKlBEhM/l0qj71J3MdswLtiSC46v4PJpDGyu8hzh/wDI+Qoy/u8PRb/zuP6Pfz8M/7o5/nLQ8233", + "tKL0xLG/mjUv44qf/X8Jz3bniajjOlkv2j3pikuIfePtVlqZ7RzfgU34WvkE4jwM0ETlhMn9lfb+qrv6", + "9cA30EC45MgZQkas4XJF/tCAmsPGXz4xs5XpHxef5WINpHrwzRuTZFn9HsHYAjKipNgSJVMgTGYEvpdc", + "A2E5gvY0ZX3FrskbslZWm+alhirTKw3ngyOZiI2f5XRwHN36mNHKB8uzFyHioV8L/NewcNbVxXDAMv6J", + "xXHs+GrB4KtARyA1j6HIbvefAAAA///VFi5JkCUAAA==", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/api/openapi/specs/kurtosis_api.yaml b/api/openapi/specs/kurtosis_api.yaml index 3b238c855c..9c66c22d14 100644 --- a/api/openapi/specs/kurtosis_api.yaml +++ b/api/openapi/specs/kurtosis_api.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: - title: Kurtosis REST API + title: Kurtosis RESTful API version: 0.1.0 paths: @@ -15,7 +15,7 @@ paths: get: tags: - engine - summary: Get Engine Info + summary: Get engine info responses: default: $ref: "#/components/responses/NotOk" @@ -30,7 +30,7 @@ paths: get: tags: - engine - summary: Get Enclaves + summary: List enclaves responses: default: $ref: "#/components/responses/NotOk" @@ -46,7 +46,7 @@ paths: post: tags: - engine - summary: Create Enclave + summary: Create enclave requestBody: required: true content: @@ -66,7 +66,9 @@ paths: delete: tags: - engine - summary: Delete Enclaves + summary: Delete enclaves + description: |- + Delete stopped enclaves. TO delete all the enclaves use the query parameter `remove_all` parameters: - $ref: "#/components/parameters/remove_all" responses: @@ -79,11 +81,11 @@ paths: schema: $ref: "#/components/schemas/DeletionSummary" - /enclaves/historical: + /enclaves/history: get: tags: - engine - summary: Get Historical Enclaves + summary: List all enclave identifiers responses: default: $ref: "#/components/responses/NotOk" @@ -100,7 +102,7 @@ paths: get: tags: - engine - summary: Get Enclave Info + summary: Get enclave detailed info parameters: - $ref: "#/components/parameters/enclave_identifier" responses: @@ -116,7 +118,7 @@ paths: delete: tags: - engine - summary: Destroy Enclave + summary: Destroy enclave parameters: - $ref: "#/components/parameters/enclave_identifier" responses: @@ -140,7 +142,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/EnclaveContainersStatus" + $ref: "#/components/schemas/EnclaveStatus" post: tags: - engine @@ -169,7 +171,7 @@ paths: get: tags: - enclave - description: Get last Starlark run + summary: Get last Starlark run parameters: - $ref: "#/components/parameters/enclave_identifier" responses: @@ -186,7 +188,9 @@ paths: post: tags: - enclave - description: Uploads a Starlark package. This step is required before the package can be executed with RunStarlarkPackage + summary: Uploads a Starlark package + description: |- + Uploads a Starlark package. This step is required before the package can be executed with RunStarlarkPackage parameters: - $ref: "#/components/parameters/enclave_identifier" requestBody: @@ -201,7 +205,12 @@ paths: post: tags: - enclave - description: Executes a Starlark script on the user's behalf + summary: Executes a Starlark package on the user's behalf + description: |- + The endpoint will trigger the execution and deployment of a Starlark package. By default, it'll + return an async logs resource using `starlark_execution_uuid` that can be used to retrieve the logs + via streaming. It's also possible to block the call and wait for the execution to complete using the + query parameter `retrieve_logs_async`. parameters: - $ref: "#/components/parameters/enclave_identifier" - $ref: "#/components/parameters/package_id" @@ -226,7 +235,12 @@ paths: post: tags: - enclave - description: Executes a Starlark script on the user's behalf + summary: Executes a Starlark script on the user's behalf + description: |- + The endpoint will trigger the execution and deployment of a Starlark file. By default, it'll + return an async logs resource using `starlark_execution_uuid` that can be used to retrieve the logs + via streaming. It's also possible to block the call and wait for the execution to complete using the + query parameter `retrieve_logs_async`. parameters: - $ref: "#/components/parameters/enclave_identifier" - $ref: "#/components/parameters/retrieve_logs_async" @@ -250,6 +264,7 @@ paths: get: tags: - enclave + summary: Returns detailed information about a specific service parameters: - $ref: "#/components/parameters/enclave_identifier" - $ref: "#/components/parameters/service_identifier" @@ -267,7 +282,7 @@ paths: get: tags: - enclave - description: Returns information about all existing & historical services + summary: Returns information about all existing & historical services parameters: - $ref: "#/components/parameters/enclave_identifier" responses: @@ -286,6 +301,7 @@ paths: get: tags: - enclave + summary: Returns detailed information about alls services within the enclave parameters: - $ref: "#/components/parameters/enclave_identifier" - in: query @@ -311,7 +327,7 @@ paths: post: tags: - enclave - description: Executes the given command inside a running container + summary: Executes the given command inside a running service's container parameters: - $ref: "#/components/parameters/enclave_identifier" - $ref: "#/components/parameters/service_identifier" @@ -336,6 +352,7 @@ paths: get: tags: - enclave + summary: Check for service availability description: Block until the given HTTP endpoint returns available, calling it through a HTTP request parameters: - $ref: "#/components/parameters/enclave_identifier" @@ -356,7 +373,7 @@ paths: get: tags: - enclave - description: List all files artifacts + summary: List all files artifacts parameters: - $ref: "#/components/parameters/enclave_identifier" responses: @@ -378,7 +395,7 @@ paths: parameters: - $ref: "#/components/parameters/enclave_identifier" - $ref: "#/components/parameters/artifact_identifier" - description: Inspect the content of a file artifact + summary: Inspect the content of a file artifact responses: default: $ref: "#/components/responses/NotOk" @@ -395,7 +412,7 @@ paths: get: tags: - enclave - description: Downloads a files artifact from the Kurtosis File System + summary: Downloads a files artifact from the Kurtosis File System parameters: - $ref: "#/components/parameters/enclave_identifier" - $ref: "#/components/parameters/artifact_identifier" @@ -414,7 +431,7 @@ paths: post: tags: - enclave - description: Uploads a files artifact to the Kurtosis File System + summary: Uploads local file artifact to the Kurtosis File System parameters: - $ref: "#/components/parameters/enclave_identifier" requestBody: @@ -435,6 +452,7 @@ paths: post: tags: - enclave + summary: Add remote file to Kurtosis File System description: Tells the API container to download a files artifact from the web to the Kurtosis File System parameters: - $ref: "#/components/parameters/enclave_identifier" @@ -459,6 +477,7 @@ paths: post: tags: - enclave + summary: Add service's file to Kurtosis File System description: Tells the API container to copy a files artifact from a service to the Kurtosis File System parameters: - $ref: "#/components/parameters/enclave_identifier" @@ -483,7 +502,7 @@ paths: post: tags: - enclave - description: User services port forwarding + summary: User services port forwarding parameters: - $ref: "#/components/parameters/enclave_identifier" requestBody: @@ -508,9 +527,9 @@ paths: get: tags: - streaming - summary: Get enclave logs + summary: Get enclave's services logs description: |- - Get enclave logs. This endpoint can stream the logs by either starting + Get multiple enclave services logs concurrently. This endpoint can stream the logs by either starting a Websocket connection (recommended) or legacy HTTP streaming. parameters: - $ref: "#/components/parameters/enclave_identifier" @@ -648,7 +667,7 @@ components: name: remove_all in: query required: false - description: If true, remove all enclaves. Default is false + description: If true, remove all enclaves. Otherwise only remove stopped enclaves. Default is false schema: type: boolean @@ -813,7 +832,7 @@ components: - TEST - PRODUCTION - EnclaveContainersStatus: + EnclaveStatus: type: string enum: - RUNNING @@ -842,7 +861,7 @@ components: shortened_uuid: type: string containers_status: - $ref: "#/components/schemas/EnclaveContainersStatus" + $ref: "#/components/schemas/EnclaveStatus" api_container_status: $ref: "#/components/schemas/ApiContainerStatus" api_container_info: diff --git a/engine/server/engine/enclave_manager/enclave_creator.go b/engine/server/engine/enclave_manager/enclave_creator.go index 15eaac9b4b..4cf67ac0a0 100644 --- a/engine/server/engine/enclave_manager/enclave_creator.go +++ b/engine/server/engine/enclave_manager/enclave_creator.go @@ -139,11 +139,11 @@ func (creator *EnclaveCreator) CreateEnclave( } newEnclaveInfo := &types.EnclaveInfo{ - EnclaveUuid: newEnclaveUuidStr, - Name: newEnclave.GetName(), - ShortenedUuid: shortenedUuid, - EnclaveContainersStatus: types.EnclaveContainersStatus_RUNNING, - ApiContainerStatus: types.ContainerStatus_RUNNING, + EnclaveUuid: newEnclaveUuidStr, + Name: newEnclave.GetName(), + ShortenedUuid: shortenedUuid, + EnclaveStatus: types.EnclaveStatus_RUNNING, + ApiContainerStatus: types.ContainerStatus_RUNNING, ApiContainerInfo: &types.EnclaveAPIContainerInfo{ ContainerId: "", IpInsideEnclave: apiContainer.GetPrivateIPAddress().String(), diff --git a/engine/server/engine/enclave_manager/enclave_manager.go b/engine/server/engine/enclave_manager/enclave_manager.go index 332054ccd6..78c2ebc1d1 100644 --- a/engine/server/engine/enclave_manager/enclave_manager.go +++ b/engine/server/engine/enclave_manager/enclave_manager.go @@ -583,9 +583,9 @@ func getEnclaveInfoForEnclave(ctx context.Context, kurtosisBackend backend_inter if err != nil { return nil, stacktrace.Propagate(err, "Expected to be able to get information on the API container of enclave '%v', instead an error occurred.", enclaveUuid) } - enclaveContainersStatus, err := getEnclaveContainersStatusFromEnclaveStatus(enclave.GetStatus()) + enclaveStatus, err := getEnclaveStatusFromEnclaveStatus(enclave.GetStatus()) if err != nil { - return nil, stacktrace.Propagate(err, "Expected to be able to get EnclaveContainersStatus from the enclave status of enclave '%v', but an error occurred", enclaveUuid) + return nil, stacktrace.Propagate(err, "Expected to be able to get EnclaveStatus from the enclave status of enclave '%v', but an error occurred", enclaveUuid) } creationTimestamp, err := getEnclaveCreationTimestamp(enclave) @@ -604,7 +604,7 @@ func getEnclaveInfoForEnclave(ctx context.Context, kurtosisBackend backend_inter EnclaveUuid: enclaveUuidStr, ShortenedUuid: uuid_generator.ShortenedUUIDString(enclaveUuidStr), Name: enclaveName, - EnclaveContainersStatus: enclaveContainersStatus, + EnclaveStatus: enclaveStatus, ApiContainerStatus: apiContainerStatus, ApiContainerInfo: apiContainerInfo, ApiContainerHostMachineInfo: apiContainerHostMachineInfo, @@ -661,16 +661,16 @@ func getFirstApiContainerFromMap(apiContainerMap map[enclave.EnclaveUUID]*api_co return firstApiContainerFound } -func getEnclaveContainersStatusFromEnclaveStatus(status enclave.EnclaveStatus) (types.EnclaveContainersStatus, error) { +func getEnclaveStatusFromEnclaveStatus(status enclave.EnclaveStatus) (types.EnclaveStatus, error) { switch status { case enclave.EnclaveStatus_Empty: - return types.EnclaveContainersStatus_EMPTY, nil + return types.EnclaveStatus_EMPTY, nil case enclave.EnclaveStatus_Stopped: - return types.EnclaveContainersStatus_STOPPED, nil + return types.EnclaveStatus_STOPPED, nil case enclave.EnclaveStatus_Running: - return types.EnclaveContainersStatus_RUNNING, nil + return types.EnclaveStatus_RUNNING, nil default: - // EnclaveContainersStatus is of type string, cannot convert nil to sting returning "" + // EnclaveStatus is of type string, cannot convert nil to sting returning "" return "", stacktrace.NewError("Unrecognized enclave status '%v'; this is a bug in Kurtosis", status.String()) } } diff --git a/engine/server/engine/enclave_manager/enclave_manager_test.go b/engine/server/engine/enclave_manager/enclave_manager_test.go index b360888b1c..8a7f88b558 100644 --- a/engine/server/engine/enclave_manager/enclave_manager_test.go +++ b/engine/server/engine/enclave_manager/enclave_manager_test.go @@ -16,10 +16,10 @@ func TestIsContainerRunningDeterminerCompleteness(t *testing.T) { } } -func TestGetEnclaveContainersStatusFromEnclaveStatusCompleteness(t *testing.T) { +func TestGetEnclaveStatusFromEnclaveStatusCompleteness(t *testing.T) { for _, enclaveStatus := range enclave.EnclaveStatusValues() { - _, err := getEnclaveContainersStatusFromEnclaveStatus(enclaveStatus) - require.NoError(t, err, "No EnclaveContainersStatus provided for enclave status '%v'", enclaveStatus.String()) + _, err := getEnclaveStatusFromEnclaveStatus(enclaveStatus) + require.NoError(t, err, "No EnclaveStatus provided for enclave status '%v'", enclaveStatus.String()) } } diff --git a/engine/server/engine/mapping/to_http/engine.go b/engine/server/engine/mapping/to_http/engine.go index 4a0b0c8f6e..f2b73cd09e 100644 --- a/engine/server/engine/mapping/to_http/engine.go +++ b/engine/server/engine/mapping/to_http/engine.go @@ -15,14 +15,14 @@ func warnUnmatchedValue[T any](value T) { logrus.Warnf("Unmatched gRPC %T to Http mapping, returning empty value", value) } -func ToHttpEnclaveContainersStatus(status types.EnclaveContainersStatus) api_type.EnclaveContainersStatus { +func ToHttpEnclaveStatus(status types.EnclaveStatus) api_type.EnclaveStatus { switch status { - case types.EnclaveContainersStatus_EMPTY: - return api_type.EnclaveContainersStatusEMPTY - case types.EnclaveContainersStatus_STOPPED: - return api_type.EnclaveContainersStatusSTOPPED - case types.EnclaveContainersStatus_RUNNING: - return api_type.EnclaveContainersStatusRUNNING + case types.EnclaveStatus_EMPTY: + return api_type.EnclaveStatusEMPTY + case types.EnclaveStatus_STOPPED: + return api_type.EnclaveStatusSTOPPED + case types.EnclaveStatus_RUNNING: + return api_type.EnclaveStatusRUNNING default: warnUnmatchedValue(status) panic(fmt.Sprintf("Undefined mapping of value: %s", status)) @@ -78,7 +78,7 @@ func ToHttpEnclaveInfo(info types.EnclaveInfo) api_type.EnclaveInfo { EnclaveUuid: info.EnclaveUuid, ShortenedUuid: info.ShortenedUuid, Name: info.Name, - ContainersStatus: ToHttpEnclaveContainersStatus(info.EnclaveContainersStatus), + ContainersStatus: ToHttpEnclaveStatus(info.EnclaveStatus), ApiContainerStatus: ToHttpApiContainerStatus(info.ApiContainerStatus), ApiContainerInfo: utils.MapPointer(info.ApiContainerInfo, ToHttpEnclaveAPIContainerInfo), ApiContainerHostMachineInfo: utils.MapPointer(info.ApiContainerHostMachineInfo, ToHttpApiContainerHostMachineInfo), diff --git a/engine/server/engine/server/engine_connect_server_service.go b/engine/server/engine/server/engine_connect_server_service.go index 83e51b18e2..4f46601f5e 100644 --- a/engine/server/engine/server/engine_connect_server_service.go +++ b/engine/server/engine/server/engine_connect_server_service.go @@ -79,13 +79,13 @@ func NewEngineConnectServerService( return service } -func toGrpcEnclaveContainersStatus(status types.EnclaveContainersStatus) kurtosis_engine_rpc_api_bindings.EnclaveContainersStatus { +func toGrpcEnclaveStatus(status types.EnclaveStatus) kurtosis_engine_rpc_api_bindings.EnclaveContainersStatus { switch status { - case types.EnclaveContainersStatus_EMPTY: + case types.EnclaveStatus_EMPTY: return kurtosis_engine_rpc_api_bindings.EnclaveContainersStatus_EnclaveContainersStatus_EMPTY - case types.EnclaveContainersStatus_STOPPED: + case types.EnclaveStatus_STOPPED: return kurtosis_engine_rpc_api_bindings.EnclaveContainersStatus_EnclaveContainersStatus_STOPPED - case types.EnclaveContainersStatus_RUNNING: + case types.EnclaveStatus_RUNNING: return kurtosis_engine_rpc_api_bindings.EnclaveContainersStatus_EnclaveContainersStatus_RUNNING default: panic(fmt.Sprintf("Undefined mapping of value: %s", status)) @@ -143,7 +143,7 @@ func toGrpcEnclaveInfo(info types.EnclaveInfo) kurtosis_engine_rpc_api_bindings. EnclaveUuid: info.EnclaveUuid, ShortenedUuid: info.ShortenedUuid, Name: info.Name, - ContainersStatus: toGrpcEnclaveContainersStatus(info.EnclaveContainersStatus), + ContainersStatus: toGrpcEnclaveStatus(info.EnclaveStatus), ApiContainerStatus: toGrpcContainerStatus(info.ApiContainerStatus), ApiContainerInfo: containerInfo, ApiContainerHostMachineInfo: apiHostMachine, diff --git a/engine/server/engine/server/engine_rest_api_handler.go b/engine/server/engine/server/engine_rest_api_handler.go index bbc3dd2fde..68ba8908ad 100644 --- a/engine/server/engine/server/engine_rest_api_handler.go +++ b/engine/server/engine/server/engine_rest_api_handler.go @@ -92,15 +92,15 @@ func (engine EngineRuntime) PostEnclaves(ctx context.Context, request api.PostEn return api.PostEnclaves200JSONResponse(response), nil } -// Get Historical Enclaves -// (GET /enclaves/historical) -func (engine EngineRuntime) GetEnclavesHistorical(ctx context.Context, request api.GetEnclavesHistoricalRequestObject) (api.GetEnclavesHistoricalResponseObject, error) { +// Get History Enclaves +// (GET /enclaves/history) +func (engine EngineRuntime) GetEnclavesHistory(ctx context.Context, request api.GetEnclavesHistoryRequestObject) (api.GetEnclavesHistoryResponseObject, error) { allIdentifiers, err := engine.EnclaveManager.GetExistingAndHistoricalEnclaveIdentifiers() if err != nil { return nil, stacktrace.Propagate(err, "An error occurred while fetching enclave identifiers") } identifiers_map_api := utils.MapList(allIdentifiers, to_http.ToHttpEnclaveIdentifiers) - return api.GetEnclavesHistorical200JSONResponse(identifiers_map_api), nil + return api.GetEnclavesHistory200JSONResponse(identifiers_map_api), nil } // Destroy Enclave @@ -148,7 +148,7 @@ func (engine EngineRuntime) GetEnclavesEnclaveIdentifierStatus(ctx context.Conte return nil, err } - return api.GetEnclavesEnclaveIdentifierStatus200JSONResponse(to_http.ToHttpEnclaveContainersStatus(info.EnclaveContainersStatus)), nil + return api.GetEnclavesEnclaveIdentifierStatus200JSONResponse(to_http.ToHttpEnclaveStatus(info.EnclaveStatus)), nil } // Set enclave status diff --git a/engine/server/engine/types/engine_types.go b/engine/server/engine/types/engine_types.go index 58e0eb28d3..ba858cdc8b 100644 --- a/engine/server/engine/types/engine_types.go +++ b/engine/server/engine/types/engine_types.go @@ -4,13 +4,13 @@ import ( "time" ) -// Defines values for EnclaveContainersStatus. -type EnclaveContainersStatus string +// Defines values for EnclaveStatus. +type EnclaveStatus string const ( - EnclaveContainersStatus_RUNNING EnclaveContainersStatus = "RUNNING" - EnclaveContainersStatus_STOPPED EnclaveContainersStatus = "STOPPED" - EnclaveContainersStatus_EMPTY EnclaveContainersStatus = "EMPTY" + EnclaveStatus_RUNNING EnclaveStatus = "RUNNING" + EnclaveStatus_STOPPED EnclaveStatus = "STOPPED" + EnclaveStatus_EMPTY EnclaveStatus = "EMPTY" ) // Defines values for ContainerStatus. @@ -64,7 +64,7 @@ type EnclaveInfo struct { ApiContainerHostMachineInfo *EnclaveAPIContainerHostMachineInfo ApiContainerInfo *EnclaveAPIContainerInfo ApiContainerStatus ContainerStatus - EnclaveContainersStatus EnclaveContainersStatus + EnclaveStatus EnclaveStatus CreationTime Timestamp EnclaveUuid string Mode EnclaveMode From 4d0f6c77a1fb3d57f253c23f423ff00565dc4f71 Mon Sep 17 00:00:00 2001 From: lostbean Date: Sat, 2 Dec 2023 19:10:51 -0300 Subject: [PATCH 74/95] Improve main engine function --- .../engine_functions/create_engine.go | 2 +- engine/server/engine/main.go | 109 +++++++++--------- .../engine/server/websocket_api_handler.go | 4 +- .../streaming/streaming_pool_manager.go | 4 + 4 files changed, 65 insertions(+), 54 deletions(-) diff --git a/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/engine_functions/create_engine.go b/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/engine_functions/create_engine.go index 9b9d975aa5..c054eac180 100644 --- a/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/engine_functions/create_engine.go +++ b/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/engine_functions/create_engine.go @@ -140,7 +140,7 @@ func CreateEngine( if err != nil { return nil, stacktrace.Propagate( err, - "An error occurred creating the Enclave Manager UI's http port spec object using number '%v' and protocol '%v'", + "An error occurred creating the REST API server's http port spec object using number '%v' and protocol '%v'", restAPIPort, consts.EngineTransportProtocol.String(), ) diff --git a/engine/server/engine/main.go b/engine/server/engine/main.go index 7f0bf4e7f5..2193a81e57 100644 --- a/engine/server/engine/main.go +++ b/engine/server/engine/main.go @@ -72,10 +72,15 @@ const ( shouldFlushMetricsClientQueueOnEachEvent = false - restAPIPortAddr uint16 = 9779 + restAPIPortAddr uint16 = 977 //TODO: pass this parameter9 + restAPIHostIP string = "0.0.0.0" streamerPoolSize = 1000 streamerExpirationTime = time.Hour * 2 + + pathToEnclaveSpecs = "/api/specs/enclave" + pathToEngineSpecs = "/api/specs/engine" + pathToWebsocketSpecs = "/api/specs/websocket" ) // Nil indicates that the KurtosisBackend should not operate in API container mode, which is appropriate here @@ -243,15 +248,22 @@ func runMain() error { } }() - go restApiServer( - ctx, - serverArgs, - enclaveManager, - perWeekLogsDatabaseClient, - perFileLogsDatabaseClient, - logFileManager, - metricsClient, - ) + go func() { + err := restApiServer( + ctx, + serverArgs, + enclaveManager, + perWeekLogsDatabaseClient, + perFileLogsDatabaseClient, + logFileManager, + metricsClient, + ) + if err != nil { + logrus.Fatal("The REST API server is down, exiting!", err) + fmt.Fprintln(logrus.StandardLogger().Out, err) + os.Exit(failureExitCode) + } + }() engineConnectServer := server.NewEngineConnectServerService( serverArgs.ImageVersionTag, @@ -373,48 +385,27 @@ func restApiServer( perFileLogsDatabaseClient centralized_logs.LogsDatabaseClient, logFileManager *log_file_manager.LogFileManager, metricsClient metrics_client.MetricsClient, -) { +) error { asyncStarlarkLogs := streaming.NewStreamerPool[*kurtosis_core_rpc_api_bindings.StarlarkRunResponseLine](streamerPoolSize, streamerExpirationTime) + defer asyncStarlarkLogs.Clean() logrus.Info("Running REST API server...") // This is how you set up a basic Echo router - e := echo.New() - // Log all requests - e.Use(echomiddleware.Logger()) + echoRouter := echo.New() + echoRouter.Use(echomiddleware.Logger()) // ============================== Engine Management API ====================================== - // OpenAPI schema. - swagger_engine, err := engineApi.GetSwagger() - if err != nil { - fmt.Fprintf(os.Stderr, "Error loading swagger spec\n: %s", err) - os.Exit(1) - } - server.ServeSwaggerUI(e, "/api/specs/engine", server.NewSwaggerUIConfig(swagger_engine)) - - // Use our validation middleware to check all requests against the - // e.Use(middleware.OapiRequestValidator(swagger_engine)) - - // We now register our runtime above as the handler for the interface engineRuntime := restApi.EngineRuntime{ ImageVersionTag: serverArgs.ImageVersionTag, EnclaveManager: enclave_manager, LogFileManager: logFileManager, MetricsClient: metricsClient, } - engineApi.RegisterHandlers(e, engineApi.NewStrictHandler(engineRuntime, nil)) + engineApi.RegisterHandlers(echoRouter, engineApi.NewStrictHandler(engineRuntime, nil)) // ============================== Logging API ====================================== - - swagger_websocket, err := loggingApi.GetSwagger() - if err != nil { - fmt.Fprintf(os.Stderr, "Error loading swagger spec\n: %s", err) - os.Exit(1) - } - server.ServeSwaggerUI(e, "/api/specs/websocket", server.NewSwaggerUIConfig(swagger_websocket)) - // Use our validation middleware to check all requests against the - // e.Use(middleware.OapiRequestValidator(swagger_websocket)) webSocketRuntime := restApi.WebSocketRuntime{ ImageVersionTag: serverArgs.ImageVersionTag, EnclaveManager: enclave_manager, @@ -426,29 +417,43 @@ func restApiServer( MetricsClient: metricsClient, AsyncStarlarkLogs: asyncStarlarkLogs, } - // TODO(edgar) add logging Close() - // defer webSocketRuntime.ShutDown() - loggingApi.RegisterHandlers(e, webSocketRuntime) + loggingApi.RegisterHandlers(echoRouter, webSocketRuntime) // ============================== Engine Management API ====================================== - // OpenAPI schema. - swagger_enclave, err := enclaveApi.GetSwagger() + enclaveRuntime, err := restApi.NewEnclaveRuntime(ctx, *enclave_manager, asyncStarlarkLogs, false) if err != nil { - fmt.Fprintf(os.Stderr, "Error loading swagger spec\n: %s", err) - os.Exit(1) + stacktrace.Propagate(err, "Failed to initialize %T", enclaveRuntime) + return err } - server.ServeSwaggerUI(e, "/api/specs/enclave", server.NewSwaggerUIConfig(swagger_enclave)) + enclaveApi.RegisterHandlers(echoRouter, enclaveApi.NewStrictHandler(enclaveRuntime, nil)) - // Use our validation middleware to check all requests against the - // e.Use(middleware.OapiRequestValidator(swagger_enclave)) - enclaveRuntime, err := restApi.NewEnclaveRuntime(ctx, *enclave_manager, asyncStarlarkLogs, false) + // ============================== Serve OpenAPI specs ====================================== + // TODO (edgar) Move Spec service to Web Server + // ========================================================================================= + swaggerEngine, err := engineApi.GetSwagger() + if err != nil { + // Log and skip since this is non-essential + logrus.Errorf("Error loading swagger spec: %v", err) + } else { + server.ServeSwaggerUI(echoRouter, pathToEngineSpecs, server.NewSwaggerUIConfig(swaggerEngine)) + } + + swaggerEnclave, err := enclaveApi.GetSwagger() + if err != nil { + // Log and skip since this is non-essential + logrus.Errorf("Error loading swagger spec: %v", err) + } else { + server.ServeSwaggerUI(echoRouter, pathToEnclaveSpecs, server.NewSwaggerUIConfig(swaggerEnclave)) + } + + swaggerWebsocket, err := loggingApi.GetSwagger() if err != nil { - // TODO(edgar) fix error handling + // Log and skip since this is non-essential + logrus.Errorf("Error loading swagger spec: %v", err) + } else { + server.ServeSwaggerUI(echoRouter, pathToWebsocketSpecs, server.NewSwaggerUIConfig(swaggerWebsocket)) } - // TODO(edgar) add enclave Close() - // defer enclaveRuntime.ShutDown() - enclaveApi.RegisterHandlers(e, enclaveApi.NewStrictHandler(enclaveRuntime, nil)) // ============================== Start Server ====================================== - e.Logger.Fatal(e.Start(net.JoinHostPort("0.0.0.0", fmt.Sprint(restAPIPortAddr)))) + return echoRouter.Start(net.JoinHostPort(restAPIHostIP, fmt.Sprint(restAPIPortAddr))) } diff --git a/engine/server/engine/server/websocket_api_handler.go b/engine/server/engine/server/websocket_api_handler.go index 55c4f09dfd..25444e8526 100644 --- a/engine/server/engine/server/websocket_api_handler.go +++ b/engine/server/engine/server/websocket_api_handler.go @@ -44,7 +44,9 @@ type WebSocketRuntime struct { LogFileManager *log_file_manager.LogFileManager - MetricsClient metrics_client.MetricsClient + MetricsClient metrics_client.MetricsClient + + // Pool of Starlark log streamers create by package/script runs AsyncStarlarkLogs streaming.StreamerPool[*rpc_api.StarlarkRunResponseLine] } diff --git a/engine/server/engine/streaming/streaming_pool_manager.go b/engine/server/engine/streaming/streaming_pool_manager.go index d3c7f1f0f7..01e625c54d 100644 --- a/engine/server/engine/streaming/streaming_pool_manager.go +++ b/engine/server/engine/streaming/streaming_pool_manager.go @@ -77,3 +77,7 @@ func (streamerPool StreamerPool[T]) Consume(uuid StreamerUUID, consumer func(*ku return true, nil } + +func (streamerPool StreamerPool[T]) Clean() { + streamerPool.pool.Purge() +} From 14e0b26589a0de0e40b0e5b5ef3ffa72af2cb0f6 Mon Sep 17 00:00:00 2001 From: lostbean Date: Mon, 4 Dec 2023 10:00:26 -0300 Subject: [PATCH 75/95] improvements to the enclave handler module --- .../core_rest_api/api_container_server.gen.go | 26 +- api/openapi/specs/kurtosis_api.yaml | 2 + .../engine/server/enclave_rest_api_handler.go | 420 +++++++++--------- 3 files changed, 242 insertions(+), 206 deletions(-) diff --git a/api/golang/http_rest/core_rest_api/api_container_server.gen.go b/api/golang/http_rest/core_rest_api/api_container_server.gen.go index 92780b75dc..4536ff112d 100644 --- a/api/golang/http_rest/core_rest_api/api_container_server.gen.go +++ b/api/golang/http_rest/core_rest_api/api_container_server.gen.go @@ -885,6 +885,18 @@ func (response GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPor return nil } +type GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilitydefaultJSONResponse struct { + Body ResponseInfo + StatusCode int +} + +func (response GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilitydefaultJSONResponse) VisitGetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(response.StatusCode) + + return json.NewEncoder(w).Encode(response.Body) +} + type GetEnclavesEnclaveIdentifierStarlarkRequestObject struct { EnclaveIdentifier EnclaveIdentifier `json:"enclave_identifier"` } @@ -1601,13 +1613,13 @@ var swaggerSpec = []string{ "rtjwzrzwwwVpjxQcNYzDD2MLkHZ7ybIqJX8M/hilVU+Me9iDFqfUmmn8e0X19T4iAV7Z6STydAF+u3vI", "03CyLQ4Am2VakWtgZUct9+gE+4cWtSRAVWP/GDztG2nK0fda973bEd5p3uAUY5NGb0y/M9vhrMLJ9KNr", "Negsm57F5VtnogNVwYvVGmE7y1M6fggNXPZLmHKhbGe542YLwueSt/2z6p0QBwyvNwAdsjpW6yHjevpv", - "Dpjtu/QNH3rHjdrdWQdtWevD2GUygyphR6pPTHPLJS991d1Glw8vtMMDalc6cjfXxk/+EfzbIQVAjfzb", - "k2j096AQxVJVz2RFwe565G6JkXvsIrvvKvxdIm49zz1C8zWRSCrI7VM/a1N9M4h664gUs0YHR9NBNtCi", - "46DLi53J8ge/fu6Q7we66m0fz0Oxxuh79SKq706r3inblDIpQVYr1z+l6gyiPZAMcsq3mzJj3OasN1v/", - "qj1GRL2g9IpZ444wsx0cbftIAa6EyjY++dLRaPGL7Svq2NA3wW60ftTLXbFrgqvek0dobJqwUMlRzqUk", - "C3tFYluvmry36YTLMttVyL9jr5A1F3qbnILyEKo1XDGTtkMlJ6IvgaarX47uJw3u/+On8vVrz+YGG+Fm", - "l9nHCg0CeuaJb/lCNcpPHAa0hQxxm8MsJIgXEi1gjenyvkrDoiMfWU1ohfuHjri7jjh3p/Q0muGZZN01", - "u/mPFnW75QNLun1gb4euCIORK2/Vv5SKoORvHVaEBa6KLW5v/z8AAP//cGremulkAAA=", + "Dpjtu/QNH3rHjdrdWQdtWevD2GUygyrh3nrgxLTDXPLSu91tjfnwYj48BHfFJndzhvzkH8EjHlIy1MjY", + "PYkNeA8KUSxV9bBWFOyuR+6WGLnnMbL7dsPfPuLWg94jNF8TiaSC3D4OtFbYt4+oN5tIMWv0fDQ9ZwNN", + "PQ667tiZLH/wC+vH0Qjdx/NQrDH6Xr2h6rsFq/fWNsVPSpDVynVcqXqJaJ8lg5zy7abMMbc5683Wv4OP", + "EVEvKL1i1h1AmNmej7bhpABXdGVbpXzpaM34xXYidWzo22Y3mkXq5a7YNcFVt8ojNDZtW6jkKOdSkoW9", + "VLHNWk2m3PTOZZntQ+RfvlfImivATU5BeQjVGq6YSfShkhPRl0Cb1i9H95MG9//xU0UHtYd2g812sy/t", + "YwUTAT3zxPeCoarmJw4c2kKGuM16FhLEC4kWsMZ0eV+lYdGRj6wmtML9Q0fcXUecu1N6Gs3wTLLu2uP8", + "R4u63fKBJd0+ybdDV4TByBXE6l9KRVDytw4rwgJXxRa3t/8fAAD//4EvswEbZQAA", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/api/openapi/specs/kurtosis_api.yaml b/api/openapi/specs/kurtosis_api.yaml index 9c66c22d14..e0d30fc9b5 100644 --- a/api/openapi/specs/kurtosis_api.yaml +++ b/api/openapi/specs/kurtosis_api.yaml @@ -366,6 +366,8 @@ paths: - $ref: "#/components/parameters/expected_response" - $ref: "#/components/parameters/request_body" responses: + default: + $ref: "#/components/responses/NotOk" "200": description: Success diff --git a/engine/server/engine/server/enclave_rest_api_handler.go b/engine/server/engine/server/enclave_rest_api_handler.go index 0a740e1242..5148f5d502 100644 --- a/engine/server/engine/server/enclave_rest_api_handler.go +++ b/engine/server/engine/server/enclave_rest_api_handler.go @@ -26,6 +26,10 @@ import ( api "github.com/kurtosis-tech/kurtosis/api/golang/http_rest/core_rest_api" ) +const ( + unknownStreamLength uint64 = 0 // set an unknown HTTP length header when using streaming/chunks +) + type enclaveRuntime struct { enclaveManager enclave_manager.EnclaveManager remoteApiContainerClient map[string]rpc_api.ApiContainerServiceClient @@ -35,44 +39,6 @@ type enclaveRuntime struct { asyncStarlarkLogs streaming.StreamerPool[*rpc_api.StarlarkRunResponseLine] } -func (runtime enclaveRuntime) refreshEnclaveConnections() error { - runtime.lock.Lock() - defer runtime.lock.Unlock() - - enclaves, err := runtime.enclaveManager.GetEnclaves(runtime.ctx) - if err != nil { - return err - } - - // Clean up removed enclaves - for uuid := range runtime.remoteApiContainerClient { - _, found := enclaves[uuid] - if !found { - delete(runtime.remoteApiContainerClient, uuid) - } - } - - // Add new enclaves - assuming enclaves properties (API container connection) are immutable - for uuid, info := range enclaves { - _, found := runtime.remoteApiContainerClient[uuid] - if !found && (info != nil) { - conn, err := getGrpcClientConn(*info, runtime.connectOnHostMachine) - if err != nil { - logrus.Errorf("Failed to establish gRPC connection with enclave manager service on enclave %s", uuid) - return err - } - if conn == nil { - logrus.Warnf("Unavailable gRPC connection to enclave '%s', skipping it!", uuid) - continue - } - apiContainerClient := rpc_api.NewApiContainerServiceClient(conn) - runtime.remoteApiContainerClient[uuid] = apiContainerClient - } - } - - return nil -} - func NewEnclaveRuntime(ctx context.Context, manager enclave_manager.EnclaveManager, asyncStarlarkLogs streaming.StreamerPool[*rpc_api.StarlarkRunResponseLine], connectOnHostMachine bool) (*enclaveRuntime, error) { runtime := enclaveRuntime{ @@ -85,7 +51,7 @@ func NewEnclaveRuntime(ctx context.Context, manager enclave_manager.EnclaveManag err := runtime.refreshEnclaveConnections() if err != nil { - return nil, err + return nil, stacktrace.Propagate(err, "failed to create enclave connections") } return &runtime, nil @@ -97,15 +63,15 @@ func NewEnclaveRuntime(ctx context.Context, manager enclave_manager.EnclaveManag // (GET /enclaves/{enclave_identifier}/artifacts) func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierArtifacts(ctx context.Context, request api.GetEnclavesEnclaveIdentifierArtifactsRequestObject) (api.GetEnclavesEnclaveIdentifierArtifactsResponseObject, error) { - enclave_identifier := request.EnclaveIdentifier - apiContainerClient, responseErr := manager.GetApiClientOrResponseError(enclave_identifier) + enclaveIdentifier := request.EnclaveIdentifier + apiContainerClient, responseErr := manager.getApiClientOrResponseError(enclaveIdentifier) if responseErr != nil { return api.GetEnclavesEnclaveIdentifierArtifactsdefaultJSONResponse{Body: *responseErr, StatusCode: int(responseErr.Code)}, nil } artifacts, err := (*apiContainerClient).ListFilesArtifactNamesAndUuids(ctx, &emptypb.Empty{}) if err != nil { - return nil, err + return nil, stacktrace.Propagate(err, "fail to list fails file artifacts") } results := utils.MapList( @@ -122,14 +88,14 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierArtifacts(ctx context // (POST /enclaves/{enclave_identifier}/artifacts/local-file) func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierArtifactsLocalFile(ctx context.Context, request api.PostEnclavesEnclaveIdentifierArtifactsLocalFileRequestObject) (api.PostEnclavesEnclaveIdentifierArtifactsLocalFileResponseObject, error) { - enclave_identifier := request.EnclaveIdentifier - apiContainerClient, responseErr := manager.GetApiClientOrResponseError(enclave_identifier) + enclaveIdentifier := request.EnclaveIdentifier + apiContainerClient, responseErr := manager.getApiClientOrResponseError(enclaveIdentifier) if responseErr != nil { return api.PostEnclavesEnclaveIdentifierArtifactsLocalFiledefaultJSONResponse{Body: *responseErr, StatusCode: int(responseErr.Code)}, nil } - logrus.Infof("Uploading file artifact to enclave %s", enclave_identifier) + logrus.Infof("Uploading file artifact to enclave %s", enclaveIdentifier) - uploaded_artifacts := map[string]api_type.FileArtifactReference{} + uploadedArtifacts := map[string]api_type.FileArtifactReference{} for { // Get next part (file) from the the multipart POST request part, err := request.Body.NextPart() @@ -140,14 +106,14 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierArtifactsLocalFile(c client, err := (*apiContainerClient).UploadFilesArtifact(ctx) if err != nil { - return nil, stacktrace.Propagate(err, "Can't start file upload gRPC call with enclave %s", enclave_identifier) + return nil, stacktrace.Propagate(err, "Can't start file upload gRPC call with enclave %s", enclaveIdentifier) } clientStream := grpc_file_streaming.NewClientStream[rpc_api.StreamedDataChunk, rpc_api.UploadFilesArtifactResponse](client) response, err := clientStream.SendData( filename, part, - 0, // Length unknown head of time + unknownStreamLength, func(previousChunkHash string, contentChunk []byte) (*rpc_api.StreamedDataChunk, error) { return &rpc_api.StreamedDataChunk{ Data: contentChunk, @@ -162,95 +128,93 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierArtifactsLocalFile(c // The response is nil when a file artifact with the same has already been uploaded // TODO (edgar) Is this the expected behavior? If so, we should be explicit about it. if response != nil { - artifact_response := api_type.FileArtifactReference{ + artifactResponse := api_type.FileArtifactReference{ Name: response.Name, Uuid: response.Uuid, } - uploaded_artifacts[filename] = artifact_response + uploadedArtifacts[filename] = artifactResponse } } - return api.PostEnclavesEnclaveIdentifierArtifactsLocalFile200JSONResponse(uploaded_artifacts), nil + return api.PostEnclavesEnclaveIdentifierArtifactsLocalFile200JSONResponse(uploadedArtifacts), nil } // (POST /enclaves/{enclave_identifier}/artifacts/remote-file) func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierArtifactsRemoteFile(ctx context.Context, request api.PostEnclavesEnclaveIdentifierArtifactsRemoteFileRequestObject) (api.PostEnclavesEnclaveIdentifierArtifactsRemoteFileResponseObject, error) { - enclave_identifier := request.EnclaveIdentifier - apiContainerClient, responseErr := manager.GetApiClientOrResponseError(enclave_identifier) + enclaveIdentifier := request.EnclaveIdentifier + apiContainerClient, responseErr := manager.getApiClientOrResponseError(enclaveIdentifier) if responseErr != nil { return api.PostEnclavesEnclaveIdentifierArtifactsRemoteFiledefaultJSONResponse{Body: *responseErr, StatusCode: int(responseErr.Code)}, nil } - logrus.Infof("Uploading file artifact to enclave %s", enclave_identifier) + logrus.Infof("Uploading file artifact to enclave %s", enclaveIdentifier) storeWebFilesArtifactArgs := rpc_api.StoreWebFilesArtifactArgs{ Url: request.Body.Url, Name: request.Body.Name, } - stored_artifact, err := (*apiContainerClient).StoreWebFilesArtifact(ctx, &storeWebFilesArtifactArgs) + storedArtifact, err := (*apiContainerClient).StoreWebFilesArtifact(ctx, &storeWebFilesArtifactArgs) if err != nil { - logrus.Errorf("Can't start file upload gRPC call with enclave %s, error: %s", enclave_identifier, err) - return nil, stacktrace.NewError("Can't start file upload gRPC call with enclave %s", enclave_identifier) + logrus.Errorf("Can't start file upload gRPC call with enclave %s, error: %s", enclaveIdentifier, err) + return nil, stacktrace.NewError("Can't start file upload gRPC call with enclave %s", enclaveIdentifier) } - artifact_response := api_type.FileArtifactReference{ - Uuid: stored_artifact.Uuid, + artifactResponse := api_type.FileArtifactReference{ + Uuid: storedArtifact.Uuid, Name: request.Body.Name, } - return api.PostEnclavesEnclaveIdentifierArtifactsRemoteFile200JSONResponse(artifact_response), nil + return api.PostEnclavesEnclaveIdentifierArtifactsRemoteFile200JSONResponse(artifactResponse), nil } // (POST /enclaves/{enclave_identifier}/artifacts/services/{service_identifier}) func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier(ctx context.Context, request api.PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierRequestObject) (api.PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierResponseObject, error) { - enclave_identifier := request.EnclaveIdentifier - service_identifier := request.ServiceIdentifier - apiContainerClient, responseErr := manager.GetApiClientOrResponseError(enclave_identifier) + enclaveIdentifier := request.EnclaveIdentifier + serviceIdentifier := request.ServiceIdentifier + apiContainerClient, responseErr := manager.getApiClientOrResponseError(enclaveIdentifier) if responseErr != nil { return api.PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifierdefaultJSONResponse{Body: *responseErr, StatusCode: int(responseErr.Code)}, nil } - logrus.Infof("Storing file artifact from service %s on enclave %s", service_identifier, enclave_identifier) + logrus.Infof("Storing file artifact from service %s on enclave %s", serviceIdentifier, enclaveIdentifier) storeWebFilesArtifactArgs := rpc_api.StoreFilesArtifactFromServiceArgs{ - ServiceIdentifier: service_identifier, + ServiceIdentifier: serviceIdentifier, SourcePath: request.Body.SourcePath, Name: request.Body.Name, } - stored_artifact, err := (*apiContainerClient).StoreFilesArtifactFromService(ctx, &storeWebFilesArtifactArgs) + storedArtifact, err := (*apiContainerClient).StoreFilesArtifactFromService(ctx, &storeWebFilesArtifactArgs) if err != nil { - logrus.Errorf("Can't start file upload gRPC call with enclave %s, error: %s", enclave_identifier, err) - return nil, stacktrace.NewError("Can't start file upload gRPC call with enclave %s", enclave_identifier) + return nil, stacktrace.NewError("Can't start file upload gRPC call with enclave %s", enclaveIdentifier) } - artifact_response := api_type.FileArtifactReference{ - Uuid: stored_artifact.Uuid, + artifactResponse := api_type.FileArtifactReference{ + Uuid: storedArtifact.Uuid, Name: request.Body.Name, } - return api.PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier200JSONResponse(artifact_response), nil + return api.PostEnclavesEnclaveIdentifierArtifactsServicesServiceIdentifier200JSONResponse(artifactResponse), nil } // (GET /enclaves/{enclave_identifier}/artifacts/{artifact_identifier}) func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier(ctx context.Context, request api.GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierRequestObject) (api.GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierResponseObject, error) { - enclave_identifier := request.EnclaveIdentifier - artifact_identifier := request.ArtifactIdentifier - apiContainerClient, responseErr := manager.GetApiClientOrResponseError(enclave_identifier) + enclaveIdentifier := request.EnclaveIdentifier + artifactIdentifier := request.ArtifactIdentifier + apiContainerClient, responseErr := manager.getApiClientOrResponseError(enclaveIdentifier) if responseErr != nil { return api.GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierdefaultJSONResponse{Body: *responseErr, StatusCode: int(responseErr.Code)}, nil } - logrus.Infof("Inspecting file artifact %s on enclave %s", artifact_identifier, enclave_identifier) + logrus.Infof("Inspecting file artifact %s on enclave %s", artifactIdentifier, enclaveIdentifier) inspectFilesArtifactContentsRequest := rpc_api.InspectFilesArtifactContentsRequest{ FileNamesAndUuid: &rpc_api.FilesArtifactNameAndUuid{ - FileName: artifact_identifier, - FileUuid: artifact_identifier, + FileName: artifactIdentifier, + FileUuid: artifactIdentifier, }, } - stored_artifact, err := (*apiContainerClient).InspectFilesArtifactContents(ctx, &inspectFilesArtifactContentsRequest) + storedArtifact, err := (*apiContainerClient).InspectFilesArtifactContents(ctx, &inspectFilesArtifactContentsRequest) if err != nil { - logrus.Errorf("Can't inspect artifact using gRPC call with enclave %s, error: %s", enclave_identifier, err) - return nil, stacktrace.NewError("Can't inspect artifact using gRPC call with enclave %s", enclave_identifier) + return nil, stacktrace.NewError("Can't inspect artifact using gRPC call with enclave %s", enclaveIdentifier) } - artifact_content_list := utils.MapList( - stored_artifact.FileDescriptions, + artifactContentList := utils.MapList( + storedArtifact.FileDescriptions, func(x *rpc_api.FileArtifactContentsFileDescription) api_type.FileArtifactDescription { size := int64(x.Size) return api_type.FileArtifactDescription{ @@ -260,31 +224,30 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierArtifactsArtifactIden } }) - return api.GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier200JSONResponse(artifact_content_list), nil + return api.GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifier200JSONResponse(artifactContentList), nil } // (GET /enclaves/{enclave_identifier}/artifacts/{artifact_identifier}/download) func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownload(ctx context.Context, request api.GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownloadRequestObject) (api.GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownloadResponseObject, error) { - enclave_identifier := request.EnclaveIdentifier - artifact_identifier := request.ArtifactIdentifier - apiContainerClient, responseErr := manager.GetApiClientOrResponseError(enclave_identifier) + enclaveIdentifier := request.EnclaveIdentifier + artifactIdentifier := request.ArtifactIdentifier + apiContainerClient, responseErr := manager.getApiClientOrResponseError(enclaveIdentifier) if responseErr != nil { return api.GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownloaddefaultJSONResponse{Body: *responseErr, StatusCode: int(responseErr.Code)}, nil } - logrus.Infof("Downloading file artifact %s from enclave %s", artifact_identifier, enclave_identifier) + logrus.Infof("Downloading file artifact %s from enclave %s", artifactIdentifier, enclaveIdentifier) downloadFilesArtifactArgs := rpc_api.DownloadFilesArtifactArgs{ - Identifier: artifact_identifier, + Identifier: artifactIdentifier, } client, err := (*apiContainerClient).DownloadFilesArtifact(ctx, &downloadFilesArtifactArgs) if err != nil { - logrus.Errorf("Can't start file download gRPC call with enclave %s, error: %s", enclave_identifier, err) - return nil, stacktrace.NewError("Can't start file download gRPC call with enclave %s", enclave_identifier) + return nil, stacktrace.NewError("Can't start file download gRPC call with enclave %s", enclaveIdentifier) } clientStream := grpc_file_streaming.NewClientStream[rpc_api.StreamedDataChunk, []byte](client) pipeReader := clientStream.PipeReader( - artifact_identifier, + artifactIdentifier, func(dataChunk *rpc_api.StreamedDataChunk) ([]byte, string, error) { return dataChunk.Data, dataChunk.PreviousChunkHash, nil }, @@ -292,7 +255,7 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierArtifactsArtifactIden response := api.GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownload200ApplicationoctetStreamResponse{ Body: pipeReader, - ContentLength: 0, // No file size is provided since we are streaming it directly + ContentLength: int64(unknownStreamLength), } return api.GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownload200ApplicationoctetStreamResponse(response), nil @@ -300,40 +263,38 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierArtifactsArtifactIden // (GET /enclaves/{enclave_identifier}/services) func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierServices(ctx context.Context, request api.GetEnclavesEnclaveIdentifierServicesRequestObject) (api.GetEnclavesEnclaveIdentifierServicesResponseObject, error) { - enclave_identifier := request.EnclaveIdentifier - apiContainerClient, responseErr := manager.GetApiClientOrResponseError(enclave_identifier) + enclaveIdentifier := request.EnclaveIdentifier + apiContainerClient, responseErr := manager.getApiClientOrResponseError(enclaveIdentifier) if responseErr != nil { return api.GetEnclavesEnclaveIdentifierServicesdefaultJSONResponse{Body: *responseErr, StatusCode: int(responseErr.Code)}, nil } - logrus.Infof("Getting info about services enclave %s", enclave_identifier) + logrus.Infof("Getting info about services enclave %s", enclaveIdentifier) - service_ids := utils.DerefWith(request.Params.Services, []string{}) + serviceIds := utils.DerefWith(request.Params.Services, []string{}) getServicesArgs := rpc_api.GetServicesArgs{ - ServiceIdentifiers: utils.NewMapFromList(service_ids, func(x string) bool { return true }), + ServiceIdentifiers: utils.NewMapFromList(serviceIds, func(x string) bool { return true }), } services, err := (*apiContainerClient).GetServices(ctx, &getServicesArgs) if err != nil { - logrus.Errorf("Can't list services using gRPC call with enclave %s, error: %s", enclave_identifier, err) - return nil, stacktrace.NewError("Can't list services using gRPC call with enclave %s", enclave_identifier) + return nil, stacktrace.NewError("Can't list services using gRPC call with enclave %s", enclaveIdentifier) } - mapped_services := utils.MapMapValues(services.ServiceInfo, to_http.ToHttpServiceInfo) - return api.GetEnclavesEnclaveIdentifierServices200JSONResponse(mapped_services), nil + mappedServices := utils.MapMapValues(services.ServiceInfo, to_http.ToHttpServiceInfo) + return api.GetEnclavesEnclaveIdentifierServices200JSONResponse(mappedServices), nil } // (GET /enclaves/{enclave_identifier}/services/history) func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierServicesHistory(ctx context.Context, request api.GetEnclavesEnclaveIdentifierServicesHistoryRequestObject) (api.GetEnclavesEnclaveIdentifierServicesHistoryResponseObject, error) { - enclave_identifier := request.EnclaveIdentifier - apiContainerClient, responseErr := manager.GetApiClientOrResponseError(enclave_identifier) + enclaveIdentifier := request.EnclaveIdentifier + apiContainerClient, responseErr := manager.getApiClientOrResponseError(enclaveIdentifier) if responseErr != nil { return api.GetEnclavesEnclaveIdentifierServicesHistorydefaultJSONResponse{Body: *responseErr, StatusCode: int(responseErr.Code)}, nil } - logrus.Infof("Listing services from enclave %s", enclave_identifier) + logrus.Infof("Listing services from enclave %s", enclaveIdentifier) services, err := (*apiContainerClient).GetExistingAndHistoricalServiceIdentifiers(ctx, &emptypb.Empty{}) if err != nil { - logrus.Errorf("Can't list services using gRPC call with enclave %s, error: %s", enclave_identifier, err) - return nil, stacktrace.NewError("Can't list services using gRPC call with enclave %s", enclave_identifier) + return nil, stacktrace.NewError("Can't list services using gRPC call with enclave %s", enclaveIdentifier) } response := utils.MapList(services.AllIdentifiers, func(service *rpc_api.ServiceIdentifiers) api_type.ServiceIdentifiers { @@ -349,20 +310,19 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierServicesHistory(ctx c // (POST /enclaves/{enclave_identifier}/services/connection) func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierServicesConnection(ctx context.Context, request api.PostEnclavesEnclaveIdentifierServicesConnectionRequestObject) (api.PostEnclavesEnclaveIdentifierServicesConnectionResponseObject, error) { - enclave_identifier := request.EnclaveIdentifier - apiContainerClient, responseErr := manager.GetApiClientOrResponseError(enclave_identifier) + enclaveIdentifier := request.EnclaveIdentifier + apiContainerClient, responseErr := manager.getApiClientOrResponseError(enclaveIdentifier) if responseErr != nil { return api.PostEnclavesEnclaveIdentifierServicesConnectiondefaultJSONResponse{Body: *responseErr, StatusCode: int(responseErr.Code)}, nil } - logrus.Infof("Listing services from enclave %s", enclave_identifier) + logrus.Infof("Listing services from enclave %s", enclaveIdentifier) connectServicesArgs := rpc_api.ConnectServicesArgs{ Connect: to_grpc.ToGrpcConnect(*request.Body), } _, err := (*apiContainerClient).ConnectServices(ctx, &connectServicesArgs) if err != nil { - logrus.Errorf("Can't list services using gRPC call with enclave %s, error: %s", enclave_identifier, err) - return nil, stacktrace.NewError("Can't list services using gRPC call with enclave %s", enclave_identifier) + return nil, stacktrace.NewError("Can't list services using gRPC call with enclave %s", enclaveIdentifier) } return api.PostEnclavesEnclaveIdentifierServicesConnection200Response{}, nil @@ -370,79 +330,85 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierServicesConnection(c // (GET /enclaves/{enclave_identifier}/services/{service_identifier}) func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierServicesServiceIdentifier(ctx context.Context, request api.GetEnclavesEnclaveIdentifierServicesServiceIdentifierRequestObject) (api.GetEnclavesEnclaveIdentifierServicesServiceIdentifierResponseObject, error) { - enclave_identifier := request.EnclaveIdentifier - service_identifier := request.ServiceIdentifier - apiContainerClient, responseErr := manager.GetApiClientOrResponseError(enclave_identifier) + enclaveIdentifier := request.EnclaveIdentifier + serviceIdentifier := request.ServiceIdentifier + apiContainerClient, responseErr := manager.getApiClientOrResponseError(enclaveIdentifier) if responseErr != nil { return api.GetEnclavesEnclaveIdentifierServicesServiceIdentifierdefaultJSONResponse{Body: *responseErr, StatusCode: int(responseErr.Code)}, nil } - logrus.Infof("Getting info about service %s from enclave %s", service_identifier, enclave_identifier) + logrus.Infof("Getting info about service %s from enclave %s", serviceIdentifier, enclaveIdentifier) getServicesArgs := rpc_api.GetServicesArgs{ - ServiceIdentifiers: map[string]bool{service_identifier: true}, + ServiceIdentifiers: map[string]bool{serviceIdentifier: true}, } services, err := (*apiContainerClient).GetServices(ctx, &getServicesArgs) if err != nil { - logrus.Errorf("Can't list services using gRPC call with enclave %s, error: %s", enclave_identifier, err) - return nil, stacktrace.NewError("Can't list services using gRPC call with enclave %s", enclave_identifier) + logrus.Errorf("Can't list services using gRPC call with enclave %s, error: %s", enclaveIdentifier, err) + return nil, stacktrace.NewError("Can't list services using gRPC call with enclave %s", enclaveIdentifier) } - mapped_services := utils.MapMapValues(services.ServiceInfo, to_http.ToHttpServiceInfo) - selected_service, found := mapped_services[service_identifier] + mappedServices := utils.MapMapValues(services.ServiceInfo, to_http.ToHttpServiceInfo) + selectedService, found := mappedServices[serviceIdentifier] if !found { - // TODO(edgar) add 404 return - return nil, stacktrace.NewError("Service %s not found", service_identifier) + notFound := api_type.ResponseInfo{ + Code: http.StatusNotFound, + Type: api_type.INFO, + Message: fmt.Sprintf("service '%s' not found", serviceIdentifier), + } + return api.GetEnclavesEnclaveIdentifierServicesServiceIdentifierdefaultJSONResponse{ + Body: notFound, + StatusCode: int(notFound.Code), + }, nil } - return api.GetEnclavesEnclaveIdentifierServicesServiceIdentifier200JSONResponse(selected_service), nil + return api.GetEnclavesEnclaveIdentifierServicesServiceIdentifier200JSONResponse(selectedService), nil } // (POST /enclaves/{enclave_identifier}/services/{service_identifier}/command) func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand(ctx context.Context, request api.PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandRequestObject) (api.PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommandResponseObject, error) { - enclave_identifier := request.EnclaveIdentifier - service_identifier := request.ServiceIdentifier - apiContainerClient, responseErr := manager.GetApiClientOrResponseError(enclave_identifier) + enclaveIdentifier := request.EnclaveIdentifier + serviceIdentifier := request.ServiceIdentifier + apiContainerClient, responseErr := manager.getApiClientOrResponseError(enclaveIdentifier) if responseErr != nil { return api.PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommanddefaultJSONResponse{Body: *responseErr, StatusCode: int(responseErr.Code)}, nil } - logrus.Infof("Getting info about service %s from enclave %s", service_identifier, enclave_identifier) + logrus.Infof("Getting info about service %s from enclave %s", serviceIdentifier, enclaveIdentifier) execCommandArgs := rpc_api.ExecCommandArgs{ - ServiceIdentifier: service_identifier, + ServiceIdentifier: serviceIdentifier, CommandArgs: request.Body.CommandArgs, } - exec_result, err := (*apiContainerClient).ExecCommand(ctx, &execCommandArgs) + execResult, err := (*apiContainerClient).ExecCommand(ctx, &execCommandArgs) if err != nil { - logrus.Errorf("Can't execute commands using gRPC call with enclave %s, error: %s", enclave_identifier, err) - return nil, stacktrace.NewError("Can't execute commands using gRPC call with enclave %s", enclave_identifier) + return nil, stacktrace.NewError("Can't execute commands using gRPC call with enclave %s", enclaveIdentifier) } response := api_type.ExecCommandResult{ - ExitCode: exec_result.ExitCode, - LogOutput: exec_result.LogOutput, + ExitCode: execResult.ExitCode, + LogOutput: execResult.LogOutput, } return api.PostEnclavesEnclaveIdentifierServicesServiceIdentifierCommand200JSONResponse(response), nil } // (GET /enclaves/{enclave_identifier}/services/{service_identifier}/endpoints/{port_number}/availability) func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability(ctx context.Context, request api.GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityRequestObject) (api.GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilityResponseObject, error) { - enclave_identifier := request.EnclaveIdentifier - service_identifier := request.ServiceIdentifier - port_number := request.PortNumber - endpoint_method := utils.DerefWith(request.Params.HttpMethod, api_type.GET) - apiContainerClient, errConn := manager.GetGrpcClientForEnclaveUUID(enclave_identifier) - if errConn != nil { - return nil, errConn + enclaveIdentifier := request.EnclaveIdentifier + serviceIdentifier := request.ServiceIdentifier + portNumber := request.PortNumber + endpointMethod := utils.DerefWith(request.Params.HttpMethod, api_type.GET) + apiContainerClient, responseErr := manager.getApiClientOrResponseError(enclaveIdentifier) + if responseErr != nil { + return api.GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailabilitydefaultJSONResponse{Body: *responseErr, StatusCode: int(responseErr.Code)}, nil } - logrus.Infof("Getting info about service %s from enclave %s", service_identifier, enclave_identifier) + logrus.Infof("Getting info about service %s from enclave %s", serviceIdentifier, enclaveIdentifier) castToUInt32 := func(v int32) uint32 { return uint32(v) } var err error - switch endpoint_method { + switch endpointMethod { case api_type.GET: waitForHttpGetEndpointAvailabilityArgs := rpc_api.WaitForHttpGetEndpointAvailabilityArgs{ - ServiceIdentifier: service_identifier, - Port: uint32(port_number), + ServiceIdentifier: serviceIdentifier, + Port: uint32(portNumber), Path: request.Params.Path, InitialDelayMilliseconds: utils.MapPointer(request.Params.InitialDelayMilliseconds, castToUInt32), Retries: utils.MapPointer(request.Params.Retries, castToUInt32), @@ -452,8 +418,8 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierServicesServiceIdenti _, err = (*apiContainerClient).WaitForHttpGetEndpointAvailability(ctx, &waitForHttpGetEndpointAvailabilityArgs) case api_type.POST: waitForHttpPostEndpointAvailabilityArgs := rpc_api.WaitForHttpPostEndpointAvailabilityArgs{ - ServiceIdentifier: service_identifier, - Port: uint32(port_number), + ServiceIdentifier: serviceIdentifier, + Port: uint32(portNumber), Path: request.Params.Path, InitialDelayMilliseconds: utils.MapPointer(request.Params.InitialDelayMilliseconds, castToUInt32), Retries: utils.MapPointer(request.Params.Retries, castToUInt32), @@ -463,12 +429,12 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierServicesServiceIdenti } _, err = (*apiContainerClient).WaitForHttpPostEndpointAvailability(ctx, &waitForHttpPostEndpointAvailabilityArgs) default: - return nil, stacktrace.NewError("Undefined method for availability endpoint: %s", endpoint_method) + return nil, stacktrace.NewError("Undefined method for availability endpoint: %s", endpointMethod) } if err != nil { - logrus.Errorf("Can't execute commands using gRPC call with enclave %s, error: %s", enclave_identifier, err) - return nil, stacktrace.NewError("Can't execute commands using gRPC call with enclave %s", enclave_identifier) + logrus.Errorf("Can't execute commands using gRPC call with enclave %s, error: %s", enclaveIdentifier, err) + return nil, stacktrace.NewError("Can't execute commands using gRPC call with enclave %s", enclaveIdentifier) } return api.GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAvailability200Response{}, nil @@ -476,30 +442,29 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierServicesServiceIdenti // (GET /enclaves/{enclave_identifier}/starlark) func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierStarlark(ctx context.Context, request api.GetEnclavesEnclaveIdentifierStarlarkRequestObject) (api.GetEnclavesEnclaveIdentifierStarlarkResponseObject, error) { - enclave_identifier := request.EnclaveIdentifier - apiContainerClient, responseErr := manager.GetApiClientOrResponseError(enclave_identifier) + enclaveIdentifier := request.EnclaveIdentifier + apiContainerClient, responseErr := manager.getApiClientOrResponseError(enclaveIdentifier) if responseErr != nil { return api.GetEnclavesEnclaveIdentifierStarlarkdefaultJSONResponse{Body: *responseErr, StatusCode: int(responseErr.Code)}, nil } - logrus.Infof("Getting info about last Starlark run on enclave %s", enclave_identifier) + logrus.Infof("Getting info about last Starlark run on enclave %s", enclaveIdentifier) - starlark_result, err := (*apiContainerClient).GetStarlarkRun(ctx, &emptypb.Empty{}) + starlarkResult, err := (*apiContainerClient).GetStarlarkRun(ctx, &emptypb.Empty{}) if err != nil { - logrus.Errorf("Can't get Starlark info using gRPC call with enclave %s, error: %s", enclave_identifier, err) - return nil, stacktrace.NewError("Can't get Starlark info using gRPC call with enclave %s", enclave_identifier) + return nil, stacktrace.NewError("Can't get Starlark info using gRPC call with enclave %s", enclaveIdentifier) } - flags := utils.MapList(starlark_result.ExperimentalFeatures, to_http.ToHttpFeatureFlag) - policy := to_http.ToHttpRestartPolicy(starlark_result.RestartPolicy) + flags := utils.MapList(starlarkResult.ExperimentalFeatures, to_http.ToHttpFeatureFlag) + policy := to_http.ToHttpRestartPolicy(starlarkResult.RestartPolicy) response := api_type.StarlarkDescription{ ExperimentalFeatures: flags, - MainFunctionName: starlark_result.MainFunctionName, - PackageId: starlark_result.PackageId, - Parallelism: starlark_result.Parallelism, - RelativePathToMainFile: starlark_result.RelativePathToMainFile, + MainFunctionName: starlarkResult.MainFunctionName, + PackageId: starlarkResult.PackageId, + Parallelism: starlarkResult.Parallelism, + RelativePathToMainFile: starlarkResult.RelativePathToMainFile, RestartPolicy: policy, - SerializedParams: starlark_result.SerializedParams, - SerializedScript: starlark_result.SerializedScript, + SerializedParams: starlarkResult.SerializedParams, + SerializedScript: starlarkResult.SerializedScript, } return api.GetEnclavesEnclaveIdentifierStarlark200JSONResponse(response), nil @@ -507,13 +472,15 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierStarlark(ctx context. // (POST /enclaves/{enclave_identifier}/starlark/packages) func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkPackages(ctx context.Context, request api.PostEnclavesEnclaveIdentifierStarlarkPackagesRequestObject) (api.PostEnclavesEnclaveIdentifierStarlarkPackagesResponseObject, error) { - enclave_identifier := request.EnclaveIdentifier - apiContainerClient, responseErr := manager.GetApiClientOrResponseError(enclave_identifier) + enclaveIdentifier := request.EnclaveIdentifier + apiContainerClient, responseErr := manager.getApiClientOrResponseError(enclaveIdentifier) if responseErr != nil { return api.PostEnclavesEnclaveIdentifierStarlarkPackagesdefaultJSONResponse{Body: *responseErr, StatusCode: int(responseErr.Code)}, nil } - logrus.Infof("Upload Starlark package on enclave %s", enclave_identifier) + logrus.Infof("Upload Starlark package on enclave %s", enclaveIdentifier) + failedUploads := []string{} + successfulUploads := []string{} for { // Get next part (file) from the the multipart POST request part, err := request.Body.NextPart() @@ -523,15 +490,14 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkPackages(ctx filename := part.FileName() client, err := (*apiContainerClient).UploadStarlarkPackage(ctx) if err != nil { - logrus.Errorf("Can't upload Starlark package using gRPC call with enclave %s, error: %s", enclave_identifier, err) - return nil, stacktrace.NewError("Can't upload Starlark package using gRPC call with enclave %s", enclave_identifier) + return nil, stacktrace.NewError("Can't upload Starlark package using gRPC call with enclave %s", enclaveIdentifier) } clientStream := grpc_file_streaming.NewClientStream[rpc_api.StreamedDataChunk, emptypb.Empty](client) _, err = clientStream.SendData( filename, part, - 0, // Length unknown head of time + unknownStreamLength, func(previousChunkHash string, contentChunk []byte) (*rpc_api.StreamedDataChunk, error) { return &rpc_api.StreamedDataChunk{ Data: contentChunk, @@ -543,23 +509,43 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkPackages(ctx }, ) if err != nil { - // TODO(edgar) Should we stop on failure in case of multiple files? Should we return a list of succeed uploads? - return nil, err + logrus.Warnf("Failed to upload file %s with error: %v", filename, err) + failedUploads = append(failedUploads, filename) + } else { + successfulUploads = append(successfulUploads, filename) } } + if len(successfulUploads) > 0 && len(failedUploads) > 0 { + response := api_type.ResponseInfo{ + Code: http.StatusOK, + Type: api_type.WARNING, + Message: fmt.Sprintf("Failed to upload some of the files: %+v", failedUploads), + } + return api.PostEnclavesEnclaveIdentifierStarlarkPackagesdefaultJSONResponse{Body: response, StatusCode: int(response.Code)}, nil + } + + if len(successfulUploads) == 0 && len(failedUploads) > 0 { + response := api_type.ResponseInfo{ + Code: http.StatusInternalServerError, + Type: api_type.ERROR, + Message: fmt.Sprintf("Failed to upload the files: %+v", failedUploads), + } + return api.PostEnclavesEnclaveIdentifierStarlarkPackagesdefaultJSONResponse{Body: response, StatusCode: int(response.Code)}, nil + } + return api.PostEnclavesEnclaveIdentifierStarlarkPackages200Response{}, nil } // (POST /enclaves/{enclave_identifier}/starlark/packages/{package_id}) func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId(ctx context.Context, request api.PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdRequestObject) (api.PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdResponseObject, error) { - enclave_identifier := request.EnclaveIdentifier - apiContainerClient, responseErr := manager.GetApiClientOrResponseError(enclave_identifier) + enclaveIdentifier := request.EnclaveIdentifier + apiContainerClient, responseErr := manager.getApiClientOrResponseError(enclaveIdentifier) if responseErr != nil { return api.PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIddefaultJSONResponse{Body: *responseErr, StatusCode: int(responseErr.Code)}, nil } - package_id := request.PackageId + packageId := request.PackageId flags := utils.MapList(utils.DerefWith(request.Body.ExperimentalFeatures, []api_type.KurtosisFeatureFlag{}), to_grpc.ToGrpcFeatureFlag) // The gRPC always expect a JSON object even though it's marked as optional, so we need to default to `{}`` jsonParams := utils.DerefWith(request.Body.Params, map[string]interface{}{}) @@ -569,9 +555,9 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkPackagesPack } jsonString := string(jsonBlob) - logrus.Infof("Executing Starlark package `%s`", package_id) + logrus.Infof("Executing Starlark package `%s`", packageId) runStarlarkPackageArgs := rpc_api.RunStarlarkPackageArgs{ - PackageId: package_id, + PackageId: packageId, SerializedParams: &jsonString, DryRun: request.Body.DryRun, Parallelism: request.Body.Parallelism, @@ -592,38 +578,37 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkPackagesPack stream, err := (*apiContainerClient).RunStarlarkPackage(ctxWithCancel, &runStarlarkPackageArgs) if err != nil { cancelCtxFunc() - logrus.Errorf("Can't run Starlark package using gRPC call with enclave %s, error: %s", enclave_identifier, err) - return nil, stacktrace.Propagate(err, "Can't run Starlark package using gRPC call with enclave %s", enclave_identifier) + return nil, stacktrace.Propagate(err, "Can't run Starlark package using gRPC call with enclave %s", enclaveIdentifier) } asyncLogs := streaming.NewAsyncStarlarkLogs(cancelCtxFunc) go asyncLogs.AttachStream(stream) isAsyncRetrieval := utils.DerefWith(request.Params.RetrieveLogsAsync, true) - var sync_logs api_type.StarlarkRunResponse_StarlarkExecutionLogs + var syncLogs api_type.StarlarkRunResponse_StarlarkExecutionLogs if !isAsyncRetrieval { logs := utils.MapList(asyncLogs.WaitAndConsumeAll(), to_http.ToHttpStarlarkRunResponseLine) - sync_logs.FromStarlarkRunLogs(utils.FilterListNils(logs)) + syncLogs.FromStarlarkRunLogs(utils.FilterListNils(logs)) } else { - async_uuid := manager.asyncStarlarkLogs.Add(&asyncLogs) - var async_logs api_type.AsyncStarlarkExecutionLogs - async_logs.AsyncStarlarkExecutionLogs.StarlarkExecutionUuid = string(async_uuid) - sync_logs.FromAsyncStarlarkExecutionLogs(async_logs) + asyncUuid := manager.asyncStarlarkLogs.Add(&asyncLogs) + var asyncLogs api_type.AsyncStarlarkExecutionLogs + asyncLogs.AsyncStarlarkExecutionLogs.StarlarkExecutionUuid = string(asyncUuid) + syncLogs.FromAsyncStarlarkExecutionLogs(asyncLogs) } - response := api_type.StarlarkRunResponse{StarlarkExecutionLogs: &sync_logs} + response := api_type.StarlarkRunResponse{StarlarkExecutionLogs: &syncLogs} return api.PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId200JSONResponse(response), nil } // (POST /enclaves/{enclave_identifier}/starlark/scripts) func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx context.Context, request api.PostEnclavesEnclaveIdentifierStarlarkScriptsRequestObject) (api.PostEnclavesEnclaveIdentifierStarlarkScriptsResponseObject, error) { - enclave_identifier := request.EnclaveIdentifier - apiContainerClient, responseErr := manager.GetApiClientOrResponseError(enclave_identifier) + enclaveIdentifier := request.EnclaveIdentifier + apiContainerClient, responseErr := manager.getApiClientOrResponseError(enclaveIdentifier) if responseErr != nil { return api.PostEnclavesEnclaveIdentifierStarlarkScriptsdefaultJSONResponse{Body: *responseErr, StatusCode: int(responseErr.Code)}, nil } - logrus.Infof("Run Starlark script on enclave %s", enclave_identifier) + logrus.Infof("Run Starlark script on enclave %s", enclaveIdentifier) flags := utils.MapList(utils.DerefWith(request.Body.ExperimentalFeatures, []api_type.KurtosisFeatureFlag{}), to_grpc.ToGrpcFeatureFlag) jsonString := utils.MapPointer(request.Body.Params, func(v map[string]interface{}) string { @@ -650,23 +635,23 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx stream, err := (*apiContainerClient).RunStarlarkScript(ctxWithCancel, &runStarlarkScriptArgs) if err != nil { cancelCtxFunc() - logrus.Errorf("Can't run Starlark package using gRPC call with enclave %s, error: %s", enclave_identifier, err) - return nil, stacktrace.Propagate(err, "Can't run Starlark script package using gRPC call with enclave %s", enclave_identifier) + logrus.Errorf("Can't run Starlark package using gRPC call with enclave %s, error: %s", enclaveIdentifier, err) + return nil, stacktrace.Propagate(err, "Can't run Starlark script package using gRPC call with enclave %s", enclaveIdentifier) } asyncLogs := streaming.NewAsyncStarlarkLogs(cancelCtxFunc) go asyncLogs.AttachStream(stream) logs := utils.MapList(asyncLogs.WaitAndConsumeAll(), to_http.ToHttpStarlarkRunResponseLine) - var sync_logs api_type.StarlarkRunResponse_StarlarkExecutionLogs - sync_logs.FromStarlarkRunLogs(utils.FilterListNils(logs)) + var syncLogs api_type.StarlarkRunResponse_StarlarkExecutionLogs + syncLogs.FromStarlarkRunLogs(utils.FilterListNils(logs)) - response := api_type.StarlarkRunResponse{StarlarkExecutionLogs: &sync_logs} + response := api_type.StarlarkRunResponse{StarlarkExecutionLogs: &syncLogs} return api.PostEnclavesEnclaveIdentifierStarlarkScripts200JSONResponse(response), nil } // =============================================================================================================== -// =============================================================================================================== +// ===================================== Internal Functions ===================================================== // =============================================================================================================== // GetGrpcClientConn returns a client conn dialed in to the local port @@ -699,8 +684,8 @@ func getGrpcClientConn(enclaveInfo types.EnclaveInfo, connectOnHostMachine bool) return grpcConnection, nil } -func (manager enclaveRuntime) GetApiClientOrResponseError(enclave_uuid string) (*rpc_api.ApiContainerServiceClient, *api_type.ResponseInfo) { - client, err := manager.GetGrpcClientForEnclaveUUID(enclave_uuid) +func (manager enclaveRuntime) getApiClientOrResponseError(enclaveUuid string) (*rpc_api.ApiContainerServiceClient, *api_type.ResponseInfo) { + client, err := manager.getGrpcClientForEnclaveUUID(enclaveUuid) if err != nil { return nil, &api_type.ResponseInfo{ Type: api_type.ERROR, @@ -711,23 +696,60 @@ func (manager enclaveRuntime) GetApiClientOrResponseError(enclave_uuid string) ( if client == nil { return nil, &api_type.ResponseInfo{ Type: api_type.INFO, - Message: fmt.Sprintf("enclave '%s' not found", enclave_uuid), + Message: fmt.Sprintf("enclave '%s' not found", enclaveUuid), Code: http.StatusNotFound, } } return client, nil } -func (manager enclaveRuntime) GetGrpcClientForEnclaveUUID(enclave_uuid string) (*rpc_api.ApiContainerServiceClient, error) { +func (manager enclaveRuntime) getGrpcClientForEnclaveUUID(enclaveUuid string) (*rpc_api.ApiContainerServiceClient, error) { err := manager.refreshEnclaveConnections() if err != nil { return nil, err } - client, found := manager.remoteApiContainerClient[enclave_uuid] + client, found := manager.remoteApiContainerClient[enclaveUuid] if !found { return nil, nil } return &client, nil } + +func (runtime enclaveRuntime) refreshEnclaveConnections() error { + runtime.lock.Lock() + defer runtime.lock.Unlock() + + enclaves, err := runtime.enclaveManager.GetEnclaves(runtime.ctx) + if err != nil { + return stacktrace.Propagate(err, "failed to retrieve the list of enclaves") + } + + // Clean up removed enclaves (or enclaves not in the list of enclaves anymore) + for uuid := range runtime.remoteApiContainerClient { + _, found := enclaves[uuid] + if !found { + delete(runtime.remoteApiContainerClient, uuid) + } + } + + // Add new enclaves - assuming enclaves properties (API container connection) are immutable + for uuid, info := range enclaves { + _, found := runtime.remoteApiContainerClient[uuid] + if !found && info != nil { + conn, err := getGrpcClientConn(*info, runtime.connectOnHostMachine) + if err != nil { + return stacktrace.Propagate(err, "Failed to establish gRPC connection with enclave manager service on enclave %s", uuid) + } + if conn == nil { + logrus.Warnf("Unavailable gRPC connection to enclave '%s', skipping it!", uuid) + continue + } + apiContainerClient := rpc_api.NewApiContainerServiceClient(conn) + runtime.remoteApiContainerClient[uuid] = apiContainerClient + } + } + + return nil +} From bf3d37bac664c7a9052524e4cb19116b8837d89e Mon Sep 17 00:00:00 2001 From: lostbean Date: Mon, 4 Dec 2023 10:05:32 -0300 Subject: [PATCH 76/95] clean-up utils --- engine/server/engine/utils/list.go | 16 ++-------------- engine/server/engine/utils/map.go | 8 ++++---- engine/server/engine/utils/pointer.go | 4 ++-- 3 files changed, 8 insertions(+), 20 deletions(-) diff --git a/engine/server/engine/utils/list.go b/engine/server/engine/utils/list.go index fbadf75387..250e8f12f5 100644 --- a/engine/server/engine/utils/list.go +++ b/engine/server/engine/utils/list.go @@ -1,25 +1,13 @@ package utils -func MapList[T, U any](data []T, f func(T) U) []U { +func MapList[T, U any](data []T, function func(T) U) []U { res := make([]U, 0, len(data)) for _, e := range data { - res = append(res, f(e)) + res = append(res, function(e)) } return res } -func MapListStopOnError[T, U any](data []T, f func(T) (U, error)) ([]U, error) { - res := make([]U, 0, len(data)) - for _, e := range data { - y, err := f(e) - if err != nil { - return res, err - } - res = append(res, y) - } - return res, nil -} - func FilterListNils[T any](data []*T) []T { filterList := make([]T, 0) for _, elem := range data { diff --git a/engine/server/engine/utils/map.go b/engine/server/engine/utils/map.go index 764337ab37..ee95691865 100644 --- a/engine/server/engine/utils/map.go +++ b/engine/server/engine/utils/map.go @@ -1,18 +1,18 @@ package utils -func MapMapValues[T, U any, K comparable](data map[K]T, f func(T) U) map[K]U { +func MapMapValues[T, U any, K comparable](data map[K]T, function func(T) U) map[K]U { mappedMap := make(map[K]U, len(data)) for key, value := range data { - mappedMap[key] = f(value) + mappedMap[key] = function(value) } return mappedMap } -func NewMapFromList[U any, K comparable](data []K, f func(K) U) map[K]U { +func NewMapFromList[U any, K comparable](data []K, function func(K) U) map[K]U { mappedMap := make(map[K]U, len(data)) for _, key := range data { - mappedMap[key] = f(key) + mappedMap[key] = function(key) } return mappedMap diff --git a/engine/server/engine/utils/pointer.go b/engine/server/engine/utils/pointer.go index 1532465753..fce6cc32c2 100644 --- a/engine/server/engine/utils/pointer.go +++ b/engine/server/engine/utils/pointer.go @@ -7,10 +7,10 @@ func DerefWith[T any](value *T, defaultValue T) T { return *value } -func MapPointer[T any, U any](value *T, foo func(T) U) *U { +func MapPointer[T any, U any](value *T, function func(T) U) *U { if value == nil { return nil } - mapped := foo(*value) + mapped := function(*value) return &mapped } From 663f93926d432e4690f94c08b1c4240d3835965f Mon Sep 17 00:00:00 2001 From: lostbean Date: Mon, 4 Dec 2023 10:40:37 -0300 Subject: [PATCH 77/95] report existing file artifact upload --- .../http_rest/api_types/api_types.gen.go | 72 ++++++++++++ .../core_rest_api/api_container_server.gen.go | 103 +++++++++--------- api/openapi/specs/kurtosis_api.yaml | 10 +- .../engine/server/enclave_rest_api_handler.go | 39 +++++-- 4 files changed, 163 insertions(+), 61 deletions(-) diff --git a/api/golang/http_rest/api_types/api_types.gen.go b/api/golang/http_rest/api_types/api_types.gen.go index 398ee2fe01..bb2da1bd7a 100644 --- a/api/golang/http_rest/api_types/api_types.gen.go +++ b/api/golang/http_rest/api_types/api_types.gen.go @@ -236,6 +236,16 @@ type FileArtifactReference struct { Uuid string `json:"uuid"` } +// FileArtifactUploadResult defines model for FileArtifactUploadResult. +type FileArtifactUploadResult struct { + FileArtifactUploadResult *FileArtifactUploadResult_FileArtifactUploadResult `json:"file_artifact_upload_result,omitempty"` +} + +// FileArtifactUploadResult_FileArtifactUploadResult defines model for FileArtifactUploadResult.FileArtifactUploadResult. +type FileArtifactUploadResult_FileArtifactUploadResult struct { + union json.RawMessage +} + // HttpMethodAvailability defines model for HttpMethodAvailability. type HttpMethodAvailability string @@ -719,6 +729,68 @@ type PostEnclavesEnclaveIdentifierStarlarkScriptsJSONRequestBody = RunStarlarkSc // PostEnclavesEnclaveIdentifierStatusJSONRequestBody defines body for PostEnclavesEnclaveIdentifierStatus for application/json ContentType. type PostEnclavesEnclaveIdentifierStatusJSONRequestBody = EnclaveTargetStatus +// AsFileArtifactReference returns the union data inside the FileArtifactUploadResult_FileArtifactUploadResult as a FileArtifactReference +func (t FileArtifactUploadResult_FileArtifactUploadResult) AsFileArtifactReference() (FileArtifactReference, error) { + var body FileArtifactReference + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromFileArtifactReference overwrites any union data inside the FileArtifactUploadResult_FileArtifactUploadResult as the provided FileArtifactReference +func (t *FileArtifactUploadResult_FileArtifactUploadResult) FromFileArtifactReference(v FileArtifactReference) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeFileArtifactReference performs a merge with any union data inside the FileArtifactUploadResult_FileArtifactUploadResult, using the provided FileArtifactReference +func (t *FileArtifactUploadResult_FileArtifactUploadResult) MergeFileArtifactReference(v FileArtifactReference) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JsonMerge(b, t.union) + t.union = merged + return err +} + +// AsResponseInfo returns the union data inside the FileArtifactUploadResult_FileArtifactUploadResult as a ResponseInfo +func (t FileArtifactUploadResult_FileArtifactUploadResult) AsResponseInfo() (ResponseInfo, error) { + var body ResponseInfo + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromResponseInfo overwrites any union data inside the FileArtifactUploadResult_FileArtifactUploadResult as the provided ResponseInfo +func (t *FileArtifactUploadResult_FileArtifactUploadResult) FromResponseInfo(v ResponseInfo) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeResponseInfo performs a merge with any union data inside the FileArtifactUploadResult_FileArtifactUploadResult, using the provided ResponseInfo +func (t *FileArtifactUploadResult_FileArtifactUploadResult) MergeResponseInfo(v ResponseInfo) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JsonMerge(b, t.union) + t.union = merged + return err +} + +func (t FileArtifactUploadResult_FileArtifactUploadResult) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *FileArtifactUploadResult_FileArtifactUploadResult) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + // AsStarlarkInterpretationError returns the union data inside the StarlarkError_Error as a StarlarkInterpretationError func (t StarlarkError_Error) AsStarlarkInterpretationError() (StarlarkInterpretationError, error) { var body StarlarkInterpretationError diff --git a/api/golang/http_rest/core_rest_api/api_container_server.gen.go b/api/golang/http_rest/core_rest_api/api_container_server.gen.go index 4536ff112d..c27e703b21 100644 --- a/api/golang/http_rest/core_rest_api/api_container_server.gen.go +++ b/api/golang/http_rest/core_rest_api/api_container_server.gen.go @@ -565,7 +565,7 @@ type PostEnclavesEnclaveIdentifierArtifactsLocalFileResponseObject interface { VisitPostEnclavesEnclaveIdentifierArtifactsLocalFileResponse(w http.ResponseWriter) error } -type PostEnclavesEnclaveIdentifierArtifactsLocalFile200JSONResponse map[string]FileArtifactReference +type PostEnclavesEnclaveIdentifierArtifactsLocalFile200JSONResponse map[string]FileArtifactUploadResult func (response PostEnclavesEnclaveIdentifierArtifactsLocalFile200JSONResponse) VisitPostEnclavesEnclaveIdentifierArtifactsLocalFileResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -1570,56 +1570,57 @@ var swaggerSpec = []string{ "KF8lvFB5ERDTYymLDUh0MX/38n90DMwzqwb7NUwFQmP5EELvCIVjF+a/re+9i1Y4YJjqYEEAxYpcmzDB", "RgK0SjNEgXOW5LdAhH1OfivDfb1EjAhDi60y/ladkH/7a5CQCr6pJBdwTeAmQEq0IMosD98UcvY0RmRZ", "A5lSfiPRT5JsCMUmgLiYjP/3hUQv1oCzFz/vJbwPYTR++6g9gyUIYGmAEnqYRH4gargwzVPxOqadUalT", - "UpanEWu1rQN/dLM2/qyFQStxojS9zZRCFQJCB+cN3JNst0Nbl6YyGIdo25FX0BLp1NH7U22PdJAV1D5j", - "rUff8humPbxPToDbKvD44+Xx/507DfhpfH5u9ZrfxH6O4sh/Cm3190IoLol8B1jj/o7iVXizyVkynpzP", - "Zxcn8/HZ5Dw5OT750Nyva0RoW223A3K3xgIydGYoKdFPFxIy9GaLPhmPlgI6dTkv+XPbAauc0SQXXPGU", - "06DarYL2ASpRCcykicnra/YZy7mfMfUTbuNIh26JIhvgId2qgxAT3LkRKCuEQUTzpQN8H0+WKYMAxCEe", - "bXjgbX9n12gU3STagJR4BT0mblgsMNdjd9EyC1R7xBayPoTmbkvPlaez2dksiqPx5N1ZFEeXx7NJF1PO", - "wCSSppySdNshBaf/OJ05iSvlqxQA/TGKveAFtyiYD1umNmEWID7lDJK8+twE43INam1C0iplV0WjZnJm", - "ctZcHV2xKjJXWu/VJ/mUTl5QChlaCr4x34+n4xNEeYpptb7iAo7QeImIeiER3vlslibS5OOu2BpfA1oA", - "MFSYEBUyVEitaG3EuoM/ygXhNkWGKdXD2jSyeJhAuRsNh7lB4z1RH4oFWsCSi3r4ZM5XVmxcpgtiTfUi", - "S3ymMJgkdZkKk4yBTa62IcNk1ykkiLuvkYltIgrWP9scaxAVHTsLsgGm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UtuAToJQwuCQkkOPa7moWyL2", - "MA3Eretau85BomNMjc7h4YOPKTD9EPXTPaeOc9uoBbCuD3oeOxGEoQ+zWcHeEUbkGrLT66AoikJ7IHZI", - "AuExWjoKlsgiTUHKZUH3SmRVxbDHqrRW3kuDAMB7KBAuSyuzSlUp2Edb3HWQEZkVzN98fdRCFjAgtaFT", - "wVc6Vg4UVbgvSdiSp4UQwFQiFeTlkOHFTI3ph13Acu166nnyLjqoDXdzyTBoe5mgSa095z+rveTYW7jn", - "ywWHucU9dZBDvVvPoNatHYLHR2cP9vLzrHopcqiXX1n+wV76QT59XRaGzmmbpgN2a6rBoRMvsalLPwDE", - "JdcnWZ3bbtDT4sHrcsDz2JTW/n3S5OnRgvFmz4fh4O9O2IuA3zoMNxdgaqh8CdU7wTcuKdQGdthVS7Ow", - "KZhL44VIbZjf8fJuITktFCA70r60qWVK7a92o/J+nefE3a/vT7fVAOgplDLkuYRFg0Ih1cIFoEtYoGY5", - "2sA7isPpVwgayGPOPiLFkb9es69efGHcIKroZXuo0a4cCuYL5ydTlys8P5lPfaLw7bSWJJyf6L/05yiO", - "9KfPcehZgbfjiiiqv/lEHpqdns+XBUXH03EUR9cgpNv+6M9HrzSoPAeGcxK9jv5y9OroVWRfcZkzGLnE", - "u/7jNq7+HK2JVFxsd3/+3n4yeTtkzMjT3uy6AsM3mhmMLhln0evoPahTt4T7f3VxdlzOjhvPVzssVDVk", - "FHjieft557XEL69eHfRWYpDLFy7ZbBcSt15TnJfurX+ZZW607a1q164lPiP79MO8wCg2G6yPMPpIpDIv", - "eprCZEprsPZgfvVPYSPjVww9y5EpLHrps7M5l4FznXI54GA/6pXe2eTmA52wf4Wz7SZa7aHOaOeVzu09", - "meQuVz77eKa0aU/BNJYW0hWPNWqzfcF2qYI04Oh8KxVs7s1TAjZcQYupdqwEUCp9/Vv95VdN5eMddq9q", - "5m5gsQeFu7DwzAD+iDz8II+5wlY8xFLddrz5HO6+knIHiXgSATjOMmSZ0XK/4o/D8O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u3+3v/lCG", + "FTZulsbDc37J3g1co4Di8857on3XRPHEUpTQDkKWzr5dWfvN+j96dgcp9Y9X5qCOtABdRXaW8/4E58Yt", + "xx7koK1q6+tKys8NhEFF+IdI/iGSvz+RlCAIpuQ3yBJZ8vaenGJrSsjJObc58XEZTwayPMcslJon2mqn", + "nFIwUOtj0/FYbA/Rpebd/b0L1IYEqpMaC7hdg/kCl8vfH372LeIB7FjGXEo0kNi7aPsQKjBdpNrat+9c", + "OpzpWoJ0UMLQhCn3oXcuyDVWkJA8wVnWcYEzniL9EaTcvS0mTJIMdso2OjfRwUZvvrUPZxMIhuxDXiwo", + "SbsxmJrvdST+xAul4f5THXB0swYBTewkEoDTNV5QuGKTs/npa3TpL+u1/vc5pWoCe6GQKBgjbNUsEslI", + "pr9lsCRMi9HWZN+lqX4xd704/QosQxkHs4gscpOeF6D/p71di2eN9EseJLYlx+PQ2vP9sLy2Y3af1X4i", + "6T5/SMnelY9dZu6S/Rap4pp09yiG58vIe+PVmxp+Eu8k7FUEPIF6uc0+R2GAK9DvH7c2EDYJkORlFmBP", + "8qKWMmia/soHCdnDQx2ERqFQe35o5ya1eikRPJ4ut7VFpCDn+2tmcxHdZjn/87BkrV9tzBSIXIAy+TG7", + "9r6UrZ/7D0xJdod55aWzm/a5dVtjfu8lQnOJgAD6m2DoIVfSnWoLQVQO33svvbt9HyphH4d0/CqVKNKw", + "0tFThmPUGL0XofrGAwYv+R6Ue9DAYlVsfEXvIH0ZWPbYLRK80TaHo52VZIeeLbVS+96tYIlM5FeS55CF", + "CoDiKOeS+B0ORGPqp7aUl/8QgDGukbAT2wbYA8+qJGrozHrpIyAXILXW0+oyTKaautXLmSD3oDCvmhXa", + "cyCO09ph7UYdtNiwgTZS24BOglDC4JDaSY9ruahbIvYwDcSt6/avzkGiY0yNzuHhg48pMP0Q9dM9p45z", + "26gFsK4Peh47EYShD7NZwd4RRuQastProCiKQnsgdkgC4TFaOgqWyCJNQcplQfdKZFWOsceqtFbeS4MA",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ykVQcnfOqwIC1wV", + "W9ze/n8AAAD//zXpwHfnZQAA", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/api/openapi/specs/kurtosis_api.yaml b/api/openapi/specs/kurtosis_api.yaml index e0d30fc9b5..857fc3a308 100644 --- a/api/openapi/specs/kurtosis_api.yaml +++ b/api/openapi/specs/kurtosis_api.yaml @@ -448,7 +448,7 @@ paths: schema: type: object additionalProperties: - $ref: "#/components/schemas/FileArtifactReference" + $ref: "#/components/schemas/FileArtifactUploadResult" /enclaves/{enclave_identifier}/artifacts/remote-file: post: @@ -1416,6 +1416,14 @@ components: - exit_code - log_output + FileArtifactUploadResult: + type: object + properties: + file_artifact_upload_result: + oneOf: + - $ref: "#/components/schemas/FileArtifactReference" + - $ref: "#/components/schemas/ResponseInfo" + FileArtifactReference: type: object properties: diff --git a/engine/server/engine/server/enclave_rest_api_handler.go b/engine/server/engine/server/enclave_rest_api_handler.go index 5148f5d502..130607e0ff 100644 --- a/engine/server/engine/server/enclave_rest_api_handler.go +++ b/engine/server/engine/server/enclave_rest_api_handler.go @@ -95,7 +95,7 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierArtifactsLocalFile(c } logrus.Infof("Uploading file artifact to enclave %s", enclaveIdentifier) - uploadedArtifacts := map[string]api_type.FileArtifactReference{} + uploadedArtifacts := map[string]api_type.FileArtifactUploadResult{} for { // Get next part (file) from the the multipart POST request part, err := request.Body.NextPart() @@ -110,7 +110,8 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierArtifactsLocalFile(c } clientStream := grpc_file_streaming.NewClientStream[rpc_api.StreamedDataChunk, rpc_api.UploadFilesArtifactResponse](client) - response, err := clientStream.SendData( + var result api_type.FileArtifactUploadResult + uploadResult, err := clientStream.SendData( filename, part, unknownStreamLength, @@ -124,16 +125,36 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierArtifactsLocalFile(c }, nil }, ) + if err != nil { + logrus.Errorf("Failed to upload file %s with error: %v", filename, err) + response := api_type.ResponseInfo{ + Code: http.StatusInternalServerError, + Type: api_type.ERROR, + Message: fmt.Sprintf("Failed to upload file: %s", filename), + } + result.FileArtifactUploadResult.FromResponseInfo(response) + uploadedArtifacts[filename] = result + continue + } - // The response is nil when a file artifact with the same has already been uploaded - // TODO (edgar) Is this the expected behavior? If so, we should be explicit about it. - if response != nil { - artifactResponse := api_type.FileArtifactReference{ - Name: response.Name, - Uuid: response.Uuid, + if uploadResult == nil { + logrus.Warnf("File %s has been already uploaded", filename) + response := api_type.ResponseInfo{ + Code: http.StatusConflict, + Type: api_type.WARNING, + Message: fmt.Sprintf("File %s has been already uploaded", filename), } - uploadedArtifacts[filename] = artifactResponse + result.FileArtifactUploadResult.FromResponseInfo(response) + uploadedArtifacts[filename] = result + continue + } + + artifactResponse := api_type.FileArtifactReference{ + Name: uploadResult.Name, + Uuid: uploadResult.Uuid, } + result.FileArtifactUploadResult.FromFileArtifactReference(artifactResponse) + uploadedArtifacts[filename] = result } return api.PostEnclavesEnclaveIdentifierArtifactsLocalFile200JSONResponse(uploadedArtifacts), nil From 07c7f8e47f0dfab5a5fabea5b64b8cde1bd21ec7 Mon Sep 17 00:00:00 2001 From: lostbean Date: Mon, 4 Dec 2023 14:00:45 -0300 Subject: [PATCH 78/95] do not panic --- .../engine/server/enclave_rest_api_handler.go | 16 +++++++++------- engine/server/engine/utils/pointer.go | 11 +++++++++++ 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/engine/server/engine/server/enclave_rest_api_handler.go b/engine/server/engine/server/enclave_rest_api_handler.go index 130607e0ff..5e81cfd63f 100644 --- a/engine/server/engine/server/enclave_rest_api_handler.go +++ b/engine/server/engine/server/enclave_rest_api_handler.go @@ -279,7 +279,7 @@ func (manager *enclaveRuntime) GetEnclavesEnclaveIdentifierArtifactsArtifactIden ContentLength: int64(unknownStreamLength), } - return api.GetEnclavesEnclaveIdentifierArtifactsArtifactIdentifierDownload200ApplicationoctetStreamResponse(response), nil + return response, nil } // (GET /enclaves/{enclave_identifier}/services) @@ -572,7 +572,8 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkPackagesPack jsonParams := utils.DerefWith(request.Body.Params, map[string]interface{}{}) jsonBlob, err := json.Marshal(jsonParams) if err != nil { - panic("Failed to serialize parameters") + stacktrace.Propagate(err, "I'm actually panicking here. Re-serializing a already deserialized JSON parameter should never fail.") + return nil, err } jsonString := string(jsonBlob) @@ -632,13 +633,14 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx logrus.Infof("Run Starlark script on enclave %s", enclaveIdentifier) flags := utils.MapList(utils.DerefWith(request.Body.ExperimentalFeatures, []api_type.KurtosisFeatureFlag{}), to_grpc.ToGrpcFeatureFlag) - jsonString := utils.MapPointer(request.Body.Params, func(v map[string]interface{}) string { + jsonString, err := utils.MapPointerWithError(request.Body.Params, func(v map[string]interface{}) (string, error) { jsonBlob, err := json.Marshal(v) - if err != nil { - panic("Failed to serialize parsed JSON") - } - return string(jsonBlob) + return string(jsonBlob), err }) + if err != nil { + stacktrace.Propagate(err, "I'm actually panicking here. Re-serializing a already deserialized JSON parameter should never fail.") + return nil, err + } runStarlarkScriptArgs := rpc_api.RunStarlarkScriptArgs{ SerializedScript: request.Body.SerializedScript, diff --git a/engine/server/engine/utils/pointer.go b/engine/server/engine/utils/pointer.go index fce6cc32c2..8ba51b116d 100644 --- a/engine/server/engine/utils/pointer.go +++ b/engine/server/engine/utils/pointer.go @@ -14,3 +14,14 @@ func MapPointer[T any, U any](value *T, function func(T) U) *U { mapped := function(*value) return &mapped } + +func MapPointerWithError[T any, U any](value *T, function func(T) (U, error)) (*U, error) { + if value == nil { + return nil, nil + } + mapped, err := function(*value) + if err != nil { + return nil, err + } + return &mapped, nil +} From 7e41cfc1964aefd53aff13ab4471b19830b678de Mon Sep 17 00:00:00 2001 From: lostbean Date: Mon, 4 Dec 2023 17:29:57 -0300 Subject: [PATCH 79/95] add exhaustive linter --- .golangci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.golangci.yml b/.golangci.yml index dfebdbb9ff..4ce75172eb 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -4,5 +4,6 @@ linters: - exportloopref - gomnd - staticcheck + - exhaustive max-issues-per-linter: 0 sort-results: true From 031cb3f5113317e066ab3e2362e7530fcd9ac28b Mon Sep 17 00:00:00 2001 From: lostbean Date: Mon, 4 Dec 2023 23:04:37 -0300 Subject: [PATCH 80/95] improve responses on engine api --- .../engine/server/engine_rest_api_handler.go | 141 ++++++++++++++---- 1 file changed, 115 insertions(+), 26 deletions(-) diff --git a/engine/server/engine/server/engine_rest_api_handler.go b/engine/server/engine/server/engine_rest_api_handler.go index 68ba8908ad..6e5b40f3c3 100644 --- a/engine/server/engine/server/engine_rest_api_handler.go +++ b/engine/server/engine/server/engine_rest_api_handler.go @@ -2,6 +2,8 @@ package server import ( "context" + "fmt" + "net/http" "github.com/kurtosis-tech/kurtosis/engine/server/engine/centralized_logs/client_implementations/persistent_volume/log_file_manager" "github.com/kurtosis-tech/kurtosis/engine/server/engine/enclave_manager" @@ -9,7 +11,6 @@ import ( "github.com/kurtosis-tech/kurtosis/engine/server/engine/types" "github.com/kurtosis-tech/kurtosis/engine/server/engine/utils" "github.com/kurtosis-tech/kurtosis/metrics-library/golang/lib/metrics_client" - "github.com/kurtosis-tech/stacktrace" "github.com/sirupsen/logrus" api_type "github.com/kurtosis-tech/kurtosis/api/golang/http_rest/api_types" @@ -32,11 +33,19 @@ type EngineRuntime struct { func (engine EngineRuntime) DeleteEnclaves(ctx context.Context, request api.DeleteEnclavesRequestObject) (api.DeleteEnclavesResponseObject, error) { removedEnclaveUuidsAndNames, err := engine.EnclaveManager.Clean(ctx, *request.Params.RemoveAll) if err != nil { - return nil, stacktrace.Propagate(err, "An error occurred while cleaning enclaves") + response := internalErrorResponseInfof(err, "An error occurred while cleaning enclaves") + return api.DeleteEnclavesdefaultJSONResponse{ + Body: response, + StatusCode: int(response.Code), + }, nil } if *request.Params.RemoveAll { if err = engine.LogFileManager.RemoveAllLogs(); err != nil { - return nil, stacktrace.Propagate(err, "An error occurred removing all logs.") + response := internalErrorResponseInfof(err, "An error occurred removing all logs") + return api.DeleteEnclavesdefaultJSONResponse{ + Body: response, + StatusCode: int(response.Code), + }, nil } } removedApiResponse := utils.MapList(removedEnclaveUuidsAndNames, to_http.ToHttpEnclaveNameAndUuid) @@ -48,7 +57,11 @@ func (engine EngineRuntime) DeleteEnclaves(ctx context.Context, request api.Dele func (engine EngineRuntime) GetEnclaves(ctx context.Context, request api.GetEnclavesRequestObject) (api.GetEnclavesResponseObject, error) { infoForEnclaves, err := engine.EnclaveManager.GetEnclaves(ctx) if err != nil { - return nil, stacktrace.Propagate(err, "An error occurred getting info for enclaves") + response := internalErrorResponseInfof(err, "An error occurred getting info for enclaves") + return api.GetEnclavesdefaultJSONResponse{ + Body: response, + StatusCode: int(response.Code), + }, nil } response := utils.MapMapValues(infoForEnclaves, func(enclave *types.EnclaveInfo) api_type.EnclaveInfo { return to_http.ToHttpEnclaveInfo(*enclave) }) return api.GetEnclaves200JSONResponse(response), nil @@ -57,35 +70,48 @@ func (engine EngineRuntime) GetEnclaves(ctx context.Context, request api.GetEncl // Create Enclave // (POST /enclaves) func (engine EngineRuntime) PostEnclaves(ctx context.Context, request api.PostEnclavesRequestObject) (api.PostEnclavesResponseObject, error) { - enclave_mode := utils.DerefWith(request.Body.Mode, api_type.TEST) - enclave_name := request.Body.EnclaveName - apic_version_tag := request.Body.ApiContainerVersionTag + enclaveMode := utils.DerefWith(request.Body.Mode, api_type.TEST) + enclaveName := request.Body.EnclaveName + apicVersionTag := request.Body.ApiContainerVersionTag - if err := engine.MetricsClient.TrackCreateEnclave(enclave_name, subnetworkDisableBecauseItIsDeprecated); err != nil { + if err := engine.MetricsClient.TrackCreateEnclave(enclaveName, subnetworkDisableBecauseItIsDeprecated); err != nil { logrus.Warn("An error occurred while logging the create enclave event") } logrus.Debugf("request: %+v", request) apiContainerLogLevel, err := logrus.ParseLevel(utils.DerefWith(request.Body.ApiContainerLogLevel, "INFO")) if err != nil { - return nil, stacktrace.Propagate(err, "An error occurred parsing the log level string '%v':", request.Body.ApiContainerLogLevel) + logrus.Infof("An error occurred parsing the log level string '%v':", request.Body.ApiContainerLogLevel) + response := api_type.ResponseInfo{ + Code: http.StatusBadRequest, + Type: api_type.ERROR, + Message: fmt.Sprintf("An error occurred parsing the log level string '%v':", request.Body.ApiContainerLogLevel), + } + return api.PostEnclavesdefaultJSONResponse{ + Body: response, + StatusCode: int(response.Code), + }, nil } isProduction := false - if enclave_mode == api_type.PRODUCTION { + if enclaveMode == api_type.PRODUCTION { isProduction = true } enclaveInfo, err := engine.EnclaveManager.CreateEnclave( ctx, engine.ImageVersionTag, - apic_version_tag, + apicVersionTag, apiContainerLogLevel, - enclave_name, + enclaveName, isProduction, ) if err != nil { - return nil, stacktrace.Propagate(err, "An error occurred creating new enclave with name '%v'", request.Body.EnclaveName) + response := internalErrorResponseInfof(err, "An error occurred creating new enclave with name '%v'", request.Body.EnclaveName) + return api.PostEnclavesdefaultJSONResponse{ + Body: response, + StatusCode: int(response.Code), + }, nil } response := to_http.ToHttpEnclaveInfo(*enclaveInfo) @@ -97,10 +123,15 @@ func (engine EngineRuntime) PostEnclaves(ctx context.Context, request api.PostEn func (engine EngineRuntime) GetEnclavesHistory(ctx context.Context, request api.GetEnclavesHistoryRequestObject) (api.GetEnclavesHistoryResponseObject, error) { allIdentifiers, err := engine.EnclaveManager.GetExistingAndHistoricalEnclaveIdentifiers() if err != nil { - return nil, stacktrace.Propagate(err, "An error occurred while fetching enclave identifiers") + response := internalErrorResponseInfof(err, "An error occurred while fetching enclave identifiers") + return api.GetEnclavesHistorydefaultJSONResponse{ + Body: response, + StatusCode: int(response.Code), + }, nil } - identifiers_map_api := utils.MapList(allIdentifiers, to_http.ToHttpEnclaveIdentifiers) - return api.GetEnclavesHistory200JSONResponse(identifiers_map_api), nil + + identifiersMapApi := utils.MapList(allIdentifiers, to_http.ToHttpEnclaveIdentifiers) + return api.GetEnclavesHistory200JSONResponse(identifiersMapApi), nil } // Destroy Enclave @@ -113,8 +144,13 @@ func (engine EngineRuntime) DeleteEnclavesEnclaveIdentifier(ctx context.Context, } if err := engine.EnclaveManager.DestroyEnclave(ctx, enclaveIdentifier); err != nil { - return nil, stacktrace.Propagate(err, "An error occurred destroying enclave with identifier '%v':", enclaveIdentifier) + response := internalErrorResponseInfof(err, "An error occurred destroying enclave with identifier '%v':", enclaveIdentifier) + return api.DeleteEnclavesEnclaveIdentifierdefaultJSONResponse{ + Body: response, + StatusCode: int(response.Code), + }, nil } + return api.DeleteEnclavesEnclaveIdentifier200Response{}, nil } @@ -123,13 +159,22 @@ func (engine EngineRuntime) DeleteEnclavesEnclaveIdentifier(ctx context.Context, func (engine EngineRuntime) GetEnclavesEnclaveIdentifier(ctx context.Context, request api.GetEnclavesEnclaveIdentifierRequestObject) (api.GetEnclavesEnclaveIdentifierResponseObject, error) { infoForEnclaves, err := engine.EnclaveManager.GetEnclaves(ctx) if err != nil { - return nil, stacktrace.Propagate(err, "An error occurred getting info for enclaves") + response := internalErrorResponseInfof(err, "An error occurred getting info for enclaves") + return api.GetEnclavesEnclaveIdentifierdefaultJSONResponse{ + Body: response, + StatusCode: int(response.Code), + }, nil } + info, found := infoForEnclaves[request.EnclaveIdentifier] if !found { - notFoundErr := stacktrace.NewError("Enclave '%s' not found.", request.EnclaveIdentifier) - return nil, notFoundErr + response := enclaveNotFoundResponseInfo(request.EnclaveIdentifier) + return api.GetEnclavesEnclaveIdentifierdefaultJSONResponse{ + Body: response, + StatusCode: int(response.Code), + }, nil } + response := to_http.ToHttpEnclaveInfo(*info) return api.GetEnclavesEnclaveIdentifier200JSONResponse(response), nil } @@ -140,12 +185,20 @@ func (engine EngineRuntime) GetEnclavesEnclaveIdentifierStatus(ctx context.Conte enclaveIdentifier := request.EnclaveIdentifier enclaveList, err := engine.EnclaveManager.GetEnclaves(ctx) if err != nil { - return nil, stacktrace.Propagate(err, "An error occurred stopping enclave '%v'", enclaveIdentifier) + response := internalErrorResponseInfof(err, "An error occurred stopping enclave '%v'", enclaveIdentifier) + return api.GetEnclavesEnclaveIdentifierStatusdefaultJSONResponse{ + Body: response, + StatusCode: int(response.Code), + }, nil } + info, found := enclaveList[enclaveIdentifier] if !found { - err := stacktrace.NewError("Enclave not found: '%s'", enclaveIdentifier) - return nil, err + response := enclaveNotFoundResponseInfo(request.EnclaveIdentifier) + return api.GetEnclavesEnclaveIdentifierStatusdefaultJSONResponse{ + Body: response, + StatusCode: int(response.Code), + }, nil } return api.GetEnclavesEnclaveIdentifierStatus200JSONResponse(to_http.ToHttpEnclaveStatus(info.EnclaveStatus)), nil @@ -164,12 +217,26 @@ func (engine EngineRuntime) PostEnclavesEnclaveIdentifierStatus(ctx context.Cont } if err := engine.EnclaveManager.StopEnclave(ctx, enclaveIdentifier); err != nil { - return nil, stacktrace.Propagate(err, "An error occurred stopping enclave '%v'", enclaveIdentifier) + response := internalErrorResponseInfof(err, "An error occurred stopping enclave '%v'", enclaveIdentifier) + return api.PostEnclavesEnclaveIdentifierStatusdefaultJSONResponse{ + Body: response, + StatusCode: int(response.Code), + }, nil } + return api.PostEnclavesEnclaveIdentifierStatus200Response{}, nil + default: - err := stacktrace.NewError("Unsupported target state: '%s'", string(*targetState)) - return nil, err + logrus.Infof("Unsupported target state: '%s'", string(*targetState)) + response := api_type.ResponseInfo{ + Code: http.StatusBadRequest, + Type: api_type.WARNING, + Message: fmt.Sprintf("Unsupported target state: '%s'", string(*targetState)), + } + return api.PostEnclavesEnclaveIdentifierStatusdefaultJSONResponse{ + Body: response, + StatusCode: int(response.Code), + }, nil } } @@ -179,3 +246,25 @@ func (engine EngineRuntime) GetEngineInfo(ctx context.Context, request api.GetEn result := api_type.EngineInfo{EngineVersion: engine.ImageVersionTag} return api.GetEngineInfo200JSONResponse(result), nil } + +// =============================================================================================================== +// ===================================== Internal Functions ===================================================== +// =============================================================================================================== + +func enclaveNotFoundResponseInfo(enclaveIdentifier string) api_type.ResponseInfo { + logrus.Infof("Enclave '%s' not found.", enclaveIdentifier) + return api_type.ResponseInfo{ + Code: http.StatusNotFound, + Type: api_type.INFO, + Message: fmt.Sprintf("Enclave '%s' not found.", enclaveIdentifier), + } +} + +func internalErrorResponseInfof(err error, format string, args ...interface{}) api_type.ResponseInfo { + logrus.WithField("stacktrace", fmt.Sprintf("%+v", err)).WithError(err).Errorf(format, args...) + return api_type.ResponseInfo{ + Code: http.StatusInternalServerError, + Type: api_type.ERROR, + Message: fmt.Sprintf(format, args...), + } +} From b8e5969113579038f4c8c427d24fddbcd0fee364 Mon Sep 17 00:00:00 2001 From: lostbean Date: Mon, 4 Dec 2023 23:25:17 -0300 Subject: [PATCH 81/95] improve websocket logs --- .../engine/server/websocket_api_handler.go | 30 ++++++++++++++----- .../server/engine/streaming/service_logs.go | 4 +++ 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/engine/server/engine/server/websocket_api_handler.go b/engine/server/engine/server/websocket_api_handler.go index 25444e8526..8bf550fe7b 100644 --- a/engine/server/engine/server/websocket_api_handler.go +++ b/engine/server/engine/server/websocket_api_handler.go @@ -67,6 +67,7 @@ func (engine WebSocketRuntime) GetEnclavesEnclaveIdentifierLogs(ctx echo.Context logrus.WithFields(logrus.Fields{ "enclave_identifier": enclaveIdentifier, "parameters": params, + "stacktrace": fmt.Sprintf("%+v", err), }).Error("Failed to create log stream") errInfo := api_type.ResponseInfo{ Code: http.StatusInternalServerError, @@ -103,9 +104,10 @@ func (engine WebSocketRuntime) GetEnclavesEnclaveIdentifierServicesServiceIdenti params.ConjunctiveFilters, ) if err != nil { - logrus.WithFields(logrus.Fields{ + logrus.WithError(err).WithFields(logrus.Fields{ "enclave_identifier": enclaveIdentifier, "parameters": params, + "stacktrace": fmt.Sprintf("%+v", err), }).Error("Failed to create log stream") errInfo := api_type.ResponseInfo{ Code: http.StatusInternalServerError, @@ -129,14 +131,14 @@ func (engine WebSocketRuntime) GetEnclavesEnclaveIdentifierServicesServiceIdenti // (GET /starlark/executions/{starlark_execution_uuid}/logs) func (engine WebSocketRuntime) GetStarlarkExecutionsStarlarkExecutionUuidLogs(ctx echo.Context, starlarkExecutionUuid api_type.StarlarkExecutionUuid) error { - async_log_uuid := streaming.StreamerUUID(starlarkExecutionUuid) + asyncLogUuid := streaming.StreamerUUID(starlarkExecutionUuid) if ctx.IsWebSocket() { logrus.Infof("Starting log stream using Websocket for streamer UUUID: %s", starlarkExecutionUuid) - streamStarlarkLogsWithWebsocket(ctx, engine.AsyncStarlarkLogs, async_log_uuid) + streamStarlarkLogsWithWebsocket(ctx, engine.AsyncStarlarkLogs, asyncLogUuid) } else { logrus.Infof("Starting log stream using plain HTTP for streamer UUUID: %s", starlarkExecutionUuid) - streamStarlarkLogsWithHTTP(ctx, engine.AsyncStarlarkLogs, async_log_uuid) + streamStarlarkLogsWithHTTP(ctx, engine.AsyncStarlarkLogs, asyncLogUuid) } return nil @@ -180,7 +182,10 @@ func streamStarlarkLogsWithWebsocket[T any](ctx echo.Context, streamerPool strea } if err != nil { - logrus.Errorf("Failed to stream all data %s", err) + logrus.WithError(err).WithFields(logrus.Fields{ + "streamerUUID": streamerUUID, + "stacktrace": fmt.Sprintf("%+v", err), + }).Error("Failed to stream all data") streamingErr := api_type.ResponseInfo{ Type: api_type.ERROR, Message: fmt.Sprintf("Log streaming '%s' failed while sending the data", streamerUUID), @@ -219,7 +224,10 @@ func streamStarlarkLogsWithHTTP[T any](ctx echo.Context, streamerPool streaming. } if err != nil { - logrus.Errorf("Failed to stream all data %s", err) + logrus.WithError(err).WithFields(logrus.Fields{ + "streamerUUID": streamerUUID, + "stacktrace": fmt.Sprintf("%+v", err), + }).Error("Failed to stream all data") streamingErr := api_type.ResponseInfo{ Type: api_type.ERROR, Message: fmt.Sprintf("Log streaming '%s' failed while sending the data", streamerUUID), @@ -241,7 +249,10 @@ func streamServiceLogsWithWebsocket(ctx echo.Context, streamer streaming.Service }) if err != nil { - logrus.Errorf("Failed to stream all data %s", err) + logrus.WithError(err).WithFields(logrus.Fields{ + "stacktrace": fmt.Sprintf("%+v", err), + "services": streamer.GetRequestedServiceUuids(), + }).Error("Failed to stream all data") streamingErr := api_type.ResponseInfo{ Type: api_type.ERROR, Message: fmt.Sprintf("Log streaming failed while sending the data"), @@ -265,7 +276,10 @@ func streamServiceLogsWithHTTP(ctx echo.Context, streamer streaming.ServiceLogSt }) if err != nil { - logrus.Errorf("Failed to stream all data %s", err) + logrus.WithError(err).WithFields(logrus.Fields{ + "stacktrace": fmt.Sprintf("%+v", err), + "services": streamer.GetRequestedServiceUuids(), + }).Error("Failed to stream all data") streamingErr := api_type.ResponseInfo{ Type: api_type.ERROR, Message: fmt.Sprintf("Log streaming failed while sending the data"), diff --git a/engine/server/engine/streaming/service_logs.go b/engine/server/engine/streaming/service_logs.go index f5b775236f..11698a01d8 100644 --- a/engine/server/engine/streaming/service_logs.go +++ b/engine/server/engine/streaming/service_logs.go @@ -113,6 +113,10 @@ func NewServiceLogStreamer( }, nil } +func (streamer ServiceLogStreamer) GetRequestedServiceUuids() []user_service.ServiceUUID { + return streamer.requestedServiceUuids +} + func (streamer ServiceLogStreamer) Close() { streamer.cancelCtxFunc() } From 3dd801a1293346564d06deb484813765dae260ba Mon Sep 17 00:00:00 2001 From: lostbean Date: Tue, 5 Dec 2023 19:40:52 -0300 Subject: [PATCH 82/95] remaining golint errors --- .../http_rest/api_types/api_types.gen.go | 2 +- .../core_rest_api/api_container_server.gen.go | 142 +++++++++--------- .../websocket_api/websocket_server.gen.go | 58 +++---- api/openapi/specs/kurtosis_api.yaml | 1 - engine/server/engine/main.go | 4 +- .../engine/mapping/to_http/starlark_logs.go | 128 ++++++++++------ .../engine/server/enclave_rest_api_handler.go | 64 ++++++-- .../engine/server/websocket_api_handler.go | 46 ++++-- .../server/engine/streaming/service_logs.go | 5 +- .../server/engine/streaming/starlark_logs.go | 17 ++- engine/server/engine/utils/list.go | 28 +++- engine/server/engine/utils/pointer.go | 4 + 12 files changed, 310 insertions(+), 189 deletions(-) diff --git a/api/golang/http_rest/api_types/api_types.gen.go b/api/golang/http_rest/api_types/api_types.gen.go index bb2da1bd7a..1a31729aae 100644 --- a/api/golang/http_rest/api_types/api_types.gen.go +++ b/api/golang/http_rest/api_types/api_types.gen.go @@ -459,7 +459,7 @@ type StarlarkInstruction struct { ExecutableInstruction string `json:"executable_instruction"` InstructionName string `json:"instruction_name"` IsSkipped bool `json:"is_skipped"` - Position StarlarkInstructionPosition `json:"position"` + Position *StarlarkInstructionPosition `json:"position,omitempty"` } // StarlarkInstructionArgument defines model for StarlarkInstructionArgument. diff --git a/api/golang/http_rest/core_rest_api/api_container_server.gen.go b/api/golang/http_rest/core_rest_api/api_container_server.gen.go index c27e703b21..f7dad9cb8c 100644 --- a/api/golang/http_rest/core_rest_api/api_container_server.gen.go +++ b/api/golang/http_rest/core_rest_api/api_container_server.gen.go @@ -1547,80 +1547,80 @@ func (sh *strictHandler) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx echo.C var swaggerSpec = []string{ "H4sIAAAAAAAC/+w8a2/bOLZ/hdC9QGcWatydXSwu+i1N09bY1jEcZ3MvJoVKS8c2tzSpJamkniL//YIv", - "PSxKlvPs7M6Xmcbi45zD8+bh+R6lfJNzBkzJ6PX3KMcCb0CBMH9hocgSpyohGTBFlgSE/jkDmQqSK8JZ", + "PSxKlvPs7M6Xmcbi47x5zuHh+R6lfJNzBkzJ6PX3KMcCb0CBMH9hocgSpyohGTBFlgSE/jkDmQqSK8JZ", "9DqarwH5gYjhDSAuUFGQLIojogfkWK2jONKfotfBNeNIwL8KIiCLXitRQBzJdA0brDdT21xPk0oQtopu", "b+MIWErxNfQCdXExfhsjueZCAYMM2b+5cAAukVoDcguF4QzsciCY33JIFWSJAJlzJqEN5djDkeWcMIUE", "qEIwidSaSHSNaQGxGSBBXJMU0A2hFC0AbbD4ChnCEuFrTCheUEA/wdHqCH0ASjm65IJmPx95xP5VgNjW", - "M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TT3u", + "cR60JKXWDeTfK6qvN0IJyMpOK5SnC/Db7U+eRpJtfQDYLNOKXAMrW4K5xybYP7CoJQGq2vrHkGnfCVSO", + "vtfaB96O8E7TBmcYmzR6Yxq22RZtFU6moV6rw2jZtS0u3zgTHagKXqzWCNtZntLxQ1jgsk/ClAtlW+Md", + "N3soPpe+7Z9Vb+U4YHi9g+mQ1bFaDxnX00B0wGzfZnD40Dtu1G4vO2jLWiPJriMzaBLubQdOTD/PJS+9", + "293eng+v5sNDcFdvcjdnyE/+ETziIVVDjYzdk5wB70EhiqWqHtSKgt2V5W6JkXsWI7tvN/ztI2495D1C", + "8zWRSCrI7aNAewr7thH1JhMpZo2mlaZpbqCZx0HXHTuT5Q9+Z/04FqGbPQ8lGqPv1dupvluwenNwU/+k", + "BFmtXKeVqoeI9lkyyCnfbsocc1uy3mz9+/cYEfWC0itm3QGEmW1aaTtmCnB1V7ZFypeO3pJfbCtVJ4a+", + "73ej26Ve7opdE1y12zxCY9OuhUqOci4lWdhLFdtt1mTKTfNfltn+Q/7Fe4WsuQLc5BSUh1Ct4YqZRB8q", + "JRF9CfSZ/XJ0P21w/x8/VXRQe2A3+NhuNtZ9rGAiYGee+F4wVNj8xIFDW8kQt1nPQoJ4IdEC1pgu72s0", + "LDrykc2ENrh/2Ii724hzx6WnsQzPpOuuLc5/tKrbLR9Y0+1TfDt0RRiMXE2s/qU0BKV867AirHBVbHF7", + "+/8BAAD//z+MtuXcZQAA", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/api/golang/http_rest/websocket_api/websocket_server.gen.go b/api/golang/http_rest/websocket_api/websocket_server.gen.go index 59527a4f3b..f5541f40a7 100644 --- a/api/golang/http_rest/websocket_api/websocket_server.gen.go +++ b/api/golang/http_rest/websocket_api/websocket_server.gen.go @@ -197,38 +197,38 @@ func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/+x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YreiXWwIc16CJQWe9XH2WjHyEpVHpE6CT", + "J6GCTPJXDakqCpAZZH8jShMBK5ZuyW+Lxb2Xy+XqgkZ+LMeVvMlqq2feZ//3pnX4fT3V7976HDli9iRx", + "4HbkGL52uAYTowk83TuSCeShO6gJbIe3HBNY+pctu8eDAfeby8tXG293B3KB6fZD2yeSxgRaEeXMf1aE", + "hLfWxvUsvhqJ26JgDsiqPPeb/BfTT3CHuMyVyCfaphytRk4nCquRMqkKW2DZp/95fGeA8iug2KiE2F9g", + "vYKkBklM/Fwqjb5L3cVsw7hgSy44voLLpzGwub9zhP8DIOcryPi/PxT9zuP6P/79MPzr5vjLQc+33dOK", + "0hPH/j7WvIwrfvb/JTzbnSeijutkvWj3pCsuIfaNt1tpZbbDewc24bvkE4jzcIAmKidM7u+x9/fb1U8G", + "voEGwiVHzhAyYg2XK/KHBtQcNv7GiZmtTP+4+CwXayDVg2/emCTL6kcIxhaQESXFliiZAmEyI/C95BoI", + "yxG0pynre3VN3pC1sto0LzVUmV5pOB8cyURs/Cyng+PgqscMVj5Ynr0IEY/9ROC/hoWz7isOByzD31WM", + "Y8dXCwZfBToCqTmGIrvdfwIAAP//rrgHHYUlAAA=", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/api/openapi/specs/kurtosis_api.yaml b/api/openapi/specs/kurtosis_api.yaml index 857fc3a308..29967046a3 100644 --- a/api/openapi/specs/kurtosis_api.yaml +++ b/api/openapi/specs/kurtosis_api.yaml @@ -1215,7 +1215,6 @@ components: is_skipped: type: boolean required: - - position - instruction_name - arguments - executable_instruction diff --git a/engine/server/engine/main.go b/engine/server/engine/main.go index 2193a81e57..5a734ad3ae 100644 --- a/engine/server/engine/main.go +++ b/engine/server/engine/main.go @@ -422,8 +422,8 @@ func restApiServer( // ============================== Engine Management API ====================================== enclaveRuntime, err := restApi.NewEnclaveRuntime(ctx, *enclave_manager, asyncStarlarkLogs, false) if err != nil { - stacktrace.Propagate(err, "Failed to initialize %T", enclaveRuntime) - return err + newErr := stacktrace.Propagate(err, "Failed to initialize %T", enclaveRuntime) + return newErr } enclaveApi.RegisterHandlers(echoRouter, enclaveApi.NewStrictHandler(enclaveRuntime, nil)) diff --git a/engine/server/engine/mapping/to_http/starlark_logs.go b/engine/server/engine/mapping/to_http/starlark_logs.go index 9449300023..e40eb7e79e 100644 --- a/engine/server/engine/mapping/to_http/starlark_logs.go +++ b/engine/server/engine/mapping/to_http/starlark_logs.go @@ -1,126 +1,156 @@ package to_http import ( - "reflect" - "github.com/kurtosis-tech/kurtosis/engine/server/engine/utils" - "github.com/sirupsen/logrus" + "github.com/kurtosis-tech/stacktrace" rpc_api "github.com/kurtosis-tech/kurtosis/api/golang/core/kurtosis_core_rpc_api_bindings" api_type "github.com/kurtosis-tech/kurtosis/api/golang/http_rest/api_types" ) -func ToHttpStarlarkRunResponseLine(rpc_value rpc_api.StarlarkRunResponseLine) *api_type.StarlarkRunResponseLine { +func ToHttpStarlarkRunResponseLine(rpc_value *rpc_api.StarlarkRunResponseLine) (*api_type.StarlarkRunResponseLine, error) { var http_type api_type.StarlarkRunResponseLine + if runError := rpc_value.GetError(); runError != nil { - if value := ToHttpStarlarkError(*runError); value != nil { - http_type.FromStarlarkError(*value) - return &http_type + value, err := ToHttpStarlarkError(runError) + if err != nil { + return nil, stacktrace.Propagate(err, "failed to serialize %T", runError) } - return nil + if value != nil { + if err := http_type.FromStarlarkError(*value); err != nil { + return nil, stacktrace.Propagate(err, "failed to serialize %T", runError) + } + return &http_type, nil + } + return nil, nil } if runInfo := rpc_value.GetInfo(); runInfo != nil { - http_type.FromStarlarkInfo(ToHttpStarlarkInfo(*runInfo)) - return &http_type + if err := http_type.FromStarlarkInfo(ToHttpStarlarkInfo(runInfo)); err != nil { + return nil, stacktrace.Propagate(err, "failed to serialize %T", runInfo) + } + return &http_type, nil } if runInstruction := rpc_value.GetInstruction(); runInstruction != nil { - http_type.FromStarlarkInstruction(ToHttpStarlarkInstruction(*runInstruction)) - return &http_type + if err := http_type.FromStarlarkInstruction(ToHttpStarlarkInstruction(runInstruction)); err != nil { + return nil, stacktrace.Propagate(err, "failed to serialize %T", runInstruction) + } + return &http_type, nil } if runInstructionResult := rpc_value.GetInstructionResult(); runInstructionResult != nil { - http_type.FromStarlarkInstructionResult(ToHttpStarlarkInstructionResult(*runInstructionResult)) - return &http_type + if err := http_type.FromStarlarkInstructionResult(ToHttpStarlarkInstructionResult(runInstructionResult)); err != nil { + return nil, stacktrace.Propagate(err, "failed to serialize %T", runInstructionResult) + } + return &http_type, nil } if runProgressInfo := rpc_value.GetProgressInfo(); runProgressInfo != nil { - http_type.FromStarlarkRunProgress(ToHttpStarlarkProgressInfo(*runProgressInfo)) - return &http_type + if err := http_type.FromStarlarkRunProgress(ToHttpStarlarkProgressInfo(runProgressInfo)); err != nil { + return nil, stacktrace.Propagate(err, "failed to serialize %T", runProgressInfo) + } + return &http_type, nil } if runWarning := rpc_value.GetWarning(); runWarning != nil { - http_type.FromStarlarkWarning(ToHttpStarlarkWarning(*runWarning)) - return &http_type + if err := http_type.FromStarlarkWarning(ToHttpStarlarkWarning(runWarning)); err != nil { + return nil, stacktrace.Propagate(err, "failed to serialize %T", runWarning) + } + return &http_type, nil } if runFinishedEvent := rpc_value.GetRunFinishedEvent(); runFinishedEvent != nil { - http_type.FromStarlarkRunFinishedEvent(ToHttpStarlarkRunFinishedEvent(*runFinishedEvent)) - return &http_type + if err := http_type.FromStarlarkRunFinishedEvent(ToHttpStarlarkRunFinishedEvent(runFinishedEvent)); err != nil { + return nil, stacktrace.Propagate(err, "failed to serialize %T", runFinishedEvent) + } + return &http_type, nil } - logrus.WithFields(logrus.Fields{ - "type": reflect.TypeOf(rpc_value).Name(), - "value": rpc_value.String(), - }).Warnf("Unmatched gRPC to Http mapping, returning empty value") - return nil + err := stacktrace.NewError("Unmatched gRPC to Http mapping, source type: %T", rpc_value) + return nil, err } -func ToHttpStarlarkError(rpc_value rpc_api.StarlarkError) *api_type.StarlarkError { +func ToHttpStarlarkError(rpc_value *rpc_api.StarlarkError) (*api_type.StarlarkError, error) { var http_type api_type.StarlarkError if runError := rpc_value.GetExecutionError(); runError != nil { - http_type.Error.FromStarlarkExecutionError(ToHttpStarlarkExecutionError(*runError)) - return &http_type + if err := http_type.Error.FromStarlarkExecutionError(ToHttpStarlarkExecutionError(runError)); err != nil { + return nil, stacktrace.Propagate(err, "failed to serialize %T", runError) + } + return &http_type, nil } if runError := rpc_value.GetInterpretationError(); runError != nil { - http_type.Error.FromStarlarkInterpretationError(ToHttpStarlarkInterpretationError(*runError)) - return &http_type + if err := http_type.Error.FromStarlarkInterpretationError(ToHttpStarlarkInterpretationError(runError)); err != nil { + return nil, stacktrace.Propagate(err, "failed to serialize %T", runError) + } + return &http_type, nil } if runError := rpc_value.GetValidationError(); runError != nil { - http_type.Error.FromStarlarkValidationError(ToHttpStarlarkValidationError(*runError)) - return &http_type + if err := http_type.Error.FromStarlarkValidationError(ToHttpStarlarkValidationError(runError)); err != nil { + return nil, stacktrace.Propagate(err, "failed to serialize %T", runError) + } + return &http_type, nil } - logrus.WithFields(logrus.Fields{ - "type": reflect.TypeOf(rpc_value).Name(), - "value": rpc_value.String(), - }).Warnf("Unmatched gRPC to Http mapping, returning empty value") - return nil + err := stacktrace.NewError("Unmatched gRPC to Http mapping, source type: %T", rpc_value) + return nil, err } -func ToHttpStarlarkExecutionError(rpc_value rpc_api.StarlarkExecutionError) api_type.StarlarkExecutionError { +func ToHttpStarlarkExecutionError(rpc_value *rpc_api.StarlarkExecutionError) api_type.StarlarkExecutionError { var http_type api_type.StarlarkExecutionError http_type.ExecutionError.ErrorMessage = rpc_value.ErrorMessage return http_type } -func ToHttpStarlarkInterpretationError(rpc_value rpc_api.StarlarkInterpretationError) api_type.StarlarkInterpretationError { +func ToHttpStarlarkInterpretationError(rpc_value *rpc_api.StarlarkInterpretationError) api_type.StarlarkInterpretationError { var http_type api_type.StarlarkInterpretationError http_type.InterpretationError.ErrorMessage = rpc_value.ErrorMessage return http_type } -func ToHttpStarlarkValidationError(rpc_value rpc_api.StarlarkValidationError) api_type.StarlarkValidationError { +func ToHttpStarlarkValidationError(rpc_value *rpc_api.StarlarkValidationError) api_type.StarlarkValidationError { var http_type api_type.StarlarkValidationError http_type.ValidationError.ErrorMessage = rpc_value.ErrorMessage return http_type } -func ToHttpStarlarkInfo(rpc_value rpc_api.StarlarkInfo) api_type.StarlarkInfo { +func ToHttpStarlarkInfo(rpc_value *rpc_api.StarlarkInfo) api_type.StarlarkInfo { var info api_type.StarlarkInfo - info.Info.Instruction.InfoMessage = "" + info.Info.Instruction.InfoMessage = rpc_value.InfoMessage return info } -func ToHttpStarlarkInstruction(rpc_value rpc_api.StarlarkInstruction) api_type.StarlarkInstruction { +func ToHttpStarlarkInstruction(rpc_value *rpc_api.StarlarkInstruction) api_type.StarlarkInstruction { + position := ToHttpStarlarkInstructionPosition(rpc_value.Position) return api_type.StarlarkInstruction{ + ExecutableInstruction: rpc_value.ExecutableInstruction, + IsSkipped: rpc_value.IsSkipped, + Position: &position, + InstructionName: rpc_value.InstructionName, Arguments: utils.MapList( - utils.FilterListNils(rpc_value.Arguments), + rpc_value.Arguments, ToHttpStarlarkInstructionArgument, ), } } -func ToHttpStarlarkInstructionResult(rpc_value rpc_api.StarlarkInstructionResult) api_type.StarlarkInstructionResult { +func ToHttpStarlarkInstructionPosition(rpc_value *rpc_api.StarlarkInstructionPosition) api_type.StarlarkInstructionPosition { + return api_type.StarlarkInstructionPosition{ + Column: rpc_value.Column, + Line: rpc_value.Line, + Filename: rpc_value.Filename, + } +} + +func ToHttpStarlarkInstructionResult(rpc_value *rpc_api.StarlarkInstructionResult) api_type.StarlarkInstructionResult { var instructionResult api_type.StarlarkInstructionResult instructionResult.InstructionResult.SerializedInstructionResult = rpc_value.SerializedInstructionResult return instructionResult } -func ToHttpStarlarkProgressInfo(rpc_value rpc_api.StarlarkRunProgress) api_type.StarlarkRunProgress { +func ToHttpStarlarkProgressInfo(rpc_value *rpc_api.StarlarkRunProgress) api_type.StarlarkRunProgress { var progress api_type.StarlarkRunProgress progress.ProgressInfo.CurrentStepInfo = rpc_value.CurrentStepInfo progress.ProgressInfo.CurrentStepNumber = int32(rpc_value.CurrentStepNumber) @@ -128,20 +158,20 @@ func ToHttpStarlarkProgressInfo(rpc_value rpc_api.StarlarkRunProgress) api_type. return progress } -func ToHttpStarlarkWarning(rpc_value rpc_api.StarlarkWarning) api_type.StarlarkWarning { +func ToHttpStarlarkWarning(rpc_value *rpc_api.StarlarkWarning) api_type.StarlarkWarning { var warning api_type.StarlarkWarning warning.Warning.WarningMessage = rpc_value.WarningMessage return warning } -func ToHttpStarlarkRunFinishedEvent(rpc_value rpc_api.StarlarkRunFinishedEvent) api_type.StarlarkRunFinishedEvent { +func ToHttpStarlarkRunFinishedEvent(rpc_value *rpc_api.StarlarkRunFinishedEvent) api_type.StarlarkRunFinishedEvent { var event api_type.StarlarkRunFinishedEvent event.RunFinishedEvent.IsRunSuccessful = rpc_value.IsRunSuccessful event.RunFinishedEvent.SerializedOutput = rpc_value.SerializedOutput return event } -func ToHttpStarlarkInstructionArgument(rpc_value rpc_api.StarlarkInstructionArg) api_type.StarlarkInstructionArgument { +func ToHttpStarlarkInstructionArgument(rpc_value *rpc_api.StarlarkInstructionArg) api_type.StarlarkInstructionArgument { return api_type.StarlarkInstructionArgument{ ArgName: rpc_value.ArgName, IsRepresentative: rpc_value.IsRepresentative, diff --git a/engine/server/engine/server/enclave_rest_api_handler.go b/engine/server/engine/server/enclave_rest_api_handler.go index 5e81cfd63f..a35f59a9ff 100644 --- a/engine/server/engine/server/enclave_rest_api_handler.go +++ b/engine/server/engine/server/enclave_rest_api_handler.go @@ -47,6 +47,7 @@ func NewEnclaveRuntime(ctx context.Context, manager enclave_manager.EnclaveManag connectOnHostMachine: connectOnHostMachine, ctx: ctx, asyncStarlarkLogs: asyncStarlarkLogs, + lock: sync.Mutex{}, } err := runtime.refreshEnclaveConnections() @@ -132,7 +133,9 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierArtifactsLocalFile(c Type: api_type.ERROR, Message: fmt.Sprintf("Failed to upload file: %s", filename), } - result.FileArtifactUploadResult.FromResponseInfo(response) + if err := result.FileArtifactUploadResult.FromResponseInfo(response); err != nil { + return nil, stacktrace.Propagate(err, "Failed to write to enum http type with %T", response) + } uploadedArtifacts[filename] = result continue } @@ -144,7 +147,9 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierArtifactsLocalFile(c Type: api_type.WARNING, Message: fmt.Sprintf("File %s has been already uploaded", filename), } - result.FileArtifactUploadResult.FromResponseInfo(response) + if err := result.FileArtifactUploadResult.FromResponseInfo(response); err != nil { + return nil, stacktrace.Propagate(err, "Failed to write to enum http type with %T", response) + } uploadedArtifacts[filename] = result continue } @@ -153,7 +158,10 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierArtifactsLocalFile(c Name: uploadResult.Name, Uuid: uploadResult.Uuid, } - result.FileArtifactUploadResult.FromFileArtifactReference(artifactResponse) + if err := result.FileArtifactUploadResult.FromFileArtifactReference(artifactResponse); err != nil { + return nil, stacktrace.Propagate(err, "Failed to write to enum http type with %T", artifactResponse) + } + uploadedArtifacts[filename] = result uploadedArtifacts[filename] = result } @@ -572,8 +580,7 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkPackagesPack jsonParams := utils.DerefWith(request.Body.Params, map[string]interface{}{}) jsonBlob, err := json.Marshal(jsonParams) if err != nil { - stacktrace.Propagate(err, "I'm actually panicking here. Re-serializing a already deserialized JSON parameter should never fail.") - return nil, err + return nil, stacktrace.Propagate(err, "I'm actually panicking here. Re-serializing a already deserialized JSON parameter should never fail.") } jsonString := string(jsonBlob) @@ -610,13 +617,28 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkPackagesPack var syncLogs api_type.StarlarkRunResponse_StarlarkExecutionLogs if !isAsyncRetrieval { - logs := utils.MapList(asyncLogs.WaitAndConsumeAll(), to_http.ToHttpStarlarkRunResponseLine) - syncLogs.FromStarlarkRunLogs(utils.FilterListNils(logs)) + allLogs, err := asyncLogs.WaitAndConsumeAll() + if err != nil { + cancelCtxFunc() + return nil, stacktrace.Propagate(err, "Failed to consume all logs with enclave %s", enclaveIdentifier) + } + httpLogs, err := utils.MapListWithRefStopOnError(allLogs, to_http.ToHttpStarlarkRunResponseLine) + if err != nil { + cancelCtxFunc() + return nil, stacktrace.Propagate(err, "Failed to convert values to http with enclave %s", enclaveIdentifier) + } + + logs := utils.FilterListNils(httpLogs) + if err := syncLogs.FromStarlarkRunLogs(logs); err != nil { + return nil, stacktrace.Propagate(err, "failed to serialize %T", logs) + } } else { asyncUuid := manager.asyncStarlarkLogs.Add(&asyncLogs) var asyncLogs api_type.AsyncStarlarkExecutionLogs asyncLogs.AsyncStarlarkExecutionLogs.StarlarkExecutionUuid = string(asyncUuid) - syncLogs.FromAsyncStarlarkExecutionLogs(asyncLogs) + if err := syncLogs.FromAsyncStarlarkExecutionLogs(asyncLogs); err != nil { + return nil, stacktrace.Propagate(err, "failed to serialize %T", asyncLogs) + } } response := api_type.StarlarkRunResponse{StarlarkExecutionLogs: &syncLogs} @@ -638,8 +660,7 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx return string(jsonBlob), err }) if err != nil { - stacktrace.Propagate(err, "I'm actually panicking here. Re-serializing a already deserialized JSON parameter should never fail.") - return nil, err + return nil, stacktrace.Propagate(err, "I'm actually panicking here. Re-serializing a already deserialized JSON parameter should never fail.") } runStarlarkScriptArgs := rpc_api.RunStarlarkScriptArgs{ @@ -665,9 +686,22 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx asyncLogs := streaming.NewAsyncStarlarkLogs(cancelCtxFunc) go asyncLogs.AttachStream(stream) - logs := utils.MapList(asyncLogs.WaitAndConsumeAll(), to_http.ToHttpStarlarkRunResponseLine) + allLogs, err := asyncLogs.WaitAndConsumeAll() + if err != nil { + cancelCtxFunc() + return nil, stacktrace.Propagate(err, "Failed to consume all logs with enclave %s", enclaveIdentifier) + } + httpLogs, err := utils.MapListWithRefStopOnError(allLogs, to_http.ToHttpStarlarkRunResponseLine) + if err != nil { + cancelCtxFunc() + return nil, stacktrace.Propagate(err, "Failed to convert values to http with enclave %s", enclaveIdentifier) + } + + logs := utils.FilterListNils(httpLogs) var syncLogs api_type.StarlarkRunResponse_StarlarkExecutionLogs - syncLogs.FromStarlarkRunLogs(utils.FilterListNils(logs)) + if err := syncLogs.FromStarlarkRunLogs(logs); err != nil { + return nil, stacktrace.Propagate(err, "failed to serialize %T", logs) + } response := api_type.StarlarkRunResponse{StarlarkExecutionLogs: &syncLogs} return api.PostEnclavesEnclaveIdentifierStarlarkScripts200JSONResponse(response), nil @@ -707,7 +741,7 @@ func getGrpcClientConn(enclaveInfo types.EnclaveInfo, connectOnHostMachine bool) return grpcConnection, nil } -func (manager enclaveRuntime) getApiClientOrResponseError(enclaveUuid string) (*rpc_api.ApiContainerServiceClient, *api_type.ResponseInfo) { +func (manager *enclaveRuntime) getApiClientOrResponseError(enclaveUuid string) (*rpc_api.ApiContainerServiceClient, *api_type.ResponseInfo) { client, err := manager.getGrpcClientForEnclaveUUID(enclaveUuid) if err != nil { return nil, &api_type.ResponseInfo{ @@ -726,7 +760,7 @@ func (manager enclaveRuntime) getApiClientOrResponseError(enclaveUuid string) (* return client, nil } -func (manager enclaveRuntime) getGrpcClientForEnclaveUUID(enclaveUuid string) (*rpc_api.ApiContainerServiceClient, error) { +func (manager *enclaveRuntime) getGrpcClientForEnclaveUUID(enclaveUuid string) (*rpc_api.ApiContainerServiceClient, error) { err := manager.refreshEnclaveConnections() if err != nil { return nil, err @@ -740,7 +774,7 @@ func (manager enclaveRuntime) getGrpcClientForEnclaveUUID(enclaveUuid string) (* return &client, nil } -func (runtime enclaveRuntime) refreshEnclaveConnections() error { +func (runtime *enclaveRuntime) refreshEnclaveConnections() error { runtime.lock.Lock() defer runtime.lock.Unlock() diff --git a/engine/server/engine/server/websocket_api_handler.go b/engine/server/engine/server/websocket_api_handler.go index 8bf550fe7b..085b0bc04e 100644 --- a/engine/server/engine/server/websocket_api_handler.go +++ b/engine/server/engine/server/websocket_api_handler.go @@ -13,6 +13,7 @@ import ( "github.com/kurtosis-tech/kurtosis/engine/server/engine/streaming" "github.com/kurtosis-tech/kurtosis/engine/server/engine/utils" "github.com/kurtosis-tech/kurtosis/metrics-library/golang/lib/metrics_client" + "github.com/kurtosis-tech/stacktrace" "github.com/labstack/echo/v4" "github.com/sirupsen/logrus" "golang.org/x/net/websocket" @@ -152,7 +153,7 @@ func writeResponseInfo(ctx echo.Context, response api_type.ResponseInfo) { ctx.Response().Header().Set(echo.HeaderContentType, echo.MIMEApplicationJSON) enc := json.NewEncoder(ctx.Response()) ctx.Response().WriteHeader(int(response.Code)) - enc.Encode(response) + _ = enc.Encode(response) } func streamStarlarkLogsWithWebsocket[T any](ctx echo.Context, streamerPool streaming.StreamerPool[T], streamerUUID streaming.StreamerUUID) { @@ -170,15 +171,20 @@ func streamStarlarkLogsWithWebsocket[T any](ctx echo.Context, streamerPool strea websocket.Handler(func(ws *websocket.Conn) { defer ws.Close() found, err := streamerPool.Consume(streaming.StreamerUUID(streamerUUID), func(logline *rpc_api.StarlarkRunResponseLine) error { - err := websocket.JSON.Send(ws, utils.MapPointer(logline, to_http.ToHttpStarlarkRunResponseLine)) + response, err := to_http.ToHttpStarlarkRunResponseLine(logline) if err != nil { - return err + return stacktrace.Propagate(err, "Failed to convert value of type `%T` to http", logline) + } + if err := websocket.JSON.Send(ws, response); err != nil { + return stacktrace.Propagate(err, "Failed to send value of type `%T` via websocket", logline) } return nil }) if !found { - websocket.JSON.Send(ws, notFoundErr) + if err := websocket.JSON.Send(ws, notFoundErr); err != nil { + logrus.WithError(err).Errorf("Failed to send value via websocket") + } } if err != nil { @@ -191,7 +197,9 @@ func streamStarlarkLogsWithWebsocket[T any](ctx echo.Context, streamerPool strea Message: fmt.Sprintf("Log streaming '%s' failed while sending the data", streamerUUID), Code: http.StatusInternalServerError, } - websocket.JSON.Send(ws, streamingErr) + if err := websocket.JSON.Send(ws, streamingErr); err != nil { + logrus.WithError(err).Errorf("Failed to send value via websocket") + } } }).ServeHTTP(ctx.Response(), ctx.Request()) } @@ -212,15 +220,21 @@ func streamStarlarkLogsWithHTTP[T any](ctx echo.Context, streamerPool streaming. enc := json.NewEncoder(ctx.Response()) ctx.Response().WriteHeader(http.StatusOK) found, err := streamerPool.Consume(streaming.StreamerUUID(streamerUUID), func(logline *rpc_api.StarlarkRunResponseLine) error { - if err := enc.Encode(utils.MapPointer(logline, to_http.ToHttpStarlarkRunResponseLine)); err != nil { - return err + response, err := to_http.ToHttpStarlarkRunResponseLine(logline) + if err != nil { + return stacktrace.Propagate(err, "Failed to convert value of type `%T` to http", logline) + } + if err := enc.Encode(response); err != nil { + return stacktrace.Propagate(err, "Failed to send value of type `%T` via http streaming", logline) } ctx.Response().Flush() return nil }) if !found { - enc.Encode(notFoundErr) + if err := enc.Encode(notFoundErr); err != nil { + logrus.WithError(err).Errorf("Failed to send value via websocket") + } } if err != nil { @@ -233,7 +247,9 @@ func streamStarlarkLogsWithHTTP[T any](ctx echo.Context, streamerPool streaming. Message: fmt.Sprintf("Log streaming '%s' failed while sending the data", streamerUUID), Code: http.StatusInternalServerError, } - enc.Encode(streamingErr) + if err := enc.Encode(streamingErr); err != nil { + logrus.WithError(err).Errorf("Failed to send value via websocket") + } } } @@ -255,10 +271,12 @@ func streamServiceLogsWithWebsocket(ctx echo.Context, streamer streaming.Service }).Error("Failed to stream all data") streamingErr := api_type.ResponseInfo{ Type: api_type.ERROR, - Message: fmt.Sprintf("Log streaming failed while sending the data"), + Message: "Log streaming failed while sending the data", Code: http.StatusInternalServerError, } - websocket.JSON.Send(ws, streamingErr) + if err := websocket.JSON.Send(ws, streamingErr); err != nil { + logrus.WithError(err).Errorf("Failed to send value via websocket") + } } }).ServeHTTP(ctx.Response(), ctx.Request()) } @@ -282,9 +300,11 @@ func streamServiceLogsWithHTTP(ctx echo.Context, streamer streaming.ServiceLogSt }).Error("Failed to stream all data") streamingErr := api_type.ResponseInfo{ Type: api_type.ERROR, - Message: fmt.Sprintf("Log streaming failed while sending the data"), + Message: "Log streaming failed while sending the data", Code: http.StatusInternalServerError, } - enc.Encode(streamingErr) + if err := enc.Encode(streamingErr); err != nil { + logrus.WithError(err).Errorf("Failed to send value via websocket") + } } } diff --git a/engine/server/engine/streaming/service_logs.go b/engine/server/engine/streaming/service_logs.go index 11698a01d8..138a3b5751 100644 --- a/engine/server/engine/streaming/service_logs.go +++ b/engine/server/engine/streaming/service_logs.go @@ -19,7 +19,8 @@ import ( ) var ( - logRetentionFeatureReleaseTime = time.Date(2023, 9, 7, 13, 0, 0, 0, time.UTC) + logRetentionFeatureReleaseTime = time.Date(2023, 9, 7, 13, 0, 0, 0, time.UTC) + defaultNumberOfLogLines uint32 = 100 ) type ServiceLogStreamer struct { @@ -51,7 +52,7 @@ func NewServiceLogStreamer( requestedServiceUuids := make(map[user_service.ServiceUUID]bool, len(serviceUuidList)) shouldFollowLogs := utils.DerefWith(maybeShouldFollowLogs, false) shouldReturnAllLogs := utils.DerefWith(maybeShouldReturnAllLogs, false) - numLogLines := utils.DerefWith(maybeNumLogLines, 100) + numLogLines := utils.DerefWith(maybeNumLogLines, defaultNumberOfLogLines) filters := utils.DerefWith(maybeFilters, []api_type.LogLineFilter{}) for _, serviceUuidStr := range serviceUuidList { diff --git a/engine/server/engine/streaming/starlark_logs.go b/engine/server/engine/streaming/starlark_logs.go index c1057ba12e..00d6fae575 100644 --- a/engine/server/engine/streaming/starlark_logs.go +++ b/engine/server/engine/streaming/starlark_logs.go @@ -9,6 +9,7 @@ import ( rpc_api "github.com/kurtosis-tech/kurtosis/api/golang/core/kurtosis_core_rpc_api_bindings" "github.com/kurtosis-tech/kurtosis/engine/server/engine/utils" + "github.com/kurtosis-tech/stacktrace" ) type asyncStarlarkLogs struct { @@ -69,20 +70,28 @@ func (async *asyncStarlarkLogs) AttachStream(stream grpc.ClientStream) { } } -func (async *asyncStarlarkLogs) WaitAndConsumeAll() []rpc_api.StarlarkRunResponseLine { +func (async *asyncStarlarkLogs) WaitAndConsumeAll() ([]rpc_api.StarlarkRunResponseLine, error) { var logs []*rpc_api.StarlarkRunResponseLine - async.Consume(func(elem *rpc_api.StarlarkRunResponseLine) error { + err := async.Consume(func(elem *rpc_api.StarlarkRunResponseLine) error { if elem != nil { logs = append(logs, elem) } return nil }) - return utils.FilterListNils(logs) + notNilsLogs := utils.FilterListNils(logs) + + if err != nil { + return notNilsLogs, stacktrace.Propagate(err, "Failed to consume all logs, %d were consumed before the error", len(notNilsLogs)) + } + + return notNilsLogs, nil } func (async *asyncStarlarkLogs) Consume(consumer func(*rpc_api.StarlarkRunResponseLine) error) error { for elem := range async.starlarkRunResponseLineChan { - consumer(elem) + if err := consumer(elem); err != nil { + return stacktrace.Propagate(err, "Failed to consume element of type '%T'", elem) + } } return nil } diff --git a/engine/server/engine/utils/list.go b/engine/server/engine/utils/list.go index 250e8f12f5..8a31ef3e62 100644 --- a/engine/server/engine/utils/list.go +++ b/engine/server/engine/utils/list.go @@ -2,12 +2,36 @@ package utils func MapList[T, U any](data []T, function func(T) U) []U { res := make([]U, 0, len(data)) - for _, e := range data { - res = append(res, function(e)) + for _, elem := range data { + res = append(res, function(elem)) } return res } +func MapListWithRefStopOnError[T, U any](data []T, function func(*T) (U, error)) ([]U, error) { + res := make([]U, 0, len(data)) + for _, elem := range data { + value, err := function(&elem) + if err != nil { + return res, err + } + res = append(res, value) + } + return res, nil +} + +func MapListStopOnError[T, U any](data []T, function func(T) (U, error)) ([]U, error) { + res := make([]U, 0, len(data)) + for _, elem := range data { + value, err := function(elem) + if err != nil { + return res, err + } + res = append(res, value) + } + return res, nil +} + func FilterListNils[T any](data []*T) []T { filterList := make([]T, 0) for _, elem := range data { diff --git a/engine/server/engine/utils/pointer.go b/engine/server/engine/utils/pointer.go index 8ba51b116d..84cc2b7802 100644 --- a/engine/server/engine/utils/pointer.go +++ b/engine/server/engine/utils/pointer.go @@ -7,6 +7,10 @@ func DerefWith[T any](value *T, defaultValue T) T { return *value } +func MapWithRef[T any, U any](value T, function func(*T) U) U { + return function(&value) +} + func MapPointer[T any, U any](value *T, function func(T) U) *U { if value == nil { return nil From ad5ec74e7ff77a46e44f2a12a9a576980412209d Mon Sep 17 00:00:00 2001 From: lostbean Date: Tue, 5 Dec 2023 22:14:59 -0300 Subject: [PATCH 83/95] fix lint errors in container-engine-lib due new linter --- .../kubernetes_manager/kubernetes_manager.go | 26 ++++++++++++------- .../enclave_db/enclave_db.go | 6 +++-- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/container-engine-lib/lib/backend_impls/kubernetes/kubernetes_manager/kubernetes_manager.go b/container-engine-lib/lib/backend_impls/kubernetes/kubernetes_manager/kubernetes_manager.go index 231c0b6340..8a64347b01 100644 --- a/container-engine-lib/lib/backend_impls/kubernetes/kubernetes_manager/kubernetes_manager.go +++ b/container-engine-lib/lib/backend_impls/kubernetes/kubernetes_manager/kubernetes_manager.go @@ -10,12 +10,21 @@ import ( "context" "encoding/json" "fmt" + "io" + "net/http" + "net/url" + "os" + "path" + "strconv" + "strings" + "sync" + "time" + "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/exec_result" "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/channel_writer" "github.com/kurtosis-tech/stacktrace" "github.com/sirupsen/logrus" terminal "golang.org/x/term" - "io" apiv1 "k8s.io/api/core/v1" rbacv1 "k8s.io/api/rbac/v1" "k8s.io/apimachinery/pkg/api/resource" @@ -26,14 +35,6 @@ import ( "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/rest" "k8s.io/client-go/tools/remotecommand" - "net/http" - "net/url" - "os" - "path" - "strconv" - "strings" - "sync" - "time" ) const ( @@ -1911,6 +1912,8 @@ func (manager *KubernetesManager) waitForPersistentVolumeClaimBinding( claim.GetName(), claimPhase, ) + case apiv1.ClaimPending: + // not impl - skipping } time.Sleep(time.Duration(waitForPersistentVolumeBoundRetriesDelayMilliSeconds) * time.Millisecond) @@ -1939,6 +1942,8 @@ func (manager *KubernetesManager) waitForPodAvailability(ctx context.Context, na latestPodStatus = &pod.Status switch latestPodStatus.Phase { + case apiv1.PodUnknown: + // not impl - skipping case apiv1.PodRunning: return nil case apiv1.PodPending: @@ -2034,6 +2039,9 @@ func (manager *KubernetesManager) waitForPodTermination(ctx context.Context, nam latestPodStatus = &pod.Status switch latestPodStatus.Phase { + case apiv1.PodPending: + case apiv1.PodRunning: + case apiv1.PodUnknown: case apiv1.PodSucceeded: case apiv1.PodFailed: return nil diff --git a/container-engine-lib/lib/database_accessors/enclave_db/enclave_db.go b/container-engine-lib/lib/database_accessors/enclave_db/enclave_db.go index f15f19354d..f216db350f 100644 --- a/container-engine-lib/lib/database_accessors/enclave_db/enclave_db.go +++ b/container-engine-lib/lib/database_accessors/enclave_db/enclave_db.go @@ -1,11 +1,12 @@ package enclave_db import ( - "github.com/kurtosis-tech/stacktrace" - bolt "go.etcd.io/bbolt" "os" "sync" "time" + + "github.com/kurtosis-tech/stacktrace" + bolt "go.etcd.io/bbolt" ) const ( @@ -38,6 +39,7 @@ func GetOrCreateEnclaveDatabase() (*EnclaveDB, error) { NoSync: false, OpenFile: nil, Mlock: false, + PreLoadFreelist: false, }) }) if databaseOpenError != nil { From f671f3b2b799974127dfc9cc5b3fff4df0e24f5b Mon Sep 17 00:00:00 2001 From: lostbean Date: Tue, 5 Dec 2023 22:45:41 -0300 Subject: [PATCH 84/95] fix lint errors in grpc-file-transfer-lib due new linter --- grpc-file-transfer/golang/grpc_file_streaming/client_stream.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grpc-file-transfer/golang/grpc_file_streaming/client_stream.go b/grpc-file-transfer/golang/grpc_file_streaming/client_stream.go index b4e886fab3..cc1fc9737a 100644 --- a/grpc-file-transfer/golang/grpc_file_streaming/client_stream.go +++ b/grpc-file-transfer/golang/grpc_file_streaming/client_stream.go @@ -94,7 +94,7 @@ func (clientStream *ClientStream[DataChunkMessageType, ServerResponseType]) Pipe clientStream.grpcStream.RecvMsg, func(chunk *DataChunkMessageType) ([]byte, string, error) { data, hash, extErr := grpcMsgExtractor(chunk) - pipeWriter.Write(data) + _, _ = pipeWriter.Write(data) return []byte{}, hash, extErr }) if err != nil { From 2ae3034edb7723ad2788e169e95b2bccc1bae245 Mon Sep 17 00:00:00 2001 From: lostbean Date: Tue, 5 Dec 2023 22:55:03 -0300 Subject: [PATCH 85/95] bump go in CI lint --- .github/workflows/golangci-lint.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index cdeb6a4d84..c9457cb391 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -18,7 +18,7 @@ on: merge_group: env: - GOLINT_VERSION: v1.53.3 + GOLINT_VERSION: v1.52.2 jobs: golangci: @@ -27,7 +27,7 @@ jobs: steps: - uses: actions/setup-go@v3 with: - go-version: 1.19 + go-version: 1.20 - uses: actions/checkout@v3 # Generate versions - run: scripts/generate-kurtosis-version.sh From 1cd04f5cb51b3997eebff740109adf43f76503bf Mon Sep 17 00:00:00 2001 From: lostbean Date: Wed, 6 Dec 2023 09:50:27 -0300 Subject: [PATCH 86/95] set go module off during linter CI --- .github/workflows/golangci-lint.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index c9457cb391..dac3778006 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -25,9 +25,11 @@ jobs: name: golang-lint runs-on: ubuntu-latest steps: - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v4 with: go-version: 1.20 + env: + GO111MODULE: off - uses: actions/checkout@v3 # Generate versions - run: scripts/generate-kurtosis-version.sh From 762e45e3b2b6ce669296dce8f98d3edf55750829 Mon Sep 17 00:00:00 2001 From: lostbean Date: Wed, 6 Dec 2023 10:04:04 -0300 Subject: [PATCH 87/95] tidy it all --- api/golang/go.mod | 1 - api/golang/go.sum | 2 -- cli/cli/go.sum | 2 +- core/launcher/go.mod | 9 ++++++++- core/launcher/go.sum | 26 +++++++++++++++++++++++++- core/server/go.mod | 7 +++---- core/server/go.sum | 14 +++++++------- engine/launcher/go.mod | 12 ++++++++++-- engine/launcher/go.sum | 26 +++++++++++++++++++++++++- engine/server/go.mod | 2 +- engine/server/go.sum | 6 +++--- go.work.sum | 1 + internal_testsuites/golang/go.mod | 5 +++-- internal_testsuites/golang/go.sum | 10 ++++++---- metrics-library/golang/go.mod | 2 +- 15 files changed, 94 insertions(+), 31 deletions(-) diff --git a/api/golang/go.mod b/api/golang/go.mod index 29e3eae7a0..64a4982d09 100644 --- a/api/golang/go.mod +++ b/api/golang/go.mod @@ -49,7 +49,6 @@ require ( github.com/go-playground/universal-translator v0.18.1 // indirect github.com/go-playground/validator/v10 v10.14.0 // indirect github.com/goccy/go-json v0.10.2 // indirect - github.com/golang-jwt/jwt v3.2.2+incompatible // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/gomarkdown/markdown v0.0.0-20230716120725-531d2d74bc12 // indirect diff --git a/api/golang/go.sum b/api/golang/go.sum index 24c4a0e9ad..9838cef789 100644 --- a/api/golang/go.sum +++ b/api/golang/go.sum @@ -74,8 +74,6 @@ github.com/go-yaml/yaml v2.1.0+incompatible/go.mod h1:w2MrLa16VYP0jy6N7M5kHaCkaL github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= -github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY= -github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= diff --git a/cli/cli/go.sum b/cli/cli/go.sum index 8e4d98c917..4e34926b7d 100644 --- a/cli/cli/go.sum +++ b/cli/cli/go.sum @@ -515,7 +515,7 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.9.0 h1:l9HGsTsHJcvW14Nk7J9KFz8bzeAWXn3CG6bgt7LsrAE= github.com/rs/cors v1.9.0/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= diff --git a/core/launcher/go.mod b/core/launcher/go.mod index 018c7285c3..53bbc2f5b5 100644 --- a/core/launcher/go.mod +++ b/core/launcher/go.mod @@ -15,12 +15,19 @@ require ( github.com/stretchr/testify v1.8.4 ) +require github.com/kurtosis-tech/kurtosis/metrics-library/golang v0.0.0-20231206095907-9bdf0d02cb90 + require ( github.com/davecgh/go-spew v1.1.1 // indirect - github.com/kr/text v0.2.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/rogpeppe/go-internal v1.11.0 // indirect + github.com/segmentio/backo-go v1.0.0 // indirect github.com/stretchr/objx v0.5.0 // indirect + github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c // indirect golang.org/x/sys v0.13.0 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect + gopkg.in/segmentio/analytics-go.v3 v3.1.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect + k8s.io/apimachinery v0.27.2 // indirect + k8s.io/utils v0.0.0-20230711102312-30195339c3c7 // indirect ) diff --git a/core/launcher/go.sum b/core/launcher/go.sum index db8464f2bf..412c83f7c9 100644 --- a/core/launcher/go.sum +++ b/core/launcher/go.sum @@ -1,34 +1,58 @@ +github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY= +github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/kurtosis-tech/kurtosis/metrics-library/golang v0.0.0-20231206095907-9bdf0d02cb90 h1:TsoeAb56Igz+Rz4bLT4KC69H0DIl8rjqFivynZ+ynNw= +github.com/kurtosis-tech/kurtosis/metrics-library/golang v0.0.0-20231206095907-9bdf0d02cb90/go.mod h1:iI48cMGK2g4lkccaUPSVd+kjVnrKdwK5eCdCqHQIsmA= github.com/kurtosis-tech/stacktrace v0.0.0-20211028211901-1c67a77b5409 h1:YQTATifMUwZEtZYb0LVA7DK2pj8s71iY8rzweuUQ5+g= github.com/kurtosis-tech/stacktrace v0.0.0-20211028211901-1c67a77b5409/go.mod h1:y5weVs5d9wXXHcDA1awRxkIhhHC1xxYJN8a7aXnE6S8= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= +github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/segmentio/backo-go v1.0.0 h1:kbOAtGJY2DqOR0jfRkYEorx/b18RgtepGtY3+Cpe6qA= +github.com/segmentio/backo-go v1.0.0/go.mod h1:kJ9mm9YmoWSkk+oQ+5Cj8DEoRCX2JT6As4kEtIIOp1M= +github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c h1:3lbZUMbMiGUW/LMkfsEABsc5zNT9+b1CvsJx47JzJ8g= +github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c/go.mod h1:UrdRz5enIKZ63MEE3IF9l2/ebyx59GyGgPi+tICQdmM= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/segmentio/analytics-go.v3 v3.1.0 h1:UzxH1uaGZRpMKDhJyBz0pexz6yUoBU3x8bJsRk/HV6U= +gopkg.in/segmentio/analytics-go.v3 v3.1.0/go.mod h1:4QqqlTlSSpVlWA9/9nDcPw+FkM2yv1NQoYjUbL9/JAw= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +k8s.io/apimachinery v0.27.2 h1:vBjGaKKieaIreI+oQwELalVG4d8f3YAMNpWLzDXkxeg= +k8s.io/apimachinery v0.27.2/go.mod h1:XNfZ6xklnMCOGGFNqXG7bUrQCoR04dh/E7FprV6pb+E= +k8s.io/utils v0.0.0-20230711102312-30195339c3c7 h1:ZgnF1KZsYxWIifwSNZFZgNtWE89WI5yiP5WwlfDoIyc= +k8s.io/utils v0.0.0-20230711102312-30195339c3c7/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= diff --git a/core/server/go.mod b/core/server/go.mod index 095beebd0a..971579029b 100644 --- a/core/server/go.mod +++ b/core/server/go.mod @@ -14,7 +14,7 @@ replace ( ) require ( - github.com/google/uuid v1.3.0 + github.com/google/uuid v1.3.1 github.com/kurtosis-tech/kurtosis/api/golang v0.84.10 // Local dependency github.com/kurtosis-tech/kurtosis/container-engine-lib v0.0.0 // Local dependency github.com/kurtosis-tech/kurtosis/core/files_artifacts_expander v0.0.0 // Local dependency @@ -48,7 +48,7 @@ require ( github.com/Microsoft/go-winio v0.6.1 // indirect github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 // indirect github.com/acomagu/bufpipe v1.0.3 // indirect - github.com/andybalholm/brotli v1.0.4 // indirect + github.com/andybalholm/brotli v1.0.5 // indirect github.com/bytedance/sonic v1.9.2 // indirect github.com/cenkalti/backoff/v4 v4.2.1 // indirect github.com/cloudflare/circl v1.3.3 // indirect @@ -64,13 +64,12 @@ require ( github.com/frankban/quicktest v1.14.5 // indirect github.com/gammazero/deque v0.1.0 // indirect github.com/gammazero/workerpool v1.1.2 // indirect - github.com/gin-gonic/gin v1.9.1 // indirect github.com/go-git/gcfg v1.5.0 // indirect github.com/go-git/go-billy/v5 v5.3.1 // indirect github.com/go-logr/logr v1.2.3 // indirect github.com/go-openapi/jsonpointer v0.19.6 // indirect github.com/go-openapi/jsonreference v0.20.1 // indirect - github.com/go-openapi/swag v0.22.3 // indirect + github.com/go-openapi/swag v0.22.4 // indirect github.com/go-playground/validator/v10 v10.14.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/protobuf v1.5.3 // indirect diff --git a/core/server/go.sum b/core/server/go.sum index be05db2a67..a6a50573e4 100644 --- a/core/server/go.sum +++ b/core/server/go.sum @@ -26,8 +26,8 @@ github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRF github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/andybalholm/brotli v1.0.1/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= -github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY= -github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= +github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs= +github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 h1:kFOfPq6dUM1hTo4JG6LR5AXSUEsOjtdm0kw0FtQtMJA= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= @@ -129,7 +129,6 @@ github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= -github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= github.com/gliderlabs/ssh v0.2.2 h1:6zsha5zo/TWhRhwqCD3+EarCAgZ2yN28ipRnGPnwkI0= github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4= @@ -155,8 +154,9 @@ github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= github.com/go-openapi/jsonreference v0.20.1 h1:FBLnyygC4/IZZr893oiomc9XaghoveYTrLC1F86HID8= github.com/go-openapi/jsonreference v0.20.1/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= -github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU= +github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= @@ -227,8 +227,8 @@ github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/ github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= +github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= @@ -460,7 +460,7 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.9.0 h1:l9HGsTsHJcvW14Nk7J9KFz8bzeAWXn3CG6bgt7LsrAE= github.com/rs/cors v1.9.0/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= diff --git a/engine/launcher/go.mod b/engine/launcher/go.mod index 01a5d8174f..22a5c80b71 100644 --- a/engine/launcher/go.mod +++ b/engine/launcher/go.mod @@ -15,14 +15,22 @@ require ( github.com/stretchr/testify v1.8.4 ) -require github.com/kurtosis-tech/kurtosis/kurtosis_version v0.0.0-00010101000000-000000000000 +require ( + github.com/kurtosis-tech/kurtosis/kurtosis_version v0.0.0-00010101000000-000000000000 + github.com/kurtosis-tech/kurtosis/metrics-library/golang v0.0.0-20231206095907-9bdf0d02cb90 +) require ( github.com/davecgh/go-spew v1.1.1 // indirect - github.com/kr/text v0.2.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/rogpeppe/go-internal v1.11.0 // indirect + github.com/segmentio/backo-go v1.0.0 // indirect github.com/stretchr/objx v0.5.0 // indirect + github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c // indirect golang.org/x/sys v0.13.0 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect + gopkg.in/segmentio/analytics-go.v3 v3.1.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect + k8s.io/apimachinery v0.27.2 // indirect + k8s.io/utils v0.0.0-20230711102312-30195339c3c7 // indirect ) diff --git a/engine/launcher/go.sum b/engine/launcher/go.sum index db8464f2bf..412c83f7c9 100644 --- a/engine/launcher/go.sum +++ b/engine/launcher/go.sum @@ -1,34 +1,58 @@ +github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY= +github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/kurtosis-tech/kurtosis/metrics-library/golang v0.0.0-20231206095907-9bdf0d02cb90 h1:TsoeAb56Igz+Rz4bLT4KC69H0DIl8rjqFivynZ+ynNw= +github.com/kurtosis-tech/kurtosis/metrics-library/golang v0.0.0-20231206095907-9bdf0d02cb90/go.mod h1:iI48cMGK2g4lkccaUPSVd+kjVnrKdwK5eCdCqHQIsmA= github.com/kurtosis-tech/stacktrace v0.0.0-20211028211901-1c67a77b5409 h1:YQTATifMUwZEtZYb0LVA7DK2pj8s71iY8rzweuUQ5+g= github.com/kurtosis-tech/stacktrace v0.0.0-20211028211901-1c67a77b5409/go.mod h1:y5weVs5d9wXXHcDA1awRxkIhhHC1xxYJN8a7aXnE6S8= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= +github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/segmentio/backo-go v1.0.0 h1:kbOAtGJY2DqOR0jfRkYEorx/b18RgtepGtY3+Cpe6qA= +github.com/segmentio/backo-go v1.0.0/go.mod h1:kJ9mm9YmoWSkk+oQ+5Cj8DEoRCX2JT6As4kEtIIOp1M= +github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c h1:3lbZUMbMiGUW/LMkfsEABsc5zNT9+b1CvsJx47JzJ8g= +github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c/go.mod h1:UrdRz5enIKZ63MEE3IF9l2/ebyx59GyGgPi+tICQdmM= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/segmentio/analytics-go.v3 v3.1.0 h1:UzxH1uaGZRpMKDhJyBz0pexz6yUoBU3x8bJsRk/HV6U= +gopkg.in/segmentio/analytics-go.v3 v3.1.0/go.mod h1:4QqqlTlSSpVlWA9/9nDcPw+FkM2yv1NQoYjUbL9/JAw= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +k8s.io/apimachinery v0.27.2 h1:vBjGaKKieaIreI+oQwELalVG4d8f3YAMNpWLzDXkxeg= +k8s.io/apimachinery v0.27.2/go.mod h1:XNfZ6xklnMCOGGFNqXG7bUrQCoR04dh/E7FprV6pb+E= +k8s.io/utils v0.0.0-20230711102312-30195339c3c7 h1:ZgnF1KZsYxWIifwSNZFZgNtWE89WI5yiP5WwlfDoIyc= +k8s.io/utils v0.0.0-20230711102312-30195339c3c7/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= diff --git a/engine/server/go.mod b/engine/server/go.mod index f3657ce45d..d87637a953 100644 --- a/engine/server/go.mod +++ b/engine/server/go.mod @@ -59,7 +59,7 @@ require ( github.com/hpcloud/tail v1.0.0 github.com/kurtosis-tech/kurtosis/enclave-manager/server v0.0.0-00010101000000-000000000000 github.com/kurtosis-tech/kurtosis/grpc-file-transfer/golang v0.0.0-20230803130419-099ee7a4e3dc - github.com/kurtosis-tech/kurtosis/metrics-library/golang v0.0.0-20231130220701-e2b75b25d597 + github.com/kurtosis-tech/kurtosis/metrics-library/golang v0.0.0-20231206095907-9bdf0d02cb90 github.com/labstack/echo/v4 v4.11.3 github.com/rs/cors v1.9.0 github.com/spf13/afero v1.10.0 diff --git a/engine/server/go.sum b/engine/server/go.sum index 39ad416a17..2ffcc014bc 100644 --- a/engine/server/go.sum +++ b/engine/server/go.sum @@ -289,8 +289,8 @@ github.com/kurtosis-tech/kurtosis/cloud/api/golang v0.0.0-20230828153722-32770ca github.com/kurtosis-tech/kurtosis/cloud/api/golang v0.0.0-20230828153722-32770ca96513/go.mod h1:7wEpADHHiptqiCiomzqRy9Anczj4+NrgxA8GPXk7EF0= github.com/kurtosis-tech/kurtosis/enclave-manager/api/golang v0.0.0-20230828153722-32770ca96513 h1:KSyu8+axnBYr2pmq+T1ktUWXrJzeepvvm0T2tJNUtAA= github.com/kurtosis-tech/kurtosis/enclave-manager/api/golang v0.0.0-20230828153722-32770ca96513/go.mod h1:mk3E4+k43ai3BZKMGKAvRuCXV+KT/VBc7VPGVO1nz4Y= -github.com/kurtosis-tech/kurtosis/metrics-library/golang v0.0.0-20231130220701-e2b75b25d597 h1:f3dU2EOFOqBFZOSpiBt+Fz1AbKhy8Xl0RLYcZiCOMxw= -github.com/kurtosis-tech/kurtosis/metrics-library/golang v0.0.0-20231130220701-e2b75b25d597/go.mod h1:iI48cMGK2g4lkccaUPSVd+kjVnrKdwK5eCdCqHQIsmA= +github.com/kurtosis-tech/kurtosis/metrics-library/golang v0.0.0-20231206095907-9bdf0d02cb90 h1:TsoeAb56Igz+Rz4bLT4KC69H0DIl8rjqFivynZ+ynNw= +github.com/kurtosis-tech/kurtosis/metrics-library/golang v0.0.0-20231206095907-9bdf0d02cb90/go.mod h1:iI48cMGK2g4lkccaUPSVd+kjVnrKdwK5eCdCqHQIsmA= github.com/kurtosis-tech/stacktrace v0.0.0-20211028211901-1c67a77b5409 h1:YQTATifMUwZEtZYb0LVA7DK2pj8s71iY8rzweuUQ5+g= github.com/kurtosis-tech/stacktrace v0.0.0-20211028211901-1c67a77b5409/go.mod h1:y5weVs5d9wXXHcDA1awRxkIhhHC1xxYJN8a7aXnE6S8= github.com/labstack/echo/v4 v4.11.3 h1:Upyu3olaqSHkCjs1EJJwQ3WId8b8b1hxbogyommKktM= @@ -348,7 +348,7 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= github.com/rs/cors v1.9.0 h1:l9HGsTsHJcvW14Nk7J9KFz8bzeAWXn3CG6bgt7LsrAE= github.com/rs/cors v1.9.0/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= diff --git a/go.work.sum b/go.work.sum index 76a9d9c285..58c36fef39 100644 --- a/go.work.sum +++ b/go.work.sum @@ -168,6 +168,7 @@ golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= diff --git a/internal_testsuites/golang/go.mod b/internal_testsuites/golang/go.mod index 3736dd298d..b2df60a6db 100644 --- a/internal_testsuites/golang/go.mod +++ b/internal_testsuites/golang/go.mod @@ -27,15 +27,16 @@ require ( require ( github.com/Masterminds/semver/v3 v3.1.1 // indirect github.com/adrg/xdg v0.4.0 // indirect - github.com/andybalholm/brotli v1.0.4 // indirect + github.com/andybalholm/brotli v1.0.5 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5 // indirect github.com/ghodss/yaml v1.0.0 // indirect github.com/go-yaml/yaml v2.1.0+incompatible // indirect github.com/golang/snappy v0.0.4 // indirect - github.com/google/uuid v1.3.0 // indirect + github.com/google/uuid v1.3.1 // indirect github.com/klauspost/compress v1.16.7 // indirect github.com/klauspost/pgzip v1.2.5 // indirect + github.com/kr/text v0.2.0 // indirect github.com/kurtosis-tech/kurtosis-portal/api/golang v0.0.0-20230818182330-1a86869414d2 // indirect github.com/kurtosis-tech/kurtosis/contexts-config-store v0.0.0-20230818184218-f4e3e773463b // indirect github.com/kurtosis-tech/kurtosis/grpc-file-transfer/golang v0.0.0 // indirect diff --git a/internal_testsuites/golang/go.sum b/internal_testsuites/golang/go.sum index a2a8f19be8..8d01c7efc3 100644 --- a/internal_testsuites/golang/go.sum +++ b/internal_testsuites/golang/go.sum @@ -5,11 +5,12 @@ github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0 github.com/adrg/xdg v0.4.0 h1:RzRqFcjH4nE5C6oTAxhBtoE2IRyjBSa62SCbyPidvls= github.com/adrg/xdg v0.4.0/go.mod h1:N6ag73EX4wyxeaoeHctc1mas01KZgsj5tYiAIwqJE/E= github.com/andybalholm/brotli v1.0.1/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= -github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY= -github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= +github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs= +github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -49,8 +50,8 @@ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= +github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.11.4/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I= @@ -60,6 +61,7 @@ github.com/klauspost/pgzip v1.2.5 h1:qnWYvvKqedOF2ulHpMG72XQol4ILEJ8k2wwRl/Km8oE github.com/klauspost/pgzip v1.2.5/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kurtosis-tech/example-api-server/api/golang v0.0.0-20211207020812-00a54fc29318 h1:F5lkz4H1EZSaFvIlfT1aIbA1RyOkCQh59qZObL7YUmU= github.com/kurtosis-tech/example-api-server/api/golang v0.0.0-20211207020812-00a54fc29318/go.mod h1:HI+M5KdzhZ165JPV7vQvldNNE8m86ZIeg86PzwS6cqs= github.com/kurtosis-tech/example-datastore-server/api/golang v0.0.0-20211207020830-504dbf5ed1a6 h1:0LRCDs1zd30kFyEVdapKnVHuq9gdMNzpLQ6glahob9k= diff --git a/metrics-library/golang/go.mod b/metrics-library/golang/go.mod index c9e37c0cc9..44a073e69b 100644 --- a/metrics-library/golang/go.mod +++ b/metrics-library/golang/go.mod @@ -6,7 +6,7 @@ require ( github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect github.com/kr/pretty v0.3.0 // indirect github.com/kurtosis-tech/stacktrace v0.0.0-20211028211901-1c67a77b5409 - github.com/segmentio/backo-go v1.0.0 // indirect + github.com/segmentio/backo-go v1.0.0 github.com/sirupsen/logrus v1.8.1 github.com/stretchr/testify v1.7.0 github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c // indirect From fabab420a3dd46a6f29436259a46f8786e3e6adf Mon Sep 17 00:00:00 2001 From: lostbean Date: Wed, 6 Dec 2023 10:14:22 -0300 Subject: [PATCH 88/95] use quote to force version to be string --- .github/workflows/golangci-lint.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index dac3778006..7d837605f4 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -18,7 +18,7 @@ on: merge_group: env: - GOLINT_VERSION: v1.52.2 + GOLINT_VERSION: v1.53.3 jobs: golangci: @@ -27,9 +27,7 @@ jobs: steps: - uses: actions/setup-go@v4 with: - go-version: 1.20 - env: - GO111MODULE: off + go-version: '1.20' - uses: actions/checkout@v3 # Generate versions - run: scripts/generate-kurtosis-version.sh From d30c9b63f1366f89fe846ea40a51b271b0490394 Mon Sep 17 00:00:00 2001 From: lostbean Date: Wed, 6 Dec 2023 10:23:37 -0300 Subject: [PATCH 89/95] fix another missing enum case --- core/server/api_container/server/api_container_service.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/server/api_container/server/api_container_service.go b/core/server/api_container/server/api_container_service.go index 5e8dabd37e..082fb38d1a 100644 --- a/core/server/api_container/server/api_container_service.go +++ b/core/server/api_container/server/api_container_service.go @@ -954,6 +954,9 @@ func convertServiceStatusToServiceInfoStatus(serviceStatus service.ServiceStatus return kurtosis_core_rpc_api_bindings.ServiceStatus_RUNNING, nil case service.ServiceStatus_Stopped: return kurtosis_core_rpc_api_bindings.ServiceStatus_STOPPED, nil + case service.ServiceStatus_Registered: + // missing case flagged by the linter, returning default to keep the same behavior since there is match on gRPC api + return kurtosis_core_rpc_api_bindings.ServiceStatus_UNKNOWN, stacktrace.NewError("Failed to convert service status %v", serviceStatus) default: return kurtosis_core_rpc_api_bindings.ServiceStatus_UNKNOWN, stacktrace.NewError("Failed to convert service status %v", serviceStatus) } From 3f0bf59712b47da1cb53ecaf04a16be37faa00cf Mon Sep 17 00:00:00 2001 From: lostbean Date: Wed, 6 Dec 2023 10:50:02 -0300 Subject: [PATCH 90/95] fix linter errors in other modules --- .../container_status_stringifier.go | 2 ++ .../kurtosis_instruction_printer.go | 8 ++++--- .../service_status_stringifier.go | 2 ++ connect-server/server.go | 16 ++++++++----- enclave-manager/server/server.go | 23 +++++++++++++------ 5 files changed, 35 insertions(+), 16 deletions(-) diff --git a/cli/cli/helpers/container_status_stringifier/container_status_stringifier.go b/cli/cli/helpers/container_status_stringifier/container_status_stringifier.go index 5d64f07c0b..87da321713 100644 --- a/cli/cli/helpers/container_status_stringifier/container_status_stringifier.go +++ b/cli/cli/helpers/container_status_stringifier/container_status_stringifier.go @@ -17,6 +17,8 @@ func ContainerStatusStringifier(containerStatus kurtosis_core_rpc_api_bindings.C return colorizeStopped(containerStatusStr) case kurtosis_core_rpc_api_bindings.Container_RUNNING: return colorizeRunning(containerStatusStr) + case kurtosis_core_rpc_api_bindings.Container_UNKNOWN: + return containerStatusStr default: return containerStatusStr } diff --git a/cli/cli/helpers/output_printers/kurtosis_instruction_printer.go b/cli/cli/helpers/output_printers/kurtosis_instruction_printer.go index 8fa5303703..465d97e790 100644 --- a/cli/cli/helpers/output_printers/kurtosis_instruction_printer.go +++ b/cli/cli/helpers/output_printers/kurtosis_instruction_printer.go @@ -3,6 +3,10 @@ package output_printers import ( "errors" "fmt" + "strings" + "sync" + "time" + "github.com/bazelbuild/buildtools/build" "github.com/briandowns/spinner" "github.com/fatih/color" @@ -12,9 +16,6 @@ import ( "github.com/kurtosis-tech/kurtosis/cli/cli/out" "github.com/kurtosis-tech/stacktrace" "github.com/sirupsen/logrus" - "strings" - "sync" - "time" ) const ( @@ -184,6 +185,7 @@ func formatInfo(infoMessage string) string { return colorizeInfo(infoMessage) } +// nolint:exhaustive func formatInstruction(instruction *kurtosis_core_rpc_api_bindings.StarlarkInstruction, verbosity run.Verbosity) string { var serializedInstruction string switch verbosity { diff --git a/cli/cli/helpers/service_status_stringifier/service_status_stringifier.go b/cli/cli/helpers/service_status_stringifier/service_status_stringifier.go index d1f6b9b06e..ddefded603 100644 --- a/cli/cli/helpers/service_status_stringifier/service_status_stringifier.go +++ b/cli/cli/helpers/service_status_stringifier/service_status_stringifier.go @@ -17,6 +17,8 @@ func ServiceStatusStringifier(serviceStatus kurtosis_core_rpc_api_bindings.Servi return colorizeStopped(serviceStatusStr) case kurtosis_core_rpc_api_bindings.ServiceStatus_RUNNING: return colorizeRunning(serviceStatusStr) + case kurtosis_core_rpc_api_bindings.ServiceStatus_UNKNOWN: + return serviceStatusStr default: return serviceStatusStr } diff --git a/connect-server/server.go b/connect-server/server.go index dfedc99d14..411283bed4 100644 --- a/connect-server/server.go +++ b/connect-server/server.go @@ -3,17 +3,18 @@ package connect_server import ( "context" "fmt" - "github.com/kurtosis-tech/stacktrace" - "github.com/rs/cors" - "github.com/sirupsen/logrus" - "golang.org/x/net/http2" - "golang.org/x/net/http2/h2c" "log" "net/http" "os" "os/signal" "syscall" "time" + + "github.com/kurtosis-tech/stacktrace" + "github.com/rs/cors" + "github.com/sirupsen/logrus" + "golang.org/x/net/http2" + "golang.org/x/net/http2/h2c" ) const ( @@ -63,6 +64,7 @@ func (server *ConnectServer) RunServerUntilStopped( mux.Handle(server.path, server.handler) + // nolint:exhaustruct httpServer := http.Server{ Addr: fmt.Sprintf(":%v", server.listenPort), Handler: cors.Handler(h2c.NewHandler(mux, &http2.Server{})), @@ -78,7 +80,9 @@ func (server *ConnectServer) RunServerUntilStopped( <-stopper serverStoppedChan := make(chan interface{}) go func() { - httpServer.Shutdown(context.Background()) + if err := httpServer.Shutdown(context.Background()); err != nil { + logrus.WithError(err).Error("Failed to shutdown the HTTP server") + } serverStoppedChan <- nil }() select { diff --git a/enclave-manager/server/server.go b/enclave-manager/server/server.go index d17e7c8c75..cf327283f2 100644 --- a/enclave-manager/server/server.go +++ b/enclave-manager/server/server.go @@ -26,11 +26,13 @@ import ( ) const ( - listenPort = 8081 - grpcServerStopGracePeriod = 5 * time.Second - engineHostUrl = "http://localhost:9710" - kurtosisCloudApiHost = "https://cloud.kurtosis.com" - kurtosisCloudApiPort = 8080 + listenPort = 8081 + grpcServerStopGracePeriod = 5 * time.Second + engineHostUrl = "http://localhost:9710" + kurtosisCloudApiHost = "https://cloud.kurtosis.com" + kurtosisCloudApiPort = 8080 + numberOfElementsAuthHeader = 2 + numberOfElementsHostString = 2 ) type Authentication struct { @@ -60,6 +62,7 @@ func NewWebserver(enforceAuth bool) (*WebServer, error) { apiKeyMutex: &sync.RWMutex{}, apiKeyMap: map[string]*string{}, instanceConfigMap: map[string]*kurtosis_backend_server_rpc_api_bindings.GetCloudInstanceConfigResponse{}, + instanceConfig: nil, }, nil } @@ -83,7 +86,7 @@ func (c *WebServer) ValidateRequestAuthorization( reqToken := header.Get("Authorization") splitToken := strings.Split(reqToken, "Bearer") - if len(splitToken) != 2 { + if len(splitToken) != numberOfElementsAuthHeader { return false, stacktrace.NewError("Authorization token malformed. Bearer token format required") } reqToken = strings.TrimSpace(splitToken[1]) @@ -101,7 +104,7 @@ func (c *WebServer) ValidateRequestAuthorization( } reqHost := header.Get("Host") splitHost := strings.Split(reqHost, ":") - if len(splitHost) != 2 { + if len(splitHost) != numberOfElementsHostString { return false, stacktrace.NewError("Host header malformed. host:port format required") } reqHost = splitHost[0] @@ -227,6 +230,9 @@ func (c *WebServer) RunStarlarkPackage(ctx context.Context, req *connect.Request } starlarkLogsStream, err := (*apiContainerServiceClient).RunStarlarkPackage(ctx, runStarlarkRequest) + if err != nil { + return stacktrace.Propagate(err, "Failed to run package: %s", req.Msg.RunStarlarkPackageArgs.PackageId) + } for starlarkLogsStream.Receive() { resp := starlarkLogsStream.Msg() @@ -333,6 +339,9 @@ func (c *WebServer) DownloadFilesArtifact( } filesArtifactStream, err := (*apiContainerServiceClient).DownloadFilesArtifact(ctx, downloadFilesArtifactRequest) + if err != nil { + return stacktrace.Propagate(err, "Failed to create download stream for file artifact: %s", filesArtifactIdentifier) + } for filesArtifactStream.Receive() { resp := filesArtifactStream.Msg() err = str.Send(resp) From 00851b7a62883d7761eed69454899a83623e68ae Mon Sep 17 00:00:00 2001 From: lostbean Date: Wed, 6 Dec 2023 11:33:33 -0300 Subject: [PATCH 91/95] update all references to go 1.20 --- .github/workflows/check-proto-break.yml | 2 +- .github/workflows/gofmt.yml | 2 +- README.md | 10 +++++----- api/golang/go.mod | 2 +- cli/cli/go.mod | 2 +- cloud/api/golang/go.mod | 2 +- connect-server/go.mod | 2 +- container-engine-lib/go.mod | 2 +- contexts-config-store/go.mod | 2 +- core/files_artifacts_expander/go.mod | 2 +- core/launcher/go.mod | 2 +- core/server/go.mod | 2 +- enclave-manager/api/golang/go.mod | 2 +- enclave-manager/server/go.mod | 2 +- engine/launcher/go.mod | 2 +- engine/server/go.mod | 2 +- go.work | 2 +- grpc-file-transfer/golang/go.mod | 2 +- internal_testsuites/golang/go.mod | 2 +- kurtosis_version/go.mod | 2 +- name_generator/go.mod | 2 +- scripts/versions_check.sh | 2 +- 22 files changed, 26 insertions(+), 26 deletions(-) diff --git a/.github/workflows/check-proto-break.yml b/.github/workflows/check-proto-break.yml index 49db98cc17..d293d29524 100644 --- a/.github/workflows/check-proto-break.yml +++ b/.github/workflows/check-proto-break.yml @@ -13,7 +13,7 @@ jobs: steps: - uses: actions/setup-go@v3 with: - go-version: 1.19 + go-version: '1.20' - run: go install github.com/bufbuild/buf/cmd/buf@v1.26.1 - uses: actions/checkout@v3 with: diff --git a/.github/workflows/gofmt.yml b/.github/workflows/gofmt.yml index a54257594a..f9da39a006 100644 --- a/.github/workflows/gofmt.yml +++ b/.github/workflows/gofmt.yml @@ -17,7 +17,7 @@ jobs: steps: - uses: actions/setup-go@v3 with: - go-version: 1.19 + go-version: '1.20' - uses: actions/checkout@v3 - run: scripts/generate-kurtosis-version.sh - uses: Jerome1337/gofmt-action@v1.0.5 diff --git a/README.md b/README.md index 822e8e6568..6efbd0eebe 100644 --- a/README.md +++ b/README.md @@ -195,21 +195,21 @@ On MacOS: brew install docker ``` -#### Go (1.19 or above) +#### Go (1.20 or above) On MacOS: ```bash -brew install go@1.19 +brew install go@1.20 # Add the Go binary dir to your PATH -PATH="${BREW_PREFIX}/opt/go@1.19/bin:$PATH" +PATH="${BREW_PREFIX}/opt/go@1.20/bin:$PATH" # Add the GOPATH bin dir to your PATH PATH="${HOME}/go/bin:$PATH" ``` On Ubuntu: ```bash -wget https://go.dev/dl/go1.19.13.linux-amd64.tar.gz -tar -C /usr/local -zxf go1.19.13.linux-amd64.tar.gz +wget https://go.dev/dl/go1.20.8.linux-amd64.tar.gz +tar -C /usr/local -zxf go1.20.8.linux-amd64.tar.gz # Add the following to your bashrc or equivalent. export PATH=$PATH:/usr/local/go/bin ``` diff --git a/api/golang/go.mod b/api/golang/go.mod index 64a4982d09..e4acd5cc1f 100644 --- a/api/golang/go.mod +++ b/api/golang/go.mod @@ -1,6 +1,6 @@ module github.com/kurtosis-tech/kurtosis/api/golang -go 1.19 +go 1.20 replace github.com/kurtosis-tech/kurtosis/grpc-file-transfer/golang => ../../grpc-file-transfer/golang diff --git a/cli/cli/go.mod b/cli/cli/go.mod index d7173e4370..3c32d92838 100644 --- a/cli/cli/go.mod +++ b/cli/cli/go.mod @@ -1,6 +1,6 @@ module github.com/kurtosis-tech/kurtosis/cli/cli -go 1.19 +go 1.20 replace ( github.com/kurtosis-tech/kurtosis/api/golang => ../../api/golang diff --git a/cloud/api/golang/go.mod b/cloud/api/golang/go.mod index e5dcb9fb9c..291032cf1c 100644 --- a/cloud/api/golang/go.mod +++ b/cloud/api/golang/go.mod @@ -1,6 +1,6 @@ module github.com/kurtosis-tech/kurtosis/cloud/api/golang -go 1.19 +go 1.20 require ( connectrpc.com/connect v1.11.1 diff --git a/connect-server/go.mod b/connect-server/go.mod index 91aa9d3de1..46cdea831c 100644 --- a/connect-server/go.mod +++ b/connect-server/go.mod @@ -1,6 +1,6 @@ module github.com/kurtosis-tech/kurtosis/connect-server -go 1.19 +go 1.20 require ( github.com/kurtosis-tech/stacktrace v0.0.0-20211028211901-1c67a77b5409 diff --git a/container-engine-lib/go.mod b/container-engine-lib/go.mod index 86a393672d..063196e6e6 100644 --- a/container-engine-lib/go.mod +++ b/container-engine-lib/go.mod @@ -1,6 +1,6 @@ module github.com/kurtosis-tech/kurtosis/container-engine-lib -go 1.19 +go 1.20 require ( github.com/dmarkham/enumer v1.5.5 diff --git a/contexts-config-store/go.mod b/contexts-config-store/go.mod index c7a8498a93..c0987222e9 100644 --- a/contexts-config-store/go.mod +++ b/contexts-config-store/go.mod @@ -1,6 +1,6 @@ module github.com/kurtosis-tech/kurtosis/contexts-config-store -go 1.19 +go 1.20 require ( github.com/adrg/xdg v0.4.0 diff --git a/core/files_artifacts_expander/go.mod b/core/files_artifacts_expander/go.mod index 7725fd1cb8..9b752fcd8b 100644 --- a/core/files_artifacts_expander/go.mod +++ b/core/files_artifacts_expander/go.mod @@ -1,6 +1,6 @@ module github.com/kurtosis-tech/kurtosis/core/files_artifacts_expander -go 1.19 +go 1.20 replace ( github.com/kurtosis-tech/kurtosis/api/golang => ../../api/golang diff --git a/core/launcher/go.mod b/core/launcher/go.mod index 53bbc2f5b5..514ad67b26 100644 --- a/core/launcher/go.mod +++ b/core/launcher/go.mod @@ -1,6 +1,6 @@ module github.com/kurtosis-tech/kurtosis/core/launcher -go 1.19 +go 1.20 replace ( github.com/kurtosis-tech/kurtosis/container-engine-lib => ../../container-engine-lib diff --git a/core/server/go.mod b/core/server/go.mod index 971579029b..13f74a290a 100644 --- a/core/server/go.mod +++ b/core/server/go.mod @@ -1,6 +1,6 @@ module github.com/kurtosis-tech/kurtosis/core/server -go 1.19 +go 1.20 replace ( github.com/kurtosis-tech/kurtosis/api/golang => ../../api/golang diff --git a/enclave-manager/api/golang/go.mod b/enclave-manager/api/golang/go.mod index 826724087d..d251df7362 100644 --- a/enclave-manager/api/golang/go.mod +++ b/enclave-manager/api/golang/go.mod @@ -1,6 +1,6 @@ module github.com/kurtosis-tech/kurtosis/enclave-manager/api/golang -go 1.19 +go 1.20 require ( connectrpc.com/connect v1.11.1 diff --git a/enclave-manager/server/go.mod b/enclave-manager/server/go.mod index 82897450bf..e3138d9efd 100644 --- a/enclave-manager/server/go.mod +++ b/enclave-manager/server/go.mod @@ -1,6 +1,6 @@ module github.com/kurtosis-tech/kurtosis/enclave-manager -go 1.19 +go 1.20 require ( connectrpc.com/connect v1.11.1 diff --git a/engine/launcher/go.mod b/engine/launcher/go.mod index 22a5c80b71..de2915712a 100644 --- a/engine/launcher/go.mod +++ b/engine/launcher/go.mod @@ -1,6 +1,6 @@ module github.com/kurtosis-tech/kurtosis/engine/launcher -go 1.19 +go 1.20 replace ( github.com/kurtosis-tech/kurtosis/container-engine-lib => ../../container-engine-lib diff --git a/engine/server/go.mod b/engine/server/go.mod index d87637a953..4e06028c40 100644 --- a/engine/server/go.mod +++ b/engine/server/go.mod @@ -1,6 +1,6 @@ module github.com/kurtosis-tech/kurtosis/engine/server -go 1.19 +go 1.20 replace ( github.com/kurtosis-tech/kurtosis/api/golang => ../../api/golang diff --git a/go.work b/go.work index 330716f66c..08c6e4e82b 100644 --- a/go.work +++ b/go.work @@ -1,4 +1,4 @@ -go 1.19 +go 1.20 use ( ./api/golang diff --git a/grpc-file-transfer/golang/go.mod b/grpc-file-transfer/golang/go.mod index 7a59c2964b..6e5ee674d8 100644 --- a/grpc-file-transfer/golang/go.mod +++ b/grpc-file-transfer/golang/go.mod @@ -1,6 +1,6 @@ module github.com/kurtosis-tech/kurtosis/grpc-file-transfer/golang -go 1.19 +go 1.20 require ( github.com/kurtosis-tech/stacktrace v0.0.0-20211028211901-1c67a77b5409 diff --git a/internal_testsuites/golang/go.mod b/internal_testsuites/golang/go.mod index b2df60a6db..543888fc40 100644 --- a/internal_testsuites/golang/go.mod +++ b/internal_testsuites/golang/go.mod @@ -1,6 +1,6 @@ module github.com/kurtosis-tech/kurtosis-cli/golang_internal_testsuite -go 1.19 +go 1.20 replace ( github.com/kurtosis-tech/kurtosis/api/golang => ../../api/golang diff --git a/kurtosis_version/go.mod b/kurtosis_version/go.mod index 4c787f9dac..d9e0c42ae0 100644 --- a/kurtosis_version/go.mod +++ b/kurtosis_version/go.mod @@ -1,6 +1,6 @@ module github.com/kurtosis-tech/kurtosis/kurtosis_version -go 1.19 +go 1.20 // NOTE: This module is a tiny module that contains ONLY a Go file (generated via Bash) which contains the current version of the repo, for use // in the APIC and Engine servers, reporting their own version diff --git a/name_generator/go.mod b/name_generator/go.mod index 287ca38191..c3699411a7 100644 --- a/name_generator/go.mod +++ b/name_generator/go.mod @@ -1,6 +1,6 @@ module github.com/kurtosis-tech/kurtosis/name_generator -go 1.19 +go 1.20 require github.com/stretchr/testify v1.8.4 diff --git a/scripts/versions_check.sh b/scripts/versions_check.sh index fbe2330fb8..30b3ff0184 100755 --- a/scripts/versions_check.sh +++ b/scripts/versions_check.sh @@ -3,7 +3,7 @@ set -euo pipefail # Bash "strict mode" # VERSION NUMBERS # FOR GO WE EXPECT _AT LEAST_ THIS VERSION, BUT WE ARE OK WITH SUPERIOR VERSIONS -GO_VERSION=1.19 +GO_VERSION=1.20 # FOR NODE, WE PIN THE EXACT VERSION NUMBER NODE_VERSION=16.14 From afec4a41a11859e29db65a1ff196a467773c0a14 Mon Sep 17 00:00:00 2001 From: lostbean Date: Wed, 6 Dec 2023 11:50:42 -0300 Subject: [PATCH 92/95] move from math/rand to crypto/rand rand.Seed has been deprecated since Go 1.20 and an alternative has been available since Go 1.0: Programs that call Seed and then expect a specific sequence of results from the global random source (using functions such as Int) can be broken when a dependency changes how much it consumes from the global random source. To avoid such breakages, programs that need a specific result sequence should use NewRand(NewSource(seed)) to obtain a random generator that other packages cannot access --- .../docker_network_allocator/docker_network_allocator.go | 6 ------ .../golang/grpc_file_streaming/grpc_stream_io_test.go | 5 +++-- internal_testsuites/golang/test_helpers/test_helpers.go | 5 +++-- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/container-engine-lib/lib/backend_impls/docker/docker_network_allocator/docker_network_allocator.go b/container-engine-lib/lib/backend_impls/docker/docker_network_allocator/docker_network_allocator.go index 83986f2479..d49cfca9d7 100644 --- a/container-engine-lib/lib/backend_impls/docker/docker_network_allocator/docker_network_allocator.go +++ b/container-engine-lib/lib/backend_impls/docker/docker_network_allocator/docker_network_allocator.go @@ -3,7 +3,6 @@ package docker_network_allocator import ( "context" "fmt" - "math/rand" "net" "strings" "time" @@ -51,11 +50,6 @@ type DockerNetworkAllocator struct { } func NewDockerNetworkAllocator(dockerManager *docker_manager.DockerManager) *DockerNetworkAllocator { - // NOTE: If we need a deterministic rand seed anywhere else in the program, this will break it! The reason we do this - // here is because it's way more likely that we'll forget to seed the rand when using this class than it is that we need - // a deterministic rand seed - rand.Seed(time.Now().UnixNano()) - return &DockerNetworkAllocator{ isConstructedViaConstructor: true, dockerManager: dockerManager, diff --git a/grpc-file-transfer/golang/grpc_file_streaming/grpc_stream_io_test.go b/grpc-file-transfer/golang/grpc_file_streaming/grpc_stream_io_test.go index afd9e070ec..ebdc81d621 100644 --- a/grpc-file-transfer/golang/grpc_file_streaming/grpc_stream_io_test.go +++ b/grpc-file-transfer/golang/grpc_file_streaming/grpc_stream_io_test.go @@ -2,11 +2,12 @@ package grpc_file_streaming import ( "bytes" + "crypto/rand" "fmt" + "testing" + "github.com/kurtosis-tech/stacktrace" "github.com/stretchr/testify/require" - "math/rand" - "testing" ) const ( diff --git a/internal_testsuites/golang/test_helpers/test_helpers.go b/internal_testsuites/golang/test_helpers/test_helpers.go index 459e062795..c84b6bc424 100644 --- a/internal_testsuites/golang/test_helpers/test_helpers.go +++ b/internal_testsuites/golang/test_helpers/test_helpers.go @@ -2,11 +2,10 @@ package test_helpers import ( "context" + "crypto/rand" "encoding/json" "fmt" - "github.com/kurtosis-tech/kurtosis/api/golang/core/lib/starlark_run_config" "io" - "math/rand" "net/http" "os" "path" @@ -14,6 +13,8 @@ import ( "testing" "time" + "github.com/kurtosis-tech/kurtosis/api/golang/core/lib/starlark_run_config" + "github.com/golang/protobuf/ptypes/empty" "github.com/kurtosis-tech/example-api-server/api/golang/example_api_server_rpc_api_bindings" "github.com/kurtosis-tech/example-api-server/api/golang/example_api_server_rpc_api_consts" From 7a8e927db86f2a238d241b31568bb87f80e175ae Mon Sep 17 00:00:00 2001 From: lostbean Date: Wed, 6 Dec 2023 12:02:20 -0300 Subject: [PATCH 93/95] add script to run go linter on all go modules --- scripts/go-lint-all.sh | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100755 scripts/go-lint-all.sh diff --git a/scripts/go-lint-all.sh b/scripts/go-lint-all.sh new file mode 100755 index 0000000000..762840f60b --- /dev/null +++ b/scripts/go-lint-all.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +set -euo pipefail # Bash "strict mode" +script_dirpath="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +root_dirpath="$(dirname "${script_dirpath}")" + +find $root_dirpath -type f -name 'go.mod' -exec sh -c 'dir=$(dirname "{}") && cd "$dir" && echo "$dir" && golangci-lint run' \; \ No newline at end of file From a89be52faca7d3dbd187f90f696b35a5d0378b03 Mon Sep 17 00:00:00 2001 From: lostbean Date: Wed, 6 Dec 2023 13:21:35 -0300 Subject: [PATCH 94/95] add script to tidy all go modules --- scripts/go-tidy-all.sh | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100755 scripts/go-tidy-all.sh diff --git a/scripts/go-tidy-all.sh b/scripts/go-tidy-all.sh new file mode 100755 index 0000000000..90d4e8eeea --- /dev/null +++ b/scripts/go-tidy-all.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +set -euo pipefail # Bash "strict mode" +script_dirpath="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +root_dirpath="$(dirname "${script_dirpath}")" + +find $root_dirpath -type f -name 'go.mod' -exec sh -c 'dir=$(dirname "{}") && cd "$dir" && echo "$dir" && go mod tidy' \; \ No newline at end of file From 4b7741e0fa80045043a2e7da3a8af6d892de4f56 Mon Sep 17 00:00:00 2001 From: lostbean Date: Wed, 6 Dec 2023 13:59:05 -0300 Subject: [PATCH 95/95] port number typo --- engine/server/engine/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/server/engine/main.go b/engine/server/engine/main.go index ef4f6f2147..0b2c0217dc 100644 --- a/engine/server/engine/main.go +++ b/engine/server/engine/main.go @@ -73,7 +73,7 @@ const ( shouldFlushMetricsClientQueueOnEachEvent = false - restAPIPortAddr uint16 = 977 //TODO: pass this parameter9 + restAPIPortAddr uint16 = 9779 //TODO: pass this parameter restAPIHostIP string = "0.0.0.0" streamerPoolSize = 1000