diff --git a/hack/bicep-types-radius/generated/applications/applications.core/2023-10-01-preview/types.json b/hack/bicep-types-radius/generated/applications/applications.core/2023-10-01-preview/types.json index f37147e0a3..84f91b4ef7 100644 --- a/hack/bicep-types-radius/generated/applications/applications.core/2023-10-01-preview/types.json +++ b/hack/bicep-types-radius/generated/applications/applications.core/2023-10-01-preview/types.json @@ -2379,6 +2379,33 @@ "$ref": "#/0" } }, + { + "$type": "ObjectType", + "name": "ExtenderListSecretResponse", + "properties": { + "password": { + "type": { + "$ref": "#/0" + }, + "flags": 2, + "description": "Password to use when connecting to the extender" + }, + "connectionString": { + "type": { + "$ref": "#/0" + }, + "flags": 2, + "description": "Connection string used to connect to the extender" + } + } + }, + { + "$type": "FunctionType", + "parameters": [], + "output": { + "$ref": "#/186" + } + }, { "$type": "ResourceType", "name": "Applications.Core/extenders@2023-10-01-preview", @@ -2387,7 +2414,14 @@ "$ref": "#/170" }, "flags": 0, - "functions": {} + "functions": { + "listSecrets": { + "type": { + "$ref": "#/187" + }, + "description": "listSecrets" + } + } }, { "$type": "StringLiteralType", @@ -2417,28 +2451,28 @@ }, "type": { "type": { - "$ref": "#/187" + "$ref": "#/189" }, "flags": 10, "description": "The resource type" }, "apiVersion": { "type": { - "$ref": "#/188" + "$ref": "#/190" }, "flags": 10, "description": "The resource api version" }, "properties": { "type": { - "$ref": "#/190" + "$ref": "#/192" }, "flags": 1, "description": "Gateway properties" }, "tags": { "type": { - "$ref": "#/207" + "$ref": "#/209" }, "flags": 0, "description": "Resource tags." @@ -2479,7 +2513,7 @@ }, "provisioningState": { "type": { - "$ref": "#/199" + "$ref": "#/201" }, "flags": 2, "description": "Provisioning state of the resource at the time the operation was called" @@ -2500,21 +2534,21 @@ }, "hostname": { "type": { - "$ref": "#/200" + "$ref": "#/202" }, "flags": 0, "description": "Declare hostname information for the Gateway. Leaving the hostname empty auto-assigns one: mygateway.myapp.PUBLICHOSTNAMEORIP.nip.io." }, "routes": { "type": { - "$ref": "#/202" + "$ref": "#/204" }, "flags": 1, "description": "Routes attached to this Gateway" }, "tls": { "type": { - "$ref": "#/203" + "$ref": "#/205" }, "flags": 0, "description": "TLS configuration definition for Gateway resource." @@ -2563,12 +2597,6 @@ { "$type": "UnionType", "elements": [ - { - "$ref": "#/191" - }, - { - "$ref": "#/192" - }, { "$ref": "#/193" }, @@ -2586,6 +2614,12 @@ }, { "$ref": "#/198" + }, + { + "$ref": "#/199" + }, + { + "$ref": "#/200" } ] }, @@ -2646,7 +2680,7 @@ { "$type": "ArrayType", "itemType": { - "$ref": "#/201" + "$ref": "#/203" } }, { @@ -2662,7 +2696,7 @@ }, "minimumProtocolVersion": { "type": { - "$ref": "#/206" + "$ref": "#/208" }, "flags": 0, "description": "TLS minimum protocol version (defaults to 1.2)." @@ -2688,10 +2722,10 @@ "$type": "UnionType", "elements": [ { - "$ref": "#/204" + "$ref": "#/206" }, { - "$ref": "#/205" + "$ref": "#/207" } ] }, @@ -2708,7 +2742,7 @@ "name": "Applications.Core/gateways@2023-10-01-preview", "scopeType": 0, "body": { - "$ref": "#/189" + "$ref": "#/191" }, "flags": 0, "functions": {} @@ -2741,28 +2775,28 @@ }, "type": { "type": { - "$ref": "#/209" + "$ref": "#/211" }, "flags": 10, "description": "The resource type" }, "apiVersion": { "type": { - "$ref": "#/210" + "$ref": "#/212" }, "flags": 10, "description": "The resource api version" }, "properties": { "type": { - "$ref": "#/212" + "$ref": "#/214" }, "flags": 1, "description": "The properties of SecretStore" }, "tags": { "type": { - "$ref": "#/234" + "$ref": "#/236" }, "flags": 0, "description": "Resource tags." @@ -2803,7 +2837,7 @@ }, "provisioningState": { "type": { - "$ref": "#/221" + "$ref": "#/223" }, "flags": 2, "description": "Provisioning state of the resource at the time the operation was called" @@ -2817,14 +2851,14 @@ }, "type": { "type": { - "$ref": "#/227" + "$ref": "#/229" }, "flags": 0, "description": "The type of SecretStore data" }, "data": { "type": { - "$ref": "#/233" + "$ref": "#/235" }, "flags": 1, "description": "An object to represent key-value type secrets" @@ -2873,12 +2907,6 @@ { "$type": "UnionType", "elements": [ - { - "$ref": "#/213" - }, - { - "$ref": "#/214" - }, { "$ref": "#/215" }, @@ -2896,6 +2924,12 @@ }, { "$ref": "#/220" + }, + { + "$ref": "#/221" + }, + { + "$ref": "#/222" } ] }, @@ -2923,19 +2957,19 @@ "$type": "UnionType", "elements": [ { - "$ref": "#/222" + "$ref": "#/224" }, { - "$ref": "#/223" + "$ref": "#/225" }, { - "$ref": "#/224" + "$ref": "#/226" }, { - "$ref": "#/225" + "$ref": "#/227" }, { - "$ref": "#/226" + "$ref": "#/228" } ] }, @@ -2945,7 +2979,7 @@ "properties": { "encoding": { "type": { - "$ref": "#/231" + "$ref": "#/233" }, "flags": 0, "description": "The type of SecretValue Encoding" @@ -2959,7 +2993,7 @@ }, "valueFrom": { "type": { - "$ref": "#/232" + "$ref": "#/234" }, "flags": 0, "description": "The Secret value source properties" @@ -2978,10 +3012,10 @@ "$type": "UnionType", "elements": [ { - "$ref": "#/229" + "$ref": "#/231" }, { - "$ref": "#/230" + "$ref": "#/232" } ] }, @@ -3010,7 +3044,7 @@ "name": "SecretStorePropertiesData", "properties": {}, "additionalProperties": { - "$ref": "#/228" + "$ref": "#/230" } }, { @@ -3027,14 +3061,14 @@ "properties": { "type": { "type": { - "$ref": "#/241" + "$ref": "#/243" }, "flags": 2, "description": "The type of SecretStore data" }, "data": { "type": { - "$ref": "#/242" + "$ref": "#/244" }, "flags": 2, "description": "An object to represent key-value type secrets" @@ -3065,19 +3099,19 @@ "$type": "UnionType", "elements": [ { - "$ref": "#/236" + "$ref": "#/238" }, { - "$ref": "#/237" + "$ref": "#/239" }, { - "$ref": "#/238" + "$ref": "#/240" }, { - "$ref": "#/239" + "$ref": "#/241" }, { - "$ref": "#/240" + "$ref": "#/242" } ] }, @@ -3086,14 +3120,14 @@ "name": "SecretStoreListSecretsResultData", "properties": {}, "additionalProperties": { - "$ref": "#/228" + "$ref": "#/230" } }, { "$type": "FunctionType", "parameters": [], "output": { - "$ref": "#/235" + "$ref": "#/237" } }, { @@ -3101,13 +3135,13 @@ "name": "Applications.Core/secretStores@2023-10-01-preview", "scopeType": 0, "body": { - "$ref": "#/211" + "$ref": "#/213" }, "flags": 0, "functions": { "listSecrets": { "type": { - "$ref": "#/243" + "$ref": "#/245" }, "description": "listSecrets" } @@ -3141,28 +3175,28 @@ }, "type": { "type": { - "$ref": "#/245" + "$ref": "#/247" }, "flags": 10, "description": "The resource type" }, "apiVersion": { "type": { - "$ref": "#/246" + "$ref": "#/248" }, "flags": 10, "description": "The resource api version" }, "properties": { "type": { - "$ref": "#/248" + "$ref": "#/250" }, "flags": 1, "description": "Volume properties" }, "tags": { "type": { - "$ref": "#/281" + "$ref": "#/283" }, "flags": 0, "description": "Resource tags." @@ -3204,7 +3238,7 @@ }, "provisioningState": { "type": { - "$ref": "#/257" + "$ref": "#/259" }, "flags": 2, "description": "Provisioning state of the resource at the time the operation was called" @@ -3219,7 +3253,7 @@ }, "elements": { "azure.com.keyvault": { - "$ref": "#/258" + "$ref": "#/260" } } }, @@ -3258,12 +3292,6 @@ { "$type": "UnionType", "elements": [ - { - "$ref": "#/249" - }, - { - "$ref": "#/250" - }, { "$ref": "#/251" }, @@ -3281,6 +3309,12 @@ }, { "$ref": "#/256" + }, + { + "$ref": "#/257" + }, + { + "$ref": "#/258" } ] }, @@ -3290,14 +3324,14 @@ "properties": { "certificates": { "type": { - "$ref": "#/271" + "$ref": "#/273" }, "flags": 0, "description": "The KeyVault certificates that this volume exposes" }, "keys": { "type": { - "$ref": "#/273" + "$ref": "#/275" }, "flags": 0, "description": "The KeyVault keys that this volume exposes" @@ -3311,14 +3345,14 @@ }, "secrets": { "type": { - "$ref": "#/279" + "$ref": "#/281" }, "flags": 0, "description": "The KeyVault secrets that this volume exposes" }, "kind": { "type": { - "$ref": "#/280" + "$ref": "#/282" }, "flags": 1, "description": "Discriminator property for VolumeProperties." @@ -3338,14 +3372,14 @@ }, "encoding": { "type": { - "$ref": "#/263" + "$ref": "#/265" }, "flags": 0, "description": "Encoding format. Default utf-8" }, "format": { "type": { - "$ref": "#/266" + "$ref": "#/268" }, "flags": 0, "description": "Represents certificate formats" @@ -3359,7 +3393,7 @@ }, "certType": { "type": { - "$ref": "#/270" + "$ref": "#/272" }, "flags": 0, "description": "Represents certificate types" @@ -3389,13 +3423,13 @@ "$type": "UnionType", "elements": [ { - "$ref": "#/260" + "$ref": "#/262" }, { - "$ref": "#/261" + "$ref": "#/263" }, { - "$ref": "#/262" + "$ref": "#/264" } ] }, @@ -3411,10 +3445,10 @@ "$type": "UnionType", "elements": [ { - "$ref": "#/264" + "$ref": "#/266" }, { - "$ref": "#/265" + "$ref": "#/267" } ] }, @@ -3434,13 +3468,13 @@ "$type": "UnionType", "elements": [ { - "$ref": "#/267" + "$ref": "#/269" }, { - "$ref": "#/268" + "$ref": "#/270" }, { - "$ref": "#/269" + "$ref": "#/271" } ] }, @@ -3449,7 +3483,7 @@ "name": "AzureKeyVaultVolumePropertiesCertificates", "properties": {}, "additionalProperties": { - "$ref": "#/259" + "$ref": "#/261" } }, { @@ -3484,7 +3518,7 @@ "name": "AzureKeyVaultVolumePropertiesKeys", "properties": {}, "additionalProperties": { - "$ref": "#/272" + "$ref": "#/274" } }, { @@ -3500,7 +3534,7 @@ }, "encoding": { "type": { - "$ref": "#/278" + "$ref": "#/280" }, "flags": 0, "description": "Encoding format. Default utf-8" @@ -3537,13 +3571,13 @@ "$type": "UnionType", "elements": [ { - "$ref": "#/275" + "$ref": "#/277" }, { - "$ref": "#/276" + "$ref": "#/278" }, { - "$ref": "#/277" + "$ref": "#/279" } ] }, @@ -3552,7 +3586,7 @@ "name": "AzureKeyVaultVolumePropertiesSecrets", "properties": {}, "additionalProperties": { - "$ref": "#/274" + "$ref": "#/276" } }, { @@ -3572,7 +3606,7 @@ "name": "Applications.Core/volumes@2023-10-01-preview", "scopeType": 0, "body": { - "$ref": "#/247" + "$ref": "#/249" }, "flags": 0, "functions": {} diff --git a/hack/bicep-types-radius/generated/index.json b/hack/bicep-types-radius/generated/index.json index 3f969f5438..68a264cd11 100644 --- a/hack/bicep-types-radius/generated/index.json +++ b/hack/bicep-types-radius/generated/index.json @@ -10,16 +10,16 @@ "$ref": "applications/applications.core/2023-10-01-preview/types.json#/167" }, "Applications.Core/extenders@2023-10-01-preview": { - "$ref": "applications/applications.core/2023-10-01-preview/types.json#/186" + "$ref": "applications/applications.core/2023-10-01-preview/types.json#/188" }, "Applications.Core/gateways@2023-10-01-preview": { - "$ref": "applications/applications.core/2023-10-01-preview/types.json#/208" + "$ref": "applications/applications.core/2023-10-01-preview/types.json#/210" }, "Applications.Core/secretStores@2023-10-01-preview": { - "$ref": "applications/applications.core/2023-10-01-preview/types.json#/244" + "$ref": "applications/applications.core/2023-10-01-preview/types.json#/246" }, "Applications.Core/volumes@2023-10-01-preview": { - "$ref": "applications/applications.core/2023-10-01-preview/types.json#/282" + "$ref": "applications/applications.core/2023-10-01-preview/types.json#/284" }, "Applications.Dapr/configurationStores@2023-10-01-preview": { "$ref": "applications/applications.dapr/2023-10-01-preview/types.json#/49" diff --git a/pkg/corerp/api/v20231001preview/zz_generated_extenders_client.go b/pkg/corerp/api/v20231001preview/zz_generated_extenders_client.go index 563a5589bd..a74039244f 100644 --- a/pkg/corerp/api/v20231001preview/zz_generated_extenders_client.go +++ b/pkg/corerp/api/v20231001preview/zz_generated_extenders_client.go @@ -301,7 +301,8 @@ func (client *ExtendersClient) ListSecrets(ctx context.Context, extenderName str err = runtime.NewResponseError(httpResp) return ExtendersClientListSecretsResponse{}, err } - return ExtendersClientListSecretsResponse{}, nil + resp, err := client.listSecretsHandleResponse(httpResp) + return resp, err } // listSecretsCreateRequest creates the ListSecrets request. @@ -326,6 +327,15 @@ func (client *ExtendersClient) listSecretsCreateRequest(ctx context.Context, ext return req, nil } +// listSecretsHandleResponse handles the ListSecrets response. +func (client *ExtendersClient) listSecretsHandleResponse(resp *http.Response) (ExtendersClientListSecretsResponse, error) { + result := ExtendersClientListSecretsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ExtenderListSecretResponse); err != nil { + return ExtendersClientListSecretsResponse{}, err + } + return result, nil +} + // BeginUpdate - Update a ExtenderResource // If the operation fails it returns an *azcore.ResponseError type. // diff --git a/pkg/corerp/api/v20231001preview/zz_generated_models.go b/pkg/corerp/api/v20231001preview/zz_generated_models.go index 00a1ad5695..79066c36be 100644 --- a/pkg/corerp/api/v20231001preview/zz_generated_models.go +++ b/pkg/corerp/api/v20231001preview/zz_generated_models.go @@ -612,6 +612,15 @@ func (e *ExecHealthProbeProperties) GetHealthProbeProperties() *HealthProbePrope } } +// ExtenderListSecretResponse - Response for list secrets API call +type ExtenderListSecretResponse struct { + // Connection string used to connect to the extender + ConnectionString *string + + // Password to use when connecting to the extender + Password *string +} + // ExtenderProperties - ExtenderResource portable resource properties type ExtenderProperties struct { // REQUIRED; Fully qualified resource ID for the environment that the portable resource is linked to @@ -690,6 +699,15 @@ type ExtenderResourceUpdate struct { Type *string } +// ExtenderSecret - The secret values for the given Extender resource +type ExtenderSecret struct { + // Connection string used to connect to the extender + ConnectionString *string + + // Password to use when connecting to the extender + Password *string +} + // Extension of a environment/application resource. type Extension struct { // REQUIRED; Discriminator property for Extension. diff --git a/pkg/corerp/api/v20231001preview/zz_generated_models_serde.go b/pkg/corerp/api/v20231001preview/zz_generated_models_serde.go index d02daf69d5..a6e67c3173 100644 --- a/pkg/corerp/api/v20231001preview/zz_generated_models_serde.go +++ b/pkg/corerp/api/v20231001preview/zz_generated_models_serde.go @@ -1399,6 +1399,37 @@ func (e *ExecHealthProbeProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ExtenderListSecretResponse. +func (e ExtenderListSecretResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "connectionString", e.ConnectionString) + populate(objectMap, "password", e.Password) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExtenderListSecretResponse. +func (e *ExtenderListSecretResponse) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "connectionString": + err = unpopulate(val, "ConnectionString", &e.ConnectionString) + delete(rawMsg, key) + case "password": + err = unpopulate(val, "Password", &e.Password) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ExtenderProperties. func (e ExtenderProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1590,6 +1621,37 @@ func (e *ExtenderResourceUpdate) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ExtenderSecret. +func (e ExtenderSecret) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "connectionString", e.ConnectionString) + populate(objectMap, "password", e.Password) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExtenderSecret. +func (e *ExtenderSecret) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "connectionString": + err = unpopulate(val, "ConnectionString", &e.ConnectionString) + delete(rawMsg, key) + case "password": + err = unpopulate(val, "Password", &e.Password) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type Extension. func (e Extension) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) diff --git a/pkg/corerp/api/v20231001preview/zz_generated_response_types.go b/pkg/corerp/api/v20231001preview/zz_generated_response_types.go index 731bc64919..4b2dd28359 100644 --- a/pkg/corerp/api/v20231001preview/zz_generated_response_types.go +++ b/pkg/corerp/api/v20231001preview/zz_generated_response_types.go @@ -131,7 +131,8 @@ type ExtendersClientListByScopeResponse struct { // ExtendersClientListSecretsResponse contains the response from method ExtendersClient.ListSecrets. type ExtendersClientListSecretsResponse struct { - // placeholder for future response values + // Response for list secrets API call + ExtenderListSecretResponse } // ExtendersClientUpdateResponse contains the response from method ExtendersClient.BeginUpdate. diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/openapi.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/openapi.json index d2a410e00e..741c1506ae 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/openapi.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/openapi.json @@ -1260,7 +1260,10 @@ ], "responses": { "200": { - "description": "Azure operation completed successfully." + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/ExtenderListSecretResponse" + } }, "default": { "description": "An unexpected error response.", @@ -3191,7 +3194,17 @@ }, "ExtenderListSecretResponse": { "type": "object", - "description": "Response for list secrets API call" + "description": "Response for list secrets API call", + "properties": { + "password": { + "type": "string", + "description": "Password to use when connecting to the extender" + }, + "connectionString": { + "type": "string", + "description": "Connection string used to connect to the extender" + } + } }, "ExtenderProperties": { "type": "object", @@ -3291,6 +3304,20 @@ } ] }, + "ExtenderSecret": { + "type": "object", + "description": "The secret values for the given Extender resource", + "properties": { + "password": { + "type": "string", + "description": "Password to use when connecting to the extender" + }, + "connectionString": { + "type": "string", + "description": "Connection string used to connect to the extender" + } + } + }, "Extension": { "type": "object", "description": "Extension of a environment/application resource.", diff --git a/typespec/Applications.Core/extenders.tsp b/typespec/Applications.Core/extenders.tsp index dae6687ac5..5f3a9a961b 100644 --- a/typespec/Applications.Core/extenders.tsp +++ b/typespec/Applications.Core/extenders.tsp @@ -37,7 +37,16 @@ using OpenAPI; namespace Applications.Core; @doc("Response for list secrets API call") -model ExtenderListSecretResponse {} +model ExtenderListSecretResponse is ExtenderSecret; + +@doc("The secret values for the given Extender resource") +model ExtenderSecret { + @doc("Password to use when connecting to the extender") + password?: string; + + @doc("Connection string used to connect to the extender") + connectionString?: string; +} @doc("ExtenderResource portable resource") model ExtenderResource