diff --git a/pkg/ucp/api/v20231001preview/zz_generated_constants.go b/pkg/ucp/api/v20231001preview/zz_generated_constants.go index 3818bcaa71..a9dbbd3098 100644 --- a/pkg/ucp/api/v20231001preview/zz_generated_constants.go +++ b/pkg/ucp/api/v20231001preview/zz_generated_constants.go @@ -18,12 +18,15 @@ type AWSCredentialKind string const ( // AWSCredentialKindAccessKey - The AWS Access Key credential AWSCredentialKindAccessKey AWSCredentialKind = "AccessKey" + // AWSCredentialKindIRSA - AWS IAM roles for service accounts. For more information, please see: https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html + AWSCredentialKindIRSA AWSCredentialKind = "IRSA" ) // PossibleAWSCredentialKindValues returns the possible values for the AWSCredentialKind const type. func PossibleAWSCredentialKindValues() []AWSCredentialKind { return []AWSCredentialKind{ AWSCredentialKindAccessKey, + AWSCredentialKindIRSA, } } diff --git a/pkg/ucp/api/v20231001preview/zz_generated_interfaces.go b/pkg/ucp/api/v20231001preview/zz_generated_interfaces.go index 72b5581ffd..3ace1ee706 100644 --- a/pkg/ucp/api/v20231001preview/zz_generated_interfaces.go +++ b/pkg/ucp/api/v20231001preview/zz_generated_interfaces.go @@ -10,7 +10,7 @@ package v20231001preview // AwsCredentialPropertiesClassification provides polymorphic access to related types. // Call the interface's GetAwsCredentialProperties() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: -// - *AwsAccessKeyCredentialProperties, *AwsCredentialProperties +// - *AwsAccessKeyCredentialProperties, *AwsCredentialProperties, *AwsIRSACredentialProperties type AwsCredentialPropertiesClassification interface { // GetAwsCredentialProperties returns the AwsCredentialProperties content of the underlying type. GetAwsCredentialProperties() *AwsCredentialProperties diff --git a/pkg/ucp/api/v20231001preview/zz_generated_models.go b/pkg/ucp/api/v20231001preview/zz_generated_models.go index 9a57b377e7..3cfd9ec0d9 100644 --- a/pkg/ucp/api/v20231001preview/zz_generated_models.go +++ b/pkg/ucp/api/v20231001preview/zz_generated_models.go @@ -9,7 +9,7 @@ package v20231001preview import "time" -// AwsAccessKeyCredentialProperties - AWS credential storage properties +// AwsAccessKeyCredentialProperties - AWS credential properties for Access Key type AwsAccessKeyCredentialProperties struct { // REQUIRED; Access key ID for AWS identity AccessKeyID *string @@ -87,6 +87,29 @@ type AwsCredentialResourceTagsUpdate struct { Tags map[string]*string } +// AwsIRSACredentialProperties - AWS credential properties for IAM Roles for Service Accounts (IRSA) +type AwsIRSACredentialProperties struct { + // REQUIRED; The AWS credential kind + Kind *AWSCredentialKind + + // REQUIRED; RoleARN for AWS IRSA identity + RoleARN *string + + // REQUIRED; The storage properties + Storage CredentialStoragePropertiesClassification + + // READ-ONLY; The status of the asynchronous operation. + ProvisioningState *ProvisioningState +} + +// GetAwsCredentialProperties implements the AwsCredentialPropertiesClassification interface for type AwsIRSACredentialProperties. +func (a *AwsIRSACredentialProperties) GetAwsCredentialProperties() *AwsCredentialProperties { + return &AwsCredentialProperties{ + Kind: a.Kind, + ProvisioningState: a.ProvisioningState, + } +} + // AwsPlaneResource - The AWS plane resource type AwsPlaneResource struct { // REQUIRED; The geo-location where the resource lives diff --git a/pkg/ucp/api/v20231001preview/zz_generated_models_serde.go b/pkg/ucp/api/v20231001preview/zz_generated_models_serde.go index 28932179ca..32d327b2ea 100644 --- a/pkg/ucp/api/v20231001preview/zz_generated_models_serde.go +++ b/pkg/ucp/api/v20231001preview/zz_generated_models_serde.go @@ -197,6 +197,45 @@ func (a *AwsCredentialResourceTagsUpdate) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type AwsIRSACredentialProperties. +func (a AwsIRSACredentialProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["kind"] = AWSCredentialKindIRSA + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "roleARN", a.RoleARN) + populate(objectMap, "storage", a.Storage) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AwsIRSACredentialProperties. +func (a *AwsIRSACredentialProperties) 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", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "kind": + err = unpopulate(val, "Kind", &a.Kind) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + case "roleARN": + err = unpopulate(val, "RoleARN", &a.RoleARN) + delete(rawMsg, key) + case "storage": + a.Storage, err = unmarshalCredentialStoragePropertiesClassification(val) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type AwsPlaneResource. func (a AwsPlaneResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) diff --git a/pkg/ucp/api/v20231001preview/zz_generated_polymorphic_helpers.go b/pkg/ucp/api/v20231001preview/zz_generated_polymorphic_helpers.go index 4b05fb540c..062b4f23b6 100644 --- a/pkg/ucp/api/v20231001preview/zz_generated_polymorphic_helpers.go +++ b/pkg/ucp/api/v20231001preview/zz_generated_polymorphic_helpers.go @@ -21,6 +21,8 @@ func unmarshalAwsCredentialPropertiesClassification(rawMsg json.RawMessage) (Aws switch m["kind"] { case string(AWSCredentialKindAccessKey): b = &AwsAccessKeyCredentialProperties{} + case string(AWSCredentialKindIRSA): + b = &AwsIRSACredentialProperties{} default: b = &AwsCredentialProperties{} } diff --git a/typespec/UCP/examples/2023-10-01-preview/AWSCredential_CreateOrUpdate.json b/swagger/specification/ucp/resource-manager/UCP/preview/2023-10-01-preview/examples/AWSCredential_AccessKey_CreateOrUpdate.json similarity index 96% rename from typespec/UCP/examples/2023-10-01-preview/AWSCredential_CreateOrUpdate.json rename to swagger/specification/ucp/resource-manager/UCP/preview/2023-10-01-preview/examples/AWSCredential_AccessKey_CreateOrUpdate.json index cfa9d28cfa..9b13d6016a 100644 --- a/typespec/UCP/examples/2023-10-01-preview/AWSCredential_CreateOrUpdate.json +++ b/swagger/specification/ucp/resource-manager/UCP/preview/2023-10-01-preview/examples/AWSCredential_AccessKey_CreateOrUpdate.json @@ -1,6 +1,6 @@ { "operationId": "AwsCredentials_CreateOrUpdate", - "title": "Create or update an AWS credential", + "title": "Create or update an AWS AccessKey credential", "parameters": { "api-version": "2023-10-01-preview", "planeType": "aws", diff --git a/swagger/specification/ucp/resource-manager/UCP/preview/2023-10-01-preview/examples/AWSCredential_AccessKey_Delete.json b/swagger/specification/ucp/resource-manager/UCP/preview/2023-10-01-preview/examples/AWSCredential_AccessKey_Delete.json new file mode 100644 index 0000000000..c0e5bdb067 --- /dev/null +++ b/swagger/specification/ucp/resource-manager/UCP/preview/2023-10-01-preview/examples/AWSCredential_AccessKey_Delete.json @@ -0,0 +1,14 @@ +{ + "operationId": "AwsCredentials_Delete", + "title": "Delete an AWS AccessKey credential", + "parameters": { + "api-version": "2023-10-01-preview", + "planeType": "aws", + "planeName": "awscloud", + "credentialName": "default" + }, + "responses": { + "200": {}, + "204": {} + } +} \ No newline at end of file diff --git a/typespec/UCP/examples/2023-10-01-preview/AWSCredential_Get.json b/swagger/specification/ucp/resource-manager/UCP/preview/2023-10-01-preview/examples/AWSCredential_AccessKey_Get.json similarity index 94% rename from typespec/UCP/examples/2023-10-01-preview/AWSCredential_Get.json rename to swagger/specification/ucp/resource-manager/UCP/preview/2023-10-01-preview/examples/AWSCredential_AccessKey_Get.json index e22222c8ce..91d728e6f1 100644 --- a/typespec/UCP/examples/2023-10-01-preview/AWSCredential_Get.json +++ b/swagger/specification/ucp/resource-manager/UCP/preview/2023-10-01-preview/examples/AWSCredential_AccessKey_Get.json @@ -1,6 +1,6 @@ { "operationId": "AwsCredentials_Get", - "title": "Get an AWS credential", + "title": "Get an AWS AccessKey credential", "parameters": { "api-version": "2023-10-01-preview", "planeType": "aws", diff --git a/typespec/UCP/examples/2023-10-01-preview/AWSCredential_List.json b/swagger/specification/ucp/resource-manager/UCP/preview/2023-10-01-preview/examples/AWSCredential_AccessKey_List.json similarity index 95% rename from typespec/UCP/examples/2023-10-01-preview/AWSCredential_List.json rename to swagger/specification/ucp/resource-manager/UCP/preview/2023-10-01-preview/examples/AWSCredential_AccessKey_List.json index bd11cb7df2..e89535b7fa 100644 --- a/typespec/UCP/examples/2023-10-01-preview/AWSCredential_List.json +++ b/swagger/specification/ucp/resource-manager/UCP/preview/2023-10-01-preview/examples/AWSCredential_AccessKey_List.json @@ -1,6 +1,6 @@ { "operationId": "AwsCredentials_List", - "title": "List AWS credentials", + "title": "List AWS AccessKey credential", "parameters": { "api-version": "2023-10-01-preview", "planeType": "aws", diff --git a/typespec/UCP/examples/2023-10-01-preview/AWSCredential_Update.json b/swagger/specification/ucp/resource-manager/UCP/preview/2023-10-01-preview/examples/AWSCredential_AccessKey_Update.json similarity index 96% rename from typespec/UCP/examples/2023-10-01-preview/AWSCredential_Update.json rename to swagger/specification/ucp/resource-manager/UCP/preview/2023-10-01-preview/examples/AWSCredential_AccessKey_Update.json index f636c77d2f..37a1cb337e 100644 --- a/typespec/UCP/examples/2023-10-01-preview/AWSCredential_Update.json +++ b/swagger/specification/ucp/resource-manager/UCP/preview/2023-10-01-preview/examples/AWSCredential_AccessKey_Update.json @@ -1,6 +1,6 @@ { "operationId": "AwsCredentials_Update", - "title": "Update an AWS credential", + "title": "Update an AWS AccessKey credential", "parameters": { "api-version": "2023-10-01-preview", "planeType": "aws", diff --git a/swagger/specification/ucp/resource-manager/UCP/preview/2023-10-01-preview/examples/AWSCredential_IRSA_CreateOrUpdate.json b/swagger/specification/ucp/resource-manager/UCP/preview/2023-10-01-preview/examples/AWSCredential_IRSA_CreateOrUpdate.json new file mode 100644 index 0000000000..f59f7e6f14 --- /dev/null +++ b/swagger/specification/ucp/resource-manager/UCP/preview/2023-10-01-preview/examples/AWSCredential_IRSA_CreateOrUpdate.json @@ -0,0 +1,54 @@ +{ + "operationId": "AwsCredentials_CreateOrUpdate", + "title": "Create or update an AWS IRSA credential", + "parameters": { + "api-version": "2023-10-01-preview", + "planeType": "aws", + "planeName": "aws", + "credentialName": "default", + "Credential": { + "location": "us-west-2", + "properties": { + "kind": "IRSA", + "roleARN": "enterRoleARN", + "storage": { + "kind": "Internal" + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/AWS/aws/providers/System.AWS/credentials/default", + "name": "default", + "type": "System.AWS/credentials", + "location": "us-west-2", + "properties": { + "kind": "IRSA", + "roleARN": "enterRoleARN", + "storage": { + "kind": "Internal", + "secretName": "aws-awscloud-default" + } + } + } + }, + "201": { + "body": { + "id": "/planes/AWS/aws/providers/System.AWS/credentials/default", + "name": "default", + "type": "System.AWS/credentials", + "location": "us-west-2", + "properties": { + "kind": "IRSA", + "roleARN": "enterRoleARN", + "storage": { + "kind": "Internal", + "secretName": "aws-awscloud-default" + } + } + } + } + } +} \ No newline at end of file diff --git a/typespec/UCP/examples/2023-10-01-preview/AWSCredential_Delete.json b/swagger/specification/ucp/resource-manager/UCP/preview/2023-10-01-preview/examples/AWSCredential_IRSA_Delete.json similarity index 85% rename from typespec/UCP/examples/2023-10-01-preview/AWSCredential_Delete.json rename to swagger/specification/ucp/resource-manager/UCP/preview/2023-10-01-preview/examples/AWSCredential_IRSA_Delete.json index 129dbbc139..ceda0d303b 100644 --- a/typespec/UCP/examples/2023-10-01-preview/AWSCredential_Delete.json +++ b/swagger/specification/ucp/resource-manager/UCP/preview/2023-10-01-preview/examples/AWSCredential_IRSA_Delete.json @@ -1,6 +1,6 @@ { "operationId": "AwsCredentials_Delete", - "title": "Delete an AWS credential", + "title": "Delete an AWS IRSA credential", "parameters": { "api-version": "2023-10-01-preview", "planeType": "aws", diff --git a/swagger/specification/ucp/resource-manager/UCP/preview/2023-10-01-preview/examples/AWSCredential_IRSA_Get.json b/swagger/specification/ucp/resource-manager/UCP/preview/2023-10-01-preview/examples/AWSCredential_IRSA_Get.json new file mode 100644 index 0000000000..adf56c6949 --- /dev/null +++ b/swagger/specification/ucp/resource-manager/UCP/preview/2023-10-01-preview/examples/AWSCredential_IRSA_Get.json @@ -0,0 +1,28 @@ +{ + "operationId": "AwsCredentials_Get", + "title": "Get an AWS IRSA credential", + "parameters": { + "api-version": "2023-10-01-preview", + "planeType": "aws", + "planeName": "awscloud", + "credentialName": "default" + }, + "responses": { + "200": { + "body": { + "id": "/planes/AWS/aws/providers/System.AWS/credentials/default", + "name": "default", + "type": "System.AWS/credentials", + "location": "us-west-2", + "properties": { + "kind": "IRSA", + "roleArn": "enterRoleARN", + "storage": { + "kind": "Internal", + "secretName": "aws-awscloud-default" + } + } + } + } + } +} \ No newline at end of file diff --git a/swagger/specification/ucp/resource-manager/UCP/preview/2023-10-01-preview/examples/AWSCredential_IRSA_List.json b/swagger/specification/ucp/resource-manager/UCP/preview/2023-10-01-preview/examples/AWSCredential_IRSA_List.json new file mode 100644 index 0000000000..da727860c8 --- /dev/null +++ b/swagger/specification/ucp/resource-manager/UCP/preview/2023-10-01-preview/examples/AWSCredential_IRSA_List.json @@ -0,0 +1,31 @@ +{ + "operationId": "AwsCredentials_List", + "title": "List AWS IRSA credentials", + "parameters": { + "api-version": "2023-10-01-preview", + "planeType": "aws", + "planeName": "awscloud" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/AWS/aws/providers/System.AWS/credentials/default", + "name": "default", + "type": "System.AWS/credentials", + "location": "us-west-2", + "properties": { + "kind": "IRSA", + "roleArn": "enterRoleARN", + "storage": { + "kind": "Internal", + "secretName": "aws-awscloud-default" + } + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/swagger/specification/ucp/resource-manager/UCP/preview/2023-10-01-preview/examples/AWSCredential_IRSA_Update.json b/swagger/specification/ucp/resource-manager/UCP/preview/2023-10-01-preview/examples/AWSCredential_IRSA_Update.json new file mode 100644 index 0000000000..be972e445f --- /dev/null +++ b/swagger/specification/ucp/resource-manager/UCP/preview/2023-10-01-preview/examples/AWSCredential_IRSA_Update.json @@ -0,0 +1,54 @@ +{ + "operationId": "AwsCredentials_Update", + "title": "Update an AWS IRSA credential", + "parameters": { + "api-version": "2023-10-01-preview", + "planeType": "aws", + "planeName": "aws", + "credentialName": "default", + "Credential": { + "location": "us-west-2", + "properties": { + "kind": "IRSA", + "roleArn": "enterRoleARN", + "storage": { + "kind": "Internal" + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/AWS/aws/providers/System.AWS/credentials/default", + "name": "default", + "type": "System.AWS/credentials", + "location": "us-west-2", + "properties": { + "kind": "IRSA", + "roleArn": "enterRoleARN", + "storage": { + "kind": "Internal", + "secretName": "aws-awscloud-default" + } + } + } + }, + "201": { + "body": { + "id": "/planes/AWS/aws/providers/System.AWS/credentials/default", + "name": "default", + "type": "System.AWS/credentials", + "location": "us-west-2", + "properties": { + "kind": "AccessKey", + "roleArn": "enterRoleARN", + "storage": { + "kind": "Internal", + "secretName": "aws-awscloud-default" + } + } + } + } + } +} \ No newline at end of file diff --git a/swagger/specification/ucp/resource-manager/UCP/preview/2023-10-01-preview/openapi.json b/swagger/specification/ucp/resource-manager/UCP/preview/2023-10-01-preview/openapi.json index 7dca6e2eb9..2ab5e4d7b0 100644 --- a/swagger/specification/ucp/resource-manager/UCP/preview/2023-10-01-preview/openapi.json +++ b/swagger/specification/ucp/resource-manager/UCP/preview/2023-10-01-preview/openapi.json @@ -375,8 +375,11 @@ } }, "x-ms-examples": { - "List AWS credentials": { - "$ref": "./examples/AWSCredential_List.json" + "List AWS AccessKey credential": { + "$ref": "./examples/AWSCredential_AccessKey_List.json" + }, + "List AWS IRSA credentials": { + "$ref": "./examples/AWSCredential_IRSA_List.json" } }, "x-ms-pageable": { @@ -423,8 +426,11 @@ } }, "x-ms-examples": { - "Get an AWS credential": { - "$ref": "./examples/AWSCredential_Get.json" + "Get an AWS AccessKey credential": { + "$ref": "./examples/AWSCredential_AccessKey_Get.json" + }, + "Get an AWS IRSA credential": { + "$ref": "./examples/AWSCredential_IRSA_Get.json" } } }, @@ -481,8 +487,11 @@ } }, "x-ms-examples": { - "Create or update an AWS credential": { - "$ref": "./examples/AWSCredential_CreateOrUpdate.json" + "Create or update an AWS AccessKey credential": { + "$ref": "./examples/AWSCredential_AccessKey_CreateOrUpdate.json" + }, + "Create or update an AWS IRSA credential": { + "$ref": "./examples/AWSCredential_IRSA_CreateOrUpdate.json" } } }, @@ -533,8 +542,11 @@ } }, "x-ms-examples": { - "Update an AWS credential": { - "$ref": "./examples/AWSCredential_Update.json" + "Update an AWS AccessKey credential": { + "$ref": "./examples/AWSCredential_AccessKey_Update.json" + }, + "Update an AWS IRSA credential": { + "$ref": "./examples/AWSCredential_IRSA_Update.json" } } }, @@ -576,8 +588,11 @@ } }, "x-ms-examples": { - "Delete an AWS credential": { - "$ref": "./examples/AWSCredential_Delete.json" + "Delete an AWS AccessKey credential": { + "$ref": "./examples/AWSCredential_AccessKey_Delete.json" + }, + "Delete an AWS IRSA credential": { + "$ref": "./examples/AWSCredential_IRSA_Delete.json" } } } @@ -1649,7 +1664,8 @@ "type": "string", "description": "AWS credential kind", "enum": [ - "AccessKey" + "AccessKey", + "IRSA" ], "x-ms-enum": { "name": "AWSCredentialKind", @@ -1659,13 +1675,18 @@ "name": "AccessKey", "value": "AccessKey", "description": "The AWS Access Key credential" + }, + { + "name": "IRSA", + "value": "IRSA", + "description": "AWS IAM roles for service accounts. For more information, please see: https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html" } ] } }, "AwsAccessKeyCredentialProperties": { "type": "object", - "description": "AWS credential storage properties", + "description": "AWS credential properties for Access Key", "properties": { "accessKeyId": { "type": "string", @@ -1772,6 +1793,30 @@ } } }, + "AwsIRSACredentialProperties": { + "type": "object", + "description": "AWS credential properties for IAM Roles for Service Accounts (IRSA)", + "properties": { + "roleARN": { + "type": "string", + "description": "RoleARN for AWS IRSA identity" + }, + "storage": { + "$ref": "#/definitions/CredentialStorageProperties", + "description": "The storage properties" + } + }, + "required": [ + "roleARN", + "storage" + ], + "allOf": [ + { + "$ref": "#/definitions/AwsCredentialProperties" + } + ], + "x-ms-discriminator-value": "IRSA" + }, "AwsPlaneResource": { "type": "object", "description": "The AWS plane resource", diff --git a/typespec/UCP/aws-credentials.tsp b/typespec/UCP/aws-credentials.tsp index 3ee8ea359b..7f4d68ab1f 100644 --- a/typespec/UCP/aws-credentials.tsp +++ b/typespec/UCP/aws-credentials.tsp @@ -63,6 +63,9 @@ model AwsPlaneNameParameter { enum AWSCredentialKind { @doc("The AWS Access Key credential") AccessKey, + + @doc("AWS IAM roles for service accounts. For more information, please see: https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html") + IRSA, } @discriminator("kind") @@ -76,7 +79,7 @@ model AwsCredentialProperties { provisioningState?: ProvisioningState; } -@doc("AWS credential storage properties") +@doc("AWS credential properties for Access Key") model AwsAccessKeyCredentialProperties extends AwsCredentialProperties { @doc("Access Key kind") kind: AWSCredentialKind.AccessKey; @@ -93,6 +96,18 @@ model AwsAccessKeyCredentialProperties extends AwsCredentialProperties { storage: CredentialStorageProperties; } +@doc("AWS credential properties for IAM Roles for Service Accounts (IRSA)") +model AwsIRSACredentialProperties extends AwsCredentialProperties { + @doc("IRSA credential kind") + kind: AWSCredentialKind.IRSA; + + @doc("RoleARN for AWS IRSA identity") + roleARN: string; + + @doc("The storage properties") + storage: CredentialStorageProperties; +} + alias AwsCredentialBaseParameter = CredentialBaseParameters< TResource, AwsPlaneNameParameter diff --git a/typespec/UCP/examples/2023-10-01-preview/AWSCredential_AccessKey_CreateOrUpdate.json b/typespec/UCP/examples/2023-10-01-preview/AWSCredential_AccessKey_CreateOrUpdate.json new file mode 100644 index 0000000000..9b13d6016a --- /dev/null +++ b/typespec/UCP/examples/2023-10-01-preview/AWSCredential_AccessKey_CreateOrUpdate.json @@ -0,0 +1,53 @@ +{ + "operationId": "AwsCredentials_CreateOrUpdate", + "title": "Create or update an AWS AccessKey credential", + "parameters": { + "api-version": "2023-10-01-preview", + "planeType": "aws", + "planeName": "aws", + "credentialName": "default", + "Credential": { + "location": "us-west-2", + "properties": { + "kind": "AccessKey", + "accessKeyId": "enterAccessKeyIdHere", + "secretAccessKey": "enterSecretAccessKey", + "storage": { + "kind": "Internal" + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/AWS/aws/providers/System.AWS/credentials/default", + "name": "default", + "type": "System.AWS/credentials", + "location": "us-west-2", + "properties": { + "kind": "AccessKey", + "storage": { + "kind": "Internal", + "secretName": "aws-awscloud-default" + } + } + } + }, + "201": { + "body": { + "id": "/planes/AWS/aws/providers/System.AWS/credentials/default", + "name": "default", + "type": "System.AWS/credentials", + "location": "us-west-2", + "properties": { + "kind": "AccessKey", + "storage": { + "kind": "Internal", + "secretName": "aws-awscloud-default" + } + } + } + } + } +} \ No newline at end of file diff --git a/typespec/UCP/examples/2023-10-01-preview/AWSCredential_AccessKey_Delete.json b/typespec/UCP/examples/2023-10-01-preview/AWSCredential_AccessKey_Delete.json new file mode 100644 index 0000000000..c0e5bdb067 --- /dev/null +++ b/typespec/UCP/examples/2023-10-01-preview/AWSCredential_AccessKey_Delete.json @@ -0,0 +1,14 @@ +{ + "operationId": "AwsCredentials_Delete", + "title": "Delete an AWS AccessKey credential", + "parameters": { + "api-version": "2023-10-01-preview", + "planeType": "aws", + "planeName": "awscloud", + "credentialName": "default" + }, + "responses": { + "200": {}, + "204": {} + } +} \ No newline at end of file diff --git a/typespec/UCP/examples/2023-10-01-preview/AWSCredential_AccessKey_Get.json b/typespec/UCP/examples/2023-10-01-preview/AWSCredential_AccessKey_Get.json new file mode 100644 index 0000000000..91d728e6f1 --- /dev/null +++ b/typespec/UCP/examples/2023-10-01-preview/AWSCredential_AccessKey_Get.json @@ -0,0 +1,27 @@ +{ + "operationId": "AwsCredentials_Get", + "title": "Get an AWS AccessKey credential", + "parameters": { + "api-version": "2023-10-01-preview", + "planeType": "aws", + "planeName": "awscloud", + "credentialName": "default" + }, + "responses": { + "200": { + "body": { + "id": "/planes/AWS/aws/providers/System.AWS/credentials/default", + "name": "default", + "type": "System.AWS/credentials", + "location": "us-west-2", + "properties": { + "kind": "AccessKey", + "storage": { + "kind": "Internal", + "secretName": "aws-awscloud-default" + } + } + } + } + } +} \ No newline at end of file diff --git a/typespec/UCP/examples/2023-10-01-preview/AWSCredential_AccessKey_List.json b/typespec/UCP/examples/2023-10-01-preview/AWSCredential_AccessKey_List.json new file mode 100644 index 0000000000..e89535b7fa --- /dev/null +++ b/typespec/UCP/examples/2023-10-01-preview/AWSCredential_AccessKey_List.json @@ -0,0 +1,30 @@ +{ + "operationId": "AwsCredentials_List", + "title": "List AWS AccessKey credential", + "parameters": { + "api-version": "2023-10-01-preview", + "planeType": "aws", + "planeName": "awscloud" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/AWS/aws/providers/System.AWS/credentials/default", + "name": "default", + "type": "System.AWS/credentials", + "location": "us-west-2", + "properties": { + "kind": "AccessKey", + "storage": { + "kind": "Internal", + "secretName": "aws-awscloud-default" + } + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/typespec/UCP/examples/2023-10-01-preview/AWSCredential_AccessKey_Update.json b/typespec/UCP/examples/2023-10-01-preview/AWSCredential_AccessKey_Update.json new file mode 100644 index 0000000000..37a1cb337e --- /dev/null +++ b/typespec/UCP/examples/2023-10-01-preview/AWSCredential_AccessKey_Update.json @@ -0,0 +1,53 @@ +{ + "operationId": "AwsCredentials_Update", + "title": "Update an AWS AccessKey credential", + "parameters": { + "api-version": "2023-10-01-preview", + "planeType": "aws", + "planeName": "aws", + "credentialName": "default", + "Credential": { + "location": "us-west-2", + "properties": { + "kind": "AccessKey", + "accessKeyId": "enterAccessKeyIdHere", + "secretAccessKey": "enterSecretAccessKey", + "storage": { + "kind": "Internal" + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/AWS/aws/providers/System.AWS/credentials/default", + "name": "default", + "type": "System.AWS/credentials", + "location": "us-west-2", + "properties": { + "kind": "AccessKey", + "storage": { + "kind": "Internal", + "secretName": "aws-awscloud-default" + } + } + } + }, + "201": { + "body": { + "id": "/planes/AWS/aws/providers/System.AWS/credentials/default", + "name": "default", + "type": "System.AWS/credentials", + "location": "us-west-2", + "properties": { + "kind": "AccessKey", + "storage": { + "kind": "Internal", + "secretName": "aws-awscloud-default" + } + } + } + } + } +} \ No newline at end of file diff --git a/typespec/UCP/examples/2023-10-01-preview/AWSCredential_IRSA_CreateOrUpdate.json b/typespec/UCP/examples/2023-10-01-preview/AWSCredential_IRSA_CreateOrUpdate.json new file mode 100644 index 0000000000..f59f7e6f14 --- /dev/null +++ b/typespec/UCP/examples/2023-10-01-preview/AWSCredential_IRSA_CreateOrUpdate.json @@ -0,0 +1,54 @@ +{ + "operationId": "AwsCredentials_CreateOrUpdate", + "title": "Create or update an AWS IRSA credential", + "parameters": { + "api-version": "2023-10-01-preview", + "planeType": "aws", + "planeName": "aws", + "credentialName": "default", + "Credential": { + "location": "us-west-2", + "properties": { + "kind": "IRSA", + "roleARN": "enterRoleARN", + "storage": { + "kind": "Internal" + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/AWS/aws/providers/System.AWS/credentials/default", + "name": "default", + "type": "System.AWS/credentials", + "location": "us-west-2", + "properties": { + "kind": "IRSA", + "roleARN": "enterRoleARN", + "storage": { + "kind": "Internal", + "secretName": "aws-awscloud-default" + } + } + } + }, + "201": { + "body": { + "id": "/planes/AWS/aws/providers/System.AWS/credentials/default", + "name": "default", + "type": "System.AWS/credentials", + "location": "us-west-2", + "properties": { + "kind": "IRSA", + "roleARN": "enterRoleARN", + "storage": { + "kind": "Internal", + "secretName": "aws-awscloud-default" + } + } + } + } + } +} \ No newline at end of file diff --git a/typespec/UCP/examples/2023-10-01-preview/AWSCredential_IRSA_Delete.json b/typespec/UCP/examples/2023-10-01-preview/AWSCredential_IRSA_Delete.json new file mode 100644 index 0000000000..ceda0d303b --- /dev/null +++ b/typespec/UCP/examples/2023-10-01-preview/AWSCredential_IRSA_Delete.json @@ -0,0 +1,14 @@ +{ + "operationId": "AwsCredentials_Delete", + "title": "Delete an AWS IRSA credential", + "parameters": { + "api-version": "2023-10-01-preview", + "planeType": "aws", + "planeName": "awscloud", + "credentialName": "default" + }, + "responses": { + "200": {}, + "204": {} + } +} \ No newline at end of file diff --git a/typespec/UCP/examples/2023-10-01-preview/AWSCredential_IRSA_Get.json b/typespec/UCP/examples/2023-10-01-preview/AWSCredential_IRSA_Get.json new file mode 100644 index 0000000000..adf56c6949 --- /dev/null +++ b/typespec/UCP/examples/2023-10-01-preview/AWSCredential_IRSA_Get.json @@ -0,0 +1,28 @@ +{ + "operationId": "AwsCredentials_Get", + "title": "Get an AWS IRSA credential", + "parameters": { + "api-version": "2023-10-01-preview", + "planeType": "aws", + "planeName": "awscloud", + "credentialName": "default" + }, + "responses": { + "200": { + "body": { + "id": "/planes/AWS/aws/providers/System.AWS/credentials/default", + "name": "default", + "type": "System.AWS/credentials", + "location": "us-west-2", + "properties": { + "kind": "IRSA", + "roleArn": "enterRoleARN", + "storage": { + "kind": "Internal", + "secretName": "aws-awscloud-default" + } + } + } + } + } +} \ No newline at end of file diff --git a/typespec/UCP/examples/2023-10-01-preview/AWSCredential_IRSA_List.json b/typespec/UCP/examples/2023-10-01-preview/AWSCredential_IRSA_List.json new file mode 100644 index 0000000000..da727860c8 --- /dev/null +++ b/typespec/UCP/examples/2023-10-01-preview/AWSCredential_IRSA_List.json @@ -0,0 +1,31 @@ +{ + "operationId": "AwsCredentials_List", + "title": "List AWS IRSA credentials", + "parameters": { + "api-version": "2023-10-01-preview", + "planeType": "aws", + "planeName": "awscloud" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/AWS/aws/providers/System.AWS/credentials/default", + "name": "default", + "type": "System.AWS/credentials", + "location": "us-west-2", + "properties": { + "kind": "IRSA", + "roleArn": "enterRoleARN", + "storage": { + "kind": "Internal", + "secretName": "aws-awscloud-default" + } + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/typespec/UCP/examples/2023-10-01-preview/AWSCredential_IRSA_Update.json b/typespec/UCP/examples/2023-10-01-preview/AWSCredential_IRSA_Update.json new file mode 100644 index 0000000000..be972e445f --- /dev/null +++ b/typespec/UCP/examples/2023-10-01-preview/AWSCredential_IRSA_Update.json @@ -0,0 +1,54 @@ +{ + "operationId": "AwsCredentials_Update", + "title": "Update an AWS IRSA credential", + "parameters": { + "api-version": "2023-10-01-preview", + "planeType": "aws", + "planeName": "aws", + "credentialName": "default", + "Credential": { + "location": "us-west-2", + "properties": { + "kind": "IRSA", + "roleArn": "enterRoleARN", + "storage": { + "kind": "Internal" + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/AWS/aws/providers/System.AWS/credentials/default", + "name": "default", + "type": "System.AWS/credentials", + "location": "us-west-2", + "properties": { + "kind": "IRSA", + "roleArn": "enterRoleARN", + "storage": { + "kind": "Internal", + "secretName": "aws-awscloud-default" + } + } + } + }, + "201": { + "body": { + "id": "/planes/AWS/aws/providers/System.AWS/credentials/default", + "name": "default", + "type": "System.AWS/credentials", + "location": "us-west-2", + "properties": { + "kind": "AccessKey", + "roleArn": "enterRoleARN", + "storage": { + "kind": "Internal", + "secretName": "aws-awscloud-default" + } + } + } + } + } +} \ No newline at end of file